~ubuntu-branches/ubuntu/wily/mate-power-manager/wily

« back to all changes in this revision

Viewing changes to src/gpm-control.c

  • Committer: Package Import Robot
  • Author(s): Mike Gabriel, Martin Wimpress, Mike Gabriel
  • Date: 2015-09-02 05:08:49 UTC
  • mfrom: (7.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20150902050849-4krrri9he6z6tiby
Tags: 1.10.2-1
[ Martin Wimpress ]
* New upstream release.
* debian/mate-power-manager-common.install:
  + Add usr/share/{help,man}.
* debian/mate-power-manager.install:
  + Remove usr/share/man.
* debian/rules:
  + Correct typo.
  + Add --enable-deprecated and --disable-strict build options.
  + Remove dfsg suffix.
* debian/watch:
  + Remove dfsg suffix.
* debian/copyright:
  + Add copyright attribution for help authors and translators.
  + Remove patches/gpm-manager.patch, no longer upstream.
* debian/patches:
  + Drop 2001_omit-gfdl-licensed-help-files.patch, the mate-power-manager
    help is DFSG compliant.

[ Mike Gabriel ]
* Upload to unstable.
  - This new upstream release fixes keyboard backlight adjustment for
    laptops with non-standard levels. (This hopefully closes: #775500,
    please reopen, if not).
* lintian:
  + Move overrides in mate-power-manager.lintian-overrides over to
    bin:package mate-power-manager-common (man page have been moved
    over into the latter).

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
gpm_control_systemd_shutdown (void) {
98
98
        GError *error = NULL;
99
99
        GDBusProxy *proxy;
 
100
        GVariant *res = NULL;
100
101
 
101
102
        egg_debug ("Requesting systemd to shutdown");
102
103
        proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
114
115
                return FALSE;
115
116
        }
116
117
 
117
 
        g_dbus_proxy_call_sync (proxy, "PowerOff",
118
 
                                g_variant_new( "(b)", FALSE),
119
 
                                G_DBUS_CALL_FLAGS_NONE,
120
 
                                -1,
121
 
                                NULL,
122
 
                                &error
123
 
                                );
 
118
        res = g_dbus_proxy_call_sync (proxy, "PowerOff",
 
119
                                      g_variant_new( "(b)", FALSE),
 
120
                                      G_DBUS_CALL_FLAGS_NONE,
 
121
                                      -1,
 
122
                                      NULL,
 
123
                                      &error
 
124
                                      );
124
125
        if (error != NULL) {
125
126
                egg_error ("Error in dbus - %s", error->message);
126
127
                g_error_free (error);
127
128
                return FALSE;
128
129
        }
129
130
 
 
131
        g_variant_unref(res);
130
132
        return TRUE;
131
133
}
132
134
 
219
221
 
220
222
        GError *dbus_error = NULL;
221
223
        GDBusProxy *proxy;
 
224
        GVariant *res = NULL;
222
225
 
223
226
        screensaver = gpm_screensaver_new ();
224
227
 
272
275
                        g_error_free (dbus_error);
273
276
                        return -1;
274
277
                }
275
 
                g_dbus_proxy_call_sync (proxy, "Suspend", 
276
 
                                        g_variant_new( "(b)",FALSE),
277
 
                                        G_DBUS_CALL_FLAGS_NONE,
278
 
                                        -1,
279
 
                                        NULL,
280
 
                                        &dbus_error
281
 
                                        );
 
278
                res = g_dbus_proxy_call_sync (proxy, "Suspend",
 
279
                                              g_variant_new( "(b)",FALSE),
 
280
                                              G_DBUS_CALL_FLAGS_NONE,
 
281
                                              -1,
 
282
                                              NULL,
 
283
                                              &dbus_error
 
284
                                              );
282
285
                if (dbus_error != NULL ) {
283
286
                        egg_debug ("Error in dbus - %s", dbus_error->message);
284
287
                        g_error_free (dbus_error);
285
288
                        ret = TRUE;
286
289
                }
287
290
                else {
 
291
                        g_variant_unref(res);
288
292
                        ret = TRUE;
289
293
                }
290
294
                g_object_unref(proxy);
331
335
 
332
336
        GError *dbus_error = NULL;
333
337
        GDBusProxy *proxy;
 
338
        GVariant *res = NULL;
334
339
 
335
340
        screensaver = gpm_screensaver_new ();
336
341
 
384
389
                        g_error_free (dbus_error);
385
390
                        return -1;
386
391
                }
387
 
                g_dbus_proxy_call_sync (proxy, "Hibernate", 
388
 
                                        g_variant_new( "(b)",FALSE),
389
 
                                        G_DBUS_CALL_FLAGS_NONE,
390
 
                                        -1,
391
 
                                        NULL,
392
 
                                        &dbus_error
393
 
                                        );
 
392
                res = g_dbus_proxy_call_sync (proxy, "Hibernate",
 
393
                                              g_variant_new( "(b)",FALSE),
 
394
                                              G_DBUS_CALL_FLAGS_NONE,
 
395
                                              -1,
 
396
                                              NULL,
 
397
                                              &dbus_error
 
398
                                              );
394
399
                if (dbus_error != NULL ) {
395
400
                        egg_debug ("Error in dbus - %s", dbus_error->message);
396
401
                        g_error_free (dbus_error);
397
402
                        ret = TRUE;
398
403
                }
399
404
                else {
 
405
                        g_variant_unref(res);
400
406
                        ret = TRUE;
401
407
                }
402
408
        }