aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-11-23 14:25:39 -0300
committerRenato Araujo Oliveira Filho <renato.filho@canonical.com>2012-11-23 14:25:39 -0300
commitaf103ebfb8945c903accb42944516d234fe5744c (patch)
tree749d2d64dc09db6b3b85c7e04ea4ee036f1f5cfb
parentf68764ac84a0aba3c729d4998ca64919bf3375f4 (diff)
downloadqmenumodel-af103ebfb8945c903accb42944516d234fe5744c.tar.gz
qmenumodel-af103ebfb8945c903accb42944516d234fe5744c.tar.bz2
qmenumodel-af103ebfb8945c903accb42944516d234fe5744c.zip
Replaced 'reinterpret_cast' for gobject cast when possible.
-rw-r--r--libqmenumodel/src/qdbusmenumodel.cpp6
-rw-r--r--libqmenumodel/src/qmenumodel.cpp4
2 files changed, 5 insertions, 5 deletions
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<GMenuModel*>(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<GObject*>(m_menuModel),
+ g_object_weak_ref(G_OBJECT(m_menuModel),
reinterpret_cast<GWeakNotify>(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<GObject*>(m_menuModel),
+ g_object_weak_unref(G_OBJECT(m_menuModel),
reinterpret_cast<GWeakNotify>(QMenuModel::onGMenuModelDestroyed),
this);
g_signal_handler_disconnect(m_menuModel, m_signalChangedId);