-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathToolData.cpp
63 lines (52 loc) · 1.58 KB
/
ToolData.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "ToolData.h"
#include "PluginHub.h"
#include "PluginImageSettings.h"
#include "PluginPipeSettings.h"
#include "PluginTile.h"
#include "PluginImage.h"
#include <QDebug>
#include <QString>
#include <QPair>
ToolData::ToolData()
: version(2), ownerId(-1), groupId(-1), owner(""), group(""), enabledIds()
{
}
ToolData::ToolData(const ToolData &toolData) {
this->version = 2;
this->owner = toolData.owner;
this->ownerId = toolData.ownerId;
this->group = toolData.group;
this->groupId = toolData.groupId;
this->v1_enabledIds = toolData.v1_enabledIds;
if (toolData.version < 2) {
QListIterator<int> i(toolData.v1_enabledIds);
while (i.hasNext()) {
this->addEnabledId(i.next());
}
}
if (toolData.version > 1) {
this->enabledIds = toolData.enabledIds;
}
}
QList<PluginDependency*> ToolData::prerequisites(const PluginImageSettings &options, const PluginPipeSettings &settings) const {
Q_UNUSED(options);
Q_UNUSED(settings);
QList<PluginDependency*> list;
return list;
}
PluginData::Status ToolData::run(const PluginImageSettings &options, const PluginPipeSettings &settings)
{
Q_UNUSED(options);
Q_UNUSED(settings);
qDebug() << "ToolData: run" << owner << "with id =" << ownerId << "data =" << this;
return Complete;
}
bool ToolData::requiresDisk() const
{
return false;
}
void ToolData::addEnabledId(int id, QString shortName, QString longName, QString hint) {
Option *option = new Option(id, shortName, longName, hint);
enabledIds.append(*option);
v1_enabledIds.append(id);
}