[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/traverso Interface.cpp
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src/traverso Interface.cpp |
Date: |
Sat, 14 Apr 2007 19:14:51 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 07/04/14 19:14:51
Modified files:
src/traverso : Interface.cpp
Log message:
* only show context menu if there is something under the mouse!
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/Interface.cpp?cvsroot=traverso&r1=1.62&r2=1.63
Patches:
Index: Interface.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/Interface.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- Interface.cpp 13 Apr 2007 09:59:19 -0000 1.62
+++ Interface.cpp 14 Apr 2007 19:14:51 -0000 1.63
@@ -445,15 +445,13 @@
// If not, show the menu for the topmost context item, and it's
// siblings as submenus
if (ie().is_holding()) {
- items.append(ie().get_holding_command());
+ Command* holding = ie().get_holding_command();
+ if (holding) {
+ items.append(holding);
+ }
} else {
items = cpointer().get_context_items();
- if (items.isEmpty()) {
- printf("Interface::show_context_menu: cpointer()
returned empty list\n");
- return 0;
- }
-
// Filter out classes that don't need to show up in the menu
foreach(QObject* item, items) {
QString className = item->metaObject()->className();
@@ -463,6 +461,11 @@
}
}
+ if (items.isEmpty()) {
+ printf("Interface:: No items under mouse to show context menu
for!\n");
+ return 0;
+ }
+
// 'Store' the contextitems under the mouse cursor, so the InputEngine
// dispatches the 'keyfact' from the menu to the 'pointed' objects!
cpointer().set_contextmenu_items(cpointer().get_context_items());