summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamey Hicks <jamey.hicks@nokia.com>2012-10-08 11:38:24 -0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-10 21:44:47 +0200
commitc29da8f42556856cb7dc8538fc505b9426e0f69e (patch)
tree6ecda7b80a68e2fc2b2c75ffad768d620dbb3313
parent68599fdb6edd04cb0bda2440b70406a503f5bf02 (diff)
Add QtJsonDb namespace to Q_PROPERTY as needed for qml
The QML runtime requires that QObject classes defined in other C++ namespaces have their namespace prepended in Q_PROPERTY, Q_INVOKABLE, etc. This change prepends the QtJsonDb in the necessary files in src/imports so that QtJsonDb QML elements that use Partition objects will work again. Change-Id: Id424fefe1fca960807fffc77cc47a4a2fc452a41 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
-rw-r--r--src/client/qjsondbglobal.h4
-rw-r--r--src/imports/jsondb/jsondatabase.h2
-rw-r--r--src/imports/jsondb/jsondblistmodel.h10
-rw-r--r--src/imports/jsondb/jsondbnotification.h6
-rw-r--r--src/imports/jsondb/jsondbpartition.h4
-rw-r--r--src/imports/jsondb/jsondbqueryobject.h6
-rw-r--r--src/imports/jsondb/jsondbsortinglistmodel.h6
7 files changed, 19 insertions, 19 deletions
diff --git a/src/client/qjsondbglobal.h b/src/client/qjsondbglobal.h
index fe992fac..87efad64 100644
--- a/src/client/qjsondbglobal.h
+++ b/src/client/qjsondbglobal.h
@@ -58,12 +58,12 @@
# define QT_BEGIN_NAMESPACE_JSONDB namespace QT_NAMESPACE { namespace QtJsonDb {
# define QT_END_NAMESPACE_JSONDB } }
# define QT_USE_NAMESPACE_JSONDB using namespace QT_NAMESPACE::QtJsonDb;
-# define QT_PREPEND_NAMESPACE_JSONDB(name) ::QT_NAMESPACE::QtJsonDb::name
+# define QT_PREPEND_NAMESPACE_JSONDB(name) QT_NAMESPACE::QtJsonDb::name
#else
# define QT_BEGIN_NAMESPACE_JSONDB namespace QtJsonDb {
# define QT_END_NAMESPACE_JSONDB }
# define QT_USE_NAMESPACE_JSONDB using namespace QtJsonDb;
-# define QT_PREPEND_NAMESPACE_JSONDB(name) ::QtJsonDb::name
+# define QT_PREPEND_NAMESPACE_JSONDB(name) QtJsonDb::name
#endif
// a workaround for moc - if there is a header file that doesn't use jsondb
diff --git a/src/imports/jsondb/jsondatabase.h b/src/imports/jsondb/jsondatabase.h
index d6b3a8ef..ed799cbf 100644
--- a/src/imports/jsondb/jsondatabase.h
+++ b/src/imports/jsondb/jsondatabase.h
@@ -60,7 +60,7 @@ public:
JsonDatabase(QObject *parent = 0);
~JsonDatabase();
- Q_INVOKABLE JsonDbPartition* partition(const QString &partitionName);
+ Q_INVOKABLE QT_PREPEND_NAMESPACE_JSONDB(JsonDbPartition)* partition(const QString &partitionName);
Q_INVOKABLE void listPartitions(const QJSValue &callback);
Q_INVOKABLE QString uuidFromString(const QString &identifier);
diff --git a/src/imports/jsondb/jsondblistmodel.h b/src/imports/jsondb/jsondblistmodel.h
index 4114d4fb..9fc52474 100644
--- a/src/imports/jsondb/jsondblistmodel.h
+++ b/src/imports/jsondb/jsondblistmodel.h
@@ -62,12 +62,12 @@ public:
JsonDbListModel(QObject *parent = 0);
virtual ~JsonDbListModel();
- Q_PROPERTY(QQmlListProperty<JsonDbPartition> partitions READ partitions)
+ Q_PROPERTY(QQmlListProperty<QT_PREPEND_NAMESPACE_JSONDB(JsonDbPartition)> partitions READ partitions)
Q_PROPERTY(int count READ count NOTIFY countChanged)
Q_PROPERTY(int limit READ limit WRITE setLimit)
Q_PROPERTY(int chunkSize READ chunkSize WRITE setChunkSize)
Q_PROPERTY(int lowWaterMark READ lowWaterMark WRITE setLowWaterMark)
- Q_PROPERTY(JsonDbPartition* partition READ partition WRITE setPartition)
+ Q_PROPERTY(QT_PREPEND_NAMESPACE_JSONDB(JsonDbPartition)* partition READ partition WRITE setPartition)
virtual void classBegin();
virtual void componentComplete();
@@ -75,7 +75,7 @@ public:
QQmlListProperty<JsonDbPartition> partitions();
Q_INVOKABLE void get(int index, const QJSValue &callback);
- Q_INVOKABLE JsonDbPartition* getPartition(int index);
+ Q_INVOKABLE QT_PREPEND_NAMESPACE_JSONDB(JsonDbPartition)* getPartition(int index);
Q_INVOKABLE int indexOf(const QString &uuid) const;
static void partitions_append(QQmlListProperty<JsonDbPartition> *p, JsonDbPartition *v);
static int partitions_count(QQmlListProperty<JsonDbPartition> *p);
@@ -84,9 +84,9 @@ public:
// Offered for backwards compatibility with JsonDbListModel only
// Deprecated
- JsonDbPartition* partition();
+ QtJsonDb::JsonDbPartition* partition();
int count() const;
- void setPartition(JsonDbPartition *newPartition);
+ void setPartition(QtJsonDb::JsonDbPartition *newPartition);
int limit() const;
void setLimit(int newCacheSize);
int chunkSize() const;
diff --git a/src/imports/jsondb/jsondbnotification.h b/src/imports/jsondb/jsondbnotification.h
index a28d6fd5..78a23c33 100644
--- a/src/imports/jsondb/jsondbnotification.h
+++ b/src/imports/jsondb/jsondbnotification.h
@@ -69,7 +69,7 @@ public:
Q_PROPERTY(QString query READ query WRITE setQuery)
Q_PROPERTY(QVariant actions READ actions WRITE setActions)
- Q_PROPERTY(JsonDbPartition* partition READ partition WRITE setPartition)
+ Q_PROPERTY(QT_PREPEND_NAMESPACE_JSONDB(JsonDbPartition)* partition READ partition WRITE setPartition)
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
Q_PROPERTY(QVariantMap error READ error NOTIFY errorChanged)
@@ -83,8 +83,8 @@ public:
QVariant actions();
void setActions(const QVariant &newActions);
- JsonDbPartition* partition();
- void setPartition(JsonDbPartition* newPartition);
+ QtJsonDb::JsonDbPartition* partition();
+ void setPartition(QtJsonDb::JsonDbPartition* newPartition);
bool enabled() const;
void setEnabled(bool enabled);
diff --git a/src/imports/jsondb/jsondbpartition.h b/src/imports/jsondb/jsondbpartition.h
index 46ddc84e..cad15182 100644
--- a/src/imports/jsondb/jsondbpartition.h
+++ b/src/imports/jsondb/jsondbpartition.h
@@ -92,9 +92,9 @@ public:
const QJSValue &options = QJSValue(QJSValue::UndefinedValue),
const QJSValue &callback = QJSValue(QJSValue::UndefinedValue));
- Q_INVOKABLE JsonDbNotify* createNotification(const QString &query);
+ Q_INVOKABLE QT_PREPEND_NAMESPACE_JSONDB(JsonDbNotify)* createNotification(const QString &query);
- Q_INVOKABLE JsonDbQueryObject* createQuery(const QString &query, int limit, QVariantMap bindings);
+ Q_INVOKABLE QT_PREPEND_NAMESPACE_JSONDB(JsonDbQueryObject)* createQuery(const QString &query, int limit, QVariantMap bindings);
QString name() const;
void setName(const QString &partitionName);
diff --git a/src/imports/jsondb/jsondbqueryobject.h b/src/imports/jsondb/jsondbqueryobject.h
index 14ae4f5a..0139b912 100644
--- a/src/imports/jsondb/jsondbqueryobject.h
+++ b/src/imports/jsondb/jsondbqueryobject.h
@@ -65,7 +65,7 @@ public:
enum Status { Null, Loading, Ready, Error };
Q_PROPERTY(QString query READ query WRITE setQuery)
- Q_PROPERTY(JsonDbPartition* partition READ partition WRITE setPartition)
+ Q_PROPERTY(QT_PREPEND_NAMESPACE_JSONDB(JsonDbPartition)* partition READ partition WRITE setPartition)
Q_PROPERTY(quint32 stateNumber READ stateNumber)
Q_PROPERTY(int limit READ limit WRITE setLimit)
@@ -79,8 +79,8 @@ public:
QString query();
void setQuery(const QString &newQuery);
- JsonDbPartition* partition();
- void setPartition(JsonDbPartition* newPartition);
+ QtJsonDb::JsonDbPartition* partition();
+ void setPartition(QT_PREPEND_NAMESPACE_JSONDB(JsonDbPartition)* newPartition);
quint32 stateNumber() const;
diff --git a/src/imports/jsondb/jsondbsortinglistmodel.h b/src/imports/jsondb/jsondbsortinglistmodel.h
index d6fc80f8..6294cddc 100644
--- a/src/imports/jsondb/jsondbsortinglistmodel.h
+++ b/src/imports/jsondb/jsondbsortinglistmodel.h
@@ -79,7 +79,7 @@ public:
Q_PROPERTY(QVariant roleNames READ scriptableRoleNames WRITE setScriptableRoleNames)
Q_PROPERTY(int queryLimit READ queryLimit WRITE setQueryLimit)
Q_PROPERTY(bool overflow READ overflow)
- Q_PROPERTY(QQmlListProperty<JsonDbPartition> partitions READ partitions)
+ Q_PROPERTY(QQmlListProperty<QT_PREPEND_NAMESPACE_JSONDB(JsonDbPartition)> partitions READ partitions)
Q_PROPERTY(QVariantMap error READ error NOTIFY errorChanged)
Q_PROPERTY(QJSValue propertyInjector READ propertyInjector WRITE setPropertyInjector)
@@ -99,7 +99,7 @@ public:
QVariantMap bindings() const;
void setBindings(const QVariantMap &newBindings);
- QQmlListProperty<JsonDbPartition> partitions();
+ QQmlListProperty<QtJsonDb::JsonDbPartition> partitions();
int queryLimit() const;
void setQueryLimit(int newQueryLimit);
@@ -119,7 +119,7 @@ public:
Q_INVOKABLE int indexOf(const QString &uuid) const;
Q_INVOKABLE QJSValue get(int index) const;
Q_INVOKABLE QVariant get(int index, const QString &property) const;
- Q_INVOKABLE JsonDbPartition* getPartition(int index) const;
+ Q_INVOKABLE QT_PREPEND_NAMESPACE_JSONDB(JsonDbPartition)* getPartition(int index) const;
QVariantMap error() const;
signals: