Skip to content

Commit

Permalink
Remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Jul 25, 2024
1 parent 834c926 commit 5751cdf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
32 changes: 0 additions & 32 deletions src/scriptable/scriptableproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1232,38 +1232,6 @@ void ScriptableProxy::runInternalAction(const QVariantMap &data, const QString &
m_wnd->runInternalAction(action);
}

QByteArray ScriptableProxy::tryGetCommandOutput(const QString &command)
{
INVOKE(tryGetCommandOutput, (command));

for (int i = 0; i < 3; ++i) {
Action action;
action.setCommand(command);
action.setReadOutput(true);

QByteArray output;
connect( &action, &Action::actionOutput,
this, [&output](const QByteArray &actionOutput) {
output.append(actionOutput);
} );

action.start();
if ( !action.waitForFinished(5000) ) {
if ( output.isEmpty() || !action.waitForFinished(30000) ) {
action.terminate();
continue;
}
}

if ( action.actionFailed() || action.exitCode() != 0 )
continue;

return output;
}

return QByteArray();
}

void ScriptableProxy::showMessage(const QString &title,
const QString &msg,
const QString &icon,
Expand Down
1 change: 0 additions & 1 deletion src/scriptable/scriptableproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public slots:
void action(const QVariantMap &arg1, const Command &arg2);

void runInternalAction(const QVariantMap &data, const QString &command);
QByteArray tryGetCommandOutput(const QString &command);

void showMessage(const QString &title,
const QString &msg,
Expand Down

0 comments on commit 5751cdf

Please sign in to comment.