summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph/command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/buildgraph/command.cpp')
-rw-r--r--src/lib/buildgraph/command.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/lib/buildgraph/command.cpp b/src/lib/buildgraph/command.cpp
index 372d4b469..64b4c57e3 100644
--- a/src/lib/buildgraph/command.cpp
+++ b/src/lib/buildgraph/command.cpp
@@ -60,6 +60,12 @@ AbstractCommand *AbstractCommand::createByType(AbstractCommand::CommandType comm
return 0;
}
+bool AbstractCommand::equals(const AbstractCommand *other) const
+{
+ return m_description == other->m_description && m_highlight == other->m_highlight
+ && m_silent == other->m_silent && type() == other->type();
+}
+
void AbstractCommand::fillFromScriptValue(const QScriptValue *scriptValue, const CodeLocation &codeLocation)
{
Q_UNUSED(codeLocation);
@@ -143,6 +149,22 @@ void ProcessCommand::getEnvironmentFromList(const QStringList &envList)
}
}
+bool ProcessCommand::equals(const AbstractCommand *otherAbstractCommand) const
+{
+ if (!AbstractCommand::equals(otherAbstractCommand))
+ return false;
+ const ProcessCommand * const other = static_cast<const ProcessCommand *>(otherAbstractCommand);
+ return m_program == other->m_program
+ && m_arguments == other->m_arguments
+ && m_workingDir == other->m_workingDir
+ && m_maxExitCode == other->m_maxExitCode
+ && m_stdoutFilterFunction == other->m_stdoutFilterFunction
+ && m_stderrFilterFunction == other->m_stderrFilterFunction
+ && m_responseFileThreshold == other->m_responseFileThreshold
+ && m_responseFileUsagePrefix == other->m_responseFileUsagePrefix
+ && m_environment == other->m_environment;
+}
+
void ProcessCommand::fillFromScriptValue(const QScriptValue *scriptValue, const CodeLocation &codeLocation)
{
AbstractCommand::fillFromScriptValue(scriptValue, codeLocation);
@@ -214,6 +236,17 @@ JavaScriptCommand::JavaScriptCommand()
{
}
+bool JavaScriptCommand::equals(const AbstractCommand *otherAbstractCommand) const
+{
+ if (!AbstractCommand::equals(otherAbstractCommand))
+ return false;
+ const JavaScriptCommand * const other
+ = static_cast<const JavaScriptCommand *>(otherAbstractCommand);
+ return m_sourceCode == other->m_sourceCode
+ && m_properties == other->m_properties
+ && m_codeLocation == other->m_codeLocation;
+}
+
void JavaScriptCommand::fillFromScriptValue(const QScriptValue *scriptValue, const CodeLocation &codeLocation)
{
m_codeLocation = codeLocation;