← Back to team overview

ayatana-commits team mailing list archive

[Branch ~agateau/libindicate-qt/trunk] Rev 97: Use defines from libindicate for property names in convenience methods.

 

------------------------------------------------------------
revno: 97
committer: Aurelien Gateau <aurelien.gateau@xxxxxxxxxxxxx>
branch nick: libindicate-qt
timestamp: Fri 2009-09-25 12:29:09 +0200
message:
  Use defines from libindicate for property names in convenience methods.
modified:
  src/qindicateindicator.cpp
  tests/indicatortest.cpp


--
lp:libindicate-qt
https://code.launchpad.net/~agateau/libindicate-qt/trunk

Your team ayatana-commits is subscribed to branch lp:libindicate-qt.
To unsubscribe from this branch go to https://code.launchpad.net/~agateau/libindicate-qt/trunk/+edit-subscription.
=== modified file 'src/qindicateindicator.cpp'
--- src/qindicateindicator.cpp	2009-09-17 14:57:52 +0000
+++ src/qindicateindicator.cpp	2009-09-25 10:29:09 +0000
@@ -22,6 +22,7 @@
 
 // libindicate
 #include <libindicate/indicator.h>
+#include <libindicate/indicator-messages.h>
 
 // Local
 #include "qindicatedecode.h"
@@ -152,52 +153,52 @@
 
 QImage Indicator::iconProperty() const
 {
-    return Decode::imageFromValue(indicatorProperty("icon"));
+    return Decode::imageFromValue(indicatorProperty(INDICATE_INDICATOR_MESSAGES_PROP_ICON));
 }
 
 void Indicator::setIconProperty(const QImage& value)
 {
-    setIndicatorProperty("icon", value);
+    setIndicatorProperty(INDICATE_INDICATOR_MESSAGES_PROP_ICON, value);
 }
 
 QDateTime Indicator::timeProperty() const
 {
-    return Decode::dateTimeFromValue(indicatorProperty("time"));
+    return Decode::dateTimeFromValue(indicatorProperty(INDICATE_INDICATOR_MESSAGES_PROP_TIME));
 }
 
 void Indicator::setTimeProperty(const QDateTime& value)
 {
-    setIndicatorProperty("time", value);
+    setIndicatorProperty(INDICATE_INDICATOR_MESSAGES_PROP_TIME, value);
 }
 
 QString Indicator::nameProperty() const
 {
-    return Decode::stringFromValue(indicatorProperty("name"));
+    return Decode::stringFromValue(indicatorProperty(INDICATE_INDICATOR_MESSAGES_PROP_NAME));
 }
 
 void Indicator::setNameProperty(const QString& value)
 {
-    setIndicatorProperty("name", value);
+    setIndicatorProperty(INDICATE_INDICATOR_MESSAGES_PROP_NAME, value);
 }
 
 int Indicator::countProperty() const
 {
-    return Decode::intFromValue(indicatorProperty("count"));
+    return Decode::intFromValue(indicatorProperty(INDICATE_INDICATOR_MESSAGES_PROP_COUNT));
 }
 
 void Indicator::setCountProperty(int value)
 {
-    setIndicatorProperty("count", value);
+    setIndicatorProperty(INDICATE_INDICATOR_MESSAGES_PROP_COUNT, value);
 }
 
 void Indicator::setDrawAttentionProperty(bool value)
 {
-    setIndicatorProperty("draw_attention", value);
+    setIndicatorProperty(INDICATE_INDICATOR_MESSAGES_PROP_ATTENTION, value);
 }
 
 bool Indicator::drawAttentionProperty() const
 {
-    return Decode::boolFromValue(indicatorProperty("draw_attention"));
+    return Decode::boolFromValue(indicatorProperty(INDICATE_INDICATOR_MESSAGES_PROP_ATTENTION));
 }
 
 void Indicator::emitDisplay()

=== modified file 'tests/indicatortest.cpp'
--- tests/indicatortest.cpp	2009-09-14 15:10:58 +0000
+++ tests/indicatortest.cpp	2009-09-25 10:29:09 +0000
@@ -49,7 +49,7 @@
     QSignalSpy removedSpy(mServer, SIGNAL(indicatorRemoved(uint)));
 
     QIndicate::Indicator indicator;
-    indicator.setIndicatorProperty("name", "Unittest");
+    indicator.setNameProperty("Unittest");
 
     indicator.show();
 
@@ -85,9 +85,6 @@
     QIndicate::Indicator indicator;
     QCOMPARE(indicator.countProperty(), 0);
 
-    indicator.setIndicatorProperty("count", "1");
-    QCOMPARE(indicator.countProperty(), 1);
-
     indicator.setCountProperty(2);
     QCOMPARE(indicator.countProperty(), 2);
 }
@@ -97,7 +94,7 @@
     QIndicate::Indicator indicator;
     QVERIFY(!indicator.drawAttentionProperty());
 
-    indicator.setIndicatorProperty("draw_attention", "true");
+    indicator.setDrawAttentionProperty(true);
     QVERIFY(indicator.drawAttentionProperty());
 
     indicator.setDrawAttentionProperty(false);