From 88075d9226213620bc7fed29f07aa1b8d3480144 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 c2d657240..0627aeefd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -228,9 +228,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 += "|"; }