summaryrefslogtreecommitdiffstats
path: root/kompare/libdiff2/komparemodellist.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
commit99a2774ca6f1cab334de5d43fe36fc44ae889a4c (patch)
treeeff34cf0762227f6baf2a93e8fef48d4bed2651c /kompare/libdiff2/komparemodellist.cpp
parent1c104292188541106338d4940b0f04beeb4301a0 (diff)
downloadtdesdk-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 'kompare/libdiff2/komparemodellist.cpp')
-rw-r--r--kompare/libdiff2/komparemodellist.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/kompare/libdiff2/komparemodellist.cpp b/kompare/libdiff2/komparemodellist.cpp
index db10f4c3..dc39c1bc 100644
--- a/kompare/libdiff2/komparemodellist.cpp
+++ b/kompare/libdiff2/komparemodellist.cpp
@@ -46,8 +46,8 @@
using namespace Diff2;
-KompareModelList::KompareModelList( DiffSettings* diffSettings, struct Kompare::Info& info, TQObject* parent, const char* name )
- : TQObject( parent, name ),
+KompareModelList::KompareModelList( DiffSettings* diffSettings, struct Kompare::Info& info, TQObject* tqparent, const char* name )
+ : TQObject( tqparent, name ),
m_diffProcess( 0 ),
m_diffSettings( diffSettings ),
m_models( 0 ),
@@ -58,34 +58,34 @@ KompareModelList::KompareModelList( DiffSettings* diffSettings, struct Kompare::
m_info( info ),
m_textCodec( 0 )
{
- m_applyDifference = new KAction( i18n("&Apply Difference"), "1rightarrow", Qt::Key_Space,
+ m_applyDifference = new KAction( i18n("&Apply Difference"), "1rightarrow", TQt::Key_Space,
this, TQT_SLOT(slotActionApplyDifference()),
- (( KomparePart* )parent)->actionCollection(), "difference_apply" );
- m_unApplyDifference = new KAction( i18n("Un&apply Difference"), "1leftarrow", Qt::Key_BackSpace,
+ (( KomparePart* )tqparent)->actionCollection(), "difference_apply" );
+ m_unApplyDifference = new KAction( i18n("Un&apply Difference"), "1leftarrow", TQt::Key_BackSpace,
this, TQT_SLOT(slotActionUnApplyDifference()),
- (( KomparePart* )parent)->actionCollection(), "difference_unapply" );
- m_applyAll = new KAction( i18n("App&ly All"), "2rightarrow", Qt::CTRL + Qt::Key_A,
+ (( KomparePart* )tqparent)->actionCollection(), "difference_unapply" );
+ m_applyAll = new KAction( i18n("App&ly All"), "2rightarrow", TQt::CTRL + TQt::Key_A,
this, TQT_SLOT(slotActionApplyAllDifferences()),
- (( KomparePart* )parent)->actionCollection(), "difference_applyall" );
- m_unapplyAll = new KAction( i18n("&Unapply All"), "2leftarrow", Qt::CTRL + Qt::Key_U,
+ (( KomparePart* )tqparent)->actionCollection(), "difference_applyall" );
+ m_unapplyAll = new KAction( i18n("&Unapply All"), "2leftarrow", TQt::CTRL + TQt::Key_U,
this, TQT_SLOT(slotActionUnapplyAllDifferences()),
- (( KomparePart* )parent)->actionCollection(), "difference_unapplyall" );
- m_previousFile = new KAction( i18n("P&revious File"), "2uparrow", Qt::CTRL + Qt::Key_PageUp,
+ (( KomparePart* )tqparent)->actionCollection(), "difference_unapplyall" );
+ m_previousFile = new KAction( i18n("P&revious File"), "2uparrow", TQt::CTRL + TQt::Key_PageUp,
this, TQT_SLOT(slotPreviousModel()),
- (( KomparePart* )parent)->actionCollection(), "difference_previousfile" );
- m_nextFile = new KAction( i18n("N&ext File"), "2downarrow", Qt::CTRL + Qt::Key_PageDown,
+ (( KomparePart* )tqparent)->actionCollection(), "difference_previousfile" );
+ m_nextFile = new KAction( i18n("N&ext File"), "2downarrow", TQt::CTRL + TQt::Key_PageDown,
this, TQT_SLOT(slotNextModel()),
- (( KomparePart* )parent)->actionCollection(), "difference_nextfile" );
- m_previousDifference = new KAction( i18n("&Previous Difference"), "1uparrow", Qt::CTRL + Qt::Key_Up,
+ (( KomparePart* )tqparent)->actionCollection(), "difference_nextfile" );
+ m_previousDifference = new KAction( i18n("&Previous Difference"), "1uparrow", TQt::CTRL + TQt::Key_Up,
this, TQT_SLOT(slotPreviousDifference()),
- (( KomparePart* )parent)->actionCollection(), "difference_previous" );
- m_nextDifference = new KAction( i18n("&Next Difference"), "1downarrow", Qt::CTRL + Qt::Key_Down,
+ (( KomparePart* )tqparent)->actionCollection(), "difference_previous" );
+ m_nextDifference = new KAction( i18n("&Next Difference"), "1downarrow", TQt::CTRL + TQt::Key_Down,
this, TQT_SLOT(slotNextDifference()),
- (( KomparePart* )parent)->actionCollection(), "difference_next" );
+ (( KomparePart* )tqparent)->actionCollection(), "difference_next" );
m_previousDifference->setEnabled( false );
m_nextDifference->setEnabled( false );
- m_save = KStdAction::save( this, TQT_SLOT(slotSaveDestination()), ((KomparePart*)parent)->actionCollection() );
+ m_save = KStdAction::save( this, TQT_SLOT(slotSaveDestination()), ((KomparePart*)tqparent)->actionCollection() );
m_save->setEnabled( false );
updateModelListActions();
@@ -235,7 +235,7 @@ bool KompareModelList::openFileAndDiff( const TQString& file, const TQString& di
if ( parseDiffOutput( readFile( diff ) ) != 0 )
{
- emit error( i18n( "<qt>No models or no differences, this file: <b>%1</b>, is not a valid diff file.</qt>" ).arg( diff ) );
+ emit error( i18n( "<qt>No models or no differences, this file: <b>%1</b>, is not a valid diff file.</qt>" ).tqarg( diff ) );
return false;
}
@@ -243,7 +243,7 @@ bool KompareModelList::openFileAndDiff( const TQString& file, const TQString& di
if ( !blendOriginalIntoModelList( file ) )
{
kdDebug(8101) << "Oops cant blend original file into modellist : " << file << endl;
- emit( i18n( "<qt>There were problems applying the diff <b>%1</b> to the file <b>%2</b>.</qt>" ).arg( diff ).arg( file ) );
+ emit( i18n( "<qt>There were problems applying the diff <b>%1</b> to the file <b>%2</b>.</qt>" ).tqarg( diff ).tqarg( file ) );
return false;
}
@@ -259,7 +259,7 @@ bool KompareModelList::openDirAndDiff( const TQString& dir, const TQString& diff
if ( parseDiffOutput( readFile( diff ) ) != 0 )
{
- emit error( i18n( "<qt>No models or no differences, this file: <b>%1</b>, is not a valid diff file.</qt>" ).arg( diff ) );
+ emit error( i18n( "<qt>No models or no differences, this file: <b>%1</b>, is not a valid diff file.</qt>" ).tqarg( diff ) );
return false;
}
@@ -268,7 +268,7 @@ bool KompareModelList::openDirAndDiff( const TQString& dir, const TQString& diff
{
// Trouble blending the original into the model
kdDebug(8101) << "Oops cant blend original dir into modellist : " << dir << endl;
- emit error( i18n( "<qt>There were problems applying the diff <b>%1</b> to the folder <b>%2</b>.</qt>" ).arg( diff ).arg( dir ) );
+ emit error( i18n( "<qt>There were problems applying the diff <b>%1</b> to the folder <b>%2</b>.</qt>" ).tqarg( diff ).tqarg( dir ) );
return false;
}
@@ -347,7 +347,7 @@ bool KompareModelList::saveDestination( DiffModel* model )
temp->close();
if( temp->status() != 0 ) {
- emit error( i18n( "<qt>Could not write to the temporary file <b>%1</b>, deleting it.</qt>" ).arg( temp->name() ) );
+ emit error( i18n( "<qt>Could not write to the temporary file <b>%1</b>, deleting it.</qt>" ).tqarg( temp->name() ) );
temp->unlink();
delete temp;
return false;
@@ -361,26 +361,26 @@ bool KompareModelList::saveDestination( DiffModel* model )
kdDebug(8101) << "Tempfilename : " << temp->name() << endl;
kdDebug(8101) << "DestinationURL : " << destination << endl;
KIO::UDSEntry entry;
- if ( !KIO::NetAccess::stat( KURL( destination ).path(), entry, (TQWidget*)parent() ) )
+ if ( !KIO::NetAccess::stat( KURL( destination ).path(), entry, (TQWidget*)tqparent() ) )
{
- if ( !KIO::NetAccess::mkdir( KURL( destination ).path(), (TQWidget*)parent() ) )
+ if ( !KIO::NetAccess::mkdir( KURL( destination ).path(), (TQWidget*)tqparent() ) )
{
emit error( i18n( "<qt>Could not create destination directory <b>%1</b>.\nThe file has not been saved.</qt>" ) );
return false;
}
}
- result = KIO::NetAccess::upload( temp->name(), KURL( destination ), (TQWidget*)parent() );
+ result = KIO::NetAccess::upload( temp->name(), KURL( destination ), (TQWidget*)tqparent() );
}
else
{
kdDebug(8101) << "Tempfilename : " << temp->name() << endl;
kdDebug(8101) << "DestinationURL : " << m_destination << endl;
- result = KIO::NetAccess::upload( temp->name(), KURL( m_destination ), (TQWidget*)parent() );
+ result = KIO::NetAccess::upload( temp->name(), KURL( m_destination ), (TQWidget*)tqparent() );
}
if ( !result )
{
- emit error( i18n( "<qt>Could not upload the temporary file to the destination location <b>%1</b>. The temporary file is still available under: <b>%2</b>. You can manually copy it to the right place.</qt>" ).arg( m_destination ).arg( temp->name() ) );
+ emit error( i18n( "<qt>Could not upload the temporary file to the destination location <b>%1</b>. The temporary file is still available under: <b>%2</b>. You can manually copy it to the right place.</qt>" ).tqarg( m_destination ).tqarg( temp->name() ) );
}
else
{
@@ -489,12 +489,12 @@ TQStringList KompareModelList::split( const TQString& fileContents )
int pos = 0;
unsigned int oldpos = 0;
// split that does not strip the split char
-#ifdef QT_OS_MAC
+#ifdef TQT_OS_MAC
const char split = '\r';
#else
const char split = '\n';
#endif
- while ( ( pos = contents.find( split, oldpos ) ) >= 0 )
+ while ( ( pos = contents.tqfind( split, oldpos ) ) >= 0 )
{
list.append( contents.mid( oldpos, pos - oldpos + 1 ) );
oldpos = pos + 1;
@@ -613,7 +613,7 @@ void KompareModelList::slotWriteDiffOutput( bool success )
emit error( i18n( "Could not write to the temporary file." ) );
}
- KIO::NetAccess::upload( m_diffTemp->name(), KURL( m_diffURL ), (TQWidget*)parent() );
+ KIO::NetAccess::upload( m_diffTemp->name(), KURL( m_diffURL ), (TQWidget*)tqparent() );
emit status( Kompare::FinishedWritingDiff );
}
@@ -633,11 +633,11 @@ void KompareModelList::slotSelectionChanged( const Diff2::DiffModel* model, cons
// This method will signal all the other objects about a change in selection,
// it will emit setSelection( const DiffModel*, const Difference* ) to all who are connected
kdDebug(8101) << "KompareModelList::slotSelectionChanged( " << model << ", " << diff << " )" << endl;
- kdDebug(8101) << "Sender is : " << sender()->className() << endl;
+ kdDebug(8101) << "Sender is : " << TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->className() << endl;
// kdDebug(8101) << kdBacktrace() << endl;
m_selectedModel = const_cast<DiffModel*>(model);
- m_modelIndex = m_models->findIndex( m_selectedModel );
+ m_modelIndex = m_models->tqfindIndex( m_selectedModel );
kdDebug( 8101 ) << "m_modelIndex = " << m_modelIndex << endl;
m_selectedDifference = const_cast<Difference*>(diff);
@@ -668,7 +668,7 @@ void KompareModelList::slotSelectionChanged( const Diff2::Difference* diff )
// This method will emit setSelection( const Difference* ) to whomever is listening
// when for instance in kompareview the selection has changed
kdDebug(8101) << "KompareModelList::slotSelectionChanged( " << diff << " )" << endl;
- kdDebug(8101) << "Sender is : " << sender()->className() << endl;
+ kdDebug(8101) << "Sender is : " << TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->className() << endl;
m_selectedDifference = const_cast<Difference*>(diff);
@@ -901,7 +901,7 @@ bool KompareModelList::blendOriginalIntoModelList( const TQString& localURL )
if ( fi.isDir() )
{ // is a dir
kdDebug() << "Blend Dir" << endl;
-// TQDir dir( localURL, TQString::null, TQDir::Name|TQDir::DirsFirst, TQDir::All );
+// TQDir dir( localURL, TQString(), TQDir::Name|TQDir::DirsFirst, TQDir::All );
DiffModelListIterator modelIt = m_models->begin();
DiffModelListIterator mEnd = m_models->end();
for ( ; modelIt != mEnd; ++modelIt )
@@ -1086,7 +1086,7 @@ bool KompareModelList::blendFile( DiffModel* model, const TQString& fileContents
case Difference::Change:
kdDebug(8101) << "Change" << endl;
- //QStringListConstIterator saveIt = linesIt;
+ //TQStringListConstIterator saveIt = linesIt;
for ( int i = 0; i < diff->sourceLineCount(); i++ )
{
@@ -1255,10 +1255,10 @@ bool KompareModelList::setSelectedModel( DiffModel* model )
if ( model != m_selectedModel )
{
- if ( m_models->findIndex( model ) == -1 )
+ if ( m_models->tqfindIndex( model ) == -1 )
return false;
kdDebug(8101) << "m_selectedModel (was) = " << m_selectedModel << endl;
- m_modelIndex = m_models->findIndex( model );
+ m_modelIndex = m_models->tqfindIndex( model );
kdDebug(8101) << "m_selectedModel (is) = " << m_selectedModel << endl;
m_selectedModel = model;
}
@@ -1272,7 +1272,7 @@ void KompareModelList::updateModelListActions()
{
if ( m_models && m_selectedModel && m_selectedDifference )
{
- if ( ( ( KomparePart* )parent() )->isReadWrite() )
+ if ( ( ( KomparePart* )tqparent() )->isReadWrite() )
{
if ( m_selectedModel->appliedCount() != m_selectedModel->differenceCount() )
m_applyAll->setEnabled( true );