summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MultiMC.cpp14
-rw-r--r--depends/util/include/cmdutils.h8
-rw-r--r--depends/util/src/cmdutils.cpp15
-rw-r--r--gui/settingsdialog.cpp2
4 files changed, 12 insertions, 27 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp
index 56109ba6..4e2a5b0b 100644
--- a/MultiMC.cpp
+++ b/MultiMC.cpp
@@ -351,20 +351,24 @@ std::shared_ptr<JavaVersionList> MultiMC::javalist()
return m_javalist;
}
-int main(int argc, char *argv[])
+int main_gui(MultiMC & app)
{
- // initialize Qt
- MultiMC app(argc, argv);
-
// show main window
MainWindow mainWin;
mainWin.show();
mainWin.checkSetDefaultJava();
+ return app.exec();
+}
+
+int main(int argc, char *argv[])
+{
+ // initialize Qt
+ MultiMC app(argc, argv);
switch (app.status())
{
case MultiMC::Initialized:
- return app.exec();
+ return main_gui(app);
case MultiMC::Failed:
return 1;
case MultiMC::Succeeded:
diff --git a/depends/util/include/cmdutils.h b/depends/util/include/cmdutils.h
index 93fef9ff..b8582195 100644
--- a/depends/util/include/cmdutils.h
+++ b/depends/util/include/cmdutils.h
@@ -83,16 +83,10 @@ enum Enum
/**
* @brief The ParsingError class
*/
-class LIBUTIL_EXPORT ParsingError : public std::exception
+class LIBUTIL_EXPORT ParsingError : public std::runtime_error
{
public:
ParsingError(const QString &what);
- ParsingError(const ParsingError &e);
- ~ParsingError() throw() {}
- const char *what() const throw();
- QString qwhat() const;
-private:
- QString m_what;
};
/**
diff --git a/depends/util/src/cmdutils.cpp b/depends/util/src/cmdutils.cpp
index 80ba719d..b9cab717 100644
--- a/depends/util/src/cmdutils.cpp
+++ b/depends/util/src/cmdutils.cpp
@@ -463,21 +463,8 @@ void Parser::getPrefix(QString &opt, QString &flag)
// ParsingError
ParsingError::ParsingError(const QString &what)
+:std::runtime_error(what.toStdString())
{
- m_what = what;
-}
-ParsingError::ParsingError(const ParsingError &e)
-{
- m_what = e.m_what;
-}
-
-const char *ParsingError::what() const throw()
-{
- return m_what.toLocal8Bit().constData();
-}
-QString ParsingError::qwhat() const
-{
- return m_what;
}
}
diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp
index b2fbd898..fb204d10 100644
--- a/gui/settingsdialog.cpp
+++ b/gui/settingsdialog.cpp
@@ -55,7 +55,7 @@ void SettingsDialog::updateCheckboxStuff()
void SettingsDialog::on_instDirBrowseBtn_clicked()
{
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Instance Directory"),
- ui->instDirTextBox->text());
+ ui->instDirTextBox->text());
QString cooked_dir = NormalizePath(raw_dir);
// do not allow current dir - it's dirty. Do not allow dirs that don't exist