summaryrefslogtreecommitdiffstats
path: root/kbabel/catalogmanager/libcvs
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:51:49 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:51:49 +0000
commit4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch)
treeb0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kbabel/catalogmanager/libcvs
parent1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff)
downloadtdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz
tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/catalogmanager/libcvs')
-rw-r--r--kbabel/catalogmanager/libcvs/cvsdialog.cpp128
-rw-r--r--kbabel/catalogmanager/libcvs/cvsdialog.h36
-rw-r--r--kbabel/catalogmanager/libcvs/cvshandler.cpp124
-rw-r--r--kbabel/catalogmanager/libcvs/cvshandler.h38
4 files changed, 163 insertions, 163 deletions
diff --git a/kbabel/catalogmanager/libcvs/cvsdialog.cpp b/kbabel/catalogmanager/libcvs/cvsdialog.cpp
index af76d9d0..090b3de3 100644
--- a/kbabel/catalogmanager/libcvs/cvsdialog.cpp
+++ b/kbabel/catalogmanager/libcvs/cvsdialog.cpp
@@ -33,18 +33,18 @@
// Qt include files
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qfileinfo.h>
-#include <qframe.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlistbox.h>
-#include <qpushbutton.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qtextedit.h>
-#include <qtextcodec.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqfileinfo.h>
+#include <tqframe.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlistbox.h>
+#include <tqpushbutton.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqtextedit.h>
+#include <tqtextcodec.h>
// KDE include files
#include <kconfig.h>
#include <kdebug.h>
@@ -60,16 +60,16 @@
#include "cvsdialog.h"
-CVSDialog::CVSDialog( CVS::Command cmd, QWidget * parent, KSharedConfig* config )
+CVSDialog::CVSDialog( CVS::Command cmd, TQWidget * parent, KSharedConfig* config )
: KDialog( parent, "CVSDIALOG", true ), m_config( config )
{
_cmd = cmd;
p=0L;
setCaption( i18n( "CVS Dialog" ) );
- QString temp;
+ TQString temp;
- QVBoxLayout * layout = new QVBoxLayout( this, 6, 6, "MAIN LAYOUT" );
+ TQVBoxLayout * layout = new TQVBoxLayout( this, 6, 6, "MAIN LAYOUT" );
// Set the label's text depending on the CVS command.
switch ( cmd ) {
@@ -86,54 +86,54 @@ CVSDialog::CVSDialog( CVS::Command cmd, QWidget * parent, KSharedConfig* config
temp = i18n( "Get diff for the following files:" );
break;
}
- layout->addWidget( new QLabel( temp, this ) );
+ layout->addWidget( new TQLabel( temp, this ) );
// Widget for showing the list of files.
- filebox = new QListBox( this );
+ filebox = new TQListBox( this );
layout->addWidget( filebox );
// Add special widgets for 'cvs commit'.
if ( cmd == CVS::Commit ) {
- QLabel * label;
+ TQLabel * label;
// Combobox for displaying old log messages.
- label = new QLabel( i18n( "&Old messages:" ), this );
- oldMessages = new QComboBox( this );
+ label = new TQLabel( i18n( "&Old messages:" ), this );
+ oldMessages = new TQComboBox( this );
oldMessages->setDuplicatesEnabled( false );
label->setBuddy( oldMessages );
layout->addWidget( label );
layout->addWidget( oldMessages );
// Textfield for entering a log message.
- label = new QLabel( i18n( "&Log message:" ), this );
- logedit = new QTextEdit( this );
+ label = new TQLabel( i18n( "&Log message:" ), this );
+ logedit = new TQTextEdit( this );
label->setBuddy( logedit );
layout->addWidget( label );
layout->addWidget( logedit );
- label = new QLabel( i18n( "E&ncoding:" ), this );
+ label = new TQLabel( i18n( "E&ncoding:" ), this );
m_encodingComboBox = new KComboBox( this );
label->setBuddy( m_encodingComboBox );
layout->addWidget( label );
layout->addWidget( m_encodingComboBox );
- QStringList encodingList;
+ TQStringList encodingList;
// The last encoding will be added at the top of the list, when the seetings will be read.
encodingList << i18n( "Descriptive encoding name", "Recommended ( %1 )" ).arg( "UTF-8" );
- encodingList << i18n( "Descriptive encoding name", "Locale ( %1 )" ).arg( QTextCodec::codecForLocale()->mimeName() );
+ encodingList << i18n( "Descriptive encoding name", "Locale ( %1 )" ).arg( TQTextCodec::codecForLocale()->mimeName() );
encodingList += KGlobal::charsets()->descriptiveEncodingNames();
m_encodingComboBox->insertStringList( encodingList );
- connect( oldMessages, SIGNAL( activated( int ) ),
- this, SLOT( slotComboActivated( int ) ) );
+ connect( oldMessages, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( slotComboActivated( int ) ) );
}
- QHBoxLayout * buttons = new QHBoxLayout( 0, 0, 6, "BUTTON LAYOUT" );
+ TQHBoxLayout * buttons = new TQHBoxLayout( 0, 0, 6, "BUTTON LAYOUT" );
// Add special buttons for 'cvs commit'.
if ( cmd == CVS::Commit ) {
- autoAddBox = new QCheckBox( i18n( "Auto&matically add files if necessary" ), this );
+ autoAddBox = new TQCheckBox( i18n( "Auto&matically add files if necessary" ), this );
buttons->addWidget( autoAddBox );
}
- buttons->addItem( new QSpacerItem( 1, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
+ buttons->addItem( new TQSpacerItem( 1, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum ) );
// Set the main button's text depending on the CVS comand.
switch ( cmd ) {
@@ -150,33 +150,33 @@ CVSDialog::CVSDialog( CVS::Command cmd, QWidget * parent, KSharedConfig* config
temp = i18n( "&Get Diff" );
break;
}
- mainBtn = new QPushButton( temp, this );
+ mainBtn = new TQPushButton( temp, this );
mainBtn->setDefault( true );
buttons->addWidget( mainBtn );
- cancelBtn = new QPushButton( i18n( "C&ancel" ), this );
+ cancelBtn = new TQPushButton( i18n( "C&ancel" ), this );
buttons->addWidget( cancelBtn );
layout->addLayout( buttons );
- QFrame * line = new QFrame( this );
- line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ TQFrame * line = new TQFrame( this );
+ line->setFrameStyle( TQFrame::HLine | TQFrame::Sunken );
layout->addWidget( line );
- layout->addWidget( new QLabel( i18n( "Command output:" ), this ) );
+ layout->addWidget( new TQLabel( i18n( "Command output:" ), this ) );
- output = new QTextEdit( this );
+ output = new TQTextEdit( this );
output->setReadOnly( true );
layout->addWidget( output );
- resize( QSize( 600, 450 ).expandedTo( minimumSizeHint( ) ) );
+ resize( TQSize( 600, 450 ).expandedTo( minimumSizeHint( ) ) );
if ( cmd == CVS::Commit )
logedit->setFocus( );
readSettings( );
- connect( mainBtn, SIGNAL( clicked( ) ), this, SLOT( slotExecuteCommand( ) ) );
- connect( cancelBtn, SIGNAL( clicked( ) ), this, SLOT( reject( ) ) );
+ connect( mainBtn, TQT_SIGNAL( clicked( ) ), this, TQT_SLOT( slotExecuteCommand( ) ) );
+ connect( cancelBtn, TQT_SIGNAL( clicked( ) ), this, TQT_SLOT( reject( ) ) );
}
void CVSDialog::slotComboActivated( int index )
@@ -197,17 +197,17 @@ void CVSDialog::accept( )
KDialog::accept( );
}
-void CVSDialog::setFiles( const QStringList& files )
+void CVSDialog::setFiles( const TQStringList& files )
{
filebox->insertStringList( files );
}
-void CVSDialog::setCommandLine( const QString& command )
+void CVSDialog::setCommandLine( const TQString& command )
{
_commandLine = command;
}
-void CVSDialog::setAddCommand( const QString& command )
+void CVSDialog::setAddCommand( const TQString& command )
{
_addCommand = command;
}
@@ -228,7 +228,7 @@ void CVSDialog::slotExecuteCommand( )
if ( autoAddBox->isChecked( ) && !_addCommand.isEmpty( ) )
_commandLine.prepend( _addCommand );
- const QString msg( logedit->text() );
+ const TQString msg( logedit->text() );
if ( msg.isEmpty() )
{
@@ -240,7 +240,7 @@ void CVSDialog::slotExecuteCommand( )
}
m_encoding = KGlobal::charsets()->encodingForName( m_encodingComboBox->currentText() );
- QTextCodec* codec = QTextCodec::codecForName( m_encoding.utf8() );
+ TQTextCodec* codec = TQTextCodec::codecForName( m_encoding.utf8() );
if ( !codec )
{
@@ -259,10 +259,10 @@ void CVSDialog::slotExecuteCommand( )
// Write the commit log message from the input field to a temporary file
m_tempFile = new KTempFile;
m_tempFile->setAutoDelete( true );
- QTextStream* stream = m_tempFile->textStream();
+ TQTextStream* stream = m_tempFile->textStream();
if ( !stream )
{
- kdError() << "Could not create QTextStream for file " << m_tempFile->name();
+ kdError() << "Could not create TQTextStream for file " << m_tempFile->name();
delete m_tempFile;
m_tempFile = 0;
KMessageBox::error( this, i18n( "Cannot open temporary file for writing. Aborting.") );
@@ -286,7 +286,7 @@ void CVSDialog::slotExecuteCommand( )
// Update the list of log messages
if ( !msg.isEmpty() ) {
- const QString shortLog = KStringHandler::csqueeze( msg, 80 );
+ const TQString shortLog = KStringHandler::csqueeze( msg, 80 );
// Remove the message from the list if it already exists
@@ -301,12 +301,12 @@ void CVSDialog::slotExecuteCommand( )
// Set the KProcess' command line.
*p << _commandLine;
- connect( p, SIGNAL( receivedStdout( KProcess*, char*, int ) ),
- this, SLOT ( slotProcessStdout( KProcess*, char*, int ) ) );
- connect( p, SIGNAL( receivedStderr( KProcess*, char*, int ) ),
- this, SLOT ( slotProcessStderr( KProcess*, char*, int ) ) );
- connect( p, SIGNAL( processExited( KProcess* ) ),
- this, SLOT( slotProcessExited( KProcess* ) ) );
+ connect( p, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ),
+ this, TQT_SLOT ( slotProcessStdout( KProcess*, char*, int ) ) );
+ connect( p, TQT_SIGNAL( receivedStderr( KProcess*, char*, int ) ),
+ this, TQT_SLOT ( slotProcessStderr( KProcess*, char*, int ) ) );
+ connect( p, TQT_SIGNAL( processExited( KProcess* ) ),
+ this, TQT_SLOT( slotProcessExited( KProcess* ) ) );
output->append( i18n( "[ Starting command ]" ) );
@@ -325,22 +325,22 @@ void CVSDialog::slotExecuteCommand( )
void CVSDialog::slotProcessStdout( KProcess*, char * buffer, int len )
{
- output->append( QString::fromLocal8Bit( buffer, len ) );
+ output->append( TQString::fromLocal8Bit( buffer, len ) );
// Set the cursor's position at the end of the output.
output->setCursorPosition( output->lines( ), 0 );
// If the command is 'cvs status' or 'cvs diff' collect the output of stdout.
if ( (_cmd == CVS::Status) || (_cmd == CVS::Diff) )
- _statusOutput += QString::fromLocal8Bit( buffer, len );
+ _statusOutput += TQString::fromLocal8Bit( buffer, len );
}
void CVSDialog::slotProcessStderr( KProcess*, char * buffer, int len )
{
// If an error occurs while executing the command display stderr in
// another color.
- QColor oldColor( output->color( ) );
+ TQColor oldColor( output->color( ) );
output->setColor( Qt::red );
- output->append( QString::fromLocal8Bit( buffer, len ) );
+ output->append( TQString::fromLocal8Bit( buffer, len ) );
output->setColor( oldColor );
output->setCursorPosition( output->lines( ), 0 );
}
@@ -358,7 +358,7 @@ void CVSDialog::slotProcessExited( KProcess * p )
mainBtn->setText( i18n( "&Show Diff" ) );
else
mainBtn->setText( i18n( "&Close" ) );
- connect( mainBtn, SIGNAL( clicked( ) ), this, SLOT( accept( ) ) );
+ connect( mainBtn, TQT_SIGNAL( clicked( ) ), this, TQT_SLOT( accept( ) ) );
// Reenable the button and the log edit now that the process is finished.
mainBtn->setEnabled( true );
@@ -366,7 +366,7 @@ void CVSDialog::slotProcessExited( KProcess * p )
logedit->setEnabled( true );
}
-QString CVSDialog::statusOutput( )
+TQString CVSDialog::statusOutput( )
{
return _statusOutput;
}
@@ -383,14 +383,14 @@ void CVSDialog::readSettings( )
m_logMessages.clear();
m_squeezedLogMessages.clear();
for ( int cnt = 0; cnt < 10; cnt++ )
- if ( config->hasKey( QString( "CommitLogMessage%1" ).arg( cnt ) ) )
+ if ( config->hasKey( TQString( "CommitLogMessage%1" ).arg( cnt ) ) )
{
- const QString logMessage = config->readEntry( QString( "CommitLogMessage%1" ).arg( cnt ) );
+ const TQString logMessage = config->readEntry( TQString( "CommitLogMessage%1" ).arg( cnt ) );
if ( !logMessage.isEmpty() )
{
// If the message is too long, cut it to 80 characters (or the combo box becomes too wide)
// ### FIXME: if the string matches the squeezed 80 chars, it might overwrite another entry
- const QString shortLog = KStringHandler::csqueeze( logMessage );
+ const TQString shortLog = KStringHandler::csqueeze( logMessage );
m_logMessages.append( logMessage );
m_squeezedLogMessages.append( shortLog );
oldMessages->insertItem( shortLog );
@@ -411,9 +411,9 @@ void CVSDialog::saveSettings( )
// Write the log messages to the config file.
int cnt = 0;
- QStringList::const_iterator it;
+ TQStringList::const_iterator it;
for ( it = m_logMessages.constBegin( ); it != m_logMessages.constEnd( ) && cnt < 10 ; ++it, ++cnt )
- config->writeEntry( QString( "CommitLogMessage%1" ).arg( cnt ), *it );
+ config->writeEntry( TQString( "CommitLogMessage%1" ).arg( cnt ), *it );
config->writeEntry( "CVSEncoding", m_encoding );
}
diff --git a/kbabel/catalogmanager/libcvs/cvsdialog.h b/kbabel/catalogmanager/libcvs/cvsdialog.h
index 658e9883..1ed312fe 100644
--- a/kbabel/catalogmanager/libcvs/cvsdialog.h
+++ b/kbabel/catalogmanager/libcvs/cvsdialog.h
@@ -72,30 +72,30 @@ class CVSDialog : public KDialog
* Constructor for creating the dialog.
* @param cmd The type of command to be executed.
*/
- CVSDialog( CVS::Command cmd, QWidget * parent, KSharedConfig* config );
+ CVSDialog( CVS::Command cmd, TQWidget * parent, KSharedConfig* config );
~CVSDialog();
/**
* Set the list of files which will be used for the CVS command.
* @param files The list of files.
*/
- void setFiles( const QStringList& files );
+ void setFiles( const TQStringList& files );
/**
* Set the command line for the execution of the CVS command.
* @param command The command line.
*/
- void setCommandLine( const QString& command );
+ void setCommandLine( const TQString& command );
/**
* Set the command line for adding files to the CVS repository.
* This method is only used together with a 'cvs commit' for automatically
* adding files which are not yet in the repository.
* @param command The command line.
*/
- void setAddCommand( const QString& command );
+ void setAddCommand( const TQString& command );
/**
* Return the output of a 'cvs status' command.
* @returns The complete output.
*/
- QString statusOutput( );
+ TQString statusOutput( );
protected:
/**
@@ -123,30 +123,30 @@ class CVSDialog : public KDialog
private:
CVS::Command _cmd;
- QPushButton * mainBtn;
- QPushButton * cancelBtn;
- QListBox * filebox;
- QComboBox * oldMessages;
- QTextEdit * logedit;
- QTextEdit * output;
- QCheckBox * autoAddBox;
+ TQPushButton * mainBtn;
+ TQPushButton * cancelBtn;
+ TQListBox * filebox;
+ TQComboBox * oldMessages;
+ TQTextEdit * logedit;
+ TQTextEdit * output;
+ TQCheckBox * autoAddBox;
KProcess * p;
- QString _commandLine;
- QString _addCommand;
- QString _statusOutput;
+ TQString _commandLine;
+ TQString _addCommand;
+ TQString _statusOutput;
/// Log messages (long version)
- QStringList m_logMessages;
+ TQStringList m_logMessages;
/// Log messages (short version)
- QStringList m_squeezedLogMessages;
+ TQStringList m_squeezedLogMessages;
/// Temporary file (for commits)
KTempFile* m_tempFile;
/// Encoding for the commit log message
- QString m_encoding;
+ TQString m_encoding;
/// Combo box for the encoding
KComboBox* m_encodingComboBox;
diff --git a/kbabel/catalogmanager/libcvs/cvshandler.cpp b/kbabel/catalogmanager/libcvs/cvshandler.cpp
index d3f2ae18..66eeac0a 100644
--- a/kbabel/catalogmanager/libcvs/cvshandler.cpp
+++ b/kbabel/catalogmanager/libcvs/cvshandler.cpp
@@ -37,12 +37,12 @@
#include <time.h>
#include <unistd.h>
// Qt include files
-#include <qdir.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qregexp.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
// KDE include files
#include <kapplication.h>
#include <klocale.h>
@@ -52,17 +52,17 @@
#include "cvshandler.h"
-CVSHandler::CVSHandler( const QString& poBaseDir, const QString& potBaseDir )
+CVSHandler::CVSHandler( const TQString& poBaseDir, const TQString& potBaseDir )
{
setPOBaseDir( poBaseDir );
setPOTBaseDir( potBaseDir );
_autoUpdateTemplates = false;
}
-void CVSHandler::setPOBaseDir( const QString& dir )
+void CVSHandler::setPOBaseDir( const TQString& dir )
{
// check if 'CVS/Entries' exists in the PO base directory
- if ( QFileInfo( dir + "/CVS/Entries" ).exists( ) ) {
+ if ( TQFileInfo( dir + "/CVS/Entries" ).exists( ) ) {
_isPORepository = true;
_poBaseDir = dir;
} else
@@ -70,10 +70,10 @@ void CVSHandler::setPOBaseDir( const QString& dir )
emit signalIsPORepository( _isPORepository );
}
-void CVSHandler::setPOTBaseDir( const QString& dir )
+void CVSHandler::setPOTBaseDir( const TQString& dir )
{
// check if 'CVS/Entries' exists in the POT base directory
- if ( QFileInfo( dir + "/CVS/Entries" ).exists( ) ) {
+ if ( TQFileInfo( dir + "/CVS/Entries" ).exists( ) ) {
_isPOTRepository = true;
_potBaseDir = dir;
} else
@@ -81,7 +81,7 @@ void CVSHandler::setPOTBaseDir( const QString& dir )
emit signalIsPOTRepository( _isPOTRepository );
}
-QString CVSHandler::fileStatus( const FileStatus status ) const
+TQString CVSHandler::fileStatus( const FileStatus status ) const
{
switch ( status ) {
case NO_REPOSITORY:
@@ -111,29 +111,29 @@ QString CVSHandler::fileStatus( const FileStatus status ) const
}
}
-CVSHandler::FileStatus CVSHandler::fstatus( const QString& filename ) const
+CVSHandler::FileStatus CVSHandler::fstatus( const TQString& filename ) const
{
// no valid repository
if ( !_isPORepository )
return NO_REPOSITORY;
- QString fn( filename );
- fn = fn.remove( QRegExp( "/$" ) );
+ TQString fn( filename );
+ fn = fn.remove( TQRegExp( "/$" ) );
- QFileInfo info( fn );
+ TQFileInfo info( fn );
// check if 'CVS/Entries' exists and can be read
- QFile entries( info.dir( true ).path( ) + "/CVS/Entries" );
+ TQFile entries( info.dir( true ).path( ) + "/CVS/Entries" );
if ( !entries.open( IO_ReadOnly ) )
return NOT_IN_CVS; // we already know that it's a repository
// ### FIXME: it does not take care of CVS/Entries.Log
// a line in CVS/Entries has the following format:
// [D]/NAME/REVISION/[CONFLICT+]TIMESTAMP/OPTIONS/TAGDATE
- QRegExp rx( QString( "^D?/%1/" ).arg( info.fileName( ) ) );
+ TQRegExp rx( TQString( "^D?/%1/" ).arg( info.fileName( ) ) );
- QString temp;
- QTextStream stream( &entries );
+ TQString temp;
+ TQTextStream stream( &entries );
bool isInRepository = false;
while ( !stream.atEnd() ) {
@@ -149,11 +149,11 @@ CVSHandler::FileStatus CVSHandler::fstatus( const QString& filename ) const
if ( !isInRepository )
return NOT_IN_CVS;
- const QStringList fields = QStringList::split( '/', temp, true );
+ const TQStringList fields = TQStringList::split( '/', temp, true );
// bool isDir = ( fields[0] == "D" );
- const QString cvsname( fields[1] );
- const QString revision( fields[2] );
- const QString timestamp( fields[3] );
+ const TQString cvsname( fields[1] );
+ const TQString revision( fields[2] );
+ const TQString timestamp( fields[3] );
// ignore the other fields for now
if ( revision == "0" && timestamp == "dummy timestamp" )
@@ -167,9 +167,9 @@ CVSHandler::FileStatus CVSHandler::fstatus( const QString& filename ) const
// calculate the UTC time from the file's last modified date
struct stat st;
- lstat( QFile::encodeName(fn), &st );
+ lstat( TQFile::encodeName(fn), &st );
struct tm * tm_p = gmtime( &st.st_mtime );
- QString ftime = QString( asctime( tm_p ) );
+ TQString ftime = TQString( asctime( tm_p ) );
ftime.truncate( ftime.length( ) - 1 );
if ( ftime != timestamp )
return LOCALLY_MODIFIED;
@@ -177,12 +177,12 @@ CVSHandler::FileStatus CVSHandler::fstatus( const QString& filename ) const
return UP_TO_DATE;
}
-QString CVSHandler::cvsStatus( const QString& filename ) const
+TQString CVSHandler::cvsStatus( const TQString& filename ) const
{
return map[filename];
}
-void CVSHandler::execCVSCommand( QWidget* parent, CVS::Command cmd, const QString& filename, bool templates, KSharedConfig* config )
+void CVSHandler::execCVSCommand( TQWidget* parent, CVS::Command cmd, const TQString& filename, bool templates, KSharedConfig* config )
{
if ( !_isPORepository ) {
// This message box should never be visible but who knows... ;-)
@@ -191,16 +191,16 @@ void CVSHandler::execCVSCommand( QWidget* parent, CVS::Command cmd, const QStrin
return;
}
- QFileInfo info( filename );
+ TQFileInfo info( filename );
if ( !info.isDir( ) ) {
- execCVSCommand( parent, cmd, QStringList( filename ), templates, config );
+ execCVSCommand( parent, cmd, TQStringList( filename ), templates, config );
return;
}
- // ### FIXME: instead of making a QString, use KProcess directly, so that it cares about quoting.
+ // ### FIXME: instead of making a TQString, use KProcess directly, so that it cares about quoting.
// ### FIXME: use KProcess::setWorkingDirectory instead of using "cd" (therefore allowing to use KProcess without a shell.)
// it's a dir
- QString command( "cd " + filename + " && cvs " );
+ TQString command( "cd " + filename + " && cvs " );
switch ( cmd ) {
case CVS::Update:
command += "update -dP";
@@ -208,7 +208,7 @@ void CVSHandler::execCVSCommand( QWidget* parent, CVS::Command cmd, const QStrin
case CVS::Commit:
// The cvs client does not care about the encoding, so we cannot set anything here
command += "commit -F @LOG@FILE@";
- checkToAdd( QStringList( filename ) );
+ checkToAdd( TQStringList( filename ) );
break;
case CVS::Status:
command += "status";
@@ -218,10 +218,10 @@ void CVSHandler::execCVSCommand( QWidget* parent, CVS::Command cmd, const QStrin
break;
}
- showDialog( parent, cmd, QStringList( filename ), command, config );
+ showDialog( parent, cmd, TQStringList( filename ), command, config );
}
-void CVSHandler::execCVSCommand( QWidget* parent, CVS::Command cmd, const QStringList& files, bool templates, KSharedConfig* config )
+void CVSHandler::execCVSCommand( TQWidget* parent, CVS::Command cmd, const TQStringList& files, bool templates, KSharedConfig* config )
{
if ( !_isPORepository ) {
// This message box should never be visible but who knows... ;-)
@@ -230,9 +230,9 @@ void CVSHandler::execCVSCommand( QWidget* parent, CVS::Command cmd, const QStrin
return;
}
- // ### FIXME: instead of making a QString, use KProcess directly, so that it cares about quoting.
+ // ### FIXME: instead of making a TQString, use KProcess directly, so that it cares about quoting.
// ### FIXME: use KProcess::setWorkingDirectory instead of using "cd" (therefore allowing to use KProcess without a shell.)
- QString command("cd " + (templates ? _potBaseDir : _poBaseDir) + " && cvs ");
+ TQString command("cd " + (templates ? _potBaseDir : _poBaseDir) + " && cvs ");
switch ( cmd ) {
case CVS::Update:
command += "update -dP";
@@ -249,15 +249,15 @@ void CVSHandler::execCVSCommand( QWidget* parent, CVS::Command cmd, const QStrin
break;
}
- QRegExp rx;
+ TQRegExp rx;
if (templates)
rx.setPattern(_potBaseDir + "/?");
else
rx.setPattern(_poBaseDir + "/?");
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for ( it = files.begin( ); it != files.end( ); ++it ) {
- QString temp = *it;
+ TQString temp = *it;
temp.remove(rx);
command += " \'" + temp + "\'";
}
@@ -270,7 +270,7 @@ void CVSHandler::setAutoUpdateTemplates( bool update )
_autoUpdateTemplates = update;
}
-void CVSHandler::showDialog( QWidget* parent, CVS::Command cmd, const QStringList& files, const QString& commandLine, KSharedConfig* config )
+void CVSHandler::showDialog( TQWidget* parent, CVS::Command cmd, const TQStringList& files, const TQString& commandLine, KSharedConfig* config )
{
CVSDialog * dia = new CVSDialog( cmd, parent, config );
dia->setFiles( files );
@@ -293,30 +293,30 @@ void CVSHandler::showDialog( QWidget* parent, CVS::Command cmd, const QStringLis
emit signalFilesCommitted( files );
}
-void CVSHandler::checkToAdd( const QStringList& files )
+void CVSHandler::checkToAdd( const TQStringList& files )
{
if ( files.isEmpty( ) )
return;
- QStringList toBeAdded;
+ TQStringList toBeAdded;
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for ( it = files.begin( ); it != files.end( ); ++it ) {
// check for every entry if it needs to be added
if ( fstatus( *it ) == NOT_IN_CVS ) {
- QFileInfo info( *it );
- QString temp; // will hold the dir path
+ TQFileInfo info( *it );
+ TQString temp; // will hold the dir path
if ( info.isDir( ) ) {
toBeAdded << *it;
temp = *it;
} else {
toBeAdded << *it;
- temp = QFileInfo( *it ).dirPath( true );
+ temp = TQFileInfo( *it ).dirPath( true );
}
// check recursivlely if parent dirs have to be added as well
while ( fstatus( temp ) == NOT_IN_CVS && toBeAdded.findIndex( temp ) == -1 ) {
toBeAdded << temp;
- temp = QFileInfo( temp ).dirPath( true );
+ temp = TQFileInfo( temp ).dirPath( true );
}
}
}
@@ -329,36 +329,36 @@ void CVSHandler::checkToAdd( const QStringList& files )
// create a command line for adding the files and dirs
for ( it = toBeAdded.begin( ); it != toBeAdded.end( ); ++it ) {
- QFileInfo info( *it );
+ TQFileInfo info( *it );
_addCommand += "cd " + info.dirPath( true ) + " && cvs add " + info.fileName( ) + "; ";
}
}
-void CVSHandler::processStatusOutput( const QString& status )
+void CVSHandler::processStatusOutput( const TQString& status )
{
if ( !_isPORepository )
return;
// at first we need to extract the name of the base directory on the server
- QFile f( _poBaseDir + "/CVS/Root" );
+ TQFile f( _poBaseDir + "/CVS/Root" );
if ( !f.open( IO_ReadOnly ) )
return;
- QTextStream stream( &f );
+ TQTextStream stream( &f );
// extract the string after the last colon in the first line
- QString basedir = stream.readLine( ).section( ':', -1 );
+ TQString basedir = stream.readLine( ).section( ':', -1 );
f.close( );
// divide the complete status output in little chunks for every file
- QStringList entries = QStringList::split( QRegExp( "={67,67}" ), status );
- QStringList::Iterator it;
+ TQStringList entries = TQStringList::split( TQRegExp( "={67,67}" ), status );
+ TQStringList::Iterator it;
for ( it = entries.begin( ); it != entries.end( ); ++it ) {
- QString entr = *it;
+ TQString entr = *it;
// translate the filename from repository to local
- QRegExp rx( basedir + ".*,v" );
+ TQRegExp rx( basedir + ".*,v" );
int pos = entr.find( rx );
- QString file = _poBaseDir + entr.mid( pos + basedir.length( ),
+ TQString file = _poBaseDir + entr.mid( pos + basedir.length( ),
rx.matchedLength( ) - basedir.length( ) - 2 );
entr = "<qt>" + entr + "</qt>";
@@ -369,16 +369,16 @@ void CVSHandler::processStatusOutput( const QString& status )
}
}
-void CVSHandler::processDiff( QString output )
+void CVSHandler::processDiff( TQString output )
{
- output.remove( QRegExp( "\\[ .* \\]$" ));
- output.remove( QRegExp( "^" + i18n("[ Starting command ]" ).replace("[","\\[").replace("]","\\]")));
+ output.remove( TQRegExp( "\\[ .* \\]$" ));
+ output.remove( TQRegExp( "^" + i18n("[ Starting command ]" ).replace("[","\\[").replace("]","\\]")));
KTempFile tmpFile;
*(tmpFile.textStream()) << output;
tmpFile.close();
- QString error;
+ TQString error;
if ( KApplication::startServiceByName( "Kompare", tmpFile.name(), &error ) )
KMessageBox::error( 0, error );
}
diff --git a/kbabel/catalogmanager/libcvs/cvshandler.h b/kbabel/catalogmanager/libcvs/cvshandler.h
index 44777aa3..8157a895 100644
--- a/kbabel/catalogmanager/libcvs/cvshandler.h
+++ b/kbabel/catalogmanager/libcvs/cvshandler.h
@@ -36,8 +36,8 @@
#define CVSHANDLER_H
// Qt include files
-#include <qmap.h>
-#include <qobject.h>
+#include <tqmap.h>
+#include <tqobject.h>
// Project specific include files
#include "cvsdialog.h"
#include "cvsresources.h"
@@ -69,17 +69,17 @@ class CVSHandler : public QObject
UP_TO_DATE
};
- CVSHandler( const QString& poBaseDir = QString::null, const QString& potBaseDir = QString::null );
+ CVSHandler( const TQString& poBaseDir = TQString::null, const TQString& potBaseDir = TQString::null );
- void setPOBaseDir( const QString& dir );
- void setPOTBaseDir( const QString& dir );
+ void setPOBaseDir( const TQString& dir );
+ void setPOTBaseDir( const TQString& dir );
- FileStatus fstatus( const QString& filename ) const;
- QString fileStatus( const FileStatus status ) const;
- QString cvsStatus( const QString& filename ) const;
+ FileStatus fstatus( const TQString& filename ) const;
+ TQString fileStatus( const FileStatus status ) const;
+ TQString cvsStatus( const TQString& filename ) const;
- void execCVSCommand( QWidget* parent, CVS::Command cmd, const QString& filename, bool templates, KSharedConfig* config );
- void execCVSCommand( QWidget* parent, CVS::Command cmd, const QStringList& files, bool templates, KSharedConfig* config );
+ void execCVSCommand( TQWidget* parent, CVS::Command cmd, const TQString& filename, bool templates, KSharedConfig* config );
+ void execCVSCommand( TQWidget* parent, CVS::Command cmd, const TQStringList& files, bool templates, KSharedConfig* config );
void setAutoUpdateTemplates( bool update );
@@ -91,24 +91,24 @@ class CVSHandler : public QObject
signals:
void signalIsPORepository( bool );
void signalIsPOTRepository( bool );
- void signalFilesCommitted( const QStringList& );
+ void signalFilesCommitted( const TQStringList& );
private:
- void showDialog( QWidget* parent, CVS::Command cmd, const QStringList& files, const QString& commandLine, KSharedConfig* config );
- void checkToAdd( const QStringList& files );
- void processStatusOutput( const QString& status );
- void processDiff( QString output );
+ void showDialog( TQWidget* parent, CVS::Command cmd, const TQStringList& files, const TQString& commandLine, KSharedConfig* config );
+ void checkToAdd( const TQStringList& files );
+ void processStatusOutput( const TQString& status );
+ void processDiff( TQString output );
private:
- QString _poBaseDir;
- QString _potBaseDir;
+ TQString _poBaseDir;
+ TQString _potBaseDir;
bool _isPORepository;
bool _isPOTRepository;
bool _autoUpdateTemplates;
- QString _addCommand;
+ TQString _addCommand;
/** Mapping the output of 'cvs status' against the filename. */
- QMap<QString,QString> map;
+ TQMap<TQString,TQString> map;
};
#endif // CVSHANDLER_H