windows powerfail signal: stop indexing only on resume and topdirs change
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user