mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Merge pull request #145 from sledgehammer999/fix_encoding_problem
Fix command-line encoding problem on Windows (closes #139)
This commit is contained in:
commit
3bc85c29ae
1 changed files with 5 additions and 4 deletions
|
@ -179,12 +179,13 @@ int main(int argc, char *argv[]) {
|
||||||
// Check if qBittorrent is already running for this user
|
// Check if qBittorrent is already running for this user
|
||||||
if (app.isRunning()) {
|
if (app.isRunning()) {
|
||||||
qDebug("qBittorrent is already running for this user.");
|
qDebug("qBittorrent is already running for this user.");
|
||||||
|
// Read torrents given on command line
|
||||||
|
QStringList torrentCmdLine = app.arguments();
|
||||||
//Pass program parameters if any
|
//Pass program parameters if any
|
||||||
QString message;
|
QString message;
|
||||||
for (int a = 1; a < argc; ++a) {
|
for (int a = 1; a < torrentCmdLine.size(); ++a) {
|
||||||
QString p = QString::fromLocal8Bit(argv[a]);
|
if (torrentCmdLine[a].startsWith("--")) continue;
|
||||||
if (p.startsWith("--")) continue;
|
message += torrentCmdLine[a];
|
||||||
message += p;
|
|
||||||
if (a < argc-1)
|
if (a < argc-1)
|
||||||
message += "|";
|
message += "|";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue