summaryrefslogtreecommitdiffstats
path: root/kbabel/catalogmanager/libsvn
diff options
context:
space:
mode:
Diffstat (limited to 'kbabel/catalogmanager/libsvn')
-rw-r--r--kbabel/catalogmanager/libsvn/svndialog.cpp120
-rw-r--r--kbabel/catalogmanager/libsvn/svndialog.h34
-rw-r--r--kbabel/catalogmanager/libsvn/svnhandler.cpp152
-rw-r--r--kbabel/catalogmanager/libsvn/svnhandler.h52
4 files changed, 179 insertions, 179 deletions
diff --git a/kbabel/catalogmanager/libsvn/svndialog.cpp b/kbabel/catalogmanager/libsvn/svndialog.cpp
index 69653591..a6f7d229 100644
--- a/kbabel/catalogmanager/libsvn/svndialog.cpp
+++ b/kbabel/catalogmanager/libsvn/svndialog.cpp
@@ -33,17 +33,17 @@
// 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 <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>
// KDE include files
#include <kconfig.h>
#include <kdebug.h>
@@ -57,16 +57,16 @@
#include "svndialog.h"
-SVNDialog::SVNDialog( SVN::Command cmd, QWidget * parent, KSharedConfig* config )
+SVNDialog::SVNDialog( SVN::Command cmd, TQWidget * parent, KSharedConfig* config )
: KDialog( parent, "SVN DIALOG", true ), m_tempFile( 0 ), m_config( config )
{
_cmd = cmd;
p=0L;
setCaption( i18n( "SVN 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 SVN command.
switch ( cmd ) {
@@ -89,42 +89,42 @@ SVNDialog::SVNDialog( SVN::Command cmd, QWidget * parent, KSharedConfig* config
temp = i18n( "Get information 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 'svn commit'.
if ( cmd == SVN::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 );
- 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 'svn commit'.
if ( cmd == SVN::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 SVN comand.
switch ( cmd ) {
@@ -145,33 +145,33 @@ SVNDialog::SVNDialog( SVN::Command cmd, QWidget * parent, KSharedConfig* config
temp = i18n( "&Get Information" );
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 == SVN::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 SVNDialog::slotComboActivated( int index )
@@ -193,17 +193,17 @@ void SVNDialog::accept( )
KDialog::accept( );
}
-void SVNDialog::setFiles( const QStringList& files )
+void SVNDialog::setFiles( const TQStringList& files )
{
filebox->insertStringList( files );
}
-void SVNDialog::setCommandLine( const QString& command )
+void SVNDialog::setCommandLine( const TQString& command )
{
_commandLine = command;
}
-void SVNDialog::setAddCommand( const QString& command )
+void SVNDialog::setAddCommand( const TQString& command )
{
_addCommand = command;
}
@@ -224,7 +224,7 @@ void SVNDialog::slotExecuteCommand( )
if ( autoAddBox->isChecked( ) && !_addCommand.isEmpty( ) )
_commandLine.prepend( _addCommand );
- const QString msg( logedit->text() );
+ const TQString msg( logedit->text() );
if ( msg.isEmpty() )
{
@@ -238,16 +238,16 @@ void SVNDialog::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.") );
return;
}
- stream->setEncoding( QTextStream::UnicodeUTF8 );
+ stream->setEncoding( TQTextStream::UnicodeUTF8 );
*stream << msg;
m_tempFile->close();
@@ -265,7 +265,7 @@ void SVNDialog::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
@@ -280,12 +280,12 @@ void SVNDialog::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 ]" ) );
@@ -304,22 +304,22 @@ void SVNDialog::slotExecuteCommand( )
void SVNDialog::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 'svn status' or 'svn diff' collect the output of stdout.
if ( ( _cmd == SVN::StatusLocal ) || ( _cmd == SVN::StatusRemote ) || ( _cmd == SVN::Diff ) )
- _statusOutput += QString::fromLocal8Bit( buffer, len );
+ _statusOutput += TQString::fromLocal8Bit( buffer, len );
}
void SVNDialog::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 );
}
@@ -337,7 +337,7 @@ void SVNDialog::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 );
@@ -345,7 +345,7 @@ void SVNDialog::slotProcessExited( KProcess * p )
logedit->setEnabled( true );
}
-QString SVNDialog::statusOutput( )
+TQString SVNDialog::statusOutput( )
{
return _statusOutput;
}
@@ -362,14 +362,14 @@ void SVNDialog::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 );
@@ -388,9 +388,9 @@ void SVNDialog::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 );
}
m_config->sync();
}
diff --git a/kbabel/catalogmanager/libsvn/svndialog.h b/kbabel/catalogmanager/libsvn/svndialog.h
index 0c824fa8..23ec6a7e 100644
--- a/kbabel/catalogmanager/libsvn/svndialog.h
+++ b/kbabel/catalogmanager/libsvn/svndialog.h
@@ -71,30 +71,30 @@ class SVNDialog : public KDialog
* Constructor for creating the dialog.
* @param cmd The type of command to be executed.
*/
- SVNDialog( SVN::Command cmd, QWidget * parent, KSharedConfig* config );
+ SVNDialog( SVN::Command cmd, TQWidget * parent, KSharedConfig* config );
~SVNDialog();
/**
* Set the list of files which will be used for the SVN 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 SVN 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 SVN repository.
* This method is only used together with a 'svn 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 'svn status' command.
* @returns The complete output.
*/
- QString statusOutput( );
+ TQString statusOutput( );
protected:
/**
@@ -122,24 +122,24 @@ class SVNDialog : public KDialog
private:
SVN::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;
diff --git a/kbabel/catalogmanager/libsvn/svnhandler.cpp b/kbabel/catalogmanager/libsvn/svnhandler.cpp
index 8117fe62..1ac98f66 100644
--- a/kbabel/catalogmanager/libsvn/svnhandler.cpp
+++ b/kbabel/catalogmanager/libsvn/svnhandler.cpp
@@ -37,13 +37,13 @@
#include <sys/stat.h>
#include <time.h>
// Qt include files
-#include <qdir.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qregexp.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qdom.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqdom.h>
// KDE include files
#include <kapplication.h>
#include <klocale.h>
@@ -54,17 +54,17 @@
// project specific include files
#include "svnhandler.h"
-SVNHandler::SVNHandler( const QString& poBaseDir, const QString& potBaseDir )
+SVNHandler::SVNHandler( const TQString& poBaseDir, const TQString& potBaseDir )
{
setPOBaseDir( poBaseDir );
setPOTBaseDir( potBaseDir );
_autoUpdateTemplates = false;
}
-void SVNHandler::setPOBaseDir( const QString& dir )
+void SVNHandler::setPOBaseDir( const TQString& dir )
{
// check if '.svn/entries' exists in the PO base directory
- if ( QFileInfo( dir + "/.svn/entries" ).exists( ) ) {
+ if ( TQFileInfo( dir + "/.svn/entries" ).exists( ) ) {
_isPORepository = true;
_poBaseDir = dir;
} else
@@ -72,10 +72,10 @@ void SVNHandler::setPOBaseDir( const QString& dir )
emit signalIsPORepository( _isPORepository );
}
-void SVNHandler::setPOTBaseDir( const QString& dir )
+void SVNHandler::setPOTBaseDir( const TQString& dir )
{
// check if '.svn/entries' exists in the POT base directory
- if ( QFileInfo( dir + "/.svn/entries" ).exists( ) ) {
+ if ( TQFileInfo( dir + "/.svn/entries" ).exists( ) ) {
_isPOTRepository = true;
_potBaseDir = dir;
} else
@@ -83,7 +83,7 @@ void SVNHandler::setPOTBaseDir( const QString& dir )
emit signalIsPOTRepository( _isPOTRepository );
}
-QString SVNHandler::fileStatus( const FileStatus status ) const
+TQString SVNHandler::fileStatus( const FileStatus status ) const
{
switch ( status ) {
case NO_REPOSITORY:
@@ -115,19 +115,19 @@ QString SVNHandler::fileStatus( const FileStatus status ) const
}
}
-SVNHandler::FileStatus SVNHandler::fstatus( const QString& filename ) const
+SVNHandler::FileStatus SVNHandler::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 '.svn/entries' exists.
- QFile entries( info.dir( true ).path( ) + "/.svn/entries" );
+ TQFile entries( info.dir( true ).path( ) + "/.svn/entries" );
if ( !entries.exists() )
return NOT_IN_SVN;
@@ -140,12 +140,12 @@ SVNHandler::FileStatus SVNHandler::fstatus( const QString& filename ) const
if( !proc.start( KProcess::Block, KProcess::Stdout ) )
return ERROR_IN_WC;
- QDomDocument doc;
- QString errorMsg;
+ TQDomDocument doc;
+ TQString errorMsg;
int errorLine, errorCol;
- QDomNodeList nodelist;
- QDomNode node;
- QDomElement entry, wcStatus;
+ TQDomNodeList nodelist;
+ TQDomNode node;
+ TQDomElement entry, wcStatus;
// Parse the output.
if ( !doc.setContent( out.getOutput(), &errorMsg, &errorLine, &errorCol ) ) {
@@ -211,11 +211,11 @@ no_status_xml:
}
entries.close();
- QDomElement element;
+ TQDomElement element;
// File name that we are searching
- const QString findName = info.fileName();
+ const TQString findName = info.fileName();
// The entries are <entry> elements, so we have to check them
- QDomNode child = doc.documentElement().firstChild();
+ TQDomNode child = doc.documentElement().firstChild();
for ( ; !child.isNull() ; child = child.nextSibling() )
{
if ( !child.isElement() )
@@ -226,7 +226,7 @@ no_status_xml:
// Should not happend with svn 1.1.x
continue;
}
- const QString name = element.attribute("name");
+ const TQString name = element.attribute("name");
if ( name == findName )
break;
}
@@ -239,7 +239,7 @@ no_status_xml:
// ### TODO: should we check the attribute kind to be file and not dir?
// ### TODO: what do copy and move add here?
- const QString onSchedule = element.attribute( "schedule" );
+ const TQString onSchedule = element.attribute( "schedule" );
if ( onSchedule == "delete" )
return LOCALLY_REMOVED;
else if ( onSchedule == "added" )
@@ -250,15 +250,15 @@ no_status_xml:
}
// Note: we do not check the property time stamp
- const QString textTimeStamp( element.attribute( "text-time" ) );
+ const TQString textTimeStamp( element.attribute( "text-time" ) );
// 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 );
const int year = tm_p->tm_year + 1900;
const int month = tm_p->tm_mon + 1;
- QString fileTime;
+ TQString fileTime;
fileTime.sprintf( "%04i-%02i-%02iT%02i:%02i:%02i.000000Z",
year, month, tm_p->tm_mday, tm_p->tm_hour, tm_p->tm_min, tm_p->tm_sec );
//kdDebug() << "File: " << filename << " SVN time: " << textTimeStamp << " File time: " << fileTime << endl;
@@ -269,19 +269,19 @@ no_status_xml:
}
-QString SVNHandler::svnStatus( const QString& filename ) const
+TQString SVNHandler::svnStatus( const TQString& filename ) const
{
return map[filename];
}
-void SVNHandler::execSVNCommand( QWidget* parent, SVN::Command cmd, const QString& filename, bool templates, KSharedConfig* config)
+void SVNHandler::execSVNCommand( TQWidget* parent, SVN::Command cmd, const TQString& filename, bool templates, KSharedConfig* config)
{
// Unlike cvs, svn works also from outside the repository(as long as the path is in a repository of course!)
// ### FIXME: wrong, svn commit cannot work if the current directory is not a SVN one
- execSVNCommand( parent, cmd, QStringList( filename ), templates, config );
+ execSVNCommand( parent, cmd, TQStringList( filename ), templates, config );
}
-void SVNHandler::execSVNCommand( QWidget* parent, SVN::Command cmd, const QStringList& files, bool templates, KSharedConfig* config )
+void SVNHandler::execSVNCommand( TQWidget* parent, SVN::Command cmd, const TQStringList& files, bool templates, KSharedConfig* config )
{
if ( !_isPORepository ) {
// This message box should never be visible but who knows... ;-)
@@ -290,9 +290,9 @@ void SVNHandler::execSVNCommand( QWidget* parent, SVN::Command cmd, const QStrin
return;
}
- // ### TODO: instead of making a QString, use KProcess directly, so that it cares about quoting.
+ // ### TODO: instead of making a TQString, use KProcess directly, so that it cares about quoting.
// ### TODO: use KProcess::setWorkingDirectory instead of using "cd" (therefore allowing to use KProcess without a shell.)
- QString command("cd " + (templates ? _potBaseDir : _poBaseDir) + " && svn ");
+ TQString command("cd " + (templates ? _potBaseDir : _poBaseDir) + " && svn ");
switch ( cmd ) {
case SVN::Update:
command += "update --non-interactive";
@@ -315,15 +315,15 @@ void SVNHandler::execSVNCommand( QWidget* parent, SVN::Command cmd, const QStrin
command += "info"; // Does not allow --non-interactive (at least svn 1.1.4).
}
- 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 + "\'";
}
@@ -336,7 +336,7 @@ void SVNHandler::setAutoUpdateTemplates( bool update )
_autoUpdateTemplates = update;
}
-void SVNHandler::showDialog( QWidget* parent, SVN::Command cmd, const QStringList& files, const QString& commandLine, KSharedConfig* config )
+void SVNHandler::showDialog( TQWidget* parent, SVN::Command cmd, const TQStringList& files, const TQString& commandLine, KSharedConfig* config )
{
SVNDialog * dia = new SVNDialog( cmd, parent, config );
dia->setFiles( files );
@@ -359,7 +359,7 @@ void SVNHandler::showDialog( QWidget* parent, SVN::Command cmd, const QStringLis
emit signalFilesCommitted( files );
}
-bool SVNHandler::isInSvn( const QString& path )
+bool SVNHandler::isInSvn( const TQString& path )
{
if ( path.isEmpty() )
return false;
@@ -375,57 +375,57 @@ bool SVNHandler::isInSvn( const QString& path )
* - for a file: check if there is a corresponding file in .svn/text-base/
*/
- const QFileInfo info( path );
+ const TQFileInfo info( path );
if ( info.isDir() ) {
// It is a directory, so find a .svn/entries file
- QDir dir( path );
+ TQDir dir( path );
return dir.exists( ".svn/entries", true );
}
else {
// It is a file, so find the corresponding file in .svn/text-base
- QDir dir( info.dirPath() );
+ TQDir dir( info.dirPath() );
if ( ! dir.cd( ".svn/text-base" ) ) {
// There is not even a .svn/text-base directory, so the file is not under control
return false;
}
- const QString textBaseFilename( info.fileName() + ".svn-base" );
+ const TQString textBaseFilename( info.fileName() + ".svn-base" );
return dir.exists( textBaseFilename, true );
}
}
-void SVNHandler::checkToAdd( const QStringList& files )
+void SVNHandler::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 ( ! isInSvn( *it ) ) {
- 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 );
}
// ### TODO: does SVN really needs this or does it do it automatically?
// check recursivlely if parent dirs have to be added as well
while ( ! isInSvn( temp ) && toBeAdded.findIndex( temp ) == -1 ) {
toBeAdded << temp;
- temp = QFileInfo( temp ).dirPath( true );
+ temp = TQFileInfo( temp ).dirPath( true );
}
}
}
// remove an old command
- _addCommand = QString();
+ _addCommand = TQString();
// ### TODO: does SVN really need this?
// make sure the directories are added before the files
@@ -434,38 +434,38 @@ void SVNHandler::checkToAdd( const QStringList& files )
// ### TODO: try to make this better
// 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 ) + " && svn add " + info.fileName( ) + "; ";
}
}
// ### TODO: convert to SVN
-void SVNHandler::processStatusOutput( const QString& status )
+void SVNHandler::processStatusOutput( const TQString& status )
{
if ( !_isPORepository )
return;
#if 0
// at first we need to extract the name of the base directory on the server
- QFile f( _poBaseDir + "/SVN/Root" ); // ### FIXME
+ TQFile f( _poBaseDir + "/SVN/Root" ); // ### FIXME
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>";
@@ -477,16 +477,16 @@ void SVNHandler::processStatusOutput( const QString& status )
#endif
}
-void SVNHandler::processDiff( QString output )
+void SVNHandler::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 );
}
@@ -516,10 +516,10 @@ void SVNOutputCollector::setProcess( KProcess* p )
m_process = p;
if( p ) {
- connect( p, SIGNAL(receivedStdout(KProcess*, char*, int)),
- this, SLOT(slotGatherStdout(KProcess*, char*, int)) );
- connect( p, SIGNAL(receivedStderr(KProcess*, char*, int)),
- this, SLOT(slotGatherStderr(KProcess*, char*, int)) );
+ connect( p, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)),
+ this, TQT_SLOT(slotGatherStdout(KProcess*, char*, int)) );
+ connect( p, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)),
+ this, TQT_SLOT(slotGatherStderr(KProcess*, char*, int)) );
}
m_gatheredOutput.truncate( 0 );
@@ -529,14 +529,14 @@ void SVNOutputCollector::setProcess( KProcess* p )
void SVNOutputCollector::slotGatherStderr( KProcess*, char* data, int len )
{
- m_gatheredOutput.append( QString::fromLocal8Bit( data, len ) );
- m_stderrOutput.append( QString::fromLocal8Bit( data, len ) );
+ m_gatheredOutput.append( TQString::fromLocal8Bit( data, len ) );
+ m_stderrOutput.append( TQString::fromLocal8Bit( data, len ) );
}
void SVNOutputCollector::slotGatherStdout( KProcess*, char* data, int len )
{
- m_gatheredOutput.append( QString::fromLocal8Bit( data, len ) );
- m_stdoutOutput.append( QString::fromLocal8Bit( data, len ) );
+ m_gatheredOutput.append( TQString::fromLocal8Bit( data, len ) );
+ m_stdoutOutput.append( TQString::fromLocal8Bit( data, len ) );
}
#include "svnhandler.moc"
diff --git a/kbabel/catalogmanager/libsvn/svnhandler.h b/kbabel/catalogmanager/libsvn/svnhandler.h
index 67c86d73..4933cb92 100644
--- a/kbabel/catalogmanager/libsvn/svnhandler.h
+++ b/kbabel/catalogmanager/libsvn/svnhandler.h
@@ -36,8 +36,8 @@
#define SVNHANDLER_H
// Qt include files
-#include <qmap.h>
-#include <qobject.h>
+#include <tqmap.h>
+#include <tqobject.h>
// Project specific include files
#include "svndialog.h"
#include "svnresources.h"
@@ -68,17 +68,17 @@ class SVNHandler : public QObject
ERROR_IN_WC ///< The working copy has data that cannot be handled
};
- SVNHandler( const QString& poBaseDir = QString::null, const QString& potBaseDir = QString::null );
+ SVNHandler( 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 svnStatus( const QString& filename ) const;
+ FileStatus fstatus( const TQString& filename ) const;
+ TQString fileStatus( const FileStatus status ) const;
+ TQString svnStatus( const TQString& filename ) const;
- void execSVNCommand( QWidget* parent, SVN::Command cmd, const QString& filename, bool templates, KSharedConfig* config );
- void execSVNCommand( QWidget* parent, SVN::Command cmd, const QStringList& files, bool templates, KSharedConfig* config );
+ void execSVNCommand( TQWidget* parent, SVN::Command cmd, const TQString& filename, bool templates, KSharedConfig* config );
+ void execSVNCommand( TQWidget* parent, SVN::Command cmd, const TQStringList& files, bool templates, KSharedConfig* config );
void setAutoUpdateTemplates( bool update );
@@ -90,26 +90,26 @@ class SVNHandler : public QObject
signals:
void signalIsPORepository( bool );
void signalIsPOTRepository( bool );
- void signalFilesCommitted( const QStringList& );
+ void signalFilesCommitted( const TQStringList& );
private:
- void showDialog( QWidget* parent, SVN::Command cmd, const QStringList& files, const QString& commandLine, KSharedConfig* config );
+ void showDialog( TQWidget* parent, SVN::Command cmd, const TQStringList& files, const TQString& commandLine, KSharedConfig* config );
/// Check quickly if the file is part of a SVN repository
- bool isInSvn( const QString& path );
- void checkToAdd( const QStringList& files );
- void processStatusOutput( const QString& status );
- void processDiff( QString output );
+ bool isInSvn( const TQString& path );
+ 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 'svn status' against the filename. */
- QMap<QString,QString> map;
+ TQMap<TQString,TQString> map;
};
class SVNOutputCollector: public QObject
@@ -120,18 +120,18 @@ class SVNOutputCollector: public QObject
SVNOutputCollector( KProcess* );
void setProcess( KProcess* );
- const QString& getOutput() const { return m_gatheredOutput; }
- const QString& getStderr() const { return m_stderrOutput; }
- const QString& getStdout() const { return m_stdoutOutput; }
+ const TQString& getOutput() const { return m_gatheredOutput; }
+ const TQString& getStderr() const { return m_stderrOutput; }
+ const TQString& getStdout() const { return m_stdoutOutput; }
private slots:
void slotGatherStderr( KProcess*, char*, int );
void slotGatherStdout( KProcess*, char*, int );
private:
- QString m_gatheredOutput;
- QString m_stderrOutput;
- QString m_stdoutOutput;
+ TQString m_gatheredOutput;
+ TQString m_stderrOutput;
+ TQString m_stdoutOutput;
KProcess* m_process;
};