diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2024-01-26 16:54:57 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2024-01-26 16:57:36 +0100 |
commit | 67433f377693d1598a14da8bbb82136247dd5810 (patch) | |
tree | 2b46bea5853b9e27d02461d4435d0470921ac677 | |
parent | c1418c74627735276dd9f215ddd43937227b0f97 (diff) | |
download | fiv-67433f377693d1598a14da8bbb82136247dd5810.tar.gz fiv-67433f377693d1598a14da8bbb82136247dd5810.tar.xz fiv-67433f377693d1598a14da8bbb82136247dd5810.zip |
Add a --collection toggle
One possible use of it is to avoid thumbnailing the parent directory.
-rw-r--r-- | docs/fiv.adoc | 4 | ||||
-rw-r--r-- | fiv.c | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/docs/fiv.adoc b/docs/fiv.adoc index 5285d5d..0188086 100644 --- a/docs/fiv.adoc +++ b/docs/fiv.adoc @@ -32,6 +32,10 @@ Options handler to implement the "Open Containing Folder" feature of certain applications. +*--collection*:: + Always put arguments in a virtual directory, even when only one is passed. + Implies *--browse*. + *--help-all*:: Show the full list of options, including those provided by GTK+. @@ -2453,7 +2453,7 @@ on_app_startup(GApplication *app, G_GNUC_UNUSED gpointer user_data) } static struct { - gboolean browse, extract_thumbnail; + gboolean browse, collection, extract_thumbnail; gchar **args, *thumbnail_size, *thumbnail_size_search; } o; @@ -2463,12 +2463,12 @@ on_app_activate( { // XXX: We follow the behaviour of Firefox and Eye of GNOME, which both // interpret multiple command line arguments differently, as a collection. - // However, single-element collections are unrepresentable this way. - // Should we allow multiple targets only in a special new mode? + // However, single-element collections are unrepresentable this way, + // so we have a switch to enforce it. g.files_index = -1; if (o.args) { const gchar *target = *o.args; - if (o.args[1]) { + if (o.args[1] || o.collection) { fiv_collection_reload(o.args); target = FIV_COLLECTION_SCHEME ":/"; } @@ -2619,6 +2619,9 @@ main(int argc, char *argv[]) {"browse", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &o.browse, "Start in filesystem browsing mode", NULL}, + {"collection", 0, G_OPTION_FLAG_IN_MAIN, + G_OPTION_ARG_NONE, &o.collection, + "Always put arguments in a collection (implies --browse)", NULL}, {"invalidate-cache", 0, G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, NULL, "Invalidate the wide thumbnail cache", NULL}, |