Commit Graph

78 Commits

Author SHA1 Message Date
Albert S. f8542dc96a shared: Indexer: Handle keepGoing, set verbose 2022-06-06 09:34:37 +02:00
Albert S. fdae7fd065 shared: LooqsQuery: Use unicode category class in regex 2022-06-06 09:34:37 +02:00
Albert S. 61fa7ca16d shared: IndexSyncer: Check whether file is located in a mountpath 2022-06-06 09:34:37 +02:00
Albert S. 61a446ec2d shared: common: Add mountPaths()
Mountpaths indicate mount points of external devices. Files
located under such paths should not be removed on sync, because
they may have not been deleted, but are just inaccessible right now.
2022-06-06 09:34:37 +02:00
Albert S. 0e5abf96c8 shared: indexer: Don't dispatch DirScanner if no dirs given
This makes sense in general, however it also avoids a race condition.

The dirscanner may finish before the filescanworkers for the files
run, this then signals the whole indexer has finished.
2022-06-05 20:35:21 +02:00
Albert S. e5e43c8bfb shared: SqliteSearch: Append LIMIT statement if need be 2022-06-05 14:39:57 +02:00
Albert S. a6ddcef0c0 shared: LooqsQuery: Fix logic of implicit AND booleans. Add 'limit:' support
Add implicit AND booleans at the end.

This fixes a number of issues in LooqsQuery:

(1) A query like a b c p:(something) would fail, because
a b c get merged into one word. This happens at the end.

lonewords are special and do not become a token immediatly. So previous
logic to add implicit ANDs does not apply.

(2) Negations were also broken with lonewords.

(3) The TokenType enum fields were too narrow to be useful for the bitmask

Independent of that, add support for 'limit:'
2022-06-05 14:39:57 +02:00
Albert S. 821bed6706 shared: LooqsQuery: Add 'p', 'pb', 'pe' aliases
Because this way the user has to type significantly less
2022-06-05 14:39:57 +02:00
Albert S. d7b93d11d8 shared: IndexSyncer: Support cancellation 2022-06-04 17:09:26 +02:00
Albert S. 7d9c883abd shared: LooqsQuery: build(): Return empty query for empty expresion 2022-06-04 17:09:26 +02:00
Albert S. abc126548b shared: Introduce IndexSyncer, containing logic of cli/CommandUpdate
IndexSyncer contains most of the logic of cli/CommandUpdate, so
it can be reused in the GUI where we need it too
2022-06-04 17:09:26 +02:00
Albert S. 86d629c957 shared: SqliteDbService: Changed getFiles() return to unsigned int 2022-06-04 17:09:26 +02:00
Albert S. 05fad3be17 shared: ParallelDirScanner: Delete DirScanWorkers after they are done 2022-06-04 17:09:26 +02:00
Albert S. 6f11a5e662 shared: FileSaver: Adjust message as it's confusing on updates 2022-06-04 17:09:26 +02:00
Albert S. db029dd915 shared: shared.pro: Add git commit id to build 2022-06-04 17:09:26 +02:00
Albert S. f14e2e77cd shared: common: Add versionText() function 2022-06-04 17:09:26 +02:00
Albert S. 15615776d3 shared: SandboxedProcessor: Fix scope issue with readablePathLocation
The pointer becomes invalid as readablePathLocation falls out of scope,
and exile.h quits with an error.

This may indicate exile API sucks, so something to think about there.
2022-06-04 17:09:26 +02:00
Albert S. c2bd1b526b shared: Indexer: Use WildcardMatcher to ignore paths 2022-06-04 17:09:26 +02:00
Albert S. a3666f283e shared: DirscanWorker: Use WildcardMatcher to ignore paths 2022-06-04 17:09:26 +02:00
Albert S. edc41d6f59 shared: Introduce WildcardMatcher 2022-06-04 17:09:26 +02:00
Albert S. 26c7cdbc5f shared: Move textfile detector to common 2022-06-04 17:09:26 +02:00
Albert S. aed0ca31f7 shared: SandboxedProcessor: Perform MIME-type detection
Detect mime types, and for text/*, run the default text processor.

The added benefit is that we can now add plaintext files without extensions,
or many other text files (e. g. source code).
2022-06-04 17:09:26 +02:00
Albert S. b6926d510f FileSaver: Don't add files in blacklisted paths
We now resolve symlinks when adding, so we can properly check
whether a path is excluded or not. This accidently also
helps with duplicates.

Excluded paths are hardcoded and can also be appended to
by the user using the settings.

Closes: #34
2022-06-04 17:09:26 +02:00
Albert S. ad0fc74439 ipc: Place socket in /tmp/.looqs/, remove ipc path settings 2022-05-29 11:20:28 +02:00
Albert S. 4a492fb356 shared: ParallelDirScanner: Remove leftover debug output 2022-04-28 23:45:56 +02:00
Albert S. def766ba67 shared: common: On first start, try to set a rasonable pdfviewer value
May not be users default, but better than nothing for now.

Issue: #27
2022-04-25 23:01:11 +02:00
Albert S. 0d01fa977d shared: LooqsQuery: Consider " a part of the loneword
Strictly speaking a hack, and we may probably need to
add more chars here.

This mainly fixes the difference between:

"one two"
and c:("one two")

In the first case they are "lonewords", the " does
not get picked up. Then, the search results are something
not expected.
2022-04-25 22:27:46 +02:00
Albert S. 9b51e00737 Rename leftovers that were forgotten in 645903ed6b 2022-04-24 19:40:43 +02:00
Albert S. 84e13e432b shared: common: Introduce ipcSocketPath() 2022-04-24 15:52:20 +02:00
Albert S. e8f095f821 shared: sqlitedbservice: Call prepare(), don't pass query in constructor for consistency 2022-04-24 15:52:20 +02:00
Albert S. c99827e854 shared: FileScanWorker: Catch correct exception type 2022-04-24 15:52:20 +02:00
Albert S. e3440beae7 shared: sqlitesearch: Avoid joining content table more than once 2022-04-24 15:52:20 +02:00
Albert S. 8194476fa6 shared: sqlitesearch: Only order by rank if token is FILTER_CONTENT_CONTAINS 2022-04-24 15:52:20 +02:00
Albert S. 45de97d8fb gui: Begin cancellation of Indexer 2022-04-24 15:52:20 +02:00
Albert S. 1cc7053193 shared: Update shared.pro with recent additions 2022-04-15 21:06:56 +02:00
Albert S. c51fd3c555 shared: FileSaver: Return NOTFOUND, Handle NOTHING_PROCESSED exit code correctly 2022-04-15 21:06:56 +02:00
Albert S. 715023a3ee shared: FileSaver: Make addFile(),updateFile() public 2022-04-15 21:06:56 +02:00
Albert S. 4234967ef5 shared: Add NOTFOUND SaveFileResult 2022-04-15 21:06:56 +02:00
Albert S. d483d05db1 shared: Begin Indexer 2022-04-15 21:06:56 +02:00
Albert S. 564b5ddae8 shared: Begin FileScanWorker 2022-04-15 21:06:56 +02:00
Albert S. d7705241ee shared: Begin ParallelDirScanner 2022-04-15 21:06:56 +02:00
Albert S. f3fbf4a1dc shared: Begin DirScanWorker 2022-04-15 21:06:56 +02:00
Albert S. 56414ee5e2 shared: Begin basic ConcurrentQueue 2022-04-15 21:06:56 +02:00
Albert S. 478d57b342 cli: Move most classes to shared lib for reuse 2022-04-15 21:06:56 +02:00
Albert S. d43c35819d common: Use DBMigrator to init and update database 2022-04-15 21:06:56 +02:00
Albert S. 3d8b086f53 shared: Begin db migration logic
Issue: #26
2022-04-15 21:06:56 +02:00
Albert S. 294455b861 DatabaseFactory: Move to /shared 2022-04-15 21:06:56 +02:00
Albert S. 7066cc1a45 Logger: Move to shared/ 2022-02-27 23:10:46 +01:00
Albert S. c0657947b1 LooqsQuery: Add hasContentSearch(),hasPathSearch() convenience functions 2022-01-04 11:24:37 +01:00
Albert S. 1f35e2120e LooqsQuery::build(): Ensure values are non-empty and ignore empty lone words 2022-01-04 11:24:37 +01:00