aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/filetransferwindow/libkvifiletransferwindow.cpp
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2016-04-22 16:33:54 +0200
committerGravatar Szymon Tomasz Stefanek2016-04-22 16:34:00 +0200
commit1cf063fdc7c47b6325c61c6531dc4aecc0c5e60f (patch)
tree27ba6e8bbf7f9fecc03615b61600f2a24c05b07d /src/modules/filetransferwindow/libkvifiletransferwindow.cpp
parentFix classes tree creation in class editor (diff)
downloadKVIrc-1cf063fdc7c47b6325c61c6531dc4aecc0c5e60f.tar.gz
KVIrc-1cf063fdc7c47b6325c61c6531dc4aecc0c5e60f.tar.bz2
KVIrc-1cf063fdc7c47b6325c61c6531dc4aecc0c5e60f.zip
Add a 'clear' command to the filetransferwindow module
Diffstat (limited to 'src/modules/filetransferwindow/libkvifiletransferwindow.cpp')
-rw-r--r--src/modules/filetransferwindow/libkvifiletransferwindow.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/modules/filetransferwindow/libkvifiletransferwindow.cpp b/src/modules/filetransferwindow/libkvifiletransferwindow.cpp
index 8e7aa83a4..8bea5bd1a 100644
--- a/src/modules/filetransferwindow/libkvifiletransferwindow.cpp
+++ b/src/modules/filetransferwindow/libkvifiletransferwindow.cpp
@@ -74,9 +74,40 @@ static bool filetransferwindow_kvs_cmd_open(KviKvsModuleCommandCall * c)
return true;
}
+/*
+ @doc: filetransferwindow.clear
+ @type:
+ command
+ @title:
+ filetransferwindow.clear
+ @short:
+ Clears the list of transfers
+ @syntax:
+ filetransferwindow.clear [-a]
+ @switches:
+ !sw: -a | --all
+ Clears all the transfers, including the running ones!
+ @description:
+ Clears the transfers. Without the -a switch only the terminated
+ transfers are cleared. With -a all the transfers are terminated (including the running ones).
+*/
+
+static bool filetransferwindow_kvs_cmd_clear(KviKvsModuleCommandCall * c)
+{
+
+ if(c->hasSwitch('a',QString::fromLatin1("all")))
+ KviFileTransferManager::instance()->killAllTransfers();
+ else
+ KviFileTransferManager::instance()->killTerminatedTransfers();
+
+ return true;
+}
+
+
static bool filetransferwindow_module_init(KviModule * m)
{
KVSM_REGISTER_SIMPLE_COMMAND(m,"open",filetransferwindow_kvs_cmd_open);
+ KVSM_REGISTER_SIMPLE_COMMAND(m,"clear",filetransferwindow_kvs_cmd_clear);
return true;
}