summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-03-12 22:04:53 +0100
committerLaurent Montel <[email protected]>2018-03-12 22:04:53 +0100
commit09908926bc773e8eecc804f8e8a4eabacaf8d9cb (patch)
tree8f90c911afa2a96e5fe8b021b8d1a276eca6c86d
parentb28e9e5adb80fafb1f9a4863958200cfe47ef542 (diff)
Improve api
-rw-r--r--templateparser/src/templatescommandmenu.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/templateparser/src/templatescommandmenu.cpp b/templateparser/src/templatescommandmenu.cpp
index 82c54c9..0f16b79 100644
--- a/templateparser/src/templatescommandmenu.cpp
+++ b/templateparser/src/templatescommandmenu.cpp
@@ -439,17 +439,20 @@ void TemplatesCommandMenu::fillSubMenus()
}
mWasInitialized = true;
QMap< QString, Command > commandMap;
+ KActionMenu *menu = nullptr;
// ******************************************************
- KActionMenu *menu = new KActionMenu(i18n("Original Message"), mMenu);
- mMenu->addAction(menu);
+ if ((mType == All) | (mType == ReplyForwardMessage)) {
+ menu = new KActionMenu(i18n("Original Message"), mMenu);
+ mMenu->addAction(menu);
- // Map sorts commands
- for (int i = 0; i < originalCommandsCount; ++i) {
- commandMap.insert(originalCommands[i].getLocalizedDisplayName(), originalCommands[i].command);
- }
+ // Map sorts commands
+ for (int i = 0; i < originalCommandsCount; ++i) {
+ commandMap.insert(originalCommands[i].getLocalizedDisplayName(), originalCommands[i].command);
+ }
- fillMenuFromActionMap(commandMap, menu);
- commandMap.clear();
+ fillMenuFromActionMap(commandMap, menu);
+ commandMap.clear();
+ }
// ******************************************************
menu = new KActionMenu(i18n("Current Message"), mMenu);