summaryrefslogtreecommitdiffstats
path: root/parts/replace
diff options
context:
space:
mode:
Diffstat (limited to 'parts/replace')
-rw-r--r--parts/replace/replace_part.cpp22
-rw-r--r--parts/replace/replace_part.h12
-rw-r--r--parts/replace/replace_widget.cpp128
-rw-r--r--parts/replace/replace_widget.h28
-rw-r--r--parts/replace/replacedlgimpl.cpp58
-rw-r--r--parts/replace/replacedlgimpl.h14
-rw-r--r--parts/replace/replaceitem.cpp56
-rw-r--r--parts/replace/replaceitem.h30
-rw-r--r--parts/replace/replaceview.cpp42
-rw-r--r--parts/replace/replaceview.h22
10 files changed, 206 insertions, 206 deletions
diff --git a/parts/replace/replace_part.cpp b/parts/replace/replace_part.cpp
index 6e1312ed..7a64cac8 100644
--- a/parts/replace/replace_part.cpp
+++ b/parts/replace/replace_part.cpp
@@ -10,7 +10,7 @@
***************************************************************************/
#include "replace_part.h"
-#include <qwhatsthis.h>
+#include <tqwhatsthis.h>
#include <kaction.h>
#include <kiconloader.h>
@@ -29,7 +29,7 @@ static const KDevPluginInfo data("kdevreplace");
typedef KDevGenericFactory<ReplacePart> ReplaceFactory;
K_EXPORT_COMPONENT_FACTORY(libkdevreplace, ReplaceFactory(data))
-ReplacePart::ReplacePart(QObject *parent, const char *name, const QStringList& )
+ReplacePart::ReplacePart(TQObject *parent, const char *name, const TQStringList& )
: KDevPlugin( &data, parent, name ? name : "ReplacePart" )
{
setInstance(ReplaceFactory::instance());
@@ -39,7 +39,7 @@ ReplacePart::ReplacePart(QObject *parent, const char *name, const QStringList& )
m_widget->setIcon( SmallIcon("filefind") );
m_widget->setCaption(i18n("Replace"));
- QWhatsThis::add
+ TQWhatsThis::add
(m_widget, i18n("<b>Replace</b><p>"
"This window shows a preview of a string replace "
"operation. Uncheck a line to exclude that replacement. "
@@ -53,7 +53,7 @@ ReplacePart::ReplacePart(QObject *parent, const char *name, const QStringList& )
mainWindow()->setViewAvailable( m_widget, false );
action = new KAction(i18n("Find-Select-Replace..."), 0,
- CTRL+SHIFT+Key_R, this, SLOT(slotReplace()), actionCollection(), "edit_replace_across");
+ CTRL+SHIFT+Key_R, this, TQT_SLOT(slotReplace()), actionCollection(), "edit_replace_across");
action->setToolTip( i18n("Project wide string replacement") );
action->setWhatsThis( i18n("<b>Find-Select-Replace</b><p>"
"Opens the project wide string replacement dialog. There you "
@@ -62,9 +62,9 @@ ReplacePart::ReplacePart(QObject *parent, const char *name, const QStringList& )
"you specify. Matches will be displayed in the <b>Replace</b> window, you "
"can replace them with the specified string, exclude them from replace operation or cancel the whole replace.") );
- connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
- connect( core(), SIGNAL(projectOpened()), this, SLOT(enableAction()));
- connect( core(), SIGNAL(projectClosed()), this, SLOT(disableAction()));
+ connect( core(), TQT_SIGNAL(contextMenu(TQPopupMenu *, const Context *)), this, TQT_SLOT(contextMenu(TQPopupMenu *, const Context *)) );
+ connect( core(), TQT_SIGNAL(projectOpened()), this, TQT_SLOT(enableAction()));
+ connect( core(), TQT_SIGNAL(projectClosed()), this, TQT_SLOT(disableAction()));
}
void ReplacePart::enableAction()
@@ -89,18 +89,18 @@ void ReplacePart::slotReplace()
m_widget->showDialog();
}
-void ReplacePart::contextMenu(QPopupMenu *popup, const Context *context)
+void ReplacePart::contextMenu(TQPopupMenu *popup, const Context *context)
{
if (!context->hasType( Context::EditorContext ))
return;
const EditorContext *econtext = static_cast<const EditorContext*>(context);
- QString ident = econtext->currentWord();
+ TQString ident = econtext->currentWord();
if (!ident.isEmpty()) {
m_popupstr = ident;
- QString squeezed = KStringHandler::csqueeze(ident, 30);
+ TQString squeezed = KStringHandler::csqueeze(ident, 30);
int id = popup->insertItem( i18n("Replace Project Wide: %1").arg(squeezed),
- this, SLOT(slotReplace()) );
+ this, TQT_SLOT(slotReplace()) );
popup->setWhatsThis(id, i18n("<b>Replace Project Wide</b><p>Opens the find in files dialog "
"and sets the pattern to the text under the cursor."));
popup->insertSeparator();
diff --git a/parts/replace/replace_part.h b/parts/replace/replace_part.h
index 35a293ab..8fb6f5e3 100644
--- a/parts/replace/replace_part.h
+++ b/parts/replace/replace_part.h
@@ -13,9 +13,9 @@
#define __KDEVPART_REPLACE_H__
-#include <qguardedptr.h>
+#include <tqguardedptr.h>
#include <kdevplugin.h>
-#include <qpopupmenu.h>
+#include <tqpopupmenu.h>
class ReplaceWidget;
@@ -27,17 +27,17 @@ class ReplacePart : public KDevPlugin
Q_OBJECT
public:
- ReplacePart(QObject *parent, const char *name, const QStringList &);
+ ReplacePart(TQObject *parent, const char *name, const TQStringList &);
~ReplacePart();
public slots:
void slotReplace();
- void contextMenu(QPopupMenu *popup, const Context *context);
+ void contextMenu(TQPopupMenu *popup, const Context *context);
void enableAction();
void disableAction();
private:
- QGuardedPtr<ReplaceWidget> m_widget;
- QString m_popupstr;
+ TQGuardedPtr<ReplaceWidget> m_widget;
+ TQString m_popupstr;
KAction* action;
};
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();
}
diff --git a/parts/replace/replace_widget.h b/parts/replace/replace_widget.h
index fa5809d5..bbadce37 100644
--- a/parts/replace/replace_widget.h
+++ b/parts/replace/replace_widget.h
@@ -14,8 +14,8 @@
#include <ktexteditor/editinterface.h>
-#include <qwidget.h>
-#include <qstring.h>
+#include <tqwidget.h>
+#include <tqstring.h>
class QPushButton;
class QListViewItem;
@@ -38,13 +38,13 @@ public slots:
void stopButtonClicked( KDevPlugin * );
protected:
- virtual void focusInEvent(QFocusEvent *e);
+ virtual void focusInEvent(TQFocusEvent *e);
private slots:
void find();
void replace();
void clear();
- void editDocument( const QString & ,int );
+ void editDocument( const TQString & ,int );
void setCursorPos( KParts::Part *part, uint line, uint col );
void cursorPos( KParts::Part *part, uint * line, uint * col );
@@ -53,26 +53,26 @@ private:
bool makeReplacements();
bool shouldTerminate();
- QString relativeProjectPath( QString );
- QString fullProjectPath( QString );
+ TQString relativeProjectPath( TQString );
+ TQString fullProjectPath( TQString );
- QStringList workFiles();
- QStringList allProjectFiles();
- QStringList subProjectFiles( QString const & );
- QStringList openProjectFiles();
+ TQStringList workFiles();
+ TQStringList allProjectFiles();
+ TQStringList subProjectFiles( TQString const & );
+ TQStringList openProjectFiles();
- KTextEditor::EditInterface * getEditInterfaceForFile( QString const & file );
+ KTextEditor::EditInterface * getEditInterfaceForFile( TQString const & file );
ReplacePart * m_part;
ReplaceDlgImpl * m_dialog;
ReplaceView * _listview;
- QPushButton * _cancel;
- QPushButton * _replace;
+ TQPushButton * _cancel;
+ TQPushButton * _replace;
uint calledCol;
uint calledLine;
- QString calledUrl;
+ TQString calledUrl;
bool _terminateOperation;
};
diff --git a/parts/replace/replacedlgimpl.cpp b/parts/replace/replacedlgimpl.cpp
index 59eee128..b0c5bffd 100644
--- a/parts/replace/replacedlgimpl.cpp
+++ b/parts/replace/replacedlgimpl.cpp
@@ -1,8 +1,8 @@
-#include <qcheckbox.h>
-#include <qradiobutton.h>
-#include <qstring.h>
-#include <qregexp.h>
-#include <qlabel.h>
+#include <tqcheckbox.h>
+#include <tqradiobutton.h>
+#include <tqstring.h>
+#include <tqregexp.h>
+#include <tqlabel.h>
#include <ktrader.h>
#include <kparts/componentfactory.h>
@@ -20,10 +20,10 @@ namespace
/// @todo This is the same function as in ../grepview/grepviewwidget.cpp and
/// should probably be placed in a common place. For now it seemed like too
/// little code to bother with.
-QString escape(const QString &str)
+TQString escape(const TQString &str)
{
- QString escaped("[]{}()\\^$?.+-*");
- QString res;
+ TQString escaped("[]{}()\\^$?.+-*");
+ TQString res;
for (uint i=0; i < str.length(); ++i)
{
@@ -37,17 +37,17 @@ QString escape(const QString &str)
}
-ReplaceDlgImpl::ReplaceDlgImpl(QWidget* parent, const char* name, bool modal, WFlags fl)
+ReplaceDlgImpl::ReplaceDlgImpl(TQWidget* parent, const char* name, bool modal, WFlags fl)
: ReplaceDlg(parent,name, modal,fl), _regexp_dialog( 0 )
{
- connect( find_button, SIGNAL( clicked() ), SLOT( saveComboHistories() ) );
- connect( regexp_button, SIGNAL( clicked() ), SLOT( showRegExpEditor() ) );
- connect( find_combo, SIGNAL( textChanged( const QString & ) ),
- SLOT( validateFind( const QString & ) ) );
- connect( regexp_combo, SIGNAL( textChanged ( const QString & ) ),
- SLOT( validateExpression( const QString & ) ) );
- connect( strings_regexp_radio, SIGNAL( toggled( bool ) ), SLOT( toggleExpression( bool ) ) );
+ connect( find_button, TQT_SIGNAL( clicked() ), TQT_SLOT( saveComboHistories() ) );
+ connect( regexp_button, TQT_SIGNAL( clicked() ), TQT_SLOT( showRegExpEditor() ) );
+ connect( find_combo, TQT_SIGNAL( textChanged( const TQString & ) ),
+ TQT_SLOT( validateFind( const TQString & ) ) );
+ connect( regexp_combo, TQT_SIGNAL( textChanged ( const TQString & ) ),
+ TQT_SLOT( validateExpression( const TQString & ) ) );
+ connect( strings_regexp_radio, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( toggleExpression( bool ) ) );
// disable the editor button if the regexp editor isn't installed
if ( KTrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty() )
@@ -64,7 +64,7 @@ ReplaceDlgImpl::ReplaceDlgImpl(QWidget* parent, const char* name, bool modal, WF
ReplaceDlgImpl::~ReplaceDlgImpl()
{}
-void ReplaceDlgImpl::show( QString const & path )
+void ReplaceDlgImpl::show( TQString const & path )
{
path_urlreq->lineEdit()->setText( path );
@@ -77,13 +77,13 @@ void ReplaceDlgImpl::show( QString const & path )
find_button->setEnabled( false );
- QDialog::show();
+ TQDialog::show();
}
void ReplaceDlgImpl::showRegExpEditor()
{
- _regexp_dialog = KParts::ComponentFactory::createInstanceFromQuery<QDialog>( "KRegExpEditor/KRegExpEditor" );
+ _regexp_dialog = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>( "KRegExpEditor/KRegExpEditor" );
if ( _regexp_dialog )
{
@@ -92,14 +92,14 @@ void ReplaceDlgImpl::showRegExpEditor()
editor->setRegExp( regexp_combo->currentText() );
- if ( _regexp_dialog->exec() == QDialog::Accepted )
+ if ( _regexp_dialog->exec() == TQDialog::Accepted )
{
regexp_combo->setCurrentText( editor->regExp() );
}
}
}
-void ReplaceDlgImpl::validateFind( const QString & )
+void ReplaceDlgImpl::validateFind( const TQString & )
{
//kdDebug(0) << "ReplaceWidget::validateFind()" << endl;
@@ -107,12 +107,12 @@ void ReplaceDlgImpl::validateFind( const QString & )
find_button->setEnabled( !x );
}
-void ReplaceDlgImpl::validateExpression( const QString & )
+void ReplaceDlgImpl::validateExpression( const TQString & )
{
//kdDebug(0) << "ReplaceWidget::validateExpression()" << endl;
- QString pattern = regexp_combo->currentText();
- QRegExp re( pattern );
+ TQString pattern = regexp_combo->currentText();
+ TQRegExp re( pattern );
if ( pattern.isEmpty() || !re.isValid() )
{
@@ -130,7 +130,7 @@ void ReplaceDlgImpl::toggleExpression( bool on )
{
if ( on )
{
- validateExpression( QString() );
+ validateExpression( TQString() );
}
else
{
@@ -157,11 +157,11 @@ void ReplaceDlgImpl::saveComboHistories()
}
}
-QRegExp ReplaceDlgImpl::expressionPattern()
+TQRegExp ReplaceDlgImpl::expressionPattern()
{
- QString pattern = escape( find_combo->currentText() );
+ TQString pattern = escape( find_combo->currentText() );
- QRegExp re;
+ TQRegExp re;
re.setCaseSensitive( case_box->isChecked() );
re.setMinimal( true );
@@ -179,7 +179,7 @@ QRegExp ReplaceDlgImpl::expressionPattern()
return re;
}
-QString ReplaceDlgImpl::replacementString()
+TQString ReplaceDlgImpl::replacementString()
{
return replacement_combo->currentText();
}
diff --git a/parts/replace/replacedlgimpl.h b/parts/replace/replacedlgimpl.h
index 38938bed..d67908ff 100644
--- a/parts/replace/replacedlgimpl.h
+++ b/parts/replace/replacedlgimpl.h
@@ -11,26 +11,26 @@ class ReplaceDlgImpl : public ReplaceDlg
Q_OBJECT
public:
- ReplaceDlgImpl(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ReplaceDlgImpl(TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~ReplaceDlgImpl();
- QRegExp expressionPattern();
- QString replacementString();
+ TQRegExp expressionPattern();
+ TQString replacementString();
public slots:
- void show( QString const & path );
+ void show( TQString const & path );
protected:
protected slots:
void showRegExpEditor();
- void validateExpression( const QString & );
- void validateFind( const QString & );
+ void validateExpression( const TQString & );
+ void validateFind( const TQString & );
void toggleExpression( bool );
void saveComboHistories();
private:
- QDialog * _regexp_dialog;
+ TQDialog * _regexp_dialog;
};
diff --git a/parts/replace/replaceitem.cpp b/parts/replace/replaceitem.cpp
index bc33211f..d810e2ad 100644
--- a/parts/replace/replaceitem.cpp
+++ b/parts/replace/replaceitem.cpp
@@ -9,10 +9,10 @@
* *
***************************************************************************/
-#include <qpainter.h>
-#include <qstyle.h>
-#include <qpalette.h>
-#include <qcheckbox.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
+#include <tqpalette.h>
+#include <tqcheckbox.h>
#include "replaceitem.h"
@@ -69,41 +69,41 @@ void ReplaceItem::setChecked( bool checked )
}
}
-// code mostly lifted from QCheckListItem::paintCell()
-void ReplaceItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align )
+// code mostly lifted from TQCheckListItem::paintCell()
+void ReplaceItem::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align )
{
if ( !p )
return;
- QListView *lvv = listView();
+ TQListView *lvv = listView();
if ( !lvv )
return;
ReplaceView * lv = static_cast<ReplaceView*>(lvv);
const BackgroundMode bgmode = lv->viewport()->backgroundMode();
- const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode( bgmode );
+ const TQColorGroup::ColorRole crole = TQPalette::backgroundRoleFromMode( bgmode );
if ( cg.brush( crole ) != lv->colorGroup().brush( crole ) )
p->fillRect( 0, 0, width, height(), cg.brush( crole ) );
else
- lv->paintEmptyArea( p, QRect( 0, 0, width, height() ) );
+ lv->paintEmptyArea( p, TQRect( 0, 0, width, height() ) );
- QFontMetrics fm( lv->fontMetrics() );
- int boxsize = lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv);
+ TQFontMetrics fm( lv->fontMetrics() );
+ int boxsize = lv->style().pixelMetric(TQStyle::PM_CheckListButtonSize, lv);
int marg = lv->itemMargin();
int r = marg;
// Draw controller / checkbox / radiobutton ---------------------
- int styleflags = QStyle::Style_Default;
+ int styleflags = TQStyle::Style_Default;
if ( isOn() )
- styleflags |= QStyle::Style_On;
+ styleflags |= TQStyle::Style_On;
else
- styleflags |= QStyle::Style_Off;
+ styleflags |= TQStyle::Style_Off;
if ( isSelected() )
- styleflags |= QStyle::Style_Selected;
+ styleflags |= TQStyle::Style_Selected;
if ( isEnabled() && lv->isEnabled() )
- styleflags |= QStyle::Style_Enabled;
+ styleflags |= TQStyle::Style_Enabled;
int x = 0;
int y = 0;
@@ -116,30 +116,30 @@ void ReplaceItem::paintCell( QPainter * p, const QColorGroup & cg, int column, i
else
y = (fm.height() + 2 + marg - boxsize) / 2;
- lv->style().drawPrimitive(QStyle::PE_CheckListIndicator, p,
- QRect(x, y, boxsize,
+ lv->style().drawPrimitive(TQStyle::PE_CheckListIndicator, p,
+ TQRect(x, y, boxsize,
fm.height() + 2 + marg),
- cg, styleflags, QStyleOption(this));
+ cg, styleflags, TQStyleOption(this));
r += boxsize + 4;
// Draw text ----------------------------------------------------
p->translate( r, 0 );
- p->setPen( QPen( cg.text() ) );
+ p->setPen( TQPen( cg.text() ) );
- QColorGroup mcg = cg;
- mcg.setColor( QColorGroup::Text, ( isFile() ? Qt::darkGreen : Qt::blue ) );
- mcg.setColor( QColorGroup::HighlightedText, ( isFile() ? Qt::darkGreen : Qt::blue ) );
+ TQColorGroup mcg = cg;
+ mcg.setColor( TQColorGroup::Text, ( isFile() ? Qt::darkGreen : Qt::blue ) );
+ mcg.setColor( TQColorGroup::HighlightedText, ( isFile() ? Qt::darkGreen : Qt::blue ) );
- QListViewItem::paintCell( p, mcg, column, width - r, align );
+ TQListViewItem::paintCell( p, mcg, column, width - r, align );
}
-void ReplaceItem::activate( int, QPoint const & localPos )
+void ReplaceItem::activate( int, TQPoint const & localPos )
{
- QListView * lv = listView();
- QCheckBox cb(0);
+ TQListView * lv = listView();
+ TQCheckBox cb(0);
int boxsize = cb.sizeHint().width();
-//that's KDE-3.1 only int boxsize = lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv);
+//that's KDE-3.1 only int boxsize = lv->style().pixelMetric(TQStyle::PM_CheckListButtonSize, lv);
int rightside = lv->itemMargin() + boxsize + ( isFile() ? 0 : lv->treeStepSize() );
// _lineclicked indicates if the click was on the line or in the checkbox
diff --git a/parts/replace/replaceitem.h b/parts/replace/replaceitem.h
index a6bc8ffb..4cea682c 100644
--- a/parts/replace/replaceitem.h
+++ b/parts/replace/replaceitem.h
@@ -22,10 +22,10 @@ class ReplaceItem : public QCheckListItem
{
public:
// the file item
- ReplaceItem( ReplaceView * parent, ReplaceItem * after, QString file ) :
- QCheckListItem( parent,
+ ReplaceItem( ReplaceView * parent, ReplaceItem * after, TQString file ) :
+ TQCheckListItem( parent,
after,
- file, QCheckListItem::CheckBox ),
+ file, TQCheckListItem::CheckBox ),
_file( file ), _string( file ), _line( 0 ), _isfile( true ),
_lineclicked( false ), _clicked( true )
{
@@ -34,17 +34,17 @@ public:
}
// the line item
- ReplaceItem( ReplaceItem * parent, ReplaceItem * after, QString file, QString string, int line ) :
- QCheckListItem( parent,
+ ReplaceItem( ReplaceItem * parent, ReplaceItem * after, TQString file, TQString string, int line ) :
+ TQCheckListItem( parent,
after,
- QString::number( line + 1 ) + ": " + string, QCheckListItem::CheckBox ),
+ TQString::number( line + 1 ) + ": " + string, TQCheckListItem::CheckBox ),
_file( file ), _string( string ), _line( line ), _isfile( false ),
_lineclicked( false ), _clicked( true )
{
setOn( true );
}
- QString const & file() const
+ TQString const & file() const
{
return _file;
}
@@ -54,7 +54,7 @@ public:
return _line;
}
- QString const & string() const
+ TQString const & string() const
{
return _string;
}
@@ -78,31 +78,31 @@ public:
ReplaceItem * parent() const
{
- return static_cast<ReplaceItem*>( QListViewItem::parent() );
+ return static_cast<ReplaceItem*>( TQListViewItem::parent() );
}
ReplaceItem * firstChild() const
{
- return static_cast<ReplaceItem*>( QListViewItem::firstChild() );
+ return static_cast<ReplaceItem*>( TQListViewItem::firstChild() );
}
ReplaceItem * nextSibling() const
{
- return static_cast<ReplaceItem*>( QListViewItem::nextSibling() );
+ return static_cast<ReplaceItem*>( TQListViewItem::nextSibling() );
}
- void activate( int column, QPoint const & localPos );
+ void activate( int column, TQPoint const & localPos );
bool hasCheckedChildren() const;
virtual void stateChange( bool state );
static bool s_listview_done;
private:
- void paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align );
+ void paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align );
void setChecked( bool checked );
- QString _file;
- QString _string;
+ TQString _file;
+ TQString _string;
int _line;
bool const _isfile;
bool _lineclicked;
diff --git a/parts/replace/replaceview.cpp b/parts/replace/replaceview.cpp
index 7a7505d7..6730971a 100644
--- a/parts/replace/replaceview.cpp
+++ b/parts/replace/replaceview.cpp
@@ -9,12 +9,12 @@
* *
***************************************************************************/
-#include <qheader.h>
-#include <qtextstream.h>
-#include <qdir.h>
-#include <qstringlist.h>
-#include <qregexp.h>
-#include <qpalette.h>
+#include <tqheader.h>
+#include <tqtextstream.h>
+#include <tqdir.h>
+#include <tqstringlist.h>
+#include <tqregexp.h>
+#include <tqpalette.h>
#include "replaceitem.h"
#include "replaceview.h"
@@ -23,29 +23,29 @@
ReplaceItem * ReplaceView::firstChild() const
{
- return static_cast<ReplaceItem*>( QListView::firstChild() );
+ return static_cast<ReplaceItem*>( TQListView::firstChild() );
}
-ReplaceView::ReplaceView( QWidget * parent ) : KListView( parent ), _latestfile( 0 )
+ReplaceView::ReplaceView( TQWidget * parent ) : KListView( parent ), _latestfile( 0 )
{
setSorting( -1 );
addColumn( "" );
header()->hide();
setFullWidth(true);
- QPalette pal = palette();
- QColorGroup cg = pal.active();
- cg.setColor( QColorGroup::Highlight, Qt::lightGray );
+ TQPalette pal = palette();
+ TQColorGroup cg = pal.active();
+ cg.setColor( TQColorGroup::Highlight, Qt::lightGray );
pal.setActive( cg );
setPalette( pal );
- connect( this, SIGNAL( clicked( QListViewItem * ) ), SLOT( slotClicked( QListViewItem * ) ) );
- connect( this, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint &, int) ),
- SLOT( slotMousePressed(int, QListViewItem *, const QPoint &, int) ) );
+ connect( this, TQT_SIGNAL( clicked( TQListViewItem * ) ), TQT_SLOT( slotClicked( TQListViewItem * ) ) );
+ connect( this, TQT_SIGNAL( mouseButtonPressed( int, TQListViewItem *, const TQPoint &, int) ),
+ TQT_SLOT( slotMousePressed(int, TQListViewItem *, const TQPoint &, int) ) );
}
-void ReplaceView::makeReplacementsForFile( QTextStream & istream, QTextStream & ostream, ReplaceItem const * fileitem )
+void ReplaceView::makeReplacementsForFile( TQTextStream & istream, TQTextStream & ostream, ReplaceItem const * fileitem )
{
int line = 0;
@@ -73,7 +73,7 @@ void ReplaceView::makeReplacementsForFile( QTextStream & istream, QTextStream &
}
}
-void ReplaceView::showReplacementsForFile( QTextStream & stream, QString const & file )
+void ReplaceView::showReplacementsForFile( TQTextStream & stream, TQString const & file )
{
ReplaceItem * latestitem = 0;
@@ -82,7 +82,7 @@ void ReplaceView::showReplacementsForFile( QTextStream & stream, QString const &
while ( !stream.atEnd() )
{
- QString s = stream.readLine();
+ TQString s = stream.readLine();
if ( s.contains( _regexp ) > 0 )
{
@@ -100,13 +100,13 @@ void ReplaceView::showReplacementsForFile( QTextStream & stream, QString const &
}
}
-void ReplaceView::setReplacementData( QRegExp const & re, QString const & replacement )
+void ReplaceView::setReplacementData( TQRegExp const & re, TQString const & replacement )
{
_regexp = re;
_replacement = replacement;
}
-void ReplaceView::slotMousePressed(int btn, QListViewItem* i, const QPoint& pos, int col)
+void ReplaceView::slotMousePressed(int btn, TQListViewItem* i, const TQPoint& pos, int col)
{
kdDebug(0) << "ReplaceView::slotMousePressed()" << endl;
@@ -119,12 +119,12 @@ void ReplaceView::slotMousePressed(int btn, QListViewItem* i, const QPoint& pos,
else if ( btn == Qt::LeftButton )
{
// map pos to item/column and call ReplacetItem::activate(pos)
- item->activate( col, viewport()->mapFromGlobal( pos ) - QPoint( 0, itemRect(item).top() ) );
+ item->activate( col, viewport()->mapFromGlobal( pos ) - TQPoint( 0, itemRect(item).top() ) );
}
}
}
-void ReplaceView::slotClicked( QListViewItem * item )
+void ReplaceView::slotClicked( TQListViewItem * item )
{
kdDebug(0) << "ReplaceView::slotClicked()" << endl;
diff --git a/parts/replace/replaceview.h b/parts/replace/replaceview.h
index 02ba60c9..31dcc4cd 100644
--- a/parts/replace/replaceview.h
+++ b/parts/replace/replaceview.h
@@ -14,8 +14,8 @@
#include <klistview.h>
-#include <qstring.h>
-#include <qregexp.h>
+#include <tqstring.h>
+#include <tqregexp.h>
class QTextStream;
class QWidget;
@@ -26,22 +26,22 @@ class ReplaceView : public KListView
Q_OBJECT
signals:
- void editDocument( const QString &, int );
+ void editDocument( const TQString &, int );
public:
- ReplaceView( QWidget *);
+ ReplaceView( TQWidget *);
ReplaceItem * firstChild() const;
- void setReplacementData( QRegExp const &, QString const & );
- void showReplacementsForFile( QTextStream &, QString const & );
- void makeReplacementsForFile( QTextStream & istream, QTextStream & ostream, ReplaceItem const * fileitem );
+ void setReplacementData( TQRegExp const &, TQString const & );
+ void showReplacementsForFile( TQTextStream &, TQString const & );
+ void makeReplacementsForFile( TQTextStream & istream, TQTextStream & ostream, ReplaceItem const * fileitem );
private slots:
- void slotMousePressed(int, QListViewItem *, const QPoint &, int);
- void slotClicked( QListViewItem * );
+ void slotMousePressed(int, TQListViewItem *, const TQPoint &, int);
+ void slotClicked( TQListViewItem * );
private:
- QRegExp _regexp;
- QString _replacement;
+ TQRegExp _regexp;
+ TQString _replacement;
ReplaceItem * _latestfile;
friend class ReplaceItem;