MightyCreak / diffuse

Diffuse is a graphical tool for comparing and merging text files. It can retrieve files for comparison from Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion, and SVK repositories.
http://mightycreak.github.io/diffuse/
GNU General Public License v2.0
260 stars 46 forks source link

Icon 'document-new' not present in theme gnome #146

Closed grozin closed 2 years ago

grozin commented 2 years ago

After some unrelated upgrades, diffuse-0.7.3 no longer starts:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.10/diffuse", line 33, in <module>
    sys.exit(main.main())
  File "/usr/share/diffuse/diffuse/main.py", line 1715, in main
    diff = Diffuse(rc_dir)
  File "/usr/share/diffuse/diffuse/main.py", line 661, in __init__
    p0 = default_theme.load_icon_for_scale("document-new", icon_size, scale_factor, 0)
gi.repository.GLib.GError: gtk-icon-theme-error-quark: Icon 'document-new' not present in theme gnome (0)

I don't know how default_theme is chosen etc. There are rather many document-new.svg and document-view.png files somewhere under /usr/share/icons/ This is Gentoo Linux. What can I do to use diffuse again? Install some icons set? Or change somthing in configs of diffuse?

grozin commented 2 years ago

There are 2 packages in Gentoo: gnome-icon-theme-symbolic, gnome-icon-theme-extras. Installing them does not help.

grozin commented 2 years ago

Is this related to the problem? https://gitlab.gnome.org/GNOME/gtk/-/issues/4790

grozin commented 2 years ago

Yes. Downgrading adwaita-icon-theme to 41.0 solves the immediate problem. But something should be done to avoid this crash with the modern version 42.0.

MightyCreak commented 2 years ago

Thanks for filing this issue.

I knew the day would come and the document-new icon, which has been deprecated a few releases ago, would no longer be available. The issue with this icon is that the code is creating a new icon based on this one, at runtime. And I haven't found a similar icon in the GNOME icons set.

At the time, there were more important things to fix, but it seems that the priority for this issue has been raised all of a sudden.

MightyCreak commented 2 years ago

Actually, reading the GTK issue and the GTK documentation a bit further, it seems that it's the Gtk.STOCK_NEW symbol that is deprecated and 'document-new' should be used instead. The GTK issue was an actual issue and it has been fixed 3 weeks ago with this MR: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4562

So I'll close this issue. Feel free to reopen it if you still think there's an issue here.