[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/generic/runners/nepomuksearch
From: Sebastian Trueg <sebastian () trueg ! de>
Date: 2010-11-29 9:33:53
Message-ID: 20101129093353.3CAFBAC8A8 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1201972 by trueg:
Use the new File class to make the code more readable.
M +2 -3 nepomuksearchrunner.cpp
M +3 -6 queryclientwrapper.cpp
--- trunk/KDE/kdebase/workspace/plasma/generic/runners/nepomuksearch/nepomuksearchrunner.cpp \
#1201971:1201972 @@ -128,9 +128,8 @@
Nepomuk::Resource res = match.data().value<Nepomuk::Resource>();
KUrl url = res.resourceUri();
- if (res.hasType(Nepomuk::Vocabulary::NFO::FileDataObject()) &&
- KUrl(res.property(Nepomuk::Vocabulary::NIE::url()).toUrl()).isLocalFile()) {
- url = res.property(Nepomuk::Vocabulary::NIE::url()).toUrl();
+ if (res.isFile() && res.toFile().url().isLocalFile()) {
+ url = res.toFile().url();
}
(void)new KRun(url, 0);
--- trunk/KDE/kdebase/workspace/plasma/generic/runners/nepomuksearch/queryclientwrapper.cpp \
#1201971:1201972 @@ -21,7 +21,7 @@
#include <nepomuk/nie.h>
#include <nepomuk/nfo.h>
-#include <Nepomuk/Resource>
+#include <Nepomuk/File>
#include <Nepomuk/Variant>
#include <Nepomuk/Types/Class>
#include <Nepomuk/Query/QueryServiceClient>
@@ -29,8 +29,6 @@
#include <Nepomuk/Query/Query>
#include <Nepomuk/Query/QueryParser>
-#include <Soprano/Vocabulary/Xesam>
-
#include <KIcon>
#include <KDebug>
#include <KMimeType>
@@ -102,9 +100,8 @@
QString type;
QString iconName;
- if (res.hasType(Nepomuk::Vocabulary::NFO::FileDataObject()) &&
- KUrl(res.property(Nepomuk::Vocabulary::NIE::url()).toUrl()).isLocalFile()) \
{
- const KUrl url = res.property(Nepomuk::Vocabulary::NIE::url()).toUrl();
+ if (res.isFile() && res.toFile().url().isLocalFile()) {
+ const KUrl url(res.toFile().url());
KMimeType::Ptr mimetype = KMimeType::findByUrl(url);
if (mimetype) {
type = mimetype->comment();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic