summaryrefslogtreecommitdiffstats
path: root/parts/grepview
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
commit48d4a26399959121f33d2bc3bfe51c7827b654fc (patch)
tree5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /parts/grepview
parent7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff)
downloadtdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz
tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/grepview')
-rw-r--r--parts/grepview/README.dox2
-rw-r--r--parts/grepview/grepdlg.cpp54
-rw-r--r--parts/grepview/grepdlg.h5
-rw-r--r--parts/grepview/grepviewpart.cpp8
-rw-r--r--parts/grepview/grepviewpart.h3
-rw-r--r--parts/grepview/grepviewwidget.cpp38
-rw-r--r--parts/grepview/grepviewwidget.h6
7 files changed, 60 insertions, 56 deletions
diff --git a/parts/grepview/README.dox b/parts/grepview/README.dox
index d5e9130a..23e0eac3 100644
--- a/parts/grepview/README.dox
+++ b/parts/grepview/README.dox
@@ -1,5 +1,5 @@
/** \class GrepViewPart
-Integrates "find|grep" in KDevelop - allows fast searching of multiple files using patterns or regular expressions.
+Integrates "tqfind|grep" in KDevelop - allows fast searching of multiple files using patterns or regular expressions.
\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
diff --git a/parts/grepview/grepdlg.cpp b/parts/grepview/grepdlg.cpp
index 80264a92..80c06c8b 100644
--- a/parts/grepview/grepdlg.cpp
+++ b/parts/grepview/grepdlg.cpp
@@ -80,33 +80,33 @@ const char *filepatterns[] = {
};
-GrepDialog::GrepDialog( GrepViewPart * part, TQWidget *parent, const char *name )
- : TQDialog(parent, name, false), m_part( part )
+GrepDialog::GrepDialog( GrepViewPart * part, TQWidget *tqparent, const char *name )
+ : TQDialog(tqparent, name, false), m_part( part )
{
setCaption(i18n("Find in Files"));
config = GrepViewFactory::instance()->config();
config->setGroup("GrepDialog");
- TQGridLayout *layout = new TQGridLayout(this, 9, 2, 10, 4);
- layout->setColStretch(0, 0);
- layout->setColStretch(1, 20);
+ TQGridLayout *tqlayout = new TQGridLayout(this, 9, 2, 10, 4);
+ tqlayout->setColStretch(0, 0);
+ tqlayout->setColStretch(1, 20);
TQLabel *pattern_label = new TQLabel(i18n("&Pattern:"), this);
- layout->addWidget(pattern_label, 0, 0, AlignRight | AlignVCenter);
+ tqlayout->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(TQComboBox::NoInsertion);
- layout->addWidget(pattern_combo, 0, 1);
+ tqlayout->addWidget(pattern_combo, 0, 1);
TQLabel *template_label = new TQLabel(i18n("&Template:"), this);
- layout->addWidget(template_label, 1, 0, AlignRight | AlignVCenter);
+ tqlayout->addWidget(template_label, 1, 0, AlignRight | AlignVCenter);
TQBoxLayout *template_layout = new TQHBoxLayout(4);
- layout->addLayout(template_layout, 1, 1);
+ tqlayout->addLayout(template_layout, 1, 1);
template_edit = new KLineEdit(this);
template_label->setBuddy(template_edit);
@@ -118,22 +118,22 @@ GrepDialog::GrepDialog( GrepViewPart * part, TQWidget *parent, const char *name
template_layout->addWidget(template_combo, 0);
TQBoxLayout *search_opts_layout = new TQHBoxLayout(15);
- layout->addLayout(search_opts_layout, 2, 1);
+ tqlayout->addLayout(search_opts_layout, 2, 1);
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 TQCheckBox(i18n("C&ase sensitive"), this);
- case_sens_box->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
+ case_sens_box->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
case_sens_box->setChecked(config->readBoolEntry("case_sens", true));
search_opts_layout->addWidget(case_sens_box);
TQLabel *dir_label = new TQLabel(i18n("&Directory:"), this);
- layout->addWidget(dir_label, 3, 0, AlignRight | AlignVCenter);
+ tqlayout->addWidget(dir_label, 3, 0, AlignRight | AlignVCenter);
TQBoxLayout *dir_layout = new TQHBoxLayout(4);
- layout->addLayout(dir_layout, 3, 1);
+ tqlayout->addLayout(dir_layout, 3, 1);
dir_combo = new KComboBox( true, this );
dir_combo->insertStringList(config->readPathListEntry("LastSearchPaths"));
@@ -158,31 +158,31 @@ GrepDialog::GrepDialog( GrepViewPart * part, TQWidget *parent, const char *name
dir_layout->addWidget( synch_button );
TQBoxLayout *dir_opts_layout = new TQHBoxLayout(15);
- layout->addLayout(dir_opts_layout, 4, 1);
+ tqlayout->addLayout(dir_opts_layout, 4, 1);
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 TQCheckBox(i18n("Limit search to &project files"), this);
- use_project_box->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
+ use_project_box->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
use_project_box->setChecked(config->readBoolEntry("search_project_files", true));
dir_opts_layout->addWidget(use_project_box);
TQLabel *files_label = new TQLabel(i18n("&Files:"), this);
- layout->addWidget(files_label, 5, 0, AlignRight | AlignVCenter);
+ tqlayout->addWidget(files_label, 5, 0, AlignRight | AlignVCenter);
files_combo = new KComboBox(true, this);
- files_label->setBuddy(files_combo->focusProxy());
+ files_label->setBuddy(TQT_TQWIDGET(files_combo->focusProxy()));
files_combo->insertStrList(filepatterns);
- layout->addWidget(files_combo, 5, 1);
+ tqlayout->addWidget(files_combo, 5, 1);
TQLabel *exclude_label = new TQLabel(i18n("&Exclude:"), this);
- layout->addWidget(exclude_label, 6, 0, AlignRight | AlignVCenter);
+ tqlayout->addWidget(exclude_label, 6, 0, AlignRight | AlignVCenter);
TQStringList exclude_list = config->readListEntry("exclude_patterns");
exclude_combo = new KComboBox(true, this);
- exclude_label->setBuddy(files_combo->focusProxy());
+ exclude_label->setBuddy(TQT_TQWIDGET(files_combo->focusProxy()));
if (exclude_list.count()) {
exclude_combo->insertStringList(exclude_list);
}
@@ -191,22 +191,22 @@ GrepDialog::GrepDialog( GrepViewPart * part, TQWidget *parent, const char *name
exclude_combo->insertItem("/CVS/,/SCCS/,/\\.svn/,/_darcs/");
exclude_combo->insertItem("");
}
- layout->addWidget(exclude_combo, 6, 1);
+ tqlayout->addWidget(exclude_combo, 6, 1);
TQBoxLayout *other_opts_layout = new TQHBoxLayout(15);
- layout->addLayout(other_opts_layout, 7, 1);
+ tqlayout->addLayout(other_opts_layout, 7, 1);
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 TQCheckBox(i18n("&Suppress find errors"), this);
- no_find_err_box->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
+ no_find_err_box->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed);
no_find_err_box->setChecked(config->readBoolEntry("no_find_errs", true));
other_opts_layout->addWidget(no_find_err_box);
TQBoxLayout *button_layout = new TQHBoxLayout(4);
- layout->addLayout(button_layout, 8, 1);
+ tqlayout->addLayout(button_layout, 8, 1);
search_button = new KPushButton(KGuiItem(i18n("Sea&rch"),"grep"), this);
search_button->setDefault(true);
KPushButton *done_button = new KPushButton(KStdGuiItem::cancel(), this);
@@ -214,7 +214,7 @@ GrepDialog::GrepDialog( GrepViewPart * part, TQWidget *parent, const char *name
button_layout->addWidget(search_button);
button_layout->addWidget(done_button);
- resize(sizeHint());
+ resize(tqsizeHint());
TQWhatsThis::add(pattern_combo,
i18n("<qt>Enter the regular expression you want to search for here.<p>"
@@ -261,7 +261,7 @@ GrepDialog::GrepDialog( GrepViewPart * part, TQWidget *parent, const char *name
slotPatternChanged( pattern_combo->currentText() );
}
-// Returns the contents of a TQComboBox as a QStringList
+// Returns the contents of a TQComboBox as a TQStringList
static TQStringList qCombo2StringList( TQComboBox* combo )
{
TQStringList list;
@@ -345,7 +345,7 @@ void GrepDialog::slotSearchClicked()
void GrepDialog::show()
{
// not beautiful, but works with all window
- // managers and Qt versions
+ // managers and TQt versions
if (isVisible())
hide();
// TQDialog::hide();
diff --git a/parts/grepview/grepdlg.h b/parts/grepview/grepdlg.h
index 5c49a155..294dd326 100644
--- a/parts/grepview/grepdlg.h
+++ b/parts/grepview/grepdlg.h
@@ -25,12 +25,13 @@ class TQPushButton;
class GrepViewPart;
class KLineEdit;
-class GrepDialog : public QDialog
+class GrepDialog : public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- GrepDialog( GrepViewPart * part, TQWidget *parent=0, const char *name=0 );
+ GrepDialog( GrepViewPart * part, TQWidget *tqparent=0, const char *name=0 );
~GrepDialog();
void setPattern(const TQString &pattern)
diff --git a/parts/grepview/grepviewpart.cpp b/parts/grepview/grepviewpart.cpp
index 6765f87f..e404ad2d 100644
--- a/parts/grepview/grepviewpart.cpp
+++ b/parts/grepview/grepviewpart.cpp
@@ -34,8 +34,8 @@ static const KDevPluginInfo data("kdevgrepview");
K_EXPORT_COMPONENT_FACTORY(libkdevgrepview, GrepViewFactory(data))
-GrepViewPart::GrepViewPart( TQObject *parent, const char *name, const TQStringList & )
- : KDevPlugin( &data, parent, name ? name : "GrepViewPart" )
+GrepViewPart::GrepViewPart( TQObject *tqparent, const char *name, const TQStringList & )
+ : KDevPlugin( &data, tqparent, name ? name : "GrepViewPart" )
{
setInstance(GrepViewFactory::instance());
@@ -116,9 +116,9 @@ void GrepViewPart::contextMenu(TQPopupMenu *popup, const Context *context)
if (!ident.isEmpty()) {
m_popupstr = ident;
TQString squeezed = KStringHandler::csqueeze(ident, 30);
- int id = popup->insertItem( i18n("Grep: %1").arg(squeezed),
+ int id = popup->insertItem( i18n("Grep: %1").tqarg(squeezed),
this, TQT_SLOT(slotContextGrep()) );
- popup->setWhatsThis(id, i18n("<b>Grep</b><p>Opens the find in files dialog "
+ popup->tqsetWhatsThis(id, i18n("<b>Grep</b><p>Opens the find in files dialog "
"and sets the pattern to the text under the cursor."));
popup->insertSeparator();
}
diff --git a/parts/grepview/grepviewpart.h b/parts/grepview/grepviewpart.h
index 65baced0..f33dd240 100644
--- a/parts/grepview/grepviewpart.h
+++ b/parts/grepview/grepviewpart.h
@@ -25,9 +25,10 @@ class GrepViewWidget;
class GrepViewPart : public KDevPlugin
{
Q_OBJECT
+ TQ_OBJECT
public:
- GrepViewPart( TQObject *parent, const char *name, const TQStringList & );
+ GrepViewPart( TQObject *tqparent, const char *name, const TQStringList & );
~GrepViewPart();
private slots:
diff --git a/parts/grepview/grepviewwidget.cpp b/parts/grepview/grepviewwidget.cpp
index 78aa4224..e565a7d8 100644
--- a/parts/grepview/grepviewwidget.cpp
+++ b/parts/grepview/grepviewwidget.cpp
@@ -55,11 +55,11 @@ private:
GrepListBoxItem::GrepListBoxItem(const TQString &fileName, const TQString &lineNumber, const TQString &text, bool showFilename)
- : ProcessListBoxItem( TQString::null, Normal),
+ : ProcessListBoxItem( TQString(), Normal),
fileName(fileName), lineNumber(lineNumber), text(text.stripWhiteSpace()),
show(showFilename)
{
- this->text.replace( TQChar('\t'), TQString(" ") );
+ this->text.tqreplace( TQChar('\t'), TQString(" ") );
}
@@ -73,7 +73,7 @@ void GrepListBoxItem::paint(TQPainter *p)
{
TQColor base, dim, result, bkground;
if (listBox()) {
- const TQColorGroup& group = listBox()->palette().active();
+ const TQColorGroup& group = listBox()->tqpalette().active();
if (isSelected()) {
bkground = group.button();
base = group.buttonText();
@@ -88,13 +88,13 @@ void GrepListBoxItem::paint(TQPainter *p)
}
else
{
- base = Qt::black;
- dim = Qt::darkGreen;
- result = Qt::blue;
+ base = TQt::black;
+ dim = TQt::darkGreen;
+ result = TQt::blue;
if (isSelected())
- bkground = Qt::lightGray;
+ bkground = TQt::lightGray;
else
- bkground = Qt::white;
+ bkground = TQt::white;
}
TQFontMetrics fm = p->fontMetrics();
TQString stx = lineNumber + ": ";
@@ -126,7 +126,7 @@ void GrepListBoxItem::paint(TQPainter *p)
GrepViewWidget::GrepViewWidget(GrepViewPart *part) : TQWidget(0, "grepview widget")
{
- m_layout = new TQHBoxLayout(this, 0, -1, "greplayout");
+ m_layout = new TQHBoxLayout(this, 0, -1, "greptqlayout");
m_tabWidget = new KTabWidget(this);
@@ -174,7 +174,7 @@ void GrepViewWidget::showDialog()
if(selectIface && selectIface->hasSelection())
{
TQString selText = selectIface->selection();
- if(!selText.contains('\n'))
+ if(!selText.tqcontains('\n'))
{
grepdlg->setPattern(selText);
}
@@ -193,7 +193,7 @@ void GrepViewWidget::showDialog()
grepdlg->show();
}
-// @todo - put this somewhere common - or just use Qt if possible
+// @todo - put this somewhere common - or just use TQt if possible
static TQString escape(const TQString &str)
{
TQString escaped("[]{}()\\^$?.+-*|");
@@ -201,7 +201,7 @@ static TQString escape(const TQString &str)
for (uint i=0; i < str.length(); ++i)
{
- if (escaped.find(str[i]) != -1)
+ if (escaped.tqfind(str[i]) != -1)
res += "\\";
res += str[i];
}
@@ -305,7 +305,7 @@ void GrepViewWidget::searchActivated()
}
command = "cat ";
- command += tmpFilePath.replace(' ', "\\ ");
+ command += tmpFilePath.tqreplace(' ', "\\ ");
}
}
else
@@ -319,7 +319,7 @@ void GrepViewWidget::searchActivated()
files += " -o -name " + KShellProcess::quote(*it);
}
- TQString filepattern = "find ";
+ TQString filepattern = "tqfind ";
filepattern += KShellProcess::quote(grepdlg->directoryString());
if (!grepdlg->recursiveFlag())
filepattern += " -maxdepth 1";
@@ -366,9 +366,9 @@ void GrepViewWidget::searchActivated()
m_lastPattern = grepdlg->patternString();
TQString pattern = grepdlg->templateString();
if (grepdlg->regexpFlag())
- pattern.replace(TQRegExp("%s"), grepdlg->patternString());
+ pattern.tqreplace(TQRegExp("%s"), grepdlg->patternString());
else
- pattern.replace(TQRegExp("%s"), escape( grepdlg->patternString() ) );
+ pattern.tqreplace(TQRegExp("%s"), escape( grepdlg->patternString() ) );
command += KShellProcess::quote(pattern);
m_curOutput->startJob("", command);
@@ -402,11 +402,11 @@ void GrepViewProcessWidget::insertStdoutLine(const TQCString &line)
{
str = TQString::fromLocal8Bit( line );
}
- if ( (pos = str.find(':')) != -1)
+ if ( (pos = str.tqfind(':')) != -1)
{
filename = str.left(pos);
str.remove( 0, pos+1 );
- if ( ( pos = str.find(':') ) != -1)
+ if ( ( pos = str.tqfind(':') ) != -1)
{
linenumber = str.left(pos);
str.remove( 0, pos+1 );
@@ -452,7 +452,7 @@ void GrepViewWidget::popupMenu(TQListBoxItem*, const TQPoint& p)
void GrepViewWidget::slotKeepOutput( )
{
- if ( m_lastPattern == TQString::null ) return;
+ if ( m_lastPattern == TQString() ) return;
m_tabWidget->changeTab(m_curOutput, m_lastPattern);
diff --git a/parts/grepview/grepviewwidget.h b/parts/grepview/grepviewwidget.h
index 9c232b1b..f0b57aff 100644
--- a/parts/grepview/grepviewwidget.h
+++ b/parts/grepview/grepviewwidget.h
@@ -25,8 +25,9 @@ class TQToolButton;
class GrepViewProcessWidget : public ProcessWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- GrepViewProcessWidget(TQWidget* parent) : ProcessWidget(parent) {};
+ GrepViewProcessWidget(TQWidget* tqparent) : ProcessWidget(tqparent) {};
~GrepViewProcessWidget(){};
void setMatchCount(int newCount)
{
@@ -56,9 +57,10 @@ private:
TQCString grepbuf;
};
-class GrepViewWidget : public QWidget
+class GrepViewWidget : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
GrepViewWidget(GrepViewPart *part);