Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
geoclue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
28
Issues
28
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
geoclue
geoclue
Commits
b6c2aa46
Commit
b6c2aa46
authored
Dec 01, 2008
by
Jussi Kukkonen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
call add_reference and remove_reference asynchronously
parent
58609b12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
geoclue/geoclue-provider.c
geoclue/geoclue-provider.c
+24
-9
No files found.
geoclue/geoclue-provider.c
View file @
b6c2aa46
...
...
@@ -84,6 +84,24 @@ status_changed (DBusGProxy *proxy,
g_signal_emit
(
provider
,
signals
[
STATUS_CHANGED
],
0
,
status
);
}
static
void
add_reference_callback
(
DBusGProxy
*
proxy
,
GError
*
error
,
gpointer
userdata
)
{
if
(
error
)
{
g_printerr
(
"Could not reference provider: %s"
,
error
->
message
);
g_error_free
(
error
);
}
}
static
void
remove_reference_callback
(
DBusGProxy
*
proxy
,
GError
*
error
,
gpointer
userdata
)
{
if
(
error
)
{
g_printerr
(
"Could not unreference provider: %s"
,
error
->
message
);
g_error_free
(
error
);
}
}
static
void
finalize
(
GObject
*
object
)
{
...
...
@@ -101,12 +119,10 @@ dispose (GObject *object)
{
GeoclueProvider
*
provider
=
GEOCLUE_PROVIDER
(
object
);
GeoclueProviderPrivate
*
priv
=
GET_PRIVATE
(
object
);
GError
*
error
=
NULL
;
if
(
!
org_freedesktop_Geoclue_remove_reference
(
priv
->
geoclue_proxy
,
&
error
)){
g_printerr
(
"Could not unreference provider: %s"
,
error
->
message
);
g_error_free
(
error
);
}
org_freedesktop_Geoclue_remove_reference_async
(
priv
->
geoclue_proxy
,
remove_reference_callback
,
NULL
);
if
(
priv
->
geoclue_proxy
)
{
g_object_unref
(
priv
->
geoclue_proxy
);
priv
->
geoclue_proxy
=
NULL
;
...
...
@@ -156,10 +172,9 @@ constructor (GType type,
priv
->
geoclue_proxy
=
dbus_g_proxy_new_for_name
(
connection
,
priv
->
service
,
priv
->
path
,
GEOCLUE_INTERFACE_NAME
);
if
(
!
org_freedesktop_Geoclue_add_reference
(
priv
->
geoclue_proxy
,
&
error
)){
g_printerr
(
"Could not reference provider: %s"
,
error
->
message
);
g_error_free
(
error
);
}
org_freedesktop_Geoclue_add_reference_async
(
priv
->
geoclue_proxy
,
add_reference_callback
,
NULL
);
dbus_g_proxy_add_signal
(
priv
->
geoclue_proxy
,
"StatusChanged"
,
G_TYPE_INT
,
G_TYPE_INVALID
);
dbus_g_proxy_connect_signal
(
priv
->
geoclue_proxy
,
"StatusChanged"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment