Changeset View
Changeset View
Standalone View
Standalone View
krusader/KViewer/krviewer.cpp
Show First 20 Lines • Show All 244 Lines • ▼ Show 20 Line(s) | 243 | if (e->type() == QEvent::ShortcutOverride) { | |||
---|---|---|---|---|---|
245 | if (reservedKeys.contains(ke->key())) { | 245 | if (reservedKeys.contains(ke->key())) { | ||
246 | ke->accept(); | 246 | ke->accept(); | ||
247 | 247 | | |||
248 | QAction *act = reservedKeyActions[ reservedKeys.indexOf(ke->key())]; | 248 | QAction *act = reservedKeyActions[ reservedKeys.indexOf(ke->key())]; | ||
249 | if (act != 0) { | 249 | if (act != 0) { | ||
250 | // don't activate the close functions immediately! | 250 | // don't activate the close functions immediately! | ||
251 | // it can cause crash | 251 | // it can cause crash | ||
252 | if (act == tabCloseAction || act == quitAction) { | 252 | if (act == tabCloseAction || act == quitAction) { | ||
253 | QTimer::singleShot(0, act, SLOT(trigger())); | 253 | QTimer::singleShot(0, act, &QAction::trigger); | ||
254 | } else { | 254 | } else { | ||
255 | act->activate(QAction::Trigger); | 255 | act->activate(QAction::Trigger); | ||
256 | } | 256 | } | ||
257 | } | 257 | } | ||
258 | return true; | 258 | return true; | ||
259 | } | 259 | } | ||
260 | } else if (e->type() == QEvent::KeyPress) { | 260 | } else if (e->type() == QEvent::KeyPress) { | ||
261 | QKeyEvent* ke = (QKeyEvent*) e; | 261 | QKeyEvent* ke = (QKeyEvent*) e; | ||
▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Line(s) | 426 | if (tabBar.count() <= 0) { | |||
427 | if (returnFocusToThisWidget) { | 427 | if (returnFocusToThisWidget) { | ||
428 | returnFocusToThisWidget->raise(); | 428 | returnFocusToThisWidget->raise(); | ||
429 | returnFocusToThisWidget->activateWindow(); | 429 | returnFocusToThisWidget->activateWindow(); | ||
430 | } else { | 430 | } else { | ||
431 | krMainWindow->raise(); | 431 | krMainWindow->raise(); | ||
432 | krMainWindow->activateWindow(); | 432 | krMainWindow->activateWindow(); | ||
433 | } | 433 | } | ||
434 | 434 | | |||
435 | QTimer::singleShot(0, this, SLOT(close())); | 435 | QTimer::singleShot(0, this, &KrViewer::close); | ||
436 | } else if (tabBar.count() == 1) { | 436 | } else if (tabBar.count() == 1) { | ||
437 | // no point in detaching only one tab.. | 437 | // no point in detaching only one tab.. | ||
438 | detachAction->setEnabled(false); | 438 | detachAction->setEnabled(false); | ||
439 | } | 439 | } | ||
440 | } | 440 | } | ||
441 | 441 | | |||
442 | void KrViewer::tabCloseRequest() | 442 | void KrViewer::tabCloseRequest() | ||
443 | { | 443 | { | ||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
497 | { | 497 | { | ||
498 | PanelViewerBase* pvb = static_cast<PanelViewerBase*>(tabBar.currentWidget()); | 498 | PanelViewerBase* pvb = static_cast<PanelViewerBase*>(tabBar.currentWidget()); | ||
499 | if (pvb) | 499 | if (pvb) | ||
500 | editInternal(pvb->url(), Text); | 500 | editInternal(pvb->url(), Text); | ||
501 | } | 501 | } | ||
502 | 502 | | |||
503 | void KrViewer::checkModified() | 503 | void KrViewer::checkModified() | ||
504 | { | 504 | { | ||
505 | QTimer::singleShot(CHECK_MODFIED_INTERVAL, this, SLOT(checkModified())); | 505 | QTimer::singleShot(CHECK_MODFIED_INTERVAL, this, &KrViewer::checkModified); | ||
506 | 506 | | |||
507 | PanelViewerBase* pvb = static_cast<PanelViewerBase*>(tabBar.currentWidget()); | 507 | PanelViewerBase* pvb = static_cast<PanelViewerBase*>(tabBar.currentWidget()); | ||
508 | if (pvb) | 508 | if (pvb) | ||
509 | refreshTab(pvb); | 509 | refreshTab(pvb); | ||
510 | } | 510 | } | ||
511 | 511 | | |||
512 | void KrViewer::refreshTab(PanelViewerBase* pvb) | 512 | void KrViewer::refreshTab(PanelViewerBase* pvb) | ||
513 | { | 513 | { | ||
▲ Show 20 Lines • Show All 198 Lines • Show Last 20 Lines |