Move the cache directory automatically to the new location (on non-Win)
This commit is contained in:
@@ -35,6 +35,8 @@
|
|||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <glibmm/fileutils.h>
|
#include <glibmm/fileutils.h>
|
||||||
|
#include <glib.h>
|
||||||
|
#include <glib/gstdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <safegtk.h>
|
#include <safegtk.h>
|
||||||
@@ -93,6 +95,12 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
Options::load ();
|
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);
|
// Gtk::RC::add_default_file (argv0+"/themes/"+options.theme);
|
||||||
std::vector<std::string> rcfiles;
|
std::vector<std::string> rcfiles;
|
||||||
rcfiles.push_back (argv0+"/themes/"+options.theme);
|
rcfiles.push_back (argv0+"/themes/"+options.theme);
|
||||||
|
Reference in New Issue
Block a user