summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-27 11:46:38 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-27 12:01:27 (GMT)
commit9165d7fa382b0f1b888f79e413f843beece50289 (patch)
tree27c7016134188358648fcc0624e74b5a66927c94
parent345d55e169a77e71de58541a40636ec1926f2fe3 (diff)
Store filename path
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptsloadjobtest.cpp2
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp12
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.cpp10
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.h4
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptsloadjob.cpp1
5 files changed, 28 insertions, 1 deletions
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptsloadjobtest.cpp b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptsloadjobtest.cpp
index bebfa69..87e8377 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptsloadjobtest.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptsloadjobtest.cpp
@@ -63,6 +63,8 @@ void ViewerPluginExternalScriptsLoadJobTest::shouldLoadDataInfo()
QCOMPARE(info.executable(), QStringLiteral("bla"));
QCOMPARE(info.icon(), QStringLiteral("blo"));
QVERIFY(!info.isReadOnly());
+ const QString filenamepath = QLatin1String(TEST_DATA_DIR) + QStringLiteral("/correctdesktop/first.desktop");
+ QCOMPARE(info.fileName(), filenamepath);
}
void ViewerPluginExternalScriptsLoadJobTest::shouldNotLoadEmptyDesktop()
diff --git a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
index a24145f..a098624 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternalconfigurewidget.cpp
@@ -96,7 +96,17 @@ void ViewerPluginExternalConfigureWidget::load()
void ViewerPluginExternalConfigureWidget::fillScriptInfo(const QVector<ViewerPluginExternalScriptInfo> &scriptInfos)
{
Q_FOREACH (const ViewerPluginExternalScriptInfo &script, scriptInfos) {
-
+ QListWidgetItem *item = new QListWidgetItem(mListExternal);
+/*
+ FileName = Qt::UserRole + 1,
+ ReadOnly = Qt::UserRole + 2,
+ CommandName = Qt::UserRole + 3,
+ Executable = Qt::UserRole + 4,
+ IconName = Qt::UserRole + 5,
+ */
+ item->setData(ReadOnly, script.isReadOnly());
+
+ //item->setData(FileName, script.);
}
//TODO
diff --git a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.cpp b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.cpp
index ee17a6e..9c793c4 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.cpp
@@ -90,3 +90,13 @@ void ViewerPluginExternalScriptInfo::setIsReadOnly(bool isReadOnly)
{
mIsReadOnly = isReadOnly;
}
+
+QString ViewerPluginExternalScriptInfo::fileName() const
+{
+ return mFileName;
+}
+
+void ViewerPluginExternalScriptInfo::setFileName(const QString &fileName)
+{
+ mFileName = fileName;
+}
diff --git a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.h b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.h
index 29bf07b..ba61c5d 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.h
@@ -46,12 +46,16 @@ public:
bool isReadOnly() const;
void setIsReadOnly(bool isReadOnly);
+ QString fileName() const;
+ void setFileName(const QString &fileName);
+
private:
QString mCommandLine;
QString mName;
QString mExecutable;
QString mDescription;
QString mIcon;
+ QString mFileName;
bool mIsReadOnly;
};
Q_DECLARE_TYPEINFO(ViewerPluginExternalScriptInfo, Q_MOVABLE_TYPE);
diff --git a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptsloadjob.cpp b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptsloadjob.cpp
index 4dee4b6..c2a07c5 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptsloadjob.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptsloadjob.cpp
@@ -63,6 +63,7 @@ void ViewerPluginExternalScriptsLoadJob::start()
info.setDescription(group.readEntry("Description", QString()));
info.setIcon(group.readEntry("Icon", QString()));
info.setIsReadOnly(!list.at(i).isWritable());
+ info.setFileName(filePath);
if (info.isValid() && !scriptNames.contains(name)) {
mScriptInfos.append(info);
scriptNames.append(name);