diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-06-25 13:53:25 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-06-25 13:53:25 -0500 |
commit | 660d7bcbbddf3ea10146b47d3bf5c64899b8b2e0 (patch) | |
tree | b5cfd6939f54cda74c6065de77eb3b52c7c67c3e /tests/backend-dbus/mock-login1-manager.cc | |
parent | 3cabab005963648247d8af74645c8e245efe13e8 (diff) | |
download | ayatana-indicator-session-660d7bcbbddf3ea10146b47d3bf5c64899b8b2e0.tar.gz ayatana-indicator-session-660d7bcbbddf3ea10146b47d3bf5c64899b8b2e0.tar.bz2 ayatana-indicator-session-660d7bcbbddf3ea10146b47d3bf5c64899b8b2e0.zip |
copyediting: remove g_messages() added while fixing the tests, remove dead code
Diffstat (limited to 'tests/backend-dbus/mock-login1-manager.cc')
-rw-r--r-- | tests/backend-dbus/mock-login1-manager.cc | 96 |
1 files changed, 1 insertions, 95 deletions
diff --git a/tests/backend-dbus/mock-login1-manager.cc b/tests/backend-dbus/mock-login1-manager.cc index 3bd652b..4461125 100644 --- a/tests/backend-dbus/mock-login1-manager.cc +++ b/tests/backend-dbus/mock-login1-manager.cc @@ -26,99 +26,17 @@ namespace const char * const BUS_NAME = "org.freedesktop.login1"; const char * const BUS_PATH = "/org/freedesktop/login1"; - -#if 0 - void on_active_session_changed (Login1Seat * o G_GNUC_UNUSED, - const gchar * new_ssid, - gpointer ssid) - { - *static_cast<std::string*>(ssid) = new_ssid; - } -#endif -} - -/*** -**** -***/ - -#if 0 -gboolean -MockLogin1Manager :: on_get_current_session (Login1Manager * m, - GDBusMethodInvocation * inv, - gpointer gself) -{ - MockLogin1Manager * self = static_cast<MockLogin1Manager*>(gself); - const std::string& ssid = self->my_current_ssid; - console_kit_manager_complete_get_current_session (m, inv, ssid.c_str()); - return true; -} - -gboolean -MockLogin1Manager :: on_get_seats (Login1Manager * m, - GDBusMethodInvocation * inv, - gpointer gself) -{ - int i; - char ** sids; - const seats_t& seats = static_cast<MockLogin1Manager*>(gself)->my_seats; - - i = 0; - sids = g_new0 (char*, seats.size()+1); - for (seats_t::const_iterator it(seats.begin()), - end(seats.end()); it!=end; ++it) - sids[i++] = (char*) (*it)->path(); - console_kit_manager_complete_get_seats (m, inv, sids); - g_strfreev (sids); - - return true; -} - -gboolean -MockLogin1Manager :: handle_restart (Login1Manager * ckm, - GDBusMethodInvocation * inv, - gpointer gself) -{ - static_cast<MockLogin1Manager*>(gself)->my_last_action = Restart; - console_kit_manager_complete_restart (ckm, inv); - return true; } -gboolean -MockLogin1Manager :: handle_stop (Login1Manager * ckm, - GDBusMethodInvocation * inv, - gpointer gself) -{ - static_cast<MockLogin1Manager*>(gself)->my_last_action = Shutdown; - console_kit_manager_complete_stop (ckm, inv); - return true; -} -#endif - /*** **** ***/ -#if 0 -MockLogin1Session * -MockLogin1Manager :: current_session () -{ - MockLogin1Session * ret = 0; - - for (seats_t::iterator it(my_seats.begin()), - end(my_seats.end()); it!=end; ++it) - if ((ret = (*it)->find (my_current_ssid.c_str()))) - break; - - return ret; -} -#endif - void MockLogin1Manager :: emit_session_new (MockLogin1Seat * seat, int tag) const { std::string id; std::string path; - seat->get_session_id_and_path_for_tag (tag, id, path); login1_manager_emit_session_new (my_skeleton, id.c_str(), path.c_str()); @@ -139,7 +57,6 @@ MockLogin1Manager :: emit_session_removed (MockLogin1Seat * seat, int tag) const { std::string id; std::string path; - seat->get_session_id_and_path_for_tag (tag, id, path); login1_manager_emit_session_removed (my_skeleton, id.c_str(), path.c_str()); @@ -188,9 +105,7 @@ MockLogin1Manager :: list_sessions () const } } - GVariant * v = g_variant_builder_end (&b); - g_message ("%s %s returning %s", G_STRLOC, G_STRFUNC, g_variant_print (v, true)); - return v; + return g_variant_builder_end (&b); } /*** @@ -313,15 +228,6 @@ MockLogin1Manager :: MockLogin1Manager (GMainLoop * loop, g_signal_connect (my_skeleton, "handle-list-sessions", G_CALLBACK(handle_list_sessions), this); -#if 0 - g_signal_connect (my_skeleton, "handle-get-seats", - G_CALLBACK(on_get_seats), this); - g_signal_connect (my_skeleton, "handle-stop", - G_CALLBACK(handle_stop), this); - g_signal_connect (my_skeleton, "handle-restart", - G_CALLBACK(handle_restart), this); -#endif - set_skeleton (G_DBUS_INTERFACE_SKELETON(my_skeleton)); } |