Changeset View
Changeset View
Standalone View
Standalone View
autotests/kmoretools/kmoretoolstest2.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 77 | { | |||
---|---|---|---|---|---|
83 | auto action = kateAppItem->action(); | 83 | auto action = kateAppItem->action(); | ||
84 | QVERIFY(action); // because kate is installed; | 84 | QVERIFY(action); // because kate is installed; | ||
85 | QCOMPARE(action->text(), QString(_("Kate in super-user mode"))); | 85 | QCOMPARE(action->text(), QString(_("Kate in super-user mode"))); | ||
86 | } | 86 | } | ||
87 | 87 | | |||
88 | 88 | | |||
89 | bool menuAtLeastOneActionWithText(const QMenu* menu, const QString& text) | 89 | bool menuAtLeastOneActionWithText(const QMenu* menu, const QString& text) | ||
90 | { | 90 | { | ||
91 | Q_FOREACH(auto a, menu->actions()) | 91 | const auto lstActions = menu->actions(); | ||
92 | for (auto a : lstActions) | ||||
92 | { | 93 | { | ||
93 | if (a->text() == text) { | 94 | if (a->text() == text) { | ||
94 | return true; | 95 | return true; | ||
95 | } | 96 | } | ||
96 | } | 97 | } | ||
97 | 98 | | |||
98 | return false; | 99 | return false; | ||
99 | } | 100 | } | ||
100 | 101 | | |||
101 | bool menuAtLeastNoActionWithText(const QMenu* menu, const QString& text) | 102 | bool menuAtLeastNoActionWithText(const QMenu* menu, const QString& text) | ||
102 | { | 103 | { | ||
103 | Q_FOREACH(auto a, menu->actions()) | 104 | const auto lstActions = menu->actions(); | ||
105 | for (auto a : lstActions) | ||||
104 | { | 106 | { | ||
105 | if (a->text() == text) { | 107 | if (a->text() == text) { | ||
106 | qDebug() << a->text(); | 108 | qDebug() << a->text(); | ||
107 | return false; | 109 | return false; | ||
108 | } | 110 | } | ||
109 | } | 111 | } | ||
110 | 112 | | |||
111 | return true; | 113 | return true; | ||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |