3131#include <gio/gio.h>
3232#include <gio/gunixfdlist.h>
3333
34- #ifdef HAVE_OLD_UPOWER
35- #define UPOWER_ENABLE_DEPRECATED 1
36- #include <upower.h>
37- #endif
3834
3935#include "csm-system.h"
4036#include "csm-consolekit.h"
@@ -51,9 +47,6 @@ struct _CsmConsolekitPrivate
5147{
5248 GDBusProxy * ck_proxy ;
5349 GDBusProxy * ck_session_proxy ;
54- #ifdef HAVE_OLD_UPOWER
55- UpClient * up_client ;
56- #endif
5750 char * session_id ;
5851 gchar * session_path ;
5952
@@ -113,9 +106,6 @@ csm_consolekit_finalize (GObject *object)
113106 drop_system_inhibitor (consolekit );
114107 drop_delay_inhibitor (consolekit );
115108
116- #ifdef HAVE_OLD_UPOWER
117- g_clear_object (& manager -> priv -> up_client );
118- #endif
119109
120110 G_OBJECT_CLASS (csm_consolekit_parent_class )-> finalize (object );
121111}
@@ -280,10 +270,6 @@ csm_consolekit_init (CsmConsolekit *manager)
280270 g_signal_connect (manager -> priv -> ck_session_proxy , "g-signal" ,
281271 G_CALLBACK (ck_session_proxy_signal_cb ), manager );
282272
283- #ifdef HAVE_OLD_UPOWER
284- g_clear_object (& manager -> priv -> up_client );
285- manager -> priv -> up_client = up_client_new ();
286- #endif
287273
288274 g_object_unref (bus );
289275}
@@ -603,10 +589,6 @@ csm_consolekit_is_login_session (CsmSystem *system)
603589static gboolean
604590csm_consolekit_can_suspend (CsmSystem * system )
605591{
606- #ifdef HAVE_OLD_UPOWER
607- CsmConsolekit * consolekit = CSM_CONSOLEKIT (system );
608- return up_client_get_can_suspend (consolekit -> priv -> up_client );
609- #else
610592 CsmConsolekit * manager = CSM_CONSOLEKIT (system );
611593 gchar * rv ;
612594 GVariant * res ;
@@ -634,16 +616,11 @@ csm_consolekit_can_suspend (CsmSystem *system)
634616 g_free (rv );
635617
636618 return can_suspend ;
637- #endif
638619}
639620
640621static gboolean
641622csm_consolekit_can_hibernate (CsmSystem * system )
642623{
643- #ifdef HAVE_OLD_UPOWER
644- CsmConsolekit * consolekit = CSM_CONSOLEKIT (system );
645- return up_client_get_can_hibernate (consolekit -> priv -> up_client );
646- #else
647624 CsmConsolekit * manager = CSM_CONSOLEKIT (system );
648625 gchar * rv ;
649626 GVariant * res ;
@@ -671,7 +648,6 @@ csm_consolekit_can_hibernate (CsmSystem *system)
671648 g_free (rv );
672649
673650 return can_hibernate ;
674- #endif
675651}
676652
677653static void
@@ -715,17 +691,6 @@ hibernate_done (GObject *source,
715691static void
716692csm_consolekit_suspend (CsmSystem * system , gboolean suspend_then_hibernate )
717693{
718- #ifdef HAVE_OLD_UPOWER
719- CsmConsolekit * consolekit = CSM_CONSOLEKIT (system );
720- GError * error = NULL ;
721- gboolean ret ;
722-
723- ret = up_client_suspend_sync (consolekit -> priv -> up_client , NULL , & error );
724- if (!ret ) {
725- g_warning ("Unexpected suspend failure: %s" , error -> message );
726- g_error_free (error );
727- }
728- #else
729694 CsmConsolekit * manager = CSM_CONSOLEKIT (system );
730695
731696 gchar * method = "Suspend" ;
@@ -742,23 +707,11 @@ csm_consolekit_suspend (CsmSystem *system, gboolean suspend_then_hibernate)
742707 NULL ,
743708 suspend_done ,
744709 manager );
745- #endif
746710}
747711
748712static void
749713csm_consolekit_hibernate (CsmSystem * system )
750714{
751- #ifdef HAVE_OLD_UPOWER
752- CsmConsolekit * consolekit = CSM_CONSOLEKIT (system );
753- GError * error = NULL ;
754- gboolean ret ;
755-
756- ret = up_client_hibernate_sync (consolekit -> priv -> up_client , NULL , & error );
757- if (!ret ) {
758- g_warning ("Unexpected hibernate failure: %s" , error -> message );
759- g_error_free (error );
760- }
761- #else
762715 CsmConsolekit * manager = CSM_CONSOLEKIT (system );
763716
764717 g_dbus_proxy_call (manager -> priv -> ck_proxy ,
@@ -769,7 +722,6 @@ csm_consolekit_hibernate (CsmSystem *system)
769722 NULL ,
770723 hibernate_done ,
771724 manager );
772- #endif
773725}
774726
775727static void
0 commit comments