aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier.tilloy@canonical.com>2012-10-10 09:41:24 +0200
committerOlivier Tilloy <olivier.tilloy@canonical.com>2012-10-10 09:41:24 +0200
commit92ee9e3197ebbfef98ec044d9d45622a880136f3 (patch)
tree671a091f4b650654cc29ea0ab12a1c676cdc2e57 /libqmenumodel
parentbced31c677a5bb6399aad890d8e09c741bfc82a6 (diff)
downloadqmenumodel-92ee9e3197ebbfef98ec044d9d45622a880136f3.tar.gz
qmenumodel-92ee9e3197ebbfef98ec044d9d45622a880136f3.tar.bz2
qmenumodel-92ee9e3197ebbfef98ec044d9d45622a880136f3.zip
Revert to using g* types, and forward-declare them.
This is more future-proof.
Diffstat (limited to 'libqmenumodel')
-rw-r--r--libqmenumodel/src/qdbusactiongroup.cpp6
-rw-r--r--libqmenumodel/src/qdbusactiongroup.h8
-rw-r--r--libqmenumodel/src/qdbusobject.cpp4
-rw-r--r--libqmenumodel/src/qdbusobject.h9
-rw-r--r--libqmenumodel/src/qmenumodel.cpp8
-rw-r--r--libqmenumodel/src/qmenumodel.h7
6 files changed, 25 insertions, 17 deletions
diff --git a/libqmenumodel/src/qdbusactiongroup.cpp b/libqmenumodel/src/qdbusactiongroup.cpp
index 354a08a..0c1367a 100644
--- a/libqmenumodel/src/qdbusactiongroup.cpp
+++ b/libqmenumodel/src/qdbusactiongroup.cpp
@@ -212,21 +212,21 @@ void QDBusActionGroup::updateActionState(const QString &name, const QVariant &st
}
/*! \internal */
-void QDBusActionGroup::onActionAdded(GDBusActionGroup *, char *name, void *data)
+void QDBusActionGroup::onActionAdded(GDBusActionGroup *, gchar *name, gpointer data)
{
QDBusActionGroup *self = reinterpret_cast<QDBusActionGroup*>(data);
Q_EMIT self->actionAppear(name);
}
/*! \internal */
-void QDBusActionGroup::onActionRemoved(GDBusActionGroup *, char *name, void *data)
+void QDBusActionGroup::onActionRemoved(GDBusActionGroup *, gchar *name, gpointer data)
{
QDBusActionGroup *self = reinterpret_cast<QDBusActionGroup*>(data);
Q_EMIT self->actionVanish(name);
}
/*! \internal */
-void QDBusActionGroup::onActionStateChanged(GDBusActionGroup *, char *name, GVariant *value, void *data)
+void QDBusActionGroup::onActionStateChanged(GDBusActionGroup *, gchar *name, GVariant *value, gpointer data)
{
QDBusActionGroup *self = reinterpret_cast<QDBusActionGroup*>(data);
Q_EMIT self->actionStateChanged(name, Converter::toQVariant(value));
diff --git a/libqmenumodel/src/qdbusactiongroup.h b/libqmenumodel/src/qdbusactiongroup.h
index 24c124e..beaca24 100644
--- a/libqmenumodel/src/qdbusactiongroup.h
+++ b/libqmenumodel/src/qdbusactiongroup.h
@@ -27,6 +27,8 @@
class QStateAction;
+typedef char gchar;
+typedef void* gpointer;
typedef struct _GVariant GVariant;
typedef struct _GActionGroup GActionGroup;
typedef struct _GDBusActionGroup GDBusActionGroup;
@@ -81,9 +83,9 @@ private:
void clear();
// glib slots
- static void onActionAdded(GDBusActionGroup *ag, char *name, void *data);
- static void onActionRemoved(GDBusActionGroup *ag, char *name, void *data);
- static void onActionStateChanged(GDBusActionGroup *ag, char *name, GVariant *value, void *data);
+ static void onActionAdded(GDBusActionGroup *ag, gchar *name, gpointer data);
+ static void onActionRemoved(GDBusActionGroup *ag, gchar *name, gpointer data);
+ static void onActionStateChanged(GDBusActionGroup *ag, gchar *name, GVariant *value, gpointer data);
};
#endif
diff --git a/libqmenumodel/src/qdbusobject.cpp b/libqmenumodel/src/qdbusobject.cpp
index 4520323..929aec0 100644
--- a/libqmenumodel/src/qdbusobject.cpp
+++ b/libqmenumodel/src/qdbusobject.cpp
@@ -176,7 +176,7 @@ void QDBusObject::disconnect()
}
}
-void QDBusObject::onServiceAppeared(GDBusConnection *connection, const char *, const char *, void *data)
+void QDBusObject::onServiceAppeared(GDBusConnection *connection, const gchar *, const gchar *, gpointer data)
{
QDBusObject *self = reinterpret_cast<QDBusObject*>(data);
@@ -184,7 +184,7 @@ void QDBusObject::onServiceAppeared(GDBusConnection *connection, const char *, c
self->serviceAppear(connection);
}
-void QDBusObject::onServiceVanished(GDBusConnection *connection, const char *, void *data)
+void QDBusObject::onServiceVanished(GDBusConnection *connection, const gchar *, gpointer data)
{
QDBusObject *self = reinterpret_cast<QDBusObject*>(data);
diff --git a/libqmenumodel/src/qdbusobject.h b/libqmenumodel/src/qdbusobject.h
index 1c5c08d..324d3fd 100644
--- a/libqmenumodel/src/qdbusobject.h
+++ b/libqmenumodel/src/qdbusobject.h
@@ -24,6 +24,9 @@
#include "dbus-enums.h"
+typedef unsigned int guint;
+typedef char gchar;
+typedef void* gpointer;
typedef struct _GDBusConnection GDBusConnection;
class QDBusObject
@@ -57,7 +60,7 @@ protected:
virtual void statusChanged(DBusEnums::ConnectionStatus status) = 0;
private:
- quint32 m_watchId;
+ guint m_watchId;
DBusEnums::BusType m_busType;
QString m_busName;
QString m_objectPath;
@@ -66,8 +69,8 @@ private:
void setStatus(DBusEnums::ConnectionStatus status);
// glib slots
- static void onServiceAppeared(GDBusConnection *connection, const char *name, const char *name_owner, void *data);
- static void onServiceVanished(GDBusConnection *connection, const char *name, void *data);
+ static void onServiceAppeared(GDBusConnection *connection, const gchar *name, const gchar *name_owner, gpointer data);
+ static void onServiceVanished(GDBusConnection *connection, const gchar *name, gpointer data);
};
#endif
diff --git a/libqmenumodel/src/qmenumodel.cpp b/libqmenumodel/src/qmenumodel.cpp
index a34cb47..1aaf210 100644
--- a/libqmenumodel/src/qmenumodel.cpp
+++ b/libqmenumodel/src/qmenumodel.cpp
@@ -209,10 +209,10 @@ QVariant QMenuModel::getExtraProperties(const QModelIndex &index) const
/*! \internal */
void QMenuModel::onItemsChanged(GMenuModel *,
- int position,
- int removed,
- int added,
- void *data)
+ gint position,
+ gint removed,
+ gint added,
+ gpointer data)
{
QMenuModel *self = reinterpret_cast<QMenuModel*>(data);
diff --git a/libqmenumodel/src/qmenumodel.h b/libqmenumodel/src/qmenumodel.h
index af27802..b5c76c0 100644
--- a/libqmenumodel/src/qmenumodel.h
+++ b/libqmenumodel/src/qmenumodel.h
@@ -22,6 +22,9 @@
#include <QAbstractListModel>
+typedef int gint;
+typedef unsigned int guint;
+typedef void* gpointer;
typedef struct _GMenuModel GMenuModel;
class QMenuModel : public QAbstractListModel
@@ -51,14 +54,14 @@ protected:
private:
GMenuModel *m_menuModel;
- quint32 m_signalChangedId;
+ guint m_signalChangedId;
QVariant getStringAttribute(const QModelIndex &index, const QString &attribute) const;
QVariant getLink(const QModelIndex &index, const QString &linkName) const;
QVariant getExtraProperties(const QModelIndex &index) const;
QString parseExtraPropertyName(const QString &name) const;
- static void onItemsChanged(GMenuModel *model, int position, int removed, int added, void *data);
+ static void onItemsChanged(GMenuModel *model, gint position, gint removed, gint added, gpointer data);
};
#endif