Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package nemo for openSUSE:Factory checked in at 2021-07-17 23:36:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nemo (Old) and /work/SRC/openSUSE:Factory/.nemo.new.2632 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nemo" Sat Jul 17 23:36:45 2021 rev:43 rq:906785 version:5.0.3 Changes: -------- --- /work/SRC/openSUSE:Factory/nemo/nemo.changes 2021-06-22 20:45:01.306828563 +0200 +++ /work/SRC/openSUSE:Factory/.nemo.new.2632/nemo.changes 2021-07-17 23:37:23.829618928 +0200 @@ -1,0 +2,29 @@ +Fri Jul 16 20:15:44 UTC 2021 - Dirk M??ller <[email protected]> + +- update to 5.0.3: + * search: Use untex instead of detex to search latex files. + * search: Fix build from previous commit. + * nemo-search-engine-advanced.c: Also match \r (carriage return) in the newline filter. + * nemo-blank-desktop-window.c: Don't try to open a nonexistent menu. + * settings: Make the default search button states match the old search behavior. + * nemo-search-engine-advanced.c: Escape paths properly before passing them to + search helpers. + * nemo-query-editor.c: Don't show the bar separator if the search box isn't being shown. + * Search: Allow TryExec to be a list of programs. + * Search: Update search README.md for TryExec changes. + * search-helpers/nemo-mso-to-txt.c: Refactor and improve error handling. + * Search: Add .doc, .xls and .tex helpers. + * Search: Add .ppt helper. + * debian/control: Make search helper programs dependencies instead of recommends. + * nemo-mime-actions.c: Only add entire view file list to an image viewer + launch if its commandline supports multiple files. + * nemo-search-engine-advanced.c: Ensure that the final snippet endpoint is no + greater than the original endpoint. + * nemo-search-engine-advanced.c: a couple fixes. + * search: Disable content search for some special folders. + * nemo-view.c: Update context menu item visibility from preferences after + updating the menu items from any extensions. + * nemo-view.c: Clear extension menu items during real_update_menus. + * nemo-view.c: Move call added to last commit to nemo_view_stop_loading. + +------------------------------------------------------------------- Old: ---- nemo-5.0.1.tar.gz New: ---- nemo-5.0.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nemo.spec ++++++ --- /var/tmp/diff_new_pack.3As2rn/_old 2021-07-17 23:37:24.313615196 +0200 +++ /var/tmp/diff_new_pack.3As2rn/_new 2021-07-17 23:37:24.317615166 +0200 @@ -20,7 +20,7 @@ %define sover 1 %define typelib typelib-1_0-Nemo-3_0 Name: nemo -Version: 5.0.1 +Version: 5.0.3 Release: 0 Summary: File browser for Cinnamon License: GPL-2.0-or-later ++++++ nemo-5.0.1.tar.gz -> nemo-5.0.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/debian/changelog new/nemo-5.0.3/debian/changelog --- old/nemo-5.0.1/debian/changelog 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/debian/changelog 2021-07-02 11:50:04.000000000 +0200 @@ -1,3 +1,35 @@ +nemo (5.0.3) uma; urgency=medium + + [ Michael Webster ] + * search: Use untex instead of detex to search latex files. + * search: Fix build from previous commit. + * nemo-search-engine-advanced.c: Also match \r (carriage return) in the newline filter. + * nemo-blank-desktop-window.c: Don't try to open a nonexistent menu. + + -- Clement Lefebvre <[email protected]> Fri, 02 Jul 2021 10:49:34 +0100 + +nemo (5.0.2) uma; urgency=medium + + [ Michael Webster ] + * settings: Make the default search button states match the old search behavior. + * nemo-search-engine-advanced.c: Escape paths properly before passing them to search helpers. + * nemo-query-editor.c: Don't show the bar separator if the search box isn't being shown. + * Search: Allow TryExec to be a list of programs. + * Search: Update search README.md for TryExec changes. + * search-helpers/nemo-mso-to-txt.c: Refactor and improve error handling. + * Search: Add .doc, .xls and .tex helpers. + * Search: Add .ppt helper. + * debian/control: Make search helper programs dependencies instead of recommends. + * nemo-mime-actions.c: Only add entire view file list to an image viewer launch if its commandline supports multiple files. + * nemo-search-engine-advanced.c: Ensure that the final snippet endpoint is no greater than the original endpoint. + * nemo-search-engine-advanced.c: a couple fixes. + * search: Disable content search for some special folders. + * nemo-view.c: Update context menu item visibility from preferences after updating the menu items from any extensions. + * nemo-view.c: Clear extension menu items during real_update_menus. + * nemo-view.c: Move call added to last commit to nemo_view_stop_loading. + + -- Clement Lefebvre <[email protected]> Fri, 25 Jun 2021 16:58:08 +0100 + nemo (5.0.1) uma; urgency=medium [ Michael Webster ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/debian/control new/nemo-5.0.3/debian/control --- old/nemo-5.0.1/debian/control 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/debian/control 2021-07-02 11:50:04.000000000 +0200 @@ -92,17 +92,19 @@ libnemo-extension1 (= ${binary:Version}), nemo-data (= ${source:Version}), shared-mime-info (>= 0.50), + poppler-utils, + exif, + id3, + odt2txt, + catdoc, + untex, ${misc:Depends}, ${shlibs:Depends}, Recommends: gvfs-backends, gvfs-fuse, librsvg2-common, - nemo-fileroller, - poppler-utils, - exif, - id3, - odt2txt + nemo-fileroller 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/libnemo-private/nemo-search-engine-advanced.c new/nemo-5.0.3/libnemo-private/nemo-search-engine-advanced.c --- old/nemo-5.0.1/libnemo-private/nemo-search-engine-advanced.c 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/libnemo-private/nemo-search-engine-advanced.c 2021-07-02 11:50:04.000000000 +0200 @@ -132,7 +132,7 @@ { GKeyFile *key_file; gchar *exec_format = NULL; - gchar *try_exec = NULL; + gchar **try_exec_list = NULL; gchar *abs_try_path = NULL; gchar **mime_types = NULL; gint priority = 100; @@ -158,10 +158,24 @@ goto done; } - try_exec = g_key_file_get_string (key_file, SEARCH_HELPER_GROUP, "TryExec", NULL); - abs_try_path = g_find_program_in_path (try_exec); - if (!abs_try_path) { - DEBUG ("Skipping search helper '%s' - program is not available (%s)", path, try_exec); + try_exec_list = g_key_file_get_string_list (key_file, SEARCH_HELPER_GROUP, "TryExec", NULL, NULL); + gboolean try_failed = FALSE; + + for (i = 0; i < g_strv_length (try_exec_list); i++) { + abs_try_path = g_find_program_in_path (try_exec_list[i]); + + if (!abs_try_path) { + DEBUG ("Skipping search helper '%s' - program is not available (%s)", path, try_exec_list[i]); + try_failed = TRUE; + break; + } + + g_free (abs_try_path); + } + + g_strfreev (try_exec_list); + + if (try_failed) { goto done; } @@ -215,8 +229,6 @@ done: g_key_file_free (key_file); g_free (exec_format); - g_free (try_exec); - g_free (abs_try_path); if (mime_types != NULL) { g_strfreev (mime_types); @@ -501,7 +513,7 @@ g_free (escaped); - data->newline_re = g_regex_new ("\\n{2,}", + data->newline_re = g_regex_new ("[\\n\\r]{2,}", G_REGEX_OPTIMIZE, 0, &error); @@ -647,7 +659,7 @@ gchar *ptr, *path, *quoted; path = g_file_get_path (file); - quoted = g_strdup_printf ("\"%s\"", path); + quoted = g_shell_quote (path); g_free (path); command_line = g_string_new (helper->exec_format); @@ -670,6 +682,7 @@ error)) { g_string_free (command_line, TRUE); g_free (quoted); + return NULL; } flags = G_SUBPROCESS_FLAGS_STDOUT_PIPE; @@ -712,7 +725,11 @@ // Extend the snipped forwards and back a bit to give context. new_start = MAX (0, start - SNIPPET_EXTEND_SIZE); - new_end = MIN (end + SNIPPET_EXTEND_SIZE, total_length - 1); + + // g_match_info_fetch_pos() can return an end_bytes that == total_length, + // maybe a utf-8 encoding issue - g_utf8_substring can't deal with this, + // so just clamp new_end to >= end. + new_end = MIN (end + SNIPPET_EXTEND_SIZE, MAX (end, total_length - 1)); matched_str = g_match_info_fetch (match_info, 0); @@ -847,7 +864,7 @@ fsr = file_search_result_new (g_file_get_uri (file)); } - file_search_result_add_hit (fsr, create_snippet (match_info, stripped, g_utf8_strlen (stripped, G_MAXSSIZE))); + file_search_result_add_hit (fsr, create_snippet (match_info, stripped, g_utf8_strlen (stripped, -1))); if (!data->count_hits) { break; @@ -1016,7 +1033,7 @@ if (!toplevel) { if (g_hash_table_contains (data->skip_folders, g_file_peek_path (dir))) { - g_object_unref (data); + g_object_unref (dir); continue; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/libnemo-private/org.nemo.gschema.xml new/nemo-5.0.3/libnemo-private/org.nemo.gschema.xml --- old/nemo-5.0.1/libnemo-private/org.nemo.gschema.xml 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/libnemo-private/org.nemo.gschema.xml 2021-07-02 11:50:04.000000000 +0200 @@ -210,7 +210,7 @@ <key name="image-viewers-with-external-sort" type="as"> <default>['xviewer','feh','sxiv']</default> <summary>Image viewer executables to pass sort order to</summary> - <description>When opening a single image with an application in this list, allow that viewer to display other images in the current nemo view, in the presented order (including searches). Other image viewers can be added, but are likely to ignore the order.</description> + <description>When opening a single image with an application in this list, allow that viewer to display other images in the current nemo view, in the presented order (including searches). Other image viewers can be added, but are likely to ignore the order. The viewer Exec line must accept a list of files (either %U or %F).</description> </key> <key name="mouse-use-extra-buttons" type="b"> <default>true</default> @@ -826,20 +826,20 @@ <summary>Treat patterns as raw bytes, not utf-8</summary> </key> <key name="search-file-case-sensitive" type="b"> - <default>true</default> + <default>false</default> <summary>Stores the most recent state of the file search case toggle</summary> </key> <key name="search-content-case-sensitive" type="b"> - <default>true</default> + <default>false</default> <summary>Stores the most recent state of the content search case toggle</summary> </key> <key name="search-skip-folders" type="as"> - <default>[]</default> + <default>['/dev', '/proc', '/run', '/sys']</default> <summary>Paths or folder names to never recurse into when searching</summary> <description>List of locations that the search engine will never enter when looking for matches. These can be absolute or simply folder names (like .git). You can still enter those folders and search inside of them, however.</description> </key> <key name="search-files-recursively" type="b"> - <default>false</default> + <default>true</default> <summary>Recurse into subfolders when performing a search</summary> </key> <key name="search-visible-columns" type="as"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/meson.build new/nemo-5.0.3/meson.build --- old/nemo-5.0.1/meson.build 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/meson.build 2021-07-02 11:50:04.000000000 +0200 @@ -1,7 +1,7 @@ # Meson build file # https://github.com/linuxmint/nemo -project('nemo', 'c', version: '5.0.1', +project('nemo', 'c', version: '5.0.3', meson_version: '>=0.41.0' ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/README.md new/nemo-5.0.3/search-helpers/README.md --- old/nemo-5.0.1/search-helpers/README.md 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/search-helpers/README.md 2021-07-02 11:50:04.000000000 +0200 @@ -17,9 +17,9 @@ The `Nemo Search Helper` group name is mandatory. - The filename must end in `.nemo_search_helper`. -- `TryExec` should be set to the name of the executable (without any arguments). When the helpers are loaded, Nemo will - check that the program a) exists and b) is executable. If these checks fail, the helper will be skipped. If only a - program name is provided, it must exist in the user's path. This can also be an absolute path. +- `TryExec` should be a list executables required. When the helpers are loaded, Nemo will check that the program(s) a) exist and + b) are executable. If these checks fail, the helper will be skipped. If only a program name is provided, it must exist in the + user's path. This can also be an absolute path. - `Exec` should provide the full command line necessary to extract the text from the file. The `%s` argument will be replaced by the file name being processed during content search. Note, uris are not supported, only paths (local files). - `MimeType`is a semicolon (`;`)-separated list of mimetypes that this search helper should be used with. It should be @@ -36,4 +36,4 @@ ``` NEMO_DEBUG=Search nemo --debug ``` -This will print out a bit of extra information related to searches. \ No newline at end of file +This will print out a bit of extra information related to searches. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/meson.build new/nemo-5.0.3/search-helpers/meson.build --- old/nemo-5.0.1/search-helpers/meson.build 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/search-helpers/meson.build 2021-07-02 11:50:04.000000000 +0200 @@ -4,14 +4,25 @@ 'nemo-mso-to-txt.c' ] -watcher = executable('nemo-mso-to-txt', +mso_to_txt = executable('nemo-mso-to-txt', mso_to_txt_sources, dependencies: [libgsf, gio, glib], install: true ) +ppt_to_txt_sources = [ + 'nemo-ppt-to-txt.c' +] + +ppt_to_txt = executable('nemo-ppt-to-txt', + ppt_to_txt_sources, + dependencies: [gio, glib], + install: true +) + install_data( 'mso.nemo_search_helper', + 'mso-ppt.nemo_search_helper', install_dir: join_paths(nemoDataPath, 'search-helpers') ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/mso-ppt.nemo_search_helper new/nemo-5.0.3/search-helpers/mso-ppt.nemo_search_helper --- old/nemo-5.0.1/search-helpers/mso-ppt.nemo_search_helper 1970-01-01 01:00:00.000000000 +0100 +++ new/nemo-5.0.3/search-helpers/mso-ppt.nemo_search_helper 2021-07-02 11:50:04.000000000 +0200 @@ -0,0 +1,5 @@ +[Nemo Search Helper] +TryExec=nemo-ppt-to-txt;libreoffice; +Exec=nemo-ppt-to-txt %s +MimeType=application/vnd.ms-powerpoint; +Priority=100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/mso.nemo_search_helper new/nemo-5.0.3/search-helpers/mso.nemo_search_helper --- old/nemo-5.0.1/search-helpers/mso.nemo_search_helper 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/search-helpers/mso.nemo_search_helper 2021-07-02 11:50:04.000000000 +0200 @@ -1,5 +1,5 @@ [Nemo Search Helper] -TryExec=nemo-mso-to-txt +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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/nemo-mso-to-txt.c new/nemo-5.0.3/search-helpers/nemo-mso-to-txt.c --- old/nemo-5.0.1/search-helpers/nemo-mso-to-txt.c 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/search-helpers/nemo-mso-to-txt.c 2021-07-02 11:50:04.000000000 +0200 @@ -111,18 +111,43 @@ } } +gchar * +run_regex_replace (const gchar *pattern, + gchar *input, + const gchar *replacement, + GError **error) +{ + GRegex *re; + gchar *out; + + out = NULL; + + re = g_regex_new (pattern, + G_REGEX_OPTIMIZE, + 0, + error); + + if (re == NULL) { + return NULL; + } + + out = g_regex_replace_literal (re, input, -1, 0, replacement, 0, error); + g_free (input); + g_regex_unref (re); + + return out; +} + int main (int argc, char *argv[]) { GsfInput *input; GsfInfile *toplevel; GString *collective; - GRegex *re; GError *error; GFile *file; gchar *filename; - gchar *xml_strip_out; - gchar *space_strip_out; + gchar *content; if (argc < 2) { g_printerr ("Need a filename\n"); @@ -149,6 +174,7 @@ if (error != NULL) { g_critical ("Could not load mso file: %s", error->message); + g_object_unref (input); g_error_free (error); return 1; } @@ -160,33 +186,40 @@ g_object_unref (toplevel); g_object_unref (input); - re = g_regex_new ("<[^>]+>", - G_REGEX_OPTIMIZE, - 0, - &error); + content = g_string_free (collective, FALSE); - xml_strip_out = g_regex_replace_literal (re, collective->str, -1, 0, " ", 0, &error); - g_string_free (collective, TRUE); - g_regex_unref (re); + if (content == NULL) { + goto out; + } - re = g_regex_new ("\\s+", - G_REGEX_OPTIMIZE, - 0, - &error); + content = run_regex_replace ("<[^>]+>", + content, + "", + &error); - space_strip_out = g_regex_replace_literal (re, xml_strip_out, -1, 0, " ", 0, &error); - g_free (xml_strip_out); - g_regex_unref (re); + if (content == NULL) { + goto out; + } + + content = run_regex_replace ("\\s+", + content, + " ", + &error); + + if (content == NULL) { + goto out; + } + + g_printf ("%s", content); + g_free (content); +out: if (error != NULL) { - g_critical ("Could extract strings from mso file: %s", error->message); + g_critical ("Could not extract strings from mso 2003+ file: %s", error->message); g_error_free (error); return 1; } - g_printf ("%s", space_strip_out); - g_free (space_strip_out); - return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/nemo-ppt-to-txt.c new/nemo-5.0.3/search-helpers/nemo-ppt-to-txt.c --- old/nemo-5.0.1/search-helpers/nemo-ppt-to-txt.c 1970-01-01 01:00:00.000000000 +0100 +++ new/nemo-5.0.3/search-helpers/nemo-ppt-to-txt.c 2021-07-02 11:50:04.000000000 +0200 @@ -0,0 +1,265 @@ +/* Nemo is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * Nemo is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; see the file COPYING. If not, + * write to the Free Software Foundation, Inc., 51 Franklin Street - Suite 500, + * Boston, MA 02110-1335, USA. + */ + +#include <stdlib.h> +#include <glib.h> +#include <gio/gio.h> +#include <glib/gprintf.h> + +static void +cleanup_tmp_dir (const gchar *tmp_dir, + GFile *xml_file) +{ + if (tmp_dir == NULL || xml_file == NULL) { + return; + } + + GFile *parent; + + parent = g_file_get_parent (xml_file); + + g_file_delete (xml_file, NULL, NULL); + g_file_delete (parent, NULL, NULL); + + g_object_unref (parent); +} + +static gchar * +get_tmp_dir (GError **error) +{ + gchar *tmp_dir = NULL; + + // Create our temp dir in /dev/shm if it's available, + // otherwise use whatever glib ends up with (/tmp probably). + + if (g_file_test ("/dev/shm", G_FILE_TEST_IS_DIR)) { + gchar *old_env_tmp; + + old_env_tmp = g_strdup (g_getenv ("TMPDIR")); + if (g_setenv ("TMPDIR", "/dev/shm", TRUE)) { + tmp_dir = g_dir_make_tmp ("nemo-search-helper-XXXXXX", NULL); + + if (old_env_tmp != NULL) { + g_setenv ("TMPDIR", old_env_tmp, TRUE); + g_free (old_env_tmp); + } else { + g_unsetenv ("TMPDIR"); + } + } + } + + if (tmp_dir != NULL) { + return tmp_dir; + } + + return g_dir_make_tmp ("nemo-search-helper-XXXXXX", error); +} + +gchar * +run_regex_replace (const gchar *pattern, + gchar *input, + const gchar *replacement, + GError **error) +{ + GRegex *re; + gchar *out; + + out = NULL; + + re = g_regex_new (pattern, + G_REGEX_OPTIMIZE, + 0, + error); + + if (re == NULL) { + return NULL; + } + + out = g_regex_replace_literal (re, input, -1, 0, replacement, 0, error); + g_free (input); + g_regex_unref (re); + + return out; +} + +int +main (int argc, char *argv[]) +{ + if (argc < 2) { + g_printerr ("Need a filename\n"); + return 1; + } + + GSubprocess *lo_proc; + GFile *xml_file; + GError *error; + + gchar *tmp_dir = NULL; + gchar *name_only = NULL; + gchar *ptr; + gchar *orig_file_path = NULL, *orig_basename = NULL; + gchar *xml_file_path = NULL, *xml_basename = NULL; + gchar *content = NULL; + + gint retval; + gsize length; + + orig_file_path = g_strdup (argv[1]); + + orig_basename = g_path_get_basename (orig_file_path); + ptr = g_strrstr (orig_basename, "."); + + name_only = g_strndup (orig_basename, ptr - orig_basename); + g_free (orig_basename); + + retval = 0; + xml_file = NULL; + error = NULL; + tmp_dir = get_tmp_dir (&error); + + if (tmp_dir == NULL) { + if (error != NULL) { + g_warning ("Could not create a temp dir for conversion: %s", error->message); + g_clear_error (&error); + } + + retval = 1; + goto out; + } + + gchar *lo_args[7] = { + "libreoffice", + "--convert-to", "xml", + "--outdir", tmp_dir, + orig_file_path, + NULL + }; + + lo_proc = g_subprocess_newv ((const gchar * const *) lo_args, + G_SUBPROCESS_FLAGS_STDERR_SILENCE | G_SUBPROCESS_FLAGS_STDOUT_SILENCE, + &error); + + if (lo_proc == NULL) { + if (error != NULL) { + g_warning ("Could not lauch headless libreoffice for conversion: %s", error->message); + g_clear_error (&error); + } + retval = 1; + goto out; + } + + g_subprocess_wait (lo_proc, NULL, &error); + g_object_unref (lo_proc); + g_free (orig_file_path); + + if (error != NULL) { + g_warning ("LibreOffice was unable to convert ppt to xml: %s", error->message); + g_clear_error (&error); + retval = 1; + goto out; + } + + xml_basename = g_strconcat (name_only, ".xml", NULL); + xml_file_path = g_build_filename (tmp_dir, xml_basename, NULL); + + xml_file = g_file_new_for_path (xml_file_path); + + if (!g_file_load_contents (xml_file, + NULL, + &content, + &length, + NULL, + &error)) { + if (error != NULL) { + g_warning ("Unable to read xml file: %s", error->message); + g_clear_error (&error); + retval = 1; + goto out; + } + } + + // remove doc settings which has content but is uninteresting + content = run_regex_replace ("<office:settings>[\\s\\S]*?</office:settings>", + content, + "", + &error); + + if (content == NULL) { + goto out; + } + + // remove any binary data content like embedded images + content = run_regex_replace ("<office:binary-data>[\\s\\S]*?</office:binary-data>", + content, + "", + &error); + + if (content == NULL) { + goto out; + } + + // remove any escaped markup as content + content = run_regex_replace ("<[\\s\\S]*?>", + content, + "", + &error); + + if (content == NULL) { + goto out; + } + + // remove all remaining markup + content = run_regex_replace ("<[^>]+>", + content, + " ", + &error); + + if (content == NULL) { + goto out; + } + + // remove excess whitespace, replace with a single space + content = run_regex_replace ("\\s+", + content, + " ", + &error); + + if (content == NULL) { + goto out; + } + + g_printf ("%s", content); + +out: + g_free (content); + g_free (name_only); + + g_free (xml_basename); + g_free (xml_file_path); + + if (error != NULL) + { + g_critical ("Could not extract strings from ppt file: %s", error->message); + g_error_free (error); + retval = 1; + } + + cleanup_tmp_dir (tmp_dir, xml_file); + g_clear_object (&xml_file); + g_free (tmp_dir); + + return retval; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/third-party/exif.nemo_search_helper new/nemo-5.0.3/search-helpers/third-party/exif.nemo_search_helper --- old/nemo-5.0.1/search-helpers/third-party/exif.nemo_search_helper 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/search-helpers/third-party/exif.nemo_search_helper 2021-07-02 11:50:04.000000000 +0200 @@ -1,5 +1,5 @@ [Nemo Search Helper] -TryExec=exif +TryExec=exif; Exec=exif -m %s MimeType=image/jpeg;image/png;image/gif;image/bmp;image/tiff; Priority=100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/third-party/id3.nemo_search_helper new/nemo-5.0.3/search-helpers/third-party/id3.nemo_search_helper --- old/nemo-5.0.1/search-helpers/third-party/id3.nemo_search_helper 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/search-helpers/third-party/id3.nemo_search_helper 2021-07-02 11:50:04.000000000 +0200 @@ -1,5 +1,5 @@ [Nemo Search Helper] -TryExec=id3 +TryExec=id3; Exec=id3 -l %s MimeType=audio/mpeg; Priority=100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/third-party/libreoffice.nemo_search_helper new/nemo-5.0.3/search-helpers/third-party/libreoffice.nemo_search_helper --- old/nemo-5.0.1/search-helpers/third-party/libreoffice.nemo_search_helper 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/search-helpers/third-party/libreoffice.nemo_search_helper 2021-07-02 11:50:04.000000000 +0200 @@ -1,5 +1,5 @@ [Nemo Search Helper] -TryExec=odt2txt +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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/third-party/meson.build new/nemo-5.0.3/search-helpers/third-party/meson.build --- old/nemo-5.0.1/search-helpers/third-party/meson.build 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/search-helpers/third-party/meson.build 2021-07-02 11:50:04.000000000 +0200 @@ -1,7 +1,10 @@ helpers = [ + 'untex.nemo_search_helper', 'exif.nemo_search_helper', 'id3.nemo_search_helper', 'libreoffice.nemo_search_helper', + 'mso-doc.nemo_search_helper', + 'mso-xls.nemo_search_helper', 'pdf2txt.nemo_search_helper', 'pdftotext.nemo_search_helper', 'ps2ascii.nemo_search_helper' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/third-party/mso-doc.nemo_search_helper new/nemo-5.0.3/search-helpers/third-party/mso-doc.nemo_search_helper --- old/nemo-5.0.1/search-helpers/third-party/mso-doc.nemo_search_helper 1970-01-01 01:00:00.000000000 +0100 +++ new/nemo-5.0.3/search-helpers/third-party/mso-doc.nemo_search_helper 2021-07-02 11:50:04.000000000 +0200 @@ -0,0 +1,5 @@ +[Nemo Search Helper] +TryExec=catdoc; +Exec=catdoc %s +MimeType=application/msword; +Priority=100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/third-party/mso-xls.nemo_search_helper new/nemo-5.0.3/search-helpers/third-party/mso-xls.nemo_search_helper --- old/nemo-5.0.1/search-helpers/third-party/mso-xls.nemo_search_helper 1970-01-01 01:00:00.000000000 +0100 +++ new/nemo-5.0.3/search-helpers/third-party/mso-xls.nemo_search_helper 2021-07-02 11:50:04.000000000 +0200 @@ -0,0 +1,5 @@ +[Nemo Search Helper] +TryExec=xls2csv; +Exec=xls2csv %s +MimeType=application/vnd.ms-excel; +Priority=100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/third-party/pdf2txt.nemo_search_helper new/nemo-5.0.3/search-helpers/third-party/pdf2txt.nemo_search_helper --- old/nemo-5.0.1/search-helpers/third-party/pdf2txt.nemo_search_helper 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/search-helpers/third-party/pdf2txt.nemo_search_helper 2021-07-02 11:50:04.000000000 +0200 @@ -1,5 +1,5 @@ [Nemo Search Helper] -TryExec=pdf2txt +TryExec=pdf2txt; Exec=pdf2txt %s MimeType=application/pdf; Priority=100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/third-party/pdftotext.nemo_search_helper new/nemo-5.0.3/search-helpers/third-party/pdftotext.nemo_search_helper --- old/nemo-5.0.1/search-helpers/third-party/pdftotext.nemo_search_helper 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/search-helpers/third-party/pdftotext.nemo_search_helper 2021-07-02 11:50:04.000000000 +0200 @@ -1,5 +1,5 @@ [Nemo Search Helper] -TryExec=pdftotext +TryExec=pdftotext; Exec=pdftotext %s - MimeType=application/pdf; Priority=200 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/third-party/ps2ascii.nemo_search_helper new/nemo-5.0.3/search-helpers/third-party/ps2ascii.nemo_search_helper --- old/nemo-5.0.1/search-helpers/third-party/ps2ascii.nemo_search_helper 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/search-helpers/third-party/ps2ascii.nemo_search_helper 2021-07-02 11:50:04.000000000 +0200 @@ -1,5 +1,5 @@ [Nemo Search Helper] -TryExec=ps2ascii +TryExec=ps2ascii; Exec=ps2ascii %s MimeType=application/ps; Priority=100; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/search-helpers/third-party/untex.nemo_search_helper new/nemo-5.0.3/search-helpers/third-party/untex.nemo_search_helper --- old/nemo-5.0.1/search-helpers/third-party/untex.nemo_search_helper 1970-01-01 01:00:00.000000000 +0100 +++ new/nemo-5.0.3/search-helpers/third-party/untex.nemo_search_helper 2021-07-02 11:50:04.000000000 +0200 @@ -0,0 +1,5 @@ +[Nemo Search Helper] +TryExec=untex; +Exec=untex %s +MimeType=text/x-tex; +Priority=100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/src/nemo-blank-desktop-window.c new/nemo-5.0.3/src/nemo-blank-desktop-window.c --- old/nemo-5.0.1/src/nemo-blank-desktop-window.c 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/src/nemo-blank-desktop-window.c 2021-07-02 11:50:04.000000000 +0200 @@ -33,6 +33,7 @@ #include <libnemo-private/nemo-action.h> #include <libnemo-private/nemo-file.h> #include <libnemo-private/nemo-file-utilities.h> +#include <libnemo-private/nemo-global-preferences.h> #include <eel/eel-gtk-extensions.h> @@ -79,7 +80,7 @@ } static void -actions_changed_cb (NemoBlankDesktopWindow *window) +reset_popup_menu (NemoBlankDesktopWindow *window) { g_clear_pointer (&window->details->popup_menu, gtk_widget_destroy); } @@ -91,18 +92,20 @@ return; } + gboolean show_customize; NemoActionManager *desktop_action_manager = nemo_desktop_manager_get_action_manager (); if (window->details->actions_changed_id == 0) { window->details->actions_changed_id = g_signal_connect_swapped (desktop_action_manager, "changed", - G_CALLBACK (actions_changed_cb), + G_CALLBACK (reset_popup_menu), window); } + show_customize = g_settings_get_boolean (nemo_menu_config_preferences, "desktop-menu-customize"); GList *action_list = nemo_action_manager_list_actions (desktop_action_manager); - if (g_list_length (action_list) == 0) + if (g_list_length (action_list) == 0 && !show_customize) return; window->details->popup_menu = gtk_menu_new (); @@ -144,6 +147,10 @@ } } + if (!show_customize) { + return; + } + item = gtk_menu_item_new_with_label (_("Customize")); gtk_widget_set_visible (item, TRUE); @@ -155,6 +162,11 @@ do_popup_menu (NemoBlankDesktopWindow *window, GdkEventButton *event) { build_menu (window); + + if (window->details->popup_menu == NULL) { + return; + } + eel_pop_up_context_menu (GTK_MENU(window->details->popup_menu), event); } @@ -192,6 +204,8 @@ window->details->actions_changed_id = 0; } + g_signal_handlers_disconnect_by_func (nemo_menu_config_preferences, reset_popup_menu, window); + G_OBJECT_CLASS (nemo_blank_desktop_window_parent_class)->dispose (obj); } @@ -233,6 +247,11 @@ g_signal_connect (GTK_WIDGET (window), "button-press-event", G_CALLBACK (on_button_press), window); g_signal_connect (GTK_WIDGET (window), "popup-menu", G_CALLBACK (on_popup_menu), window); + + g_signal_connect_swapped (nemo_menu_config_preferences, + "changed::desktop-menu-customize", + G_CALLBACK (reset_popup_menu), + window); } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/src/nemo-mime-actions.c new/nemo-5.0.3/src/nemo-mime-actions.c --- old/nemo-5.0.1/src/nemo-mime-actions.c 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/src/nemo-mime-actions.c 2021-07-02 11:50:04.000000000 +0200 @@ -1491,9 +1491,12 @@ { NemoFile *single_file; char **sortable_image_viewers; + gboolean accepts_uri_list; - if (uris != NULL && uris->next == NULL) { + accepts_uri_list = g_strstr_len (g_app_info_get_commandline (application), -1, "%F") || + g_strstr_len (g_app_info_get_commandline (application), -1, "%U"); + if (uris != NULL && uris->next == NULL && accepts_uri_list) { sortable_image_viewers = g_settings_get_strv (nemo_preferences, NEMO_PREFERENCES_IMAGE_VIEWERS_WITH_EXTERNAL_SORT); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/src/nemo-query-editor.c new/nemo-5.0.3/src/nemo-query-editor.c --- old/nemo-5.0.1/src/nemo-query-editor.c 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/src/nemo-query-editor.c 2021-07-02 11:50:04.000000000 +0200 @@ -561,7 +561,9 @@ separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_box_pack_start (GTK_BOX (editor), separator, FALSE, FALSE, 0); - gtk_widget_show (separator); + g_object_bind_property (priv->infobar, "visible", + separator, "visible", + G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); priv->focus_chain = g_list_append (NULL, priv->file_entry); priv->focus_chain = g_list_append (priv->focus_chain, priv->content_entry); @@ -723,12 +725,20 @@ gtk_widget_show (editor->priv->infobar); gtk_widget_queue_resize (GTK_WIDGET (editor->priv->infobar)); + const gchar *content_forbidden_dirs[] = { + "file:///dev", + "file:///proc", + "file:///run", + "file:///sys", + NULL + }; + g_clear_pointer (&editor->priv->base_uri, g_free); editor->priv->base_uri = base_uri; base = g_file_new_for_uri (base_uri); - if (g_file_is_native (base)) { + if (g_file_is_native (base) && !g_strv_contains (content_forbidden_dirs, base_uri)) { gtk_widget_set_sensitive (editor->priv->content_main_box, TRUE); gtk_entry_set_placeholder_text (GTK_ENTRY (editor->priv->content_entry), ""); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nemo-5.0.1/src/nemo-view.c new/nemo-5.0.3/src/nemo-view.c --- old/nemo-5.0.1/src/nemo-view.c 2021-06-10 15:02:11.000000000 +0200 +++ new/nemo-5.0.3/src/nemo-view.c 2021-07-02 11:50:04.000000000 +0200 @@ -5648,6 +5648,8 @@ gtk_action_set_sensitive (action, sensitive); g_object_set (action, "is-important", priority, NULL); + // FIXME: Don't add the selection to the action data. + // Just grab the selection in the activation callback. data = g_new0 (ExtensionActionCallbackData, 1); data->item = g_object_ref (item); data->view = view; @@ -10053,6 +10055,7 @@ update_actions_visibility (view, selection); reset_extension_actions_menu (view, selection); + update_configurable_context_menu_items (view); nemo_file_list_free (selection); } @@ -10601,6 +10604,15 @@ { g_return_if_fail (NEMO_IS_VIEW (view)); + if (view->details->window) { + GtkUIManager *ui_manager; + + ui_manager = nemo_window_get_ui_manager (view->details->window); + nemo_ui_unmerge_ui (ui_manager, + &view->details->extensions_menu_merge_id, + &view->details->extensions_menu_action_group); + } + unschedule_display_of_pending_files (view); reset_update_interval (view);
