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

List:       kde-commits
Subject:    kdenetwork/kget
From:       Rainer Wirtz <rainer.wirtz () gmx ! de>
Date:       2005-02-10 19:58:59
Message-ID: 20050210195859.17AB11D161 () office ! kde ! org
[Download RAW message or body]

CVS commit by ratz: 

Makes automated disconnect take place even when there are delayed transfers in the \
                list. Previous behaviour: Disconnect only when all transfers are \
                finished.
BUG: 97022


  M +2 -2      kmainwidget.cpp   1.109
  M +8 -8      transferlist.cpp   1.28
  M +2 -2      transferlist.h   1.15


--- kdenetwork/kget/kmainwidget.cpp  #1.108:1.109
@@ -1408,6 +1408,6 @@ void KMainWidget::slotStatusChanged(Tran
             item->setMode(Transfer::MD_NONE);
 
-        if (myTransferList->isQueueEmpty()) {
-            // no items in the TransferList or we have donwload all items
+        if (!myTransferList->areTransfersQueuedOrScheduled()) {
+            // no items or only delayed and finished items in the TransferList
             if (ksettings.b_autoDisconnect)
                 onlineDisconnect();

--- kdenetwork/kget/transferlist.cpp  #1.27:1.28
@@ -197,15 +197,15 @@ bool TransferList::updateStatus(int coun
 
 
-bool TransferList::isQueueEmpty()
+bool TransferList::areTransfersQueuedOrScheduled()
 {
     TransferIterator it(this);
 
-    if (childCount() <= 0)
-        return true;
-    else
-        for (; it.current(); ++it)
-            if (it.current()->getMode() == Transfer::MD_NONE)
+    if (childCount() > 0) {
+        for (; it.current(); ++it) {
+            if ((it.current()->getMode() == Transfer::MD_QUEUED)|| \
+                (it.current()->getMode() == Transfer::MD_SCHEDULED))
                 return true;
-
+        }
+    }
     return false;
 }

--- kdenetwork/kget/transferlist.h  #1.14:1.15
@@ -77,5 +77,5 @@ Q_OBJECT public:
     bool updateStatus(int counter);
     Transfer * find(const KURL& _src);
-    bool isQueueEmpty();
+    bool areTransfersQueuedOrScheduled();
 
     void readTransfers(const KURL& file);


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

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