windows powerfail signal: stop indexing only on resume and topdirs change

This commit is contained in:
Jean-Francois Dockes
2019-03-19 14:38:57 +01:00
parent d2b8eb6d80
commit 4d7d1a7965
6 changed files with 80 additions and 39 deletions
+15
View File
@@ -132,6 +132,21 @@ string path_wingettempfilename(TCHAR *pref)
#endif // _WIN32
// Check if path is either non-existing or an empty directory.
bool path_empty(const string& path)
{
if (path_isdir(path)) {
string reason;
std::set<string> entries;
if (!readdir(path, reason, entries) || entries.empty()) {
return true;
}
return false;
} else {
return !path_exists(path);
}
}
string path_defaultrecollconfsubdir()
{
#ifdef _WIN32
+2
View File
@@ -30,6 +30,8 @@ extern void rclutil_init_mt();
/// Sub-directory for default recoll config (e.g: .recoll)
extern std::string path_defaultrecollconfsubdir();
// Check if path is either non-existing or an empty directory.
extern bool path_empty(const std::string& path);
/// e.g. /usr/share/recoll. Depends on OS and config
extern const std::string& path_pkgdatadir();