RSS/Atom feed Twitter
Site is read-only, email is disabled

Hacking on the mail plugin

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

Hacking on the mail plugin Chris Mohler 04 Oct 04:27
  Hacking on the mail plugin Sven Neumann 04 Oct 20:25
   Hacking on the mail plugin Chris Mohler 04 Oct 23:59
    Hacking on the mail plugin Chris Mohler 05 Oct 03:27
    Hacking on the mail plugin Sven Neumann 05 Oct 21:41
Chris Mohler
2009-10-04 04:27:06 UTC (about 15 years ago)

Hacking on the mail plugin

OK, so I thought bug 596066
(https://bugzilla.gnome.org/show_bug.cgi?id=596066) might be easy enough for me, an admitted novice in C.

However, I can not for the life of me figure out why my call to g_spawn_async throws a segfault every time. I would be most grateful if someone could point out the problem (I'm sure it's a newbie error on my part).

This patch has known problems. Due to the new import/export structure (I think), it will only work on native .XCF files right now., and the file must be saved. There is some legacy code from the original sendmail plugin hanging around that isn't doing much. And the segfault of course :) And finally, xdg-email is broken, and needs to be patched in order for Evolution or Thunderbird to even accept attachments. You can grab the patch for xdg-email from launchpad (filed upstream also):
https://bugs.launchpad.net/ubuntu/+source/xdg-utils/+bug/408350

The git patch is attached.

Thanks! Chris

PS - is there any reason to maintain backwards compatibility with the original mail plugin? The attached patch was a heavy-handed attack just to see if I could get it working with xdg-utils - I have not really settled on the best approach yet.

Sven Neumann
2009-10-04 20:25:28 UTC (about 15 years ago)

Hacking on the mail plugin

On Sat, 2009-10-03 at 21:27 -0500, Chris Mohler wrote:

However, I can not for the life of me figure out why my call to g_spawn_async throws a segfault every time.

Well, you pass it a pointer to xdgargs which was previously allocated on the stack like this:

gchar *xdgargs[sizeof (gchar)];

This should probably read

gchar *xdgargs[4];

instead, since you want to store three arguments plus a trailing NULL.

And please make sure that you convert your tabs to spaces before you submit your patch. Thanks.

Sven

Chris Mohler
2009-10-04 23:59:07 UTC (about 15 years ago)

Hacking on the mail plugin

On Sun, Oct 4, 2009 at 1:25 PM, Sven Neumann wrote:

This should probably read

 gchar *xdgargs[4];

(sorry forgot to reply-all)

Oops (facepalm). Thanks.

So, I've written a replacement plug-in that works pretty well. However, the only filetype supported is still .XCF.

Looking at the new api docs, it seems possible to raise a GimpDialog that contains something like a toggle for "Native XCF or Export" and also the new 'gimp_export_dialog_new' widget. Does this sound reasonable?

Thanks,
Chris

Chris Mohler
2009-10-05 03:27:03 UTC (about 15 years ago)

Hacking on the mail plugin

On Sun, Oct 4, 2009 at 4:59 PM, Chris Mohler wrote:

Looking at the new api docs, it seems possible to raise a GimpDialog that contains something like a toggle for "Native XCF or Export" and also the new 'gimp_export_dialog_new' widget.  Does this sound reasonable?

Also - is there some way to grab a list of all of the file types supported by GIMP automatically? I've taken a look in the app/dialogs/file-save-dialog, but I'm beginning to doubt that a call like 'gimp->plug_in_manager->export_procs' is possible from a plug-in...

Thanks,
Chris

Sven Neumann
2009-10-05 21:41:27 UTC (about 15 years ago)

Hacking on the mail plugin

Hi,

On Sun, 2009-10-04 at 16:59 -0500, Chris Mohler wrote:

So, I've written a replacement plug-in that works pretty well. However, the only filetype supported is still .XCF.

I don't quite understand where this limitation comes from. If you allow the user to enter any filename, then GIMP will select a save procedure that matches the file extension. That should work for all file-types that GIMP knows about, not only for XCF. If it indeed does only work for XCF, then that's a regression in the plug-in API that should be reported and fixed for 2.8.

Sven