Hello community, here is the log from the commit of package libnepomukwidgets for openSUSE:Factory checked in at 2013-07-22 17:19:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libnepomukwidgets (Old) and /work/SRC/openSUSE:Factory/.libnepomukwidgets.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libnepomukwidgets" Changes: -------- --- /work/SRC/openSUSE:Factory/libnepomukwidgets/libnepomukwidgets.changes 2013-07-08 07:31:53.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libnepomukwidgets.new/libnepomukwidgets.changes 2013-07-22 17:19:54.000000000 +0200 @@ -1,0 +2,7 @@ +Mon Jul 15 08:14:12 UTC 2013 - [email protected] + +- Update to 4.10.95 + * KDE 4.11 RC 1 release + * See http://www.kde.org/announcements/announce-4.11-rc1.php + +------------------------------------------------------------------- Old: ---- nepomuk-widgets-4.10.90.tar.xz New: ---- nepomuk-widgets-4.10.95.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libnepomukwidgets.spec ++++++ --- /var/tmp/diff_new_pack.OFoabh/_old 2013-07-22 17:19:55.000000000 +0200 +++ /var/tmp/diff_new_pack.OFoabh/_new 2013-07-22 17:19:55.000000000 +0200 @@ -32,7 +32,7 @@ License: GPL-2.0+ and LGPL-2.1+ Group: System/GUI/KDE Url: http://nepomuk.kde.org/ -Version: 4.10.90 +Version: 4.10.95 Release: 0 Source0: nepomuk-widgets-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ nepomuk-widgets-4.10.90.tar.xz -> nepomuk-widgets-4.10.95.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nepomuk-widgets-4.10.90/CMakeLists.txt new/nepomuk-widgets-4.10.95/CMakeLists.txt --- old/nepomuk-widgets-4.10.90/CMakeLists.txt 2013-06-10 20:50:26.000000000 +0200 +++ new/nepomuk-widgets-4.10.95/CMakeLists.txt 2013-07-10 00:38:27.000000000 +0200 @@ -19,7 +19,7 @@ find_package(NepomukCore) set_package_properties(NepomukCore PROPERTIES DESCRIPTION "The core Nepomuk libraries" URL "http://nepomuk.kde.org" TYPE REQUIRED PURPOSE "Required for running Nepomuk") -feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) # Some definitions # ================ @@ -58,6 +58,7 @@ ui/kedittagsdialog.cpp ui/tagcheckbox.cpp ui/filemetadatawidget.cpp + ui/filemetadataconfigwidget.cpp ui/filemetadataprovider.cpp ui/resourceloader.cpp ui/indexeddataretriever.cpp @@ -104,6 +105,7 @@ nepomukwidgets_export.h ui/tagwidget.h ui/filemetadatawidget.h + ui/filemetadataconfigwidget.h utils/resourcemodel.h DESTINATION ${INCLUDE_INSTALL_DIR}/nepomuk2 COMPONENT Devel diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nepomuk-widgets-4.10.90/test/CMakeLists.txt new/nepomuk-widgets-4.10.95/test/CMakeLists.txt --- old/nepomuk-widgets-4.10.90/test/CMakeLists.txt 2013-06-10 20:50:26.000000000 +0200 +++ new/nepomuk-widgets-4.10.95/test/CMakeLists.txt 2013-07-10 00:38:27.000000000 +0200 @@ -24,3 +24,10 @@ nepomukwidgets ) +kde4_add_executable(metadataconfigwidgetapp TEST metadataconfigwidgetapp.cpp ) +target_link_libraries(metadataconfigwidgetapp + ${KDE4_KIO_LIBS} + ${NEPOMUK_CORE_LIBRARY} + nepomukwidgets + ) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nepomuk-widgets-4.10.90/test/metadataconfigwidgetapp.cpp new/nepomuk-widgets-4.10.95/test/metadataconfigwidgetapp.cpp --- old/nepomuk-widgets-4.10.90/test/metadataconfigwidgetapp.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/nepomuk-widgets-4.10.95/test/metadataconfigwidgetapp.cpp 2013-07-10 00:38:27.000000000 +0200 @@ -0,0 +1,76 @@ +/* + <one line to give the library's name and an idea of what it does.> + Copyright (C) 2012 Vishesh Handa <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "filemetadataconfigwidget.h" + +#include <QApplication> +#include <kcomponentdata.h> +#include <kfiledialog.h> +#include <KPushButton> + +#include <QVBoxLayout> +#include <QCheckBox> + +class FileMetadataWidgetTest : public QWidget +{ + Q_OBJECT +public: + explicit FileMetadataWidgetTest(QWidget* parent = 0, Qt::WindowFlags f = 0); + +private slots: + void slotChooseFiles(); + +private: + Nepomuk2::FileMetaDataConfigWidget* m_metadataWidget; + KPushButton* m_button; +}; + +FileMetadataWidgetTest::FileMetadataWidgetTest(QWidget* parent, Qt::WindowFlags f) + : QWidget(parent, f) +{ + m_metadataWidget = new Nepomuk2::FileMetaDataConfigWidget( this ); + + m_button = new KPushButton( QLatin1String("Select files"), this ); + connect( m_button, SIGNAL(clicked(bool)), this, SLOT(slotChooseFiles()) ); + + QVBoxLayout* layout = new QVBoxLayout( this ); + layout->addWidget( m_button ); + layout->addWidget( m_metadataWidget ); +} + +void FileMetadataWidgetTest::slotChooseFiles() +{ + KUrl::List urlList = KFileDialog::getOpenUrls(); + KFileItemList list; + foreach(const KUrl& url, urlList) + list << KFileItem( url, QString(), mode_t() ); + + m_metadataWidget->setItems( list ); +} + +int main( int argc, char** argv ) +{ + QApplication app( argc, argv ); + KComponentData data( "FileMetaDataConfigWidgetApp" ); + FileMetadataWidgetTest test; + test.show(); + return app.exec(); +} + +#include "metadataconfigwidgetapp.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nepomuk-widgets-4.10.90/ui/filemetadataconfigwidget.cpp new/nepomuk-widgets-4.10.95/ui/filemetadataconfigwidget.cpp --- old/nepomuk-widgets-4.10.90/ui/filemetadataconfigwidget.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/nepomuk-widgets-4.10.95/ui/filemetadataconfigwidget.cpp 2013-07-10 00:38:27.000000000 +0200 @@ -0,0 +1,234 @@ +/***************************************************************************** + * Copyright (C) 2013 by Vishesh Handa <[email protected]> * + * Copyright (C) 2009 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 * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public License * + * along with this library; see the file COPYING.LIB. If not, write to * + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301, USA. * + *****************************************************************************/ + +#include "filemetadataconfigwidget.h" + +#include <kconfig.h> +#include <kconfiggroup.h> +#include <kfilemetainfo.h> +#include <kfilemetainfoitem.h> +#include "knfotranslator_p.h" +#include <klocale.h> + +#include <Nepomuk2/Variant> +#include <Nepomuk2/Resource> +#include <Nepomuk2/ResourceManager> +#include <Nepomuk2/Types/Property> +#include <Soprano/Vocabulary/NAO> +#include <KDebug> + +#include "filemetadataprovider_p.h" +#include "knfotranslator_p.h" + +#include <QEvent> +#include <QListWidget> +#include <QVBoxLayout> + +using namespace Soprano::Vocabulary; + +namespace Nepomuk2 { + +class Nepomuk2::FileMetaDataConfigWidget ::Private +{ +public: + Private(FileMetaDataConfigWidget* parent); + ~Private(); + + void init(); + void loadMetaData(); + void addItem(const KUrl& uri); + + /** + * Is invoked after the meta data model has finished the loading of + * meta data. The meta data labels will be added to the configuration + * list. + */ + void slotLoadingFinished(); + + int m_visibleDataTypes; + KFileItemList m_fileItems; + FileMetaDataProvider* m_provider; + QListWidget* m_metaDataList; + +private: + FileMetaDataConfigWidget* const q; +}; + + +FileMetaDataConfigWidget::Private::Private(FileMetaDataConfigWidget* parent) : + m_visibleDataTypes(0), + m_fileItems(), + m_provider(0), + m_metaDataList(0), + q(parent) +{ + m_metaDataList = new QListWidget(q); + m_metaDataList->setSelectionMode(QAbstractItemView::NoSelection); + m_metaDataList->setSortingEnabled(true); + + QVBoxLayout* layout = new QVBoxLayout(q); + layout->addWidget(m_metaDataList); + + m_provider = new FileMetaDataProvider(q); + m_provider->setReadOnly(true); + connect(m_provider, SIGNAL(loadingFinished()), + q, SLOT(slotLoadingFinished())); +} + +FileMetaDataConfigWidget::Private::~Private() +{ +} + +void FileMetaDataConfigWidget::Private::loadMetaData() +{ + m_metaDataList->clear(); + m_provider->setItems(m_fileItems); +} + +void FileMetaDataConfigWidget::Private::addItem(const KUrl& uri) +{ + // Meta information provided by Nepomuk that is already + // available from KFileItem as "fixed item" (see above) + // should not be shown as second entry. + static const char* const hiddenProperties[] = { + "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#comment", // = fixed item kfileitem#comment + "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize", // = fixed item kfileitem#size + "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified", // = fixed item kfileitem#modified + "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#plainTextContent" // hide this property always + "http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType", // = fixed item kfileitem#type + "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName", // hide this property always + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", // = fixed item kfileitem#type + + // Nepomuk internal properties + "http://www.semanticdesktop.org/ontologies/2007/08/15/nao#lastModified", + "http://www.semanticdesktop.org/ontologies/2007/08/15/nao#created", + + 0 // mandatory last entry + }; + + int i = 0; + const QString key = uri.url(); + while (hiddenProperties[i] != 0) { + if (key == QLatin1String(hiddenProperties[i])) { + // the item is hidden + return; + } + ++i; + } + + // Only user visible properties should be shown + if (!Types::Property(uri).userVisible()) { + return; + } + + // the item is not hidden, add it to the list + KConfig config("kmetainformationrc", KConfig::NoGlobals); + KConfigGroup settings = config.group("Show"); + + const QString label = (m_provider == 0) + ? KNfoTranslator::instance().translation(uri) + : m_provider->label(uri); + + QListWidgetItem* item = new QListWidgetItem(label, m_metaDataList); + item->setData(Qt::UserRole, key); + const bool show = settings.readEntry(key, true); + item->setCheckState(show ? Qt::Checked : Qt::Unchecked); +} + +void FileMetaDataConfigWidget::Private::slotLoadingFinished() +{ + // Get all meta information labels that are available for + // the currently shown file item and add them to the list. + Q_ASSERT(m_provider != 0); + + QHash<QUrl, Nepomuk2::Variant> data = m_provider->data(); + // Always show these 3 + data.remove( NAO::numericRating() ); + data.remove( NAO::hasTag() ); + data.remove( NAO::description() ); + + QHash<QUrl, Nepomuk2::Variant>::const_iterator it = data.constBegin(); + while (it != data.constEnd()) { + addItem(it.key()); + ++it; + } + + addItem( NAO::numericRating() ); + addItem( NAO::hasTag() ); + addItem( NAO::description() ); +} + +FileMetaDataConfigWidget::FileMetaDataConfigWidget(QWidget* parent) : + QWidget(parent), + d(new Private(this)) +{ +} + +FileMetaDataConfigWidget::~FileMetaDataConfigWidget() +{ + delete d; +} + +void FileMetaDataConfigWidget::setItems(const KFileItemList& items) +{ + d->m_fileItems = items; + //d->loadMetaData(); +} + +KFileItemList FileMetaDataConfigWidget::items() const +{ + return d->m_fileItems; +} + +void FileMetaDataConfigWidget::save() +{ + KConfig config("kmetainformationrc", KConfig::NoGlobals); + KConfigGroup showGroup = config.group("Show"); + + const int count = d->m_metaDataList->count(); + for (int i = 0; i < count; ++i) { + QListWidgetItem* item = d->m_metaDataList->item(i); + const bool show = (item->checkState() == Qt::Checked); + const QString key = item->data(Qt::UserRole).toString(); + showGroup.writeEntry(key, show); + } + + showGroup.sync(); +} + +bool FileMetaDataConfigWidget::event(QEvent* event) +{ + if (event->type() == QEvent::Polish) { + kDebug() << "GOT POLISH EVENT!!!"; + // loadMetaData() must be invoked asynchronously, as the list + // must finish it's initialization first + QMetaObject::invokeMethod(this, "loadMetaData", Qt::QueuedConnection); + } + return QWidget::event(event);; +} + +QSize FileMetaDataConfigWidget::sizeHint() const +{ + return d->m_metaDataList->sizeHint(); +} + +} + +#include "filemetadataconfigwidget.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nepomuk-widgets-4.10.90/ui/filemetadataconfigwidget.h new/nepomuk-widgets-4.10.95/ui/filemetadataconfigwidget.h --- old/nepomuk-widgets-4.10.90/ui/filemetadataconfigwidget.h 1970-01-01 01:00:00.000000000 +0100 +++ new/nepomuk-widgets-4.10.95/ui/filemetadataconfigwidget.h 2013-07-10 00:38:27.000000000 +0200 @@ -0,0 +1,76 @@ +/***************************************************************************** + * Copyright (C) 2013 by Vishesh Handa <[email protected]> * + * Copyright (C) 2009 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 * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public License * + * along with this library; see the file COPYING.LIB. If not, write to * + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301, USA. * + *****************************************************************************/ + +#ifndef NEPOMUK2_FILEMETADATACONFIGWIDGET_H +#define NEPOMUK2_FILEMETADATACONFIGWIDGET_H + +#include "nepomukwidgets_export.h" +#include <KFileItem> + +#include <QWidget> + + +namespace Nepomuk2 { + +/** + * @brief Widget which allows to configure which meta data should be shown + * in the FileMetadataWidget + */ +class NEPOMUKWIDGETS_EXPORT FileMetaDataConfigWidget : public QWidget +{ + Q_OBJECT + +public: + explicit FileMetaDataConfigWidget(QWidget* parent = 0); + virtual ~FileMetaDataConfigWidget(); + + /** + * Sets the items, for which the visibility of the meta data should + * be configured. Note that the visibility of the meta data is not + * bound to the items itself, the items are only used to determine + * which meta data should be configurable. For example when a JPEG image + * is set as item, it will be configurable which EXIF data should be + * shown. If an audio file is set as item, it will be configurable + * whether the artist, album name, ... should be shown. + */ + void setItems(const KFileItemList& items); + KFileItemList items() const; + + /** + * Saves the modified configuration. + */ + void save(); + + /** @see QWidget::sizeHint() */ + virtual QSize sizeHint() const; + +protected: + virtual bool event(QEvent* event); + +private: + class Private; + Private* const d; + + Q_PRIVATE_SLOT(d, void loadMetaData()) + Q_PRIVATE_SLOT(d, void slotLoadingFinished()) +}; + +} +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nepomuk-widgets-4.10.90/ui/resourceloader.cpp new/nepomuk-widgets-4.10.95/ui/resourceloader.cpp --- old/nepomuk-widgets-4.10.90/ui/resourceloader.cpp 2013-06-25 20:18:41.000000000 +0200 +++ new/nepomuk-widgets-4.10.95/ui/resourceloader.cpp 2013-07-10 00:38:27.000000000 +0200 @@ -24,6 +24,7 @@ #include <QtCore/QThread> #include <Nepomuk2/Variant> #include <Nepomuk2/ResourceManager> +#include <Nepomuk2/Types/Property> using namespace Nepomuk2; @@ -46,7 +47,13 @@ return; Resource res( uri ); - res.properties(); + const QHash<QUrl, Variant> data = res.properties(); + + // Load all the associated properties as well so that we do not block in the main thread + QHash< QUrl, Variant >::const_iterator it = data.constBegin(); + for(; it != data.constEnd(); it++) { + Types::Property( it.key() ).userVisible(); + } m_resourceList.append( res ); } -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
