author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/apps/opie-write/qtextedit.cpp | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/apps/opie-write/qtextedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-write/qtextedit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/opie-write/qtextedit.cpp b/noncore/apps/opie-write/qtextedit.cpp index 27dd515..73b7b7b 100644 --- a/noncore/apps/opie-write/qtextedit.cpp +++ b/noncore/apps/opie-write/qtextedit.cpp | |||
@@ -632,98 +632,98 @@ QTextEdit::QTextEdit( QWidget *parent, const char *name ) | |||
632 | /*! | 632 | /*! |
633 | Constructs a QTextEdit with parent \a parent and name \a name. The | 633 | Constructs a QTextEdit with parent \a parent and name \a name. The |
634 | text edit will display the text \a text using context \a context. | 634 | text edit will display the text \a text using context \a context. |
635 | 635 | ||
636 | The \a context is a path which the text edit's QMimeSourceFactory | 636 | The \a context is a path which the text edit's QMimeSourceFactory |
637 | uses to resolve the locations of files and images. It is passed to | 637 | uses to resolve the locations of files and images. It is passed to |
638 | the mimeSourceFactory() when quering data. | 638 | the mimeSourceFactory() when quering data. |
639 | 639 | ||
640 | For example if the text contains an image tag, | 640 | For example if the text contains an image tag, |
641 | \c{<img src="image.png">}, and the context is "path/to/look/in", the | 641 | \c{<img src="image.png">}, and the context is "path/to/look/in", the |
642 | QMimeSourceFactory will try to load the image from | 642 | QMimeSourceFactory will try to load the image from |
643 | "path/to/look/in/image.png". If the tag was | 643 | "path/to/look/in/image.png". If the tag was |
644 | \c{<img src="/image.png">}, the context will not be used (because | 644 | \c{<img src="/image.png">}, the context will not be used (because |
645 | QMimeSourceFactory recognizes that we have used an absolute path) | 645 | QMimeSourceFactory recognizes that we have used an absolute path) |
646 | and will try to load "/image.png". The context is applied in exactly | 646 | and will try to load "/image.png". The context is applied in exactly |
647 | the same way to \e hrefs, for example, | 647 | the same way to \e hrefs, for example, |
648 | \c{<a href="target.html">Target</a>}, would resolve to | 648 | \c{<a href="target.html">Target</a>}, would resolve to |
649 | "path/to/look/in/target.html". | 649 | "path/to/look/in/target.html". |
650 | 650 | ||
651 | */ | 651 | */ |
652 | 652 | ||
653 | QTextEdit::QTextEdit( const QString& text, const QString& context, | 653 | QTextEdit::QTextEdit( const QString& text, const QString& context, |
654 | QWidget *parent, const char *name) | 654 | QWidget *parent, const char *name) |
655 | : QScrollView( parent, name, WStaticContents | WRepaintNoErase | WResizeNoErase ), | 655 | : QScrollView( parent, name, WStaticContents | WRepaintNoErase | WResizeNoErase ), |
656 | doc( new QTextDocument( 0 ) ), undoRedoInfo( doc ) | 656 | doc( new QTextDocument( 0 ) ), undoRedoInfo( doc ) |
657 | { | 657 | { |
658 | init(); | 658 | init(); |
659 | setText( text, context ); | 659 | setText( text, context ); |
660 | } | 660 | } |
661 | 661 | ||
662 | /*! \reimp */ | 662 | /*! \reimp */ |
663 | 663 | ||
664 | QTextEdit::~QTextEdit() | 664 | QTextEdit::~QTextEdit() |
665 | { | 665 | { |
666 | delete undoRedoInfo.d; | 666 | delete undoRedoInfo.d; |
667 | undoRedoInfo.d = 0; | 667 | undoRedoInfo.d = 0; |
668 | delete cursor; | 668 | delete cursor; |
669 | delete doc; | 669 | delete doc; |
670 | delete d; | 670 | delete d; |
671 | } | 671 | } |
672 | 672 | ||
673 | void QTextEdit::init() | 673 | void QTextEdit::init() |
674 | { | 674 | { |
675 | setFrameStyle( Sunken ); | 675 | setFrameStyle( Sunken ); |
676 | undoEnabled = TRUE; | 676 | undoEnabled = TRUE; |
677 | readonly = TRUE; | 677 | readonly = TRUE; |
678 | setReadOnly( FALSE ); | 678 | setReadOnly( FALSE ); |
679 | d = new QTextEditPrivate; | 679 | d = new QTextEditPrivate; |
680 | connect( doc, SIGNAL( minimumWidthChanged( int ) ), | 680 | connect( doc, SIGNAL( minimumWidthChanged(int) ), |
681 | this, SLOT( documentWidthChanged( int ) ) ); | 681 | this, SLOT( documentWidthChanged(int) ) ); |
682 | 682 | ||
683 | mousePressed = FALSE; | 683 | mousePressed = FALSE; |
684 | inDoubleClick = FALSE; | 684 | inDoubleClick = FALSE; |
685 | modified = FALSE; | 685 | modified = FALSE; |
686 | onLink = QString::null; | 686 | onLink = QString::null; |
687 | overWrite = FALSE; | 687 | overWrite = FALSE; |
688 | wrapMode = WidgetWidth; | 688 | wrapMode = WidgetWidth; |
689 | wrapWidth = -1; | 689 | wrapWidth = -1; |
690 | wPolicy = AtWhiteSpace; | 690 | wPolicy = AtWhiteSpace; |
691 | inDnD = FALSE; | 691 | inDnD = FALSE; |
692 | 692 | ||
693 | doc->setFormatter( new QTextFormatterBreakWords ); | 693 | doc->setFormatter( new QTextFormatterBreakWords ); |
694 | doc->formatCollection()->defaultFormat()->setFont( QScrollView::font() ); | 694 | doc->formatCollection()->defaultFormat()->setFont( QScrollView::font() ); |
695 | doc->formatCollection()->defaultFormat()->setColor( colorGroup().color( QColorGroup::Text ) ); | 695 | doc->formatCollection()->defaultFormat()->setColor( colorGroup().color( QColorGroup::Text ) ); |
696 | currentFormat = doc->formatCollection()->defaultFormat(); | 696 | currentFormat = doc->formatCollection()->defaultFormat(); |
697 | currentAlignment = Qt3::AlignAuto; | 697 | currentAlignment = Qt3::AlignAuto; |
698 | 698 | ||
699 | viewport()->setBackgroundMode( PaletteBase ); | 699 | viewport()->setBackgroundMode( PaletteBase ); |
700 | viewport()->setAcceptDrops( TRUE ); | 700 | viewport()->setAcceptDrops( TRUE ); |
701 | resizeContents( 0, doc->lastParagraph() ? | 701 | resizeContents( 0, doc->lastParagraph() ? |
702 | ( doc->lastParagraph()->paragId() + 1 ) * doc->formatCollection()->defaultFormat()->height() : 0 ); | 702 | ( doc->lastParagraph()->paragId() + 1 ) * doc->formatCollection()->defaultFormat()->height() : 0 ); |
703 | 703 | ||
704 | setKeyCompression( TRUE ); | 704 | setKeyCompression( TRUE ); |
705 | viewport()->setMouseTracking( TRUE ); | 705 | viewport()->setMouseTracking( TRUE ); |
706 | #ifndef QT_NO_CURSOR | 706 | #ifndef QT_NO_CURSOR |
707 | viewport()->setCursor( isReadOnly() ? arrowCursor : ibeamCursor ); | 707 | viewport()->setCursor( isReadOnly() ? arrowCursor : ibeamCursor ); |
708 | #endif | 708 | #endif |
709 | cursor = new QTextCursor( doc ); | 709 | cursor = new QTextCursor( doc ); |
710 | 710 | ||
711 | formatTimer = new QTimer( this ); | 711 | formatTimer = new QTimer( this ); |
712 | connect( formatTimer, SIGNAL( timeout() ), | 712 | connect( formatTimer, SIGNAL( timeout() ), |
713 | this, SLOT( formatMore() ) ); | 713 | this, SLOT( formatMore() ) ); |
714 | lastFormatted = doc->firstParagraph(); | 714 | lastFormatted = doc->firstParagraph(); |
715 | 715 | ||
716 | scrollTimer = new QTimer( this ); | 716 | scrollTimer = new QTimer( this ); |
717 | connect( scrollTimer, SIGNAL( timeout() ), | 717 | connect( scrollTimer, SIGNAL( timeout() ), |
718 | this, SLOT( autoScrollTimerDone() ) ); | 718 | this, SLOT( autoScrollTimerDone() ) ); |
719 | 719 | ||
720 | interval = 0; | 720 | interval = 0; |
721 | changeIntervalTimer = new QTimer( this ); | 721 | changeIntervalTimer = new QTimer( this ); |
722 | connect( changeIntervalTimer, SIGNAL( timeout() ), | 722 | connect( changeIntervalTimer, SIGNAL( timeout() ), |
723 | this, SLOT( doChangeInterval() ) ); | 723 | this, SLOT( doChangeInterval() ) ); |
724 | 724 | ||
725 | cursorVisible = TRUE; | 725 | cursorVisible = TRUE; |
726 | blinkTimer = new QTimer( this ); | 726 | blinkTimer = new QTimer( this ); |
727 | connect( blinkTimer, SIGNAL( timeout() ), | 727 | connect( blinkTimer, SIGNAL( timeout() ), |
728 | this, SLOT( blinkCursor() ) ); | 728 | this, SLOT( blinkCursor() ) ); |
729 | 729 | ||