GUI tools for setting up indexing schedule, initial implementation done

This commit is contained in:
Jean-Francois Dockes
2011-12-07 13:41:05 +01:00
parent b9c64e8591
commit 07226fa306
17 changed files with 438 additions and 29 deletions
+17 -9
View File
@@ -100,6 +100,14 @@ void RclConfig::zeroMe() {
m_rmtstate.init(this, 0, "indexedmimetypes");
}
bool RclConfig::isDefaultConfig()
{
string defaultconf = path_cat(path_canon(path_home()), ".recoll/");
string specifiedconf = path_canon(m_confdir);
path_catslash(specifiedconf);
return !defaultconf.compare(specifiedconf);
}
RclConfig::RclConfig(const string *argcnf)
{
zeroMe();
@@ -130,18 +138,18 @@ RclConfig::RclConfig(const string *argcnf)
m_confdir = cp;
} else {
autoconfdir = true;
m_confdir = path_home();
m_confdir += ".recoll/";
m_confdir = path_cat(path_home(), ".recoll/");
}
}
if (!autoconfdir) {
// We want a recoll.conf file to exist in this case to avoid
// creating indexes all over the place
string conffile = path_cat(m_confdir, "recoll.conf");
if (access(conffile.c_str(), 0) < 0) {
m_reason = "Explicitly specified configuration directory must exist"
" (won't be automatically created)";
// Note: autoconfdir and isDefaultConfig() are normally the same. We just
// want to avoid the imperfect test in isDefaultConfig() if we actually know
// this is the default conf
if (!autoconfdir && !isDefaultConfig()) {
if (access(m_confdir.c_str(), 0) < 0) {
m_reason = "Explicitly specified configuration "
"directory must exist"
" (won't be automatically created). Use mkdir first";
return;
}
}
+6 -1
View File
@@ -83,8 +83,13 @@ class RclConfig {
bool ok() {return m_ok;}
const string &getReason() {return m_reason;}
/** Return the directory where this configuration is stored */
/** Return the directory where this configuration is stored.
* This was possibly silently created by the rclconfig
* constructor it it is the default one (~/.recoll) and it did
* not exist yet. */
string getConfDir() {return m_confdir;}
/** Returns true if this is ~/.recoll */
bool isDefaultConfig();
/** Get the local value for /usr/local/share/recoll/ */
const string& getDatadir() {return m_datadir;}