From 87a016680e3677da3993f333561e79eb0cead7d5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 29 Jun 2011 16:05:55 +0000 Subject: TQt4 port ktechlab This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/recentfilesaction.cpp | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src/recentfilesaction.cpp') diff --git a/src/recentfilesaction.cpp b/src/recentfilesaction.cpp index ac38d6b..64ba467 100644 --- a/src/recentfilesaction.cpp +++ b/src/recentfilesaction.cpp @@ -15,22 +15,22 @@ #include #include -RecentFilesAction::RecentFilesAction( const QString & configGroupName, const QString& text, const QObject* receiver, const char* slot, QObject* parent, const char* name ) - : KSelectAction( text, 0/*pix*/, parent, name ) +RecentFilesAction::RecentFilesAction( const TQString & configGroupName, const TQString& text, const TQObject* receiver, const char* slot, TQObject* tqparent, const char* name ) + : KSelectAction( text, 0/*pix*/, tqparent, name ) { m_configGroupName = configGroupName; m_maxItems = 10; m_popup = new KPopupMenu; - connect(m_popup, SIGNAL(aboutToShow()), this, SLOT(menuAboutToShow())); - connect(m_popup, SIGNAL(activated(int)), this, SLOT(menuItemActivated(int))); - connect( this, SIGNAL( activated( const QString& ) ), - this, SLOT( itemSelected( const QString& ) ) ); + connect(m_popup, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(menuAboutToShow())); + connect(m_popup, TQT_SIGNAL(activated(int)), this, TQT_SLOT(menuItemActivated(int))); + connect( this, TQT_SIGNAL( activated( const TQString& ) ), + this, TQT_SLOT( itemSelected( const TQString& ) ) ); setMenuAccelsEnabled( false ); if ( receiver ) - connect( this, SIGNAL(urlSelected(const KURL &)), receiver, slot ); + connect( this, TQT_SIGNAL(urlSelected(const KURL &)), receiver, slot ); } @@ -44,13 +44,13 @@ void RecentFilesAction::addURL( const KURL& url ) if ( url.isLocalFile() && !KGlobal::dirs()->relativeLocation("tmp", url.path()).startsWith("/")) return; - QString file; + TQString file; if ( url.isLocalFile() && url.ref().isNull() && url.query().isNull() ) file = url.path(); else file = url.prettyURL(); - QStringList lst = items(); + TQStringList lst = items(); // remove file if already in list lst.remove( file ); @@ -74,10 +74,10 @@ void RecentFilesAction::loadEntries() { KConfig * config = KGlobal::config(); - QString key; - QString value; - QString oldGroup; - QStringList lst; + TQString key; + TQString value; + TQString oldGroup; + TQStringList lst; oldGroup = config->group(); @@ -86,7 +86,7 @@ void RecentFilesAction::loadEntries() // read file list for( unsigned int i = 1 ; i <= m_maxItems ; i++ ) { - key = QString( "File%1" ).arg( i ); + key = TQString( "File%1" ).tqarg( i ); value = config->readPathEntry( key ); if (!value.isNull()) @@ -103,10 +103,10 @@ void RecentFilesAction::saveEntries() { KConfig * config = KGlobal::config(); - QString key; - QString value; - QString oldGroup; - QStringList lst = items(); + TQString key; + TQString value; + TQString oldGroup; + TQStringList lst = items(); oldGroup = config->group(); @@ -116,7 +116,7 @@ void RecentFilesAction::saveEntries() // write file list for( unsigned int i = 1 ; i <= lst.count() ; i++ ) { - key = QString( "File%1" ).arg( i ); + key = TQString( "File%1" ).tqarg( i ); value = lst[ i - 1 ]; config->writePathEntry( key, value ); } @@ -126,7 +126,7 @@ void RecentFilesAction::saveEntries() config->sync(); } -void RecentFilesAction::itemSelected( const QString& text ) +void RecentFilesAction::itemSelected( const TQString& text ) { emit urlSelected( KURL( text ) ); } @@ -140,9 +140,9 @@ void RecentFilesAction::menuAboutToShow() { KPopupMenu *menu = m_popup; menu->clear(); - QStringList list = items(); - QStringList::iterator end = list.end(); - for ( QStringList::Iterator it = list.begin(); it != end; ++it ) + TQStringList list = items(); + TQStringList::iterator end = list.end(); + for ( TQStringList::Iterator it = list.begin(); it != end; ++it ) menu->insertItem(*it); } @@ -151,7 +151,7 @@ void RecentFilesAction::slotClicked() KAction::slotActivated(); } -void RecentFilesAction::slotActivated(const QString& text) +void RecentFilesAction::slotActivated(const TQString& text) { KSelectAction::slotActivated(text); } -- cgit v1.2.1