Fixed #7240 (GUI: Result tree Context Menu should show default editor application only.)

This commit is contained in:
Akhilesh Nema 2016-01-16 15:19:06 +01:00 committed by Daniel Marjamäki
parent d39097f52a
commit 06ded4a3d4
1 changed files with 16 additions and 16 deletions

View File

@ -541,10 +541,11 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
QSignalMapper *signalMapper = new QSignalMapper(this);
if (mContextItem && mApplications->GetApplicationCount() > 0 && mContextItem->parent()) {
//Go through all applications and add them to the context menu
for (int i = 0; i < mApplications->GetApplicationCount(); i++) {
//Create an action for the application
const Application& app = mApplications->GetApplication(i);
int defaultApplicationIndex = mApplications->GetDefaultApplication();
if (defaultApplicationIndex < 0)
defaultApplicationIndex = 0;
const Application& app = mApplications->GetApplication(defaultApplicationIndex);
QAction *start = new QAction(app.getName(), &menu);
if (multipleSelection)
start->setDisabled(true);
@ -559,8 +560,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
connect(start, SIGNAL(triggered()), signalMapper, SLOT(map()));
//Add a new mapping
signalMapper->setMapping(start, i);
}
signalMapper->setMapping(start, defaultApplicationIndex);
connect(signalMapper, SIGNAL(mapped(int)),
this, SLOT(Context(int)));