Skip to content

Commit f41bec4

Browse files
committed
Implement cache maintenance command line feature
1 parent 2ec35a8 commit f41bec4

File tree

6 files changed

+20
-26
lines changed

6 files changed

+20
-26
lines changed

doc/create-shortcuts-xml.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ awk_window='BEGIN {
8383
LINT = "fatal"
8484
FS = ","
8585
getline
86-
while ($0 !~ /^hard_coded_window_keys/) {getline}
86+
while ($0 !~ /^static hard_coded_window_keys/) {getline}
8787
}
8888
8989
$0~/\{static_cast<GdkModifierType>\(0\), 0/ {exit}

doc/docbook/CommandLineOptions.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<refmeta>
88
<refentrytitle>GEEQIE</refentrytitle>
99
<manvolnum>1</manvolnum>
10-
<refmiscinfo class='source'>November 2024</refmiscinfo>
11-
<refmiscinfo class='manual'>Geeqie 2.5+git20241126-85764a0f GTK3</refmiscinfo>
10+
<refmiscinfo class='source'>January 2025</refmiscinfo>
11+
<refmiscinfo class='manual'>Geeqie 2.5+git20250101-2ec35a8e GTK3</refmiscinfo>
1212
</refmeta>
1313
<refnamediv>
1414
<refname>Geeqie</refname>
@@ -28,7 +28,7 @@ zooming, panning, thumbnails and sorting images into collections.</para>
2828

2929
<para>Geeqie is an image viewer.</para>
3030

31-
<para>Version: Geeqie 2.5+git20241126-85764a0f</para>
31+
<para>Version: Geeqie 2.5+git20250101-2ec35a8e</para>
3232
</refsect2>
3333

3434
<refsect2 id='help_options'><title>Help Options:</title>
@@ -269,7 +269,7 @@ zooming, panning, thumbnails and sorting images into collections.</para>
269269
<varlistentry>
270270
<term><emphasis role='strong' remap='B'>-o</emphasis>, <emphasis role='strong' remap='B'>--log-file=</emphasis>&lt;file&gt;</term>
271271
<listitem>
272-
<para>open collection window for command line</para>
272+
<para>save log data to file</para>
273273
</listitem>
274274
</varlistentry>
275275
<varlistentry>
@@ -394,13 +394,13 @@ GQ_NEW_INSTANCE=y[es] geeqie
394394
Normally a single set of configuration files is used for all instances.
395395
However, the environment variables XDG_CONFIG_HOME, XDG_CACHE_HOME, XDG_DATA_HOME
396396
can be used to modify this behavior on an individual basis e.g.
397-
XDG_CONFIG_HOME=/tmp/a XDG_CACHE_HOME=/tmp/b GQ_NON_UNIQUE= geeqie</para>
397+
XDG_CONFIG_HOME=/tmp/a XDG_CACHE_HOME=/tmp/b GQ_NEW_INSTANCE=y geeqie</para>
398398

399399
<para>To disable Clutter use:
400400
GQ_DISABLE_CLUTTER=y[es] geeqie</para>
401401

402402
<para>To run or stop Geeqie in cache maintenance (non-GUI) mode use:
403-
GQ_CACHE_MAINTENANCE=y[es] geeqie <emphasis role='strong' remap='B'>--help</emphasis> (This is disabled in this version and will be fixed in a future version.)</para>
403+
GQ_CACHE_MAINTENANCE=y[es] geeqie <emphasis role='strong' remap='B'>--help</emphasis></para>
404404

405405
<para>User manual: https://www.geeqie.org/help/GuideIndex.html</para>
406406

@@ -416,7 +416,7 @@ GQ_CACHE_MAINTENANCE=y[es] geeqie <emphasis role='strong' remap='B'>--help</emph
416416
</refsect1>
417417

418418
<refsect1 id='copyright'><title>COPYRIGHT</title>
419-
<para>Copyright (C) 1999-2004 by John Ellis. Copyright (C) 2004-2024 by The Geeqie Team. Use this software at your
419+
<para>Copyright (C) 1999-2004 by John Ellis. Copyright (C) 2004-2025 by The Geeqie Team. Use this software at your
420420
own risk! This software released under the GNU General Public License. Please read the COPYING file for more
421421
information.</para>
422422
</refsect1>

doc/docbook/GuideReferenceManagement.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
<section id="CacheMaintenance">
171171
<title>Command line program</title>
172172
<para>
173-
Geeqie can be run as a command line program: <code>geeqie --cache-maintenance &lt;path to images&gt;</code>. It will recursively remove orphaned thumbnails and .sim files, and create thumbnails and similarity data for all images found.
173+
Geeqie can be run as a command line program: <code>GQ_CACHE_MAINTENANCE=y[es] geeqie --cache-maintenance &lt;path to images&gt;</code>. It will recursively remove orphaned thumbnails and .sim files, and create thumbnails and similarity data for all images found.
174174
<para/>
175175
It may also be called from <code>cron</code> or <code>anacron</code> thus enabling automatic updating of the cached data for all your images.
176176
</para>

geeqie.1

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
2-
.TH GEEQIE "1" "November 2024" "Geeqie 2.5+git20241126-85764a0f GTK3" "User Commands"
2+
.TH GEEQIE "1" "January 2025" "Geeqie 2.5+git20250101-2ec35a8e GTK3" "User Commands"
33
.SH NAME
44
Geeqie - GTK based multiformat image viewer
55
.SH DESCRIPTION
@@ -13,7 +13,7 @@ geeqie [OPTION?] [path...]
1313
.PP
1414
Geeqie is an image viewer.
1515
.IP
16-
Version: Geeqie 2.5+git20241126\-85764a0f
16+
Version: Geeqie 2.5+git20250101\-2ec35a8e
1717
.SS "Help Options:"
1818
.TP
1919
\fB\-h\fR, \fB\-\-help\fR
@@ -132,7 +132,7 @@ window id for following commands
132132
last image
133133
.TP
134134
\fB\-o\fR, \fB\-\-log\-file=\fR<file>
135-
open collection window for command line
135+
save log data to file
136136
.TP
137137
\fB\-\-lua=\fR<FILE>,<lua script>
138138
run lua script on FILE
@@ -203,20 +203,20 @@ GQ_NEW_INSTANCE=y[es] geeqie
203203
Normally a single set of configuration files is used for all instances.
204204
However, the environment variables XDG_CONFIG_HOME, XDG_CACHE_HOME, XDG_DATA_HOME
205205
can be used to modify this behavior on an individual basis e.g.
206-
XDG_CONFIG_HOME=/tmp/a XDG_CACHE_HOME=/tmp/b GQ_NON_UNIQUE= geeqie
206+
XDG_CONFIG_HOME=/tmp/a XDG_CACHE_HOME=/tmp/b GQ_NEW_INSTANCE=y geeqie
207207
.IP
208208
To disable Clutter use:
209209
GQ_DISABLE_CLUTTER=y[es] geeqie
210210
.IP
211211
To run or stop Geeqie in cache maintenance (non\-GUI) mode use:
212-
GQ_CACHE_MAINTENANCE=y[es] geeqie \fB\-\-help\fR (This is disabled in this version and will be fixed in a future version.)
212+
GQ_CACHE_MAINTENANCE=y[es] geeqie \fB\-\-help\fR
213213
.IP
214214
User manual: https://www.geeqie.org/help/GuideIndex.html
215215
.IP
216216
: https://www.geeqie.org/help\-pdf/help.pdf
217217
.SH BUGS
218218
Please send bug reports and feedback to https://github.com/BestImageViewer/geeqie/issues
219219
.SH COPYRIGHT
220-
Copyright (C) 1999-2004 by John Ellis. Copyright (C) 2004-2024 by The Geeqie Team. Use this software at your
220+
Copyright (C) 1999-2004 by John Ellis. Copyright (C) 2004-2025 by The Geeqie Team. Use this software at your
221221
own risk! This software released under the GNU General Public License. Please read the COPYING file for more
222222
information.

src/cache-maint.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -1699,9 +1699,7 @@ void cache_maintenance_notification(GtkApplication *app, const gchar *message, g
16991699
geeqie_icon = g_themed_icon_new(PIXBUF_INLINE_ICON);
17001700

17011701
g_notification_set_body(notification, message);
1702-
g_notification_set_icon(notification, geeqie_icon);
1703-
g_notification_set_priority(notification, G_NOTIFICATION_PRIORITY_LOW);
1704-
g_notification_set_priority(notification, G_NOTIFICATION_PRIORITY_URGENT);
1702+
g_notification_set_priority(notification, G_NOTIFICATION_PRIORITY_NORMAL);
17051703
g_notification_set_title(notification, _("Cache Maintenance"));
17061704

17071705
if (show_quit_button)

src/main.cc

+4-8
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ XDG_CONFIG_HOME=/tmp/a XDG_CACHE_HOME=/tmp/b GQ_NEW_INSTANCE=y geeqie\n\n \
117117
To disable Clutter use:\n \
118118
GQ_DISABLE_CLUTTER=y[es] geeqie\n\n \
119119
To run or stop Geeqie in cache maintenance (non-GUI) mode use:\n \
120-
GQ_CACHE_MAINTENANCE=y[es] geeqie --help (This is disabled in this version and will be fixed in a future version.)\n\n \
120+
GQ_CACHE_MAINTENANCE=y[es] geeqie --help\n\n \
121121
User manual: https://www.geeqie.org/help/GuideIndex.html\n \
122122
: https://www.geeqie.org/help-pdf/help.pdf");
123123

124124
const gchar *option_context_description_cache_maintenance = _(" \
125-
This will recursively remove orphaned thumbnails and .sim files, and create thumbnails\n \
126-
and similarity data for all images found under FOLDER.\n \
125+
This is a command line program that will recursively remove orphaned thumbnails and\n \
126+
.sim files, and create thumbnails and similarity data for all images found under FOLDER.\n \
127127
It may also be called from cron or anacron thus enabling automatic updating of the cached\n \
128128
data for all your images.\n\n \
129129
User manual: https://www.geeqie.org/help/GuideIndex.html\n \
@@ -1082,16 +1082,12 @@ gint main(gint argc, gchar *argv[])
10821082
const gchar *gq_cache_maintenance = g_getenv("GQ_CACHE_MAINTENANCE");
10831083
if (gq_cache_maintenance && tolower(gq_cache_maintenance[0]) == 'y')
10841084
{
1085-
/* Disabled at the moment */
1086-
log_printf("Command line cache maintenance is disabled in this version.\nThis will be fixed in a future version.");
1087-
return 1;
1088-
10891085
app = gtk_application_new("org.geeqie.cache-maintenance", static_cast<GApplicationFlags>( G_APPLICATION_HANDLES_COMMAND_LINE | G_APPLICATION_SEND_ENVIRONMENT));
10901086
g_application_add_main_option_entries(G_APPLICATION(app), command_line_options_cache_maintenance);
10911087

10921088
g_application_set_option_context_parameter_string (G_APPLICATION(app), \
10931089
_("\n\nUsage for cache maintenance:\n \
1094-
GQ_CACHE_MAINTENANCE= geeqie OPTION"));
1090+
GQ_CACHE_MAINTENANCE=y[es] geeqie OPTION"));
10951091

10961092
g_autofree gchar *version_string = g_strconcat(
10971093
_("Geeqie Cache Maintenance. \n \

0 commit comments

Comments
 (0)