diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-12 01:36:19 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-12 01:36:19 +0000 |
commit | 99a2774ca6f1cab334de5d43fe36fc44ae889a4c (patch) | |
tree | eff34cf0762227f6baf2a93e8fef48d4bed2651c /kbabel/catalogmanager/libsvn | |
parent | 1c104292188541106338d4940b0f04beeb4301a0 (diff) | |
download | tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.tar.gz tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.zip |
TQt4 convert kdesdk
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1236185 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/catalogmanager/libsvn')
-rw-r--r-- | kbabel/catalogmanager/libsvn/svndialog.cpp | 52 | ||||
-rw-r--r-- | kbabel/catalogmanager/libsvn/svndialog.h | 11 | ||||
-rw-r--r-- | kbabel/catalogmanager/libsvn/svnhandler.cpp | 58 | ||||
-rw-r--r-- | kbabel/catalogmanager/libsvn/svnhandler.h | 34 | ||||
-rw-r--r-- | kbabel/catalogmanager/libsvn/svnresources.h | 6 |
5 files changed, 82 insertions, 79 deletions
diff --git a/kbabel/catalogmanager/libsvn/svndialog.cpp b/kbabel/catalogmanager/libsvn/svndialog.cpp index a6f7d229..e6cb76e5 100644 --- a/kbabel/catalogmanager/libsvn/svndialog.cpp +++ b/kbabel/catalogmanager/libsvn/svndialog.cpp @@ -20,11 +20,11 @@ In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked + the TQt library by Trolltech AS, Norway (or with modified versions + of TQt that use the same license as TQt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to + TQt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. @@ -32,7 +32,7 @@ **************************************************************************** */ -// Qt include files +// TQt include files #include <tqcheckbox.h> #include <tqcombobox.h> #include <tqfileinfo.h> @@ -57,8 +57,8 @@ #include "svndialog.h" -SVNDialog::SVNDialog( SVN::Command cmd, TQWidget * parent, KSharedConfig* config ) - : KDialog( parent, "SVN DIALOG", true ), m_tempFile( 0 ), m_config( config ) +SVNDialog::SVNDialog( SVN::Command cmd, TQWidget * tqparent, KSharedConfig* config ) + : KDialog( tqparent, "SVN DIALOG", true ), m_tempFile( 0 ), m_config( config ) { _cmd = cmd; p=0L; @@ -66,7 +66,7 @@ SVNDialog::SVNDialog( SVN::Command cmd, TQWidget * parent, KSharedConfig* config TQString temp; - TQVBoxLayout * layout = new TQVBoxLayout( this, 6, 6, "MAIN LAYOUT" ); + TQVBoxLayout * tqlayout = new TQVBoxLayout( this, 6, 6, "MAIN LAYOUT" ); // Set the label's text depending on the SVN command. switch ( cmd ) { @@ -89,11 +89,11 @@ SVNDialog::SVNDialog( SVN::Command cmd, TQWidget * parent, KSharedConfig* config temp = i18n( "Get information for the following files:" ); break; } - layout->addWidget( new TQLabel( temp, this ) ); + tqlayout->addWidget( new TQLabel( temp, this ) ); // Widget for showing the list of files. filebox = new TQListBox( this ); - layout->addWidget( filebox ); + tqlayout->addWidget( filebox ); // Add special widgets for 'svn commit'. if ( cmd == SVN::Commit ) { @@ -104,15 +104,15 @@ SVNDialog::SVNDialog( SVN::Command cmd, TQWidget * parent, KSharedConfig* config oldMessages = new TQComboBox( this ); oldMessages->setDuplicatesEnabled( false ); label->setBuddy( oldMessages ); - layout->addWidget( label ); - layout->addWidget( oldMessages ); + tqlayout->addWidget( label ); + tqlayout->addWidget( oldMessages ); // Textfield for entering a log message. label = new TQLabel( i18n( "&Log message:" ), this ); logedit = new TQTextEdit( this ); label->setBuddy( logedit ); - layout->addWidget( label ); - layout->addWidget( logedit ); + tqlayout->addWidget( label ); + tqlayout->addWidget( logedit ); connect( oldMessages, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotComboActivated( int ) ) ); @@ -136,7 +136,7 @@ SVNDialog::SVNDialog( SVN::Command cmd, TQWidget * parent, KSharedConfig* config break; case SVN::StatusRemote: case SVN::StatusLocal: - temp = i18n( "&Get Status" ); + temp = i18n( "&Get tqStatus" ); break; case SVN::Diff: temp = i18n( "&Get Diff" ); @@ -151,19 +151,19 @@ SVNDialog::SVNDialog( SVN::Command cmd, TQWidget * parent, KSharedConfig* config cancelBtn = new TQPushButton( i18n( "C&ancel" ), this ); buttons->addWidget( cancelBtn ); - layout->addLayout( buttons ); + tqlayout->addLayout( buttons ); TQFrame * line = new TQFrame( this ); line->setFrameStyle( TQFrame::HLine | TQFrame::Sunken ); - layout->addWidget( line ); + tqlayout->addWidget( line ); - layout->addWidget( new TQLabel( i18n( "Command output:" ), this ) ); + tqlayout->addWidget( new TQLabel( i18n( "Command output:" ), this ) ); output = new TQTextEdit( this ); output->setReadOnly( true ); - layout->addWidget( output ); + tqlayout->addWidget( output ); - resize( TQSize( 600, 450 ).expandedTo( minimumSizeHint( ) ) ); + resize( TQSize( 600, 450 ).expandedTo( tqminimumSizeHint( ) ) ); if ( cmd == SVN::Commit ) logedit->setFocus( ); @@ -261,7 +261,7 @@ void SVNDialog::slotExecuteCommand( ) } // Change the command line to have the real name of the temporary file - _commandLine.replace( "@LOG@FILE@", KProcess::quote( m_tempFile->name() ) ); + _commandLine.tqreplace( "@LOG@FILE@", KProcess::quote( m_tempFile->name() ) ); // Update the list of log messages if ( !msg.isEmpty() ) { @@ -318,7 +318,7 @@ void SVNDialog::slotProcessStderr( KProcess*, char * buffer, int len ) // If an error occurs while executing the command display stderr in // another color. TQColor oldColor( output->color( ) ); - output->setColor( Qt::red ); + output->setColor( TQt::red ); output->append( TQString::fromLocal8Bit( buffer, len ) ); output->setColor( oldColor ); output->setCursorPosition( output->lines( ), 0 ); @@ -327,7 +327,7 @@ void SVNDialog::slotProcessStderr( KProcess*, char * buffer, int len ) void SVNDialog::slotProcessExited( KProcess * p ) { if ( p->exitStatus( ) ) - output->append( i18n( "[ Exited with status %1 ]" ).arg( p->exitStatus( ) ) ); + output->append( i18n( "[ Exited with status %1 ]" ).tqarg( p->exitStatus( ) ) ); else output->append( i18n( "[ Finished ]" ) ); @@ -362,9 +362,9 @@ void SVNDialog::readSettings( ) m_logMessages.clear(); m_squeezedLogMessages.clear(); for ( int cnt = 0; cnt < 10; cnt++ ) - if ( config->hasKey( TQString( "CommitLogMessage%1" ).arg( cnt ) ) ) + if ( config->hasKey( TQString( "CommitLogMessage%1" ).tqarg( cnt ) ) ) { - const TQString logMessage = config->readEntry( TQString( "CommitLogMessage%1" ).arg( cnt ) ); + const TQString logMessage = config->readEntry( TQString( "CommitLogMessage%1" ).tqarg( cnt ) ); if ( !logMessage.isEmpty() ) { // If the message is too long, cut it to 80 characters (or the combo box becomes too wide) @@ -390,11 +390,11 @@ void SVNDialog::saveSettings( ) int cnt = 0; TQStringList::const_iterator it; for ( it = m_logMessages.constBegin( ); it != m_logMessages.constEnd( ) && cnt < 10 ; ++it, ++cnt ) - config->writeEntry( TQString( "CommitLogMessage%1" ).arg( cnt ), *it ); + config->writeEntry( TQString( "CommitLogMessage%1" ).tqarg( cnt ), *it ); } m_config->sync(); } #include "svndialog.moc" -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kbabel/catalogmanager/libsvn/svndialog.h b/kbabel/catalogmanager/libsvn/svndialog.h index d1ca2d16..55c57f27 100644 --- a/kbabel/catalogmanager/libsvn/svndialog.h +++ b/kbabel/catalogmanager/libsvn/svndialog.h @@ -20,11 +20,11 @@ In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked + the TQt library by Trolltech AS, Norway (or with modified versions + of TQt that use the same license as TQt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to + TQt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. @@ -39,7 +39,7 @@ #include <kdialog.h> // Project specific include files #include "svnresources.h" -// Forwarding Qt classes +// Forwarding TQt classes class TQCheckBox; class TQComboBox; class TQListBox; @@ -65,13 +65,14 @@ class KSharedConfig; class SVNDialog : public KDialog { Q_OBJECT + TQ_OBJECT public: /** * Constructor for creating the dialog. * @param cmd The type of command to be executed. */ - SVNDialog( SVN::Command cmd, TQWidget * parent, KSharedConfig* config ); + SVNDialog( SVN::Command cmd, TQWidget * tqparent, KSharedConfig* config ); ~SVNDialog(); /** * Set the list of files which will be used for the SVN command. diff --git a/kbabel/catalogmanager/libsvn/svnhandler.cpp b/kbabel/catalogmanager/libsvn/svnhandler.cpp index 1ac98f66..c648c2bb 100644 --- a/kbabel/catalogmanager/libsvn/svnhandler.cpp +++ b/kbabel/catalogmanager/libsvn/svnhandler.cpp @@ -20,11 +20,11 @@ In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked + the TQt library by Trolltech AS, Norway (or with modified versions + of TQt that use the same license as TQt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to + TQt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. @@ -36,7 +36,7 @@ #include <unistd.h> #include <sys/stat.h> #include <time.h> -// Qt include files +// TQt include files #include <tqdir.h> #include <tqfile.h> #include <tqfileinfo.h> @@ -83,7 +83,7 @@ void SVNHandler::setPOTBaseDir( const TQString& dir ) emit signalIsPOTRepository( _isPOTRepository ); } -TQString SVNHandler::fileStatus( const FileStatus status ) const +TQString SVNHandler::filetqStatus( const FiletqStatus status ) const { switch ( status ) { case NO_REPOSITORY: @@ -115,7 +115,7 @@ TQString SVNHandler::fileStatus( const FileStatus status ) const } } -SVNHandler::FileStatus SVNHandler::fstatus( const TQString& filename ) const +SVNHandler::FiletqStatus SVNHandler::fstatus( const TQString& filename ) const { // no valid repository if ( !_isPORepository ) @@ -145,7 +145,7 @@ SVNHandler::FileStatus SVNHandler::fstatus( const TQString& filename ) const int errorLine, errorCol; TQDomNodeList nodelist; TQDomNode node; - TQDomElement entry, wcStatus; + TQDomElement entry, wctqStatus; // Parse the output. if ( !doc.setContent( out.getOutput(), &errorMsg, &errorLine, &errorCol ) ) { @@ -177,22 +177,22 @@ SVNHandler::FileStatus SVNHandler::fstatus( const TQString& filename ) const if ( node.isNull() ) return ERROR_IN_WC; - wcStatus = node.toElement(); + wctqStatus = node.toElement(); - if ( wcStatus.attributeNode("item").value() == "normal" ) + if ( wctqStatus.attributeNode("item").value() == "normal" ) return UP_TO_DATE; - if ( wcStatus.attributeNode("item").value() == "modified" ) + if ( wctqStatus.attributeNode("item").value() == "modified" ) return LOCALLY_MODIFIED; - if ( wcStatus.attributeNode("item").value() == "conflicted" ) + if ( wctqStatus.attributeNode("item").value() == "conflicted" ) return CONFLICT; - if ( wcStatus.attributeNode("item").value() == "unversioned" ) + if ( wctqStatus.attributeNode("item").value() == "unversioned" ) return NOT_IN_SVN; // TODO Ignored entry should have separate return value probably. - if ( wcStatus.attributeNode("item").value() == "ignored" ) + if ( wctqStatus.attributeNode("item").value() == "ignored" ) return NOT_IN_SVN; - if ( wcStatus.attributeNode("item").value() == "added" ) + if ( wctqStatus.attributeNode("item").value() == "added" ) return LOCALLY_ADDED; - if ( wcStatus.attributeNode("item").value() == "deleted" ) + if ( wctqStatus.attributeNode("item").value() == "deleted" ) return LOCALLY_REMOVED; // TODO What to do with "missing", "incomplete", "replaced", "merged", // "obstructed", "external"? Can these appear at all in our case? @@ -269,23 +269,23 @@ no_status_xml: } -TQString SVNHandler::svnStatus( const TQString& filename ) const +TQString SVNHandler::svntqStatus( const TQString& filename ) const { return map[filename]; } -void SVNHandler::execSVNCommand( TQWidget* parent, SVN::Command cmd, const TQString& filename, bool templates, KSharedConfig* config) +void SVNHandler::execSVNCommand( TQWidget* tqparent, 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, TQStringList( filename ), templates, config ); + execSVNCommand( tqparent, cmd, TQStringList( filename ), templates, config ); } -void SVNHandler::execSVNCommand( TQWidget* parent, SVN::Command cmd, const TQStringList& files, bool templates, KSharedConfig* config ) +void SVNHandler::execSVNCommand( TQWidget* tqparent, SVN::Command cmd, const TQStringList& files, bool templates, KSharedConfig* config ) { if ( !_isPORepository ) { // This message box should never be visible but who knows... ;-) - KMessageBox::sorry( parent, i18n( "This is not a valid SVN repository. " + KMessageBox::sorry( tqparent, i18n( "This is not a valid SVN repository. " "The SVN commands cannot be executed." ) ); return; } @@ -328,7 +328,7 @@ void SVNHandler::execSVNCommand( TQWidget* parent, SVN::Command cmd, const TQStr command += " \'" + temp + "\'"; } - showDialog( parent, cmd, files, command, config ); + showDialog( tqparent, cmd, files, command, config ); } void SVNHandler::setAutoUpdateTemplates( bool update ) @@ -336,9 +336,9 @@ void SVNHandler::setAutoUpdateTemplates( bool update ) _autoUpdateTemplates = update; } -void SVNHandler::showDialog( TQWidget* parent, SVN::Command cmd, const TQStringList& files, const TQString& commandLine, KSharedConfig* config ) +void SVNHandler::showDialog( TQWidget* tqparent, SVN::Command cmd, const TQStringList& files, const TQString& commandLine, KSharedConfig* config ) { - SVNDialog * dia = new SVNDialog( cmd, parent, config ); + SVNDialog * dia = new SVNDialog( cmd, tqparent, config ); dia->setFiles( files ); dia->setCommandLine( commandLine ); if ( cmd == SVN::Commit ) { @@ -415,7 +415,7 @@ void SVNHandler::checkToAdd( const TQStringList& files ) } // ### TODO: does SVN really needs this or does it do it automatically? - // check recursivlely if parent dirs have to be added as well + // check recursivlely if tqparent dirs have to be added as well while ( ! isInSvn( temp ) && toBeAdded.findIndex( temp ) == -1 ) { toBeAdded << temp; temp = TQFileInfo( temp ).dirPath( true ); @@ -464,7 +464,7 @@ void SVNHandler::processStatusOutput( const TQString& status ) TQString entr = *it; // translate the filename from repository to local TQRegExp rx( basedir + ".*,v" ); - int pos = entr.find( rx ); + int pos = entr.tqfind( rx ); TQString file = _poBaseDir + entr.mid( pos + basedir.length( ), rx.matchedLength( ) - basedir.length( ) - 2 ); @@ -472,7 +472,7 @@ void SVNHandler::processStatusOutput( const TQString& status ) // TODO: do some markup - map.replace( file, entr ); + map.tqreplace( file, entr ); } #endif } @@ -480,7 +480,7 @@ void SVNHandler::processStatusOutput( const TQString& status ) void SVNHandler::processDiff( TQString output ) { output.remove( TQRegExp( "\\[ .* \\]$" )); - output.remove( TQRegExp( "^" + i18n("[ Starting command ]" ).replace("[","\\[").replace("]","\\]"))); + output.remove( TQRegExp( "^" + i18n("[ Starting command ]" ).tqreplace("[","\\[").tqreplace("]","\\]"))); KTempFile tmpFile; *(tmpFile.textStream()) << output; @@ -491,7 +491,7 @@ void SVNHandler::processDiff( TQString output ) KMessageBox::error( 0, error ); } -bool SVNHandler::isConsideredModified( const FileStatus status ) const +bool SVNHandler::isConsideredModified( const FiletqStatus status ) const { /* * A file is modified if it is either: @@ -541,4 +541,4 @@ void SVNOutputCollector::slotGatherStdout( KProcess*, char* data, int len ) #include "svnhandler.moc" -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kbabel/catalogmanager/libsvn/svnhandler.h b/kbabel/catalogmanager/libsvn/svnhandler.h index 82039421..cad3e93f 100644 --- a/kbabel/catalogmanager/libsvn/svnhandler.h +++ b/kbabel/catalogmanager/libsvn/svnhandler.h @@ -20,11 +20,11 @@ In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked + the TQt library by Trolltech AS, Norway (or with modified versions + of TQt that use the same license as TQt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to + TQt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. @@ -35,13 +35,13 @@ #ifndef SVNHANDLER_H #define SVNHANDLER_H -// Qt include files +// TQt include files #include <tqmap.h> #include <tqobject.h> // Project specific include files #include "svndialog.h" #include "svnresources.h" -// Forwarding Qt classes +// Forwarding TQt classes class TQString; class TQStringList; @@ -52,12 +52,13 @@ class KSharedConfig; * * @short Backend for SVN support in Catalog Manager */ -class SVNHandler : public QObject +class SVNHandler : public TQObject { Q_OBJECT + TQ_OBJECT public: - enum FileStatus { + enum FiletqStatus { NO_REPOSITORY, NOT_IN_SVN, LOCALLY_ADDED, @@ -68,24 +69,24 @@ class SVNHandler : public QObject ERROR_IN_WC ///< The working copy has data that cannot be handled }; - SVNHandler( const TQString& poBaseDir = TQString::null, const TQString& potBaseDir = TQString::null ); + SVNHandler( const TQString& poBaseDir = TQString(), const TQString& potBaseDir = TQString() ); void setPOBaseDir( const TQString& dir ); void setPOTBaseDir( const TQString& dir ); - FileStatus fstatus( const TQString& filename ) const; - TQString fileStatus( const FileStatus status ) const; - TQString svnStatus( const TQString& filename ) const; + FiletqStatus fstatus( const TQString& filename ) const; + TQString filetqStatus( const FiletqStatus status ) const; + TQString svntqStatus( const TQString& filename ) const; - 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 execSVNCommand( TQWidget* tqparent, SVN::Command cmd, const TQString& filename, bool templates, KSharedConfig* config ); + void execSVNCommand( TQWidget* tqparent, SVN::Command cmd, const TQStringList& files, bool templates, KSharedConfig* config ); void setAutoUpdateTemplates( bool update ); /** * True if the file was modified or has another status considered as a modification */ - bool isConsideredModified( const FileStatus status ) const; + bool isConsideredModified( const FiletqStatus status ) const; signals: void signalIsPORepository( bool ); @@ -93,7 +94,7 @@ class SVNHandler : public QObject void signalFilesCommitted( const TQStringList& ); private: - void showDialog( TQWidget* parent, SVN::Command cmd, const TQStringList& files, const TQString& commandLine, KSharedConfig* config ); + void showDialog( TQWidget* tqparent, 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 TQString& path ); void checkToAdd( const TQStringList& files ); @@ -112,9 +113,10 @@ class SVNHandler : public QObject TQMap<TQString,TQString> map; }; -class SVNOutputCollector: public QObject +class SVNOutputCollector: public TQObject { Q_OBJECT + TQ_OBJECT public: SVNOutputCollector( KProcess* ); diff --git a/kbabel/catalogmanager/libsvn/svnresources.h b/kbabel/catalogmanager/libsvn/svnresources.h index d9032a4f..1d68aa16 100644 --- a/kbabel/catalogmanager/libsvn/svnresources.h +++ b/kbabel/catalogmanager/libsvn/svnresources.h @@ -20,11 +20,11 @@ In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked + the TQt library by Trolltech AS, Norway (or with modified versions + of TQt that use the same license as TQt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to + TQt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. |