diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 82ebd62fd..5f2630c53 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -564,6 +564,9 @@ void ResultsTree::StartApplication(QStandardItem *target, int application) return; } + if (application == -1) + application = mApplications->GetDefaultApplication(); + if (target && application >= 0 && application < mApplications->GetApplicationCount() && target->parent()) { // Make sure we are working with the first column @@ -704,7 +707,7 @@ void ResultsTree::Context(int application) void ResultsTree::QuickStartApplication(const QModelIndex &index) { - StartApplication(mModel.itemFromIndex(index), 0); + StartApplication(mModel.itemFromIndex(index)); } void ResultsTree::CopyPath(QStandardItem *target, bool fullPath) diff --git a/gui/resultstree.h b/gui/resultstree.h index 8dbd7e0a7..99448261e 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -238,9 +238,10 @@ protected: * @brief Helper function to open an error within target with application* * * @param target Error tree item to open - * @param application Index of the application to open with + * @param application Index of the application to open with. Giving -1 + * (default value) will open the default application. */ - void StartApplication(QStandardItem *target, int application); + void StartApplication(QStandardItem *target, int application = -1); /** * @brief Helper function to copy filename/full path to the clipboard