From af103ebfb8945c903accb42944516d234fe5744c Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Fri, 23 Nov 2012 14:25:39 -0300 Subject: Replaced 'reinterpret_cast' for gobject cast when possible. --- libqmenumodel/src/qdbusmenumodel.cpp | 6 +++--- libqmenumodel/src/qmenumodel.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'libqmenumodel/src') diff --git a/libqmenumodel/src/qdbusmenumodel.cpp b/libqmenumodel/src/qdbusmenumodel.cpp index 070381f..d3369dd 100644 --- a/libqmenumodel/src/qdbusmenumodel.cpp +++ b/libqmenumodel/src/qdbusmenumodel.cpp @@ -99,9 +99,9 @@ void QDBusMenuModel::serviceVanish(GDBusConnection *) /*! \internal */ void QDBusMenuModel::serviceAppear(GDBusConnection *connection) { - GMenuModel *model = reinterpret_cast(g_dbus_menu_model_get(connection, - busName().toUtf8().data(), - objectPath().toUtf8().data())); + GMenuModel *model = G_MENU_MODEL(g_dbus_menu_model_get(connection, + busName().toUtf8().data(), + objectPath().toUtf8().data())); setMenuModel(model); if (model == NULL) { stop(); diff --git a/libqmenumodel/src/qmenumodel.cpp b/libqmenumodel/src/qmenumodel.cpp index a45d647..3ae2e3e 100644 --- a/libqmenumodel/src/qmenumodel.cpp +++ b/libqmenumodel/src/qmenumodel.cpp @@ -68,7 +68,7 @@ void QMenuModel::setMenuModelImpl(GMenuModel *other) m_menuModel = other; if (m_menuModel) { - g_object_weak_ref(reinterpret_cast(m_menuModel), + g_object_weak_ref(G_OBJECT(m_menuModel), reinterpret_cast(QMenuModel::onGMenuModelDestroyed), this); // this will trigger the menu load @@ -92,7 +92,7 @@ GMenuModel *QMenuModel::menuModel() const void QMenuModel::clearModel() { if (m_menuModel) { - g_object_weak_unref(reinterpret_cast(m_menuModel), + g_object_weak_unref(G_OBJECT(m_menuModel), reinterpret_cast(QMenuModel::onGMenuModelDestroyed), this); g_signal_handler_disconnect(m_menuModel, m_signalChangedId); -- cgit v1.2.3