-Improved preference loading error checking

This commit is contained in:
Harry van Haaren 2013-12-10 13:05:27 +00:00
parent ddd44f3950
commit 5cd23266a0
3 changed files with 4 additions and 2 deletions

View file

@ -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)

View file

@ -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;
}

View file

@ -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
{