summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-10-12 13:58:18 +0200
committerMontel Laurent <[email protected]>2015-10-12 13:58:46 +0200
commit9d1fa4ffbce2f006bd1079ecbd4d3b16e5dbb082 (patch)
treee53a02ee69c386509defb3bae250c53da5d0eb5f
parent341cf1c6df4807449173adba330e54b707d8593d (diff)
Use KEditListWidget
-rw-r--r--grantleeeditor/grantleethemeeditor/desktopfilepage.cpp15
-rw-r--r--grantleeeditor/grantleethemeeditor/desktopfilepage.h5
2 files changed, 9 insertions, 11 deletions
diff --git a/grantleeeditor/grantleethemeeditor/desktopfilepage.cpp b/grantleeeditor/grantleethemeeditor/desktopfilepage.cpp
index 4f55fa9..118677b 100644
--- a/grantleeeditor/grantleethemeeditor/desktopfilepage.cpp
+++ b/grantleeeditor/grantleethemeeditor/desktopfilepage.cpp
@@ -18,8 +18,7 @@
#include "desktopfilepage.h"
#include "globalsettings_base.h"
-#include "PimCommon/SimpleStringlistEditor"
-
+#include <KEditListWidget>
#include <QLineEdit>
#include <KLocalizedString>
#include <KDesktopFile>
@@ -99,9 +98,9 @@ DesktopFilePage::DesktopFilePage(const QString &defaultFileName, DesktopFilePage
lay->addWidget(lab, row , 0, 1, 2);
++row;
- mExtraDisplayHeaders = new PimCommon::SimpleStringListEditor;
+ mExtraDisplayHeaders = new KEditListWidget;
lay->addWidget(mExtraDisplayHeaders, row, 0, 1, 2);
- connect(mExtraDisplayHeaders, &PimCommon::SimpleStringListEditor::changed, this, &DesktopFilePage::slotExtraDisplayHeadersChanged);
+ connect(mExtraDisplayHeaders, &KEditListWidget::changed, this, &DesktopFilePage::slotExtraDisplayHeadersChanged);
} else {
lay->setRowStretch(row, 1);
}
@@ -122,7 +121,7 @@ DesktopFilePage::~DesktopFilePage()
void DesktopFilePage::slotExtraDisplayHeadersChanged()
{
- Q_EMIT extraDisplayHeaderChanged(mExtraDisplayHeaders->stringList());
+ Q_EMIT extraDisplayHeaderChanged(mExtraDisplayHeaders->items());
Q_EMIT changed();
}
@@ -176,7 +175,7 @@ void DesktopFilePage::loadTheme(const QString &path)
mVersion->setText(desktopFile.desktopGroup().readEntry(QStringLiteral("ThemeVersion")));
if (mExtraDisplayHeaders) {
const QStringList displayExtraHeaders = desktopFile.desktopGroup().readEntry(QStringLiteral("DisplayExtraVariables"), QStringList());
- mExtraDisplayHeaders->setStringList(displayExtraHeaders);
+ mExtraDisplayHeaders->setItems(displayExtraHeaders);
}
}
@@ -195,9 +194,9 @@ void DesktopFilePage::saveAsFilename(const QString &filename)
desktopFile.desktopGroup().writeEntry(QStringLiteral("FileName"), mFilename->text());
}
if (mExtraDisplayHeaders) {
- const QStringList displayExtraHeaders = mExtraDisplayHeaders->stringList();
+ const QStringList displayExtraHeaders = mExtraDisplayHeaders->items();
if (!displayExtraHeaders.isEmpty()) {
- desktopFile.desktopGroup().writeEntry(QStringLiteral("DisplayExtraVariables"), mExtraDisplayHeaders->stringList());
+ desktopFile.desktopGroup().writeEntry(QStringLiteral("DisplayExtraVariables"), displayExtraHeaders);
}
}
diff --git a/grantleeeditor/grantleethemeeditor/desktopfilepage.h b/grantleeeditor/grantleethemeeditor/desktopfilepage.h
index 437a9dd..557ec06 100644
--- a/grantleeeditor/grantleethemeeditor/desktopfilepage.h
+++ b/grantleeeditor/grantleethemeeditor/desktopfilepage.h
@@ -22,10 +22,9 @@
#include "grantleethemeeditor_export.h"
class QLineEdit;
class KZip;
-
+class KEditListWidget;
namespace PimCommon
{
-class SimpleStringListEditor;
class PlainTextEditorWidget;
}
namespace GrantleeThemeEditor
@@ -75,7 +74,7 @@ private:
QLineEdit *mAuthor;
QLineEdit *mEmail;
QLineEdit *mVersion;
- PimCommon::SimpleStringListEditor *mExtraDisplayHeaders;
+ KEditListWidget *mExtraDisplayHeaders;
};
}