diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-02-01 15:14:12 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-02-01 15:14:12 -0600 |
commit | fd5d099065a748cac49e20a13481f85666c53c71 (patch) | |
tree | a0f1672cd88eb0e69b9ddc2ed9b08ecd98538bd3 /kontact/src/mainwindow.cpp | |
parent | b440a9c608596cd88efdb3bfa4661c5e37efbe4b (diff) | |
download | tdepim-fd5d099065a748cac49e20a13481f85666c53c71.tar.gz tdepim-fd5d099065a748cac49e20a13481f85666c53c71.zip |
Rename a number of classes to enhance compatibility with KDE4
Diffstat (limited to 'kontact/src/mainwindow.cpp')
-rw-r--r-- | kontact/src/mainwindow.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
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<KAction> sorted; + TQPtrList<TDEAction> sorted; - TQPtrListIterator<KAction> eit( mActionPlugins ); - KAction *action; + TQPtrListIterator<TDEAction> eit( mActionPlugins ); + TDEAction *action; while ( ( action = eit.current() ) != 0 ) { ++eit; - TQPtrListIterator<KAction> sortIt( sorted ); + TQPtrListIterator<TDEAction> 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<KAction> *actionList = plugin->newActions(); + TDEAction *action; + TQPtrList<TDEAction> *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<KAction> loadedActions; + TQPtrList<TDEAction> loadedActions; sortActionsByWeight(); - TQPtrListIterator<KAction> it( mActionPlugins ); + TQPtrListIterator<TDEAction> 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<KAction> *actionList = plugin->newActions(); + TDEAction *action; + TQPtrList<TDEAction> *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<KToolBar *>(TQT_TQWIDGET(child(name, "KToolBar"))); + // like TDEMainWindow::toolBar, but which doesn't create the toolbar if not found + return static_cast<TDEToolBar *>(TQT_TQWIDGET(child(name, "TDEToolBar"))); } void MainWindow::slotActionTriggered() { - const KAction *actionSender = static_cast<const KAction*>( sender() ); + const TDEAction *actionSender = static_cast<const TDEAction*>( 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<KToolBar> it( toolBarIterator() ); + TQPtrListIterator<TDEToolBar> it( toolBarIterator() ); for ( ; it.current() ; ++it ) { action->unplug( it.current() ); } |