This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Silently start new command line torrent (patch)

Tags: None
(comma "," separated)
caruccio
Registered Member
Posts
5
Karma
0
Hi,

here is a very little patch to add option --silent, so ktorrent won't ask for save dir. I use it to add torrents from a remote host using ssh.

Code: Select all
--- ktorrent-2.2.5/apps/ktorrent/main.cpp       2008-01-27 10:06:10.000000000 -0200
+++ ktorrent-2.2.5/apps/ktorrent/main-silent.cpp        2008-02-01 17:49:36.000000000 -0200
@@ -106,6 +106,7 @@ bool GrabPIDLock()
 static KCmdLineOptions options[] =
 {
        { "debug", I18N_NOOP("Debug mode"), 0 },
+       { "silent",  I18N_NOOP("Silently save torrent given on URL"), 0 },
        { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
        KCmdLineLastOption
 };
--- ktorrent-2.2.5/apps/ktorrent/ktorrentapp.cpp        2008-01-27 10:06:10.000000000 -0200
+++ ktorrent-2.2.5/apps/ktorrent/ktorrentapp-silent.cpp 2008-02-01 17:49:46.000000000 -0200
@@ -66,7 +66,11 @@ int KTorrentApp::newInstance()
 
        for (int i = 0; i < args->count(); i++)
        {
-               widget->load(args->url(i));
+               if (args->isSet("silent"))
+                       widget->loadSilently(args->url(i));
+               else
+                       widget->load(args->url(i));
+
        }
 
        args->clear();


sorry, don't known how to attach files.

Caruccio
George
Moderator
Posts
5421
Karma
1

Sat Feb 02, 2008 11:41 am
Patch looks OK, I'm gonna commit it
George
Moderator
Posts
5421
Karma
1

Sat Feb 02, 2008 12:11 pm
OK it is committed and I have ported it to the KDE4 version


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]