diff options
Diffstat (limited to 'kate/make/plugin_katemake.cpp')
-rw-r--r-- | kate/make/plugin_katemake.cpp | 210 |
1 files changed, 105 insertions, 105 deletions
diff --git a/kate/make/plugin_katemake.cpp b/kate/make/plugin_katemake.cpp index 64282dd..e78bda9 100644 --- a/kate/make/plugin_katemake.cpp +++ b/kate/make/plugin_katemake.cpp @@ -30,15 +30,15 @@ #include <cassert> #include <config.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qinputdialog.h> -#include <qregexp.h> -#include <qstring.h> -#include <qtextstream.h> -#include <qpalette.h> -#include <qvbox.h> -#include <qlabel.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqinputdialog.h> +#include <tqregexp.h> +#include <tqstring.h> +#include <tqtextstream.h> +#include <tqpalette.h> +#include <tqvbox.h> +#include <tqlabel.h> #include <kaction.h> #include <kcursor.h> @@ -62,7 +62,7 @@ K_EXPORT_COMPONENT_FACTORY( katemakeplugin, KGenericFactory<PluginKateMake>( "ka // #define FUNCTIONSETUP kdDebug() << k_funcinfo << endl; #define FUNCTIONSETUP -PluginKateMake::PluginKateMake( QObject* parent, const char* name, const QStringList& ) +PluginKateMake::PluginKateMake( TQObject* parent, const char* name, const TQStringList& ) : Kate::Plugin ( (Kate::Application *)parent, name ) { FUNCTIONSETUP; @@ -80,9 +80,9 @@ void PluginKateMake::addView(Kate::MainWindow *win) FUNCTIONSETUP; Kate::ToolViewManager *viewmanager = win->toolViewManager(); - QWidget *w = viewmanager->createToolView("kate_plugin_make", + TQWidget *w = viewmanager->createToolView("kate_plugin_make", Kate::ToolViewManager::Bottom, - SmallIcon(QString::fromLatin1("misc")), + SmallIcon(TQString::fromLatin1("misc")), i18n("Make Output")); PluginKateMakeView *view = new PluginKateMakeView (w,win, "katemakeview"); @@ -123,23 +123,23 @@ void PluginKateMake::removeView(Kate::MainWindow *win) class ErrorMessage : public QListViewItem { public: - ErrorMessage(QListView *parent, - const QString &filename, + ErrorMessage(TQListView *parent, + const TQString &filename, int lineno, - const QString &message) : - QListViewItem(parent, + const TQString &message) : + TQListViewItem(parent, filename, - (lineno > 0 ? QString::number(lineno) : QString::null), + (lineno > 0 ? TQString::number(lineno) : TQString::null), message) { - m_isError = !message.contains(QString::fromLatin1("warning")); + m_isError = !message.contains(TQString::fromLatin1("warning")); m_lineno = lineno; m_serial = s_serial++; } - ErrorMessage(QListView *parent,const QString &message) : - QListViewItem(parent,QString::null,QString::null,QString::null) + ErrorMessage(TQListView *parent,const TQString &message) : + TQListViewItem(parent,TQString::null,TQString::null,TQString::null) { - QString m(message); + TQString m(message); m.remove('\n'); m.stripWhiteSpace(); setText(COL_MSG,m); @@ -149,8 +149,8 @@ public: m_serial = s_serial++; setSelectable(false); } - ErrorMessage(QListView *parent, bool start) : - QListViewItem(parent,QString::null) + ErrorMessage(TQListView *parent, bool start) : + TQListViewItem(parent,TQString::null) { m_isError=false; m_lineno=-1; @@ -162,19 +162,19 @@ public: virtual ~ErrorMessage() ; bool isError() const { return m_isError; } - QString message() const { return text(COL_MSG); } - QString fancyMessage() const; - QString caption() const; - QString filename() const { return text(COL_FILE); } + TQString message() const { return text(COL_MSG); } + TQString fancyMessage() const; + TQString caption() const; + TQString filename() const { return text(COL_FILE); } int line() const { return m_lineno; } int serial() const { return m_serial; } - virtual int compare(QListViewItem *,int,bool) const; + virtual int compare(TQListViewItem *,int,bool) const; static void resetSerial() { s_serial=10; } protected: - virtual void paintCell(QPainter *,const QColorGroup &, + virtual void paintCell(TQPainter *,const TQColorGroup &, int,int,int); bool m_isError; @@ -190,40 +190,40 @@ protected: { } -QString ErrorMessage::caption() const +TQString ErrorMessage::caption() const { - return QString::fromLatin1("%1:%2").arg(text(COL_FILE)).arg(line()); + return TQString::fromLatin1("%1:%2").arg(text(COL_FILE)).arg(line()); } -QString ErrorMessage::fancyMessage() const +TQString ErrorMessage::fancyMessage() const { - QString msg = QString::fromLatin1("<qt>"); + TQString msg = TQString::fromLatin1("<qt>"); if (isError()) { - msg.append(QString::fromLatin1("<font color=\"red\">")); + msg.append(TQString::fromLatin1("<font color=\"red\">")); } msg.append(message()); if (isError()) { - msg.append(QString::fromLatin1("</font>")); + msg.append(TQString::fromLatin1("</font>")); } - msg.append(QString::fromLatin1("<qt>")); + msg.append(TQString::fromLatin1("<qt>")); return msg; } -/* virtual */ void ErrorMessage::paintCell(QPainter *p, - const QColorGroup &cg, +/* virtual */ void ErrorMessage::paintCell(TQPainter *p, + const TQColorGroup &cg, int column, int width, int align) { if ((column!=COL_LINE) || (serial()<0)) { - QListViewItem::paintCell(p,cg,column,width,align); + TQListViewItem::paintCell(p,cg,column,width,align); } else { - QColorGroup myCG(cg); + TQColorGroup myCG(cg); #if 0 red, //darkRed, green, //darkGreen, @@ -233,21 +233,21 @@ QString ErrorMessage::fancyMessage() const yellow, //darkYellow, gray); #endif - myCG.setColor(QColorGroup::Light,red); + myCG.setColor(TQColorGroup::Light,red); if (!isSelected()) { - myCG.setColor(QColorGroup::Base,gray); - myCG.setColor(QColorGroup::Text, + myCG.setColor(TQColorGroup::Base,gray); + myCG.setColor(TQColorGroup::Text, m_isError ? red : yellow); } - QListViewItem::paintCell(p,myCG,column,width,align); + TQListViewItem::paintCell(p,myCG,column,width,align); } } -/* virtual */ int ErrorMessage::compare(QListViewItem *i, +/* virtual */ int ErrorMessage::compare(TQListViewItem *i, int /* column */ , bool /* ascending */) const { kdDebug() << "In compare " << serial() << endl; @@ -261,17 +261,17 @@ QString ErrorMessage::fancyMessage() const class LinePopup : public KPassivePopup { protected: - LinePopup( QWidget *parent=0, const char *name=0, WFlags f=0 ); + LinePopup( TQWidget *parent=0, const char *name=0, WFlags f=0 ); virtual ~LinePopup(); public: - static LinePopup *message(QWidget *, - const QPoint &p,ErrorMessage *e); + static LinePopup *message(TQWidget *, + const TQPoint &p,ErrorMessage *e); protected: virtual void positionSelf(); - QPoint fLoc; + TQPoint fLoc; // There should be only one static LinePopup *one; @@ -279,7 +279,7 @@ protected: /* static */ LinePopup *LinePopup::one = 0L; -LinePopup::LinePopup(QWidget *p,const char *n,WFlags f) : +LinePopup::LinePopup(TQWidget *p,const char *n,WFlags f) : KPassivePopup(p,n,f), fLoc(-1,-1) { @@ -292,8 +292,8 @@ LinePopup::~LinePopup() one=0L; } -/* static */ LinePopup *LinePopup::message(QWidget *parent, - const QPoint &p, +/* static */ LinePopup *LinePopup::message(TQWidget *parent, + const TQPoint &p, ErrorMessage *e) { if (one) delete one; @@ -301,7 +301,7 @@ LinePopup::~LinePopup() pop->setAutoDelete( true ); - pop->setView( e->caption(), e->fancyMessage(), QPixmap() ); + pop->setView( e->caption(), e->fancyMessage(), TQPixmap() ); // pop->hideDelay = timeout; pop->fLoc=p; pop->show(); @@ -317,14 +317,14 @@ LinePopup::~LinePopup() // Move above or below the intended line if (fLoc.y()>320) fLoc.setY(fLoc.y()-80); else fLoc.setY(fLoc.y()+80); - moveNear(QRect(fLoc.x(),fLoc.y(),40,30)); + moveNear(TQRect(fLoc.x(),fLoc.y(),40,30)); } } -PluginKateMakeView::PluginKateMakeView(QWidget *parent, +PluginKateMakeView::PluginKateMakeView(TQWidget *parent, Kate::MainWindow *mainwin, const char* name) : - QListView(parent,name), + TQListView(parent,name), KXMLGUIClient(), win(mainwin), filenameDetector(0L), @@ -334,26 +334,26 @@ PluginKateMakeView::PluginKateMakeView(QWidget *parent, m_proc=0; (void) new KAction ( i18n("Next Error"), KShortcut(ALT+CTRL+Key_Right), - this, SLOT( slotNext() ), + this, TQT_SLOT( slotNext() ), actionCollection(), "make_right" ); (void) new KAction ( i18n("Previous Error"), KShortcut(ALT+CTRL+Key_Left), - this, SLOT( slotPrev() ), + this, TQT_SLOT( slotPrev() ), actionCollection(), "make_left" ); (void) new KAction ( i18n("Make"), KShortcut(ALT+Key_R), - this, SLOT( slotValidate() ), + this, TQT_SLOT( slotValidate() ), actionCollection(), "make_check" ); (void) new KAction ( i18n("Configure..."), KShortcut(), - this, SLOT( slotConfigure() ), + this, TQT_SLOT( slotConfigure() ), actionCollection(), "make_settings" ); setInstance(new KInstance("kate")); - setXMLFile(QString::fromLatin1("plugins/katemake/ui.rc")); + setXMLFile(TQString::fromLatin1("plugins/katemake/ui.rc")); - setFocusPolicy(QWidget::NoFocus); + setFocusPolicy(TQWidget::NoFocus); setSorting(COL_LINE); addColumn(i18n("File"), -1); @@ -361,25 +361,25 @@ PluginKateMakeView::PluginKateMakeView(QWidget *parent, setColumnAlignment(COL_LINE, AlignRight); addColumn(i18n("Message"), -1); setAllColumnsShowFocus(true); - setResizeMode(QListView::LastColumn); - connect(this, SIGNAL(clicked(QListViewItem *)), SLOT(slotClicked(QListViewItem *))); + setResizeMode(TQListView::LastColumn); + connect(this, TQT_SIGNAL(clicked(TQListViewItem *)), TQT_SLOT(slotClicked(TQListViewItem *))); m_proc = new KProcess(); - connect(m_proc, SIGNAL(processExited(KProcess*)), this, SLOT(slotProcExited(KProcess*))); - connect(m_proc, SIGNAL(receivedStderr(KProcess*,char*,int)), - this, SLOT(slotReceivedProcStderr(KProcess*, char*, int))); + connect(m_proc, TQT_SIGNAL(processExited(KProcess*)), this, TQT_SLOT(slotProcExited(KProcess*))); + connect(m_proc, TQT_SIGNAL(receivedStderr(KProcess*,char*,int)), + this, TQT_SLOT(slotReceivedProcStderr(KProcess*, char*, int))); KConfig c("katemakepluginrc"); c.setGroup("Prefixes"); - source_prefix = c.readEntry("Source",QString::null); - build_prefix = c.readEntry("Build",QString::null); + source_prefix = c.readEntry("Source",TQString::null); + build_prefix = c.readEntry("Build",TQString::null); // if (source_prefix.isEmpty()) { - filenameDetector = new QRegExp( - QString::fromLatin1("[a-zA-Z0-9_\\.\\-]*\\.[chp]*:[0-9]*:")); + filenameDetector = new TQRegExp( + TQString::fromLatin1("[a-zA-Z0-9_\\.\\-]*\\.[chp]*:[0-9]*:")); } // else { @@ -398,7 +398,7 @@ PluginKateMakeView::~PluginKateMakeView() } -void PluginKateMakeView::processLine(const QString &l) +void PluginKateMakeView::processLine(const TQString &l) { kdDebug() << "Got line " << l ; @@ -419,10 +419,10 @@ void PluginKateMakeView::processLine(const QString &l) int ofs1 = l.find(':'); int ofs2 = l.find(':',ofs1+1); // - QString m = l.mid(ofs2+1); + TQString m = l.mid(ofs2+1); m.remove('\n'); m.stripWhiteSpace(); - QString filename = l.left(ofs1); + TQString filename = l.left(ofs1); int line = l.mid(ofs1+1,ofs2-ofs1-1).toInt(); ErrorMessage *e = new ErrorMessage(this, filename,line,m); @@ -431,7 +431,7 @@ void PluginKateMakeView::processLine(const QString &l) // Should cache files being found and check for // existence. kdDebug() << ": Looking at " << document_dir+filename << endl; - if (!QFile::exists(document_dir+filename)) + if (!TQFile::exists(document_dir+filename)) { e->setSelectable(false); } @@ -447,7 +447,7 @@ void PluginKateMakeView::slotReceivedProcStderr(KProcess *, char *result, int le { FUNCTIONSETUP; - QString l = QString::fromLocal8Bit( QCString(result, len+1) ); + TQString l = TQString::fromLocal8Bit( TQCString(result, len+1) ); output_line += l; @@ -480,13 +480,13 @@ void PluginKateMakeView::slotProcExited(KProcess *p) #endif kdDebug() << "slotProcExited()" << endl; - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); sort(); if ( found_error || !p->normalExit() || p->exitStatus() ) { - QListViewItem *i = firstChild(); + TQListViewItem *i = firstChild(); while (i && !i->isSelectable()) { i = i->nextSibling(); @@ -504,8 +504,8 @@ void PluginKateMakeView::slotProcExited(KProcess *p) this); clear(); #if 0 - QListViewItem *i = new QListViewItem(this,QString::null, - QString::null, + TQListViewItem *i = new TQListViewItem(this,TQString::null, + TQString::null, i18n("No Errors.")); i->setSelectable(false); #else @@ -515,7 +515,7 @@ void PluginKateMakeView::slotProcExited(KProcess *p) } -void PluginKateMakeView::slotClicked(QListViewItem *item) +void PluginKateMakeView::slotClicked(TQListViewItem *item) { FUNCTIONSETUP; if (!item) @@ -530,7 +530,7 @@ void PluginKateMakeView::slotClicked(QListViewItem *item) ensureItemVisible(e); - QString filename = document_dir + e->filename(); + TQString filename = document_dir + e->filename(); int lineno = e->line(); if (!build_prefix.isEmpty()) @@ -542,7 +542,7 @@ void PluginKateMakeView::slotClicked(QListViewItem *item) kdDebug() << ": Looking at " << filename << ":" << lineno << endl; - if (QFile::exists(filename)) + if (TQFile::exists(filename)) { KURL u; u.setPath(filename); @@ -552,12 +552,12 @@ void PluginKateMakeView::slotClicked(QListViewItem *item) kv->setCursorPositionReal(lineno-1,1); - QPoint globalPos = kv->mapToGlobal(kv->cursorCoordinates()); + TQPoint globalPos = kv->mapToGlobal(kv->cursorCoordinates()); kdDebug() << ": Want to map at " << globalPos.x() << "," << globalPos.y() << endl; #if 0 KPassivePopup::message( - QString::fromLatin1("%1:%2").arg(filename).arg(lineno), + TQString::fromLatin1("%1:%2").arg(filename).arg(lineno), msg, this); #else @@ -571,10 +571,10 @@ void PluginKateMakeView::slotNext() { FUNCTIONSETUP; - QListViewItem *i = selectedItem(); + TQListViewItem *i = selectedItem(); if (!i) return; - QListViewItem *n = i; + TQListViewItem *n = i; while ((n=n->nextSibling())) { if (n->isSelectable()) @@ -592,10 +592,10 @@ void PluginKateMakeView::slotPrev() { FUNCTIONSETUP; - QListViewItem *i = selectedItem(); + TQListViewItem *i = selectedItem(); if (!i) return; - QListViewItem *n = i; + TQListViewItem *n = i; while ((n=n->itemAbove())) { if (n->isSelectable()) @@ -632,7 +632,7 @@ bool PluginKateMakeView::slotValidate() doc->save(); KURL url(doc->url()); - output_line = QString::null; + output_line = TQString::null; ErrorMessage::resetSerial(); found_error=false; @@ -648,8 +648,8 @@ bool PluginKateMakeView::slotValidate() return false; } - document_dir = QFileInfo(url.path()).dirPath(true) + - QString::fromLatin1("/"); + document_dir = TQFileInfo(url.path()).dirPath(true) + + TQString::fromLatin1("/"); if (document_dir.startsWith(source_prefix)) { @@ -657,7 +657,7 @@ bool PluginKateMakeView::slotValidate() } m_proc->setWorkingDirectory(document_dir); - QString make = KStandardDirs::findExe( "gmake" ); + TQString make = KStandardDirs::findExe( "gmake" ); if (make.isEmpty()) make = KStandardDirs::findExe("make"); *m_proc << make; @@ -666,7 +666,7 @@ bool PluginKateMakeView::slotValidate() "make" : make)); return false; } - QApplication::setOverrideCursor(KCursor::waitCursor()); + TQApplication::setOverrideCursor(KCursor::waitCursor()); running_indicator = new ErrorMessage(this,true); return true; } @@ -674,27 +674,27 @@ bool PluginKateMakeView::slotValidate() class Settings : public KDialogBase { public: - Settings( QWidget *parent, - const QString &src, const QString &bld); + Settings( TQWidget *parent, + const TQString &src, const TQString &bld); KLineEdit *edit_src,*edit_bld; } ; -Settings::Settings(QWidget *p, - const QString &s, const QString &b) : +Settings::Settings(TQWidget *p, + const TQString &s, const TQString &b) : KDialogBase(p,"settings",true, i18n("Directories"), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true ) { - QVBox *page = makeVBoxMainWidget(); - QHBox *h = new QHBox(page); - (void) new QLabel(i18n("Source prefix:"),h); + TQVBox *page = makeVBoxMainWidget(); + TQHBox *h = new TQHBox(page); + (void) new TQLabel(i18n("Source prefix:"),h); edit_src = new KLineEdit(h); edit_src->setText(s); - h = new QHBox(page); - (void) new QLabel(i18n("Build prefix:"),h); + h = new TQHBox(page); + (void) new TQLabel(i18n("Build prefix:"),h); edit_bld = new KLineEdit(h); edit_bld->setText(b); } @@ -716,8 +716,8 @@ void PluginKateMakeView::slotConfigure() { if (!filenameDetector) { - filenameDetector = new QRegExp( - QString::fromLatin1("[a-zA-Z0-9_\\.\\-]*\\.[chp]*:[0-9]*:")); + filenameDetector = new TQRegExp( + TQString::fromLatin1("[a-zA-Z0-9_\\.\\-]*\\.[chp]*:[0-9]*:")); } } //else |