|
42 | 42 | #include <libcinnamon-desktop/gnome-rr.h> |
43 | 43 |
|
44 | 44 | #include "gpm-common.h" |
45 | | -#include "gpm-phone.h" |
46 | 45 | #include <libcinnamon-desktop/gnome-idle-monitor.h> |
47 | 46 | #include "cinnamon-settings-profile.h" |
48 | 47 | #include "cinnamon-settings-session.h" |
@@ -149,7 +148,6 @@ struct CsdPowerManagerPrivate |
149 | 148 | gboolean use_time_primary; |
150 | 149 | GIcon *previous_icon; |
151 | 150 | guint previous_percentage; |
152 | | - GpmPhone *phone; |
153 | 151 | GPtrArray *devices_array; |
154 | 152 | guint action_percentage; |
155 | 153 | guint action_time; |
@@ -965,9 +963,6 @@ engine_coldplug (CsdPowerManager *manager) |
965 | 963 | GPtrArray *array = NULL; |
966 | 964 | UpDevice *device; |
967 | 965 |
|
968 | | - /* connected mobile phones */ |
969 | | - gpm_phone_coldplug (manager->priv->phone); |
970 | | - |
971 | 966 | engine_recalculate_state (manager); |
972 | 967 |
|
973 | 968 | /* add to database */ |
@@ -1757,90 +1752,6 @@ engine_get_primary_device (CsdPowerManager *manager) |
1757 | 1752 | return device; |
1758 | 1753 | } |
1759 | 1754 |
|
1760 | | -static void |
1761 | | -phone_device_added_cb (GpmPhone *phone, guint idx, CsdPowerManager *manager) |
1762 | | -{ |
1763 | | - UpDevice *device; |
1764 | | - device = up_device_new (); |
1765 | | - |
1766 | | - g_debug ("phone added %i", idx); |
1767 | | - |
1768 | | - /* get device properties */ |
1769 | | - g_object_set (device, |
1770 | | - "kind", UP_DEVICE_KIND_PHONE, |
1771 | | - "is-rechargeable", TRUE, |
1772 | | - "native-path", g_strdup_printf ("dummy:phone_%i", idx), |
1773 | | - "is-present", TRUE, |
1774 | | - NULL); |
1775 | | - |
1776 | | - /* state changed */ |
1777 | | - engine_device_add (manager, device); |
1778 | | - g_ptr_array_add (manager->priv->devices_array, g_object_ref (device)); |
1779 | | - engine_recalculate_state (manager); |
1780 | | -} |
1781 | | - |
1782 | | -static void |
1783 | | -phone_device_removed_cb (GpmPhone *phone, guint idx, CsdPowerManager *manager) |
1784 | | -{ |
1785 | | - guint i; |
1786 | | - UpDevice *device; |
1787 | | - UpDeviceKind kind; |
1788 | | - |
1789 | | - g_debug ("phone removed %i", idx); |
1790 | | - |
1791 | | - for (i=0; i<manager->priv->devices_array->len; i++) { |
1792 | | - device = g_ptr_array_index (manager->priv->devices_array, i); |
1793 | | - |
1794 | | - /* get device properties */ |
1795 | | - g_object_get (device, |
1796 | | - "kind", &kind, |
1797 | | - NULL); |
1798 | | - |
1799 | | - if (kind == UP_DEVICE_KIND_PHONE) { |
1800 | | - g_ptr_array_remove_index (manager->priv->devices_array, i); |
1801 | | - break; |
1802 | | - } |
1803 | | - } |
1804 | | - |
1805 | | - /* state changed */ |
1806 | | - engine_recalculate_state (manager); |
1807 | | -} |
1808 | | - |
1809 | | -static void |
1810 | | -phone_device_refresh_cb (GpmPhone *phone, guint idx, CsdPowerManager *manager) |
1811 | | -{ |
1812 | | - guint i; |
1813 | | - UpDevice *device; |
1814 | | - UpDeviceKind kind; |
1815 | | - UpDeviceState state; |
1816 | | - gboolean is_present; |
1817 | | - gdouble percentage; |
1818 | | - |
1819 | | - g_debug ("phone refresh %i", idx); |
1820 | | - |
1821 | | - for (i=0; i<manager->priv->devices_array->len; i++) { |
1822 | | - device = g_ptr_array_index (manager->priv->devices_array, i); |
1823 | | - |
1824 | | - /* get device properties */ |
1825 | | - g_object_get (device, |
1826 | | - "kind", &kind, |
1827 | | - "state", &state, |
1828 | | - "percentage", &percentage, |
1829 | | - "is-present", &is_present, |
1830 | | - NULL); |
1831 | | - |
1832 | | - if (kind == UP_DEVICE_KIND_PHONE) { |
1833 | | - is_present = gpm_phone_get_present (phone, idx); |
1834 | | - state = gpm_phone_get_on_ac (phone, idx) ? UP_DEVICE_STATE_CHARGING : UP_DEVICE_STATE_DISCHARGING; |
1835 | | - percentage = gpm_phone_get_percentage (phone, idx); |
1836 | | - break; |
1837 | | - } |
1838 | | - } |
1839 | | - |
1840 | | - /* state changed */ |
1841 | | - engine_recalculate_state (manager); |
1842 | | -} |
1843 | | - |
1844 | 1755 | static void |
1845 | 1756 | cinnamon_session_shutdown_cb (GObject *source_object, |
1846 | 1757 | GAsyncResult *res, |
@@ -4166,14 +4077,6 @@ on_rr_screen_acquired (GObject *object, |
4166 | 4077 | connect_screen_iface (manager); |
4167 | 4078 | connect_keyboard_iface (manager); |
4168 | 4079 |
|
4169 | | - manager->priv->phone = gpm_phone_new (); |
4170 | | - g_signal_connect (manager->priv->phone, "device-added", |
4171 | | - G_CALLBACK (phone_device_added_cb), manager); |
4172 | | - g_signal_connect (manager->priv->phone, "device-removed", |
4173 | | - G_CALLBACK (phone_device_removed_cb), manager); |
4174 | | - g_signal_connect (manager->priv->phone, "device-refresh", |
4175 | | - G_CALLBACK (phone_device_refresh_cb), manager); |
4176 | | - |
4177 | 4080 | /* create a fake virtual composite battery */ |
4178 | 4081 | manager->priv->device_composite = up_device_new (); |
4179 | 4082 | g_object_set (manager->priv->device_composite, |
@@ -4363,11 +4266,6 @@ csd_power_manager_stop (CsdPowerManager *manager) |
4363 | 4266 | g_ptr_array_unref (manager->priv->devices_array); |
4364 | 4267 | manager->priv->devices_array = NULL; |
4365 | 4268 |
|
4366 | | - if (manager->priv->phone != NULL) { |
4367 | | - g_object_unref (manager->priv->phone); |
4368 | | - manager->priv->phone = NULL; |
4369 | | - } |
4370 | | - |
4371 | 4269 | if (manager->priv->device_composite != NULL) { |
4372 | 4270 | g_object_unref (manager->priv->device_composite); |
4373 | 4271 | manager->priv->device_composite = NULL; |
|
0 commit comments