From 40da2161b79ee55b52d73c639d6144fe0deb3921 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Mon, 20 Feb 2023 09:45:25 +0000 Subject: [PATCH] Fix #1061: meson fails to detect strverscmp https://github.com/BestImageViewer/geeqie/issues/1061 Delete Sort By Number option. Use Natural Sort Order on Edit/Preferences/File Filters instead. --- config.h.in | 3 --- doc/docbook/GuideOptionsFiltering.xml | 1 + doc/docbook/GuideReferenceCollectionsShortcuts.xml | 1 - meson.build | 5 ----- scripts/geeqie.cppcheck | 1 - src/collect-table.cc | 1 - src/collect.cc | 10 ---------- src/filedata.cc | 6 ------ src/main.h | 6 ------ src/menu.cc | 6 ------ src/preferences.cc | 2 +- src/typedefs.h | 1 - 12 files changed, 2 insertions(+), 41 deletions(-) diff --git a/config.h.in b/config.h.in index ab5e2825..24f8ee0c 100644 --- a/config.h.in +++ b/config.h.in @@ -160,9 +160,6 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 -/* Define to 1 if you have the `strverscmp' function. */ -#mesondefine HAVE_STRVERSCMP - /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 diff --git a/doc/docbook/GuideOptionsFiltering.xml b/doc/docbook/GuideOptionsFiltering.xml index 5cfead35..6c5e82cd 100644 --- a/doc/docbook/GuideOptionsFiltering.xml +++ b/doc/docbook/GuideOptionsFiltering.xml @@ -41,6 +41,7 @@ Files and folders are sorted with the dot '.' treated as a special case, so the order is e.g. "event.c" "event.h" "eventgenerator.c". Also, files containing numbers are sorted as "file1" "file5" "file10". + If this option is selected and a standard numerical sort is required and the files are in a single folder, a workaround is to put the files in a temporary collection and select Sort By Path diff --git a/doc/docbook/GuideReferenceCollectionsShortcuts.xml b/doc/docbook/GuideReferenceCollectionsShortcuts.xml index 5c68fa71..e830cac0 100644 --- a/doc/docbook/GuideReferenceCollectionsShortcuts.xml +++ b/doc/docbook/GuideReferenceCollectionsShortcuts.xml @@ -42,7 +42,6 @@ keyboard shortcuts Ctrl + S Save collection as Ctrl + T Show filename text N Sort by name - I Sort by number D Sort by date B Sort by size P Sort by path diff --git a/meson.build b/meson.build index 4552e8ce..7d7efd88 100644 --- a/meson.build +++ b/meson.build @@ -500,11 +500,6 @@ else summary({'nl_langinfo' : ['nl_langinfo not found - first weekday depends on locale:', false, 'first weekday defaults to Monday']}, section : 'Documentation', bool_yn : true) endif -result = cc.has_function('strverscmp', prefix : '#include ') -if result - conf_data.set('HAVE_STRVERSCMP', 1) -endif - conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name()) conf_data.set_quoted('GQ_APPDIR', gq_appdir) conf_data.set_quoted('GQ_BINDIR', gq_bindir) diff --git a/scripts/geeqie.cppcheck b/scripts/geeqie.cppcheck index 04e85b8c..3dcf3dfd 100644 --- a/scripts/geeqie.cppcheck +++ b/scripts/geeqie.cppcheck @@ -35,7 +35,6 @@ - diff --git a/src/collect-table.cc b/src/collect-table.cc index fc846f42..df013473 100644 --- a/src/collect-table.cc +++ b/src/collect-table.cc @@ -95,7 +95,6 @@ hard_coded_window_keys collection_window_keys[] = { {GDK_CONTROL_MASK, 'S', N_("Save collection as")}, {GDK_CONTROL_MASK, 'T', N_("Show filename text")}, {0, 'N', N_("Sort by name")}, - {0, 'I', N_("Sort by number")}, {0, 'D', N_("Sort by date")}, {0, 'B', N_("Sort by size")}, {0, 'P', N_("Sort by path")}, diff --git a/src/collect.cc b/src/collect.cc index 09847352..82a53a17 100644 --- a/src/collect.cc +++ b/src/collect.cc @@ -183,11 +183,6 @@ static gint collection_list_sort_cb(gconstpointer a, gconstpointer b) if (cia->fd->format_class < cib->fd->format_class) return -1; if (cia->fd->format_class > cib->fd->format_class) return 1; break; -#ifdef HAVE_STRVERSCMP - case SORT_NUMBER: - return strverscmp(cia->fd->name, cib->fd->name); - break; -#endif default: break; } @@ -1030,11 +1025,6 @@ static gboolean collection_window_keypress(GtkWidget *UNUSED(widget), GdkEventKe case 'N': case 'n': collection_set_sort_method(cw->cd, SORT_NAME); break; -#ifdef HAVE_STRVERSCMP - case 'I': case 'i': - collection_set_sort_method(cw->cd, SORT_NUMBER); - break; -#endif case 'D': case 'd': collection_set_sort_method(cw->cd, SORT_TIME); break; diff --git a/src/filedata.cc b/src/filedata.cc index f9356f54..5c165b7f 100644 --- a/src/filedata.cc +++ b/src/filedata.cc @@ -1157,12 +1157,6 @@ gint filelist_sort_compare_filedata(FileData *fa, FileData *fb) if (fa->format_class > fb->format_class) return 1; /* fall back to name */ break; -#ifdef HAVE_STRVERSCMP - case SORT_NUMBER: - ret = strverscmp(fa->name, fb->name); - if (ret != 0) return ret; - break; -#endif default: break; } diff --git a/src/main.h b/src/main.h index 1ade3dde..a2e3dfb4 100644 --- a/src/main.h +++ b/src/main.h @@ -24,12 +24,6 @@ #include -#ifdef HAVE_STRVERSCMP -# ifndef _GNU_SOURCE -# define _GNU_SOURCE -# endif -#endif - #include "intl.h" diff --git a/src/menu.cc b/src/menu.cc index 1f266d3a..1ded25af 100644 --- a/src/menu.cc +++ b/src/menu.cc @@ -155,9 +155,6 @@ gchar *sort_type_get_text(SortType method) case SORT_PATH: return _("Sort by path"); break; - case SORT_NUMBER: - return _("Sort by number"); - break; case SORT_RATING: return _("Sort by rating"); break; @@ -204,9 +201,6 @@ GtkWidget *submenu_add_sort(GtkWidget *menu, GCallback func, gpointer data, g_object_set_data(G_OBJECT(submenu), "submenu_data", data); submenu_add_sort_item(submenu, func, SORT_NAME, show_current, type); -#ifdef HAVE_STRVERSCMP - submenu_add_sort_item(submenu, func, SORT_NUMBER, show_current, type); -#endif submenu_add_sort_item(submenu, func, SORT_TIME, show_current, type); submenu_add_sort_item(submenu, func, SORT_CTIME, show_current, type); submenu_add_sort_item(submenu, func, SORT_EXIFTIME, show_current, type); diff --git a/src/preferences.cc b/src/preferences.cc index 9fd6937f..db16cd4d 100644 --- a/src/preferences.cc +++ b/src/preferences.cc @@ -2689,7 +2689,7 @@ static void config_tab_files(GtkWidget *notebook) options->file_filter.show_parent_directory, &c_options->file_filter.show_parent_directory); pref_checkbox_new_int(group, _("Case sensitive sort"), options->file_sort.case_sensitive, &c_options->file_sort.case_sensitive); - pref_checkbox_new_int(group, _("Natural sort order"), + pref_checkbox_new_int(group, _("Natural sort order - Requires restart"), options->file_sort.natural, &c_options->file_sort.natural); pref_checkbox_new_int(group, _("Disable file extension checks"), options->file_filter.disable_file_extension_checks, &c_options->file_filter.disable_file_extension_checks); diff --git a/src/typedefs.h b/src/typedefs.h index bbf6ca52..e49f65b8 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -83,7 +83,6 @@ typedef enum { SORT_TIME, SORT_CTIME, SORT_PATH, - SORT_NUMBER, SORT_EXIFTIME, SORT_EXIFTIMEDIGITIZED, SORT_RATING, -- 2.20.1