┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/search/searchcriterionvalue.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-11-12 20:07:14 +0000
committerPeter Penz <[email protected]>2009-11-12 20:07:14 +0000
commitebba84fbdd1effc828f88e08966dad5982371ecc (patch)
treef60155d31af6e274c721d83e9fbd284d3a74683d /src/search/searchcriterionvalue.cpp
parent1c62d0accf3cdfbeaaf93abb06971531cce156f1 (diff)
* adjust order of search options
* load real tags instead of offering the dummy "feffi" svn path=/trunk/KDE/kdebase/apps/; revision=1048145
Diffstat (limited to 'src/search/searchcriterionvalue.cpp')
-rw-r--r--src/search/searchcriterionvalue.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/search/searchcriterionvalue.cpp b/src/search/searchcriterionvalue.cpp
index 5a903cbae..531db3e01 100644
--- a/src/search/searchcriterionvalue.cpp
+++ b/src/search/searchcriterionvalue.cpp
@@ -23,10 +23,13 @@
#include <klineedit.h>
#include <klocale.h>
+#include <nepomuk/tag.h>
+
#include <QComboBox>
#include <QDateEdit>
#include <QLabel>
#include <QHBoxLayout>
+#include <QShowEvent>
SearchCriterionValue::SearchCriterionValue(QWidget* parent) :
QWidget(parent)
@@ -66,7 +69,7 @@ TagValue::TagValue(QWidget* parent) :
m_tags(0)
{
m_tags = new QComboBox(this);
- m_tags->addItem("feffi");
+ m_tags->setInsertPolicy(QComboBox::InsertAlphabetically);
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(0);
@@ -82,6 +85,21 @@ QString TagValue::value() const
return QString();
}
+void TagValue::showEvent(QShowEvent* event)
+{
+ if (!event->spontaneous() && (m_tags->count() == 0)) {
+ const QList<Nepomuk::Tag> tags = Nepomuk::Tag::allTags();
+ foreach (const Nepomuk::Tag& tag, tags) {
+ m_tags->addItem(tag.label());
+ }
+
+ if (tags.count() == 0) {
+ m_tags->addItem(i18nc("@label", "No Tags Available"));
+ }
+ }
+ SearchCriterionValue::showEvent(event);
+}
+
// -------------------------------------------------------------------------
SizeValue::SizeValue(QWidget* parent) :