From 48d4a26399959121f33d2bc3bfe51c7827b654fc Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 14 Jun 2011 16:45:05 +0000 Subject: 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 --- parts/outputviews/makewidget.cpp | 70 +++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 37 deletions(-) (limited to 'parts/outputviews/makewidget.cpp') diff --git a/parts/outputviews/makewidget.cpp b/parts/outputviews/makewidget.cpp index 3ccc4608..b7d5ed2f 100644 --- a/parts/outputviews/makewidget.cpp +++ b/parts/outputviews/makewidget.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include @@ -162,7 +162,7 @@ MakeWidget::MakeWidget(MakeViewPart *part) { updateSettingsFromConfig(); - setTextFormat( Qt::RichText ); + setTextFormat( TQt::RichText ); if ( m_bLineWrapping ) setWordWrap(WidgetWidth); @@ -178,7 +178,7 @@ MakeWidget::MakeWidget(MakeViewPart *part) dirstack.setAutoDelete(true); - childproc = new KProcess(this); + childproc = new KProcess(TQT_TQOBJECT(this)); procLineMaker = new ProcessLineMaker( childproc ); connect( procLineMaker, TQT_SIGNAL(receivedStdoutLine(const TQCString&)), @@ -247,20 +247,20 @@ void MakeWidget::startNextJob() currentCommand = *it; commandList.remove(it); - int i = currentCommand.findRev(" gmake"); + int i = currentCommand.tqfindRev(" gmake"); if ( i == -1 ) - i = currentCommand.findRev(" make"); + i = currentCommand.tqfindRev(" make"); if ( i == -1 ) m_bCompiling = false; else { TQString s = currentCommand.right(currentCommand.length() - i); - if ( s.contains("configure ") || - s.contains(" Makefile.cvs") || - s.contains(" clean") || - s.contains(" distclean") || - s.contains(" package-messages") || - s.contains(" install") ) + if ( s.tqcontains("configure ") || + s.tqcontains(" Makefile.cvs") || + s.tqcontains(" clean") || + s.tqcontains(" distclean") || + s.tqcontains(" package-messages") || + s.tqcontains(" install") ) { m_bCompiling = false; } @@ -337,12 +337,12 @@ void MakeWidget::copy() selection.remove((selection.length()-1) - removeend, removeend); } - selection.replace("<","<"); - selection.replace(">",">"); - selection.replace(""","\""); - selection.replace("&","&"); + selection.tqreplace("<","<"); + selection.tqreplace(">",">"); + selection.tqreplace(""","\""); + selection.tqreplace("&","&"); - kapp->clipboard()->setText(selection, QClipboard::Clipboard); + kapp->tqclipboard()->setText(selection, TQClipboard::Clipboard); } void MakeWidget::nextError() @@ -378,11 +378,7 @@ void MakeWidget::prevError() if (m_lastErrorSelected != -1) { m_lastErrorSelected = -1; -#if QT_VERSION >= 0x030100 parag = (int)m_items.count(); -#else - parag = m_items.size(); -#endif if (!scanErrorBackward(parag)) KNotifyClient::beep(); } @@ -393,7 +389,7 @@ void MakeWidget::prevError() void MakeWidget::contentsMouseReleaseEvent( TQMouseEvent* e ) { TQTextEdit::contentsMouseReleaseEvent(e); - if ( e->button() != LeftButton ) + if ( e->button() != Qt::LeftButton ) return; searchItem(paragraphAt(e->pos())); } @@ -413,9 +409,9 @@ void MakeWidget::keyPressEvent(TQKeyEvent *e) // returns the current directory for parag TQString MakeWidget::directory(int parag) const { - TQValueVector::const_iterator it = qFind( m_items.begin(), m_items.end(), m_paragraphToItem[parag] ); + TQValueVector::const_iterator it = tqFind( m_items.begin(), m_items.end(), m_paragraphToItem[parag] ); if ( it == m_items.end() ) - return TQString::null; + return TQString(); // run backwards over directories and figure out where we are while ( it != m_items.begin() ) { --it; @@ -423,7 +419,7 @@ TQString MakeWidget::directory(int parag) const if ( edi ) return edi->directory + "/"; } - return TQString::null; + return TQString(); } // hackish function that will return true and put string "file" in "fName" if the file @@ -457,7 +453,7 @@ void MakeWidget::specialCheck( const TQString& file, TQString& fName ) const TQStringList files = m_part->project()->allFiles(); for( TQStringList::iterator it = files.begin() ; it != files.end(); ++it) { - if( (*it).contains( file ) ) + if( (*it).tqcontains( file ) ) { fName = URLUtil::canonicalPath( m_part->project()->projectDirectory() + "/" + *it ); } @@ -570,12 +566,12 @@ void MakeWidget::slotProcessExited(KProcess *) { if (childproc->exitStatus()) { - KNotifyClient::event( topLevelWidget()->winId(), "ProcessError", i18n("The process has finished with errors")); + KNotifyClient::event( tqtopLevelWidget()->winId(), "ProcessError", i18n("The process has finished with errors")); emit m_part->commandFailed(currentCommand); } else { - KNotifyClient::event( topLevelWidget()->winId(), "ProcessSuccess", i18n("The process has finished successfully")); + KNotifyClient::event( tqtopLevelWidget()->winId(), "ProcessSuccess", i18n("The process has finished successfully")); emit m_part->commandFinished(currentCommand); } } @@ -584,7 +580,7 @@ void MakeWidget::slotProcessExited(KProcess *) insertItem( item ); displayPendingItem(); - m_part->mainWindow()->statusBar()->message( TQString("%1: %2").arg(currentCommand).arg(item->m_text), 3000); + m_part->mainWindow()->statusBar()->message( TQString("%1: %2").tqarg(currentCommand).tqarg(item->m_text), 3000); m_part->core()->running(m_part, false); // Defensive programming: We emit this with a single shot timer so that we go once again @@ -692,7 +688,7 @@ void MakeWidget::insertItem( MakeItem* new_item ) bool MakeWidget::brightBg() { int h,s,v; - paletteBackgroundColor().hsv( &h, &s, &v ); + TQColor(paletteBackgroundColor()).hsv( &h, &s, &v ); return (v > 127); } @@ -704,22 +700,22 @@ TQPopupMenu* MakeWidget::createPopupMenu( const TQPoint& pos ) pMenu->insertSeparator(); int id = pMenu->insertItem(i18n("Line Wrapping"), this, TQT_SLOT(toggleLineWrapping()) ); pMenu->setItemChecked(id, m_bLineWrapping); - pMenu->setWhatsThis(id, i18n("Line wrapping

Enables or disables wrapping of command lines displayed.")); + pMenu->tqsetWhatsThis(id, i18n("Line wrapping

Enables or disables wrapping of command lines displayed.")); pMenu->insertSeparator(); id = pMenu->insertItem(i18n("Very Short Compiler Output"), this, TQT_SLOT(slotVeryShortCompilerOutput()) ); - pMenu->setWhatsThis(id, i18n("Very short compiler output

Displays only warnings, errors and the file names which are compiled.")); + pMenu->tqsetWhatsThis(id, i18n("Very short compiler output

Displays only warnings, errors and the file names which are compiled.")); pMenu->setItemChecked(id, m_compilerOutputLevel == eVeryShort); id = pMenu->insertItem(i18n("Short Compiler Output"), this, TQT_SLOT(slotShortCompilerOutput()) ); - pMenu->setWhatsThis(id, i18n("Short compiler output

Suppresses all the compiler flags and formats to something readable.")); + pMenu->tqsetWhatsThis(id, i18n("Short compiler output

Suppresses all the compiler flags and formats to something readable.")); pMenu->setItemChecked(id, m_compilerOutputLevel == eShort); id = pMenu->insertItem(i18n("Full Compiler Output"), this, TQT_SLOT(slotFullCompilerOutput()) ); - pMenu->setWhatsThis(id, i18n("Full compiler output

Displays unmodified compiler output.")); + pMenu->tqsetWhatsThis(id, i18n("Full compiler output

Displays unmodified compiler output.")); pMenu->setItemChecked(id, m_compilerOutputLevel == eFull); pMenu->insertSeparator(); id = pMenu->insertItem(i18n("Show Directory Navigation Messages"), this, TQT_SLOT(toggleShowDirNavigMessages())); - pMenu->setWhatsThis(id, i18n("Show directory navigation messages

Shows cd commands that are executed while building.")); + pMenu->tqsetWhatsThis(id, i18n("Show directory navigation messages

Shows cd commands that are executed while building.")); pMenu->setItemChecked(id, DirectoryItem::getShowDirectoryMessages()); return pMenu; @@ -756,9 +752,9 @@ void MakeWidget::refill() } -void MakeWidget::slotVeryShortCompilerOutput() { setTextFormat( Qt::RichText ); setCompilerOutputLevel(eVeryShort); } -void MakeWidget::slotShortCompilerOutput() { setTextFormat( Qt::RichText ); setCompilerOutputLevel(eShort); } -void MakeWidget::slotFullCompilerOutput() { setTextFormat( Qt::RichText ); setCompilerOutputLevel(eFull); } +void MakeWidget::slotVeryShortCompilerOutput() { setTextFormat( TQt::RichText ); setCompilerOutputLevel(eVeryShort); } +void MakeWidget::slotShortCompilerOutput() { setTextFormat( TQt::RichText ); setCompilerOutputLevel(eShort); } +void MakeWidget::slotFullCompilerOutput() { setTextFormat( TQt::RichText ); setCompilerOutputLevel(eFull); } void MakeWidget::setCompilerOutputLevel(EOutputLevel level) { -- cgit v1.2.1