File tree Expand file tree Collapse file tree 7 files changed +28
-17
lines changed
gnome/src/ui/search_window Expand file tree Collapse file tree 7 files changed +28
-17
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ pub struct SearchFlags {
32
32
pub case_sensitive : bool ,
33
33
pub fixed_string : bool ,
34
34
35
+ pub search_names : bool ,
35
36
pub search_pdf : bool ,
36
37
pub search_office : bool ,
37
38
@@ -112,14 +113,16 @@ pub fn run(engine: SearchEngine, params: SearchParameters) {
112
113
return WalkState :: Continue ;
113
114
}
114
115
115
- let file_name = entry. file_name ( ) ;
116
116
let mut path_matches = Vec :: new ( ) ;
117
- matcher
118
- . find_iter ( file_name. as_bytes ( ) , |m| {
119
- path_matches. push ( m) ;
120
- true
121
- } )
122
- . expect ( "RegexMatcher should never throw an error" ) ;
117
+ if params. flags . search_names {
118
+ let file_name = entry. file_name ( ) ;
119
+ matcher
120
+ . find_iter ( file_name. as_bytes ( ) , |m| {
121
+ path_matches. push ( m) ;
122
+ true
123
+ } )
124
+ . expect ( "RegexMatcher should never throw an error" ) ;
125
+ }
123
126
124
127
if !file_type. is_file ( ) {
125
128
return WalkState :: Continue ;
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ pub struct SearchWindow {
43
43
#[ property( get, set) ]
44
44
pub disable_regex : Cell < bool > ,
45
45
46
+ #[ property( get, set) ]
47
+ pub search_names : Cell < bool > ,
46
48
#[ property( get, set) ]
47
49
pub search_pdf : Cell < bool > ,
48
50
#[ property( get, set) ]
@@ -250,6 +252,7 @@ impl SearchWindow {
250
252
case_sensitive : self . case_sensitive . get ( ) ,
251
253
fixed_string : self . disable_regex . get ( ) ,
252
254
255
+ search_names : self . search_names . get ( ) ,
253
256
search_pdf : self . search_pdf . get ( ) ,
254
257
search_office : self . search_office . get ( ) ,
255
258
Original file line number Diff line number Diff line change @@ -116,12 +116,17 @@ template $ClapgrepSearchWindow: Adw.ApplicationWindow {
116
116
title: _("Extra File Formats");
117
117
118
118
Adw.SwitchRow {
119
- title: _("PDF files");
119
+ title: _("File Names");
120
+ active: bind template.search_names bidirectional;
121
+ }
122
+
123
+ Adw.SwitchRow {
124
+ title: _("PDF Files");
120
125
active: bind template.search_pdf bidirectional;
121
126
}
122
127
123
128
Adw.SwitchRow {
124
- title: _("Office files ");
129
+ title: _("Office Files ");
125
130
active: bind template.search_office bidirectional;
126
131
}
127
132
}
Original file line number Diff line number Diff line change @@ -141,11 +141,11 @@ msgid "Extra File Formats"
141
141
msgstr "Extra formáty souborů"
142
142
143
143
#: gnome/src/ui/search_window/search_window.blp:119
144
- msgid "PDF files "
144
+ msgid "PDF Files "
145
145
msgstr "PDF soubory"
146
146
147
147
#: gnome/src/ui/search_window/search_window.blp:124
148
- msgid "Office files "
148
+ msgid "Office Files "
149
149
msgstr "Soubory Office"
150
150
151
151
#: gnome/src/ui/search_window/search_window.blp:135
Original file line number Diff line number Diff line change @@ -151,11 +151,11 @@ msgid "Extra File Formats"
151
151
msgstr "Zusätzliche Dateiformate"
152
152
153
153
#: gnome/src/ui/search_window/search_window.blp:119
154
- msgid "PDF files "
154
+ msgid "PDF Files "
155
155
msgstr "PDF Dateien"
156
156
157
157
#: gnome/src/ui/search_window/search_window.blp:124
158
- msgid "Office files "
158
+ msgid "Office Files "
159
159
msgstr "Office Dateien"
160
160
161
161
#: gnome/src/ui/search_window/search_window.blp:135
Original file line number Diff line number Diff line change @@ -148,11 +148,11 @@ msgid "Extra File Formats"
148
148
msgstr "Formati di file extra"
149
149
150
150
#: gnome/src/ui/search_window/search_window.blp:119
151
- msgid "PDF files "
151
+ msgid "PDF Files "
152
152
msgstr "File PDF"
153
153
154
154
#: gnome/src/ui/search_window/search_window.blp:124
155
- msgid "Office files "
155
+ msgid "Office Files "
156
156
msgstr "File di ufficio"
157
157
158
158
#: gnome/src/ui/search_window/search_window.blp:135
Original file line number Diff line number Diff line change @@ -141,11 +141,11 @@ msgid "Extra File Formats"
141
141
msgstr "Дополнительные форматы файлов"
142
142
143
143
#: gnome/src/ui/search_window/search_window.blp:119
144
- msgid "PDF files "
144
+ msgid "PDF Files "
145
145
msgstr "PDF файлы"
146
146
147
147
#: gnome/src/ui/search_window/search_window.blp:124
148
- msgid "Office files "
148
+ msgid "Office Files "
149
149
msgstr "Файлы Office"
150
150
151
151
#: gnome/src/ui/search_window/search_window.blp:135
You can’t perform that action at this time.
0 commit comments