From 5cd23266a01c98af1efa8d7a9cbc56611bf96e7d Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Tue, 10 Dec 2013 13:05:27 +0000 Subject: [PATCH] -Improved preference loading error checking --- src/CMakeLists.txt | 2 +- src/diskreader.cxx | 2 ++ src/gui.cxx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 706c812..d4eb7c1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,7 +38,7 @@ ENDIF(BUILD_TESTS) IF(RELEASE_BUILD) SET(CMAKE_CXX_FLAGS "-g -Wall -Werror -Wno-unused-variable -ffast-math") - SET(CMAKE_C_FLAGS "-g -Wall -Werror -W -Wno-unused-variable -ffast-math") + SET(CMAKE_C_FLAGS "-g -Wall -Werror -W -Wno-unused-variable -ffast-math") ENDIF(RELEASE_BUILD) diff --git a/src/diskreader.cxx b/src/diskreader.cxx index 58d07ba..1655e2b 100644 --- a/src/diskreader.cxx +++ b/src/diskreader.cxx @@ -66,6 +66,7 @@ int DiskReader::loadPreferences() cJSON* preferencesJson = cJSON_Parse( sampleString ); if (!preferencesJson) { + LUPPP_WARN("Preferences JSON not valid"); return LUPPP_RETURN_ERROR; } @@ -108,6 +109,7 @@ int DiskReader::loadPreferences() else { // empty file / file no exists: + LUPPP_WARN("Preferences, file doesn't exist: ~/.config/openAV/luppp/luppp.prefs"); return LUPPP_RETURN_ERROR; } diff --git a/src/gui.cxx b/src/gui.cxx index 1e1471f..8f5dc25 100644 --- a/src/gui.cxx +++ b/src/gui.cxx @@ -434,7 +434,7 @@ Gui::Gui(std::string argZero) : int prefs = diskReader->loadPreferences(); if ( prefs != LUPPP_RETURN_OK ) { - LUPPP_ERROR("Error loading preferences"); + LUPPP_WARN("No preferences loaded, using defaults."); } else {