Commit fea04885 authored by Laurent Montel's avatar Laurent Montel 😁

Prepare to read external script info

parent e2e96a8d
......@@ -36,6 +36,7 @@ void ViewerPluginExternalScriptInfoTest::shouldHaveDefaultValue()
ViewerPluginExternalScriptInfo info;
QVERIFY(info.name().isEmpty());
QVERIFY(info.commandLine().isEmpty());
QVERIFY(info.executable().isEmpty());
}
QTEST_MAIN(ViewerPluginExternalScriptInfoTest)
......@@ -41,3 +41,13 @@ void ViewerPluginExternalScriptInfo::setCommandLine(const QString &commandLine)
{
mCommandLine = commandLine;
}
QString ViewerPluginExternalScriptInfo::executable() const
{
return mExecutable;
}
void ViewerPluginExternalScriptInfo::setExecutable(const QString &executable)
{
mExecutable = executable;
}
......@@ -30,9 +30,14 @@ public:
QString commandLine() const;
void setCommandLine(const QString &commandLine);
QString executable() const;
void setExecutable(const QString &executable);
private:
QString mCommandLine;
QString mName;
QString mExecutable;
};
Q_DECLARE_TYPEINFO(ViewerPluginExternalScriptInfo, Q_MOVABLE_TYPE);
#endif // VIEWERPLUGINEXTERNALSCRIPTINFO_H
......@@ -38,7 +38,7 @@ Q_GLOBAL_STATIC(ViewerPluginExternalScriptManagerInstancePrivate, sInstance)
ViewerPluginExternalScriptManager::ViewerPluginExternalScriptManager(QObject *parent)
: QObject(parent)
{
readExternalScriptInfo();
}
ViewerPluginExternalScriptManager::~ViewerPluginExternalScriptManager()
......@@ -51,6 +51,16 @@ ViewerPluginExternalScriptManager *ViewerPluginExternalScriptManager::self()
return sInstance->externalScriptPluginManager;
}
void ViewerPluginExternalScriptManager::readExternalScriptInfo()
{
}
QVector<ViewerPluginExternalScriptInfo> ViewerPluginExternalScriptManager::scriptInfos() const
{
return mScriptInfos;
}
//TODO read list of external script.
//TODO read desktop file.
//TODO read specific directory.
......@@ -18,7 +18,10 @@
#ifndef VIEWERPLUGINEXTERNALSCRIPTMANAGER_H
#define VIEWERPLUGINEXTERNALSCRIPTMANAGER_H
#include "viewerpluginexternalscriptinfo.h"
#include <QObject>
#include <QVector>
class ViewerPluginExternalScriptManager : public QObject
{
......@@ -27,6 +30,12 @@ public:
explicit ViewerPluginExternalScriptManager(QObject *parent = Q_NULLPTR);
~ViewerPluginExternalScriptManager();
static ViewerPluginExternalScriptManager *self();
QVector<ViewerPluginExternalScriptInfo> scriptInfos() const;
private:
void readExternalScriptInfo();
QVector<ViewerPluginExternalScriptInfo> mScriptInfos;
};
#endif // VIEWERPLUGINEXTERNALSCRIPTMANAGER_H
Markdown is supported
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