]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Minor adjustments for searching: at least searching for tags works now again :-)
authorPeter Penz <peter.penz19@gmail.com>
Fri, 4 Dec 2009 00:18:24 +0000 (00:18 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Fri, 4 Dec 2009 00:18:24 +0000 (00:18 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=1058137

src/search/dolphinsearchbox.cpp
src/search/searchcriterionselector.cpp
src/search/searchcriterionvalue.cpp

index 507becabd9a6651142243b7bdb5184bb1559b5f2..1dcb381ddeea91f23f6f343842f891c902228c67 100644 (file)
@@ -61,8 +61,8 @@ DolphinSearchCompleter::DolphinSearchCompleter(KLineEdit* linedit) :
         foreach (const Nepomuk::Tag& tag, tags) {
             const QString tagText = tag.label();
             addCompletionItem(tagText,
-                              "tag:\"" + tagText + '\"',
-                              i18nc("Tag as in Nepomuk::Tag", "Tag"),
+                              "hasTag:\"" + tagText + '\"',
+                              i18nc("Tag as in Nepomuk::Tag", "Tag"), // TODO: change to "hasTag" after msg freeze
                               QString(),
                               KIcon("mail-tagged"));
         }
index ab447bb83d5f3d8cdb5cd4049bf0b575dbf1af25..f9c122d46ccbb2bad6d2f6d2946cce8729ebe6d0 100644 (file)
@@ -210,12 +210,16 @@ void SearchCriterionSelector::createDescriptions()
     QList<SearchCriterionDescription::Comparator> tagComps;
     tagComps.append(SearchCriterionDescription::Comparator(i18nc("@label All (tags)", "All")));
     tagComps.append(SearchCriterionDescription::Comparator(i18nc("@label", "Equal to"), Nepomuk::Query::ComparisonTerm::Equal));
-    tagComps.append(SearchCriterionDescription::Comparator(i18nc("@label", "Not Equal to"), Nepomuk::Query::ComparisonTerm::Equal)); // TODO
+    // It is unclear yet how to express != for tags with the new Nepomuk query API. Disable it for KDE 4.4,
+    // but leave the translation string there to be able to enable this functionality for KDE 4.4.x:
+    const QString dummy = i18nc("@label", "Not Equal to");
+    Q_UNUSED(dummy);
+    //tagComps.append(SearchCriterionDescription::Comparator(i18nc("@label", "Not Equal to"), Nepomuk::Query::ComparisonTerm::Equal)); // TODO
 
     TagValue* tagValue = new TagValue(this);
     tagValue->hide();
     SearchCriterionDescription tag(i18nc("@label", "Tag:"),
-                                   Soprano::Vocabulary::NAO::Tag(),
+                                   Soprano::Vocabulary::NAO::hasTag(),
                                    tagComps,
                                    tagValue);
     Q_ASSERT(static_cast<int>(SearchCriterionSelector::Tag) == 2);
index eda297b8305b357df8ab2c652eb43accf931c7bc..065100e4ed626905ffb7708c55265094b3170576 100644 (file)
@@ -67,7 +67,8 @@ DateValue::~DateValue()
 
 Nepomuk::Query::LiteralTerm DateValue::value() const
 {
-    return Nepomuk::Query::LiteralTerm(m_dateWidget->date());
+    const QDateTime dateTime(m_dateWidget->date());
+    return Nepomuk::Query::LiteralTerm(dateTime);
 }
 
 void DateValue::initializeValue(const QString& valueType)