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 --- main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'main.cpp') 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); -- cgit v1.2.3-70-g09d2