diff options
author | Petr Mrázek <peterix@users.noreply.github.com> | 2020-05-29 01:55:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-29 01:55:27 +0200 |
commit | c4779e5a35a79c028bd6b66822552a8c30cd5883 (patch) | |
tree | e0b7058db542801c0d4695720c607e0149f9b5d2 | |
parent | aad34f3679fa329afd1f3133681ef602a2e57a30 (diff) | |
parent | bbcacec6eca70fefcb6c7a3249586a8c7b2fb634 (diff) | |
download | PrismLauncher-c4779e5a35a79c028bd6b66822552a8c30cd5883.tar.gz PrismLauncher-c4779e5a35a79c028bd6b66822552a8c30cd5883.tar.bz2 PrismLauncher-c4779e5a35a79c028bd6b66822552a8c30cd5883.zip |
Merge pull request #3127 from OverMighty/develop
fix: add support for args with spaces to MultiMC::messageReceived()
-rw-r--r-- | application/MultiMC.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp index 53044c51..a8d26498 100644 --- a/application/MultiMC.cpp +++ b/application/MultiMC.cpp @@ -888,8 +888,7 @@ void MultiMC::messageReceived(const QString& message) return; } - QStringList args = message.split(' '); - QString command = args.takeFirst(); + QString command = message.section(' ', 0, 0); if(command == "activate") { @@ -897,21 +896,23 @@ void MultiMC::messageReceived(const QString& message) } else if(command == "import") { - if(args.isEmpty()) + QString arg = message.section(' ', 1); + if(arg.isEmpty()) { qWarning() << "Received" << command << "message without a zip path/URL."; return; } - m_mainWindow->droppedURLs({ QUrl(args.takeFirst()) }); + m_mainWindow->droppedURLs({ QUrl(arg) }); } else if(command == "launch") { - if(args.isEmpty()) + QString arg = message.section(' ', 1); + if(arg.isEmpty()) { qWarning() << "Received" << command << "message without an instance ID."; return; } - auto inst = instances()->getInstanceById(args.takeFirst()); + auto inst = instances()->getInstanceById(arg); if(inst) { launch(inst, true, nullptr); |