aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.cpp5
-rw-r--r--qt-ui/mainwindow.cpp6
2 files changed, 9 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index a6e39ec53..f12d293d6 100644
--- a/main.cpp
+++ b/main.cpp
@@ -52,9 +52,10 @@ int main(int argc, char **argv)
}
}
if (no_filenames) {
- files.push_back( QString(prefs.default_filename) );
+ QString defaultFile(prefs.default_filename);
+ if (!defaultFile.isEmpty())
+ files.push_back( QString(prefs.default_filename) );
}
-
parse_xml_exit();
subsurface_command_line_exit(&argc, &argv);
mainWindow()->loadFiles(files);
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 9a26404e2..eda19164d 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -748,6 +748,9 @@ void MainWindow::setTitle(enum MainWindowTitleFormat format)
void MainWindow::importFiles(const QStringList fileNames)
{
+ if (fileNames.isEmpty())
+ return;
+
QByteArray fileNamePtr;
char *error = NULL;
for (int i = 0; i < fileNames.size(); ++i) {
@@ -771,6 +774,9 @@ void MainWindow::importFiles(const QStringList fileNames)
void MainWindow::loadFiles(const QStringList fileNames)
{
+ if (fileNames.isEmpty())
+ return;
+
char *error = NULL;
QByteArray fileNamePtr;