From 7661e0bc236d8a5ab5a82070dc53eb9ec68aa0a1 Mon Sep 17 00:00:00 2001 From: Philip Rinn Date: Thu, 26 Aug 2010 14:33:10 +0200 Subject: [PATCH] Move the cache directory automatically to the new location (on non-Win) --- rtgui/main.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rtgui/main.cc b/rtgui/main.cc index 1c9fb21e1..48c112f19 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -35,6 +35,8 @@ #ifndef WIN32 #include #include +#include +#include #endif #include @@ -93,6 +95,12 @@ int main(int argc, char **argv) Options::load (); +#ifndef _WIN32 + // Move the old path to the new one if the new does not exist + if (Glib::file_test(Glib::build_filename(options.rtdir,"cache"), Glib::FILE_TEST_IS_DIR) && !Glib::file_test(options.cacheBaseDir, Glib::FILE_TEST_IS_DIR)) + ::g_rename(Glib::build_filename(options.rtdir,"cache").c_str(), options.cacheBaseDir.c_str()); +#endif + // Gtk::RC::add_default_file (argv0+"/themes/"+options.theme); std::vector rcfiles; rcfiles.push_back (argv0+"/themes/"+options.theme);