diff options
Diffstat (limited to 'kicker/kicker/ui/k_new_mnu.cpp')
-rw-r--r-- | kicker/kicker/ui/k_new_mnu.cpp | 287 |
1 files changed, 89 insertions, 198 deletions
diff --git a/kicker/kicker/ui/k_new_mnu.cpp b/kicker/kicker/ui/k_new_mnu.cpp index 7ccb447b4..834086f33 100644 --- a/kicker/kicker/ui/k_new_mnu.cpp +++ b/kicker/kicker/ui/k_new_mnu.cpp @@ -21,12 +21,21 @@ ******************************************************************/ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdlib.h> #include <sys/types.h> #include <unistd.h> #include <dmctl.h> #include <inttypes.h> +#ifdef Q_OS_SOLARIS +#include <sys/statvfs.h> +#define statfs statvfs +#endif /* Q_OS_SOLARIS */ + #include <tqimage.h> #include <tqpainter.h> #include <tqstyle.h> @@ -52,7 +61,7 @@ #include <kdebug.h> #include <tdeglobal.h> #include <tdeglobalsettings.h> -#ifdef __TDE_HAVE_TDEHWLIB +#ifdef WITH_TDEHWLIB #include <tdehardwaredevices.h> #endif #include <kiconloader.h> @@ -112,16 +121,6 @@ #include "config.h" -#ifdef COMPILE_HALBACKEND -#ifndef NO_QT3_DBUS_SUPPORT -/* We acknowledge the the dbus API is unstable */ -#define DBUS_API_SUBJECT_TO_CHANGE -#include <dbus/connection.h> -#endif // NO_QT3_DBUS_SUPPORT - -#include <hal/libhal.h> -#endif // COMPILE_HALBACKEND - #ifdef __NetBSD__ #define statfs statvfs #endif @@ -207,15 +206,15 @@ KMenu::KMenu() m_iconName(TQString()), m_orientation(UnDetermined), m_search_plugin( 0 ) { setMouseTracking(true); - connect(&m_sloppyTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotSloppyTimeout())); + connect(&m_sloppyTimer, TQ_SIGNAL(timeout()), TQ_SLOT(slotSloppyTimeout())); // set the first client id to some arbitrarily large value. client_id = 10000; // Don't automatically clear the main menu. actionCollection = new TDEActionCollection(this); - connect(Kicker::the(), TQT_SIGNAL(configurationChanged()), - this, TQT_SLOT(configChanged())); + connect(Kicker::the(), TQ_SIGNAL(configurationChanged()), + this, TQ_SLOT(configChanged())); KUser * user = new KUser(); @@ -229,7 +228,7 @@ KMenu::KMenu() setupUi(); m_userInfo->setBackgroundMode( PaletteBase ); - TQColor userInfoColor = TQApplication::palette().color( TQPalette::Normal, TQColorGroup::Mid ); + TQColor userInfoColor = TQApplication::palette().color( TQPalette::Active, TQColorGroup::Mid ); if ( tqGray( userInfoColor.rgb() ) > 120 ) userInfoColor = userInfoColor.dark( 200 ); else @@ -237,7 +236,7 @@ KMenu::KMenu() m_userInfo->setPaletteForegroundColor( userInfoColor ); m_tabBar = new KickoffTabBar(this, "m_tabBar"); - connect(m_tabBar, TQT_SIGNAL(tabClicked(TQTab*)), TQT_SLOT(tabClicked(TQTab*))); + connect(m_tabBar, TQ_SIGNAL(tabClicked(TQTab*)), TQ_SLOT(tabClicked(TQTab*))); const int tab_icon_size = 32; @@ -285,8 +284,8 @@ KMenu::KMenu() m_tabs[LeaveTab]->setIconSet(BarIcon("leave", tab_icon_size)); } - connect(m_tabBar, TQT_SIGNAL(selected(int)), m_stacker, TQT_SLOT(raiseWidget(int))); - connect(m_stacker, TQT_SIGNAL(aboutToShow(int)), m_tabBar, TQT_SLOT(setCurrentTab(int))); + connect(m_tabBar, TQ_SIGNAL(selected(int)), m_stacker, TQ_SLOT(raiseWidget(int))); + connect(m_stacker, TQ_SIGNAL(aboutToShow(int)), m_tabBar, TQ_SLOT(setCurrentTab(int))); m_favoriteView = new FavoritesItemView (m_stacker, "m_favoriteView"); m_favoriteView->setAcceptDrops(true); @@ -301,11 +300,11 @@ KMenu::KMenu() m_browserView = new FlipScrollView(m_stacker, "m_browserView"); m_stacker->addWidget(m_browserView, ApplicationsTab); - connect( m_browserView, TQT_SIGNAL( backButtonClicked() ), TQT_SLOT( slotGoBack() ) ); + connect( m_browserView, TQ_SIGNAL( backButtonClicked() ), TQ_SLOT( slotGoBack() ) ); m_exitView = new FlipScrollView(m_stacker, "m_exitView"); m_stacker->addWidget(m_exitView, LeaveTab); - connect( m_exitView, TQT_SIGNAL( backButtonClicked() ), TQT_SLOT( slotGoExitMainMenu() ) ); + connect( m_exitView, TQ_SIGNAL( backButtonClicked() ), TQ_SLOT( slotGoExitMainMenu() ) ); m_searchWidget = new TQVBox (m_stacker, "m_searchWidget"); m_searchWidget->setSpacing(0); @@ -332,7 +331,7 @@ KMenu::KMenu() m_searchResultsWidget->setItemMargin(4); // m_searchResultsWidget->setIconSize(16); m_searchActions = new ItemView (m_searchWidget, "m_searchActions"); - m_searchActions->setFocusPolicy(TQ_NoFocus); + m_searchActions->setFocusPolicy(TQWidget::NoFocus); m_searchActions->setItemMargin(4); m_searchInternet = new TQListViewItem(m_searchActions, i18n("Search Internet")); m_searchInternet->setPixmap(0,icon); @@ -342,40 +341,40 @@ KMenu::KMenu() m_searchActions->setMaximumHeight(5+m_searchInternet->height()); - connect(m_searchActions, TQT_SIGNAL(clicked(TQListViewItem*)), TQT_SLOT(searchActionClicked(TQListViewItem*))); - connect(m_searchActions, TQT_SIGNAL(returnPressed(TQListViewItem*)), TQT_SLOT(searchActionClicked(TQListViewItem*))); - connect(m_searchActions, TQT_SIGNAL(spacePressed(TQListViewItem*)), TQT_SLOT(searchActionClicked(TQListViewItem*))); + connect(m_searchActions, TQ_SIGNAL(clicked(TQListViewItem*)), TQ_SLOT(searchActionClicked(TQListViewItem*))); + connect(m_searchActions, TQ_SIGNAL(returnPressed(TQListViewItem*)), TQ_SLOT(searchActionClicked(TQListViewItem*))); + connect(m_searchActions, TQ_SIGNAL(spacePressed(TQListViewItem*)), TQ_SLOT(searchActionClicked(TQListViewItem*))); - connect(m_searchResultsWidget, TQT_SIGNAL(startService(KService::Ptr)), TQT_SLOT(slotStartService(KService::Ptr))); - connect(m_searchResultsWidget, TQT_SIGNAL(startURL(const TQString&)), TQT_SLOT(slotStartURL(const TQString&))); - connect(m_searchResultsWidget, TQT_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQT_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); + connect(m_searchResultsWidget, TQ_SIGNAL(startService(KService::Ptr)), TQ_SLOT(slotStartService(KService::Ptr))); + connect(m_searchResultsWidget, TQ_SIGNAL(startURL(const TQString&)), TQ_SLOT(slotStartURL(const TQString&))); + connect(m_searchResultsWidget, TQ_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQ_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); - connect(m_recentlyView, TQT_SIGNAL(startService(KService::Ptr)), TQT_SLOT(slotStartService(KService::Ptr))); - connect(m_recentlyView, TQT_SIGNAL(startURL(const TQString&)), TQT_SLOT(slotStartURL(const TQString&))); - connect(m_recentlyView, TQT_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQT_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); + connect(m_recentlyView, TQ_SIGNAL(startService(KService::Ptr)), TQ_SLOT(slotStartService(KService::Ptr))); + connect(m_recentlyView, TQ_SIGNAL(startURL(const TQString&)), TQ_SLOT(slotStartURL(const TQString&))); + connect(m_recentlyView, TQ_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQ_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); - connect(m_favoriteView, TQT_SIGNAL(startService(KService::Ptr)), TQT_SLOT(slotStartService(KService::Ptr))); - connect(m_favoriteView, TQT_SIGNAL(startURL(const TQString&)), TQT_SLOT(slotStartURL(const TQString&))); - connect(m_favoriteView, TQT_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQT_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); - connect(m_favoriteView, TQT_SIGNAL(moved(TQListViewItem*, TQListViewItem*, TQListViewItem*)), TQT_SLOT(slotFavoritesMoved( TQListViewItem*, TQListViewItem*, TQListViewItem* ))); + connect(m_favoriteView, TQ_SIGNAL(startService(KService::Ptr)), TQ_SLOT(slotStartService(KService::Ptr))); + connect(m_favoriteView, TQ_SIGNAL(startURL(const TQString&)), TQ_SLOT(slotStartURL(const TQString&))); + connect(m_favoriteView, TQ_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQ_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); + connect(m_favoriteView, TQ_SIGNAL(moved(TQListViewItem*, TQListViewItem*, TQListViewItem*)), TQ_SLOT(slotFavoritesMoved( TQListViewItem*, TQListViewItem*, TQListViewItem* ))); - connect(m_systemView, TQT_SIGNAL(startURL(const TQString&)), TQT_SLOT(slotStartURL(const TQString&))); - connect(m_systemView, TQT_SIGNAL(startService(KService::Ptr)), TQT_SLOT(slotStartService(KService::Ptr))); - connect(m_systemView, TQT_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQT_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); + connect(m_systemView, TQ_SIGNAL(startURL(const TQString&)), TQ_SLOT(slotStartURL(const TQString&))); + connect(m_systemView, TQ_SIGNAL(startService(KService::Ptr)), TQ_SLOT(slotStartService(KService::Ptr))); + connect(m_systemView, TQ_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQ_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); - connect(m_browserView, TQT_SIGNAL(startURL(const TQString&)), TQT_SLOT(slotGoSubMenu(const TQString&))); - connect(m_browserView, TQT_SIGNAL(startService(KService::Ptr)), TQT_SLOT(slotStartService(KService::Ptr))); - connect(m_browserView, TQT_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQT_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); + connect(m_browserView, TQ_SIGNAL(startURL(const TQString&)), TQ_SLOT(slotGoSubMenu(const TQString&))); + connect(m_browserView, TQ_SIGNAL(startService(KService::Ptr)), TQ_SLOT(slotStartService(KService::Ptr))); + connect(m_browserView, TQ_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQ_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); - connect(m_exitView, TQT_SIGNAL(startURL(const TQString&)), TQT_SLOT(slotStartURL(const TQString&))); - connect(m_exitView, TQT_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQT_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); + connect(m_exitView, TQ_SIGNAL(startURL(const TQString&)), TQ_SLOT(slotStartURL(const TQString&))); + connect(m_exitView, TQ_SIGNAL(rightButtonPressed( TQListViewItem*, const TQPoint &, int )), TQ_SLOT(slotContextMenuRequested( TQListViewItem*, const TQPoint &, int ))); m_kcommand->setDuplicatesEnabled( false ); m_kcommand->setLineEdit(new KLineEdit(m_kcommand, "m_kcommand-lineedit")); m_kcommand->setCompletionMode( TDEGlobalSettings::CompletionAuto ); - connect(m_kcommand, TQT_SIGNAL(cleared()), TQT_SLOT(clearedHistory())); - connect(m_kcommand->lineEdit(), TQT_SIGNAL(returnPressed()), TQT_SLOT(searchAccept())); - connect(m_kcommand->lineEdit(), TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(searchChanged(const TQString &))); + connect(m_kcommand, TQ_SIGNAL(cleared()), TQ_SLOT(clearedHistory())); + connect(m_kcommand->lineEdit(), TQ_SIGNAL(returnPressed()), TQ_SLOT(searchAccept())); + connect(m_kcommand->lineEdit(), TQ_SIGNAL(textChanged(const TQString &)), TQ_SLOT(searchChanged(const TQString &))); // URI Filter meta object... m_filterData = new KURIFilterData(); @@ -384,14 +383,14 @@ KMenu::KMenu() categorised_hit_total = new int [num_categories]; input_timer = new TQTimer (this, "input_timer"); - connect( input_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(doQuery()) ); + connect( input_timer, TQ_SIGNAL(timeout()), this, TQ_SLOT(doQuery()) ); init_search_timer = new TQTimer (this, "init_search_timer"); - connect( init_search_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(initSearch()) ); + connect( init_search_timer, TQ_SIGNAL(timeout()), this, TQ_SLOT(initSearch()) ); init_search_timer->start(2000, true); - connect( m_favoriteView, TQT_SIGNAL( dropped (TQDropEvent *, TQListViewItem * ) ), - TQT_SLOT( slotFavDropped( TQDropEvent *, TQListViewItem * ) ) ); + connect( m_favoriteView, TQ_SIGNAL( dropped (TQDropEvent *, TQListViewItem * ) ), + TQ_SLOT( slotFavDropped( TQDropEvent *, TQListViewItem * ) ) ); this->installEventFilter(this); m_tabBar->installEventFilter(this); @@ -443,38 +442,6 @@ KMenu::KMenu() search_tab_top_left.load( locate("data", "kicker/pics/search-tab-top-left.png" ) ); search_tab_top_right.load( locate("data", "kicker/pics/search-tab-top-right.png" ) ); search_tab_top_center.load( locate("data", "kicker/pics/search-tab-top-center.png" ) ); - -#ifdef COMPILE_HALBACKEND - m_halCtx = NULL; - m_halCtx = libhal_ctx_new(); - - DBusError error; - dbus_error_init(&error); - m_dbusConn = dbus_connection_open_private(DBUS_SYSTEM_BUS, &error); - if (!m_dbusConn) { - dbus_error_free(&error); - libhal_ctx_free(m_halCtx); - m_halCtx = NULL; - } else { - dbus_bus_register(m_dbusConn, &error); - if (dbus_error_is_set(&error)) { - dbus_error_free(&error); - libhal_ctx_free(m_halCtx); - m_dbusConn = NULL; - m_halCtx = NULL; - } else { - libhal_ctx_set_dbus_connection(m_halCtx, m_dbusConn); - if (!libhal_ctx_init(m_halCtx, &error)) { - if (dbus_error_is_set(&error)) { - dbus_error_free(&error); - } - libhal_ctx_free(m_halCtx); - m_dbusConn = NULL; - m_halCtx = NULL; - } - } - } -#endif } void KMenu::setupUi() @@ -483,10 +450,10 @@ void KMenu::setupUi() m_stacker->setGeometry( TQRect( 90, 260, 320, 220 ) ); m_stacker->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)3, 1, 1, m_stacker->sizePolicy().hasHeightForWidth() ) ); m_stacker->setPaletteBackgroundColor( TQColor( 255, 255, 255 ) ); - // m_stacker->setFocusPolicy( TQ_StrongFocus ); + // m_stacker->setFocusPolicy( TQWidget::StrongFocus ); m_stacker->setLineWidth( 0 ); - m_stacker->setFocusPolicy(TQ_NoFocus); - connect(m_stacker, TQT_SIGNAL(aboutToShow(TQWidget*)), TQT_SLOT(stackWidgetRaised(TQWidget*))); + m_stacker->setFocusPolicy(TQWidget::NoFocus); + connect(m_stacker, TQ_SIGNAL(aboutToShow(TQWidget*)), TQ_SLOT(stackWidgetRaised(TQWidget*))); m_kcommand->setName("m_kcommand"); } @@ -497,15 +464,6 @@ KMenu::~KMenu() clearSubmenus(); delete m_filterData; - -#ifdef COMPILE_HALBACKEND - if (m_halCtx) { - DBusError error; - dbus_error_init(&error); - libhal_ctx_shutdown(m_halCtx, &error); - libhal_ctx_free(m_halCtx); - } -#endif } bool KMenu::eventFilter ( TQObject * receiver, TQEvent* e) @@ -522,16 +480,16 @@ bool KMenu::eventFilter ( TQObject * receiver, TQEvent* e) TQPoint p; if (e->type() == TQEvent::MouseMove || e->type() == TQEvent::MouseButtonPress) { - TQMouseEvent* me = TQT_TQMOUSEEVENT(e); + TQMouseEvent* me = static_cast<TQMouseEvent*>(e); p = me->globalPos(); } else if (e->type() == TQEvent::Wheel) { - TQWheelEvent* we = TQT_TQWHEELEVENT(e); + TQWheelEvent* we = static_cast<TQWheelEvent*>(e); p = we->globalPos(); } while (receiver) { - if (TQT_BASE_OBJECT(receiver) == TQT_BASE_OBJECT(m_tabBar) && (e->type()!=TQEvent::MouseMove || KickerSettings::kickoffSwitchTabsOnHover() ) ) { + if (receiver == m_tabBar && (e->type()!=TQEvent::MouseMove || KickerSettings::kickoffSwitchTabsOnHover() ) ) { TQTab* s = m_tabBar->selectTab(m_tabBar->mapFromGlobal(p)); if (s && s->identifier() == ApplicationsTab) raiseWidget = m_browserView; @@ -551,8 +509,8 @@ bool KMenu::eventFilter ( TQObject * receiver, TQEvent* e) /* we do not want hover activation for the search line edit as this can be * pretty disturbing */ - if ( (TQT_BASE_OBJECT(receiver) == TQT_BASE_OBJECT(m_searchPixmap) || - ( ( TQT_BASE_OBJECT(receiver) == TQT_BASE_OBJECT(m_searchLabel) || TQT_BASE_OBJECT(receiver)==TQT_BASE_OBJECT(m_kcommand->lineEdit()) ) && + if ( (receiver == m_searchPixmap || + ( ( receiver == m_searchLabel || receiver==m_kcommand->lineEdit() ) && ( e->type() == TQEvent::KeyPress || e->type() == TQEvent::Wheel || e->type() == TQEvent::MouseButtonPress ) ) ) && !m_isShowing) { @@ -564,25 +522,25 @@ bool KMenu::eventFilter ( TQObject * receiver, TQEvent* e) if(raiseWidget) break; if(receiver->isWidgetType()) - receiver = TQT_TQOBJECT(TQT_TQWIDGET(receiver)->parentWidget(true)); + receiver = static_cast<TQWidget*>(receiver)->parentWidget(true); else break; } if (e->type() == TQEvent::FocusIn && receiver && raiseWidget) { - m_searchResultsWidget->setFocusPolicy(TQ_StrongFocus); + m_searchResultsWidget->setFocusPolicy(TQWidget::StrongFocus); m_searchActions->setFocusPolicy(raiseWidget == m_searchWidget ? - TQ_StrongFocus : TQ_NoFocus); + TQWidget::StrongFocus : TQWidget::NoFocus); setTabOrder(raiseWidget, m_searchResultsWidget); if (raiseWidget != m_stacker->visibleWidget() - && TQT_TQWIDGET(receiver)->focusPolicy() == TQ_NoFocus + && static_cast<TQWidget*>(receiver)->focusPolicy() == TQWidget::NoFocus && m_stacker->id(raiseWidget) >= 0) { m_stacker->raiseWidget(raiseWidget); return true; } - if (raiseWidget->focusPolicy() != TQ_NoFocus) + if (raiseWidget->focusPolicy() != TQWidget::NoFocus) return false; } @@ -604,7 +562,7 @@ bool KMenu::eventFilter ( TQObject * receiver, TQEvent* e) } if(e->type() == TQEvent::Enter && receiver->isWidgetType()) { - TQT_TQWIDGET(receiver)->setMouseTracking(true); + static_cast<TQWidget*>(receiver)->setMouseTracking(true); TQToolTip::hide(); } @@ -631,7 +589,7 @@ bool KMenu::eventFilter ( TQObject * receiver, TQEvent* e) if (view) { bool handled = true; - switch (TQT_TQKEYEVENT(e)->key()) { + switch (static_cast<TQKeyEvent*>(e)->key()) { case Key_Up: if (view->selectedItem()) { view->setSelected(view->selectedItem()->itemAbove(),true); @@ -708,7 +666,7 @@ bool KMenu::eventFilter ( TQObject * receiver, TQEvent* e) r = true; } - if (e->type() == TQEvent::Enter && TQT_BASE_OBJECT(receiver) == TQT_BASE_OBJECT(m_stacker)) + if (e->type() == TQEvent::Enter && receiver == m_stacker) { TQRect r(m_stacker->mapToGlobal(TQPoint(-8,-32)), m_stacker->size()); r.setSize(r.size()+TQSize(16,128)); @@ -785,8 +743,8 @@ void KMenu::paintSearchTab( bool active ) m_tabBar->deactivateTabs(true); - p.setBrush( Qt::white ); - p.setPen( Qt::NoPen ); + p.setBrush( TQt::white ); + p.setPen( TQt::NoPen ); if ( m_orientation == BottomUp ) { search_tab_center.convertFromImage( search_tab_center.convertToImage().scale(search_tab_center.width(), m_searchFrame->height())); @@ -1267,17 +1225,17 @@ void KMenu::initialize() kdDebug(1210) << "KMenu::initialize()" << endl; // in case we've been through here before, let's disconnect - disconnect(kapp, TQT_SIGNAL(tdedisplayPaletteChanged()), - this, TQT_SLOT(paletteChanged())); - connect(kapp, TQT_SIGNAL(tdedisplayPaletteChanged()), - this, TQT_SLOT(paletteChanged())); + disconnect(kapp, TQ_SIGNAL(tdedisplayPaletteChanged()), + this, TQ_SLOT(paletteChanged())); + connect(kapp, TQ_SIGNAL(tdedisplayPaletteChanged()), + this, TQ_SLOT(paletteChanged())); /* If the user configured ksmserver to */ TDEConfig ksmserver("ksmserverrc", false, false); ksmserver.setGroup("General"); - connect( m_branding, TQT_SIGNAL(clicked()), TQT_SLOT(slotOpenHomepage())); + connect( m_branding, TQ_SIGNAL(clicked()), TQ_SLOT(slotOpenHomepage())); m_tabBar->setTabEnabled(LeaveTab, kapp->authorize("logout")); // load search field history @@ -1374,10 +1332,7 @@ void KMenu::insertStaticExitItems() } bool maysd = false; -#if defined(COMPILE_HALBACKEND) - if (ksmserver.readBoolEntry( "offerShutdown", true ) && DM().canShutdown()) - maysd = true; -#elif defined(__TDE_HAVE_TDEHWLIB) +#if defined(WITH_TDEHWLIB) TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if( rootDevice ) { maysd = rootDevice->canPowerOff(); @@ -1490,11 +1445,11 @@ void KMenu::insertStaticItems() m_systemView->insertItem( "network", i18n( "Network Folders" ), "remote:/", "remote:/", nId++, index++ ); - m_mediaWatcher = new MediaWatcher( TQT_TQOBJECT(this) ); - connect( m_mediaWatcher, TQT_SIGNAL( mediumChanged() ), TQT_SLOT( updateMedia() ) ); + m_mediaWatcher = new MediaWatcher( this ); + connect( m_mediaWatcher, TQ_SIGNAL( mediumChanged() ), TQ_SLOT( updateMedia() ) ); m_media_id = 0; - connect(&m_mediaFreeTimer, TQT_SIGNAL(timeout()), TQT_SLOT( updateMedia())); + connect(&m_mediaFreeTimer, TQ_SIGNAL(timeout()), TQ_SLOT( updateMedia())); } int KMenu::insertClientMenu(KickerClientMenu *) @@ -1579,7 +1534,7 @@ void KMenu::slotSessionActivated( int ent ) void KMenu::doNewSession( bool lock ) { int result = KMessageBox::warningContinueCancel( - TQT_TQWIDGET(kapp->desktop()->screen(kapp->desktop()->screenNumber(this))), + kapp->desktop()->screen(kapp->desktop()->screenNumber(this)), i18n("<p>You have chosen to open another desktop session.<br>" "The current session will be hidden " "and a new login screen will be displayed.<br>" @@ -1797,7 +1752,7 @@ void KMenu::setOrientation(MenuOrientation orientation) m_orientation=orientation; - m_resizeHandle->setCursor(m_orientation == BottomUp ? tqsizeBDiagCursor : tqsizeFDiagCursor); + m_resizeHandle->setCursor(m_orientation == BottomUp ? TQt::sizeBDiagCursor : TQt::sizeFDiagCursor); TQPixmap pix; if ( m_orientation == BottomUp ) @@ -2046,7 +2001,7 @@ void KMenu::createNewProgramList() m_seenPrograms = KickerSettings::firstSeenApps(); m_newInstalledPrograms.clear(); - m_currentDate = TQDate::currentDate().toString(Qt::ISODate); + m_currentDate = TQDate::currentDate().toString(TQt::ISODate); bool initialize = (m_seenPrograms.count() == 0); @@ -2108,7 +2063,7 @@ void KMenu::createNewProgramList(TQString relPath) else { ++it_find; if (*(it_find)!="-") { - TQDate date = TQDate::fromString(*(it_find),Qt::ISODate); + TQDate date = TQDate::fromString(*(it_find),TQt::ISODate); if (date.daysTo(TQDate::currentDate())<3) { if (m_newInstalledPrograms.find(s->storageId())==m_newInstalledPrograms.end()) m_newInstalledPrograms+=s->storageId(); @@ -2328,7 +2283,7 @@ TQString KMenu::insertBreaks(const TQString& text, TQFontMetrics fm, int width, void KMenu::clearSearchResults(bool showHelp) { m_searchResultsWidget->clear(); - m_searchResultsWidget->setFocusPolicy(showHelp ? TQ_NoFocus : TQ_StrongFocus); + m_searchResultsWidget->setFocusPolicy(showHelp ? TQWidget::NoFocus : TQWidget::StrongFocus); setTabOrder(m_kcommand, m_searchResultsWidget); if (showHelp) { @@ -2810,7 +2765,7 @@ void KMenu::slotStartURL(const TQString& u) void KMenu::slotContextMenuRequested( TQListViewItem * item, const TQPoint & pos, int /*col*/ ) { - const TQObject* source = TQT_TQOBJECT_CONST(sender()); + const TQObject* source = sender(); if (!item) return; @@ -2840,12 +2795,12 @@ void KMenu::slotContextMenuRequested( TQListViewItem * item, const TQPoint & pos } m_popupMenu = new TDEPopupMenu(this); - connect(m_popupMenu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotContextMenu(int))); + connect(m_popupMenu, TQ_SIGNAL(activated(int)), TQ_SLOT(slotContextMenu(int))); bool hasEntries = false; m_popupMenu->insertTitle(SmallIcon(kitem->icon()),kitem->title()); - if (TQT_BASE_OBJECT_CONST(source)==TQT_BASE_OBJECT(m_favoriteView)) + if (source==m_favoriteView) { hasEntries = true; m_popupMenu->insertItem(SmallIconSet("remove"), @@ -2877,7 +2832,7 @@ void KMenu::slotContextMenuRequested( TQListViewItem * item, const TQPoint & pos } } - if (TQT_BASE_OBJECT_CONST(source)!=TQT_BASE_OBJECT(m_exitView)) { + if (source!=m_exitView) { if (m_popupService || (!m_popupPath.path.startsWith("kicker:/") && !m_popupPath.path.startsWith("system:/") && !m_popupPath.path.startsWith("kaddressbook:/"))) { if (hasEntries) m_popupMenu->insertSeparator(); @@ -2917,7 +2872,7 @@ void KMenu::slotContextMenuRequested( TQListViewItem * item, const TQPoint & pos i18n("Put Into Run Dialog"), PutIntoRunDialog); } } - if (TQT_BASE_OBJECT_CONST(source)==TQT_BASE_OBJECT(m_searchResultsWidget) || ((TQT_BASE_OBJECT_CONST(source)==TQT_BASE_OBJECT(m_favoriteView) || TQT_BASE_OBJECT_CONST(source)==TQT_BASE_OBJECT(m_recentlyView) || TQT_BASE_OBJECT_CONST(source) == TQT_BASE_OBJECT(m_systemView)) && !m_popupService && !m_popupPath.path.startsWith("kicker:/")) ) { + if (source==m_searchResultsWidget || ((source==m_favoriteView || source==m_recentlyView || source == m_systemView) && !m_popupService && !m_popupPath.path.startsWith("kicker:/")) ) { TQString uri; if (m_popupService) uri = locate("apps", m_popupService->desktopEntryPath()); @@ -2954,7 +2909,7 @@ void KMenu::slotContextMenuRequested( TQListViewItem * item, const TQPoint & pos } } - if (TQT_BASE_OBJECT_CONST(source)==TQT_BASE_OBJECT(m_recentlyView)) { + if (source==m_recentlyView) { m_popupMenu->insertSeparator(); if (m_popupService) m_popupMenu->insertItem(SmallIconSet("history_clear"), @@ -3024,7 +2979,7 @@ void KMenu::slotContextMenu(int selected) case EditItem: case EditMenu: accept(); - proc = new TDEProcess(TQT_TQOBJECT(this)); + proc = new TDEProcess(this); *proc << TDEStandardDirs::findExe(TQString::fromLatin1("kmenuedit")); *proc << "/"+m_popupPath.menuPath.section('/',-200,-2) << m_popupPath.menuPath.section('/', -1); proc->start(); @@ -3790,27 +3745,7 @@ void KMenu::insertSuspendOption( int &nId, int &index ) bool standby = false; bool suspend_disk = false; bool hybrid_suspend = false; -#if defined(COMPILE_HALBACKEND) - suspend_ram = libhal_device_get_property_bool(m_halCtx, - "/org/freedesktop/Hal/devices/computer", - "power_management.can_suspend", - NULL); - - standby = libhal_device_get_property_bool(m_halCtx, - "/org/freedesktop/Hal/devices/computer", - "power_management.can_standby", - NULL); - - suspend_disk = libhal_device_get_property_bool(m_halCtx, - "/org/freedesktop/Hal/devices/computer", - "power_management.can_hibernate", - NULL); - - hybrid_suspend = libhal_device_get_property_bool(m_halCtx, - "/org/freedesktop/Hal/devices/computer", - "power_management.can_suspend_hybrid", - NULL); -#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND +#if defined(WITH_TDEHWLIB) TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if (rootDevice) { suspend_ram = rootDevice->canSuspend(); @@ -3882,49 +3817,7 @@ void KMenu::slotSuspend(int id) DCOPRef("kdesktop", "KScreensaverIface").call("lock()"); } -#if defined(COMPILE_HALBACKEND) - DBusMessage* msg = NULL; - - if (m_dbusConn) { - // No Freeze support in HAL - if (id == SuspendType::Standby) { - msg = dbus_message_new_method_call( - "org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/computer", - "org.freedesktop.Hal.Device.SystemPowerManagement", - "Standby"); - } else if (id == SuspendType::Suspend) { - msg = dbus_message_new_method_call( - "org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/computer", - "org.freedesktop.Hal.Device.SystemPowerManagement", - "Suspend"); - int wakeup=0; - dbus_message_append_args(msg, DBUS_TYPE_INT32, &wakeup, DBUS_TYPE_INVALID); - } else if (id == SuspendType::Hibernate) { - msg = dbus_message_new_method_call( - "org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/computer", - "org.freedesktop.Hal.Device.SystemPowerManagement", - "Hibernate"); - } else if (id == SuspendType::HybridSuspend) { - msg = dbus_message_new_method_call( - "org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/computer", - "org.freedesktop.Hal.Device.SystemPowerManagement", - "SuspendHybrid"); - int wakeup=0; - dbus_message_append_args(msg, DBUS_TYPE_INT32, &wakeup, DBUS_TYPE_INVALID); - } else { - return; - } - - if(dbus_connection_send(m_dbusConn, msg, NULL)) { - error = false; - } - dbus_message_unref(msg); - } -#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND +#if defined(WITH_TDEHWLIB) TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if (rootDevice) { if (id == SuspendType::Freeze) { @@ -3960,5 +3853,3 @@ void KMenu::runUserCommand() kapp->dcopClient()->send( appname, "KDesktopIface", "popupExecuteCommand()", data ); } - -// vim:cindent:sw=4: |