1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-05 11:24:15 +00:00

Merge pull request #145 from sledgehammer999/fix_encoding_problem

Fix command-line encoding problem on Windows (closes #139)
This commit is contained in:
Christophe Dumez 2012-10-06 22:55:33 -07:00
commit 3bc85c29ae

View File

@ -179,12 +179,13 @@ int main(int argc, char *argv[]) {
// Check if qBittorrent is already running for this user
if (app.isRunning()) {
qDebug("qBittorrent is already running for this user.");
// Read torrents given on command line
QStringList torrentCmdLine = app.arguments();
//Pass program parameters if any
QString message;
for (int a = 1; a < argc; ++a) {
QString p = QString::fromLocal8Bit(argv[a]);
if (p.startsWith("--")) continue;
message += p;
for (int a = 1; a < torrentCmdLine.size(); ++a) {
if (torrentCmdLine[a].startsWith("--")) continue;
message += torrentCmdLine[a];
if (a < argc-1)
message += "|";
}