@@ -33,8 +33,11 @@ ResultsTree::ResultsTree(QSettings &settings, ApplicationList &list) :
3333 QStringList labels;
3434 labels << tr (" File" ) << tr (" Severity" ) << tr (" Line" ) << tr (" Message" );
3535 mModel .setHorizontalHeaderLabels (labels);
36-
36+ setExpandsOnDoubleClick ( false );
3737 LoadSettings ();
38+ connect (this , SIGNAL (doubleClicked (const QModelIndex &)),
39+ this , SLOT (QuickStartApplication (const QModelIndex &)));
40+
3841}
3942
4043ResultsTree::~ResultsTree ()
@@ -365,12 +368,11 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
365368 }
366369}
367370
368-
369- void ResultsTree::Context (int application)
371+ void ResultsTree::StartApplication (QStandardItem *target, int application)
370372{
371- if (mContextItem )
373+ if (target && application >= 0 && application < mApplications . GetApplicationCount () )
372374 {
373- QVariantMap data = mContextItem ->data ().toMap ();
375+ QVariantMap data = target ->data ().toMap ();
374376
375377 QString program = mApplications .GetApplicationPath (application);
376378
@@ -402,6 +404,17 @@ void ResultsTree::Context(int application)
402404 program.replace (" (message)" , data[" message" ].toString (), Qt::CaseInsensitive);
403405 program.replace (" (severity)" , data[" severity" ].toString (), Qt::CaseInsensitive);
404406
405- QProcess::execute (program);
407+ QProcess::startDetached (program);
406408 }
407409}
410+
411+
412+ void ResultsTree::Context (int application)
413+ {
414+ StartApplication (mContextItem , application);
415+ }
416+
417+ void ResultsTree::QuickStartApplication (const QModelIndex &index)
418+ {
419+ StartApplication (mModel .itemFromIndex (index), 0 );
420+ }
0 commit comments