Double fallback implemented (see #4396)

If the user's default profile is not found, it'll fallback to the
bundled one. If this one is not found, it'll fall back to internal
values. No restart required. Only the GUI alert are localized.
This commit is contained in:
Hombre
2018-02-24 14:02:50 +01:00
parent ff021826c6
commit b430ca19a6
6 changed files with 149 additions and 62 deletions

View File

@@ -90,8 +90,13 @@ public:
};
private:
bool defProfRawMissing;
bool defProfImgMissing;
enum class DefProfError : short {
defProfRawMissing = 1 << 0,
bundledDefProfRawMissing = 1 << 1,
defProfImgMissing = 1 << 2,
bundledDefProfImgMissing = 1 << 3
};
short defProfError;
Glib::ustring userProfilePath;
Glib::ustring globalProfilePath;
bool checkProfilePath (Glib::ustring &path);
@@ -344,9 +349,9 @@ public:
Options ();
Options* copyFrom (Options* other);
void filterOutParsedExtensions ();
void setDefaults ();
Options* copyFrom (Options* other);
void filterOutParsedExtensions ();
void setDefaults ();
void readFromFile (Glib::ustring fname);
void saveToFile (Glib::ustring fname);
static void load (bool lightweight = false);
@@ -354,34 +359,20 @@ public:
// if multiUser=false, send back the global profile path
Glib::ustring getPreferredProfilePath();
Glib::ustring getUserProfilePath()
{
return userProfilePath;
}
Glib::ustring getGlobalProfilePath()
{
return globalProfilePath;
}
Glib::ustring getUserProfilePath();
Glib::ustring getGlobalProfilePath();
Glib::ustring findProfilePath (Glib::ustring &profName);
bool is_parse_extention (Glib::ustring fname);
bool has_retained_extention (Glib::ustring fname);
bool is_extention_enabled (Glib::ustring ext);
bool is_defProfRawMissing()
{
return defProfRawMissing;
}
bool is_defProfImgMissing()
{
return defProfImgMissing;
}
void setDefProfRawMissing (bool value)
{
defProfRawMissing = value;
}
void setDefProfImgMissing (bool value)
{
defProfImgMissing = value;
}
bool is_parse_extention (Glib::ustring fname);
bool has_retained_extention (Glib::ustring fname);
bool is_extention_enabled (Glib::ustring ext);
bool is_defProfRawMissing();
bool is_bundledDefProfRawMissing();
bool is_defProfImgMissing();
bool is_bundledDefProfImgMissing();
void setDefProfRawMissing (bool value);
void setBundledDefProfRawMissing (bool value);
void setDefProfImgMissing (bool value);
void setBundledDefProfImgMissing (bool value);
};
extern Options options;