From cdfc0fef7f35a64af6dd0875550d6d597fe480d4 Mon Sep 17 00:00:00 2001 From: Alexander Kerner Date: Sun, 15 Jun 2008 16:05:29 +0200 Subject: [PATCH] config files on sd-card --- zlibrary/core/src/unix/xmlconfig/XMLConfigIO.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/zlibrary/core/src/unix/xmlconfig/XMLConfigIO.cpp b/zlibrary/core/src/unix/xmlconfig/XMLConfigIO.cpp index f790e72..4534888 100644 --- a/zlibrary/core/src/unix/xmlconfig/XMLConfigIO.cpp +++ b/zlibrary/core/src/unix/xmlconfig/XMLConfigIO.cpp @@ -17,6 +17,9 @@ * 02110-1301, USA. */ +#include +#include + #include #include #include @@ -34,11 +37,23 @@ const std::string XMLConfig::UNKNOWN_CATEGORY = ".unknown."; static const std::string CHANGES_FILE = "config.changes"; std::string XMLConfig::configDirName() const { -#ifdef XMLCONFIGHOMEDIR +/*#ifdef XMLCONFIGHOMEDIR const std::string home = XMLCONFIGHOMEDIR; #else const std::string home = "~"; #endif +*/ + int c = -1, nc = -1; + std::string home; + + c = access("/mnt/.FBReader", F_OK); + nc = access("/home/.FBReader/nocard", F_OK); + + if((c != -1) && (nc == -1)) + home = "/mnt"; + else + home = "/home"; + return home + ZLibrary::FileNameDelimiter + "." + ZLibrary::ApplicationName(); } -- 2.11.4.GIT