Bug 443168 - Add a setting to not follow sorting as in Dolphin when Gwenview started by image click
Summary: Add a setting to not follow sorting as in Dolphin when Gwenview started by im...
Status: CONFIRMED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 21.08.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks: 473661
  Show dependency treegraph
 
Reported: 2021-09-30 20:29 UTC by JoostR
Modified: 2024-01-02 19:55 UTC (History)
15 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JoostR 2021-09-30 20:29:56 UTC
SUMMARY

Due to a recent change, gwenview now ignores the preferred sort order in its settings when starting.

STEPS TO REPRODUCE
1. start gwenview
2. set 'sort by name' in the 'view' menu
3. close gwenview
4. start gwenview
5. open a folder

OBSERVED RESULT

Sort order is erratic, it took a websearch to understand that the initial sort order is determined by the current settings in Dolphin, not Gwenview.

EXPECTED RESULT

Images sorted by name, as set in the settings.


SOFTWARE/OS VERSIONS
Arch Linux, kernel 5.14.18-1, Gwenview version 21.08.1

ADDITIONAL INFORMATION

It seems a consequence of work on this bug:
https://bugs.kde.org/show_bug.cgi?id=236059
But in my humble opinion this needs a slight rethink of the Gwenview settings and desires for Dolphin-Gwenview integration: for somebody who hardly uses Dolphin (like me) it makes no sense at all that Gwenview settings are somehow overriden by it.
Comment 1 JoostR 2021-09-30 21:15:44 UTC
To clarify my use a bit more: for many years I have used Gwenview for presentations, using folders (and subfolders) with hundreds of alphabetically organized symbolic links to images and clips. For this to work Gwenview has to have a settable default sorting behaviour.
Typically I find my most recently edited presentation folder in Dolphin in a 'sorted by date' view, open it in Gwenview and want my images sorted by name as set in the Gwenview settings.
Comment 2 JoostR 2021-09-30 21:20:09 UTC
Also for extremely large folders (>10k images) sorting by date takes quite some time in Gwenview, which is another reason it is not desirable for the Gwenview settings to be overriden.
Comment 3 Scandrof 2021-10-06 13:56:26 UTC
Gwenview following Dolphin's sort order is also causing a lot of problems for me. I often use a bash script to select a random image folder & open the first picture in Gwenview. Maybe an option could be added to Gwenview's settings to give users a choice between following Dolphin's sort order or keeping Gwenview independent of Dolphin?
Comment 4 Freddy Vejen 2022-02-10 09:32:50 UTC
gwenview ignores setting Sort By

The default sort is by name in the hamburger menu / Sort By / radio button, but when I start gwenview and choose a folder containing picture files, gwenview does not sort the files by name, but by date. When I change any setting in the Sort By menu, gwenview sorts the files according to the new setting. Then I close and start gwenview again and click on the folder with the pictures, the Sort By setting in the menu is still as I left it when closing gwenview, but the pictures are sorted by date again. I must change a setting to activate a sorting.

If I choose sort by date and close gwenview, a setting appears in ~/.config/gwenviewrc:
[ThumbnailView]
Sorting=Sorting::Date

If I choose sorting by name, that setting section gets removed at closing gwenview.

If I choose sorting by size, a setting appears in ~/.config/gwenviewrc:
[ThumbnailView]
Sorting=Sorting::Size

When I start gwenview again, the Sort By setting in the menu is still as I left it when closing gwenview,

I tried editing ~/.config/gwenviewrc to contain
[ThumbnailView]
Sorting=Sorting::Name
but but the pictures are sorted by date anyway when I start gwenview again.

Closing gwenview and editing ~/.config/gwenviewrc to have Sorting=Sorting::Name or Sorting=Sorting::Size has the effect, that when starting gwenview the setting in the Sort By menu is as set in ~/.config/gwenviewrc, but the actual sorting is still by date.
Comment 5 Robin Bankhead 2022-06-15 16:32:33 UTC
It doesn't make any sense for Gwenview to revert to obeying Dolphin's ordering instead of persisting the ordering chosen in its own UI, across multiple direct launches (i.e. not from within Dolphin).

Gwenview should have its own ordering setting, but able to be overridden on invocation (which the onus then is on Dolphin to do). This might be of benefit for other external apps calling Gwenview also.
Comment 6 glaebhoerl 2022-07-26 14:43:50 UTC
*** This bug has been confirmed by popular vote. ***
Comment 7 Oleksiy Zagorskyi 2023-05-30 09:37:20 UTC
Other reports which likely are duplicates of current one:
https://bugs.kde.org/show_bug.cgi?id=454694
https://bugs.kde.org/show_bug.cgi?id=462691
https://bugs.kde.org/show_bug.cgi?id=464959
Comment 8 Christoph Cullmann 2023-06-18 17:59:49 UTC
I am always confused by that, too.
Comment 9 Andrew 2023-08-14 14:36:44 UTC
For me the annoying case is very simple and not related with Dolphin at all.
To get natural order for date sorting:
- Open Gwenview
- Untick "Descending" in "Sort by"
- Tick it again
Comment 10 Thomas Capricelli 2023-08-14 22:27:19 UTC
(In reply to Andrew from comment #9)
> For me the annoying case is very simple and not related with Dolphin at all.
> To get natural order for date sorting:
> - Open Gwenview
> - Untick "Descending" in "Sort by"
> - Tick it again

That's exactly what we are all complaining about / reporting. For a long time :-(
Comment 11 Christoph Cullmann 2023-08-17 16:30:57 UTC
The first thing I need to do is always to set the order twice. It shows sort by name, but doesn't do that, I need to set an other one and set it back.

I think the old behaviour was a lot saner, I fail to see why it should be in sync with Dolphin at all, e.g. Kate or even our file open dialogs are not in sync and that makes sense.
Comment 12 Robin Bankhead 2023-08-19 12:14:53 UTC
(In reply to Christoph Cullmann from comment #11)
> The first thing I need to do is always to set the order twice. It shows sort
> by name, but doesn't do that, I need to set an other one and set it back.
> 
> I think the old behaviour was a lot saner, I fail to see why it should be in
> sync with Dolphin at all, e.g. Kate or even our file open dialogs are not in
> sync and that makes sense.

Very small clarification: You don't need to flip to another selection and back; clicking on the (already-selected) radio causes it to take its correct effect.
Comment 13 Andrew Shark 2023-08-22 10:29:59 UTC
> I fail to see why it should be in sync with Dolphin at all

That is incorrect. My use case is that I do not use Gwenview as an image browser, but as image viewer. I set the Esc key to quit Gwenview, not to go to Browse mode. I click an image in Dolphin, then start switching images with right and left arrows. In dolphin I have a folder sorted by date (I sometimes rename my screenshots, but want them to be shown in order when they were taken). Gwenview showed me the wrong order. I then realized that it has its own order, not used the order from Dolphin.

So Gwenview should sort images in sync with Dolphin view. At least when image was opened by click from Dolphin. Or at least there should be an option for such behavior.
Comment 14 JoostR 2023-08-22 12:27:56 UTC
(In reply to Andrew Shark from comment #13)
> > I fail to see why it should be in sync with Dolphin at all
> 
> That is incorrect. My use case is that I do not use Gwenview as an image
> browser, but as image viewer. I set the Esc key to quit Gwenview, not to go
> to Browse mode. I click an image in Dolphin, then start switching images
> with right and left arrows. In dolphin I have a folder sorted by date (I
> sometimes rename my screenshots, but want them to be shown in order when
> they were taken). Gwenview showed me the wrong order. I then realized that
> it has its own order, not used the order from Dolphin.
> 
> So Gwenview should sort images in sync with Dolphin view. At least when
> image was opened by click from Dolphin. Or at least there should be an
> option for such behavior.

I'm happy to see some activity on this bug report, after what is already a long time: almost two years !

Nothing has changed in the meantime, and my views have crystallized a bit in the meantime:
- if gwenview is intended as an image viewer for Dolphin, it should perhaps simply be integrated into Dolphin or be installed as a component of it. It doesn't need to have its own sort settings in that case.
- if gwenview is intended an independent application with its own settings, it is extremely counterintuitive that its settings are overridden by another application. Which is why I filed the bug report. 

I don't think I know of any other application that has this kind of dependency in its settings. To somebody who rarely uses Dolphin, it makes no sense.
Comment 15 JoostR 2023-08-22 12:32:07 UTC
(In reply to Robin Bankhead from comment #5)
> It doesn't make any sense for Gwenview to revert to obeying Dolphin's
> ordering instead of persisting the ordering chosen in its own UI, across
> multiple direct launches (i.e. not from within Dolphin).
> 
> Gwenview should have its own ordering setting, but able to be overridden on
> invocation (which the onus then is on Dolphin to do). This might be of
> benefit for other external apps calling Gwenview also.

That sounds like a great way to approach it !
Comment 16 Robin Bankhead 2023-08-22 13:38:45 UTC
(In reply to Andrew Shark from comment #13)
> > I fail to see why it should be in sync with Dolphin at all
> 
> That is incorrect. My use case is that I do not use Gwenview as an image
> browser, but as image viewer. I set the Esc key to quit Gwenview, not to go
> to Browse mode. I click an image in Dolphin, then start switching images
> with right and left arrows. In dolphin I have a folder sorted by date (I
> sometimes rename my screenshots, but want them to be shown in order when
> they were taken). Gwenview showed me the wrong order. I then realized that
> it has its own order, not used the order from Dolphin.
> 
> So Gwenview should sort images in sync with Dolphin view. At least when
> image was opened by click from Dolphin. Or at least there should be an
> option for such behavior.

Interesting. From your comment I assume you have Dolphin set to remember view settings per-directory (IIRC this involves dropping a .directory file in the folder). So Gwenview is ignoring these files - perhaps not surprising, it has no setting that mirrors this.

I think your issue is external to this bug, though similar in character (sort of). It would certainly make sense for Gwenview to obey the .directory files (perhaps ideally as an optional setting, in KDE philosophy). I would report it separately.
Comment 17 Thomas Capricelli 2023-08-22 13:55:18 UTC
The current behaviour is complete non-sense, i really can't see any reason to do so.  There's no coherency with behaviour and what appears in menu, there's no coherency between quitting/restarting the application. I really don't understand why gwenview should be incoherent and follow the settings of something totally unrelated such as dolphin, while still pretending having its own settings.
Comment 18 Jörg 2023-08-22 15:21:00 UTC
Many people do NOT use Dolphin, but other file managers like Krusader.

Gwenview should not depend on any setting in a file manager.
Comment 19 Andrew Shark 2023-08-22 15:46:37 UTC
> I assume you have Dolphin set to remember view settings per-directory
Of course! A very important feature of Dolphin.

Probably it will be good to have a sorting option "Follow Dolphin view". In Dolphin there are lots of ways to sort. Some of them make no sense in Gwenview, lets say "sort by file owner". Lets say I sorted by owner. Now I open Gwenview. Then I switch to some other order in Gwenview. Now I can no longer go back to "sort by file owner" in Gwenview (I can only close it and open again by clicking image from dolphin).
So it makes sense to make the "Follow Dolphin view" sorting option.
Comment 20 Christoph Cullmann 2023-08-22 17:57:44 UTC
(In reply to Andrew Shark from comment #19)
> > I assume you have Dolphin set to remember view settings per-directory
> Of course! A very important feature of Dolphin.
> 
> Probably it will be good to have a sorting option "Follow Dolphin view". In
> Dolphin there are lots of ways to sort. Some of them make no sense in
> Gwenview, lets say "sort by file owner". Lets say I sorted by owner. Now I
> open Gwenview. Then I switch to some other order in Gwenview. Now I can no
> longer go back to "sort by file owner" in Gwenview (I can only close it and
> open again by clicking image from dolphin).
> So it makes sense to make the "Follow Dolphin view" sorting option.

That would be fine for me, too, the current way is just very confusing, it doesn't follow what it set and it doesn't remember what I did set.
Comment 21 Andrew Shark 2023-08-22 18:32:46 UTC
The current title of the bug "gwenview ignores settings in initial sort order" confuses people. We are talking about two separate issues here. The first is that somebody wants to disable the thing that gwenview follows the order in dolphin (even currently partly broken, see Bug 466836). I will rename current bug to keep track on this problem, because OP wanted that.
The second is not related to Dolphin at all, about not applied sorting when entering to folder from Home page - Bug 464959

@JoostR
> for somebody who hardly uses Dolphin (like me) it makes no sense at all that Gwenview settings are somehow overriden by it.
Generally, users expect Gwenview to follow the sorting order of the place from where it was opened (Dolphin).

> Typically I find my most recently edited presentation folder in Dolphin in a 'sorted by date' view, open it in Gwenview and want my images sorted by name as set in the Gwenview settings.
You said you hardly use Dolphin, but still you use it to open your folder. If you do not need Dolphin, why don't you just launch Gwenview from start menu? It has a Home page, which also has a Recent folders.

@Scandrof
> Gwenview following Dolphin's sort order is also causing a lot of problems for me. I often use a bash script to select a random image folder & open the first picture in Gwenview.
And what is the problem then? You open first image in your random folder and it is opened in Gwenview.
 
> Maybe an option could be added to Gwenview's settings to give users a choice between following Dolphin's sort order or keeping Gwenview independent of Dolphin?
Yes.

@Freddy Vejen
> but when I start gwenview and choose a folder containing picture files, gwenview does not sort the files by name, but by date.
See 464959.

@Robin Bankhead
> It doesn't make any sense for Gwenview to revert to obeying Dolphin's ordering instead of persisting the ordering chosen in its own UI, across multiple direct launches (i.e. not from within Dolphin).
> Gwenview should have its own ordering setting, but able to be overridden on invocation (which the onus then is on Dolphin to do). This might be of benefit for other external apps calling Gwenview also.
As said above, yes there should be an option to not follow dolphin sorting when clicked image. Also, it will not be really "following Dolphin", but "following .directory file".

@Andrew + @Thomas Capricelli
> For me the annoying case is very simple and not related with Dolphin at all.
See 464959.

@Christoph Cullmann + @Thomas Capricelli
Depending on the way you launch, see one of all mentioned bugs.

@JoostR
> it should perhaps simply be integrated into Dolphin or be installed as a component of it
I am not shure. What if you want to open several images and go to another folder? What if you want to do some basic things like image rotation?

@Jörg
> Gwenview should not depend on any setting in a file manager.
As said above, it is not a Dolphin setting. It is a setting from .directory file.
Comment 22 Robin Bankhead 2023-08-22 19:05:14 UTC
> @Robin Bankhead
> > It doesn't make any sense for Gwenview to revert to obeying Dolphin's ordering instead of persisting the ordering chosen in its own UI, across multiple direct launches (i.e. not from within Dolphin).
> > Gwenview should have its own ordering setting, but able to be overridden on invocation (which the onus then is on Dolphin to do). This might be of benefit for other external apps calling Gwenview also.
> As said above, yes there should be an option to not follow dolphin sorting
> when clicked image. Also, it will not be really "following Dolphin", but
> "following .directory file".

My comment that you quote was in relation to the original scope of this bug, which had nothing to do with obeying (or not) .directory files. The latter is a separate issue introduced by you. It's not up to me but I think you should leave this bug as it was, and file a new bug for your issue.
Comment 23 Andrew Shark 2023-08-22 19:32:26 UTC
@Robin Bankhead This is not a forum. It becomes hard to read the bug history. For long discussions I suggest to go to the forum.
> which had nothing to do with obeying (or not) .directory files. The latter is a separate issue introduced by you
I clarified two separate things that people were meaning here, please read comment #21 carefully.

My proposal is the following:
With a dedicated "as in dolphin" sort entry (when 466836 will be done), and if user enabled "keep dolphin order when opening" (when the current 443168 will be done), the sorting will switch to it, and in UI it will be selected. If user disabled "keep dolphin order when opening", then Gwenview will keep its original sorting mode. At any time you can select any mode manually, if you prefer disabled "keep dolphin order when opening".
So what exactly are you arguing about? If I did not clarified that, please open a forum post and link here.
Comment 24 JoostR 2023-08-22 19:49:20 UTC
(In reply to Andrew Shark from comment #21)
> The current title of the bug "gwenview ignores settings in initial sort
> order" confuses people. We are talking about two separate issues here. The
> first is that somebody wants to disable the thing that gwenview follows the
> order in dolphin (even currently partly broken, see Bug 466836). I will
> rename current bug to keep track on this problem, because OP wanted that.
> The second is not related to Dolphin at all, about not applied sorting when
> entering to folder from Home page - Bug 464959
> 
> @JoostR
> > for somebody who hardly uses Dolphin (like me) it makes no sense at all that Gwenview settings are somehow overriden by it.
> Generally, users expect Gwenview to follow the sorting order of the place
> from where it was opened (Dolphin).
> 
> > Typically I find my most recently edited presentation folder in Dolphin in a 'sorted by date' view, open it in Gwenview and want my images sorted by name as set in the Gwenview settings.
> You said you hardly use Dolphin, but still you use it to open your folder.
> If you do not need Dolphin, why don't you just launch Gwenview from start
> menu? It has a Home page, which also has a Recent folders.
> 
> @Scandrof
> > Gwenview following Dolphin's sort order is also causing a lot of problems for me. I often use a bash script to select a random image folder & open the first picture in Gwenview.
> And what is the problem then? You open first image in your random folder and
> it is opened in Gwenview.
>  
> > Maybe an option could be added to Gwenview's settings to give users a choice between following Dolphin's sort order or keeping Gwenview independent of Dolphin?
> Yes.
> 
> @Freddy Vejen
> > but when I start gwenview and choose a folder containing picture files, gwenview does not sort the files by name, but by date.
> See 464959.
> 
> @Robin Bankhead
> > It doesn't make any sense for Gwenview to revert to obeying Dolphin's ordering instead of persisting the ordering chosen in its own UI, across multiple direct launches (i.e. not from within Dolphin).
> > Gwenview should have its own ordering setting, but able to be overridden on invocation (which the onus then is on Dolphin to do). This might be of benefit for other external apps calling Gwenview also.
> As said above, yes there should be an option to not follow dolphin sorting
> when clicked image. Also, it will not be really "following Dolphin", but
> "following .directory file".
> 
> @Andrew + @Thomas Capricelli
> > For me the annoying case is very simple and not related with Dolphin at all.
> See 464959.
> 
> @Christoph Cullmann + @Thomas Capricelli
> Depending on the way you launch, see one of all mentioned bugs.
> 
> @JoostR
> > it should perhaps simply be integrated into Dolphin or be installed as a component of it
> I am not shure. What if you want to open several images and go to another
> folder? What if you want to do some basic things like image rotation?
> 
> @Jörg
> > Gwenview should not depend on any setting in a file manager.
> As said above, it is not a Dolphin setting. It is a setting from .directory
> file.

(In reply to Andrew Shark from comment #23)
> @Robin Bankhead This is not a forum. It becomes hard to read the bug
> history. For long discussions I suggest to go to the forum.
> > which had nothing to do with obeying (or not) .directory files. The latter is a separate issue introduced by you
> I clarified two separate things that people were meaning here, please read
> comment #21 carefully.
> 
> My proposal is the following:
> With a dedicated "as in dolphin" sort entry (when 466836 will be done), and
> if user enabled "keep dolphin order when opening" (when the current 443168
> will be done), the sorting will switch to it, and in UI it will be selected.
> If user disabled "keep dolphin order when opening", then Gwenview will keep
> its original sorting mode. At any time you can select any mode manually, if
> you prefer disabled "keep dolphin order when opening".
> So what exactly are you arguing about? If I did not clarified that, please
> open a forum post and link here.

Dear Andrew,

I am not the expert on bug filing etiquette, but I think in general a bug report should just report the bug and not suggest a detailed solution.

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. 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.
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.

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 ? 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.

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'
Comment 26 Robin Bankhead 2023-08-23 14:05:41 UTC
@JoostR it's not at all inappropriate to discuss how to resolve a bug in that bug's comment thread. That's exactly what it is for. What behaviour is desired must be hashed out before it can be implemented in code. What concerned me above was scope-creep.

Perhaps I was mistaken, but I did not think any of us were concerned with .directory file handling before Andrew joined the thread. Per-directory behaviour was not mentioned in the bug summary. I do not use .directory files; I thought that (a) Dolphin does not use them by default, and (b) thus most people do not use them. Perhaps I'm incorrect in one or both of these assumptions too; if so please set me straight and accept my apologies.

Based on Andrew's initial post it seems clear that Gwenview knows nothing of .directory files, not even through Dolphin: It simply copies Dolphin's *global* sort setting.

Any solution to this particular bug needs to address how Gwenview behaves when there are no .directory files involved. My suggestion remains:
1) Gwenview should implement commandline switches that allow to override its configured default sort-mode
2) Dolphin should invoke Gwenview with the switches to mirror its own sort-mode, or not, as a configuration option (which option is the default: TBD)

Alternatively, if it's considered undesirable for the two apps to be codependent in this way for the sake of this one feature, let Gwenview ignore Dolphin entirely.
Comment 27 Oded Arbel 2023-08-23 18:00:08 UTC
(In reply to Robin Bankhead from comment #26)
> Based on Andrew's initial post it seems clear that Gwenview knows nothing of
> .directory files, not even through Dolphin: It simply copies Dolphin's
> *global* sort setting.

That is incorrect: Gwenview follows Dolphin's per-directory sort setting, which is stored in `.directory` files under the section name `[Dolphin]`. You can see that by having two folders with images, then using Dolphin - set each to different sorting (lets say, one by date and one by name), then launch Gwenview with first the one folder as the argument to gwenview, then the other - you'd see that Gwenview tracks the per-directory sort mode set by Dolphin.

You can also run gwenview under strace and see that it reads the `.directory` file in the folder where you've opened it to (with either a folder argument or a file argument). There's no additional communications between Dolphin and Gwenview.

> Any solution to this particular bug needs to address how Gwenview behaves
> when there are no .directory files involved.

That is only workable if you also remove Gwenview's feature to read `.directory` files. I'm personally OK with that, but I'm guessing that feature exists for a reason.

> 2) Dolphin should invoke Gwenview with the switches to mirror its own
> sort-mode, or not, as a configuration option (which option is the default:
> TBD)

I believe that is a non-starter: Dolphin does not integrate with Gwenview - doing any kind of deep integration with Gwenview (knowing about specific arguments needed to launch specifically Gwenview) goes in direct contrast to how a modular and generic system should work. If someone wants to implement another image viewer that can compete with Gwenview on features - including tracking the sorting order in file managers, now they can't do that. I don't think KDE devs would go for that and I don't think they should.

> Alternatively, if it's considered undesirable for the two apps to be
> codependent in this way for the sake of this one feature, let Gwenview
> ignore Dolphin entirely.

I'm willing to put up the MR to remove Gwenview's `.directory` parsing feature - but only if maintainers say they will accept this behavior change. As far as I understand, this behavior is intentional and there's no point in me putting the work in if no one is going to even look at the code.
Comment 28 Oded Arbel 2023-08-23 18:32:46 UTC
(In reply to Oded Arbel from comment #27)
> (In reply to Robin Bankhead from comment #26)
> > Based on Andrew's initial post it seems clear that Gwenview knows nothing of
> > .directory files, not even through Dolphin: It simply copies Dolphin's
> > *global* sort setting.
> 
> That is incorrect: Gwenview follows Dolphin's per-directory sort setting,
> which is stored in `.directory` files under the section name `[Dolphin]`.
> ...
> You can also run gwenview under strace and see that it reads the
> `.directory` file in the folder where you've opened it to (with either a
> folder argument or a file argument). There's no additional communications
> between Dolphin and Gwenview.

I was told that I was wrong about this - Gwenview does not read `.directory` files and instead uses a D-Bus API to communicate directly with Dolphin. The reason I thought Gwenview uses `.directory` files is because using `strace` you can see that it opens and reads these files - but from reviewing the source code, I can't find the code for that - so its probably some framework library that does something innocuous.

This doesn't mean that Dolphin integrates with Gwenview, and as for inter-module dependency - this isn't worse than Gwenview reading a file and looking for the text "Dolphin", and people can argue that it is better (i.e. weaker dependency) because a D-Bus API is well specified.
Comment 29 Thomas Capricelli 2023-08-23 23:53:13 UTC
My point of view, shared i guess with the original author of the ticket and most people here, is that we dont care about .directory, dolphin, or anything else. We use gwenview, and it doesn't work. I dont think "add an option to ignore settings from dolphin" is a good thing. That implies that by default it's normal that gwenview behaves erratically and that having a normal behaviour (like doing what its menu says) is only available once you have identified the problem/searched forum/found the proper option/...

I think that by default gwenview should be an independant image viewer.
Comment 30 Méven Car 2023-09-08 05:43:54 UTC
Git commit 18b905d34cbd012870fffecba623844384e30048 by Méven Car, on behalf of Oded Arbel.
Committed on 08/09/2023 at 07:43.
Pushed by meven into branch 'master'.

Sync sort order with file manager not only on initial launch

If we obey the file manager sort mode, we should track that when navigating to other folders.

Also make sure that if the user chooses a sorting mode themselves - we stop tracking the file manager sort mode.
Related: bug 36059, bug 466836

M  +1    -0    app/browsemainpage.cpp
M  +10   -0    app/gvcore.cpp
M  +5    -0    app/gvcore.h
M  +63   -48   app/mainwindow.cpp
M  +1    -0    app/mainwindow.h

https://invent.kde.org/graphics/gwenview/-/commit/18b905d34cbd012870fffecba623844384e30048
Comment 31 Oded Arbel 2023-09-08 09:24:12 UTC
Please note that the recent change is not much about "adding a setting to not follow Dolphin sorting" - mostly as that kind of already exists (just select any "Sort by" option), and more about making sure that the "erraric sort order" keeps being erratic even when changing directories.

As discussed - here and on bug 466836 - we're still missing a couple of UI settings:
1. Show a "Sort as in file manager" option in the "Sort by" menu, and make sure it is selected automatically correctly.
2. Have a configuration setting of "ignore file manager sort mode".

I'll see about working on these next.
Comment 32 Christoph Cullmann 2023-09-08 11:46:30 UTC
Thanks already that you work on this!