Fixed some formatting.

This commit is contained in:
Andrew 2013-02-25 13:39:07 -06:00
parent 23474da175
commit b56b819c35
3 changed files with 339 additions and 334 deletions

View File

@ -5,13 +5,13 @@
namespace Util namespace Util
{ {
// Get the Directory representing the User's Desktop // Get the Directory representing the User's Desktop
QString getDesktopDir(); QString getDesktopDir();
// Create a shortcut at *location*, pointing to *dest* called with the arguments *args* // Create a shortcut at *location*, pointing to *dest* called with the arguments *args*
// call it *name* and assign it the icon *icon* // call it *name* and assign it the icon *icon*
// return true if operation succeeded // return true if operation succeeded
bool createShortCut(QString location, QString dest, QStringList args, QString name, QString iconLocation); bool createShortCut(QString location, QString dest, QStringList args, QString name, QString iconLocation);
} }
#endif // USERUTILS_H #endif // USERUTILS_H

View File

@ -52,7 +52,7 @@ private:
MinecraftProcess *proc; MinecraftProcess *proc;
ConsoleWindow *console; ConsoleWindow *console;
public: public:
InstanceLauncher(QString instId) : QObject(), instances(settings->getInstanceDir()) InstanceLauncher(QString instId) : QObject(), instances(settings->get("InstanceDir").toString())
{ {
this->instId = instId; this->instId = instId;
} }
@ -172,22 +172,27 @@ int main(int argc, char *argv[])
// parse the arguments // parse the arguments
QHash<QString, QVariant> args; QHash<QString, QVariant> args;
try { try
{
args = parser.parse(app.arguments()); args = parser.parse(app.arguments());
} catch(ParsingError e) { }
catch(ParsingError e)
{
std::cerr << "CommandLineError: " << e.what() << std::endl; std::cerr << "CommandLineError: " << e.what() << std::endl;
std::cerr << "Try '%1 -h' to get help on MultiMC's command line parameters." << std::endl; std::cerr << "Try '%1 -h' to get help on MultiMC's command line parameters." << std::endl;
return 1; return 1;
} }
// display help and exit // display help and exit
if (args["help"].toBool()) { if (args["help"].toBool())
{
std::cout << qPrintable(parser.compileHelp(app.arguments()[0])); std::cout << qPrintable(parser.compileHelp(app.arguments()[0]));
return 0; return 0;
} }
// display version and exit // display version and exit
if (args["version"].toBool()) { if (args["version"].toBool())
{
std::cout << "Version " << VERSION_STR << std::endl; std::cout << "Version " << VERSION_STR << std::endl;
std::cout << "Git " << GIT_COMMIT << std::endl; std::cout << "Git " << GIT_COMMIT << std::endl;
std::cout << "Tag: " << JENKINS_BUILD_TAG << " " << (ARCH==x64?"x86_64":"x86") << std::endl; std::cout << "Tag: " << JENKINS_BUILD_TAG << " " << (ARCH==x64?"x86_64":"x86") << std::endl;