diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-04 19:54:24 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-04 19:54:24 +0000 |
commit | d7633c195a464e4d344ada9eea61afd10110598a (patch) | |
tree | 1f2da0b135f3ed84955e340cae823f00c4ce7284 /src/ksvnwidgets/diffbrowser.cpp | |
parent | 3fa7eb804f67b2789f128075cc2522f398640250 (diff) | |
download | tdesvn-d7633c195a464e4d344ada9eea61afd10110598a.tar.gz tdesvn-d7633c195a464e4d344ada9eea61afd10110598a.zip |
Port kdesvn to TQt4
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdesvn@1230412 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/ksvnwidgets/diffbrowser.cpp')
-rw-r--r-- | src/ksvnwidgets/diffbrowser.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/ksvnwidgets/diffbrowser.cpp b/src/ksvnwidgets/diffbrowser.cpp index d1f7b6f..ddc2d5a 100644 --- a/src/ksvnwidgets/diffbrowser.cpp +++ b/src/ksvnwidgets/diffbrowser.cpp @@ -30,25 +30,25 @@ #include <kapplication.h> #include <klocale.h> -#include <qfont.h> -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qtextcodec.h> +#include <tqfont.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqtextcodec.h> /*! - \fn DiffBrowser::DiffBrowser(QWidget*parent=0,const char*name=0) + \fn DiffBrowser::DiffBrowser(TQWidget*tqparent=0,const char*name=0) */ -DiffBrowser::DiffBrowser(QWidget*parent,const char*name) - : KTextBrowser( parent, name) +DiffBrowser::DiffBrowser(TQWidget*tqparent,const char*name) + : KTextBrowser( tqparent, name) { - setTextFormat(Qt::PlainText); + setTextFormat(TQt::PlainText); setFont(KGlobalSettings::fixedFont()); m_Data = new DiffBrowserData; - setWordWrap(QTextEdit::NoWrap); + setWordWrap(TQTextEdit::NoWrap); m_Data->m_Syntax = new DiffSyntax(this); - QToolTip::add(this,i18n("Ctrl-F for search, F3 or Shift-F3 for search again.")); - QWhatsThis::add(this,i18n("<b>Display differences between files</b><p>You may search inside text with Ctrl-F.</p><p>F3 for search forward again, Shift-F3 for search backward again.</p><p>You may save the (original) output with Ctrl-S.</p>")); + TQToolTip::add(this,i18n("Ctrl-F for search, F3 or Shift-F3 for search again.")); + TQWhatsThis::add(this,i18n("<b>Display differences between files</b><p>You may search inside text with Ctrl-F.</p><p>F3 for search forward again, Shift-F3 for search backward again.</p><p>You may save the (original) output with Ctrl-S.</p>")); setFocus(); } @@ -60,14 +60,14 @@ DiffBrowser::DiffBrowser(QWidget*parent,const char*name) delete m_Data; } -void DiffBrowser::setText(const QString&aText) +void DiffBrowser::setText(const TQString&aText) { m_Data->m_content.setRawData(aText.local8Bit(),aText.local8Bit().size()); KTextBrowser::setText(aText); setCursorPosition(0,0); } -void DiffBrowser::setText(const QByteArray&aText) +void DiffBrowser::setText(const TQByteArray&aText) { m_Data->m_content=aText; printContent(); @@ -76,9 +76,9 @@ void DiffBrowser::setText(const QByteArray&aText) void DiffBrowser::printContent() { - QTextCodec * cc = QTextCodec::codecForName(Kdesvnsettings::locale_for_diff()); + TQTextCodec * cc = TQTextCodec::codecForName(Kdesvnsettings::locale_for_diff()); if (!cc) { - KTextBrowser::setText(QString::fromLocal8Bit(m_Data->m_content,m_Data->m_content.size())); + KTextBrowser::setText(TQString::fromLocal8Bit(m_Data->m_content,m_Data->m_content.size())); } else { KTextBrowser::setText(cc->toUnicode(m_Data->m_content,m_Data->m_content.size())); } @@ -89,24 +89,24 @@ void DiffBrowser::printContent() */ void DiffBrowser::saveDiff() { - QString saveTo = KFileDialog::getSaveFileName(QString::null,"text/x-diff"); + TQString saveTo = KFileDialog::getSaveFileName(TQString(),"text/x-diff"); if (saveTo.isEmpty()) { return; } - QFile tfile(saveTo); + TQFile tfile(saveTo); if (tfile.exists()) { - if (KMessageBox::warningYesNo(KApplication::activeModalWidget(), - i18n("File %1 exists - overwrite?").arg(saveTo)) + if (KMessageBox::warningYesNo(TQT_TQWIDGET(KApplication::activeModalWidget()), + i18n("File %1 exists - overwrite?").tqarg(saveTo)) !=KMessageBox::Yes) { return; } } tfile.open(IO_Truncate|IO_WriteOnly|IO_Raw); - QDataStream stream( &tfile ); + TQDataStream stream( &tfile ); stream.writeRawBytes(m_Data->m_content.data(),m_Data->m_content.size()); } -void DiffBrowser::keyPressEvent(QKeyEvent*ev) +void DiffBrowser::keyPressEvent(TQKeyEvent*ev) { if ( ev->key() == Key_Return) { ev->ignore(); @@ -131,10 +131,10 @@ void DiffBrowser::startSearch() { if( !m_Data->srchdialog ) { m_Data->srchdialog = new KEdFind( this, "searchdialog", false); - connect(m_Data->srchdialog,SIGNAL(search()),this,SLOT(search_slot())); - connect(m_Data->srchdialog,SIGNAL(done()),this,SLOT(searchdone_slot())); + connect(m_Data->srchdialog,TQT_SIGNAL(search()),this,TQT_SLOT(search_slot())); + connect(m_Data->srchdialog,TQT_SIGNAL(done()),this,TQT_SLOT(searchdone_slot())); } - QString _st = m_Data->srchdialog->getText(); + TQString _st = m_Data->srchdialog->getText(); m_Data->srchdialog->setText(_st.isEmpty() ? m_Data->pattern : _st); m_Data->srchdialog->show(); m_Data->srchdialog->result(); @@ -148,11 +148,11 @@ void DiffBrowser::search_slot() if( !m_Data->srchdialog ) { return; } - QString to_find_string = m_Data->srchdialog->getText(); + TQString to_find_string = m_Data->srchdialog->getText(); doSearch(to_find_string,m_Data->srchdialog->case_sensitive(),m_Data->srchdialog->get_direction()); } -void DiffBrowser::doSearch(const QString&to_find_string,bool case_sensitive,bool back) +void DiffBrowser::doSearch(const TQString&to_find_string,bool case_sensitive,bool back) { if( !m_Data->srchdialog ) { return; @@ -163,7 +163,7 @@ void DiffBrowser::doSearch(const QString&to_find_string,bool case_sensitive,bool col = col+1; } while (1) { - bool result = find(to_find_string,case_sensitive,false, + bool result = tqfind(to_find_string,case_sensitive,false, (!back),&line,&col); if (result) { @@ -171,11 +171,11 @@ void DiffBrowser::doSearch(const QString&to_find_string,bool case_sensitive,bool m_Data->pattern=to_find_string; break; } - QWidget * _parent = m_Data->srchdialog->isVisible()?m_Data->srchdialog:parentWidget(); + TQWidget * _tqparent = m_Data->srchdialog->isVisible()?m_Data->srchdialog:tqparentWidget(); if (!m_Data->srchdialog->get_direction()) { // forward int query = KMessageBox::questionYesNo( - _parent, + _tqparent, i18n("End of document reached.\n"\ "Continue from the beginning?"), i18n("Find"),KStdGuiItem::cont(),i18n("Stop")); @@ -188,13 +188,13 @@ void DiffBrowser::doSearch(const QString&to_find_string,bool case_sensitive,bool } } else { int query = KMessageBox::questionYesNo( - _parent, + _tqparent, i18n("Beginning of document reached.\n"\ "Continue from the end?"), i18n("Find"),KStdGuiItem::cont(),i18n("Stop")); if (query == KMessageBox::Yes){ line = lines()-1; - QString string = text(line); + TQString string = text(line); col = string.length(); if (col>0) { --col; @@ -244,7 +244,7 @@ void DiffBrowser::doSearchAgain(bool back) } } -void DiffBrowser::slotTextCodecChanged(const QString&codec) +void DiffBrowser::slotTextCodecChanged(const TQString&codec) { if (Kdesvnsettings::locale_for_diff()!=codec) { Kdesvnsettings::setLocale_for_diff(codec); |