Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-panel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xfce
xfce4-panel
Commits
7d361dd1
Commit
7d361dd1
authored
2 years ago
by
Gaël Bonithon
Browse files
Options
Downloads
Patches
Plain Diff
panel: ExternalWrapper cleanup
* Remove useless variable * Use some macros * Improve messages
parent
18e25bb6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!103
Port to Wayland
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
panel/panel-plugin-external-wrapper.c
+11
-22
11 additions, 22 deletions
panel/panel-plugin-external-wrapper.c
with
11 additions
and
22 deletions
panel/panel-plugin-external-wrapper.c
+
11
−
22
View file @
7d361dd1
...
...
@@ -89,11 +89,7 @@ struct _PanelPluginExternalWrapper
PanelPluginExternal
__parent__
;
XfcePanelPluginWrapperExported
*
skeleton
;
GDBusConnection
*
connection
;
gboolean
exported
:
1
;
};
enum
...
...
@@ -140,7 +136,7 @@ panel_plugin_external_wrapper_class_init (PanelPluginExternalWrapperClass *klass
static
void
panel_plugin_external_wrapper_init
(
PanelPluginExternalWrapper
*
external
)
panel_plugin_external_wrapper_init
(
PanelPluginExternalWrapper
*
wrapper
)
{
}
...
...
@@ -170,9 +166,8 @@ panel_plugin_external_wrapper_constructed (GObject *object)
if
(
G_UNLIKELY
(
error
!=
NULL
))
{
g_critical
(
"
error wrapper
path %s
failed
: %s"
,
path
,
error
->
message
);
g_critical
(
"
Failed to export object at
path %s: %s"
,
path
,
error
->
message
);
g_error_free
(
error
);
wrapper
->
exported
=
FALSE
;
}
else
{
...
...
@@ -180,16 +175,14 @@ panel_plugin_external_wrapper_constructed (GObject *object)
G_CALLBACK
(
panel_plugin_external_wrapper_dbus_provider_signal
),
wrapper
);
g_signal_connect
(
wrapper
->
skeleton
,
"handle_remote_event_result"
,
G_CALLBACK
(
panel_plugin_external_wrapper_dbus_remote_event_result
),
wrapper
);
panel_debug
(
PANEL_DEBUG_EXTERNAL
,
"register dbus path %s"
,
path
);
wrapper
->
exported
=
TRUE
;
panel_debug
(
PANEL_DEBUG_EXTERNAL
,
"Exported object at path %s"
,
path
)
;
}
g_free
(
path
);
}
else
{
wrapper
->
exported
=
FALSE
;
g_critical
(
"Failed to get D-Bus session bus: %s"
,
error
->
message
);
g_error_free
(
error
);
}
...
...
@@ -206,13 +199,9 @@ panel_plugin_external_wrapper_finalize (GObject *object)
wrapper
=
PANEL_PLUGIN_EXTERNAL_WRAPPER
(
object
);
if
(
wrapper
->
exported
)
{
g_object_unref
(
wrapper
->
skeleton
);
g_object_unref
(
wrapper
->
connection
);
}
/* Export failed, but we have gotten a connection */
else
if
(
wrapper
->
connection
)
if
(
wrapper
->
skeleton
!=
NULL
)
g_object_unref
(
wrapper
->
skeleton
);
if
(
wrapper
->
connection
!=
NULL
)
g_object_unref
(
wrapper
->
connection
);
(
*
G_OBJECT_CLASS
(
panel_plugin_external_wrapper_parent_class
)
->
finalize
)
(
object
);
...
...
@@ -337,7 +326,7 @@ panel_plugin_external_wrapper_set_properties (PanelPluginExternal *external,
g_dbus_connection_emit_signal
(
wrapper
->
connection
,
NULL
,
g_dbus_interface_skeleton_get_object_path
(
G_DBUS_INTERFACE_SKELETON
(
wrapper
->
skeleton
)),
"org.xfce.Panel.Wrapper"
,
PANEL_DBUS_WRAPPER_INTERFACE
,
"Set"
,
g_variant_builder_end
(
&
builder
),
NULL
);
...
...
@@ -378,7 +367,7 @@ panel_plugin_external_wrapper_remote_event (PanelPluginExternal *external,
g_dbus_connection_emit_signal
(
wrapper
->
connection
,
NULL
,
g_dbus_interface_skeleton_get_object_path
(
G_DBUS_INTERFACE_SKELETON
(
wrapper
->
skeleton
)),
"org.xfce.Panel.Wrapper"
,
PANEL_DBUS_WRAPPER_INTERFACE
,
"RemoteEvent"
,
g_variant_new
(
"(svu)"
,
name
,
...
...
@@ -386,7 +375,7 @@ panel_plugin_external_wrapper_remote_event (PanelPluginExternal *external,
*
handle
),
NULL
);
return
TRUE
;
return
G_DBUS_METHOD_INVOCATION_HANDLED
;
}
...
...
@@ -418,7 +407,7 @@ panel_plugin_external_wrapper_dbus_provider_signal (XfcePanelPluginWrapperExport
xfce_panel_plugin_wrapper_exported_complete_provider_signal
(
skeleton
,
invocation
);
return
TRUE
;
return
G_DBUS_METHOD_INVOCATION_HANDLED
;
}
...
...
@@ -437,7 +426,7 @@ panel_plugin_external_wrapper_dbus_remote_event_result (XfcePanelPluginWrapperEx
xfce_panel_plugin_wrapper_exported_complete_remote_event_result
(
skeleton
,
invocation
);
return
TRUE
;
return
G_DBUS_METHOD_INVOCATION_HANDLED
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment