summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-10-04 12:12:46 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-10-04 12:12:46 -0300
commit7bd43bfaaf5fb444ea766aa90498de3f3b75aaaf (patch)
tree5d36580332b3364f9d9d2532ed8a97cfefcc6750 /main.cpp
parent6ae6c768f30d2d377292f0ea3ff050dfd7cb52ca (diff)
downloadsubsurface-7bd43bfaaf5fb444ea766aa90498de3f3b75aaaf.tar.gz
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 <tcanabrava@kde.org> Signed-off-by: Taiane Ramos <exhora.tat@gmail.com>
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp5
1 files changed, 3 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);