Migrate from GnomeVFS to GIO

Bug #1006290 reported by Mario Kemper (Romario)
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Shutter
Confirmed
Medium
Mario Kemper (Romario)

Bug Description

Migrating from GnomeVFS to GIO

Revision history for this message
Dominique Dumont (domi-dumont) wrote :

I can propose a patch that uses Path::Tiny to handle URIs instead of Gnome::VFS. On the downside, access to remote files is no longer possible.

Is that acceptable ?

Revision history for this message
Michael Kogan (michael-kogan) wrote :

It looks to my like GFS leads to a bug which prevents NFS access in non-Gnome environments: https://bugs.launchpad.net/shutter/+bug/1003185 I am not sure though, if one can conclude that network access is currently broken altogether...

Revision history for this message
Dominique Dumont (domi-dumont) wrote :

I have not ported file monitoring. I guess this could be done with inotify.

Note that inotify does not work with NFS (IIRC, it's not supported in the kernel). A poll loop could also be setup.

Revision history for this message
Dominique Dumont (domi-dumont) wrote :

I've managed to port file handling from VFS to GIO.

As I don't have much time, I could use some help for the remaining tasks required to get rid of VFS. I.e. replace:
- escape/unescape string done with VFS
- file monitoring
- XFER thing

See https://github.com/dod38fr/shutter/commits/master

All the best

Revision history for this message
Michael Kogan (michael-kogan) wrote :

I fear, I am the only "active maintainer" of Shutter right now, the history leading to this being as following: I was involved in Shutter's localization in its early stages and I am maintaining Shutter's Arch package. Since the development was dead for several years I requested access to Shutter's bzr repo in order to apply patches which have accumulated throughout the years (which happened in Shutter 0.94). However, I'm not a developer and in particular I never learnt Pearl and never worked with GTK libraries. So I was basically just doing organizational stuff.

Therefore I'm incapable of verifying your patch proposal and do further work on it. I can only apply it eventually. But if you are interested, I can give you access to the main bzr repo such that you can work directly at the official code tree. I think, Shutter can only profit from more developers/maintainers since the main developer had to abandon it.

Revision history for this message
Alexey Sokolov (darthgandalf) wrote :

Hi, I've finished work started by Dominique

I don't know how to bazaar, so I cloned his repo, and semi-manually applied changes which happened here since he started it.

Also I replaced most of usage of Gnome2 other than VFS, because that library is going away in Gentoo (https://bugs.gentoo.org/724794). One missing feature is thumbnails, because I couldn't find any replacement library, so I couldn't fully remove Gnome2 dependency yet. Perhaps I should try resizing the image using ImageMagick and ignore Freedesktop thumbnails...

https://github.com/DarthGandalf/shutter/commits/my has results. Can it be merged?

Revision history for this message
Michael Kogan (michael-kogan) wrote :

That's GREAT news! Probably you have already stumbled upon it but here is some kind of wrapper which works with several (reasonably up to date) libraries, Image::Magick, Imager, Image::Epeg, or GD: https://metacpan.org/pod/Image::Thumbnail

I'm a bit confused about which of the libraries you could already get rid of so far and which are in the workings? I'll test the current status and report back asap. Thanks for tackling this issue!

Revision history for this message
Alexey Sokolov (darthgandalf) wrote :

Actually, I've updated the branch to not do thumbnails at all: apparenly, Gtk can scale images itself. The 2 downsides are no generated files in ~/.cache/thumbnails/large and hardcoded size of 100 pixels in the main tab (I don't know where to get the size from, IconSize->lookup doesn't have anything bigger than 48px).

Gnome2 is fully gone, except for Gnome2::Wnck. That one seems to be not deprecated yet. I can replace it with Wnck via gobject introspection, but then for an unknown reason window icons are missing in the menu.

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Cool, thanks! I packaged Glib::IO for Arch Linux and tested the current state of your branch and it seems to work really nicely besides of the editor being dysfunctional giving

*** unhandled exception in callback:
*** Can't locate object method "new" via package "Shutter::Pixbuf::Thumbnail" (perhaps you forgot to load "Shutter::Pixbuf::Thumbnail"?) at /home/photon/Desktop/shutter-my/share/shutter/resources/modules/Shutter/Draw/DrawingTool.pm line 217.
*** ignoring at ./shutter line 2934.

Seems to be something thumbnail related which isn't done yet?

Revision history for this message
Alexey Sokolov (darthgandalf) wrote :

Ah, I haven't tested the draw tool after removing thumbnails. I wasn't even aware of such thumbnail functionality in it...

Fixed.

Revision history for this message
Alexey Sokolov (darthgandalf) wrote :

Btw, I switched from Glib::IO to using GIO via introspection directly, because Glib::IO isn't often packaged, and doesn't provide any benefit.
The only new dependencies are Number::Bytes::Human and Glib::Object::Introspection

Revision history for this message
Alexey Sokolov (darthgandalf) wrote :

> The only new dependencies are Number::Bytes::Human and Glib::Object::Introspection

And GIO itself, of course

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Nice, the editor works now! Regarding the Glib:IO dependency, it still asks for it (in line 50 of DrawingTool.pm), doesn't it?

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Edit: I just removed this line and looks like it then works without the Glib::IO dependency.

However, I now noticed that when editing a screenshot, then saving it, the preview in Shutter (both the big one in the screenshot's tab and the small thumbnail in the overview tab) is not updated though the actual file is updated with the edits.

Revision history for this message
Alexey Sokolov (darthgandalf) wrote :

Fixed both.

Revision history for this message
Michael Kogan (michael-kogan) wrote :

Works perfectly, thanks!

I shared the great news with Mike and Vadim who are involved in keeping the project website running (https://github.com/shutter-project) and we are considering to move the project to Github since Launchpad seems to have become an obstacle lately.

Since your brach on Github is the most advanced one, I think it wouldn't make sense to merge it to the Launchpad branch but rather make it the main branch. May I add you to our mail conversation to coordinate the moving to Github?

Revision history for this message
Alexey Sokolov (darthgandalf) wrote :

While it's maybe the most advanced, in my semi-manual launchpad import I didn't preserve much, e.g. commit messages after Dominique's import are missing.

I'd prefer someone more familiar with bazaar to import it to git properly. Then I can rebase my work to it. Commits in my repo before mine seem to be fine.

Revision history for this message
Alexey Sokolov (darthgandalf) wrote :

> May I add you to our mail conversation to coordinate the moving to Github?

I missed the question, sorry. Sure.

Revision history for this message
Alexey Sokolov (darthgandalf) wrote :

> I'd prefer someone more familiar with bazaar to import it to git properly.

I figured out how to do that. I pushed the rebased version to master branch and verified that contents are the same. I can move the repo to https://github.com/shutter-project once I receive that mail.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.