[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdenetwork/kget
From: Matthias Fuchs <mat69 () gmx ! net>
Date: 2011-04-23 18:44:00
Message-ID: 20110423184400.DE052AC85D () svn ! kde ! org
[Download RAW message or body]
SVN commit 1228944 by mfuchs:
Cleans up the NepomukHandler and also does not use originURL since that would be \
redundant (with copiedFrom):
M +0 -3 CMakeLists.txt
M +2 -1 core/nepomukcontroller.h
M +14 -12 core/nepomukhandler.cpp
--- trunk/KDE/kdenetwork/kget/CMakeLists.txt #1228943:1228944
@@ -130,9 +130,6 @@
ONTOLOGIES
${CMAKE_CURRENT_SOURCE_DIR}/kget_history.trig
)
- soprano_add_ontology(kgetcore_SRCS \
${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nfo.trig "NFO" \
"Nepomuk::Vocabulary" "trig")
- soprano_add_ontology(kgetcore_SRCS \
${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nepomuk/ndo.trig "NDO" "Nepomuk::Vocabulary" \
"trig")
- soprano_add_ontology(kgetcore_SRCS \
${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nie.trig "NIE" "Nepomuk::Vocabulary" "trig") \
endif (HAVE_NEPOMUK)
kde4_add_kcfg_files(kgetcore_SRCS conf/settings.kcfgc)
--- trunk/KDE/kdenetwork/kget/core/nepomukcontroller.h #1228943:1228944
@@ -21,8 +21,9 @@
#define NEPOMUKCONTROLLER
#include "../kget_export.h"
-#include "nfo.h"
+#include <Nepomuk/Vocabulary/NFO>
+
#include <QtCore/QMutex>
#include <QtCore/QThread>
--- trunk/KDE/kdenetwork/kget/core/nepomukhandler.cpp #1228943:1228944
@@ -16,13 +16,14 @@
#include "nepomukcontroller.h"
#include "verifier.h"
-#include "nfo.h"
-#include "ndo.h"
-#include "nie.h"
-#include <Soprano/Vocabulary/Xesam>
#include <Nepomuk/Variant>
#include <Nepomuk/Tag>
+#include <Nepomuk/Vocabulary/NDO>
+#include <Nepomuk/Vocabulary/NFO>
+#include <Nepomuk/Vocabulary/NIE>
+using namespace Nepomuk::Vocabulary;
+
NepomukHandler::NepomukHandler(Transfer *transfer)
: QObject(transfer),
m_transfer(transfer)
@@ -52,16 +53,17 @@
{
const QList<KUrl> destinations = m_transfer->files();
- QPair<QUrl, Nepomuk::Variant> property = \
qMakePair(Nepomuk::Vocabulary::NIE::url(), \
Nepomuk::Variant(m_transfer->source()));
- KGet::nepomukController()->setProperty(QList<KUrl>() << m_transfer->source(), \
property, Nepomuk::Vocabulary::NFO::RemoteDataObject());
- Nepomuk::Resource srcFileRes(m_transfer->source(), \
Nepomuk::Vocabulary::NFO::RemoteDataObject()); + const KUrl src = \
m_transfer->source(); + const QUrl srcType = (src.isLocalFile() ? \
NFO::FileDataObject() : NFO::RemoteDataObject()); + QPair<QUrl, Nepomuk::Variant> \
property = qMakePair(NIE::url(), Nepomuk::Variant(src)); + \
KGet::nepomukController()->setProperty(QList<KUrl>() << src, property, srcType); + \
Nepomuk::Resource srcFileRes(src, srcType);
foreach (const KUrl &destination, destinations) {
//set all the properties
QList<QPair<QUrl, Nepomuk::Variant> > properties;
- properties.append(qMakePair(Nepomuk::Vocabulary::NIE::url(), \
Nepomuk::Variant(destination)));
- properties.append(qMakePair(Nepomuk::Vocabulary::NDO::copiedFrom(), \
Nepomuk::Variant(srcFileRes)));
- properties.append(qMakePair(Soprano::Vocabulary::Xesam::originURL(), \
Nepomuk::Variant(m_transfer->source().url()))); + \
properties.append(qMakePair(NIE::url(), Nepomuk::Variant(destination))); + \
properties.append(qMakePair(NDO::copiedFrom(), Nepomuk::Variant(srcFileRes)));
//just adds one Hash as otherwise it would not be clear in \
KFileMetaDataWidget which hash belongs //to which algorithm
@@ -76,8 +78,8 @@
if (hashType.contains(QRegExp("^SHA\\d+"))) {
hashType.insert(3, '-');
}
- properties.append(qMakePair(Nepomuk::Vocabulary::NFO::hashAlgorithm(), \
Nepomuk::Variant(hashType)));
- properties.append(qMakePair(Nepomuk::Vocabulary::NFO::hashValue(), \
Nepomuk::Variant(hash))); + \
properties.append(qMakePair(NFO::hashAlgorithm(), Nepomuk::Variant(hashType))); + \
properties.append(qMakePair(NFO::hashValue(), Nepomuk::Variant(hash))); }
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic