diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /parts/bookmarks | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/bookmarks')
-rw-r--r-- | parts/bookmarks/bookmarks_config.cpp | 4 | ||||
-rw-r--r-- | parts/bookmarks/bookmarks_config.h | 6 | ||||
-rw-r--r-- | parts/bookmarks/bookmarks_part.cpp | 126 | ||||
-rw-r--r-- | parts/bookmarks/bookmarks_part.h | 30 | ||||
-rw-r--r-- | parts/bookmarks/bookmarks_settings.cpp | 8 | ||||
-rw-r--r-- | parts/bookmarks/bookmarks_settings.h | 2 | ||||
-rw-r--r-- | parts/bookmarks/bookmarks_widget.cpp | 82 | ||||
-rw-r--r-- | parts/bookmarks/bookmarks_widget.h | 18 |
8 files changed, 138 insertions, 138 deletions
diff --git a/parts/bookmarks/bookmarks_config.cpp b/parts/bookmarks/bookmarks_config.cpp index 095c3f83..939dc6c2 100644 --- a/parts/bookmarks/bookmarks_config.cpp +++ b/parts/bookmarks/bookmarks_config.cpp @@ -125,12 +125,12 @@ void BookmarksConfig::setToolTip( bool tooltip ) _tooltip = tooltip; } -QString BookmarksConfig::token( ) +TQString BookmarksConfig::token( ) { return _token; } -void BookmarksConfig::setToken( QString const & token ) +void BookmarksConfig::setToken( TQString const & token ) { _token = token; } diff --git a/parts/bookmarks/bookmarks_config.h b/parts/bookmarks/bookmarks_config.h index c372eb51..38a3f0e9 100644 --- a/parts/bookmarks/bookmarks_config.h +++ b/parts/bookmarks/bookmarks_config.h @@ -34,8 +34,8 @@ public: unsigned int context(); void setContext( unsigned int ); - QString token(); - void setToken( QString const & ); + TQString token(); + void setToken( TQString const & ); void readConfig(); void writeConfig(); @@ -44,7 +44,7 @@ private: bool _tooltip; CodeLineType _codeline; unsigned int _context; - QString _token; + TQString _token; }; diff --git a/parts/bookmarks/bookmarks_part.cpp b/parts/bookmarks/bookmarks_part.cpp index f23863af..50830723 100644 --- a/parts/bookmarks/bookmarks_part.cpp +++ b/parts/bookmarks/bookmarks_part.cpp @@ -9,11 +9,11 @@ * * ***************************************************************************/ -#include <qwhatsthis.h> -#include <qvbox.h> -#include <qtimer.h> -#include <qtextstream.h> -#include <qfile.h> +#include <tqwhatsthis.h> +#include <tqvbox.h> +#include <tqtimer.h> +#include <tqtextstream.h> +#include <tqfile.h> #include <kdebug.h> #include <kiconloader.h> @@ -44,7 +44,7 @@ typedef KDevGenericFactory<BookmarksPart> BookmarksFactory; static const KDevPluginInfo data("kdevbookmarks"); K_EXPORT_COMPONENT_FACTORY( libkdevbookmarks, BookmarksFactory( data ) ) -BookmarksPart::BookmarksPart(QObject *parent, const char *name, const QStringList& ) +BookmarksPart::BookmarksPart(TQObject *parent, const char *name, const TQStringList& ) : KDevPlugin(&data, parent, name ? name : "BookmarksPart" ) { setInstance(BookmarksFactory::instance()); @@ -54,9 +54,9 @@ BookmarksPart::BookmarksPart(QObject *parent, const char *name, const QStringLis _widget->setCaption(i18n("Bookmarks")); _widget->setIcon(SmallIcon( info()->icon() )); - _marksChangeTimer = new QTimer( this ); + _marksChangeTimer = new TQTimer( this ); - QWhatsThis::add(_widget, i18n("<b>Bookmarks</b><p>" + TQWhatsThis::add(_widget, i18n("<b>Bookmarks</b><p>" "The bookmark viewer shows all the source bookmarks in the project.")); mainWindow()->embedSelectView(_widget, i18n("Bookmarks"), i18n("Source bookmarks")); @@ -64,19 +64,19 @@ BookmarksPart::BookmarksPart(QObject *parent, const char *name, const QStringLis _editorMap.setAutoDelete( true ); _settingMarks = false; - connect( partController(), SIGNAL( partAdded( KParts::Part * ) ), this, SLOT( partAdded( KParts::Part * ) ) ); + connect( partController(), TQT_SIGNAL( partAdded( KParts::Part * ) ), this, TQT_SLOT( partAdded( KParts::Part * ) ) ); _configProxy = new ConfigWidgetProxy( core() ); _configProxy->createProjectConfigPage( i18n("Bookmarks"), BOOKMARKSETTINGSPAGE, info()->icon() ); - connect( _configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )), - this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )) ); + connect( _configProxy, TQT_SIGNAL(insertConfigWidget(const KDialogBase*, TQWidget*, unsigned int )), + this, TQT_SLOT(insertConfigWidget(const KDialogBase*, TQWidget*, unsigned int )) ); - connect( _widget, SIGNAL( removeAllBookmarksForURL( const KURL & ) ), - this, SLOT( removeAllBookmarksForURL( const KURL & ) ) ); - connect( _widget, SIGNAL( removeBookmarkForURL( const KURL &, int ) ), - this, SLOT( removeBookmarkForURL( const KURL &, int ) ) ); + connect( _widget, TQT_SIGNAL( removeAllBookmarksForURL( const KURL & ) ), + this, TQT_SLOT( removeAllBookmarksForURL( const KURL & ) ) ); + connect( _widget, TQT_SIGNAL( removeBookmarkForURL( const KURL &, int ) ), + this, TQT_SLOT( removeBookmarkForURL( const KURL &, int ) ) ); - connect( _marksChangeTimer, SIGNAL( timeout() ), this, SLOT( marksChanged() ) ); + connect( _marksChangeTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( marksChanged() ) ); _config = new BookmarksConfig; _config->readConfig(); @@ -112,10 +112,10 @@ void BookmarksPart::partAdded( KParts::Part * part ) // connect to this editor KTextEditor::Document * doc = static_cast<KTextEditor::Document*>( ro_part ); - connect( doc, SIGNAL( marksChanged() ), this, SLOT( marksEvent() ) ); + connect( doc, TQT_SIGNAL( marksChanged() ), this, TQT_SLOT( marksEvent() ) ); // workaround for a katepart oddity where it drops all bookmarks on 'reload' - connect( doc, SIGNAL( completed() ), this, SLOT( reload() ) ); + connect( doc, TQT_SIGNAL( completed() ), this, TQT_SLOT( reload() ) ); } } } @@ -124,7 +124,7 @@ void BookmarksPart::reload() { //kdDebug(0) << "BookmarksPart::reload()" << endl; - QObject * senderobj = const_cast<QObject*>( sender() ); + TQObject * senderobj = const_cast<TQObject*>( sender() ); if ( KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart *>( senderobj ) ) { if ( partIsSane( ro_part ) ) @@ -140,7 +140,7 @@ void BookmarksPart::marksEvent() if ( ! _settingMarks ) { - QObject * senderobj = const_cast<QObject*>( sender() ); + TQObject * senderobj = const_cast<TQObject*>( sender() ); KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart *>( senderobj ); if ( partIsSane( ro_part ) && !_dirtyParts.contains( ro_part ) ) @@ -155,7 +155,7 @@ void BookmarksPart::marksChanged() { //kdDebug(0) << "BookmarksPart::marksChanged()" << endl; - QValueListIterator<KParts::ReadOnlyPart*> it = _dirtyParts.begin(); + TQValueListIterator<KParts::ReadOnlyPart*> it = _dirtyParts.begin(); while ( it != _dirtyParts.end() ) { KParts::ReadOnlyPart * ro_part = *it; @@ -179,31 +179,31 @@ void BookmarksPart::marksChanged() _dirtyParts.clear(); } -void BookmarksPart::restorePartialProjectSession( const QDomElement * el ) +void BookmarksPart::restorePartialProjectSession( const TQDomElement * el ) { //kdDebug(0) << "BookmarksPart::restorePartialProjectSession()" << endl; if ( ! el ) return; - QDomElement bookmarksList = el->namedItem( "bookmarks" ).toElement(); + TQDomElement bookmarksList = el->namedItem( "bookmarks" ).toElement(); if ( bookmarksList.isNull() ) return; - QDomElement bookmark = bookmarksList.firstChild().toElement(); + TQDomElement bookmark = bookmarksList.firstChild().toElement(); while ( ! bookmark.isNull() ) { - QString path = bookmark.attribute( "url" ); - if ( path != QString::null ) + TQString path = bookmark.attribute( "url" ); + if ( path != TQString::null ) { EditorData * data = new EditorData; data->url.setPath( path ); - QDomElement mark = bookmark.firstChild().toElement(); + TQDomElement mark = bookmark.firstChild().toElement(); while ( ! mark.isNull() ) { - QString line = mark.attribute( "line" ); - if ( line != QString::null ) + TQString line = mark.attribute( "line" ); + if ( line != TQString::null ) { - data->marks.append( qMakePair( line.toInt(), QString() ) ); + data->marks.append( qMakePair( line.toInt(), TQString() ) ); } mark = mark.nextSibling().toElement(); } @@ -224,28 +224,28 @@ void BookmarksPart::restorePartialProjectSession( const QDomElement * el ) _widget->update( _editorMap ); } -void BookmarksPart::savePartialProjectSession( QDomElement * el ) +void BookmarksPart::savePartialProjectSession( TQDomElement * el ) { //kdDebug(0) << "BookmarksPart::savePartialProjectSession()" << endl; if ( ! el ) return; - QDomDocument domDoc = el->ownerDocument(); + TQDomDocument domDoc = el->ownerDocument(); if ( domDoc.isNull() ) return; - QDomElement bookmarksList = domDoc.createElement( "bookmarks" ); + TQDomElement bookmarksList = domDoc.createElement( "bookmarks" ); - QDictIterator<EditorData> it( _editorMap ); + TQDictIterator<EditorData> it( _editorMap ); while ( it.current() ) { - QDomElement bookmark = domDoc.createElement( "bookmark" ); + TQDomElement bookmark = domDoc.createElement( "bookmark" ); bookmark.setAttribute( "url", it.current()->url.path() ); bookmarksList.appendChild( bookmark ); - QValueListIterator< QPair<int,QString> > it2 = it.current()->marks.begin(); + TQValueListIterator< QPair<int,TQString> > it2 = it.current()->marks.begin(); while ( it2 != it.current()->marks.end() ) { - QDomElement line = domDoc.createElement( "mark" ); + TQDomElement line = domDoc.createElement( "mark" ); line.setAttribute( "line", (*it2).first ); bookmark.appendChild( line ); ++it2; @@ -275,7 +275,7 @@ void BookmarksPart::removeBookmarkForURL( KURL const & url, int line ) if ( EditorData * data = _editorMap.find( url.path() ) ) { - QValueListIterator< QPair<int,QString> > it = data->marks.begin(); + TQValueListIterator< QPair<int,TQString> > it = data->marks.begin(); while ( it != data->marks.end() ) { if ( (*it).first == line ) @@ -309,7 +309,7 @@ void BookmarksPart::updateContextStringForURL( KParts::ReadOnlyPart * ro_part ) if ( ! ( data && ed ) ) return; - QValueListIterator< QPair<int,QString> > it = data->marks.begin(); + TQValueListIterator< QPair<int,TQString> > it = data->marks.begin(); while ( it != data->marks.end() ) { (*it).second = ed->textLine( (*it).first ); @@ -324,7 +324,7 @@ void BookmarksPart::updateContextStringForURL( KURL const & url ) void BookmarksPart::updateContextStringForAll() { - QDictIterator<EditorData> it( _editorMap ); + TQDictIterator<EditorData> it( _editorMap ); while ( it.current() ) { if ( ! it.current()->marks.isEmpty() ) @@ -347,7 +347,7 @@ bool BookmarksPart::setBookmarksForURL( KParts::ReadOnlyPart * ro_part ) { // we've seen this one before, apply stored bookmarks - QValueListIterator< QPair<int,QString> > it = data->marks.begin(); + TQValueListIterator< QPair<int,TQString> > it = data->marks.begin(); while ( it != data->marks.end() ) { mi->addMark( (*it).first, KTextEditor::MarkInterface::markType01 ); @@ -371,8 +371,8 @@ bool BookmarksPart::clearBookmarksForURL( KParts::ReadOnlyPart * ro_part ) { _settingMarks = true; - QPtrList<KTextEditor::Mark> marks = mi->marks(); - QPtrListIterator<KTextEditor::Mark> it( marks ); + TQPtrList<KTextEditor::Mark> marks = mi->marks(); + TQPtrListIterator<KTextEditor::Mark> it( marks ); while ( it.current() ) { if ( it.current()->type & KTextEditor::MarkInterface::markType01 ) @@ -402,14 +402,14 @@ EditorData * BookmarksPart::storeBookmarksForURL( KParts::ReadOnlyPart * ro_part // removing previous data for this url, if any _editorMap.remove( data->url.path() ); - QPtrList<KTextEditor::Mark> marks = mi->marks(); - QPtrListIterator<KTextEditor::Mark> it( marks ); + TQPtrList<KTextEditor::Mark> marks = mi->marks(); + TQPtrListIterator<KTextEditor::Mark> it( marks ); while ( it.current() ) { if ( it.current()->type & KTextEditor::MarkInterface::markType01 ) { int line = it.current()->line; - data->marks.append( qMakePair( line, QString() ) ); + data->marks.append( qMakePair( line, TQString() ) ); } ++it; } @@ -430,9 +430,9 @@ EditorData * BookmarksPart::storeBookmarksForURL( KParts::ReadOnlyPart * ro_part void BookmarksPart::setBookmarksForAllURLs() { - if( const QPtrList<KParts::Part> * partlist = partController()->parts() ) + if( const TQPtrList<KParts::Part> * partlist = partController()->parts() ) { - QPtrListIterator<KParts::Part> it( *partlist ); + TQPtrListIterator<KParts::Part> it( *partlist ); while ( KParts::Part* part = it.current() ) { if ( KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart *>( part ) ) @@ -446,9 +446,9 @@ void BookmarksPart::setBookmarksForAllURLs() void BookmarksPart::storeBookmarksForAllURLs() { - if( const QPtrList<KParts::Part> * partlist = partController()->parts() ) + if( const TQPtrList<KParts::Part> * partlist = partController()->parts() ) { - QPtrListIterator<KParts::Part> it( *partlist ); + TQPtrListIterator<KParts::Part> it( *partlist ); while ( KParts::Part* part = it.current() ) { if ( KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart *>( part ) ) @@ -463,7 +463,7 @@ void BookmarksPart::storeBookmarksForAllURLs() // reimplemented from PartController::partForURL to avoid linking KParts::ReadOnlyPart * BookmarksPart::partForURL( KURL const & url ) { - QPtrListIterator<KParts::Part> it( *partController()->parts() ); + TQPtrListIterator<KParts::Part> it( *partController()->parts() ); while( it.current() ) { KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(it.current()); @@ -483,20 +483,20 @@ bool BookmarksPart::partIsSane( KParts::ReadOnlyPart * ro_part ) !ro_part->url().path().isEmpty(); } -void BookmarksPart::insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber ) +void BookmarksPart::insertConfigWidget( const KDialogBase * dlg, TQWidget * page, unsigned int pagenumber ) { kdDebug() << k_funcinfo << endl; if ( pagenumber == BOOKMARKSETTINGSPAGE ) { BookmarkSettings * w = new BookmarkSettings( this, page ); - connect( dlg, SIGNAL(okClicked()), w, SLOT(slotAccept()) ); + connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(slotAccept()) ); } } //////////////////////////////////////////// -QStringList BookmarksPart::getContextFromStream( QTextStream & istream, unsigned int line, unsigned int context ) +TQStringList BookmarksPart::getContextFromStream( TQTextStream & istream, unsigned int line, unsigned int context ) { kdDebug() << k_funcinfo << endl; @@ -504,10 +504,10 @@ QStringList BookmarksPart::getContextFromStream( QTextStream & istream, unsigned int endline = line + context; int n = 0; - QStringList list; + TQStringList list; while ( !istream.atEnd() ) { - QString templine = istream.readLine(); + TQString templine = istream.readLine(); if ( (n >= startline) && ( n <= endline ) ) { list << templine; @@ -531,31 +531,31 @@ QStringList BookmarksPart::getContextFromStream( QTextStream & istream, unsigned return list; } -QStringList BookmarksPart::getContext( KURL const & url, unsigned int line, unsigned int context ) +TQStringList BookmarksPart::getContext( KURL const & url, unsigned int line, unsigned int context ) { // if the file is open - get the line from the editor buffer if ( KTextEditor::EditInterface * ei = dynamic_cast<KTextEditor::EditInterface*>( partForURL( url ) ) ) { kdDebug() << "the file is open - get the line from the editor buffer" << endl; - QString ibuffer = ei->text(); - QTextStream istream( &ibuffer, IO_ReadOnly ); + TQString ibuffer = ei->text(); + TQTextStream istream( &ibuffer, IO_ReadOnly ); return getContextFromStream( istream, line, context ); } else if ( url.isLocalFile() ) // else the file is not open - get the line from the file on disk { kdDebug() << "the file is not open - get the line from the file on disk" << endl; - QFile file( url.path() ); - QString buffer; + TQFile file( url.path() ); + TQString buffer; if ( file.open( IO_ReadOnly ) ) { - QTextStream istream( &file ); + TQTextStream istream( &file ); return getContextFromStream( istream, line, context ); } } - return QStringList( i18n("Could not find file") ); + return TQStringList( i18n("Could not find file") ); } BookmarksConfig * BookmarksPart::config( ) diff --git a/parts/bookmarks/bookmarks_part.h b/parts/bookmarks/bookmarks_part.h index 32a105ad..7abfeb9e 100644 --- a/parts/bookmarks/bookmarks_part.h +++ b/parts/bookmarks/bookmarks_part.h @@ -14,10 +14,10 @@ #define __KDEVPART_BOOKMARKS_H__ -#include <qguardedptr.h> -#include <qvaluelist.h> -#include <qdict.h> -#include <qpair.h> +#include <tqguardedptr.h> +#include <tqvaluelist.h> +#include <tqdict.h> +#include <tqpair.h> #include <kparts/part.h> #include <kurl.h> @@ -32,7 +32,7 @@ class ConfigWidgetProxy; struct EditorData { KURL url; - QValueList< QPair<int,QString> > marks; + TQValueList< QPair<int,TQString> > marks; }; class BookmarksWidget; @@ -44,16 +44,16 @@ class BookmarksPart : public KDevPlugin public: - BookmarksPart(QObject *parent, const char *name, const QStringList &); + BookmarksPart(TQObject *parent, const char *name, const TQStringList &); ~BookmarksPart(); // reimplemented from KDevPlugin - void restorePartialProjectSession( const QDomElement * el ); - void savePartialProjectSession( QDomElement * el ); + void restorePartialProjectSession( const TQDomElement * el ); + void savePartialProjectSession( TQDomElement * el ); BookmarksConfig * config(); - QStringList getContext( KURL const & url, unsigned int line, unsigned int context ); + TQStringList getContext( KURL const & url, unsigned int line, unsigned int context ); private slots: // connected to partcontroller @@ -72,7 +72,7 @@ private slots: void removeAllBookmarksForURL( const KURL & ); void removeBookmarkForURL( const KURL &, int ); - void insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int ); + void insertConfigWidget( const KDialogBase * dlg, TQWidget * page, unsigned int ); private: bool setBookmarksForURL( KParts::ReadOnlyPart * ); @@ -86,21 +86,21 @@ private: void updateContextStringForURL( KURL const & url ); void updateContextStringForAll(); - QStringList getContextFromStream( QTextStream & istream, unsigned int line, unsigned int context ); + TQStringList getContextFromStream( TQTextStream & istream, unsigned int line, unsigned int context ); KParts::ReadOnlyPart * partForURL( KURL const & url ); bool partIsSane( KParts::ReadOnlyPart * ); - QGuardedPtr<BookmarksWidget> _widget; - QDict<EditorData> _editorMap; + TQGuardedPtr<BookmarksWidget> _widget; + TQDict<EditorData> _editorMap; bool _settingMarks; // are we currently in the process of setting bookmarks? BookmarksConfig * _config; ConfigWidgetProxy * _configProxy; - QTimer * _marksChangeTimer; - QValueList<KParts::ReadOnlyPart*> _dirtyParts; + TQTimer * _marksChangeTimer; + TQValueList<KParts::ReadOnlyPart*> _dirtyParts; }; diff --git a/parts/bookmarks/bookmarks_settings.cpp b/parts/bookmarks/bookmarks_settings.cpp index 235ec261..58369d92 100644 --- a/parts/bookmarks/bookmarks_settings.cpp +++ b/parts/bookmarks/bookmarks_settings.cpp @@ -9,9 +9,9 @@ * * ***************************************************************************/ -#include <qradiobutton.h> -#include <qcheckbox.h> -#include <qspinbox.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqspinbox.h> #include <klineedit.h> #include "bookmarks_part.h" @@ -19,7 +19,7 @@ #include "bookmarks_settings.h" -BookmarkSettings::BookmarkSettings( BookmarksPart * part, QWidget* parent, const char* name, WFlags fl ) +BookmarkSettings::BookmarkSettings( BookmarksPart * part, TQWidget* parent, const char* name, WFlags fl ) : BookmarkSettingsBase( parent, name, fl ), m_part( part ) { m_part->config()->readConfig(); diff --git a/parts/bookmarks/bookmarks_settings.h b/parts/bookmarks/bookmarks_settings.h index 3fa6c5e9..699941ca 100644 --- a/parts/bookmarks/bookmarks_settings.h +++ b/parts/bookmarks/bookmarks_settings.h @@ -21,7 +21,7 @@ class BookmarkSettings : public BookmarkSettingsBase Q_OBJECT public: - BookmarkSettings( BookmarksPart * part, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + BookmarkSettings( BookmarksPart * part, TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~BookmarkSettings(); public slots: diff --git a/parts/bookmarks/bookmarks_widget.cpp b/parts/bookmarks/bookmarks_widget.cpp index 683c32e1..20ab2cd9 100644 --- a/parts/bookmarks/bookmarks_widget.cpp +++ b/parts/bookmarks/bookmarks_widget.cpp @@ -9,11 +9,11 @@ * * ***************************************************************************/ -#include <qdict.h> -#include <qheader.h> -#include <qtooltip.h> -#include <qpair.h> -#include <qstylesheet.h> +#include <tqdict.h> +#include <tqheader.h> +#include <tqtooltip.h> +#include <tqpair.h> +#include <tqstylesheet.h> #include <kparts/part.h> #include <klibloader.h> @@ -59,13 +59,13 @@ static const char* const bookmark_xpm[]={ class BookmarkItem : public QListViewItem { public: - BookmarkItem( QListView * parent, KURL const & url ) - : QListViewItem( parent, url.fileName() ), + BookmarkItem( TQListView * parent, KURL const & url ) + : TQListViewItem( parent, url.fileName() ), _url( url ), _line( -1 ), _isBookmark( false ) {} - BookmarkItem( QListViewItem * parent, KURL const & url, QPair<int,QString> mark ) - : QListViewItem( parent, QString::number( mark.first +1 ).rightJustify( 5 ) ), + BookmarkItem( TQListViewItem * parent, KURL const & url, QPair<int,TQString> mark ) + : TQListViewItem( parent, TQString::number( mark.first +1 ).rightJustify( 5 ) ), _url( url ), _line( mark.first ), _isBookmark( true ) { BookmarksWidget * lv = static_cast<BookmarksWidget*>( listView() ); @@ -97,17 +97,17 @@ public: return _line; } - QString tipText() + TQString tipText() { if ( _isBookmark ) { BookmarksWidget * w = static_cast<BookmarksWidget*> ( listView() ); - QStringList list = w->getContext( _url, _line ); + TQStringList list = w->getContext( _url, _line ); - QString code = "<qt><table><tr><td><pre>"; + TQString code = "<qt><table><tr><td><pre>"; for ( uint i = 0; i < list.count(); i++) { - QString temp = QStyleSheet::escape( list[i] ); + TQString temp = TQStyleSheet::escape( list[i] ); if ( i == (list.count() / 2) ) // count() is always odd { @@ -134,40 +134,40 @@ private: KURL _url; int _line; bool _isBookmark; - QString _code; + TQString _code; }; BookmarksWidget::BookmarksWidget(BookmarksPart *part) - : KListView(0, "bookmarks widget"), QToolTip( viewport() ), + : KListView(0, "bookmarks widget"), TQToolTip( viewport() ), _part( part ) { - addColumn( QString::null ); + addColumn( TQString::null ); header()->hide(); setRootIsDecorated( true ); - setResizeMode( QListView::LastColumn ); + setResizeMode( TQListView::LastColumn ); setAllColumnsShowFocus( true ); // setSortColumn( -1 ); - connect( this, SIGNAL( executed( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) ); - connect( this, SIGNAL( returnPressed( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) ); - connect( this, SIGNAL( contextMenuRequested ( QListViewItem *, const QPoint & , int ) ), - this, SLOT( popupMenu(QListViewItem *, const QPoint & , int ) ) ); + connect( this, TQT_SIGNAL( executed( TQListViewItem * ) ), this, TQT_SLOT( itemClicked( TQListViewItem * ) ) ); + connect( this, TQT_SIGNAL( returnPressed( TQListViewItem * ) ), this, TQT_SLOT( itemClicked( TQListViewItem * ) ) ); + connect( this, TQT_SIGNAL( contextMenuRequested ( TQListViewItem *, const TQPoint & , int ) ), + this, TQT_SLOT( popupMenu(TQListViewItem *, const TQPoint & , int ) ) ); } BookmarksWidget::~BookmarksWidget() {} -void BookmarksWidget::maybeTip(const QPoint &p) +void BookmarksWidget::maybeTip(const TQPoint &p) { // kdDebug(0) << "ToolTip::maybeTip()" << endl; if ( ! _part->config()->toolTip() ) return; BookmarkItem * item = dynamic_cast<BookmarkItem*>( itemAt( p ) ); - QRect r = itemRect( item ); + TQRect r = itemRect( item ); if ( item && r.isValid() ) { @@ -175,13 +175,13 @@ void BookmarksWidget::maybeTip(const QPoint &p) } } -void BookmarksWidget::update( QDict<EditorData> const & map ) +void BookmarksWidget::update( TQDict<EditorData> const & map ) { // kdDebug(0) << "BookmarksWidget::update()" << endl; - QListView::clear(); + TQListView::clear(); - QDictIterator<EditorData> it( map ); + TQDictIterator<EditorData> it( map ); while ( it.current() ) { if ( ! it.current()->marks.isEmpty() ) @@ -209,15 +209,15 @@ void BookmarksWidget::createURL( EditorData * data ) if ( data ) { - QListViewItem * file = new BookmarkItem( this, data->url ); + TQListViewItem * file = new BookmarkItem( this, data->url ); file->setOpen( true ); file->setPixmap( 0, SmallIcon( "document" ) ); - QValueListIterator< QPair<int,QString> > it = data->marks.begin(); + TQValueListIterator< QPair<int,TQString> > it = data->marks.begin(); while ( it != data->marks.end() ) { - QListViewItem * item = new BookmarkItem( file, data->url, *it ); - item->setPixmap( 0, QPixmap((const char**)bookmark_xpm) ); + TQListViewItem * item = new BookmarkItem( file, data->url, *it ); + item->setPixmap( 0, TQPixmap((const char**)bookmark_xpm) ); ++it; } } @@ -227,7 +227,7 @@ bool BookmarksWidget::removeURL( KURL const & url ) { // kdDebug(0) << "BookmarksWidget::removeURL()" << endl; - QListViewItem * item = firstChild(); + TQListViewItem * item = firstChild(); while ( item ) { BookmarkItem * bm = static_cast<BookmarkItem*>(item); @@ -255,7 +255,7 @@ void BookmarksWidget::doEmitRemoveBookMark() } } -void BookmarksWidget::popupMenu( QListViewItem * item, const QPoint & p, int ) +void BookmarksWidget::popupMenu( TQListViewItem * item, const TQPoint & p, int ) { // kdDebug(0) << "BookmarksWidget::contextMenuRequested()" << endl; @@ -268,27 +268,27 @@ void BookmarksWidget::popupMenu( QListViewItem * item, const QPoint & p, int ) if ( _selectedItem->isBookmark() ) { popup.insertTitle( _selectedItem->url().fileName() + i18n(", line ") - + QString::number( _selectedItem->line() +1 ) ); + + TQString::number( _selectedItem->line() +1 ) ); - popup.insertItem( i18n("Remove This Bookmark"), this, SLOT( doEmitRemoveBookMark() ) ); + popup.insertItem( i18n("Remove This Bookmark"), this, TQT_SLOT( doEmitRemoveBookMark() ) ); } else { popup.insertTitle( _selectedItem->url().fileName() + i18n( ", All" ) ); - popup.insertItem( i18n("Remove These Bookmarks"), this, SLOT( doEmitRemoveBookMark() ) ); + popup.insertItem( i18n("Remove These Bookmarks"), this, TQT_SLOT( doEmitRemoveBookMark() ) ); } popup.insertSeparator(); - popup.insertItem( i18n( "Collapse All" ), this, SLOT(collapseAll()) ); - popup.insertItem( i18n( "Expand All" ), this, SLOT(expandAll()) ); + popup.insertItem( i18n( "Collapse All" ), this, TQT_SLOT(collapseAll()) ); + popup.insertItem( i18n( "Expand All" ), this, TQT_SLOT(expandAll()) ); popup.exec(p); } } -void BookmarksWidget::itemClicked( QListViewItem * clickedItem ) +void BookmarksWidget::itemClicked( TQListViewItem * clickedItem ) { // kdDebug(0) << "BookmarksWidget::itemClicked()" << endl; @@ -305,14 +305,14 @@ BookmarksConfig * BookmarksWidget::config( ) return _part->config(); } -QStringList BookmarksWidget::getContext( KURL const & url, unsigned int line ) +TQStringList BookmarksWidget::getContext( KURL const & url, unsigned int line ) { return _part->getContext( url, line, config()->context() ); } void BookmarksWidget::collapseAll( ) { - QListViewItem * it = firstChild(); + TQListViewItem * it = firstChild(); while( it ) { it->setOpen( false ); @@ -322,7 +322,7 @@ void BookmarksWidget::collapseAll( ) void BookmarksWidget::expandAll( ) { - QListViewItem * it = firstChild(); + TQListViewItem * it = firstChild(); while( it ) { it->setOpen( true ); diff --git a/parts/bookmarks/bookmarks_widget.h b/parts/bookmarks/bookmarks_widget.h index 96bfe046..6af0b563 100644 --- a/parts/bookmarks/bookmarks_widget.h +++ b/parts/bookmarks/bookmarks_widget.h @@ -13,10 +13,10 @@ #define __BOOKMARKS_WIDGET_H__ -#include <qwidget.h> -#include <qstring.h> -//#include <qlistview.h> -#include <qtooltip.h> +#include <tqwidget.h> +#include <tqstring.h> +//#include <tqlistview.h> +#include <tqtooltip.h> #include <klistview.h> @@ -34,23 +34,23 @@ public: BookmarksWidget( BookmarksPart * ); ~BookmarksWidget(); - void update( QDict<EditorData> const & ); + void update( TQDict<EditorData> const & ); void updateURL( EditorData * ); bool removeURL( KURL const & ); BookmarksConfig * config(); - QStringList getContext( KURL const &, unsigned int ); + TQStringList getContext( KURL const &, unsigned int ); signals: void removeAllBookmarksForURL( const KURL & ); void removeBookmarkForURL( const KURL &, int ); protected: - void maybeTip( QPoint const & ); + void maybeTip( TQPoint const & ); private slots: - void itemClicked( QListViewItem * ); - void popupMenu( QListViewItem * , const QPoint & , int ); + void itemClicked( TQListViewItem * ); + void popupMenu( TQListViewItem * , const TQPoint & , int ); void collapseAll(); void expandAll(); void doEmitRemoveBookMark(); |