Skip to content

Commit daff8ce

Browse files
committed
search: Improve logging when loading search helpers.
Fix a typo in one of the helper definition files.
1 parent 0b1d10f commit daff8ce

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

libnemo-private/nemo-search-engine-advanced.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
#define SNIPPET_EXTEND_SIZE 100
4141

4242
typedef struct {
43+
gchar *def_path;
4344
gchar *exec_format;
45+
4446
gint priority;
4547
/* future? */
4648
} SearchHelper;
@@ -91,6 +93,7 @@ static GHashTable *search_helpers = NULL;
9193
static void
9294
search_helper_free (SearchHelper *helper)
9395
{
96+
g_free (helper->def_path);
9497
g_free (helper->exec_format);
9598
g_free (helper);
9699
}
@@ -214,13 +217,16 @@ process_search_helper_file (const gchar *path)
214217

215218
existing = g_hash_table_lookup (search_helpers, mime_type);
216219
if (existing && existing->priority > priority) {
217-
DEBUG ("Existing nemo search_helper for '%s' has higher priority than a new one (%s), ignoring the new one.", mime_type, path);
220+
DEBUG ("Existing nemo search_helper for '%s' (%s) has higher priority than a new one (%s), ignoring the new one.",
221+
mime_type, existing->def_path, path);
218222
continue;
219223
} else if (existing) {
220-
DEBUG ("Replacing existing nemo search_helper for '%s' with %s based on priority.", mime_type, path);
224+
DEBUG ("Replacing existing nemo search_helper for '%s' (%s) with %s based on priority.",
225+
mime_type, existing->def_path, path);
221226
}
222227

223228
helper = g_new0 (SearchHelper, 1);
229+
helper->def_path = g_strdup (path);
224230
helper->exec_format = g_strdup (exec_format);
225231
helper->priority = priority;
226232

@@ -272,7 +278,6 @@ initialize_search_helpers (NemoSearchEngineAdvanced *engine)
272278
}
273279

274280
file_path = g_build_filename (path, filename, NULL);
275-
DEBUG ("Processing '%s'", path);
276281
process_search_helper_file (file_path);
277282
g_free (file_path);
278283
}

search-helpers/mso.nemo_search_helper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
TryExec=nemo-mso-to-txt;
33
Exec=nemo-mso-to-txt %s
44
MimeType=application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.openxmlformats-officedocument.presentationml.presentation;
5-
priority=100
5+
Priority=100

0 commit comments

Comments
 (0)