Changeset View
Changeset View
Standalone View
Standalone View
commands/kpCommandHistoryBase.cpp
Show First 20 Lines • Show All 518 Lines • ▼ Show 20 Line(s) | |||||
519 | 519 | | |||
520 | #if DEBUG_KP_COMMAND_HISTORY | 520 | #if DEBUG_KP_COMMAND_HISTORY | ||
521 | qCDebug(kpLogCommands) << "\tsize=" << commandList->size () | 521 | qCDebug(kpLogCommands) << "\tsize=" << commandList->size () | ||
522 | << " undoMinLimit=" << m_undoMinLimit | 522 | << " undoMinLimit=" << m_undoMinLimit | ||
523 | << " undoMaxLimit=" << m_undoMaxLimit | 523 | << " undoMaxLimit=" << m_undoMaxLimit | ||
524 | << " undoMaxLimitSizeLimit=" << m_undoMaxLimitSizeLimit | 524 | << " undoMaxLimitSizeLimit=" << m_undoMaxLimitSizeLimit | ||
525 | << endl; | 525 | << endl; | ||
526 | #endif | 526 | #endif | ||
527 | if ((int) commandList->size () <= m_undoMinLimit) | 527 | if (static_cast<int> (commandList->size ()) <= m_undoMinLimit) | ||
528 | { | 528 | { | ||
529 | #if DEBUG_KP_COMMAND_HISTORY | 529 | #if DEBUG_KP_COMMAND_HISTORY | ||
530 | qCDebug(kpLogCommands) << "\t\tsize under undoMinLimit - done"; | 530 | qCDebug(kpLogCommands) << "\t\tsize under undoMinLimit - done"; | ||
531 | #endif | 531 | #endif | ||
532 | return; | 532 | return; | ||
533 | } | 533 | } | ||
534 | 534 | | |||
535 | 535 | | |||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | |||||
599 | #endif | 599 | #endif | ||
600 | if (m_documentRestoredPosition != INT_MAX) | 600 | if (m_documentRestoredPosition != INT_MAX) | ||
601 | { | 601 | { | ||
602 | #if DEBUG_KP_COMMAND_HISTORY | 602 | #if DEBUG_KP_COMMAND_HISTORY | ||
603 | qCDebug(kpLogCommands) << "\t\tundoCmdList.size=" << m_undoCommandList.size () | 603 | qCDebug(kpLogCommands) << "\t\tundoCmdList.size=" << m_undoCommandList.size () | ||
604 | << " redoCmdList.size=" << m_redoCommandList.size () | 604 | << " redoCmdList.size=" << m_redoCommandList.size () | ||
605 | << endl; | 605 | << endl; | ||
606 | #endif | 606 | #endif | ||
607 | if (m_documentRestoredPosition > (int) m_redoCommandList.size () || | 607 | if (m_documentRestoredPosition > static_cast<int> (m_redoCommandList.size ()) || | ||
608 | -m_documentRestoredPosition > (int) m_undoCommandList.size ()) | 608 | -m_documentRestoredPosition > static_cast<int> (m_undoCommandList.size ())) | ||
609 | { | 609 | { | ||
610 | #if DEBUG_KP_COMMAND_HISTORY | 610 | #if DEBUG_KP_COMMAND_HISTORY | ||
611 | qCDebug(kpLogCommands) << "\t\t\tinvalidate documentRestoredPosition"; | 611 | qCDebug(kpLogCommands) << "\t\t\tinvalidate documentRestoredPosition"; | ||
612 | #endif | 612 | #endif | ||
613 | m_documentRestoredPosition = INT_MAX; | 613 | m_documentRestoredPosition = INT_MAX; | ||
614 | } | 614 | } | ||
615 | } | 615 | } | ||
616 | } | 616 | } | ||
Show All 30 Lines | |||||
647 | 647 | | |||
648 | // protected | 648 | // protected | ||
649 | void kpCommandHistoryBase::updateActions () | 649 | void kpCommandHistoryBase::updateActions () | ||
650 | { | 650 | { | ||
651 | #if DEBUG_KP_COMMAND_HISTORY | 651 | #if DEBUG_KP_COMMAND_HISTORY | ||
652 | qCDebug(kpLogCommands) << "kpCommandHistoryBase::updateActions()"; | 652 | qCDebug(kpLogCommands) << "kpCommandHistoryBase::updateActions()"; | ||
653 | #endif | 653 | #endif | ||
654 | 654 | | |||
655 | m_actionUndo->setEnabled ((bool) nextUndoCommand ()); | 655 | m_actionUndo->setEnabled (static_cast<bool> (nextUndoCommand ())); | ||
656 | // Don't want to keep changing toolbar text. | 656 | // Don't want to keep changing toolbar text. | ||
657 | // TODO: As a bad side-effect, the menu doesn't have "Undo: <action>" | 657 | // TODO: As a bad side-effect, the menu doesn't have "Undo: <action>" | ||
658 | // anymore. In any case, the KDE4 KToolBarPopupAction | 658 | // anymore. In any case, the KDE4 KToolBarPopupAction | ||
659 | // sucks in menus as it forces the clicking of a submenu. IMO, | 659 | // sucks in menus as it forces the clicking of a submenu. IMO, | ||
660 | // there should be no submenu in the menu. | 660 | // there should be no submenu in the menu. | ||
661 | //m_actionUndo->setText (undoActionText ()); | 661 | //m_actionUndo->setText (undoActionText ()); | ||
662 | 662 | | |||
663 | // But in icon mode, a tooltip with context is useful. | 663 | // But in icon mode, a tooltip with context is useful. | ||
664 | m_actionUndo->setToolTip (undoActionToolTip ()); | 664 | m_actionUndo->setToolTip (undoActionToolTip ()); | ||
665 | #if DEBUG_KP_COMMAND_HISTORY | 665 | #if DEBUG_KP_COMMAND_HISTORY | ||
666 | QTime timer; timer.start (); | 666 | QTime timer; timer.start (); | ||
667 | #endif | 667 | #endif | ||
668 | populatePopupMenu (m_actionUndo->menu (), | 668 | populatePopupMenu (m_actionUndo->menu (), | ||
669 | i18n ("Undo"), | 669 | i18n ("Undo"), | ||
670 | m_undoCommandList); | 670 | m_undoCommandList); | ||
671 | #if DEBUG_KP_COMMAND_HISTORY | 671 | #if DEBUG_KP_COMMAND_HISTORY | ||
672 | qCDebug(kpLogCommands) << "\tpopuplatePopupMenu undo=" << timer.elapsed () | 672 | qCDebug(kpLogCommands) << "\tpopuplatePopupMenu undo=" << timer.elapsed () | ||
673 | << "ms" << endl;; | 673 | << "ms" << endl;; | ||
674 | #endif | 674 | #endif | ||
675 | 675 | | |||
676 | m_actionRedo->setEnabled ((bool) nextRedoCommand ()); | 676 | m_actionRedo->setEnabled (static_cast<bool> (nextRedoCommand ())); | ||
677 | // Don't want to keep changing toolbar text. | 677 | // Don't want to keep changing toolbar text. | ||
678 | // TODO: As a bad side-effect, the menu doesn't have "Undo: <action>" | 678 | // TODO: As a bad side-effect, the menu doesn't have "Undo: <action>" | ||
679 | // anymore. In any case, the KDE4 KToolBarPopupAction | 679 | // anymore. In any case, the KDE4 KToolBarPopupAction | ||
680 | // sucks in menus as it forces the clicking of a submenu. IMO, | 680 | // sucks in menus as it forces the clicking of a submenu. IMO, | ||
681 | // there should be no submenu in the menu. | 681 | // there should be no submenu in the menu. | ||
682 | //m_actionRedo->setText (redoActionText ()); | 682 | //m_actionRedo->setText (redoActionText ()); | ||
683 | 683 | | |||
684 | // But in icon mode, a tooltip with context is useful. | 684 | // But in icon mode, a tooltip with context is useful. | ||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |