bugfix: starting without arguments caused a warning

brodykenrick-master
Marius Kintel 2013-10-22 19:39:51 -04:00
parent 178309f357
commit 1fd3bec4fe
1 changed files with 2 additions and 2 deletions

View File

@ -516,11 +516,11 @@ int gui(vector<string> &inputFiles, const fs::path &original_path, int argc, cha
if (!inputFiles.size()) inputFiles.push_back("");
#ifdef ENABLE_MDI
BOOST_FOREACH(const string &infile, inputFiles) {
new MainWindow(QString::fromLocal8Bit(boosty::stringy(original_path / infile).c_str()));
new MainWindow(QString::fromLocal8Bit(infile.empty() ? infile.c_str() : boosty::stringy(original_path / infile).c_str()));
}
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
#else
MainWindow *m = new MainWindow(QString::fromLocal8Bit(boosty::stringy(original_path / inputFiles[0]).c_str()));
MainWindow *m = new MainWindow(QString::fromLocal8Bit(inputFiles[0].empty() ? inputFiles[0].c_str() : boosty::stringy(original_path / inputFiles[0]).c_str()));
app.connect(m, SIGNAL(destroyed()), &app, SLOT(quit()));
#endif
return app.exec();