Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libinputactions/actions/Action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void Action::aboutToExecute()
void Action::execute(const ActionExecutionArguments &args)
{
qCDebug(INPUTACTIONS) << QString("Executing action \"%1\"").arg(m_id);
executeImpl(args);
doExecute(args);
}

bool Action::async() const
Expand Down
4 changes: 2 additions & 2 deletions src/libinputactions/actions/Action.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Action
void aboutToExecute();
/**
* Do not call directly, use ActionExecutor instead.
* @see executeImpl
* @see doExecute
*/
void execute(const ActionExecutionArguments &args);
/**
Expand Down Expand Up @@ -101,7 +101,7 @@ class Action
/**
* This method is not guaranteed to be called from the main thread.
*/
virtual void executeImpl(const ActionExecutionArguments &args) {}
virtual void doExecute(const ActionExecutionArguments &args) {}

private:
std::shared_ptr<Condition> m_condition;
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/ActionGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ActionGroup::ActionGroup(ActionGroupExecutionMode mode)
{
}

void ActionGroup::executeImpl(const ActionExecutionArguments &args)
void ActionGroup::doExecute(const ActionExecutionArguments &args)
{
// TODO Each action introduces latency
const auto checkCanExecute = [](const auto &action) {
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/ActionGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ActionGroup : public Action
void reset() override;

protected:
void executeImpl(const ActionExecutionArguments &args) override;
void doExecute(const ActionExecutionArguments &args) override;

private:
std::vector<std::unique_ptr<Action>> m_actions;
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/CommandAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool CommandAction::async() const
return m_wait || m_command.expensive();
}

void CommandAction::executeImpl(const ActionExecutionArguments &args)
void CommandAction::doExecute(const ActionExecutionArguments &args)
{
const auto command = m_command.get().value_or("");
if (command.isEmpty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/CommandAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CommandAction
void setWait(bool value) { m_wait = value; }

protected:
void executeImpl(const ActionExecutionArguments &args) override;
void doExecute(const ActionExecutionArguments &args) override;

private:
Value<QString> m_command;
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/CustomAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool CustomAction::mergeable() const
return m_mergeable;
}

void CustomAction::executeImpl(const ActionExecutionArguments &args)
void CustomAction::doExecute(const ActionExecutionArguments &args)
{
m_function(args);
}
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/CustomAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CustomAction : public Action
bool mergeable() const override;

protected:
void executeImpl(const ActionExecutionArguments &args) override;
void doExecute(const ActionExecutionArguments &args) override;

private:
std::function<void(const ActionExecutionArguments &args)> m_function;
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/InputAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ InputAction::InputAction(std::vector<InputActionItem> sequence)
}
}

void InputAction::executeImpl(const ActionExecutionArguments &args)
void InputAction::doExecute(const ActionExecutionArguments &args)
{
for (const auto &item : m_sequence) {
const auto keyboardText = item.keyboardText.get();
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/InputAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class InputAction : public Action
void setDelay(std::chrono::milliseconds value) { m_delay = std::move(value); }

protected:
void executeImpl(const ActionExecutionArguments &args) override;
void doExecute(const ActionExecutionArguments &args) override;

private:
std::vector<InputActionItem> m_sequence;
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/PlasmaGlobalShortcutAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ PlasmaGlobalShortcutAction::PlasmaGlobalShortcutAction(QString component, QStrin
{
}

void PlasmaGlobalShortcutAction::executeImpl(const ActionExecutionArguments &args)
void PlasmaGlobalShortcutAction::doExecute(const ActionExecutionArguments &args)
{
g_plasmaGlobalShortcutInvoker->invoke(m_component, m_shortcut);
}
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/PlasmaGlobalShortcutAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PlasmaGlobalShortcutAction : public Action
const QString &shortcut() const { return m_shortcut; }

protected:
void executeImpl(const ActionExecutionArguments &args) override;
void doExecute(const ActionExecutionArguments &args) override;

private:
QString m_component;
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/ReplaceTextAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ReplaceTextAction::ReplaceTextAction(std::vector<TextSubstitutionRule> rules)
{
}

void ReplaceTextAction::executeImpl(const ActionExecutionArguments &args)
void ReplaceTextAction::doExecute(const ActionExecutionArguments &args)
{
TextSubstitutionRule *rule{};
QThreadHelpers::runOnThread(
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/ReplaceTextAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ReplaceTextAction : public Action
bool async() const override;

protected:
void executeImpl(const ActionExecutionArguments &args) override;
void doExecute(const ActionExecutionArguments &args) override;

private:
std::vector<TextSubstitutionRule> m_rules;
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/SleepAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool SleepAction::async() const
return true;
}

void SleepAction::executeImpl(const ActionExecutionArguments &args)
void SleepAction::doExecute(const ActionExecutionArguments &args)
{
QThread::msleep(m_time.count());
}
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/actions/SleepAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class SleepAction : public Action
bool async() const override;

protected:
void executeImpl(const ActionExecutionArguments &args) override;
void doExecute(const ActionExecutionArguments &args) override;

private:
std::chrono::milliseconds m_time;
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/conditions/CanReplaceTextCondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CanReplaceTextCondition::CanReplaceTextCondition(std::vector<TextSubstitutionRul

CanReplaceTextCondition::~CanReplaceTextCondition() = default;

bool CanReplaceTextCondition::evaluateImpl(const ConditionEvaluationArguments &arguments)
bool CanReplaceTextCondition::doEvaluate(const ConditionEvaluationArguments &arguments)
{
return std::ranges::any_of(m_rules, [](const auto &rule) {
return g_textInput->canReplaceSurroundingText(rule.regex());
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/conditions/CanReplaceTextCondition.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CanReplaceTextCondition : public Condition
const std::vector<TextSubstitutionRule> &rules() const { return m_rules; }

protected:
bool evaluateImpl(const ConditionEvaluationArguments &arguments) override;
bool doEvaluate(const ConditionEvaluationArguments &arguments) override;

private:
std::vector<TextSubstitutionRule> m_rules;
Expand Down
4 changes: 2 additions & 2 deletions src/libinputactions/conditions/Condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bool Condition::satisfied(const ConditionEvaluationArguments &arguments)
bool Condition::evaluate(const ConditionEvaluationArguments &arguments)
{
try {
return evaluateImpl(arguments) == !m_negate;
return doEvaluate(arguments) == !m_negate;
} catch (const std::exception &e) {
qWarning(INPUTACTIONS).noquote() << "Failed to evaluate condition: " << e.what();
if (g_globalConfig->sendNotificationOnError() && !m_exceptionNotificationShown) {
Expand All @@ -53,7 +53,7 @@ bool Condition::evaluate(const ConditionEvaluationArguments &arguments)
}
}

bool Condition::evaluateImpl(const ConditionEvaluationArguments &arguments)
bool Condition::doEvaluate(const ConditionEvaluationArguments &arguments)
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/conditions/Condition.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Condition
/**
* @see evaluate
*/
virtual bool evaluateImpl(const ConditionEvaluationArguments &arguments);
virtual bool doEvaluate(const ConditionEvaluationArguments &arguments);

private:
bool m_exceptionNotificationShown{};
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/conditions/ConditionGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ConditionGroup::ConditionGroup(ConditionGroupMode mode)
{
}

bool ConditionGroup::evaluateImpl(const ConditionEvaluationArguments &arguments)
bool ConditionGroup::doEvaluate(const ConditionEvaluationArguments &arguments)
{
const auto pred = [&arguments](auto &condition) {
return condition->evaluate(arguments);
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/conditions/ConditionGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ConditionGroup : public Condition
void prepend(const std::shared_ptr<Condition> &condition);

protected:
bool evaluateImpl(const ConditionEvaluationArguments &arguments) override;
bool doEvaluate(const ConditionEvaluationArguments &arguments) override;

std::vector<std::shared_ptr<Condition>> m_conditions;
ConditionGroupMode m_mode;
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/conditions/CustomCondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CustomCondition::CustomCondition(std::function<bool(const ConditionEvaluationArg
{
}

bool CustomCondition::evaluateImpl(const ConditionEvaluationArguments &arguments)
bool CustomCondition::doEvaluate(const ConditionEvaluationArguments &arguments)
{
return m_function(arguments);
}
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/conditions/CustomCondition.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CustomCondition : public Condition
CustomCondition(std::function<bool(const ConditionEvaluationArguments &arguments)> function);

protected:
bool evaluateImpl(const ConditionEvaluationArguments &arguments) override;
bool doEvaluate(const ConditionEvaluationArguments &arguments) override;

private:
std::function<bool(const ConditionEvaluationArguments &arguments)> m_function;
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/conditions/VariableCondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ VariableCondition::VariableCondition(const QString &variableName, const Value<st
{
}

bool VariableCondition::evaluateImpl(const ConditionEvaluationArguments &arguments)
bool VariableCondition::doEvaluate(const ConditionEvaluationArguments &arguments)
{
const auto variable = arguments.variableManager->getVariable(m_variableName);
if (!variable) {
Expand Down
2 changes: 1 addition & 1 deletion src/libinputactions/conditions/VariableCondition.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class VariableCondition : public Condition
ComparisonOperator comparisonOperator() const { return m_comparisonOperator; }

protected:
bool evaluateImpl(const ConditionEvaluationArguments &arguments) override;
bool doEvaluate(const ConditionEvaluationArguments &arguments) override;

private:
QString m_variableName;
Expand Down