From e6e616e5420db972d0d4cc0e327b6a672bb8eb5f Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Fri, 25 Feb 2011 12:16:20 +0200 Subject: [PATCH] GUI: Fix opening error item with default app. --- gui/resultstree.cpp | 5 ++++- gui/resultstree.h | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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