summaryrefslogtreecommitdiffstats
path: root/parts/grepview
diff options
context:
space:
mode:
Diffstat (limited to 'parts/grepview')
-rw-r--r--parts/grepview/grepdlg.cpp118
-rw-r--r--parts/grepview/grepdlg.h40
-rw-r--r--parts/grepview/grepviewpart.cpp34
-rw-r--r--parts/grepview/grepviewpart.h10
-rw-r--r--parts/grepview/grepviewwidget.cpp146
-rw-r--r--parts/grepview/grepviewwidget.h30
6 files changed, 189 insertions, 189 deletions
diff --git a/parts/grepview/grepdlg.cpp b/parts/grepview/grepdlg.cpp
index 9c62510e..80264a92 100644
--- a/parts/grepview/grepdlg.cpp
+++ b/parts/grepview/grepdlg.cpp
@@ -11,13 +11,13 @@
#include "grepdlg.h"
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qregexp.h>
-#include <qhbox.h>
-#include <qwhatsthis.h>
-#include <qtooltip.h>
-#include <qstringlist.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqregexp.h>
+#include <tqhbox.h>
+#include <tqwhatsthis.h>
+#include <tqtooltip.h>
+#include <tqstringlist.h>
#include <kfiledialog.h>
#include <kbuttonbox.h>
#include <kpushbutton.h>
@@ -28,7 +28,7 @@
#include <kmessagebox.h>
#include <kdebug.h>
#include <kdeversion.h>
-#include <qlabel.h>
+#include <tqlabel.h>
#include <kcombobox.h>
#include <kurlcompletion.h>
#include <kurlrequester.h>
@@ -80,32 +80,32 @@ const char *filepatterns[] = {
};
-GrepDialog::GrepDialog( GrepViewPart * part, QWidget *parent, const char *name )
- : QDialog(parent, name, false), m_part( part )
+GrepDialog::GrepDialog( GrepViewPart * part, TQWidget *parent, const char *name )
+ : TQDialog(parent, name, false), m_part( part )
{
setCaption(i18n("Find in Files"));
config = GrepViewFactory::instance()->config();
config->setGroup("GrepDialog");
- QGridLayout *layout = new QGridLayout(this, 9, 2, 10, 4);
+ TQGridLayout *layout = new TQGridLayout(this, 9, 2, 10, 4);
layout->setColStretch(0, 0);
layout->setColStretch(1, 20);
- QLabel *pattern_label = new QLabel(i18n("&Pattern:"), this);
+ TQLabel *pattern_label = new TQLabel(i18n("&Pattern:"), this);
layout->addWidget(pattern_label, 0, 0, AlignRight | AlignVCenter);
pattern_combo = new KHistoryCombo(true, this);
pattern_label->setBuddy(pattern_combo);
pattern_combo->setFocus();
pattern_combo->setHistoryItems(config->readListEntry("LastSearchItems"), true);
- pattern_combo->setInsertionPolicy(QComboBox::NoInsertion);
+ pattern_combo->setInsertionPolicy(TQComboBox::NoInsertion);
layout->addWidget(pattern_combo, 0, 1);
- QLabel *template_label = new QLabel(i18n("&Template:"), this);
+ TQLabel *template_label = new TQLabel(i18n("&Template:"), this);
layout->addWidget(template_label, 1, 0, AlignRight | AlignVCenter);
- QBoxLayout *template_layout = new QHBoxLayout(4);
+ TQBoxLayout *template_layout = new TQHBoxLayout(4);
layout->addLayout(template_layout, 1, 1);
template_edit = new KLineEdit(this);
@@ -117,28 +117,28 @@ GrepDialog::GrepDialog( GrepViewPart * part, QWidget *parent, const char *name )
template_combo->insertStrList(template_desc);
template_layout->addWidget(template_combo, 0);
- QBoxLayout *search_opts_layout = new QHBoxLayout(15);
+ TQBoxLayout *search_opts_layout = new TQHBoxLayout(15);
layout->addLayout(search_opts_layout, 2, 1);
- regexp_box = new QCheckBox(i18n("&Regular Expression"), this);
+ regexp_box = new TQCheckBox(i18n("&Regular Expression"), this);
regexp_box->setChecked(config->readBoolEntry("regexp", false ));
search_opts_layout->addWidget(regexp_box);
- case_sens_box = new QCheckBox(i18n("C&ase sensitive"), this);
- case_sens_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ case_sens_box = new TQCheckBox(i18n("C&ase sensitive"), this);
+ case_sens_box->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
case_sens_box->setChecked(config->readBoolEntry("case_sens", true));
search_opts_layout->addWidget(case_sens_box);
- QLabel *dir_label = new QLabel(i18n("&Directory:"), this);
+ TQLabel *dir_label = new TQLabel(i18n("&Directory:"), this);
layout->addWidget(dir_label, 3, 0, AlignRight | AlignVCenter);
- QBoxLayout *dir_layout = new QHBoxLayout(4);
+ TQBoxLayout *dir_layout = new TQHBoxLayout(4);
layout->addLayout(dir_layout, 3, 1);
dir_combo = new KComboBox( true, this );
dir_combo->insertStringList(config->readPathListEntry("LastSearchPaths"));
- dir_combo->setInsertionPolicy(QComboBox::NoInsertion);
- dir_combo->setEditText(QDir::homeDirPath());
+ dir_combo->setInsertionPolicy(TQComboBox::NoInsertion);
+ dir_combo->setEditText(TQDir::homeDirPath());
url_requester = new KURLRequester( dir_combo, this );
url_requester->completionObject()->setMode(KURLCompletion::DirCompletion);
@@ -149,27 +149,27 @@ GrepDialog::GrepDialog( GrepViewPart * part, QWidget *parent, const char *name )
dir_layout->addWidget( url_requester, 10 );
synch_button = new KPushButton( this );
- QIconSet set = SmallIconSet( "dirsynch" );
- QPixmap pix = set.pixmap( QIconSet::Small, QIconSet::Normal );
+ TQIconSet set = SmallIconSet( "dirsynch" );
+ TQPixmap pix = set.pixmap( TQIconSet::Small, TQIconSet::Normal );
synch_button->setFixedSize( pix.width()+8, pix.height()+8 );
synch_button->setIconSet( set );
- synch_button->setAccel( QKeySequence( "Alt+y") );
- QToolTip::add( synch_button, i18n("Set directory to that of the current file (Alt+Y)") );
+ synch_button->setAccel( TQKeySequence( "Alt+y") );
+ TQToolTip::add( synch_button, i18n("Set directory to that of the current file (Alt+Y)") );
dir_layout->addWidget( synch_button );
- QBoxLayout *dir_opts_layout = new QHBoxLayout(15);
+ TQBoxLayout *dir_opts_layout = new TQHBoxLayout(15);
layout->addLayout(dir_opts_layout, 4, 1);
- recursive_box = new QCheckBox(i18n("Rec&ursive"), this);
+ recursive_box = new TQCheckBox(i18n("Rec&ursive"), this);
recursive_box->setChecked(config->readBoolEntry("recursive", true));
dir_opts_layout->addWidget(recursive_box);
- use_project_box = new QCheckBox(i18n("Limit search to &project files"), this);
- use_project_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ use_project_box = new TQCheckBox(i18n("Limit search to &project files"), this);
+ use_project_box->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
use_project_box->setChecked(config->readBoolEntry("search_project_files", true));
dir_opts_layout->addWidget(use_project_box);
- QLabel *files_label = new QLabel(i18n("&Files:"), this);
+ TQLabel *files_label = new TQLabel(i18n("&Files:"), this);
layout->addWidget(files_label, 5, 0, AlignRight | AlignVCenter);
files_combo = new KComboBox(true, this);
@@ -177,10 +177,10 @@ GrepDialog::GrepDialog( GrepViewPart * part, QWidget *parent, const char *name )
files_combo->insertStrList(filepatterns);
layout->addWidget(files_combo, 5, 1);
- QLabel *exclude_label = new QLabel(i18n("&Exclude:"), this);
+ TQLabel *exclude_label = new TQLabel(i18n("&Exclude:"), this);
layout->addWidget(exclude_label, 6, 0, AlignRight | AlignVCenter);
- QStringList exclude_list = config->readListEntry("exclude_patterns");
+ TQStringList exclude_list = config->readListEntry("exclude_patterns");
exclude_combo = new KComboBox(true, this);
exclude_label->setBuddy(files_combo->focusProxy());
if (exclude_list.count()) {
@@ -193,19 +193,19 @@ GrepDialog::GrepDialog( GrepViewPart * part, QWidget *parent, const char *name )
}
layout->addWidget(exclude_combo, 6, 1);
- QBoxLayout *other_opts_layout = new QHBoxLayout(15);
+ TQBoxLayout *other_opts_layout = new TQHBoxLayout(15);
layout->addLayout(other_opts_layout, 7, 1);
- keep_output_box = new QCheckBox(i18n("New view"), this);
+ keep_output_box = new TQCheckBox(i18n("New view"), this);
keep_output_box->setChecked(config->readBoolEntry("new_view", true));
other_opts_layout->addWidget(keep_output_box);
- no_find_err_box = new QCheckBox(i18n("&Suppress find errors"), this);
- no_find_err_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ no_find_err_box = new TQCheckBox(i18n("&Suppress find errors"), this);
+ no_find_err_box->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
no_find_err_box->setChecked(config->readBoolEntry("no_find_errs", true));
other_opts_layout->addWidget(no_find_err_box);
- QBoxLayout *button_layout = new QHBoxLayout(4);
+ TQBoxLayout *button_layout = new TQHBoxLayout(4);
layout->addLayout(button_layout, 8, 1);
search_button = new KPushButton(KGuiItem(i18n("Sea&rch"),"grep"), this);
search_button->setDefault(true);
@@ -216,7 +216,7 @@ GrepDialog::GrepDialog( GrepViewPart * part, QWidget *parent, const char *name )
resize(sizeHint());
- QWhatsThis::add(pattern_combo,
+ TQWhatsThis::add(pattern_combo,
i18n("<qt>Enter the regular expression you want to search for here.<p>"
"Possible meta characters are:"
"<ul>"
@@ -240,31 +240,31 @@ GrepDialog::GrepDialog( GrepViewPart * part, QWidget *parent, const char *name )
"Furthermore, backreferences to bracketed subexpressions are "
"available via the notation \\<i>n</i>.</qt>"
));
- QWhatsThis::add(files_combo,
+ TQWhatsThis::add(files_combo,
i18n("Enter the file name pattern of the files to search here. "
"You may give several patterns separated by commas"));
- QWhatsThis::add(template_edit,
+ TQWhatsThis::add(template_edit,
i18n("You can choose a template for the pattern from the combo box "
"and edit it here. The string %s in the template is replaced "
"by the pattern input field, resulting in the regular expression "
"to search for."));
- connect( template_combo, SIGNAL(activated(int)),
- SLOT(templateActivated(int)) );
- connect( search_button, SIGNAL(clicked()),
- SLOT(slotSearchClicked()) );
- connect( done_button, SIGNAL(clicked()),
- SLOT(hide()) );
- connect( pattern_combo->lineEdit(), SIGNAL( textChanged ( const QString & ) ),
- SLOT( slotPatternChanged( const QString & ) ) );
- connect( synch_button, SIGNAL(clicked()), this, SLOT(slotSynchDirectory()) );
+ connect( template_combo, TQT_SIGNAL(activated(int)),
+ TQT_SLOT(templateActivated(int)) );
+ connect( search_button, TQT_SIGNAL(clicked()),
+ TQT_SLOT(slotSearchClicked()) );
+ connect( done_button, TQT_SIGNAL(clicked()),
+ TQT_SLOT(hide()) );
+ connect( pattern_combo->lineEdit(), TQT_SIGNAL( textChanged ( const TQString & ) ),
+ TQT_SLOT( slotPatternChanged( const TQString & ) ) );
+ connect( synch_button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSynchDirectory()) );
slotPatternChanged( pattern_combo->currentText() );
}
-// Returns the contents of a QComboBox as a QStringList
-static QStringList qCombo2StringList( QComboBox* combo )
+// Returns the contents of a TQComboBox as a QStringList
+static TQStringList qCombo2StringList( TQComboBox* combo )
{
- QStringList list;
+ TQStringList list;
if (!combo)
return list;
for (int i = 0; i < combo->count(); ++i ) {
@@ -288,7 +288,7 @@ GrepDialog::~GrepDialog()
config->writeEntry("exclude_patterns", qCombo2StringList(exclude_combo));
}
-void GrepDialog::slotPatternChanged( const QString & _text )
+void GrepDialog::slotPatternChanged( const TQString & _text )
{
search_button->setEnabled( !_text.isEmpty() );
}
@@ -299,7 +299,7 @@ void GrepDialog::templateActivated(int index)
}
// Find out whether the string s is already contained in combo
-static bool qComboContains( const QString& s, QComboBox* combo )
+static bool qComboContains( const TQString& s, TQComboBox* combo )
{
if (!combo)
return false;
@@ -348,15 +348,15 @@ void GrepDialog::show()
// managers and Qt versions
if (isVisible())
hide();
-// QDialog::hide();
- QDialog::show();
+// TQDialog::hide();
+ TQDialog::show();
pattern_combo->setFocus();
}
void GrepDialog::hide()
{
pattern_combo->setFocus();
- QDialog::hide();
+ TQDialog::hide();
}
void GrepDialog::slotSynchDirectory( )
diff --git a/parts/grepview/grepdlg.h b/parts/grepview/grepdlg.h
index c24332bd..11b8d275 100644
--- a/parts/grepview/grepdlg.h
+++ b/parts/grepview/grepdlg.h
@@ -12,9 +12,9 @@
#ifndef _GREPDLG_H_
#define _GREPDLG_H_
-#include <qdialog.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
+#include <tqdialog.h>
+#include <tqcombobox.h>
+#include <tqcheckbox.h>
#include <kcombobox.h>
#include <klineedit.h>
@@ -30,24 +30,24 @@ class GrepDialog : public QDialog
Q_OBJECT
public:
- GrepDialog( GrepViewPart * part, QWidget *parent=0, const char *name=0 );
+ GrepDialog( GrepViewPart * part, TQWidget *parent=0, const char *name=0 );
~GrepDialog();
- void setPattern(const QString &pattern)
+ void setPattern(const TQString &pattern)
{ pattern_combo->setEditText(pattern); }
- void setDirectory(const QString &dir)
+ void setDirectory(const TQString &dir)
{ dir_combo->setEditText(dir); }
void setEnableProjectBox(bool enable);
- QString patternString() const
+ TQString patternString() const
{ return pattern_combo->currentText(); }
- QString templateString() const
+ TQString templateString() const
{ return template_edit->text(); }
- QString filesString() const
+ TQString filesString() const
{ return files_combo->currentText(); }
- QString excludeString() const
+ TQString excludeString() const
{ return exclude_combo->currentText(); }
- QString directoryString() const
+ TQString directoryString() const
{ return dir_combo->currentText(); }
bool useProjectFilesFlag() const
@@ -72,7 +72,7 @@ signals:
private slots:
void templateActivated(int index);
void slotSearchClicked();
- void slotPatternChanged( const QString &);
+ void slotPatternChanged( const TQString &);
void slotSynchDirectory();
private:
@@ -83,15 +83,15 @@ private:
KComboBox * dir_combo;
KURLRequester * url_requester;
- QCheckBox *regexp_box;
- QCheckBox *recursive_box;
- QCheckBox *use_project_box;
- QCheckBox *no_find_err_box;
- QCheckBox *case_sens_box;
- QCheckBox *keep_output_box;
+ TQCheckBox *regexp_box;
+ TQCheckBox *recursive_box;
+ TQCheckBox *use_project_box;
+ TQCheckBox *no_find_err_box;
+ TQCheckBox *case_sens_box;
+ TQCheckBox *keep_output_box;
KConfig* config;
- QPushButton *search_button;
- QPushButton *synch_button;
+ TQPushButton *search_button;
+ TQPushButton *synch_button;
GrepViewPart * m_part;
};
diff --git a/parts/grepview/grepviewpart.cpp b/parts/grepview/grepviewpart.cpp
index 7b1f75d9..6765f87f 100644
--- a/parts/grepview/grepviewpart.cpp
+++ b/parts/grepview/grepviewpart.cpp
@@ -11,9 +11,9 @@
#include "grepviewpart.h"
-#include <qpopupmenu.h>
-#include <qvbox.h>
-#include <qwhatsthis.h>
+#include <tqpopupmenu.h>
+#include <tqvbox.h>
+#include <tqwhatsthis.h>
#include <kdebug.h>
#include <klocale.h>
#include <kaction.h>
@@ -34,24 +34,24 @@ static const KDevPluginInfo data("kdevgrepview");
K_EXPORT_COMPONENT_FACTORY(libkdevgrepview, GrepViewFactory(data))
-GrepViewPart::GrepViewPart( QObject *parent, const char *name, const QStringList & )
+GrepViewPart::GrepViewPart( TQObject *parent, const char *name, const TQStringList & )
: KDevPlugin( &data, parent, name ? name : "GrepViewPart" )
{
setInstance(GrepViewFactory::instance());
setXMLFile("kdevgrepview.rc");
- connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)),
- this, SLOT(stopButtonClicked(KDevPlugin*)) );
- connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
- connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
- connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
- this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+ connect( core(), TQT_SIGNAL(stopButtonClicked(KDevPlugin*)),
+ this, TQT_SLOT(stopButtonClicked(KDevPlugin*)) );
+ connect( core(), TQT_SIGNAL(projectOpened()), this, TQT_SLOT(projectOpened()) );
+ connect( core(), TQT_SIGNAL(projectClosed()), this, TQT_SLOT(projectClosed()) );
+ connect( core(), TQT_SIGNAL(contextMenu(TQPopupMenu *, const Context *)),
+ this, TQT_SLOT(contextMenu(TQPopupMenu *, const Context *)) );
m_widget = new GrepViewWidget(this);
m_widget->setIcon(SmallIcon("grep"));
m_widget->setCaption(i18n("Grep Output"));
- QWhatsThis::add(m_widget, i18n("<b>Find in files</b><p>"
+ TQWhatsThis::add(m_widget, i18n("<b>Find in files</b><p>"
"This window contains the output of a grep "
"command. Clicking on an item in the list "
"will automatically open the corresponding "
@@ -63,7 +63,7 @@ GrepViewPart::GrepViewPart( QObject *parent, const char *name, const QStringList
KAction *action;
action = new KAction(i18n("Find in Fi&les..."), "grep", CTRL+ALT+Key_F,
- this, SLOT(slotGrep()),
+ this, TQT_SLOT(slotGrep()),
actionCollection(), "edit_grep");
action->setToolTip( i18n("Search for expressions over several files") );
action->setWhatsThis( i18n("<b>Find in files</b><p>"
@@ -105,19 +105,19 @@ void GrepViewPart::projectClosed()
}
-void GrepViewPart::contextMenu(QPopupMenu *popup, const Context *context)
+void GrepViewPart::contextMenu(TQPopupMenu *popup, const Context *context)
{
kdDebug(9001) << "context in grepview" << endl;
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("Grep: %1").arg(squeezed),
- this, SLOT(slotContextGrep()) );
+ this, TQT_SLOT(slotContextGrep()) );
popup->setWhatsThis(id, i18n("<b>Grep</b><p>Opens the find in files dialog "
"and sets the pattern to the text under the cursor."));
popup->insertSeparator();
@@ -129,7 +129,7 @@ void GrepViewPart::slotGrep()
{
if ( !m_widget->isRunning() )
{
- QString contextString = KDevEditorUtil::currentSelection( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+ TQString contextString = KDevEditorUtil::currentSelection( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
if ( contextString.isEmpty() )
{
contextString = KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
diff --git a/parts/grepview/grepviewpart.h b/parts/grepview/grepviewpart.h
index c6031a3b..256b44d0 100644
--- a/parts/grepview/grepviewpart.h
+++ b/parts/grepview/grepviewpart.h
@@ -12,7 +12,7 @@
#ifndef _GREPVIEWPART_H_
#define _GREPVIEWPART_H_
-#include <qguardedptr.h>
+#include <tqguardedptr.h>
#include <kdevgenericfactory.h>
#include "kdevplugin.h"
@@ -27,21 +27,21 @@ class GrepViewPart : public KDevPlugin
Q_OBJECT
public:
- GrepViewPart( QObject *parent, const char *name, const QStringList & );
+ GrepViewPart( TQObject *parent, const char *name, const TQStringList & );
~GrepViewPart();
private slots:
void stopButtonClicked(KDevPlugin *which);
void projectOpened();
void projectClosed();
- void contextMenu(QPopupMenu *popup, const Context *context);
+ void contextMenu(TQPopupMenu *popup, const Context *context);
void slotGrep();
void slotContextGrep();
private:
- QGuardedPtr<GrepViewWidget> m_widget;
- QString m_popupstr;
+ TQGuardedPtr<GrepViewWidget> m_widget;
+ TQString m_popupstr;
friend class GrepViewWidget;
};
diff --git a/parts/grepview/grepviewwidget.cpp b/parts/grepview/grepviewwidget.cpp
index 326e2897..78aa4224 100644
--- a/parts/grepview/grepviewwidget.cpp
+++ b/parts/grepview/grepviewwidget.cpp
@@ -9,11 +9,11 @@
* *
***************************************************************************/
-#include <qdir.h>
-#include <qlayout.h>
-#include <qregexp.h>
-#include <qpainter.h>
-#include <qtoolbutton.h>
+#include <tqdir.h>
+#include <tqlayout.h>
+#include <tqregexp.h>
+#include <tqpainter.h>
+#include <tqtoolbutton.h>
#include <kdialogbase.h>
#include <klocale.h>
#include <kprocess.h>
@@ -40,26 +40,26 @@ using namespace KTextEditor;
class GrepListBoxItem : public ProcessListBoxItem
{
public:
- GrepListBoxItem(const QString &fileName, const QString &lineNumber, const QString &text, bool showFilename);
- QString filename()
+ GrepListBoxItem(const TQString &fileName, const TQString &lineNumber, const TQString &text, bool showFilename);
+ TQString filename()
{ return fileName; }
int linenumber()
{ return lineNumber.toInt(); }
virtual bool isCustomItem();
private:
- virtual void paint(QPainter *p);
- QString fileName, lineNumber, text;
+ virtual void paint(TQPainter *p);
+ TQString fileName, lineNumber, text;
bool show;
};
-GrepListBoxItem::GrepListBoxItem(const QString &fileName, const QString &lineNumber, const QString &text, bool showFilename)
- : ProcessListBoxItem( QString::null, Normal),
+GrepListBoxItem::GrepListBoxItem(const TQString &fileName, const TQString &lineNumber, const TQString &text, bool showFilename)
+ : ProcessListBoxItem( TQString::null, Normal),
fileName(fileName), lineNumber(lineNumber), text(text.stripWhiteSpace()),
show(showFilename)
{
- this->text.replace( QChar('\t'), QString(" ") );
+ this->text.replace( TQChar('\t'), TQString(" ") );
}
@@ -69,11 +69,11 @@ bool GrepListBoxItem::isCustomItem()
}
-void GrepListBoxItem::paint(QPainter *p)
+void GrepListBoxItem::paint(TQPainter *p)
{
- QColor base, dim, result, bkground;
+ TQColor base, dim, result, bkground;
if (listBox()) {
- const QColorGroup& group = listBox()->palette().active();
+ const TQColorGroup& group = listBox()->palette().active();
if (isSelected()) {
bkground = group.button();
base = group.buttonText();
@@ -96,11 +96,11 @@ void GrepListBoxItem::paint(QPainter *p)
else
bkground = Qt::white;
}
- QFontMetrics fm = p->fontMetrics();
- QString stx = lineNumber + ": ";
+ TQFontMetrics fm = p->fontMetrics();
+ TQString stx = lineNumber + ": ";
int y = fm.ascent()+fm.leading()/2;
int x = 3;
- p->fillRect(p->window(), QBrush(bkground));
+ p->fillRect(p->window(), TQBrush(bkground));
if (show)
{
p->setPen(dim);
@@ -110,8 +110,8 @@ void GrepListBoxItem::paint(QPainter *p)
else
{
p->setPen(base);
- QFont font1(p->font());
- QFont font2(font1);
+ TQFont font1(p->font());
+ TQFont font2(font1);
font2.setBold(true);
p->setFont(font2);
p->drawText(x, y, stx);
@@ -124,9 +124,9 @@ void GrepListBoxItem::paint(QPainter *p)
}
-GrepViewWidget::GrepViewWidget(GrepViewPart *part) : QWidget(0, "grepview widget")
+GrepViewWidget::GrepViewWidget(GrepViewPart *part) : TQWidget(0, "grepview widget")
{
- m_layout = new QHBoxLayout(this, 0, -1, "greplayout");
+ m_layout = new TQHBoxLayout(this, 0, -1, "greplayout");
m_tabWidget = new KTabWidget(this);
@@ -137,25 +137,25 @@ GrepViewWidget::GrepViewWidget(GrepViewPart *part) : QWidget(0, "grepview widge
m_tabWidget->addTab(m_curOutput, i18n("Search Results"));
grepdlg = new GrepDialog( part, this, "grep widget");
- connect( grepdlg, SIGNAL(searchClicked()), this, SLOT(searchActivated()) );
- connect( m_curOutput, SIGNAL(processExited(KProcess* )), this, SLOT(slotSearchProcessExited()) );
+ connect( grepdlg, TQT_SIGNAL(searchClicked()), this, TQT_SLOT(searchActivated()) );
+ connect( m_curOutput, TQT_SIGNAL(processExited(KProcess* )), this, TQT_SLOT(slotSearchProcessExited()) );
- connect( m_tabWidget, SIGNAL(currentChanged(QWidget*)), this, SLOT(slotOutputTabChanged()) );
+ connect( m_tabWidget, TQT_SIGNAL(currentChanged(TQWidget*)), this, TQT_SLOT(slotOutputTabChanged()) );
- connect( m_curOutput, SIGNAL(clicked(QListBoxItem*)),
- this, SLOT(slotExecuted(QListBoxItem*)) );
- connect( m_curOutput, SIGNAL(returnPressed(QListBoxItem*)),
- this, SLOT(slotExecuted(QListBoxItem*)) );
+ connect( m_curOutput, TQT_SIGNAL(clicked(TQListBoxItem*)),
+ this, TQT_SLOT(slotExecuted(TQListBoxItem*)) );
+ connect( m_curOutput, TQT_SIGNAL(returnPressed(TQListBoxItem*)),
+ this, TQT_SLOT(slotExecuted(TQListBoxItem*)) );
- connect( m_curOutput, SIGNAL(contextMenuRequested( QListBoxItem*, const QPoint&)), this, SLOT(popupMenu(QListBoxItem*, const QPoint&)));
+ connect( m_curOutput, TQT_SIGNAL(contextMenuRequested( TQListBoxItem*, const TQPoint&)), this, TQT_SLOT(popupMenu(TQListBoxItem*, const TQPoint&)));
m_part = part;
- m_closeButton = new QToolButton(m_tabWidget);//@todo change text/icon
+ m_closeButton = new TQToolButton(m_tabWidget);//@todo change text/icon
m_closeButton->setIconSet(SmallIconSet("tab_remove"));
m_closeButton->setEnabled(false);
- connect (m_closeButton, SIGNAL(clicked()), this, SLOT(slotCloseCurrentOutput()));
+ connect (m_closeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCloseCurrentOutput()));
m_tabWidget->setCornerWidget(m_closeButton);
}
@@ -173,7 +173,7 @@ void GrepViewWidget::showDialog()
SelectionInterface *selectIface = dynamic_cast<SelectionInterface*>(ro_part);
if(selectIface && selectIface->hasSelection())
{
- QString selText = selectIface->selection();
+ TQString selText = selectIface->selection();
if(!selText.contains('\n'))
{
grepdlg->setPattern(selText);
@@ -194,10 +194,10 @@ void GrepViewWidget::showDialog()
}
// @todo - put this somewhere common - or just use Qt if possible
-static QString escape(const QString &str)
+static TQString escape(const TQString &str)
{
- QString escaped("[]{}()\\^$?.+-*|");
- QString res;
+ TQString escaped("[]{}()\\^$?.+-*|");
+ TQString res;
for (uint i=0; i < str.length(); ++i)
{
@@ -210,7 +210,7 @@ static QString escape(const QString &str)
}
-void GrepViewWidget::showDialogWithPattern(QString pattern)
+void GrepViewWidget::showDialogWithPattern(TQString pattern)
{
// Before anything, this removes line feeds from the
// beginning and the end.
@@ -248,47 +248,47 @@ void GrepViewWidget::searchActivated()
m_curOutput->setLastFileName("");
m_curOutput->setMatchCount( 0 );
- QString command, files;
+ TQString command, files;
// waba: code below breaks on filenames containing a ',' !!!
- QStringList filelist = QStringList::split(",", grepdlg->filesString());
+ TQStringList filelist = TQStringList::split(",", grepdlg->filesString());
if (grepdlg->useProjectFilesFlag())
{
KDevProject *openProject = m_part->project();
if (openProject)
{
- QString tmpFilePath;
- QStringList projectFiles = openProject->allFiles();
+ TQString tmpFilePath;
+ TQStringList projectFiles = openProject->allFiles();
if (!projectFiles.isEmpty())
{
- tmpFilePath = openProject->projectDirectory() + QChar(QDir::separator()) + ".grep.tmp";
- QString dir = grepdlg->directoryString(), file;
- QValueList<QRegExp> regExpList;
+ tmpFilePath = openProject->projectDirectory() + TQChar(TQDir::separator()) + ".grep.tmp";
+ TQString dir = grepdlg->directoryString(), file;
+ TQValueList<TQRegExp> regExpList;
- if (dir.endsWith(QChar(QDir::separator())))
+ if (dir.endsWith(TQChar(TQDir::separator())))
dir.truncate(dir.length() - 1);
if (!filelist.isEmpty())
{
- for (QStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it)
- regExpList.append(QRegExp(*it, true, true));
+ for (TQStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it)
+ regExpList.append(TQRegExp(*it, true, true));
}
m_tempFile.setName(tmpFilePath);
if (m_tempFile.open(IO_WriteOnly))
{
- QTextStream out(&m_tempFile);
- for (QStringList::Iterator it = projectFiles.begin(); it != projectFiles.end(); ++it)
+ TQTextStream out(&m_tempFile);
+ for (TQStringList::Iterator it = projectFiles.begin(); it != projectFiles.end(); ++it)
{
- file = QDir::cleanDirPath(openProject->projectDirectory() + QChar(QDir::separator()) + *it);
+ file = TQDir::cleanDirPath(openProject->projectDirectory() + TQChar(TQDir::separator()) + *it);
- QFileInfo info(file);
+ TQFileInfo info(file);
if (grepdlg->recursiveFlag() && !info.dirPath(true).startsWith(dir)) continue;
if (!grepdlg->recursiveFlag() && info.dirPath(true) != dir) continue;
bool matchOne = regExpList.count() == 0;
- for (QValueList<QRegExp>::Iterator it2 = regExpList.begin(); it2 != regExpList.end() && !matchOne; ++it2)
+ for (TQValueList<TQRegExp>::Iterator it2 = regExpList.begin(); it2 != regExpList.end() && !matchOne; ++it2)
matchOne = (*it2).exactMatch(file);
if (matchOne)
@@ -312,14 +312,14 @@ void GrepViewWidget::searchActivated()
{
if (!filelist.isEmpty())
{
- QStringList::Iterator it(filelist.begin());
+ TQStringList::Iterator it(filelist.begin());
files = KShellProcess::quote(*it);
++it;
for (; it != filelist.end(); ++it)
files += " -o -name " + KShellProcess::quote(*it);
}
- QString filepattern = "find ";
+ TQString filepattern = "find ";
filepattern += KShellProcess::quote(grepdlg->directoryString());
if (!grepdlg->recursiveFlag())
filepattern += " -maxdepth 1";
@@ -332,10 +332,10 @@ void GrepViewWidget::searchActivated()
command = filepattern + " " ;
}
- QStringList excludelist = QStringList::split(",", grepdlg->excludeString());
+ TQStringList excludelist = TQStringList::split(",", grepdlg->excludeString());
if (!excludelist.isEmpty())
{
- QStringList::Iterator it(excludelist.begin());
+ TQStringList::Iterator it(excludelist.begin());
command += "| grep -v ";
for (; it != excludelist.end(); ++it)
command += "-e " + KShellProcess::quote(*it) + " ";
@@ -364,11 +364,11 @@ void GrepViewWidget::searchActivated()
command += "-e ";
m_lastPattern = grepdlg->patternString();
- QString pattern = grepdlg->templateString();
+ TQString pattern = grepdlg->templateString();
if (grepdlg->regexpFlag())
- pattern.replace(QRegExp("%s"), grepdlg->patternString());
+ pattern.replace(TQRegExp("%s"), grepdlg->patternString());
else
- pattern.replace(QRegExp("%s"), escape( grepdlg->patternString() ) );
+ pattern.replace(TQRegExp("%s"), escape( grepdlg->patternString() ) );
command += KShellProcess::quote(pattern);
m_curOutput->startJob("", command);
@@ -377,7 +377,7 @@ void GrepViewWidget::searchActivated()
}
-void GrepViewWidget::slotExecuted(QListBoxItem* item)
+void GrepViewWidget::slotExecuted(TQListBoxItem* item)
{
ProcessListBoxItem *i = static_cast<ProcessListBoxItem*>(item);
if (!i || !i->isCustomItem())
@@ -388,19 +388,19 @@ void GrepViewWidget::slotExecuted(QListBoxItem* item)
}
-void GrepViewProcessWidget::insertStdoutLine(const QCString &line)
+void GrepViewProcessWidget::insertStdoutLine(const TQCString &line)
{
int pos;
- QString filename, linenumber, rest;
+ TQString filename, linenumber, rest;
- QString str;
+ TQString str;
if( !grepbuf.isEmpty() )
{
- str = QString::fromLocal8Bit( grepbuf+line );
+ str = TQString::fromLocal8Bit( grepbuf+line );
grepbuf.truncate( 0 );
}else
{
- str = QString::fromLocal8Bit( line );
+ str = TQString::fromLocal8Bit( line );
}
if ( (pos = str.find(':')) != -1)
{
@@ -432,11 +432,11 @@ void GrepViewProcessWidget::insertStdoutLine(const QCString &line)
void GrepViewWidget::projectChanged(KDevProject *project)
{
- QString dir = project? project->projectDirectory() : QDir::homeDirPath();
+ TQString dir = project? project->projectDirectory() : TQDir::homeDirPath();
grepdlg->setDirectory(dir);
}
-void GrepViewWidget::popupMenu(QListBoxItem*, const QPoint& p)
+void GrepViewWidget::popupMenu(TQListBoxItem*, const TQPoint& p)
{
if(m_curOutput->isRunning()) return;
@@ -452,17 +452,17 @@ void GrepViewWidget::popupMenu(QListBoxItem*, const QPoint& p)
void GrepViewWidget::slotKeepOutput( )
{
- if ( m_lastPattern == QString::null ) return;
+ if ( m_lastPattern == TQString::null ) return;
m_tabWidget->changeTab(m_curOutput, m_lastPattern);
m_curOutput = new GrepViewProcessWidget(m_tabWidget);
m_tabWidget->insertTab(m_curOutput, i18n("Search Results"), 0);
- connect( m_curOutput, SIGNAL(clicked(QListBoxItem*)), this, SLOT(slotExecuted(QListBoxItem*)) );
- connect( m_curOutput, SIGNAL(returnPressed(QListBoxItem*)), this, SLOT(slotExecuted(QListBoxItem*)) );
- connect( m_curOutput, SIGNAL(processExited(KProcess* )), this, SLOT(slotSearchProcessExited()) );
- connect( m_curOutput, SIGNAL(contextMenuRequested( QListBoxItem*, const QPoint&)), this, SLOT(popupMenu(QListBoxItem*, const QPoint&)));
+ connect( m_curOutput, TQT_SIGNAL(clicked(TQListBoxItem*)), this, TQT_SLOT(slotExecuted(TQListBoxItem*)) );
+ connect( m_curOutput, TQT_SIGNAL(returnPressed(TQListBoxItem*)), this, TQT_SLOT(slotExecuted(TQListBoxItem*)) );
+ connect( m_curOutput, TQT_SIGNAL(processExited(KProcess* )), this, TQT_SLOT(slotSearchProcessExited()) );
+ connect( m_curOutput, TQT_SIGNAL(contextMenuRequested( TQListBoxItem*, const TQPoint&)), this, TQT_SLOT(popupMenu(TQListBoxItem*, const TQPoint&)));
}
void GrepViewWidget::slotCloseCurrentOutput( )
@@ -526,7 +526,7 @@ void GrepViewProcessWidget::childFinished( bool normal, int status )
ProcessWidget::childFinished(normal, status);
}
-void GrepViewProcessWidget::addPartialStdoutLine(const QCString & line)
+void GrepViewProcessWidget::addPartialStdoutLine(const TQCString & line)
{
grepbuf += line;
}
diff --git a/parts/grepview/grepviewwidget.h b/parts/grepview/grepviewwidget.h
index bf3fca4b..04206973 100644
--- a/parts/grepview/grepviewwidget.h
+++ b/parts/grepview/grepviewwidget.h
@@ -13,8 +13,8 @@
#define _GREPVIEWWIDGET_H_
#include "processwidget.h"
-#include <qwidget.h>
-#include <qfile.h>
+#include <tqwidget.h>
+#include <tqfile.h>
class GrepDialog;
class GrepViewPart;
@@ -26,7 +26,7 @@ class GrepViewProcessWidget : public ProcessWidget
{
Q_OBJECT
public:
- GrepViewProcessWidget(QWidget* parent) : ProcessWidget(parent) {};
+ GrepViewProcessWidget(TQWidget* parent) : ProcessWidget(parent) {};
~GrepViewProcessWidget(){};
void setMatchCount(int newCount)
{
@@ -38,22 +38,22 @@ public:
m_matchCount += amount;
}
- void setLastFileName(const QString& lastFileName)
+ void setLastFileName(const TQString& lastFileName)
{
_lastfilename = lastFileName;
}
public slots:
- virtual void insertStdoutLine(const QCString &line);
- virtual void addPartialStdoutLine( const QCString &line );
+ virtual void insertStdoutLine(const TQCString &line);
+ virtual void addPartialStdoutLine( const TQCString &line );
protected:
virtual void childFinished(bool normal, int status);
private:
int m_matchCount;
- QString _lastfilename;
- QCString grepbuf;
+ TQString _lastfilename;
+ TQCString grepbuf;
};
class GrepViewWidget : public QWidget
@@ -70,7 +70,7 @@ public:
public slots:
void showDialog();
- void showDialogWithPattern(QString pattern);
+ void showDialogWithPattern(TQString pattern);
private slots:
void searchActivated();
@@ -78,8 +78,8 @@ private slots:
* If item is a valid result of a search run, it opens the file at the position, where the stuff was found.
* @param item item containing filename and linenumber of the file to open.
*/
- void slotExecuted(QListBoxItem *item);
- void popupMenu(QListBoxItem*, const QPoint& p);
+ void slotExecuted(TQListBoxItem *item);
+ void popupMenu(TQListBoxItem*, const TQPoint& p);
/**
* Creates a new tab containing the current output in the main tab and clears the main tab.
*/
@@ -98,14 +98,14 @@ private slots:
private:
- QHBoxLayout* m_layout;
+ TQHBoxLayout* m_layout;
KTabWidget* m_tabWidget;
GrepViewProcessWidget* m_curOutput;
GrepDialog *grepdlg;
GrepViewPart *m_part;
- QToolButton* m_closeButton;
- QString m_lastPattern;
- QFile m_tempFile;
+ TQToolButton* m_closeButton;
+ TQString m_lastPattern;
+ TQFile m_tempFile;
};
#endif