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

List:       kde-commits
Subject:    playground/ioslaves/kio_magnet
From:       Christian Weilbach <christian () whiletaker ! homeip ! net>
Date:       2010-09-15 9:31:46
Message-ID: 20100915093146.B7E4DAC871 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1175564 by weilbach:

Fix maxShareRatio usage and broken slot connection.


 M  +3 -3      ktorrentdbusinterface.cpp  
 M  +4 -0      magnetsettings.kcfg  


--- trunk/playground/ioslaves/kio_magnet/ktorrentdbusinterface.cpp #1175563:1175564
@@ -85,7 +85,7 @@
             return;
         }
         m_process->waitForStarted();
-        QTimer::singleShot(timeout,this,SLOT(initializeDBus()));
+        QTimer::singleShot(timeout,this,SLOT(connectToDBus()));
     } else {
         connectToDBus();
     }
@@ -130,7 +130,7 @@
         org::ktorrent::group groupInt("org.ktorrent.ktorrent", "/group/Web Share", \
bus );  KStandardDirs *dirs = new KStandardDirs();
         groupInt.setDefaultSaveLocation(dirs->saveLocation("data","Web Share"));
-        groupInt.setMaxShareRatio(1.2);
+        groupInt.setMaxShareRatio(MagnetSettings::maxShareRatio());
     }
 
     connect(m_coreInt,SIGNAL(torrentAdded(const \
QString&)),this,SLOT(slotTorrentAdded(const QString&))); @@ -232,7 +232,7 @@
         KTorrentTorrentInterface* torrentInt = new \
org::ktorrent::torrent("org.ktorrent.ktorrent", "/torrent/"+(*it),  \
QDBusConnection::sessionBus());  if (!torrentInt->isValid() || // remove \
                finished/broken torrents
-	    (torrentInt->bytesLeft()==0 && \
torrentInt->shareRatio()==torrentInt->maxShareRatio())) { +	    \
(torrentInt->bytesLeft()==0 && torrentInt->MagnetSettings::maxShareRatio())) {  \
QStringList mt = MagnetSettings::managedTorrents();  mt.removeAll((*it));
             MagnetSettings::setManagedTorrents( mt );
--- trunk/playground/ioslaves/kio_magnet/magnetsettings.kcfg #1175563:1175564
@@ -33,6 +33,10 @@
 	    <entry name="ManagedTorrents" type="StringList">
 		<label>Torrents inside KTorrent which are managed by this modules.</label>
 	    </entry>
+	    <entry name="MaxShareRatio" type="Double">
+		<label>The maximum share ratio which should be targeted for each torrent.</label>
+		<default>1.2</default>
+	    </entry>
 		
 <!--	    <entry name="SplitterSizes" type="IntList">
 		<label>How the main window is divided.</label>


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

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