summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-01 09:37:47 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-01 09:37:47 -0800
commitdcce7358ff982f01764a7f373a531092e868ca81 (patch)
treea4ec1669e4670a6f19a011e010faf86a8e2cd91b
parentda2da116b5797371f79d525df1bbc06ef895a7af (diff)
downloadsubsurface-dcce7358ff982f01764a7f373a531092e868ca81.tar.gz
QML-UI: make sure errors make it to the log
get_error_message() clears the error message in the process, so calling it twice in a row does not do what you might think it does. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-mobile/qmlmanager.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index 8a0efd764..bf7920e58 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -108,13 +108,15 @@ void QMLManager::loadDives()
int error = parse_file(fileNamePrt.data());
if (!error) {
report_error("filename is now %s", fileNamePrt.data());
- qmlUiShowMessage(get_error_string());
- appendTextToLog(get_error_string());
+ const char *error_string = get_error_string();
+ qmlUiShowMessage(error_string);
+ appendTextToLog(error_string);
set_filename(fileNamePrt.data(), true);
- appendTextToLog(fileNamePrt.data());
} else {
- qmlUiShowMessage(get_error_string());
- appendTextToLog(get_error_string());
+ report_error("failed to open file %s", fileNamePrt.data());
+ const char *error_string = get_error_string();
+ qmlUiShowMessage(error_string);
+ appendTextToLog(error_string);
}
process_dives(false, false);