Changeset View
Changeset View
Standalone View
Standalone View
krusader/GUI/terminaldock.cpp
Show First 20 Lines • Show All 222 Lines • ▼ Show 20 Line(s) | 214 | { | |||
---|---|---|---|---|---|
223 | for (w = watched; w != nullptr; w = w->parent()) | 223 | for (w = watched; w != nullptr; w = w->parent()) | ||
224 | if (w == konsole_part->widget()) | 224 | if (w == konsole_part->widget()) | ||
225 | break; | 225 | break; | ||
226 | if (w == nullptr) // is not a child of konsole_part | 226 | if (w == nullptr) // is not a child of konsole_part | ||
227 | return false; | 227 | return false; | ||
228 | 228 | | |||
229 | switch (e->type()) { | 229 | switch (e->type()) { | ||
230 | case QEvent::ShortcutOverride: { | 230 | case QEvent::ShortcutOverride: { | ||
231 | auto *ke = (QKeyEvent *)e; | 231 | auto *ke = dynamic_cast<QKeyEvent *>(e); | ||
232 | // If not present, some keys would be considered a shortcut, for example "a" | 232 | // If not present, some keys would be considered a shortcut, for example "a" | ||
233 | if ((ke->key() == Qt::Key_Insert) && (ke->modifiers() == Qt::ShiftModifier)) { | 233 | if ((ke->key() == Qt::Key_Insert) && (ke->modifiers() == Qt::ShiftModifier)) { | ||
234 | ke->accept(); | 234 | ke->accept(); | ||
235 | return true; | 235 | return true; | ||
236 | } | 236 | } | ||
237 | if ((ke->modifiers() == Qt::NoModifier || ke->modifiers() == Qt::ShiftModifier) && | 237 | if ((ke->modifiers() == Qt::NoModifier || ke->modifiers() == Qt::ShiftModifier) && | ||
238 | (ke->key() >= 32) && (ke->key() <= 127)) { | 238 | (ke->key() >= 32) && (ke->key() <= 127)) { | ||
239 | ke->accept(); | 239 | ke->accept(); | ||
240 | return true; | 240 | return true; | ||
241 | } | 241 | } | ||
242 | break; | 242 | break; | ||
243 | } | 243 | } | ||
244 | case QEvent::KeyPress: { | 244 | case QEvent::KeyPress: { | ||
245 | auto *ke = (QKeyEvent *)e; | 245 | auto *ke = dynamic_cast<QKeyEvent *>(e); | ||
246 | if (applyShortcuts(ke)) { | 246 | if (applyShortcuts(ke)) { | ||
247 | ke->accept(); | 247 | ke->accept(); | ||
248 | return true; | 248 | return true; | ||
249 | } | 249 | } | ||
250 | break; | 250 | break; | ||
251 | } | 251 | } | ||
252 | default: | 252 | default: | ||
253 | return false; | 253 | return false; | ||
Show All 35 Lines |