summaryrefslogtreecommitdiffstats
path: root/ksirc/kstextview.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:49:40 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:49:40 -0600
commit808e453c56036211f57482ed847d54aca01bba68 (patch)
tree75515d5768dea10d4fbe4cd772e0a89c1c4b3aa9 /ksirc/kstextview.cpp
parentcd9b9ed7fd0ac8a75106148254aa58e2e5c04863 (diff)
downloadtdenetwork-808e453c56036211f57482ed847d54aca01bba68.tar.gz
tdenetwork-808e453c56036211f57482ed847d54aca01bba68.zip
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'ksirc/kstextview.cpp')
-rw-r--r--ksirc/kstextview.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/ksirc/kstextview.cpp b/ksirc/kstextview.cpp
index bd43d82c..151a3be6 100644
--- a/ksirc/kstextview.cpp
+++ b/ksirc/kstextview.cpp
@@ -24,7 +24,7 @@
#include <tqvaluestack.h>
#include <tqdragobject.h>
#include <tqtimer.h>
-#include <tqclipboard.h>
+#include <clipboard.h>
#include <tqdict.h>
#include <kcharsets.h>
#include <kapplication.h>
@@ -245,7 +245,7 @@ Item *TextChunk::breakLine( int width )
return 0;
}
-Item::LayoutResettqStatus TextChunk::resetLayout()
+Item::LayoutResetStatus TextChunk::resetLayout()
{
if ( m_originalTextLength == 0 )
@@ -376,12 +376,12 @@ Item *TextChunk::hardBreak( const StringPtr &rightHandSide )
selStart->offset -= m_text.len;
selEnd->offset -= m_text.len;
selStart->item = selEnd->item = chunk;
- chunk->setSelectiontqStatus( m_selection );
+ chunk->setSelectionStatus( m_selection );
m_selection = NoSelection;
} else if ( selEnd->offset >= m_text.len ) {
selEnd->offset -= m_text.len;
selEnd->item = chunk;
- chunk->setSelectiontqStatus( SelectionEnd );
+ chunk->setSelectionStatus( SelectionEnd );
m_selection = SelectionStart;
}
}
@@ -389,7 +389,7 @@ Item *TextChunk::hardBreak( const StringPtr &rightHandSide )
if ( selection && selection->offset >= m_text.len ) {
selection->offset -= m_text.len;
selection->item = chunk;
- chunk->setSelectiontqStatus( m_selection );
+ chunk->setSelectionStatus( m_selection );
m_selection = NoSelection;
}
@@ -433,7 +433,7 @@ int TextChunk::paintSelection( TQPainter &p, int x, const StringPtr &text )
const int width = m_metrics.width( str );
- const TQColorGroup &cg = m_parag->textView()->tqcolorGroup();
+ const TQColorGroup &cg = m_parag->textView()->colorGroup();
if (m_props.bgSelColor.isValid())
p.fillRect( x, 0, width, height(), m_props.bgSelColor );
@@ -482,11 +482,11 @@ void TextChunk::mergeSelection( TextChunk *child, SelectionPoint *selection )
selection->item = this;
- if ( ( m_selection == SelectionStart && child->selectiontqStatus() == SelectionEnd ) ||
- ( m_selection == SelectionEnd && child->selectiontqStatus() == SelectionStart ) )
+ if ( ( m_selection == SelectionStart && child->selectionStatus() == SelectionEnd ) ||
+ ( m_selection == SelectionEnd && child->selectionStatus() == SelectionStart ) )
m_selection = SelectionBoth;
else
- m_selection = child->selectiontqStatus();
+ m_selection = child->selectionStatus();
}
ImageItem::ImageItem( TextParag *parag, const TQPixmap &pixmap )
@@ -512,7 +512,7 @@ void ImageItem::paint( TQPainter &painter )
if (m_props.bgSelColor.isValid())
painter.fillRect( 0, 0, width(), h, m_props.bgSelColor );
else {
- const TQColorGroup &cg = m_parag->textView()->tqcolorGroup();
+ const TQColorGroup &cg = m_parag->textView()->colorGroup();
painter.fillRect( 0, 0, width(), h, cg.highlight() );
}
}
@@ -520,7 +520,7 @@ void ImageItem::paint( TQPainter &painter )
painter.drawPixmap( 0, y, m_pixmap );
}
-Item::LayoutResettqStatus ImageItem::resetLayout()
+Item::LayoutResetStatus ImageItem::resetLayout()
{
// nothin' to do
return KeepItem;
@@ -645,7 +645,7 @@ bool Tokenizer::parseNextToken( Token &tok )
return false;
tok.id = Token::Text;
- tok.value = StringPtr( m_text.tqunicode() + idx,
+ tok.value = StringPtr( m_text.unicode() + idx,
m_text.length() - idx );
tok.attributes.clear();
return true;
@@ -658,7 +658,7 @@ bool Tokenizer::parseNextToken( Token &tok )
{
tok.id = Token::Text;
tok.attributes.clear();
- tok.value = StringPtr( m_text.tqunicode(),
+ tok.value = StringPtr( m_text.unicode(),
(*m_lastTag).index );
m_textBeforeFirstTagProcessed = true;
@@ -676,7 +676,7 @@ bool Tokenizer::parseNextToken( Token &tok )
if ( lastType == TagIndex::Open &&
type == TagIndex::Close )
{
- const TQChar *tagStart = m_text.tqunicode() + lastIndex + 1;
+ const TQChar *tagStart = m_text.unicode() + lastIndex + 1;
uint tagLen = ( index - 1 ) - ( lastIndex + 1 ) + 1;
// </bleh> ?
if ( *tagStart == '/' )
@@ -699,7 +699,7 @@ bool Tokenizer::parseNextToken( Token &tok )
{
tok.id = Token::Text;
tok.attributes.clear();
- tok.value = StringPtr( m_text.tqunicode() + lastIndex + 1,
+ tok.value = StringPtr( m_text.unicode() + lastIndex + 1,
( index - 1 ) - lastIndex );
m_lastTag = it;
@@ -715,7 +715,7 @@ bool Tokenizer::parseNextToken( Token &tok )
Tokenizer::TagIndexList Tokenizer::scanTagIndices( const TQString &text )
{
- const TQChar *start = text.tqunicode();
+ const TQChar *start = text.unicode();
const TQChar *p = start;
const TQChar *endP = p + text.length();
bool quoted = false;
@@ -754,7 +754,7 @@ Tokenizer::TagIndexList Tokenizer::scanTagIndices( const TQString &text )
void Tokenizer::resolveEntities( TQString &text, TagIndexList &tags )
{
- const TQChar *p = text.tqunicode();
+ const TQChar *p = text.unicode();
const TQChar *endP = p + text.length();
uint i = 0;
bool scanForSemicolon = false;
@@ -793,13 +793,13 @@ void Tokenizer::resolveEntities( TQString &text, TagIndexList &tags )
if ( entityValue.isNull() )
continue;
- const uint ampersandPos = ampersand - text.tqunicode();
+ const uint ampersandPos = ampersand - text.unicode();
text[ ampersandPos ] = entityValue;
text.remove( ampersandPos + 1, entityLength + 1 );
i = ampersandPos;
- p = text.tqunicode() + i;
- endP = text.tqunicode() + text.length();
+ p = text.unicode() + i;
+ endP = text.unicode() + text.length();
ampersand = 0;
uint adjustment = entityLength + 1;
@@ -1081,7 +1081,7 @@ TQString TextLine::updateSelection( const SelectionPoint &start, const Selection
{
if ( i == start.item )
{
- i->setSelectiontqStatus( Item::SelectionStart );
+ i->setSelectionStatus( Item::SelectionStart );
StringPtr txt = i->text();
if ( !txt.isNull() )
@@ -1090,7 +1090,7 @@ TQString TextLine::updateSelection( const SelectionPoint &start, const Selection
}
else if ( i == end.item )
{
- i->setSelectiontqStatus( Item::SelectionEnd );
+ i->setSelectionStatus( Item::SelectionEnd );
StringPtr txt = i->text();
if ( !txt.isNull() )
@@ -1098,7 +1098,7 @@ TQString TextLine::updateSelection( const SelectionPoint &start, const Selection
}
else
{
- i->setSelectiontqStatus( Item::InSelection );
+ i->setSelectionStatus( Item::InSelection );
selectedText += i->text().toTQString();
}
@@ -1111,7 +1111,7 @@ void TextLine::clearSelection()
{
Item *i = m_items.first();
for (; i; i = m_items.next() )
- i->setSelectiontqStatus( Item::NoSelection );
+ i->setSelectionStatus( Item::NoSelection );
}
void TextLine::appendItem( Item *i, int layoutUpdatePolicy )
@@ -1225,7 +1225,7 @@ TextParag::~TextParag()
{
}
-void TextParag::tqlayout( int width )
+void TextParag::layout( int width )
{
TQPtrList<Item> items;
@@ -1658,7 +1658,7 @@ void TextView::viewportResizeEvent( TQResizeEvent *ev )
TQScrollView::viewportResizeEvent(ev);
if ( ev->size().width() != ev->oldSize().width() )
- tqlayout();
+ layout();
int newdiff = ev->size().height() - ev->oldSize().height();
setContentsPos( 0, contentsY()-newdiff );
@@ -1720,7 +1720,7 @@ void TextView::clear()
stopAutoScroll();
clearSelection();
m_parags.clear();
- tqlayout();
+ layout();
viewport()->erase();
}
@@ -1728,7 +1728,7 @@ TextParagIterator TextView::appendParag( const TQString &richText )
{
TextParag *parag = new TextParag( this, richText );
m_parags.append( parag );
- tqlayout( false );
+ layout( false );
scrollToBottom();
TQPtrListIterator<TextParag> it( m_parags );
it.toLast();
@@ -1758,7 +1758,7 @@ bool TextView::removeParag( const TextParagIterator &parag )
if(m_selectionEnd.item != 0)
m_selectionEnd.pos.ry() -= height;
- //tqlayout( false );
+ //layout( false );
contentsChange(-height, true);
@@ -1768,14 +1768,14 @@ bool TextView::removeParag( const TextParagIterator &parag )
return true;
}
-void TextView::clearSelection( bool tqrepaint )
+void TextView::clearSelection( bool repaint )
{
m_selectionStart = SelectionPoint();
m_selectionEnd = SelectionPoint();
m_selectionEndBeforeStart = false;
m_selectedText = TQString();
clearSelectionInternal();
- if ( tqrepaint )
+ if ( repaint )
updateContents();
}
@@ -1814,7 +1814,7 @@ void TextView::setLinkColor( const TQColor &linkColor )
void TextView::copy()
{
- TQApplication::tqclipboard()->setText( m_selectedText );
+ TQApplication::clipboard()->setText( m_selectedText );
}
void TextView::clearSelectionInternal()
@@ -1840,7 +1840,7 @@ void TextView::contentsMousePressEvent( TQMouseEvent *ev )
Item *itemUnderMouse = itemAt( ev->pos(), &p, Item::SelectFuzzy );
if ( p.item && ( ev->button() & Qt::LeftButton ) ) {
m_selectionMaybeStart = p;
- p.item->setSelectiontqStatus( Item::NoSelection );
+ p.item->setSelectionStatus( Item::NoSelection );
}
if ( TextChunk *text = dynamic_cast<TextChunk *>( itemUnderMouse ) ) {
StringPtr href = text->props().attributes[ "href" ];
@@ -1953,7 +1953,7 @@ void TextView::contentsMouseReleaseEvent( TQMouseEvent *ev )
m_selectionMaybeStart = SelectionPoint();
if ( (ev->button() & Qt::LeftButton) && !m_selectedText.isEmpty() )
- TQApplication::tqclipboard()->setText( m_selectedText, TQClipboard::Selection );
+ TQApplication::clipboard()->setText( m_selectedText, TQClipboard::Selection );
if ( clicked ) {
emitLinkClickedForMouseEvent( ev );
@@ -1962,7 +1962,7 @@ void TextView::contentsMouseReleaseEvent( TQMouseEvent *ev )
if (ev->button() & Qt::MidButton)
{
- emit pasteReq( KApplication::tqclipboard()->text( TQClipboard::Selection ) );
+ emit pasteReq( KApplication::clipboard()->text( TQClipboard::Selection ) );
return;
}
}
@@ -1973,7 +1973,7 @@ void TextView::fontChange( const TQFont & )
for (; it.current(); ++it )
it.current()->fontChange( font() );
- tqlayout( true );
+ layout( true );
}
void TextView::startDrag()
@@ -2103,11 +2103,11 @@ TQString TextView::updateSelection( const SelectionPoint &start, const Selection
{
if ( start.pos.x() == end.pos.x() )
{
- i->setSelectiontqStatus( Item::NoSelection );
+ i->setSelectionStatus( Item::NoSelection );
return TQString();
}
- i->setSelectiontqStatus( Item::SelectionBoth );
+ i->setSelectionStatus( Item::SelectionBoth );
// ### ugly
const TextChunk *t = dynamic_cast<TextChunk *>( i );
@@ -2119,7 +2119,7 @@ TQString TextView::updateSelection( const SelectionPoint &start, const Selection
}
else
{
- i->setSelectiontqStatus( Item::SelectionBoth );
+ i->setSelectionStatus( Item::SelectionBoth );
// ### ugly
TextChunk *t = dynamic_cast<TextChunk *>( i );
@@ -2156,7 +2156,7 @@ TQString TextView::updateSelection( const SelectionPoint &start, const Selection
return selectedText;
}
-void TextView::tqlayout( bool force )
+void TextView::layout( bool force )
{
int height = 0;
int contentsWidth = visibleWidth();
@@ -2166,7 +2166,7 @@ void TextView::tqlayout( bool force )
for (; it.current(); ++it )
{
if ( !it.current()->isLayouted() || force )
- it.current()->tqlayout( width );
+ it.current()->layout( width );
height += it.current()->height();
contentsWidth = kMax( contentsWidth, it.current()->minWidth() );
@@ -2182,7 +2182,7 @@ void TextView::tqlayout( bool force )
void TextView::contentsChange(int heightChange, bool force)
{
if(m_height == -1){
- tqlayout(force);
+ layout(force);
}
else {
m_height += heightChange;
@@ -2248,7 +2248,7 @@ void TextParagIterator::setRichText( const TQString &richText )
m_paragIt.current()->setRichText( richText );
TextView *textView = m_paragIt.current()->textView();
- textView->tqlayout( false );
+ textView->layout( false );
if ( textView->isUpdatesEnabled() )
textView->updateContents();