diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-03 04:12:51 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-03 04:12:51 +0000 |
commit | 560378aaca1784ba19806a0414a32b20c744de39 (patch) | |
tree | ce0dfd7c3febf2a1adc7603d1019a8be2083c415 /kutils/kreplace.cpp | |
parent | d4d5af1cdbd3cc65d095e0afc5b1f4260091cf5d (diff) | |
download | tdelibs-560378aaca1784ba19806a0414a32b20c744de39.tar.gz tdelibs-560378aaca1784ba19806a0414a32b20c744de39.zip |
Automated conversion for enhanced compatibility with TQt for Qt4 3.4.0 TP1
NOTE: This will not compile with Qt4 (yet), however it does compile with Qt3
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1211081 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kutils/kreplace.cpp')
-rw-r--r-- | kutils/kreplace.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/kutils/kreplace.cpp b/kutils/kreplace.cpp index f825e93cc..856d330d5 100644 --- a/kutils/kreplace.cpp +++ b/kutils/kreplace.cpp @@ -35,7 +35,7 @@ class KReplaceNextDialog : public KDialogBase { public: KReplaceNextDialog( TQWidget *parent ); - void setLabel( const TQString& pattern, const TQString& replacement ); + void setLabel( const TQString& pattern, const TQString& tqreplacement ); private: TQLabel* m_mainLabel; }; @@ -50,28 +50,28 @@ KReplaceNextDialog::KReplaceNextDialog(TQWidget *parent) : { m_mainLabel = new TQLabel( this ); setMainWidget( m_mainLabel ); - resize(minimumSize()); + resize(tqminimumSize()); } -void KReplaceNextDialog::setLabel( const TQString& pattern, const TQString& replacement ) +void KReplaceNextDialog::setLabel( const TQString& pattern, const TQString& tqreplacement ) { - m_mainLabel->setText( i18n("Replace '%1' with '%2'?").arg(pattern).arg(replacement) ); + m_mainLabel->setText( i18n("Replace '%1' with '%2'?").arg(pattern).arg(tqreplacement) ); } //// -KReplace::KReplace(const TQString &pattern, const TQString &replacement, long options, TQWidget *parent) : +KReplace::KReplace(const TQString &pattern, const TQString &tqreplacement, long options, TQWidget *parent) : KFind( pattern, options, parent ) { - m_replacements = 0; - m_replacement = replacement; + m_tqreplacements = 0; + m_tqreplacement = tqreplacement; } -KReplace::KReplace(const TQString &pattern, const TQString &replacement, long options, TQWidget *parent, TQWidget *dlg) : +KReplace::KReplace(const TQString &pattern, const TQString &tqreplacement, long options, TQWidget *parent, TQWidget *dlg) : KFind( pattern, options, parent, dlg ) { - m_replacements = 0; - m_replacement = replacement; + m_tqreplacements = 0; + m_tqreplacement = tqreplacement; } KReplace::~KReplace() @@ -79,7 +79,7 @@ KReplace::~KReplace() // KFind::~KFind will delete m_dialog } -KDialogBase* KReplace::replaceNextDialog( bool create ) +KDialogBase* KReplace::tqreplaceNextDialog( bool create ) { if ( m_dialog || create ) return dialog(); @@ -90,7 +90,7 @@ KReplaceNextDialog* KReplace::dialog() { if ( !m_dialog ) { - m_dialog = new KReplaceNextDialog( parentWidget() ); + m_dialog = new KReplaceNextDialog( tqparentWidget() ); connect( m_dialog, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT( slotReplaceAll() ) ); connect( m_dialog, TQT_SIGNAL( user2Clicked() ), this, TQT_SLOT( slotSkip() ) ); connect( m_dialog, TQT_SIGNAL( user3Clicked() ), this, TQT_SLOT( slotReplace() ) ); @@ -101,13 +101,13 @@ KReplaceNextDialog* KReplace::dialog() void KReplace::displayFinalDialog() const { - if ( !m_replacements ) - KMessageBox::information(parentWidget(), i18n("No text was replaced.")); + if ( !m_tqreplacements ) + KMessageBox::information(tqparentWidget(), i18n("No text was tqreplaced.")); else - KMessageBox::information(parentWidget(), i18n("1 replacement done.", "%n replacements done.", m_replacements ) ); + KMessageBox::information(tqparentWidget(), i18n("1 tqreplacement done.", "%n tqreplacements done.", m_tqreplacements ) ); } -KFind::Result KReplace::replace() +KFind::Result KReplace::tqreplace() { #ifdef DEBUG_REPLACE kdDebug() << k_funcinfo << "m_index=" << m_index << endl; @@ -125,11 +125,11 @@ KFind::Result KReplace::replace() #endif // Find the next match. if ( m_options & KReplaceDialog::RegularExpression ) - m_index = KFind::find(m_text, *m_regExp, m_index, m_options, &m_matchedLength); + m_index = KFind::tqfind(m_text, *m_regExp, m_index, m_options, &m_matchedLength); else - m_index = KFind::find(m_text, m_pattern, m_index, m_options, &m_matchedLength); + m_index = KFind::tqfind(m_text, m_pattern, m_index, m_options, &m_matchedLength); #ifdef DEBUG_REPLACE - kdDebug() << k_funcinfo << "KFind::find returned m_index=" << m_index << endl; + kdDebug() << k_funcinfo << "KFind::tqfind returned m_index=" << m_index << endl; #endif if ( m_index != -1 ) { @@ -141,10 +141,10 @@ KFind::Result KReplace::replace() #ifdef DEBUG_REPLACE kdDebug() << k_funcinfo << "PromptOnReplace" << endl; #endif - // Display accurate initial string and replacement string, they can vary + // Display accurate initial string and tqreplacement string, they can vary TQString matchedText = m_text.mid( m_index, m_matchedLength ); TQString rep = matchedText; - KReplace::replace(rep, m_replacement, 0, m_options, m_matchedLength); + KReplace::tqreplace(rep, m_tqreplacement, 0, m_options, m_matchedLength); dialog()->setLabel( matchedText, rep ); dialog()->show(); @@ -177,46 +177,46 @@ KFind::Result KReplace::replace() return NoMatch; } -int KReplace::replace(TQString &text, const TQString &pattern, const TQString &replacement, int index, long options, int *replacedLength) +int KReplace::tqreplace(TQString &text, const TQString &pattern, const TQString &tqreplacement, int index, long options, int *tqreplacedLength) { int matchedLength; - index = KFind::find(text, pattern, index, options, &matchedLength); + index = KFind::tqfind(text, pattern, index, options, &matchedLength); if (index != -1) { - *replacedLength = replace(text, replacement, index, options, matchedLength); + *tqreplacedLength = tqreplace(text, tqreplacement, index, options, matchedLength); if (options & KReplaceDialog::FindBackwards) index--; else - index += *replacedLength; + index += *tqreplacedLength; } return index; } -int KReplace::replace(TQString &text, const TQRegExp &pattern, const TQString &replacement, int index, long options, int *replacedLength) +int KReplace::tqreplace(TQString &text, const TQRegExp &pattern, const TQString &tqreplacement, int index, long options, int *tqreplacedLength) { int matchedLength; - index = KFind::find(text, pattern, index, options, &matchedLength); + index = KFind::tqfind(text, pattern, index, options, &matchedLength); if (index != -1) { - *replacedLength = replace(text, replacement, index, options, matchedLength); + *tqreplacedLength = tqreplace(text, tqreplacement, index, options, matchedLength); if (options & KReplaceDialog::FindBackwards) index--; else - index += *replacedLength; + index += *tqreplacedLength; } return index; } -int KReplace::replace(TQString &text, const TQString &replacement, int index, long options, int length) +int KReplace::tqreplace(TQString &text, const TQString &tqreplacement, int index, long options, int length) { - TQString rep = replacement; - // Backreferences: replace \0 with the right portion of 'text' + TQString rep = tqreplacement; + // Backreferences: tqreplace \0 with the right portion of 'text' if ( options & KReplaceDialog::BackReference ) - rep.replace( "\\0", text.mid( index, length ) ); - // Then replace rep into the text - text.replace(index, length, rep); + rep.tqreplace( "\\0", text.mid( index, length ) ); + // Then tqreplace rep into the text + text.tqreplace(index, length, rep); return rep.length(); } @@ -225,7 +225,7 @@ void KReplace::slotReplaceAll() doReplace(); m_options &= ~KReplaceDialog::PromptOnReplace; emit optionsChanged(); - emit findNext(); + emit tqfindNext(); } void KReplace::slotSkip() @@ -238,7 +238,7 @@ void KReplace::slotSkip() delete m_dialog; // hide it again m_dialog = 0L; } else - emit findNext(); + emit tqfindNext(); } void KReplace::slotReplace() @@ -248,24 +248,24 @@ void KReplace::slotReplace() delete m_dialog; // hide it again m_dialog = 0L; } else - emit findNext(); + emit tqfindNext(); } void KReplace::doReplace() { - int replacedLength = KReplace::replace(m_text, m_replacement, m_index, m_options, m_matchedLength); + int tqreplacedLength = KReplace::tqreplace(m_text, m_tqreplacement, m_index, m_options, m_matchedLength); - // Tell the world about the replacement we made, in case someone wants to + // Tell the world about the tqreplacement we made, in case someone wants to // highlight it. - emit replace(m_text, m_index, replacedLength, m_matchedLength); + emit tqreplace(m_text, m_index, tqreplacedLength, m_matchedLength); #ifdef DEBUG_REPLACE - kdDebug() << k_funcinfo << "after replace() signal: m_index=" << m_index << " replacedLength=" << replacedLength << endl; + kdDebug() << k_funcinfo << "after tqreplace() signal: m_index=" << m_index << " tqreplacedLength=" << tqreplacedLength << endl; #endif - m_replacements++; + m_tqreplacements++; if (m_options & KReplaceDialog::FindBackwards) m_index--; else { - m_index += replacedLength; + m_index += tqreplacedLength; // when replacing the empty pattern, move on. See also kjs/regexp.cpp for how this should be done for regexps. if ( m_pattern.isEmpty() ) ++m_index; @@ -278,13 +278,13 @@ void KReplace::doReplace() void KReplace::resetCounts() { KFind::resetCounts(); - m_replacements = 0; + m_tqreplacements = 0; } bool KReplace::shouldRestart( bool forceAsking, bool showNumMatches ) const { - // Only ask if we did a "find from cursor", otherwise it's pointless. - // ... Or if the prompt-on-replace option was set. + // Only ask if we did a "tqfind from cursor", otherwise it's pointless. + // ... Or if the prompt-on-tqreplace option was set. // Well, unless the user can modify the document during a search operation, // hence the force boolean. if ( !forceAsking && (m_options & KFindDialog::FromCursor) == 0 @@ -296,10 +296,10 @@ bool KReplace::shouldRestart( bool forceAsking, bool showNumMatches ) const TQString message; if ( showNumMatches ) { - if ( !m_replacements ) - message = i18n("No text was replaced."); + if ( !m_tqreplacements ) + message = i18n("No text was tqreplaced."); else - message = i18n("1 replacement done.", "%n replacements done.", m_replacements ); + message = i18n("1 tqreplacement done.", "%n tqreplacements done.", m_tqreplacements ); } else { @@ -316,7 +316,7 @@ bool KReplace::shouldRestart( bool forceAsking, bool showNumMatches ) const i18n("Do you want to restart search from the end?") : i18n("Do you want to restart search at the beginning?"); - int ret = KMessageBox::questionYesNo( parentWidget(), message, TQString::null, i18n("Restart"), i18n("Stop") ); + int ret = KMessageBox::questionYesNo( tqparentWidget(), message, TQString::null, i18n("Restart"), i18n("Stop") ); return( ret == KMessageBox::Yes ); } |