From dc6b8e72fed2586239e3514819238c520636c9d9 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:54:04 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- quanta/utility/quantabookmarks.cpp | 58 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'quanta/utility/quantabookmarks.cpp') diff --git a/quanta/utility/quantabookmarks.cpp b/quanta/utility/quantabookmarks.cpp index ebca5843..12ba69c5 100644 --- a/quanta/utility/quantabookmarks.cpp +++ b/quanta/utility/quantabookmarks.cpp @@ -31,21 +31,21 @@ #include #include -#include -#include -#include +#include +#include +#include #include "viewmanager.h" #include "document.h" /** Utility: selection sort - sort a QMemArray in ascending order. + sort a TQMemArray in ascending order. max it the largest (zerobased) index to sort. To sort the entire array: ssort( *array, array.size() -1 ); This is only efficient if ran only once. */ -static void ssort( QMemArray &a, int max ) +static void ssort( TQMemArray &a, int max ) { uint tmp, j, maxpos; for ( uint h = max; h >= 1; h-- ) @@ -62,7 +62,7 @@ static void ssort( QMemArray &a, int max ) // TODO add a insort() or bubble_sort - more efficient for aboutToShow() ? QuantaBookmarks::QuantaBookmarks(ViewManager *parent,Sorting sort, bool onlyFromActualDocument ) - : QObject( parent, "bookmarks" ) + : TQObject( parent, "bookmarks" ) , m_sorting(sort) , m_onlyFromActualDocument(onlyFromActualDocument) { @@ -86,38 +86,38 @@ void QuantaBookmarks::init(KActionCollection* ac) { m_bookmarkToggle = new KToggleAction( i18n("Set &Bookmark"), "bookmark", CTRL+Key_B, - this, SLOT(toggleBookmark()), + this, TQT_SLOT(toggleBookmark()), ac, "bookmarks_toggle" ); m_bookmarkToggle->setWhatsThis(i18n("If a line has no bookmark then add one, otherwise remove it.")); m_bookmarkToggle->setCheckedState( i18n("Clear &Bookmark") ); m_bookmarkClear = new KAction( i18n("Clear &All Bookmarks"), 0, - this, SLOT(clearBookmarks()), + this, TQT_SLOT(clearBookmarks()), ac, "bookmarks_clear"); m_bookmarkClear->setWhatsThis(i18n("Remove all bookmarks of the current document.")); m_goNext = new KAction( i18n("Next Bookmark"), "next", ALT + Key_PageDown, - this, SLOT(goNext()), + this, TQT_SLOT(goNext()), ac, "bookmarks_next"); m_goNext->setWhatsThis(i18n("Go to the next bookmark.")); m_goPrevious = new KAction( i18n("Previous Bookmark"), "previous", ALT + Key_PageUp, - this, SLOT(goPrevious()), + this, TQT_SLOT(goPrevious()), ac, "bookmarks_previous"); m_goPrevious->setWhatsThis(i18n("Go to the previous bookmark.")); //connect the aboutToShow() and aboutToHide() signals with //the bookmarkMenuAboutToShow() and bookmarkMenuAboutToHide() slots - connect( m_bookmarksMenu, SIGNAL(aboutToShow()), this, SLOT(bookmarkMenuAboutToShow())); - connect( m_bookmarksMenu, SIGNAL(aboutToHide()), this, SLOT(bookmarkMenuAboutToHide()) ); + connect( m_bookmarksMenu, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(bookmarkMenuAboutToShow())); + connect( m_bookmarksMenu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(bookmarkMenuAboutToHide()) ); marksChanged (); } -void QuantaBookmarks::setBookmarksMenu(QPopupMenu* bookmarksMenu) +void QuantaBookmarks::setBookmarksMenu(TQPopupMenu* bookmarksMenu) { m_bookmarksMenu = bookmarksMenu; @@ -147,7 +147,7 @@ void QuantaBookmarks::clearBookmarks () Document *doc = m_viewManager->activeDocument(); if (doc && doc->markIf) { - QPtrList m = doc->markIf->marks(); + TQPtrList m = doc->markIf->marks(); for (uint i=0; i < m.count(); i++) doc->markIf->removeMark( m.at(i)->line, KTextEditor::MarkInterface::markType01 ); @@ -156,21 +156,21 @@ void QuantaBookmarks::clearBookmarks () } } -int QuantaBookmarks::insertBookmarks(QPopupMenu& menu, Document *doc, bool insertNavigationItems ) +int QuantaBookmarks::insertBookmarks(TQPopupMenu& menu, Document *doc, bool insertNavigationItems ) { int insertedItems = 0; if (doc->markIf) { uint line = doc->viewCursorIf->cursorLine(); - const QRegExp re("&(?!&)"); + const TQRegExp re("&(?!&)"); int idx( -1 ); int old_menu_count = menu.count(); KTextEditor::Mark *next = 0; KTextEditor::Mark *prev = 0; - QPtrList m = doc->markIf->marks(); - QMemArray sortArray( m.count() ); - QPtrListIterator it( m ); + TQPtrList m = doc->markIf->marks(); + TQMemArray sortArray( m.count() ); + TQPtrListIterator it( m ); if ( it.count() > 0 && insertNavigationItems) menu.insertSeparator(); @@ -179,7 +179,7 @@ int QuantaBookmarks::insertBookmarks(QPopupMenu& menu, Document *doc, bool inser { if( (*it)->type & KTextEditor::MarkInterface::markType01 ) { - QString bText = KStringHandler::rEmSqueeze + TQString bText = KStringHandler::rEmSqueeze ( doc->editIf->textLine( (*it)->line ), menu.fontMetrics(), 32 ); bText.replace(re, "&&"); // kill undesired accellerators! @@ -196,7 +196,7 @@ int QuantaBookmarks::insertBookmarks(QPopupMenu& menu, Document *doc, bool inser } menu.insertItem( - QString("%1 - \"%2\"").arg( (*it)->line+1 ).arg( bText ), + TQString("%1 - \"%2\"").arg( (*it)->line+1 ).arg( bText ), 0, (*it)->line, idx ); insertedItems++; @@ -234,7 +234,7 @@ int QuantaBookmarks::insertBookmarks(QPopupMenu& menu, Document *doc, bool inser if ( next || prev ) menu.insertSeparator( idx ); } - connect(&menu, SIGNAL(activated(int)), this, SLOT(gotoLineNumber(int))); + connect(&menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(gotoLineNumber(int))); } return insertedItems; } @@ -259,10 +259,10 @@ void QuantaBookmarks::bookmarkMenuAboutToShow() Document *doc = m_doc; if (!doc) doc = m_viewManager->activeDocument(); - QValueList openedDocuments = m_viewManager->openedDocuments(); + TQValueList openedDocuments = m_viewManager->openedDocuments(); if (doc && doc->markIf) { - QPtrList m = doc->markIf->marks(); + TQPtrList m = doc->markIf->marks(); if (!m_onlyFromActualDocument) { @@ -279,11 +279,11 @@ void QuantaBookmarks::bookmarkMenuAboutToShow() if (!m_onlyFromActualDocument) { int i = 0; - for (QValueList::Iterator it = openedDocuments.begin(); it != openedDocuments.end(); ++it) + for (TQValueList::Iterator it = openedDocuments.begin(); it != openedDocuments.end(); ++it) { if (*it != doc) { - QPopupMenu *menu = new QPopupMenu(m_bookmarksMenu); + TQPopupMenu *menu = new TQPopupMenu(m_bookmarksMenu); m_bookmarksMenu->insertItem((*it)->url().fileName(), menu); if (insertBookmarks(*menu, *it, false) > 0) { @@ -317,7 +317,7 @@ void QuantaBookmarks::goNext() doc = m_viewManager->activeDocument(); if (doc && doc->markIf) { - QPtrList m = doc->markIf->marks(); + TQPtrList m = doc->markIf->marks(); if (m.isEmpty()) return; @@ -340,7 +340,7 @@ void QuantaBookmarks::goPrevious() doc = m_viewManager->activeDocument(); if (doc && doc->markIf) { - QPtrList m = doc->markIf->marks(); + TQPtrList m = doc->markIf->marks(); if (m.isEmpty()) return; @@ -361,7 +361,7 @@ void QuantaBookmarks::gotoLineNumber(int line) Document *doc = m_doc; if (!doc) doc = m_viewManager->activeDocument(); - const QObject *s = sender(); + const TQObject *s = sender(); for (uint i = 0; i < m_othersMenuList.count(); i++) { if (s == m_othersMenuList[i]) -- cgit v1.2.1