Handle incompatible prefs/actions seperately
+8 −6 · 4 files changed
-
actiondb.cc+2 −2 -
main.cc+2 −1 -
main.h+2 −1 -
prefdb.cc+2 −2
@@ -195,7 +195,7 @@ void update_actions() { void ActionDBWatcher::init() { std::string filename = config_dir+"actions"; - for (const char **v = versions; *v; v++) + for (const char **v = actions_versions; *v; v++) if (is_file(filename + *v)) { filename += *v; try { @@ -215,7 +215,7 @@ void ActionDBWatcher::init() { } void ActionDBWatcher::timeout() { - std::string filename = config_dir+"actions"+versions[0]; + std::string filename = config_dir+"actions"+actions_versions[0]; std::string tmp = filename + ".tmp"; try { ofstream ofs(tmp.c_str()); @@ -45,7 +45,8 @@ extern Source<bool> disabled; bool experimental = false; int verbosity = 0; -const char *versions[] = { "-0.4.1", "-0.4.0", "", NULL }; +const char *prefs_versions[] = { "-0.5.5", "-0.4.1", "-0.4.0", "", NULL }; +const char *actions_versions[] = { "-0.4.1", "-0.4.0", "", NULL }; Source<Window> current_app_window(None); std::string config_dir; Win *win = NULL; @@ -23,7 +23,8 @@ bool is_file(std::string filename); bool is_dir(std::string dirname); extern std::string config_dir; -extern const char *versions[]; +extern const char *prefs_versions[]; +extern const char *actions_versions[]; extern int verbosity; extern bool experimental; @@ -134,7 +134,7 @@ template<class Archive> void PrefDB::serialize(Archive & ar, const unsigned int } void PrefDB::timeout() { - std::string filename = config_dir+"preferences"+versions[0]; + std::string filename = config_dir+"preferences"+prefs_versions[0]; std::string tmp = filename + ".tmp"; try { std::ofstream ofs(tmp.c_str()); @@ -208,7 +208,7 @@ public: void PrefDB::init() { std::string filename = config_dir+"preferences"; - for (const char **v = versions; *v; v++) { + for (const char **v = prefs_versions; *v; v++) { if (is_file(filename + *v)) { filename += *v; try {