Skip to content

Commit 3541baa

Browse files
committed
Implement Content search.
Modify existing search ui and non-tracker engine to: - Allow toggling folder recursion, case sensitivity (for both file and content search). - Content search can be plain text or a regular expression, if toggle is enabled - If visible, the 'Hits' list view column will display of how many matches are in each file. - Initial Support for text/plain files, pdf, ps, OpenDocument, exif (photo metadata) and id3 (mpeg metadata). - text/plain support is native, the others are provided via 'search helpers, and additional formats are easily added. A search helper is defined by a desktop file (in a similar manner to thumbnailers) - it only needs to be able to parse a given file type and print the text to stdout. - Multiple helpers can be defined for the same mimetype, and given priorities. If a helper is missing its executable, it is skipped, or a lower priority helper can be chosen. - The tracker engine is unchanged, but can be made to take advantage of these changes to provide content search as well. - Previous saved search functionality has been removed.
1 parent c26d309 commit 3541baa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2832
-1869
lines changed

config.h.meson.in

+2
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@
6363
// we just construct the definitons ourselves instead. Runtime
6464
// support is still checked at runtime (safely.)
6565
#mesondefine NATIVE_STATX
66+
67+
#mesondefine ENABLE_TRACKER
Loading

data/icons/meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ publicIcons = [
2929
'hicolor/actions/scalable/nemo-horizontal-layout-wide-symbolic.svg',
3030
'hicolor/actions/scalable/nemo-vertical-layout-symbolic.svg',
3131
'hicolor/actions/scalable/nemo-vertical-layout-wide-symbolic.svg',
32+
'hicolor/actions/scalable/nemo-recursive-search-symbolic.svg',
3233
'hicolor/devices/scalable/drive-removable-media-usb-symbolic.svg',
3334
'hicolor/status/48x48/progress-0.png',
3435
'hicolor/status/48x48/progress-10.png',

debian/control

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Build-Depends:
1818
libgirepository1.0-dev (>= 0.9.12),
1919
libglib2.0-dev (>= 2.45.7),
2020
libglib2.0-doc,
21+
libgsf-1-dev,
2122
libgtk-3-dev (>= 3.10),
2223
libgtk-3-doc,
2324
libnotify-dev (>= 0.7.0),
@@ -98,6 +99,10 @@ Recommends:
9899
gvfs-fuse,
99100
librsvg2-common,
100101
nemo-fileroller,
102+
poppler-utils,
103+
exif,
104+
id3,
105+
odt2txt
101106
Suggests: eog, evince | pdf-viewer, totem | mp3-decoder, xdg-user-dirs
102107
Description: file manager and graphical shell for Cinnamon
103108
Nemo is the official file manager for the Cinnamon desktop. It allows
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[Nemo Search Cat Helper]
2+
TryExec=exif
3+
Exec=exif -m %s
4+
MimeType=image/jpeg;image/png;image/gif;image/bmp;image/tiff
5+
Priority=100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[Nemo Search Cat Helper]
2+
TryExec=id3
3+
Exec=id3 -l %s
4+
MimeType=audio/mpeg
5+
Priority=100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[Nemo Search Cat Helper]
2+
TryExec=odt2txt
3+
Exec=odt2txt %s
4+
MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.graphics;
5+
priority=100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[Nemo Search Cat Helper]
2+
TryExec=pdf2txt
3+
Exec=pdf2txt %s
4+
MimeType=application/pdf;
5+
Priority=100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[Nemo Search Cat Helper]
2+
TryExec=pdftotext
3+
Exec=pdftotext %s -
4+
MimeType=application/pdf;
5+
Priority=200
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[Nemo Search Cat Helper]
2+
TryExec=ps2txt
3+
Exec=ps2txt %s
4+
MimeType=application/ps;
5+
Priority=100;

gresources/nemo-directory-view-ui.xml

-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
</placeholder>
4848
<placeholder name="Global File Items Placeholder">
4949
<menuitem name="Empty Trash" action="Empty Trash"/>
50-
<menuitem name="Save Search" action="Save Search"/>
51-
<menuitem name="Save Search As" action="Save Search As"/>
5250
</placeholder>
5351
</menu>
5452
<menu action="Edit">

0 commit comments

Comments
 (0)