diff options
Diffstat (limited to 'languages/cpp/problemreporter.cpp')
-rw-r--r-- | languages/cpp/problemreporter.cpp | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/languages/cpp/problemreporter.cpp b/languages/cpp/problemreporter.cpp index 55ca30a8..c7a8e9b6 100644 --- a/languages/cpp/problemreporter.cpp +++ b/languages/cpp/problemreporter.cpp @@ -44,30 +44,30 @@ #include <kconfig.h> -#include <qtimer.h> -#include <qregexp.h> -#include <qvbox.h> -#include <qfileinfo.h> -#include <qwhatsthis.h> -#include <qtabbar.h> -#include <qwidgetstack.h> -#include <qlayout.h> -#include <qlineedit.h> +#include <tqtimer.h> +#include <tqregexp.h> +#include <tqvbox.h> +#include <tqfileinfo.h> +#include <tqwhatsthis.h> +#include <tqtabbar.h> +#include <tqwidgetstack.h> +#include <tqlayout.h> +#include <tqlineedit.h> class ProblemItem: public KListViewItem { public: - ProblemItem( QListView* parent, const QString& problem, - const QString& file, const QString& line, const QString& column ) + ProblemItem( TQListView* parent, const TQString& problem, + const TQString& file, const TQString& line, const TQString& column ) : KListViewItem( parent, problem, file, line, column ) {} - ProblemItem( QListViewItem* parent, const QString& problem, - const QString& file, const QString& line, const QString& column ) + ProblemItem( TQListViewItem* parent, const TQString& problem, + const TQString& file, const TQString& line, const TQString& column ) : KListViewItem( parent, problem, file, line, column ) {} - int compare( QListViewItem* item, int column, bool ascending ) const + int compare( TQListViewItem* item, int column, bool ascending ) const { if ( column == 1 || column == 2 ) { @@ -82,22 +82,22 @@ public: }; -ProblemReporter::ProblemReporter( CppSupportPart* part, QWidget* parent, const char* name ) -: QWidget( parent, name ? name : "problemreporter" ), +ProblemReporter::ProblemReporter( CppSupportPart* part, TQWidget* parent, const char* name ) +: TQWidget( parent, name ? name : "problemreporter" ), m_cppSupport( part ), // m_document( 0 ), m_markIface( 0 ) { - QWhatsThis::add(this, i18n("<b>Problem reporter</b><p>This window shows various \"problems\" in your project. " + TQWhatsThis::add(this, i18n("<b>Problem reporter</b><p>This window shows various \"problems\" in your project. " "It displays TODO entries, FIXME's and errors reported by a language parser. " "To add a TODO or FIXME entry, just type<br>" "<tt>//@todo my todo</tt><br>" "<tt>//TODO: my todo</tt><br>" "<tt>//FIXME fix this</tt>")); - m_initCurrentTimer = new QTimer( this ); - connect( m_initCurrentTimer, SIGNAL(timeout()), this, SLOT(initCurrentList()) ); - m_gridLayout = new QGridLayout(this,2,3); + m_initCurrentTimer = new TQTimer( this ); + connect( m_initCurrentTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(initCurrentList()) ); + m_gridLayout = new TQGridLayout(this,2,3); m_errorList = new KListView(this); m_warningList = new KListView(this); @@ -118,7 +118,7 @@ m_markIface( 0 ) InitListView(m_currentList); m_currentList->removeColumn(1); - m_widgetStack = new QWidgetStack(this); + m_widgetStack = new TQWidgetStack(this); m_widgetStack->addWidget(m_currentList,0); m_widgetStack->addWidget(m_errorList,1); m_widgetStack->addWidget(m_warningList,2); @@ -126,38 +126,38 @@ m_markIface( 0 ) m_widgetStack->addWidget(m_todoList,4); m_widgetStack->addWidget(m_filteredList,5); - m_tabBar = new QTabBar(this); - m_tabBar->insertTab(new QTab(i18n("Current")),0); - m_tabBar->insertTab(new QTab(i18n("Errors")),1); - m_tabBar->insertTab(new QTab(i18n("Warnings")),2); - m_tabBar->insertTab(new QTab(i18n("Fixme")),3); - m_tabBar->insertTab(new QTab(i18n("Todo")),4); - m_tabBar->insertTab(new QTab(i18n("Filtered")),5); + m_tabBar = new TQTabBar(this); + m_tabBar->insertTab(new TQTab(i18n("Current")),0); + m_tabBar->insertTab(new TQTab(i18n("Errors")),1); + m_tabBar->insertTab(new TQTab(i18n("Warnings")),2); + m_tabBar->insertTab(new TQTab(i18n("Fixme")),3); + m_tabBar->insertTab(new TQTab(i18n("Todo")),4); + m_tabBar->insertTab(new TQTab(i18n("Filtered")),5); m_tabBar->setTabEnabled(0,false); m_tabBar->setTabEnabled(5,false); m_filterEdit = new KLineEdit(this); - QLabel* m_filterLabel = new QLabel(i18n("Lookup:"),this); + TQLabel* m_filterLabel = new TQLabel(i18n("Lookup:"),this); m_gridLayout->addWidget(m_tabBar,0,0); m_gridLayout->addMultiCellWidget(m_widgetStack,1,1,0,2); m_gridLayout->addWidget(m_filterLabel,0,1,Qt::AlignRight); m_gridLayout->addWidget(m_filterEdit,0,2,Qt::AlignLeft); - connect( m_filterEdit, SIGNAL(returnPressed()), - this, SLOT(slotFilter()) ); - connect( m_filterEdit, SIGNAL(textChanged( const QString & )), - this, SLOT(slotFilter()) ); - connect( m_tabBar, SIGNAL(selected(int)), - this, SLOT(slotTabSelected(int)) ); - connect( part->partController(), SIGNAL(activePartChanged(KParts::Part*)), - this, SLOT(slotActivePartChanged(KParts::Part*)) ); - connect( part->partController(), SIGNAL(partAdded(KParts::Part*)), - this, SLOT(slotPartAdded(KParts::Part*)) ); + connect( m_filterEdit, TQT_SIGNAL(returnPressed()), + this, TQT_SLOT(slotFilter()) ); + connect( m_filterEdit, TQT_SIGNAL(textChanged( const TQString & )), + this, TQT_SLOT(slotFilter()) ); + connect( m_tabBar, TQT_SIGNAL(selected(int)), + this, TQT_SLOT(slotTabSelected(int)) ); + connect( part->partController(), TQT_SIGNAL(activePartChanged(KParts::Part*)), + this, TQT_SLOT(slotActivePartChanged(KParts::Part*)) ); + connect( part->partController(), TQT_SIGNAL(partAdded(KParts::Part*)), + this, TQT_SLOT(slotPartAdded(KParts::Part*)) ); // any editors that were open when we loaded the project needs to have their markType07 icon set too.. - QPtrListIterator<KParts::Part> it( *m_cppSupport->partController()->parts() ); + TQPtrListIterator<KParts::Part> it( *m_cppSupport->partController()->parts() ); while( it.current() ) { if ( KTextEditor::MarkInterfaceExtension* iface = dynamic_cast<KTextEditor::MarkInterfaceExtension*>( it.current() ) ) @@ -193,9 +193,9 @@ void ProblemReporter::slotFilter() } -void ProblemReporter::filterList(KListView* listview, const QString& level) +void ProblemReporter::filterList(KListView* listview, const TQString& level) { - QListViewItemIterator it( listview ); + TQListViewItemIterator it( listview ); while ( it.current() ) { if ( it.current()->text(3).contains(m_filterEdit->text(),false)) @@ -221,11 +221,11 @@ void ProblemReporter::InitListView(KListView* listview) listview->addColumn( i18n("Problem") ); listview->setAllColumnsShowFocus( TRUE ); - connect( listview, SIGNAL(executed(QListViewItem*)), - this, SLOT(slotSelected(QListViewItem*)) ); + connect( listview, TQT_SIGNAL(executed(TQListViewItem*)), + this, TQT_SLOT(slotSelected(TQListViewItem*)) ); - connect( listview, SIGNAL(returnPressed(QListViewItem*)), - this, SLOT(slotSelected(QListViewItem* )) ); + connect( listview, TQT_SIGNAL(returnPressed(TQListViewItem*)), + this, TQT_SLOT(slotSelected(TQListViewItem* )) ); } @@ -255,15 +255,15 @@ void EfficientKListView::limitSize( int size ) { if( m_map.size() <= size + 50 ) return; - QMap<int, HashedString> backMap; + TQMap<int, HashedString> backMap; for( InsertionMap::const_iterator it = m_insertionNumbers.begin(); it != m_insertionNumbers.end(); ++it ) backMap[ (*it).second ] = (*it).first; - for( QMap<int, HashedString>::const_iterator it = backMap.begin(); it != backMap.end() && m_map.size() > size; ++it ) + for( TQMap<int, HashedString>::const_iterator it = backMap.begin(); it != backMap.end() && m_map.size() > size; ++it ) removeAllItems( (*it).str() ); } -void EfficientKListView::removeAllItems( const QString& str ) +void EfficientKListView::removeAllItems( const TQString& str ) { HashedString h(str); m_insertionNumbers.erase( h ) ; @@ -277,9 +277,9 @@ void EfficientKListView::removeAllItems( const QString& str ) m_map.erase( p.first, p.second ); } -void ProblemReporter::removeAllProblems( const QString& filename ) +void ProblemReporter::removeAllProblems( const TQString& filename ) { - QString relFileName = m_cppSupport->project()->relativeProjectFile(filename); + TQString relFileName = m_cppSupport->project()->relativeProjectFile(filename); kdDebug(9007) << "ProblemReporter::removeAllProblems()" << relFileName << endl; @@ -295,8 +295,8 @@ void ProblemReporter::removeAllProblems( const QString& filename ) if( m_markIface ) { - QPtrList<KTextEditor::Mark> marks = m_markIface->marks(); - QPtrListIterator<KTextEditor::Mark> it( marks ); + TQPtrList<KTextEditor::Mark> marks = m_markIface->marks(); + TQPtrListIterator<KTextEditor::Mark> it( marks ); while( it.current() ) { m_markIface->removeMark( it.current()->line, KTextEditor::MarkInterface::markType07 ); @@ -310,7 +310,7 @@ void ProblemReporter::initCurrentList() { m_tabBar->setTabEnabled(0,true); - QString relFileName = m_cppSupport->project()->relativeProjectFile(m_fileName); + TQString relFileName = m_cppSupport->project()->relativeProjectFile(m_fileName); m_currentList->clear(); @@ -322,14 +322,14 @@ void ProblemReporter::initCurrentList() // m_tabBar->setCurrentTab(0); } -void ProblemReporter::updateCurrentWith(EfficientKListView& listview, const QString& level, const QString& filename) +void ProblemReporter::updateCurrentWith(EfficientKListView& listview, const TQString& level, const TQString& filename) { EfficientKListView::Range r = listview.getRange( filename ); for( ; r.first != r.second; ++r.first ) new ProblemItem(m_currentList,level,(*r.first).second->text(1),(*r.first).second->text(2),(*r.first).second->text(3)); } -void ProblemReporter::slotSelected( QListViewItem* item ) +void ProblemReporter::slotSelected( TQListViewItem* item ) { bool is_filtered = false; bool is_current = false; @@ -345,20 +345,20 @@ void ProblemReporter::slotSelected( QListViewItem* item ) m_cppSupport->partController()->editDocument( url, line-1 ); } -bool ProblemReporter::hasErrors( const QString& fileName ) { +bool ProblemReporter::hasErrors( const TQString& fileName ) { return m_errorList.hasItem( fileName ); } -void ProblemReporter::reportProblem( const QString& fileName, const Problem& p ) +void ProblemReporter::reportProblem( const TQString& fileName, const Problem& p ) { int markType = levelToMarkType( p.level() ); if( markType != -1 && m_markIface && m_fileName == fileName ) m_markIface->addMark( p.line(), markType ); - QString msg = p.text(); - msg = msg.replace( QRegExp("\n"), "" ); + TQString msg = p.text(); + msg = msg.replace( TQRegExp("\n"), "" ); - QString relFileName = m_cppSupport->project()->relativeProjectFile(fileName); + TQString relFileName = m_cppSupport->project()->relativeProjectFile(fileName); EfficientKListView* list; @@ -384,8 +384,8 @@ void ProblemReporter::reportProblem( const QString& fileName, const Problem& p ) { list->addItem( relFileName, new ProblemItem( *list, relFileName, - QString::number( p.line() + 1 ), - QString::number( p.column() + 1 ), + TQString::number( p.line() + 1 ), + TQString::number( p.column() + 1 ), msg ) ); } @@ -403,20 +403,20 @@ void ProblemReporter::slotPartAdded( KParts::Part* part ) iface->setPixmap( KTextEditor::MarkInterface::markType07, SmallIcon("stop") ); } -QString ProblemReporter::levelToString( int level ) const +TQString ProblemReporter::levelToString( int level ) const { switch( level ) { case Problem::Level_Error: - return QString( i18n("Error") ); + return TQString( i18n("Error") ); case Problem::Level_Warning: - return QString( i18n("Warning") ); + return TQString( i18n("Warning") ); case Problem::Level_Todo: - return QString( i18n("Todo") ); + return TQString( i18n("Todo") ); case Problem::Level_Fixme: - return QString( i18n("Fixme") ); + return TQString( i18n("Fixme") ); default: - return QString::null; + return TQString::null; } } |