forked from qt-creator/qt-creator
SquishTests: Simplify and stabilize special handling of Mac menus
- Check condition only once - Make sure correct length is being used Change-Id: I8c9627d91b4f022d60bae039c0478248cc30d183 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -171,11 +171,13 @@ def invokeMenuItem(menu, item, *subItems):
|
|||||||
numberedPrefix = "%d | "
|
numberedPrefix = "%d | "
|
||||||
for subItem in subItems:
|
for subItem in subItems:
|
||||||
# we might have numbered sub items (e.g. "Recent Files") - these have this special prefix
|
# we might have numbered sub items (e.g. "Recent Files") - these have this special prefix
|
||||||
# but on macOS we don't add these prefixes
|
hasNumPrefix = subItem.startswith(numberedPrefix)
|
||||||
if platform.system() == 'Darwin' and subItem.startswith(numberedPrefix):
|
if hasNumPrefix and platform.system() == 'Darwin':
|
||||||
subItem = subItem[5:]
|
# on macOS we don't add these prefixes
|
||||||
|
subItem = subItem[len(numberedPrefix):]
|
||||||
|
hasNumPrefix = False
|
||||||
|
|
||||||
if subItem.startswith(numberedPrefix):
|
if hasNumPrefix:
|
||||||
triggered = False
|
triggered = False
|
||||||
for i in range(1, 10):
|
for i in range(1, 10):
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user