From 05929b78c632e48c20796403dd6e6775b91813a3 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Wed, 15 Oct 2014 17:36:46 +0100 Subject: [PATCH] Allow relative torrent paths when qBittorrent is already running Adding new torrents from the command line while qBittorrent was already running was possible only providing the absolute path to the file. --- src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 758ab5850..deaab1771 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -232,9 +232,14 @@ int main(int argc, char *argv[]) { QStringList torrentCmdLine = app.arguments(); //Pass program parameters if any QString message; + QFileInfo torrentPath; for (int a = 1; a < torrentCmdLine.size(); ++a) { if (torrentCmdLine[a].startsWith("--")) continue; - message += torrentCmdLine[a]; + torrentPath.setFile(torrentCmdLine[a]); + if (torrentPath.exists()) + message += torrentPath.absoluteFilePath(); + else + message += torrentCmdLine[a]; if (a < argc-1) message += "|"; }