┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information/kloadmetadatathread_p.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-03-13 13:38:40 +0000
committerPeter Penz <[email protected]>2010-03-13 13:38:40 +0000
commit54a1499586d5395f0f4589ce6deb6431d02eb866 (patch)
treeccbab754f09c2d2a98c1519267d0776e7e60b8a0 /src/panels/information/kloadmetadatathread_p.h
parenta7f4541eb8c4d33e30ee733cc39b3d40b237e903 (diff)
Provide a KMetaDataModel for KMetaDataWidget.
This allows to extend the model with custom meta data (might e. g. be useful for Gwenview). svn path=/trunk/KDE/kdebase/apps/; revision=1102749
Diffstat (limited to 'src/panels/information/kloadmetadatathread_p.h')
-rw-r--r--src/panels/information/kloadmetadatathread_p.h42
1 files changed, 17 insertions, 25 deletions
diff --git a/src/panels/information/kloadmetadatathread_p.h b/src/panels/information/kloadmetadatathread_p.h
index 6aba52ad3..be03d262f 100644
--- a/src/panels/information/kloadmetadatathread_p.h
+++ b/src/panels/information/kloadmetadatathread_p.h
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (C) 2009 by Peter Penz <[email protected]> *
+ * Copyright (C) 2009-2010 by Peter Penz <[email protected]> *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
@@ -28,6 +28,8 @@
#include <QList>
#include <QThread>
+class KMetaDataModel;
+
/**
* Loads the meta data of files that are
* required by the widget KMetaDataWidget.
@@ -37,30 +39,30 @@ class KLoadMetaDataThread : public QThread
Q_OBJECT
public:
- struct Item
- {
- QString name;
- QString label;
- QString value;
- };
-
- KLoadMetaDataThread();
+ KLoadMetaDataThread(KMetaDataModel* model);
virtual ~KLoadMetaDataThread();
/**
* Starts the thread and loads the meta data for
* the files given by \p urls. After receiving
- * the signal finished(), the methods
- * rating(), comment(), tags(), metaInfoLabels(),
- * metaInfoValues() and files() return valid data.
+ * the signal finished(), the method KLoadMetaDataThread::data()
+ * provides the loaded meta data.
*/
void load(const KUrl::List& urls);
/**
+ * Returns the meta data for the URLs given
+ * by KLoadMetaDataThread::load(). The method only provides
+ * valid results after the signal finished() has been
+ * emitted.
+ */
+ QMap<KUrl, Nepomuk::Variant> data() const;
+
+ /**
* Tells the thread that it should cancel as soon
* as possible. It is undefined when the thread
* gets cancelled. The signal finished() will emitted
- * after the cancelling has been done.
+ * after the cancelling has been done.mergedIt
*/
void cancel();
@@ -75,12 +77,6 @@ public:
/** @see QThread::run() */
virtual void run();
- int rating() const;
- QString comment() const;
- QList<Nepomuk::Tag> tags() const;
- QList<Item> items() const;
- QMap<KUrl, Nepomuk::Resource> files() const;
-
private slots:
void slotFinished();
@@ -93,12 +89,8 @@ private:
QString formatValue(const Nepomuk::Variant& value);
private:
- unsigned int m_rating;
- QString m_comment;
- QList<Nepomuk::Tag> m_tags;
- QList<Item> m_items;
- QMap<KUrl, Nepomuk::Resource> m_files;
-
+ KMetaDataModel* m_model;
+ QMap<KUrl, Nepomuk::Variant> m_data;
KUrl::List m_urls;
bool m_canceled;
};