Tracker: Delete temporary/transient queries only in ~/queries.

Otherwise we would delete them even if they'd been copied somewhere
else on the filesystem, which sounds like a terrible idea and
not at all what I (and I expect other users) would expect.
This commit is contained in:
Augustin Cavalier 2024-10-18 13:35:45 -04:00
parent 430609181e
commit 1ffd5a3665
2 changed files with 3 additions and 3 deletions

View File

@ -3674,11 +3674,11 @@ DeleteTransientQueriesTask::Initialize()
PRINT(("starting up transient query killer\n"));
BPath path;
status_t result = find_directory(B_USER_DIRECTORY, &path, false);
if (result != B_OK) {
if (result != B_OK || path.Append("queries") != B_OK) {
state = kError;
return;
}
fWalker = new BTrackerPrivate::TQueryWalker(kAttrQueryLastChange " != 0");
fWalker = new BTrackerPrivate::TNodeWalker(path.Path());
state = kAllocatedWalker;
}

View File

@ -379,7 +379,7 @@ private:
static const int32 kBatchCount = 100;
static const int32 kDaysToExpire = 7;
BTrackerPrivate::TQueryWalker* fWalker;
BTrackerPrivate::TNodeWalker* fWalker;
};