From fd5d099065a748cac49e20a13481f85666c53c71 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 15:14:12 -0600 Subject: Rename a number of classes to enhance compatibility with KDE4 --- kontact/src/iconsidepane.cpp | 10 +++--- kontact/src/iconsidepane.h | 8 ++--- kontact/src/kcmkontact.h | 2 +- kontact/src/main.cpp | 6 ++-- kontact/src/mainwindow.cpp | 74 +++++++++++++++++++++---------------------- kontact/src/mainwindow.h | 16 +++++----- kontact/src/profiledialog.cpp | 2 +- kontact/src/profiledialog.h | 4 +-- kontact/src/sidepanebase.h | 2 +- 9 files changed, 62 insertions(+), 62 deletions(-) (limited to 'kontact/src') diff --git a/kontact/src/iconsidepane.cpp b/kontact/src/iconsidepane.cpp index 2fef3e0b2..de16ee72d 100644 --- a/kontact/src/iconsidepane.cpp +++ b/kontact/src/iconsidepane.cpp @@ -251,7 +251,7 @@ void EntryItem::setPaintActive( bool paintActive ) } Navigator::Navigator( IconSidePane *parent, const char *name ) - : KListBox( parent, name ), mSidePane( parent ), + : TDEListBox( parent, name ), mSidePane( parent ), mShowIcons( true ), mShowText( true ) { mMouseOn = 0; @@ -259,7 +259,7 @@ Navigator::Navigator( IconSidePane *parent, const char *name ) mViewMode = sizeIntToEnum( Prefs::self()->sidePaneIconSize() ); mShowIcons = Prefs::self()->sidePaneShowIcons(); mShowText = Prefs::self()->sidePaneShowText(); - setSelectionMode( KListBox::Single ); + setSelectionMode( TDEListBox::Single ); viewport()->setBackgroundMode( PaletteBackground ); setFrameStyle( TQFrame::NoFrame ); setHScrollBarMode( TQScrollView::AlwaysOff ); @@ -400,13 +400,13 @@ void Navigator::resizeEvent( TQResizeEvent *event ) void Navigator::enterEvent( TQEvent *event ) { // work around TQt behaviour: onItem is not emmitted in enterEvent() - KListBox::enterEvent( event ); + TDEListBox::enterEvent( event ); emit onItem( itemAt( mapFromGlobal( TQCursor::pos() ) ) ); } void Navigator::leaveEvent( TQEvent *event ) { - KListBox::leaveEvent( event ); + TDEListBox::leaveEvent( event ); slotMouseOn( 0 ); mMouseOn = 0; } @@ -443,7 +443,7 @@ IconViewMode Navigator::sizeIntToEnum(int size) const void Navigator::slotShowRMBMenu( TQListBoxItem *, const TQPoint &pos ) { - KPopupMenu menu; + TDEPopupMenu menu; menu.insertTitle( i18n( "Icon Size" ) ); menu.insertItem( i18n( "Large" ), (int)LargeIcons ); menu.setItemEnabled( (int)LargeIcons, mShowIcons ); diff --git a/kontact/src/iconsidepane.h b/kontact/src/iconsidepane.h index 35859bda0..f7887b83e 100644 --- a/kontact/src/iconsidepane.h +++ b/kontact/src/iconsidepane.h @@ -115,7 +115,7 @@ class EntryItemToolTip : public TQToolTip /** Navigation pane showing all parts relevant to the user */ -class Navigator : public KListBox +class Navigator : public TDEListBox { Q_OBJECT @@ -132,7 +132,7 @@ class Navigator : public KListBox IconViewMode viewMode() { return mViewMode; } IconViewMode sizeIntToEnum(int size) const; - const TQPtrList & actions() { return mActions; } + const TQPtrList & actions() { return mActions; } bool showIcons() const { return mShowIcons; } bool showText() const { return mShowText; } signals: @@ -166,7 +166,7 @@ class Navigator : public KListBox EntryItem* mHighlightItem; TQSignalMapper *mMapper; - TQPtrList mActions; + TQPtrList mActions; bool mShowIcons; bool mShowText; }; @@ -185,7 +185,7 @@ class IconSidePane : public SidePaneBase virtual void updatePlugins(); virtual void selectPlugin( Kontact::Plugin* ); virtual void selectPlugin( const TQString &name ); - const TQPtrList & actions() { return mNavigator->actions(); } + const TQPtrList & actions() { return mNavigator->actions(); } private: Navigator *mNavigator; diff --git a/kontact/src/kcmkontact.h b/kontact/src/kcmkontact.h index 6e0c402af..f19980e29 100644 --- a/kontact/src/kcmkontact.h +++ b/kontact/src/kcmkontact.h @@ -34,7 +34,7 @@ class TQComboBox; class TQListViewItem; class TDEAboutData; -class KListView; +class TDEListView; class KcmKontact : public KPrefsModule { diff --git a/kontact/src/main.cpp b/kontact/src/main.cpp index 17b4710a7..1fa4e7f72 100644 --- a/kontact/src/main.cpp +++ b/kontact/src/main.cpp @@ -178,7 +178,7 @@ int main( int argc, char **argv ) KontactApp app; if ( app.restoringSession() ) { // There can only be one main window - if ( KMainWindow::canBeRestored( 1 ) ) { + if ( TDEMainWindow::canBeRestored( 1 ) ) { Kontact::MainWindow *mainWindow = new Kontact::MainWindow(); app.setMainWindow( mainWindow ); app.setSessionRestored( true ); @@ -188,8 +188,8 @@ int main( int argc, char **argv ) } bool ret = app.exec(); - while ( KMainWindow::memberList->first() ) - delete KMainWindow::memberList->first(); + while ( TDEMainWindow::memberList->first() ) + delete TDEMainWindow::memberList->first(); return ret; } diff --git a/kontact/src/mainwindow.cpp b/kontact/src/mainwindow.cpp index 180b087b3..c7976bd42 100644 --- a/kontact/src/mainwindow.cpp +++ b/kontact/src/mainwindow.cpp @@ -132,7 +132,7 @@ void MainWindow::initGUI() for ( it = mPluginInfos.begin(); it != mPluginInfos.end(); ++it ) { (*it)->load(); - KAction *action = new KAction( (*it)->name(), (*it)->icon(), KShortcut(), + TDEAction *action = new TDEAction( (*it)->name(), (*it)->icon(), TDEShortcut(), TQT_TQOBJECT(this), TQT_SLOT(slotActionTriggered()), actionCollection(), (*it)->pluginName().latin1() ); action->setName( (*it)->pluginName().latin1() ); @@ -334,8 +334,8 @@ void MainWindow::initAboutScreen() void MainWindow::setupActions() { KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT( slotQuit() ), actionCollection() ); - mNewActions = new KToolBarPopupAction( KGuiItem( i18n( "New" ), "" ), - KStdAccel::shortcut(KStdAccel::New), TQT_TQOBJECT(this), TQT_SLOT( slotNewClicked() ), + mNewActions = new TDEToolBarPopupAction( KGuiItem( i18n( "New" ), "" ), + TDEStdAccel::shortcut(TDEStdAccel::New), TQT_TQOBJECT(this), TQT_SLOT( slotNewClicked() ), actionCollection(), "action_new" ); TDEConfig* const cfg = Prefs::self()->config(); @@ -343,19 +343,19 @@ void MainWindow::setupActions() mSyncActionsEnabled = cfg->readBoolEntry( "GroupwareMailFoldersEnabled", true ); if ( mSyncActionsEnabled ) { - mSyncActions = new KToolBarPopupAction( KGuiItem( i18n( "Synchronize" ), "kitchensync" ), - KStdAccel::shortcut(KStdAccel::Reload), TQT_TQOBJECT(this), TQT_SLOT( slotSyncClicked() ), + mSyncActions = new TDEToolBarPopupAction( KGuiItem( i18n( "Synchronize" ), "kitchensync" ), + TDEStdAccel::shortcut(TDEStdAccel::Reload), TQT_TQOBJECT(this), TQT_SLOT( slotSyncClicked() ), actionCollection(), "action_sync" ); } - new KAction( i18n( "Configure Kontact..." ), "configure", 0, TQT_TQOBJECT(this), TQT_SLOT( slotPreferences() ), + new TDEAction( i18n( "Configure Kontact..." ), "configure", 0, TQT_TQOBJECT(this), TQT_SLOT( slotPreferences() ), actionCollection(), "settings_configure_kontact" ); - new KAction( i18n( "Configure &Profiles..." ), 0, TQT_TQOBJECT(this), TQT_SLOT( slotConfigureProfiles() ), + new TDEAction( i18n( "Configure &Profiles..." ), 0, TQT_TQOBJECT(this), TQT_SLOT( slotConfigureProfiles() ), actionCollection(), "settings_configure_kontact_profiles" ); - new KAction( i18n( "&Kontact Introduction" ), 0, TQT_TQOBJECT(this), TQT_SLOT( slotShowIntroduction() ), + new TDEAction( i18n( "&Kontact Introduction" ), 0, TQT_TQOBJECT(this), TQT_SLOT( slotShowIntroduction() ), actionCollection(), "help_introduction" ); - new KAction( i18n( "&Tip of the Day" ), 0, TQT_TQOBJECT(this), TQT_SLOT( slotShowTip() ), + new TDEAction( i18n( "&Tip of the Day" ), 0, TQT_TQOBJECT(this), TQT_SLOT( slotShowTip() ), actionCollection(), "help_tipofday" ); KWidgetAction* spacerAction = new KWidgetAction( new TQWidget( this ), "SpacerAction", "", 0, 0, actionCollection(), "navigator_spacer_item" ); @@ -468,7 +468,7 @@ Plugin *MainWindow::pluginFromInfo( const KPluginInfo *info ) return 0; } -Plugin *MainWindow::pluginFromAction( const KAction *action ) +Plugin *MainWindow::pluginFromAction( const TDEAction *action ) { PluginList::ConstIterator end = mPlugins.end(); for ( PluginList::ConstIterator it = mPlugins.begin(); it != end; ++it ) { @@ -479,7 +479,7 @@ Plugin *MainWindow::pluginFromAction( const KAction *action ) return 0; } -bool MainWindow::isPluginLoadedByAction( const KAction *action ) +bool MainWindow::isPluginLoadedByAction( const TDEAction *action ) { KPluginInfo::List::ConstIterator it; for ( it = mPluginInfos.begin(); it != mPluginInfos.end(); ++it ) { @@ -499,15 +499,15 @@ bool MainWindow::isPluginLoadedByAction( const KAction *action ) void MainWindow::sortActionsByWeight() { - TQPtrList sorted; + TQPtrList sorted; - TQPtrListIterator eit( mActionPlugins ); - KAction *action; + TQPtrListIterator eit( mActionPlugins ); + TDEAction *action; while ( ( action = eit.current() ) != 0 ) { ++eit; - TQPtrListIterator sortIt( sorted ); + TQPtrListIterator sortIt( sorted ); uint at = 0; - KAction *saction; + TDEAction *saction; Plugin *p1 = pluginFromAction( action ); while ( ( saction = sortIt.current() ) != 0 ) { Plugin *p2 = pluginFromAction( saction ); @@ -579,8 +579,8 @@ void MainWindow::loadPlugins() for ( i = 0; i < plugins.count(); ++ i ) { Plugin *plugin = plugins.at( i ); - KAction *action; - TQPtrList *actionList = plugin->newActions(); + TDEAction *action; + TQPtrList *actionList = plugin->newActions(); for ( action = actionList->first(); action; action = actionList->next() ) { kdDebug(5600) << "Plugging " << action->name() << endl; @@ -618,22 +618,22 @@ void MainWindow::unloadPlugins() void MainWindow::updateShortcuts() { - TQPtrList loadedActions; + TQPtrList loadedActions; sortActionsByWeight(); - TQPtrListIterator it( mActionPlugins ); + TQPtrListIterator it( mActionPlugins ); int i = 1; - KAction *action; + TDEAction *action; while ( ( action = it.current() ) != 0 ) { ++it; if ( isPluginLoadedByAction( action ) ) { loadedActions.append( action ); TQString shortcut = TQString( "CTRL+%1" ).arg( i ); - action->setShortcut( KShortcut( shortcut ) ); + action->setShortcut( TDEShortcut( shortcut ) ); i++; } else { - action->setShortcut( KShortcut() ); + action->setShortcut( TDEShortcut() ); } } unplugActionList( "navigator_actionlist" ); @@ -647,8 +647,8 @@ bool MainWindow::removePlugin( const KPluginInfo *info ) if ( ( *it )->identifier() == info->pluginName() ) { Plugin *plugin = *it; - KAction *action; - TQPtrList *actionList = plugin->newActions(); + TDEAction *action; + TQPtrList *actionList = plugin->newActions(); for ( action = actionList->first(); action; action = actionList->next() ) { kdDebug(5600) << "Unplugging " << action->name() << endl; action->unplug( mNewActions->popupMenu() ); @@ -728,7 +728,7 @@ void MainWindow::slotActivePartChanged( KParts::Part *part ) void MainWindow::slotNewClicked() { - KAction *action = mCurrentPlugin->newActions()->first(); + TDEAction *action = mCurrentPlugin->newActions()->first(); if ( action ) { action->activate(); } else { @@ -745,7 +745,7 @@ void MainWindow::slotNewClicked() void MainWindow::slotSyncClicked() { - KAction *action = mCurrentPlugin->syncActions()->first(); + TDEAction *action = mCurrentPlugin->syncActions()->first(); if ( action ) { action->activate(); } else { @@ -760,15 +760,15 @@ void MainWindow::slotSyncClicked() } } -KToolBar* Kontact::MainWindow::findToolBar(const char* name) +TDEToolBar* Kontact::MainWindow::findToolBar(const char* name) { - // like KMainWindow::toolBar, but which doesn't create the toolbar if not found - return static_cast(TQT_TQWIDGET(child(name, "KToolBar"))); + // like TDEMainWindow::toolBar, but which doesn't create the toolbar if not found + return static_cast(TQT_TQWIDGET(child(name, "TDEToolBar"))); } void MainWindow::slotActionTriggered() { - const KAction *actionSender = static_cast( sender() ); + const TDEAction *actionSender = static_cast( sender() ); TQString identifier = actionSender->name(); if ( !identifier.isEmpty() ) { selectPlugin( identifier ); @@ -836,15 +836,15 @@ void MainWindow::selectPlugin( Kontact::Plugin *plugin ) view->setFocus(); mCurrentPlugin = plugin; - KAction *newAction = plugin->newActions()->first(); - KAction *syncAction = plugin->syncActions()->first(); + TDEAction *newAction = plugin->newActions()->first(); + TDEAction *syncAction = plugin->syncActions()->first(); createGUI( plugin->part() ); - KToolBar* navigatorToolBar = findToolBar( "navigatorToolBar" ); + TDEToolBar* navigatorToolBar = findToolBar( "navigatorToolBar" ); // Let the navigator toolbar be always the last one, if it's in the top dockwindow if ( navigatorToolBar && !navigatorToolBar->isHidden() && - navigatorToolBar->barPos() == KToolBar::Top ) { + navigatorToolBar->barPos() == TDEToolBar::Top ) { topDock()->moveDockWindow( navigatorToolBar, -1 ); } @@ -885,9 +885,9 @@ void MainWindow::selectPlugin( Kontact::Plugin *plugin ) TQStringList::ConstIterator it; for ( it = invisibleActions.begin(); it != invisibleActions.end(); ++it ) { - KAction *action = part->actionCollection()->action( (*it).latin1() ); + TDEAction *action = part->actionCollection()->action( (*it).latin1() ); if ( action ) { - TQPtrListIterator it( toolBarIterator() ); + TQPtrListIterator it( toolBarIterator() ); for ( ; it.current() ; ++it ) { action->unplug( it.current() ); } diff --git a/kontact/src/mainwindow.h b/kontact/src/mainwindow.h index e9ddc121f..57df05c07 100644 --- a/kontact/src/mainwindow.h +++ b/kontact/src/mainwindow.h @@ -42,7 +42,7 @@ class TQSplitter; class TQVBox; class TQFrame; -class KAction; +class TDEAction; class TDEConfig; class KPluginInfo; class KRSqueezedTextLabel; @@ -62,7 +62,7 @@ class IconSidePane; class Plugin; typedef TQValueList PluginList; -typedef TQPtrList ActionPluginList; +typedef TQPtrList ActionPluginList; class MainWindow : public Kontact::Core, public KDCOPServiceStarter, public KontactIface { @@ -117,9 +117,9 @@ class MainWindow : public Kontact::Core, public KDCOPServiceStarter, public Kont void sortActionsByWeight(); bool isPluginLoaded( const KPluginInfo * ); - bool isPluginLoadedByAction( const KAction *action ); + bool isPluginLoadedByAction( const TDEAction *action ); Kontact::Plugin *pluginFromInfo( const KPluginInfo * ); - Kontact::Plugin *pluginFromAction( const KAction * ); + Kontact::Plugin *pluginFromAction( const TDEAction * ); void loadPlugins(); void unloadPlugins(); void updateShortcuts(); @@ -133,7 +133,7 @@ class MainWindow : public Kontact::Core, public KDCOPServiceStarter, public Kont virtual void saveProperties( TDEConfig *config ); void paintAboutScreen( const TQString& msg ); static TQString introductionString(); - KToolBar* findToolBar(const char* name); + TDEToolBar* findToolBar(const char* name); private slots: void pluginsChanged(); @@ -146,8 +146,8 @@ class MainWindow : public Kontact::Core, public KDCOPServiceStarter, public Kont TQSplitter *mSplitter; - KToolBarPopupAction *mNewActions; - KToolBarPopupAction *mSyncActions; + TDEToolBarPopupAction *mNewActions; + TDEToolBarPopupAction *mSyncActions; IconSidePane *mSidePane; TQWidgetStack *mPartsStack; Plugin *mCurrentPlugin; @@ -164,7 +164,7 @@ class MainWindow : public Kontact::Core, public KDCOPServiceStarter, public Kont TQString mActiveModule; TQMap > mFocusWidgets; - TQMap mPluginAction; + TQMap mPluginAction; AboutDialog *mAboutDialog; bool mReallyClose; diff --git a/kontact/src/profiledialog.cpp b/kontact/src/profiledialog.cpp index e959ad865..6d1372deb 100644 --- a/kontact/src/profiledialog.cpp +++ b/kontact/src/profiledialog.cpp @@ -45,7 +45,7 @@ Kontact::ProfileDialog::ProfileDialog( TQWidget* parent, WFlags flags ) : KDialo TQHBoxLayout* horizontalLayout = new TQHBoxLayout( mainWidget ); horizontalLayout->setSpacing( 5 ); - m_list = new KListView( mainWidget ); + m_list = new TDEListView( mainWidget ); m_list->addColumn( i18n("Name") ); m_list->addColumn( i18n("Description") ); m_list->setSelectionMode( TQListView::Single ); diff --git a/kontact/src/profiledialog.h b/kontact/src/profiledialog.h index 640fec99a..73a44ae55 100644 --- a/kontact/src/profiledialog.h +++ b/kontact/src/profiledialog.h @@ -32,7 +32,7 @@ class TQListViewItem; -class KListView; +class TDEListView; class TQPushButton; namespace Kontact { @@ -76,7 +76,7 @@ private slots: void profileLoaded( const TQString& id ); private: - KListView* m_list; + TDEListView* m_list; TQPushButton* m_newProfileButton; TQPushButton* m_deleteProfileButton; TQPushButton* m_saveProfileButton; diff --git a/kontact/src/sidepanebase.h b/kontact/src/sidepanebase.h index 47ed09322..c8e83442c 100644 --- a/kontact/src/sidepanebase.h +++ b/kontact/src/sidepanebase.h @@ -56,7 +56,7 @@ class SidePaneBase : public TQVBox private: Core* mCore; - KActionCollection *mActionCollection; + TDEActionCollection *mActionCollection; }; } -- cgit v1.2.1