[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenetwork/knewsticker
From:       Frerich Raabe <raabe () kde ! org>
Date:       2003-09-08 19:20:25
[Download RAW message or body]

CVS commit by raabe: 

- When checking of emptyness, use, well, isEmpty()


  M +2 -2      knewsticker.cpp   1.160
  M +7 -7      newsscroller.cpp   1.96


--- kdenetwork/knewsticker/knewsticker.cpp  #1.159:1.160
@@ -204,10 +204,10 @@ void KNewsTicker::slotNewsSourceUpdated(
                       << endl;
 
-        if (m_pendingNewsUpdates.count())
+        if (!m_pendingNewsUpdates.isEmpty())
                 return;
 
         m_updateTimer->stop();
 
-        if (m_failedNewsUpdates.count())
+        if (!m_failedNewsUpdates.isEmpty())
                 slotNotifyOfFailures();
 

--- kdenetwork/knewsticker/newsscroller.cpp  #1.95:1.96
@@ -364,5 +364,5 @@ void NewsScroller::drawContents(QPainter
 {
         if (!scrollWidth() || // No news and no "No News Available": uninitialized
-            !m_headlines.count()) // Happens when we're currently fetching new news
+            m_headlines.isEmpty()) // Happens when we're currently fetching new news
                 return;
 
@@ -374,16 +374,16 @@ void NewsScroller::drawContents(QPainter
         if (horizontal()) {
                 while (pos > 0)
-                        pos -= scrollWidth() - (m_headlines.count() ? 0 : \
m_separator.width()); +                        pos -= scrollWidth() - \
(m_headlines.isEmpty() ? m_separator.width() : 0);  do {
                         bitBlt(&buffer, pos, (contentsRect().height() - \
m_separator.height()) / 2, &m_separator);  pos += m_separator.width();
-                } while (!m_headlines.count() && pos < contentsRect().width());
+                } while (m_headlines.isEmpty() && pos < contentsRect().width());
         } else {
                 while (pos > 0)
-                        pos -= scrollHeight() - (m_headlines.count() ? \
m_separator.height() : 0); +                        pos -= scrollHeight() - \
(m_headlines.isEmpty() ? 0 : m_separator.height());  do {
                         bitBlt(&buffer, (contentsRect().width() - \
m_separator.width()) / 2, pos, &m_separator);  pos += m_separator.height();
-                } while (!m_headlines.count() && pos < contentsRect().height());
+                } while (m_headlines.isEmpty() && pos < contentsRect().height());
         }
         
@@ -437,5 +437,5 @@ void NewsScroller::reset(bool bSeparator
                 m_scrollTimer->start(speedAsInterval(m_cfg->scrollingSpeed()));
         
-        QString sep = m_headlines.count() ? QString::fromLatin1(" +++ ") : i18n(" \
+++ No News Available +++"); +        QString sep = m_headlines.isEmpty() ? i18n(" \
+++ No News Available +++") : QString::fromLatin1(" +++ ");  
         int w = fontMetrics().width(sep);
@@ -514,5 +514,5 @@ bool NewsScroller::updateActive(const QP
         Headline *headline = 0;
                 
-        if (m_headlines.count()) {
+        if (!m_headlines.isEmpty()) {
                 while (pos > 0)
                         if (horizontal())


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic