Skip to content

Commit

Permalink
search: Improve logging when loading search helpers.
Browse files Browse the repository at this point in the history
Fix a typo in one of the helper definition files.
  • Loading branch information
mtwebster committed Nov 12, 2024
1 parent 0b1d10f commit daff8ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions libnemo-private/nemo-search-engine-advanced.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
#define SNIPPET_EXTEND_SIZE 100

typedef struct {
gchar *def_path;
gchar *exec_format;

gint priority;
/* future? */
} SearchHelper;
Expand Down Expand Up @@ -91,6 +93,7 @@ static GHashTable *search_helpers = NULL;
static void
search_helper_free (SearchHelper *helper)
{
g_free (helper->def_path);
g_free (helper->exec_format);
g_free (helper);
}
Expand Down Expand Up @@ -214,13 +217,16 @@ process_search_helper_file (const gchar *path)

existing = g_hash_table_lookup (search_helpers, mime_type);
if (existing && existing->priority > priority) {
DEBUG ("Existing nemo search_helper for '%s' has higher priority than a new one (%s), ignoring the new one.", mime_type, path);
DEBUG ("Existing nemo search_helper for '%s' (%s) has higher priority than a new one (%s), ignoring the new one.",
mime_type, existing->def_path, path);
continue;
} else if (existing) {
DEBUG ("Replacing existing nemo search_helper for '%s' with %s based on priority.", mime_type, path);
DEBUG ("Replacing existing nemo search_helper for '%s' (%s) with %s based on priority.",
mime_type, existing->def_path, path);
}

helper = g_new0 (SearchHelper, 1);
helper->def_path = g_strdup (path);
helper->exec_format = g_strdup (exec_format);
helper->priority = priority;

Expand Down Expand Up @@ -272,7 +278,6 @@ initialize_search_helpers (NemoSearchEngineAdvanced *engine)
}

file_path = g_build_filename (path, filename, NULL);
DEBUG ("Processing '%s'", path);
process_search_helper_file (file_path);
g_free (file_path);
}
Expand Down
2 changes: 1 addition & 1 deletion search-helpers/mso.nemo_search_helper
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
TryExec=nemo-mso-to-txt;
Exec=nemo-mso-to-txt %s
MimeType=application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.openxmlformats-officedocument.presentationml.presentation;
priority=100
Priority=100

0 comments on commit daff8ce

Please sign in to comment.