Valgrind-checked early application start

This commit is contained in:
Petr Mrázek 2013-10-28 21:50:58 +01:00
parent 6ecb833dbf
commit 7df667f823
4 changed files with 13 additions and 28 deletions

View File

@ -351,20 +351,24 @@ std::shared_ptr<JavaVersionList> MultiMC::javalist()
return m_javalist;
}
int main_gui(MultiMC & app)
{
// show main window
MainWindow mainWin;
mainWin.show();
mainWin.checkSetDefaultJava();
return app.exec();
}
int main(int argc, char *argv[])
{
// initialize Qt
MultiMC app(argc, argv);
// show main window
MainWindow mainWin;
mainWin.show();
mainWin.checkSetDefaultJava();
switch (app.status())
{
case MultiMC::Initialized:
return app.exec();
return main_gui(app);
case MultiMC::Failed:
return 1;
case MultiMC::Succeeded:

View File

@ -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;
};
/**

View File

@ -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;
}
}

View File

@ -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