From 7bd43bfaaf5fb444ea766aa90498de3f3b75aaaf Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 4 Oct 2013 12:12:46 -0300 Subject: Fix the first load of Subsurface - "File not found" error. The first time the user loads subsurface, the default_filename is not configured yet, but yet the software tries to load "", sending an error message that this file doesn't exists. Signed-off-by: Tomaz Canabrava Signed-off-by: Taiane Ramos --- qt-ui/mainwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qt-ui/mainwindow.cpp') 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; -- cgit v1.2.3-70-g09d2