Showing the changes to interface/src/scripting/MenuScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -41,7 +41,8 @@ void MenuScriptingInterface::removeMenu(const QString& menu) { · 40 unmodified lines | |||
| 41 | 41 | ||
| 42 | bool MenuScriptingInterface::menuExists(const QString& menu) { | 42 | bool MenuScriptingInterface::menuExists(const QString& menu) { |
| 43 | if (QThread::currentThread() == qApp->thread()) { | 43 | if (QThread::currentThread() == qApp->thread()) { |
| 44 | return Menu::getInstance()->menuExists(menu); | 44 | Menu* menuInstance = Menu::getInstance(); |
| 45 | return menuInstance && menuInstance->menuExists(menu); | ||
| 45 | } | 46 | } |
| 46 | bool result { false }; | 47 | bool result { false }; |
| 47 | BLOCKING_INVOKE_METHOD(Menu::getInstance(), "menuExists", | 48 | BLOCKING_INVOKE_METHOD(Menu::getInstance(), "menuExists", |
| @@ -84,7 +85,8 @@ void MenuScriptingInterface::removeMenuItem(const QString& menu, const QString& · 36 unmodified lines | |||
| 84 | 85 | ||
| 85 | bool MenuScriptingInterface::menuItemExists(const QString& menu, const QString& menuitem) { | 86 | bool MenuScriptingInterface::menuItemExists(const QString& menu, const QString& menuitem) { |
| 86 | if (QThread::currentThread() == qApp->thread()) { | 87 | if (QThread::currentThread() == qApp->thread()) { |
| 87 | return Menu::getInstance()->menuItemExists(menu, menuitem); | 88 | Menu* menuInstance = Menu::getInstance(); |
| 89 | return menuInstance && menuInstance->menuItemExists(menu, menuitem); | ||
| 88 | } | 90 | } |
| 89 | bool result { false }; | 91 | bool result { false }; |
| 90 | BLOCKING_INVOKE_METHOD(Menu::getInstance(), "menuItemExists", | 92 | BLOCKING_INVOKE_METHOD(Menu::getInstance(), "menuItemExists", |
| @@ -96,7 +98,8 @@ bool MenuScriptingInterface::menuItemExists(const QString& menu, const QString& · 5 unmodified lines | |||
| 96 | 98 | ||
| 97 | bool MenuScriptingInterface::isOptionChecked(const QString& menuOption) { | 99 | bool MenuScriptingInterface::isOptionChecked(const QString& menuOption) { |
| 98 | if (QThread::currentThread() == qApp->thread()) { | 100 | if (QThread::currentThread() == qApp->thread()) { |
| 99 | return Menu::getInstance()->isOptionChecked(menuOption); | 101 | Menu* menuInstance = Menu::getInstance(); |
| 102 | return menuInstance && menuInstance->isOptionChecked(menuOption); | ||
| 100 | } | 103 | } |
| 101 | bool result { false }; | 104 | bool result { false }; |
| 102 | BLOCKING_INVOKE_METHOD(Menu::getInstance(), "isOptionChecked", | 105 | BLOCKING_INVOKE_METHOD(Menu::getInstance(), "isOptionChecked", |
| @@ -113,7 +116,8 @@ void MenuScriptingInterface::setIsOptionChecked(const QString& menuOption, bool · 10 unmodified lines | |||
| 113 | 116 | ||
| 114 | bool MenuScriptingInterface::isMenuEnabled(const QString& menuOption) { | 117 | bool MenuScriptingInterface::isMenuEnabled(const QString& menuOption) { |
| 115 | if (QThread::currentThread() == qApp->thread()) { | 118 | if (QThread::currentThread() == qApp->thread()) { |
| 116 | return Menu::getInstance()->isOptionChecked(menuOption); | 119 | Menu* menuInstance = Menu::getInstance(); |
| 120 | return menuInstance && menuInstance->isMenuEnabled(menuOption); | ||
| 117 | } | 121 | } |
| 118 | bool result { false }; | 122 | bool result { false }; |
| 119 | BLOCKING_INVOKE_METHOD(Menu::getInstance(), "isMenuEnabled", | 123 | BLOCKING_INVOKE_METHOD(Menu::getInstance(), "isMenuEnabled", |