The Bug 443168 discussion - gwenview option related to sorting order

To not clutter the Bug tracker, continue conversation of Bug 443168 here.

In reply to JoostR [comment 26]

You are assuming that people want a link between Dolpin and Gwenview: I personally don’t see the value of such a link, I even think it will be inherently confusing for any users that don’t or rarely use Dolphin, but I think my bug report left that open.

Yes, it may be assumed. Dolphin is default KDE file browser, Gwenview is KDE default image browser/viewer. The value of such a connection definitely exist. This is general behavior. Look how it works in Windows for example. The default viewer follows the sorting order in Explorer.

Such an extra setting to follow Dolphin could be a solution, but as somebody who doesn’t see the value of a link between Dolphin and Gwenview I personally would find that it just adds clutter to a great app. Some people use other file managers than Dolphin, and these kinds of links between apps confuse the principle of making simple apps that are good at one thing.

This is not a clutter. We should make it good for many people. As you can see, there are lots of duplicate bugs asking to add synchronization. If you prefer that to not happen, you can disable the “keep dolphin order when opening”.

As far as I am concerned the bug I reported is that gwenview does not adhere to its own settings when you open it directly, which is really bad.

When you launch it directly, where does it not following its own settings? If you mean when from going from Start page, than see Bug 464959.

Also I really don’t want to make this personal in any way, but it seems to me you are the first person in this thread who was confused by that original title, probably because you were looking for a solution for your issue, which is slightly different?

Did not I explained that in comment 21?

So perhaps you should perhaps file a bug report for your issue, or I believe you are citing a bug report of your issue that already exists, I didn’t check.

Ok, I will repeat. For me the issue is that Gwenview currently does not follow Dolphin’s sorting order when opening from dolphin. But as some people want to enforce it to not follow it (I mean, when launched by image click), the option is needed.

So if you don’t mind, I am changing the title back to a slighly modified version of the original: ‘on starting gwenview ignores its own settings concerning sort order’

As I said above, please verify you are talking about Bug 464959. If that is the case, please change it back.

1 Like

Hi,

yes, thanks, it is a good idea not to clutter the bug tracker.

That is a judgement I would like to leave up to the community. I think there are several people in the bugtracker thread who explicitly said that they were not using Dolphin or did not see the value of such a link.

If there is indeed a desire for a Windows-style integration than that is a discussion that goes much further than this particular point. I use Linux because it is Linux and I use(d) Gwenview because it is a great app.

I usually start gwenview from the command line (or from the dmenu that I use in the i3 window manager) and what happens is that gwenview follows the sort setting of the last Dolphin window I opened instead of following its own sort settings. Because the opening of that last Dolphin window may in my case have been hours or even days ago, it took me a really long time to find out that what I thought was just erratic behaviour was in fact linked to Dolphin :wink:

So that was the reason for my later comment that if more integration is wanted, the sort setting of gwenview should perhaps be simply removed, or even better in that case gwenview should be integrated into Dolphin to avoid the confusion caused by Gwenview having its own sort order setting.

I disagree, but that is linked to my non-desire for Windows-like integration.
If Gwenview and Dolphin remain separate applications, and if the opinion is that this issue should be solved by adding an extra setting, I believe that extra setting should be called something like “follow Dolphin sort order”. This could be on by default if integration is wanted, so people like me can switch that off. But at least in its formulation it would respect the design principle that each app has its own settings.

That is another bug, since it is the exact opposite of the bug I reported :slight_smile:

So: was my bug fixed ? I don’t think so ?
Strange, I can’t actually reproduce what you report: if I click on an image in Dolphin, Gwenview opens and follows the sort order of that Dolphin window (not its own settings, what I still find the most reasonable thing to expect).
Are you on gwenview version 23.04.3-1, which is currently the latest version in Arch Linux ?
Bizarre…
Are you using split views or tabs perhaps ?

More detailed:
my gwenview sort setting is ‘sort by name’.
I close gwenview.
I open a Dolphin window and set sort order to ‘sort by date’.
I click on an image in the Dolphin file listing and it opens gwenview.
The actual sort order I see in Gwenview is according to ‘sort by date’ and not according to ‘sort by name’ which is still visibly set as he gwenview sort setting (as expected).
So it is ignoring its own settings.

I still find it incomprehensible as a design choice for an app to ignore its own setting and I would never expect settings of one app to be changed by another app either.

That is a judgement I would like to leave up to the community.

As I said, just count the requests for this. Including myself.
I plainly cannot understand why are you resisting of introduction of the option, which you can just disable? I mean, because you do not want that, does not mean others do not want that.

and what happens is that gwenview follows the sort setting of the last Dolphin window I opened instead of following its own sort settings.

Some things are currently broken (not always following dolphin, see mentioned bug report). Also, I was talking about launching by image click, not from start menu (or command line). In the latter case it should not follow dolphin’s folder (and when the mentioned bug will be fixed, unless this sort options was previously selected). I did not checked what sorting happens when launching gwenview from terminal with the image as parameter.

That is another bug, since it is the exact opposite of the bug I reported :slight_smile:

In other words, you say that you want this option to be off, and you convince me to not implement it? :slightly_smiling_face:

was my bug fixed ?

What is “your” bug again? You want the Gwenview to respect its settings, what can be simpler. I already explained how this can be achieved. So is the bug fixed? Not yet, obviously.

if I click on an image in Dolphin, Gwenview opens and follows the sort order of that Dolphin window (not its own settings, what I still find the most reasonable thing to expect).

Because currently there is no option to disable following dolphin order. You yourself said in the first comment (on bugzilla) that it happened “It seems a consequence of work on this bug”.

I will repeat again, that I said many times already: current situation is that the following dolphin sorting feature is partly broken (partly implemented) itself. And besides that, you cannot disable it currently.

Are you on gwenview version 23.04.3-1, which is currently the latest version in Arch Linux ?

Ah, you using Arch btw. I am using gwenview 23.07.80-1 from kde-unstable.

I hope now I clarified all things. And you can change back the title I wrote.

First of all, this behavior was driving me crazy and I couldn’t understand why it was happening, so at least this discussion explains the weird behavior. So thank you.

I think there are several ways to look at this issue:

  1. Its OK that Gwenview follows Dolphin sort order - it is by design. The bug is that Gwenview has a short menu at all: if there’s a setting that is then ignored by the app - this is a bug.
  2. Gwenview should not use Dolphin sort order at all, its a behavior a lot of users find perplexing. It is a misbehavior - Gwenview should follow its own sort order.
  3. Using Dolphin’s sort order is useful when being launched from Dolphin, but not otherwise. This is a missing feature - Gwenview should know when it is launched from Dolphin and only use Dolphin’s sort order then, and otherwise - use its configured sort order. There is also a bug here - Gwenview’s “Sort By” submenu should reflect that it using Dolphin’s sort order.
    3.a. Another way to solve the missing feature is to have a configuration option to “Ignore Dolphin’s sort order” and let whoever wants to do so check that.

My preferred solution would actually be 3a: I often start Gwenview from a Dolphin window that is set to “sort by time” but then I start making edits and using “Save as” to save copies (or using other tools launched from Gwenview’s “Open with” menu that create similarly named files), so I want right/left navigation to move between the similarly named files.

  1. Its OK that Gwenview follows Dolphin sort order - it is by design. The bug is that Gwenview has a sort menu at all: if there’s a setting that is then ignored by the app - this is a bug.

It is questionable if we should remove the sorting feature in Gwenview.
Currently, as I see it, Gwenview is like a “image/video file manager”, i.e. it globally applies filter to only show images and (if enabled) video files.
Many people use it as an import manager for transferring photos and videos from camera. Personally I use Dolphin for that. I never use the Gwenview alone as an image manager, but just use it as an image viewer (like I mentioned in the bug tracker). I also disabled showing video files feature, because it breaks my workflow. It breaks possibility to press arrow to go to next item. More on that, playing is not working appropriately.

People may want to apply arbitrary image field sorting (and maybe even edit some of them). Somebody may want a complex sorting rules, like for example, adding second sorting rule, or applying filters during sort. But despite Dolphin has much fields to sort files, it still may lack some image specific fields. And there were some requests to add specific sorting fields to Gwenview (see 473661 – Meta bug for sorting possibilities). This probably can be added as a plugin for Dolphin instead.

In other words, for that, we need to consult other users. But I guess that the solution will be extending sorting possibilities in Gwenview, not removing them.

  1. Gwenview should not use Dolphin sort order at all, its a behavior a lot of users find perplexing. It is a misbehavior - Gwenview should follow its own sort order.

This approach is incorrect. Imagine a simple scenario: you want to start a slideshow from folder you view in Dolphin. And people expect it to even follow “virtual” or “tag” folders. See the reports in meta bug I mentioned above.

  1. Using Dolphin’s sort order is useful when being launched from Dolphin, but not otherwise. This is a missing feature - Gwenview should know when it is launched from Dolphin and only use Dolphin’s sort order then, and otherwise - use its configured sort order. There is also a bug here - Gwenview’s “Sort By” submenu should reflect that it using Dolphin’s sort order.

There should be a sort entry “as in dolphin” (which will be reflected when it applied).
The option that we discuss here in 443168 (to add a checkbox “never switch to ‘as in dolphin’ sort when launched from dolphin”) may decide if it should be switched to that mode or not.

Probably, also the option “apply dolphin sort when opened from dolphin, but do not remember this sort option, so when you launch directly, it will apply to previous sort mode”. Maybe the OP mean that.

  1. a. Another way to solve the missing feature is to have a configuration option to “Ignore Dolphin’s sort order” and let whoever wants to do so check that.

So we may have the following setting in the Gwenview.

Sort mode switching (radio button selection):

  • When launched from Dolphin, never follow its sorting order. The previous sort mode will be applied.
  • When launched from Dolphin, apply its sorting order, and stay on this sort mode.
  • When launched from Dolphin, apply its sorting order, but do not remember this sort option, so when you launch Gwenview directly next time, it will apply a previous sort mode.

You can easily sort by image dimensions or EXIF date. What other image specific things people would like to sort by that Gwenview offers? IIRC it doesn’t even offer those.

That phrasing is a bit awkward, mostly because it explains it from Dolphin’s perspective while it is often an issue that users find a problem when they don’t associate Gwenview’s behavior with Dolphin’s per-directory sorting preferences (which was my main issue).

Also I don’t understand the usefulness of the second option - Gwenview will change its current sorting configuration to a different sort order depending on which folder it has started browsing? Then again - why do we need a sorting configuration option at all (except to show what the current one is).

To explain what I mean, I think it should be clarified what we mean by “Dolphin sorting order” - I haven’t read the code, but as far as I understand it, Gwenview reads the .directory file for each folder browsed, which is where Dolphin records the last sorting mode that was selected by the user when using Dolphin to view files in that folder.

So Gwenview has - essentially - 3 modes of operation, and none of them were “just launched by Dolphin”:

  1. Launch Gwenview without any parameters - it starts in the “home view” and users can select where they want to go.
  2. Launch Gwenview with a folder argument - it starts by showing images and folders in that folder.
  3. Launch Gwenview with a file argument - it starts by showing that image, and use navigating actions to navigate to other images in the same folder.

(there’s also another mode with 2 or more file arguments where Gwenview just shows these files - but I think we can ignore it for this discussion, and another with 2 or more folder arguments - but I have no idea what it is trying to do with that, its completely broken behavior IMHO).

Currently - every time Gwenview starts, AFAIU, it reads the .directory file and uses the Dolphin sorting order set there, regardless of what its own sorting configuration is (what does it do when its a dir Dolphin didn’t set a sorting mode for? Does it fallback to Dolphin’s sort by name, or use Gwenview’s config?). It also reads the .directory file when navigating from the Gwenview “home view” using a “Places” link. Otherwise when navigating from within Gwenview to another folder, it keeps whatever sorting mode it read from the first .directory file it has seen - which is kind of your second option… Ok, maybe having that option makes sense - in the gist that the current Gwenview browsing behavior makes sense - which is to say: I don’t think it makes sense.

Finally, my suggestion for the phrasing of the configuration option:

Change Sorting Mode Automatically:

( ) Always use Gwenview’s sorting mode (fixed).
( ) Remember last sorting mode set according to Dolphin’s per-directory sorting preference.
( ) Initially sort files according to Dolphin’s per-directory sorting preference, when starting to view a file or a folder.
( ) Only use Dolphin’s per-directory sorting preference to sort the folder that Gwenview was launched to view.

The first three options are @Ashark options: (1) don’t read .directory files, that a lot of people are clamoring for; (2) update Gwenview’s config file when launching with a file or folder argument, by copying Dolphin’s sorting mode from the .directory file; (3) the current behavior: read .directory file when launched with a file or folder argument, and update the local view sorting but not the configuration file, but stick with it until closed.

I’ve added a 4th option, which I think makes at least as much sense as the 2nd option (if not more) of where we do (3), but revert to the Gwenview configuration when leaving the folder where it applied (maybe switching to the other folder’s Dolphin preference). Though IMHO there should only be two options - if we opt to keep the current behavior, which I think is mostly confusing: then just 1st and 3rd; or if we are also allowed to fix the current behavior’s weirdness: then just 1st and 4th.

Regardless of how the .directory handling behavior is changed (if at all) and made configurable (if at all) - i.e. unless .directory parsing is completely abandoned - there should be another option in the “Sort By” submenu which says “As Dolphin (SORTMODE)” (e.g. “As Dolphin (Date)”).

You can easily sort by image dimensions or EXIF date.

But for some reason, in Dolphin it works not for all images.
dolphin some dimensions are missing

What other image specific things people would like to sort by that Gwenview offers?

For example, focus distance, to sort macro and normal pictures. I have seen the request to let them be sorted in the panel 275817 – User should be able to define order of items in Meta Information (including divider). It not exactly asks for sorting pictures by them, but just the order the fields are displayed in information panel.

IIRC it doesn’t even offer those.

Yes. It is very limited currently.

That phrasing is a bit awkward,

Yes, we will rephrase. I made it excessive, to be understandable what they are. But we can make additional tooltip for them and show the shorten their text.

they don’t associate Gwenview’s behavior with Dolphin’s per-directory sorting preferences (which was my main issue).

I think for this we can make a first-run notification dialog in Gwenview (at opening image from dolphin), if the user want to disable that option.

Gwenview will change its current sorting configuration to a different sort order depending on which folder it has started browsing?

Are you talking about 466602 – Remember sorting preference per-folder ?

Then again - why do we need a sorting configuration option at all (except to show what the current one is).

I said, I do not use Gwenview as image file browser. So I personally will be ok if it will always follow Dolphin order. But somebody do. And they need this. Am I incorrect?

but as far as I understand it, Gwenview reads the .directory file for each folder browsed

No, currently it does not work this way. See 236059#c20. There is a SortOrderForUrl method.

Currently - every time Gwenview starts, AFAIU …

No. It is that related bug. By the way, I did not ever switched folder inside the gwenview. What I do, I close Gwenview, change folder in Dolphin, then open another image from there.

my suggestion for the phrasing of the configuration option

Very good. Thanks.
I however do not understand what is the difference in your 2 and 4.
I think that 466602 – Remember sorting preference per-folder even can be fixed indirectly. With implementing “Always follow dolphin” (your option 1, but the dolphin actually choosed as its fixed value) and enabling the setting “Remember display style for all folders” in Dolphin itself, this will effectively work.

That’s deficiency in the meta data parsers that Dolphin uses. I’m not sure how that system works, and I think it is out of scope for this discussion.

I believe everyone agrees that the least effort and most impact for most users would be to have just an option on to disable Gwenview’s support for Dolphin’s sort order - just a checkbox somewhere. On the bug report I offered to write the MR to just remove the Dolphin integration - I’m pretty sure I can do that well and quickly, but I’m not any good with UI.

No, but good to know this ticket exists. I was talking about your suggested option of “remember sort setting from Dolphin” which to me sounded like Gwenview will update is configuration file with a new default setting every time it reads the Dolphin per-folder sorting mode.

ehhmmm… I kind of lost you with the cascading negative assertions… If I understand correctly, you do not use Gwenview except as a single image viewer - so you don’t actually care about the sorting order. That is fine.

Regarding people who do use Gwenview’s browsing features - if only for looking at a single image and then switching to one before or one after (which is ~90% of image browsing I do) - I would love to see the Dolphin sorting mode support removed or being configurabled away (not a word, I know). From my reading, the OP for Bug 443168 - and most commenters there - would as well.

The current behavior of Gwenview sorting mode is obviously quite specifically coded in to do what it does (tracking Dolphin’s sort mode is not something you do by mistake), so obviously someone thought it is a useful feature - but I don’t think we have found that someone yet.

Ah! you found the people that think this is a good feature! Great. Now if only we can get some of them to join the discussion…

The whole “follow file manager sort” is a PITA. Even if I agree with the notion, the current behavior is weird. The 3 “ask the file manager” behavior I talked about, as far as I understand them, all start with - Gwenview was launched with a file or folder argument (or the user pressed a place or history item from the main view), so we ask the file manager for sorting instructions and do that.
Where they differ is what happens next - in relations to two things that the user can do:
(a) navigate to another folder; or
(b) close Gwenview and open it to a file/folder for which the file manager is mum about (can that happen? I don’t actually think so…).
So the different behaviors are as follows:
2. (a) keep sorting the same way; (b) keep sorting the same way
3. [current behavior] (a) keep sorting the same way; (b) use the last sort the user manually selected
4. (a) use the last sort the user manually selected; (b) use the last sort the user manually selected

Well you see - this is actually option 5 that we are missing - which, IMHO, makes the most sense of all:
5. (a) ask the file manager about the new location; (b) use the last sort the user manually selected (though that can’t actually happen, so it’ll use the file manager’s sort).

Setting Dolphin to “Remember display style for all folders” I imagine will actually do the opposite (with this new 5th option) - Gwenview will ask the file manager about each and every folder it navigates to, and the answer will always be the same - so, not actually any change. To actually implement 466602, and also keep relying on the file manager to tell Gwenview how to sort - Gwenview will have to call the file manager D-Bus API SetSortOrderForUrl when the user uses Gwenview’s “Sort By” menu (I know it doesn’t exist, but so doesn’t SortOrderForUrl, at least according to the FDo spec).

Last note: everyone keep saying “Gwenview started from Dolphin” - but that isn’t actually my use case: I start Gwenview from the wallpaper plugin, from scripts, from Firefox’s “open downloaded file” and other places - it still follows Dolphin’s sort order (i.e. the current file manager that speaks SortOrderForUrl).

By the way, does anybody actually care to have a possibility in Gwenview to keep the another “configured” sort while be able to applying dolphin sort temporary?

What if we just make the “as in dolphin” sort mode option (Bug 466836), and the sorting will not depend at all from the launching method (direct or indirectly by image click). I.e. the option 1 - always fixed. The dolphin sort will only apply if in Gwenview the user choosed (it’s an irregular verb, I know) this option. But not because of indirect launched from Dolphin.

1 Like

I’ve sent MR!219 which fixes the unexpected (IMO) navigation behavior where the sort mode that was read from the file manager (and doesn’t match the option selected in the “Sort By” menu) is incorrectly kept when browsing to other folders.

With that MR, implementing a “Sort By” “Dolphin” should be more straightforward.

1 Like

There’s now MR!226 which I believe will solve all the issues - there’s UI that tells you what Gwenview is doing and the “dolphin association” can be disabled completely, if you so wish.

I’m looking for feedback on that work so it can be polished for including in a future Gwenview release.

Thank you for working on that! I am currently working on another problem. After I done that, I will check your mr, if that will still be not merged.