Merge pull request #3127 from OverMighty/develop
fix: add support for args with spaces to MultiMC::messageReceived()
This commit is contained in:
commit
c4779e5a35
@ -888,8 +888,7 @@ void MultiMC::messageReceived(const QString& message)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList args = message.split(' ');
|
QString command = message.section(' ', 0, 0);
|
||||||
QString command = args.takeFirst();
|
|
||||||
|
|
||||||
if(command == "activate")
|
if(command == "activate")
|
||||||
{
|
{
|
||||||
@ -897,21 +896,23 @@ void MultiMC::messageReceived(const QString& message)
|
|||||||
}
|
}
|
||||||
else if(command == "import")
|
else if(command == "import")
|
||||||
{
|
{
|
||||||
if(args.isEmpty())
|
QString arg = message.section(' ', 1);
|
||||||
|
if(arg.isEmpty())
|
||||||
{
|
{
|
||||||
qWarning() << "Received" << command << "message without a zip path/URL.";
|
qWarning() << "Received" << command << "message without a zip path/URL.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_mainWindow->droppedURLs({ QUrl(args.takeFirst()) });
|
m_mainWindow->droppedURLs({ QUrl(arg) });
|
||||||
}
|
}
|
||||||
else if(command == "launch")
|
else if(command == "launch")
|
||||||
{
|
{
|
||||||
if(args.isEmpty())
|
QString arg = message.section(' ', 1);
|
||||||
|
if(arg.isEmpty())
|
||||||
{
|
{
|
||||||
qWarning() << "Received" << command << "message without an instance ID.";
|
qWarning() << "Received" << command << "message without an instance ID.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto inst = instances()->getInstanceById(args.takeFirst());
|
auto inst = instances()->getInstanceById(arg);
|
||||||
if(inst)
|
if(inst)
|
||||||
{
|
{
|
||||||
launch(inst, true, nullptr);
|
launch(inst, true, nullptr);
|
||||||
|
Loading…
Reference in New Issue
Block a user