Skip to content

Commit

Permalink
Implement Content search.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mtwebster committed May 30, 2021
1 parent c26d309 commit 3541baa
Show file tree
Hide file tree
Showing 55 changed files with 2,832 additions and 1,869 deletions.
2 changes: 2 additions & 0 deletions config.h.meson.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@
// we just construct the definitons ourselves instead. Runtime
// support is still checked at runtime (safely.)
#mesondefine NATIVE_STATX

#mesondefine ENABLE_TRACKER
203 changes: 203 additions & 0 deletions data/icons/hicolor/actions/scalable/nemo-recursive-search-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/icons/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ publicIcons = [
'hicolor/actions/scalable/nemo-horizontal-layout-wide-symbolic.svg',
'hicolor/actions/scalable/nemo-vertical-layout-symbolic.svg',
'hicolor/actions/scalable/nemo-vertical-layout-wide-symbolic.svg',
'hicolor/actions/scalable/nemo-recursive-search-symbolic.svg',
'hicolor/devices/scalable/drive-removable-media-usb-symbolic.svg',
'hicolor/status/48x48/progress-0.png',
'hicolor/status/48x48/progress-10.png',
Expand Down
5 changes: 5 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Build-Depends:
libgirepository1.0-dev (>= 0.9.12),
libglib2.0-dev (>= 2.45.7),
libglib2.0-doc,
libgsf-1-dev,
libgtk-3-dev (>= 3.10),
libgtk-3-doc,
libnotify-dev (>= 0.7.0),
Expand Down Expand Up @@ -98,6 +99,10 @@ Recommends:
gvfs-fuse,
librsvg2-common,
nemo-fileroller,
poppler-utils,
exif,
id3,
odt2txt
Suggests: eog, evince | pdf-viewer, totem | mp3-decoder, xdg-user-dirs
Description: file manager and graphical shell for Cinnamon
Nemo is the official file manager for the Cinnamon desktop. It allows
Expand Down
5 changes: 5 additions & 0 deletions files/usr/share/nemo/search-helpers/exif.nemo_search_helper
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Nemo Search Cat Helper]
TryExec=exif
Exec=exif -m %s
MimeType=image/jpeg;image/png;image/gif;image/bmp;image/tiff
Priority=100
5 changes: 5 additions & 0 deletions files/usr/share/nemo/search-helpers/id3.nemo_search_helper
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Nemo Search Cat Helper]
TryExec=id3
Exec=id3 -l %s
MimeType=audio/mpeg
Priority=100
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Nemo Search Cat Helper]
TryExec=odt2txt
Exec=odt2txt %s
MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.graphics;
priority=100
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Nemo Search Cat Helper]
TryExec=pdf2txt
Exec=pdf2txt %s
MimeType=application/pdf;
Priority=100
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Nemo Search Cat Helper]
TryExec=pdftotext
Exec=pdftotext %s -
MimeType=application/pdf;
Priority=200
5 changes: 5 additions & 0 deletions files/usr/share/nemo/search-helpers/ps2txt.nemo_search_helper
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Nemo Search Cat Helper]
TryExec=ps2txt
Exec=ps2txt %s
MimeType=application/ps;
Priority=100;
2 changes: 0 additions & 2 deletions gresources/nemo-directory-view-ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
</placeholder>
<placeholder name="Global File Items Placeholder">
<menuitem name="Empty Trash" action="Empty Trash"/>
<menuitem name="Save Search" action="Save Search"/>
<menuitem name="Save Search As" action="Save Search As"/>
</placeholder>
</menu>
<menu action="Edit">
Expand Down
Loading

0 comments on commit 3541baa

Please sign in to comment.