From bced31c677a5bb6399aad890d8e09c741bfc82a6 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Tue, 9 Oct 2012 18:37:30 +0200 Subject: Avoid including C headers (glib/gio) in public headers; use "forward declarations" instead. --- libqmenumodel/src/qmenumodel.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libqmenumodel/src/qmenumodel.h') diff --git a/libqmenumodel/src/qmenumodel.h b/libqmenumodel/src/qmenumodel.h index 7520480..af27802 100644 --- a/libqmenumodel/src/qmenumodel.h +++ b/libqmenumodel/src/qmenumodel.h @@ -22,9 +22,7 @@ #include -extern "C" { -#include -} +typedef struct _GMenuModel GMenuModel; class QMenuModel : public QAbstractListModel { @@ -53,14 +51,14 @@ protected: private: GMenuModel *m_menuModel; - guint m_signalChangedId; + quint32 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, gint position, gint removed, gint added, gpointer data); + static void onItemsChanged(GMenuModel *model, int position, int removed, int added, void *data); }; #endif -- cgit v1.2.3 From 92ee9e3197ebbfef98ec044d9d45622a880136f3 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Wed, 10 Oct 2012 09:41:24 +0200 Subject: Revert to using g* types, and forward-declare them. This is more future-proof. --- libqmenumodel/src/qmenumodel.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libqmenumodel/src/qmenumodel.h') 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 +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 -- cgit v1.2.3