From 54a1499586d5395f0f4589ce6deb6431d02eb866 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 13 Mar 2010 13:38:40 +0000 Subject: 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 --- src/panels/information/kloadmetadatathread_p.h | 42 +++++++++++--------------- 1 file changed, 17 insertions(+), 25 deletions(-) (limited to 'src/panels/information/kloadmetadatathread_p.h') 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 * + * Copyright (C) 2009-2010 by Peter Penz * * * * 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 #include +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 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 tags() const; - QList items() const; - QMap 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 m_tags; - QList m_items; - QMap m_files; - + KMetaDataModel* m_model; + QMap m_data; KUrl::List m_urls; bool m_canceled; }; -- cgit v1.3.1