dbus callverb method crashes

Bug #707364 reported by joakim@verona.se
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
joakim@verona.se

Bug Description

like this one:

(inkdoc-call-verb (inkscape-document-dbus-proxy-create "desktop_0") "ToolPen")

seems easiy fixable though:

gboolean
dbus_call_verb (DocumentInterface *object, int verbid, GError **error)
{
    SPDesktop *desk2 = object->desk;
    desktop_ensure_active (desk2);

    if ( desk2 ) {
        Inkscape::Verb *verb = Inkscape::Verb::get( verbid );
        if ( verb ) {
            SPAction *action = verb->get_action(desk2);
            if ( action ) {
                //if (!object->updates)
                    //document_interface_pause_updates (object, error);
                sp_action_perform( action, NULL );
                if (object->updates)
                    Inkscape::DocumentUndo::done(sp_desktop_document(desk2), verb->get_code(), g_strdup(verb->get_tip()));
                //if (!object->updates)
                    //document_interface_pause_updates (object, error);
                return TRUE;
            }
        }
    }
    g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_VERB, "Verb failed to execute");
    return FALSE;
}

ill test and return with a proper patch

Tags: dbusapi

Related branches

Revision history for this message
joakim@verona.se (joakim-verona) wrote :

Ive tested the fix now. seems to work fine.

Revision history for this message
jazzynico (jazzynico) wrote :

Thanks for the patches and the branch!
Don't hesitate to propose it for merging when its ready so that we can test it and then commit all your fixes at the same time.

Changed in inkscape:
assignee: nobody → joakim@verona.se (joakim-verona)
status: New → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Not reproduced on Ubuntu 10.10, Inkscape trunk revision 10113.
Inkscape doesn't crash and selects the required tool (tested with other tools too).
The only thing I notice is the following message (in D-feet):
    "org.inkscape.document.FailedVerb: Verb 'ToolPen' failed to execute or was not found."

Revision history for this message
jazzynico (jazzynico) wrote :

Ok, the patch version doesn't triggers the message anymore. I guess the missing return value that caused a d-bus crash, not an Inkscape one.

Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed in the trunk, revision 10114.
Thanks Joakim!

Changed in inkscape:
importance: Undecided → Low
status: In Progress → Fix Released
su_v (suv-lp)
tags: added: dbusapi
removed: dbus
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.