Browse Source

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.
adaptive-webui-19844
Gabriele 10 years ago
parent
commit
05929b78c6
  1. 5
      src/main.cpp

5
src/main.cpp

@ -232,8 +232,13 @@ int main(int argc, char *argv[]) { @@ -232,8 +232,13 @@ 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;
torrentPath.setFile(torrentCmdLine[a]);
if (torrentPath.exists())
message += torrentPath.absoluteFilePath();
else
message += torrentCmdLine[a];
if (a < argc-1)
message += "|";

Loading…
Cancel
Save