GH-2238 fix issues with whitespace/newlines in folder and instance names
This commit is contained in:
parent
d5037d4f79
commit
59e2f52db7
@ -244,7 +244,7 @@ QString BaseInstance::name() const
|
|||||||
|
|
||||||
QString BaseInstance::windowTitle() const
|
QString BaseInstance::windowTitle() const
|
||||||
{
|
{
|
||||||
return "MultiMC: " + name();
|
return "MultiMC: " + name().replace(QRegExp("[ \n\r\t]+"), " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: why is this here? move it to MinecraftInstance!!!
|
// FIXME: why is this here? move it to MinecraftInstance!!!
|
||||||
|
@ -294,7 +294,7 @@ QString NormalizePath(QString path)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString badFilenameChars = "\"\\/?<>:*|!+";
|
QString badFilenameChars = "\"\\/?<>:*|!+\r\n";
|
||||||
|
|
||||||
QString RemoveInvalidFilenameChars(QString string, QChar replaceWith)
|
QString RemoveInvalidFilenameChars(QString string, QChar replaceWith)
|
||||||
{
|
{
|
||||||
|
@ -52,11 +52,11 @@ public class EntryPoint
|
|||||||
else if (pair[0].equals("abort"))
|
else if (pair[0].equals("abort"))
|
||||||
return Action.Abort;
|
return Action.Abort;
|
||||||
|
|
||||||
else throw new ParseException();
|
else throw new ParseException("Error while parsing:" + pair[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pair.length != 2)
|
if(pair.length != 2)
|
||||||
throw new ParseException();
|
throw new ParseException("Pair length is not 2.");
|
||||||
|
|
||||||
String command = pair[0];
|
String command = pair[0];
|
||||||
String param = pair[1];
|
String param = pair[1];
|
||||||
@ -71,7 +71,7 @@ public class EntryPoint
|
|||||||
return Action.Proceed;
|
return Action.Proceed;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw new ParseException();
|
throw new ParseException("Invalid launcher type: " + param);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_params.add(command, param);
|
m_params.add(command, param);
|
||||||
|
@ -18,5 +18,8 @@ package org.multimc;
|
|||||||
|
|
||||||
public class ParseException extends java.lang.Exception
|
public class ParseException extends java.lang.Exception
|
||||||
{
|
{
|
||||||
|
public ParseException() { super(); }
|
||||||
|
public ParseException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user