summaryrefslogtreecommitdiffstats
path: root/parts/replace/replace_widget.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
commitd6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch)
treed109539636691d7b03036ca1c0ed29dbae6577cf /parts/replace/replace_widget.cpp
parent3331a47a9cad24795c7440ee8107143ce444ef34 (diff)
downloadtdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz
tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/replace/replace_widget.cpp')
-rw-r--r--parts/replace/replace_widget.cpp128
1 files changed, 64 insertions, 64 deletions
diff --git a/parts/replace/replace_widget.cpp b/parts/replace/replace_widget.cpp
index 24078943..c20c3bbc 100644
--- a/parts/replace/replace_widget.cpp
+++ b/parts/replace/replace_widget.cpp
@@ -35,18 +35,18 @@
#include <klocale.h>
#include <kstdguiitem.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qlineedit.h>
-#include <qradiobutton.h>
-#include <qstringlist.h>
-#include <qptrlist.h>
-#include <qregexp.h>
-#include <qdialog.h>
-#include <qfile.h>
-#include <qdir.h>
-#include <qtextstream.h>
-#include <qdatastream.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
+#include <tqradiobutton.h>
+#include <tqstringlist.h>
+#include <tqptrlist.h>
+#include <tqregexp.h>
+#include <tqdialog.h>
+#include <tqfile.h>
+#include <tqdir.h>
+#include <tqtextstream.h>
+#include <tqdatastream.h>
#include <sys/types.h>
#include <unistd.h>
@@ -60,13 +60,13 @@
//END Includes
ReplaceWidget::ReplaceWidget(ReplacePart *part)
- : QWidget(0, "replace widget"), m_part( part ),
+ : TQWidget(0, "replace widget"), m_part( part ),
m_dialog( new ReplaceDlgImpl( this, "replace widget" ) ),
_terminateOperation( false )
{
// setup outputview
- QVBoxLayout * layout = new QVBoxLayout( this );
- QHBoxLayout * buttonlayout = new QHBoxLayout( layout );
+ TQVBoxLayout * layout = new TQVBoxLayout( this );
+ TQHBoxLayout * buttonlayout = new TQHBoxLayout( layout );
_cancel = new KPushButton( KStdGuiItem::cancel(), this );
_replace = new KPushButton( KGuiItem(i18n("Replace"),"filefind"), this );
@@ -81,13 +81,13 @@ ReplaceWidget::ReplaceWidget(ReplacePart *part)
layout->addWidget( _listview );
// setup signals
- connect( m_dialog->find_button, SIGNAL( clicked() ), SLOT( find() ) );
+ connect( m_dialog->find_button, TQT_SIGNAL( clicked() ), TQT_SLOT( find() ) );
- connect( _replace, SIGNAL( clicked() ), SLOT( replace() ) );
- connect( _cancel, SIGNAL( clicked() ), SLOT( clear() ) );
- connect( _listview, SIGNAL( editDocument( const QString &, int ) ), SLOT( editDocument( const QString &, int ) ) );
+ connect( _replace, TQT_SIGNAL( clicked() ), TQT_SLOT( replace() ) );
+ connect( _cancel, TQT_SIGNAL( clicked() ), TQT_SLOT( clear() ) );
+ connect( _listview, TQT_SIGNAL( editDocument( const TQString &, int ) ), TQT_SLOT( editDocument( const TQString &, int ) ) );
- connect( m_part->core(), SIGNAL( stopButtonClicked( KDevPlugin * ) ), SLOT( stopButtonClicked( KDevPlugin * ) ) );
+ connect( m_part->core(), TQT_SIGNAL( stopButtonClicked( KDevPlugin * ) ), TQT_SLOT( stopButtonClicked( KDevPlugin * ) ) );
}
//BEGIN Slots
@@ -97,7 +97,7 @@ void ReplaceWidget::showDialog()
if ( ! m_part->project() )
return; /// @todo feedback?
- QString currentWord;
+ TQString currentWord;
KParts::ReadOnlyPart *part = dynamic_cast<KParts::ReadOnlyPart*> ( m_part->partController()->activePart() );
if ( part )
{
@@ -107,7 +107,7 @@ void ReplaceWidget::showDialog()
cursorPos ( part, &calledCol, &calledLine );
KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( m_part->partController()->activePart() );
- QString str = editIface->textLine ( calledCol );
+ TQString str = editIface->textLine ( calledCol );
int i;
uint start, end;
@@ -179,7 +179,7 @@ void ReplaceWidget::clear()
m_part->mainWindow()->setViewAvailable( this, false );
}
-void ReplaceWidget::editDocument( QString const & file, int line )
+void ReplaceWidget::editDocument( TQString const & file, int line )
{
m_part->partController()->editDocument( KURL( file ), line );
}
@@ -203,10 +203,10 @@ bool ReplaceWidget::showReplacements()
bool completed = true;
_terminateOperation = false;
- QStringList files = workFiles();
- QStringList openfiles = openProjectFiles();
+ TQStringList files = workFiles();
+ TQStringList openfiles = openProjectFiles();
- QStringList::ConstIterator it = files.begin();
+ TQStringList::ConstIterator it = files.begin();
while ( it != files.end() )
{
if ( shouldTerminate() )
@@ -219,17 +219,17 @@ bool ReplaceWidget::showReplacements()
{
if ( KTextEditor::EditInterface * ei = getEditInterfaceForFile( *it ) )
{
- QString buffer = ei->text();
- QTextIStream stream( &buffer );
+ TQString buffer = ei->text();
+ TQTextIStream stream( &buffer );
_listview->showReplacementsForFile( stream, *it );
}
}
else
{
- QFile file( *it );
+ TQFile file( *it );
if ( file.open ( IO_ReadOnly ) )
{
- QTextStream stream( &file );
+ TQTextStream stream( &file );
_listview->showReplacementsForFile( stream, *it );
}
}
@@ -280,24 +280,24 @@ bool ReplaceWidget::makeReplacements()
bool completed = true;
_terminateOperation = false;
- QStringList openfiles = openProjectFiles();
- QStringList changedFiles;
+ TQStringList openfiles = openProjectFiles();
+ TQStringList changedFiles;
ReplaceItem const * fileitem = _listview->firstChild();
while ( fileitem )
{
if ( fileitem->isOn() )
{
- QString currentfile = fileitem->file();
+ TQString currentfile = fileitem->file();
if ( openfiles.contains( currentfile ) )
{
if ( KTextEditor::EditInterface * ei = getEditInterfaceForFile( currentfile ) )
{
- QString ibuffer = ei->text();
- QString obuffer;
- QTextStream istream( &ibuffer, IO_ReadOnly );
- QTextStream ostream( &obuffer, IO_WriteOnly );
+ TQString ibuffer = ei->text();
+ TQString obuffer;
+ TQTextStream istream( &ibuffer, IO_ReadOnly );
+ TQTextStream ostream( &obuffer, IO_WriteOnly );
_listview->makeReplacementsForFile( istream, ostream, fileitem );
@@ -306,13 +306,13 @@ bool ReplaceWidget::makeReplacements()
}
else
{
- QFile file( currentfile );
- QString buffer;
+ TQFile file( currentfile );
+ TQString buffer;
if ( file.open( IO_ReadOnly ) )
{
- QTextStream istream( &file );
- QTextStream buffer_stream( &buffer, IO_WriteOnly );
+ TQTextStream istream( &file );
+ TQTextStream buffer_stream( &buffer, IO_WriteOnly );
_listview->makeReplacementsForFile( istream, buffer_stream, fileitem );
@@ -320,7 +320,7 @@ bool ReplaceWidget::makeReplacements()
if ( file.open( IO_WriteOnly ) )
{
- QTextStream ostream( &file );
+ TQTextStream ostream( &file );
ostream << buffer;
file.close();
}
@@ -343,7 +343,7 @@ bool ReplaceWidget::makeReplacements()
m_part->core()->running( m_part, false );
- if ( calledUrl != QString::null )
+ if ( calledUrl != TQString::null )
{
m_part->partController()->editDocument( calledUrl, calledLine );
setCursorPos( m_part->partController()->activePart(), calledCol, calledLine );
@@ -357,7 +357,7 @@ bool ReplaceWidget::makeReplacements()
//BEGIN Helpers
-QStringList ReplaceWidget::workFiles()
+TQStringList ReplaceWidget::workFiles()
{
if ( m_dialog->files_all_radio->isChecked() )
{
@@ -370,9 +370,9 @@ QStringList ReplaceWidget::workFiles()
return subProjectFiles( m_dialog->path_urlreq->lineEdit()->text() );
}
-QString ReplaceWidget::relativeProjectPath( QString path )
+TQString ReplaceWidget::relativeProjectPath( TQString path )
{
- QString project = m_part->project()->projectDirectory() + "/";
+ TQString project = m_part->project()->projectDirectory() + "/";
if ( path.left( project.length() ) == project )
{
path = path.mid( project.length() );
@@ -380,9 +380,9 @@ QString ReplaceWidget::relativeProjectPath( QString path )
return path;
}
-QString ReplaceWidget::fullProjectPath( QString path )
+TQString ReplaceWidget::fullProjectPath( TQString path )
{
- QString project = m_part->project()->projectDirectory() + "/";
+ TQString project = m_part->project()->projectDirectory() + "/";
if ( path.left( project.length() ) != project )
{
path = project + path;
@@ -391,11 +391,11 @@ QString ReplaceWidget::fullProjectPath( QString path )
}
-QStringList ReplaceWidget::allProjectFiles()
+TQStringList ReplaceWidget::allProjectFiles()
{
- QStringList allfiles = m_part->project()->allFiles();
+ TQStringList allfiles = m_part->project()->allFiles();
- QStringList::iterator it = allfiles.begin();
+ TQStringList::iterator it = allfiles.begin();
while ( it != allfiles.end() )
{
*it = fullProjectPath( *it );
@@ -404,11 +404,11 @@ QStringList ReplaceWidget::allProjectFiles()
return allfiles;
}
-QStringList ReplaceWidget::subProjectFiles( QString const & subpath )
+TQStringList ReplaceWidget::subProjectFiles( TQString const & subpath )
{
- QStringList projectfiles = allProjectFiles();
+ TQStringList projectfiles = allProjectFiles();
- QStringList::Iterator it = projectfiles.begin();
+ TQStringList::Iterator it = projectfiles.begin();
while ( it != projectfiles.end() )
{
if ( (*it).left( subpath.length() ) != subpath)
@@ -423,20 +423,20 @@ QStringList ReplaceWidget::subProjectFiles( QString const & subpath )
return projectfiles;
}
-QStringList ReplaceWidget::openProjectFiles()
+TQStringList ReplaceWidget::openProjectFiles()
{
- QStringList projectfiles = allProjectFiles();
- QStringList openfiles;
+ TQStringList projectfiles = allProjectFiles();
+ TQStringList openfiles;
- if( const QPtrList<KParts::Part> * partlist = m_part->
+ if( const TQPtrList<KParts::Part> * partlist = m_part->
partController()->parts() )
{
- QPtrListIterator<KParts::Part> it( *partlist );
+ TQPtrListIterator<KParts::Part> it( *partlist );
while ( KParts::Part* part = it.current() )
{
if ( KTextEditor::Editor * ed = dynamic_cast<KTextEditor::Editor *>( part ) )
{
- QString editorpath = ed->url().path();
+ TQString editorpath = ed->url().path();
if ( projectfiles.contains( editorpath ) )
{
openfiles.append( editorpath );
@@ -448,12 +448,12 @@ QStringList ReplaceWidget::openProjectFiles()
return openfiles;
}
-KTextEditor::EditInterface * ReplaceWidget::getEditInterfaceForFile( QString const & file )
+KTextEditor::EditInterface * ReplaceWidget::getEditInterfaceForFile( TQString const & file )
{
- if( const QPtrList<KParts::Part> * partlist = m_part->
+ if( const TQPtrList<KParts::Part> * partlist = m_part->
partController()->parts() )
{
- QPtrListIterator<KParts::Part> it( *partlist );
+ TQPtrListIterator<KParts::Part> it( *partlist );
while ( KParts::Part* part = it.current() )
{
if ( KTextEditor::Editor * ed = dynamic_cast<KTextEditor::Editor *>( part ) )
@@ -476,7 +476,7 @@ bool ReplaceWidget::shouldTerminate()
return b;
}
-void ReplaceWidget::focusInEvent( QFocusEvent * /* e*/ )
+void ReplaceWidget::focusInEvent( TQFocusEvent * /* e*/ )
{
_listview->setFocus();
}