summaryrefslogtreecommitdiffstats
path: root/vcs/cvsservice/diffwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vcs/cvsservice/diffwidget.cpp')
-rw-r--r--vcs/cvsservice/diffwidget.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/vcs/cvsservice/diffwidget.cpp b/vcs/cvsservice/diffwidget.cpp
index c51c16b0..87f8494f 100644
--- a/vcs/cvsservice/diffwidget.cpp
+++ b/vcs/cvsservice/diffwidget.cpp
@@ -9,11 +9,11 @@
* *
***************************************************************************/
-#include <qlayout.h>
-#include <qtextedit.h>
-#include <qpopupmenu.h>
-#include <qcursor.h>
-#include <qfile.h>
+#include <tqlayout.h>
+#include <tqtextedit.h>
+#include <tqpopupmenu.h>
+#include <tqcursor.h>
+#include <tqfile.h>
#include <kconfig.h>
#include <kapplication.h>
@@ -36,10 +36,10 @@
// yup, magic value for the popupmenu-id
static const int POPUP_BASE = 130977;
-QStringList KDiffTextEdit::extParts;
-QStringList KDiffTextEdit::extPartsTranslated;
+TQStringList KDiffTextEdit::extParts;
+TQStringList KDiffTextEdit::extPartsTranslated;
-KDiffTextEdit::KDiffTextEdit( QWidget* parent, const char* name ): QTextEdit( parent, name )
+KDiffTextEdit::KDiffTextEdit( TQWidget* parent, const char* name ): TQTextEdit( parent, name )
{
KConfig* config = kapp->config();
config->setGroup( "Diff" );
@@ -56,33 +56,33 @@ KDiffTextEdit::~KDiffTextEdit()
config->writeEntry( "Highlight", _highlight );
}
-QPopupMenu* KDiffTextEdit::createPopupMenu()
+TQPopupMenu* KDiffTextEdit::createPopupMenu()
{
- return createPopupMenu( QPoint() );
+ return createPopupMenu( TQPoint() );
}
-QPopupMenu* KDiffTextEdit::createPopupMenu( const QPoint& p )
+TQPopupMenu* KDiffTextEdit::createPopupMenu( const TQPoint& p )
{
- QPopupMenu* popup = QTextEdit::createPopupMenu( p );
+ TQPopupMenu* popup = TQTextEdit::createPopupMenu( p );
if ( !popup )
- popup = new QPopupMenu( this );
+ popup = new TQPopupMenu( this );
int i = 0;
- for ( QStringList::Iterator it = extPartsTranslated.begin(); it != extPartsTranslated.end(); ++it ) {
+ for ( TQStringList::Iterator it = extPartsTranslated.begin(); it != extPartsTranslated.end(); ++it ) {
popup->insertItem( i18n( "Show in %1" ).arg( *it ), i + POPUP_BASE, i );
i++;
}
if ( !extPartsTranslated.isEmpty() )
popup->insertSeparator( i );
- connect( popup, SIGNAL(activated(int)), this, SLOT(popupActivated(int)) );
+ connect( popup, TQT_SIGNAL(activated(int)), this, TQT_SLOT(popupActivated(int)) );
- popup->insertItem( SmallIconSet( "filesaveas" ), i18n( "&Save As..." ), this, SLOT(saveAs()), CTRL + Key_S, POPUP_BASE - 2, 0 );
+ popup->insertItem( SmallIconSet( "filesaveas" ), i18n( "&Save As..." ), this, TQT_SLOT(saveAs()), CTRL + Key_S, POPUP_BASE - 2, 0 );
popup->setItemEnabled( POPUP_BASE - 2, length() > 0 );
popup->insertSeparator( 1 );
- popup->insertItem( i18n( "Highlight Syntax" ), this, SLOT(toggleSyntaxHighlight()), 0, POPUP_BASE - 1, 2 );
+ popup->insertItem( i18n( "Highlight Syntax" ), this, TQT_SLOT(toggleSyntaxHighlight()), 0, POPUP_BASE - 1, 2 );
popup->setItemChecked( POPUP_BASE - 1, _highlight );
popup->insertSeparator( 3 );
@@ -91,13 +91,13 @@ QPopupMenu* KDiffTextEdit::createPopupMenu( const QPoint& p )
void KDiffTextEdit::saveAs()
{
- QString fName = KFileDialog::getSaveFileName();
+ TQString fName = KFileDialog::getSaveFileName();
if ( fName.isEmpty() )
return;
- QFile f( fName );
+ TQFile f( fName );
if ( f.open( IO_WriteOnly ) ) {
- QTextStream stream( &f );
+ TQTextStream stream( &f );
int pCount = paragraphs();
for ( int i = 0; i < pCount; ++i )
stream << text( i ) << "\n";
@@ -119,15 +119,15 @@ void KDiffTextEdit::toggleSyntaxHighlight()
void KDiffTextEdit::applySyntaxHighlight()
{
// the diff has been loaded so we apply a simple highlighting
- static QColor cAdded( 190, 190, 237);
- static QColor cRemoved( 190, 237, 190 );
+ static TQColor cAdded( 190, 190, 237);
+ static TQColor cRemoved( 190, 237, 190 );
if ( !_highlight )
return;
int paragCount = paragraphs();
for ( int i = 0; i < paragCount; ++i ) {
- QString txt = text( i );
+ TQString txt = text( i );
if ( txt.length() > 0 ) {
if ( txt.startsWith( "+" ) || txt.startsWith( ">" ) ) {
setParagraphBackgroundColor( i, cAdded );
@@ -174,19 +174,19 @@ void KDiffTextEdit::popupActivated( int id )
emit externalPartRequested( extParts[ id ] );
}
-DiffWidget::DiffWidget( QWidget *parent, const char *name, WFlags f ):
- QWidget( parent, name, f ), tempFile( 0 )
+DiffWidget::DiffWidget( TQWidget *parent, const char *name, WFlags f ):
+ TQWidget( parent, name, f ), tempFile( 0 )
{
job = 0;
extPart = 0;
te = new KDiffTextEdit( this, "Main Diff Viewer" );
te->setReadOnly( true );
- te->setTextFormat( QTextEdit::PlainText );
+ te->setTextFormat( TQTextEdit::PlainText );
// te->setMinimumSize( 300, 200 );
- connect( te, SIGNAL(externalPartRequested(const QString&)), this, SLOT(loadExtPart(const QString&)) );
+ connect( te, TQT_SIGNAL(externalPartRequested(const TQString&)), this, TQT_SLOT(loadExtPart(const TQString&)) );
- QVBoxLayout* layout = new QVBoxLayout( this );
+ TQVBoxLayout* layout = new TQVBoxLayout( this );
layout->addWidget( te );
}
@@ -210,7 +210,7 @@ void DiffWidget::setExtPartVisible( bool visible )
}
}
-void DiffWidget::loadExtPart( const QString& partName )
+void DiffWidget::loadExtPart( const TQString& partName )
{
if ( extPart ) {
setExtPartVisible( false );
@@ -242,15 +242,15 @@ void DiffWidget::slotClear()
}
// internally for the TextEdit only!
-void DiffWidget::slotAppend( const QString& str )
+void DiffWidget::slotAppend( const TQString& str )
{
te->append( str );
}
// internally for the TextEdit only!
-void DiffWidget::slotAppend( KIO::Job*, const QByteArray& ba )
+void DiffWidget::slotAppend( KIO::Job*, const TQByteArray& ba )
{
- slotAppend( QString( ba ) );
+ slotAppend( TQString( ba ) );
}
void DiffWidget::populateExtPart()
@@ -285,7 +285,7 @@ void DiffWidget::slotFinished()
populateExtPart();
}
-void DiffWidget::setDiff( const QString& diff )
+void DiffWidget::setDiff( const TQString& diff )
{
slotClear();
slotAppend( diff );
@@ -301,20 +301,20 @@ void DiffWidget::openURL( const KURL& url )
if ( !job )
return;
- connect( job, SIGNAL(data( KIO::Job *, const QByteArray & )),
- this, SLOT(slotAppend( KIO::Job*, const QByteArray& )) );
- connect( job, SIGNAL(result( KIO::Job * )),
- this, SLOT(slotFinished()) );
+ connect( job, TQT_SIGNAL(data( KIO::Job *, const TQByteArray & )),
+ this, TQT_SLOT(slotAppend( KIO::Job*, const TQByteArray& )) );
+ connect( job, TQT_SIGNAL(result( KIO::Job * )),
+ this, TQT_SLOT(slotFinished()) );
}
-void DiffWidget::contextMenuEvent( QContextMenuEvent* /* e */ )
+void DiffWidget::contextMenuEvent( TQContextMenuEvent* /* e */ )
{
- QPopupMenu* popup = new QPopupMenu( this );
+ TQPopupMenu* popup = new TQPopupMenu( this );
if ( !te->isVisible() )
- popup->insertItem( i18n("Display &Raw Output"), this, SLOT(showTextEdit()) );
+ popup->insertItem( i18n("Display &Raw Output"), this, TQT_SLOT(showTextEdit()) );
- popup->exec( QCursor::pos() );
+ popup->exec( TQCursor::pos() );
delete popup;
}