[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Tue Sep 28 13:13:50 CEST 2004
CVS commit by staikos:
Add the ability to pass through metadata from data sources
M +25 -0 kstdatasource.cpp 1.34
M +10 -0 kstdatasource.h 1.18
--- kdeextragear-2/kst/kst/kstdatasource.cpp #1.33:1.34
@@ -445,3 +445,28 @@ bool KstDataSource::reset() {
}
+
+const QMap<QString, QString>& KstDataSource::metaData() const {
+ return _metaData;
+}
+
+
+const QString& KstDataSource::metaData(const QString& key) const {
+ if (_metaData.contains(key)) {
+ return _metaData[key];
+ } else {
+ return QString::null;
+ }
+}
+
+
+bool KstDataSource::hasMetaData() const {
+ return !_metaData.isEmpty();
+}
+
+
+bool KstDataSource::hasMetaData(const QString& key) const {
+ return _metaData.contains(key);
+}
+
+
// vim: ts=2 sw=2 et
--- kdeextragear-2/kst/kst/kstdatasource.h #1.17:1.18
@@ -111,4 +111,12 @@ class KstDataSource : public KstObject {
virtual bool reset();
+ virtual const QMap<QString, QString>& metaData() const;
+
+ virtual const QString& metaData(const QString& key) const;
+
+ virtual bool hasMetaData() const;
+
+ virtual bool hasMetaData(const QString& key) const;
+
protected:
virtual void virtual_hook(int id, void *data);
@@ -130,4 +138,6 @@ class KstDataSource : public KstObject {
QString _source;
+ QMap<QString, QString> _metaData;
+
private:
KstDataSourcePrivate *d;
More information about the Kst
mailing list