Fixed #7240 (GUI: Result tree Context Menu should show default editor application only.)
This commit is contained in:
parent
d39097f52a
commit
06ded4a3d4
|
@ -541,10 +541,11 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
|
||||||
QSignalMapper *signalMapper = new QSignalMapper(this);
|
QSignalMapper *signalMapper = new QSignalMapper(this);
|
||||||
|
|
||||||
if (mContextItem && mApplications->GetApplicationCount() > 0 && mContextItem->parent()) {
|
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
|
//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);
|
QAction *start = new QAction(app.getName(), &menu);
|
||||||
if (multipleSelection)
|
if (multipleSelection)
|
||||||
start->setDisabled(true);
|
start->setDisabled(true);
|
||||||
|
@ -559,8 +560,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
|
||||||
connect(start, SIGNAL(triggered()), signalMapper, SLOT(map()));
|
connect(start, SIGNAL(triggered()), signalMapper, SLOT(map()));
|
||||||
|
|
||||||
//Add a new mapping
|
//Add a new mapping
|
||||||
signalMapper->setMapping(start, i);
|
signalMapper->setMapping(start, defaultApplicationIndex);
|
||||||
}
|
|
||||||
|
|
||||||
connect(signalMapper, SIGNAL(mapped(int)),
|
connect(signalMapper, SIGNAL(mapped(int)),
|
||||||
this, SLOT(Context(int)));
|
this, SLOT(Context(int)));
|
||||||
|
|
Loading…
Reference in New Issue