Bug 141799 - Not able to select anything after automatically adding several torrents.
Summary: Not able to select anything after automatically adding several torrents.
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-16 19:38 UTC by Laurens Vets
Modified: 2007-02-17 14:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurens Vets 2007-02-16 19:38:29 UTC
Version:           2.1 (using KDE KDE 3.5.6)
Installed from:    Unspecified Linux
OS:                Linux

I let ktorrent automatically add .torrent files who appear in a certain folder and ktorrent should add them silently.  After adding several torrents (3+) at once this way, I'm unable to select any menu option or torrent details or anything else in the ktorrent GUI.  Ktorrent works as the torrents which are loaded start downloading, I'm just not able to do anything in ktorrent anymore.
I can only restart ktorrent by killing at as I cannot select the option to quite ktorrent.

If I just add 1 torrent this way, ktorrent is still usable.  If I add multiple, ktorrent isn't usable anymore.

I have reproduced this several times.
Comment 1 Joris Guisson 2007-02-17 13:38:20 UTC
I have a pretty good idea what the problem is
Comment 2 Joris Guisson 2007-02-17 14:24:37 UTC
SVN commit 634509 by guisson:

- NetAccess considered harmfull, so lets not use it anymore in scanfolder plugin, this fixes bug 141799
- In case of loadSilently, if no default save location is set, the home directory of the user is used instead

BUG: 141799



 M  +7 -7      apps/ktorrent/ktorrentcore.cpp  
 M  +3 -4      plugins/scanfolder/scanfolder.cpp  


--- trunk/extragear/network/ktorrent/apps/ktorrent/ktorrentcore.cpp #634508:634509
@@ -329,15 +329,15 @@
 		QString dir = Settings::saveDir();
 		if (!Settings::useSaveDir())
 		{
-			loadingFinished(url,false,false);
+			Out(SYS_GEN|LOG_NOTICE) << "Cannot load " << path << " silently, default save location not set !" << endl;
+			Out(SYS_GEN|LOG_NOTICE) << "Using home directory instead !" << endl;
+			dir = QDir::homeDirPath();
 		}
+	
+		if (dir != QString::null && load(path,dir,true))
+			loadingFinished(url,true,false);
 		else
-		{
-			if (dir != QString::null && load(path,dir,true))
-				loadingFinished(url,true,false);
-			else
-				loadingFinished(url,false,true);
-		}
+			loadingFinished(url,false,true);
 	}
 	else
 	{
--- trunk/extragear/network/ktorrent/plugins/scanfolder/scanfolder.cpp #634508:634509
@@ -22,7 +22,7 @@
 #include <kdirlister.h>
 #include <kfileitem.h>
 #include <klocale.h>
-#include <kio/netaccess.h>
+#include <kio/job.h>
 
 #include <qstring.h>
 #include <qobject.h>
@@ -56,7 +56,6 @@
 		connect(m_dir, SIGNAL(newItems( const KFileItemList& )), this, SLOT(onNewItems( const KFileItemList& )));
 		connect(m_core, SIGNAL(loadingFinished( const KURL&, bool, bool )), this, SLOT(onLoadingFinished( const KURL&, bool, bool )));
 
-// 		Out() << "LOADING SCANFOLDER: " << m_dir->url().path() << endl;
 	}
 
 
@@ -76,7 +75,6 @@
 			QString dirname = m_dir->url().path();
 			QString filename = dirname + "/" + name;
 
-
 			if(!name.endsWith(".torrent"))
 				continue;
 
@@ -144,7 +142,8 @@
 				if(QFile::exists(dirname + "/." + name))
 					QFile::remove(dirname + "/." + name);
 
-				KIO::NetAccess::move(url, destination);
+				// NetAccess considered harmfull !!!
+				KIO::file_move(url, destination);
 				break;
 			case defaultAction:
 				QFile f(dirname + "/." + name);