Commit 9165d7fa authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Store filename path

parent 345d55e1
......@@ -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()
......
......@@ -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
......
......@@ -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;
}
......@@ -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);
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment