mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
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.
This commit is contained in:
parent
d27bff4df4
commit
05929b78c6
1 changed files with 6 additions and 1 deletions
|
@ -232,9 +232,14 @@ int main(int argc, char *argv[]) {
|
||||||
QStringList torrentCmdLine = app.arguments();
|
QStringList torrentCmdLine = app.arguments();
|
||||||
//Pass program parameters if any
|
//Pass program parameters if any
|
||||||
QString message;
|
QString message;
|
||||||
|
QFileInfo torrentPath;
|
||||||
for (int a = 1; a < torrentCmdLine.size(); ++a) {
|
for (int a = 1; a < torrentCmdLine.size(); ++a) {
|
||||||
if (torrentCmdLine[a].startsWith("--")) continue;
|
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)
|
if (a < argc-1)
|
||||||
message += "|";
|
message += "|";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue