← easystroke

Handle incompatible prefs/actions seperately

829ab2fcc7b2eac5f5c7b77ab07cab08788984c0 · Thomas Jaeger · Aug 9, 2011 22:13

+8 −6 · 4 files changed

  • actiondb.cc +2 −2
  • main.cc +2 −1
  • main.h +2 −1
  • prefdb.cc +2 −2
diff --git a/actiondb.cc b/actiondb.cc
index 7637499..236d580 100644
--- a/actiondb.cc
+++ b/actiondb.cc
@@ -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());
diff --git a/main.cc b/main.cc
index 8b820d8..0adab57 100644
--- a/main.cc
+++ b/main.cc
@@ -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;
diff --git a/main.h b/main.h
index 4cb12d4..8fe688b 100644
--- a/main.h
+++ b/main.h
@@ -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;
 
diff --git a/prefdb.cc b/prefdb.cc
index 7f463b6..358d405 100644
--- a/prefdb.cc
+++ b/prefdb.cc
@@ -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 {