Browse Source

Fix processing of arguments including spaces

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
a1a9f8bc7e
  1. 2
      src/GUI.cpp
  2. 3
      src/main.cpp

2
src/GUI.cpp

@ -718,7 +718,7 @@ void GUI::on_actionOpen_triggered() { @@ -718,7 +718,7 @@ void GUI::on_actionOpen_triggered() {
// the right addTorrent function, considering
// the parameter type.
void GUI::processParams(const QString& params_str) {
processParams(params_str.split(" ", QString::SkipEmptyParts));
processParams(params_str.split("|", QString::SkipEmptyParts));
}
void GUI::processParams(const QStringList& params) {

3
src/main.cpp

@ -192,10 +192,11 @@ int main(int argc, char *argv[]){ @@ -192,10 +192,11 @@ int main(int argc, char *argv[]){
if(p.startsWith("--")) continue;
message += argv[a];
if (a < argc-1)
message += " ";
message += "|";
}
if(!message.isEmpty()) {
qDebug("Passing program parameters to running instance...");
qDebug("Message: %s", qPrintable(message));
app->sendMessage(message);
}
return 0;

Loading…
Cancel
Save