GUI: Fix opening error item with default app.

This commit is contained in:
Kimmo Varis 2011-02-25 12:16:20 +02:00
parent 085034ddf7
commit e6e616e542
2 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -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