summaryrefslogtreecommitdiffstats
path: root/src/imports/organizer/qdeclarativeorganizercollection_p.h
diff options
context:
space:
mode:
authorXizhi Zhu <xizhi.zhu@nokia.com>2011-12-12 15:39:16 +0200
committerQt by Nokia <qt-info@nokia.com>2012-01-09 11:52:32 +0100
commitb65802ecdd9d65522995eb7287dfdcdf878a7450 (patch)
tree00b389f93deeea6b8219deb17605f74d8014f697 /src/imports/organizer/qdeclarativeorganizercollection_p.h
parent7e268a606c241be24a95fe57732b0eae50d1ac98 (diff)
Fix various coding style issues.
Change-Id: I2e09a57b26073accc0ff236161529637c2ea12f1 Reviewed-by: Xizhi Zhu <xizhi.zhu@nokia.com> Sanity-Review: Xizhi Zhu <xizhi.zhu@nokia.com>
Diffstat (limited to 'src/imports/organizer/qdeclarativeorganizercollection_p.h')
-rw-r--r--src/imports/organizer/qdeclarativeorganizercollection_p.h120
1 files changed, 33 insertions, 87 deletions
diff --git a/src/imports/organizer/qdeclarativeorganizercollection_p.h b/src/imports/organizer/qdeclarativeorganizercollection_p.h
index 22ae4130f..f02570af6 100644
--- a/src/imports/organizer/qdeclarativeorganizercollection_p.h
+++ b/src/imports/organizer/qdeclarativeorganizercollection_p.h
@@ -42,104 +42,51 @@
#ifndef QDECLARATIVEORGANIZERCOLLECTION_H
#define QDECLARATIVEORGANIZERCOLLECTION_H
-#include "qdeclarative.h"
-#include "qorganizercollection.h"
-
-#include <QColor>
-#include <QUrl>
+#include <qorganizercollection.h>
+#include <QtCore/qurl.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QtGui/qcolor.h>
QTORGANIZER_BEGIN_NAMESPACE
class QDeclarativeOrganizerCollection : public QObject
{
Q_OBJECT
+
Q_PROPERTY(QString collectionId READ id WRITE setId NOTIFY valueChanged)
Q_PROPERTY(QString name READ name WRITE setName NOTIFY valueChanged)
Q_PROPERTY(QString description READ description WRITE setDescription NOTIFY valueChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY valueChanged)
Q_PROPERTY(QUrl image READ image WRITE setImage NOTIFY valueChanged)
+
public:
- QDeclarativeOrganizerCollection(QObject* parent = 0)
- :QObject(parent)
- {
- }
-
-
- QString id() const
- {
- return d.id().toString();
- }
-
- void setId(const QString& newId)
- {
- d.setId(QOrganizerCollectionId::fromString(newId));
- }
-
- QString name() const
- {
- return metaData(QOrganizerCollection::KeyName).toString();
- }
-
- void setName(const QString& name)
- {
- setMetaData(QOrganizerCollection::KeyName, name);
- }
-
- QString description() const
- {
- return metaData(QOrganizerCollection::KeyDescription).toString();
- }
-
- void setDescription(const QString& desc)
- {
- setMetaData(QOrganizerCollection::KeyDescription, desc);
- }
-
- QColor color() const
- {
- return metaData(QOrganizerCollection::KeyColor).value<QColor>();
- }
-
- void setColor(const QColor& color)
- {
- setMetaData(QOrganizerCollection::KeyColor, color);
- }
-
- QUrl image() const
- {
- //image or image url?
- return QUrl(metaData(QOrganizerCollection::KeyImage).toString());
- }
-
- void setImage(const QUrl& url)
- {
- setMetaData(QOrganizerCollection::KeyImage, url);
- }
-
- Q_INVOKABLE void setMetaData(const QString& key, const QVariant& value)
- {
- if (metaData(key) != value) {
- d.setMetaData(key, value);
- emit valueChanged();
- }
- }
-
- Q_INVOKABLE QVariant metaData(const QString& key) const
- {
- return d.metaData(key);
- }
-
- QOrganizerCollection collection() const
- {
- return d;
- }
-
- void setCollection(const QOrganizerCollection& collection)
- {
- d = collection;
- }
-signals:
+ QDeclarativeOrganizerCollection(QObject *parent = 0);
+
+ QString id() const;
+ void setId(const QString &id);
+
+ QString name() const;
+ void setName(const QString &name);
+
+ QString description() const;
+ void setDescription(const QString &description);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ QUrl image() const;
+ void setImage(const QUrl &url);
+
+ Q_INVOKABLE void setMetaData(const QString &key, const QVariant &value);
+ Q_INVOKABLE QVariant metaData(const QString &key) const;
+
+ // used by model
+ QOrganizerCollection collection() const;
+ void setCollection(const QOrganizerCollection & collection);
+
+Q_SIGNALS:
void valueChanged();
+
private:
QOrganizerCollection d;
};
@@ -148,5 +95,4 @@ QTORGANIZER_END_NAMESPACE
QML_DECLARE_TYPE(QTORGANIZER_PREPEND_NAMESPACE(QDeclarativeOrganizerCollection))
-#endif
-
+#endif // QDECLARATIVEORGANIZERCOLLECTION_H