diff options
Diffstat (limited to 'src/menuhandler.cpp')
-rw-r--r-- | src/menuhandler.cpp | 296 |
1 files changed, 148 insertions, 148 deletions
diff --git a/src/menuhandler.cpp b/src/menuhandler.cpp index 06ca863..82b12bf 100644 --- a/src/menuhandler.cpp +++ b/src/menuhandler.cpp @@ -25,10 +25,10 @@ #include <kuser.h> #include <kstandarddirs.h> #include <kmimetype.h> -#include <qfocusdata.h> -#include <qstyle.h> -#include <qfile.h> -#include <qcursor.h> +#include <tqfocusdata.h> +#include <tqstyle.h> +#include <tqfile.h> +#include <tqcursor.h> #include <kpopupmenu.h> #include <kdebug.h> @@ -36,8 +36,8 @@ #include "menuhandler.h" #include "buttons.h" -MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) - :QFrame(parent, name, fl ), searchMode(false) +MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl) + :TQFrame(parent, name, fl ), searchMode(false) { prefSkel = prefs; @@ -46,14 +46,14 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) KServiceGroup::Ptr service = KServiceGroup::root(); //Kicker config - QString kickerConfPath = locate("config", "kickerrc"); + TQString kickerConfPath = locate("config", "kickerrc"); kickerConf = new KConfig(kickerConfPath); kickerConfWatch = new KDirWatch( this ); kickerConfWatch->addFile(kickerConfPath); - connect( kickerConfWatch, SIGNAL(dirty(const QString&)), this, + connect( kickerConfWatch, SIGNAL(dirty(const TQString&)), this, SLOT(slotModKickerConf()) ); - connect( kickerConfWatch, SIGNAL(dirty(const QString&)), this, + connect( kickerConfWatch, SIGNAL(dirty(const TQString&)), this, SIGNAL(kickerConfChanged()) ); if( _newAppsNotification = prefSkel->newAppsNotification() ) @@ -76,7 +76,7 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) //Main widget initialization menu = new Menu(this, "tastyMenu"); - MenuHandlerLayout = new QVBoxLayout( this, 0, 0, "MenuHandlerLayout"); + MenuHandlerLayout = new TQVBoxLayout( this, 0, 0, "MenuHandlerLayout"); MenuHandlerLayout->addWidget(menu); readConfig(); @@ -84,8 +84,8 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) //Searchline... iconLoader = KGlobal::iconLoader(); - QPixmap icon; - if( QApplication::reverseLayout() ) + TQPixmap icon; + if( TQApplication::reverseLayout() ) icon = iconLoader->loadIcon("locationbar_erase", KIcon::Small); else icon = iconLoader->loadIcon("clear_left", KIcon::Small); @@ -93,7 +93,7 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) connect(menu->clearButton, SIGNAL(clicked()), menu->searchLine, SLOT (clear()) ); - menu->detachButton->setIconSet(QPixmap(uic_findImage("detach.png"))); + menu->detachButton->setIconSet(TQPixmap(uic_findImage("detach.png"))); connect(menu->detachButton, SIGNAL(clicked()), this, SLOT (switchWindowMode()) ); menu->searchLine->setContextMenuEnabled(false); @@ -125,17 +125,17 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) //user icon and login KUser *user = new KUser (); - QString loginName (user->loginName ()); - QImage + TQString loginName (user->loginName ()); + TQImage userImage (locate ("data", "/home/" + loginName + "/.face.icon")); if( !userImage.isNull() ) { userImage = userImage.smoothScale (KIcon::SizeSmallMedium, KIcon::SizeSmallMedium); - menu->switchButton->setIconSet(QPixmap(userImage)); + menu->switchButton->setIconSet(TQPixmap(userImage)); } menu->switchButton->setText(loginName); - sessionsMenu = new QPopupMenu(); + sessionsMenu = new TQPopupMenu(); menu->switchButton->setPopup(sessionsMenu); @@ -145,25 +145,25 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) //left/middle mouse button connect (menu->dynamicList, - SIGNAL (activated(QListViewItem *, const QPoint & , int )), this, - SLOT (dynListClicked(QListViewItem *, const QPoint &, int))); + SIGNAL (activated(TQListViewItem *, const TQPoint & , int )), this, + SLOT (dynListClicked(TQListViewItem *, const TQPoint &, int))); connect (menu->rootList, - SIGNAL (activated(QListViewItem *, const QPoint & , int )), this, - SLOT (rootListClicked(QListViewItem *, const QPoint &, int))); + SIGNAL (activated(TQListViewItem *, const TQPoint & , int )), this, + SLOT (rootListClicked(TQListViewItem *, const TQPoint &, int))); connect (menu->childList, - SIGNAL (activated(QListViewItem *, const QPoint & , int )), this, - SLOT (childListClicked(QListViewItem *, const QPoint &, int))); + SIGNAL (activated(TQListViewItem *, const TQPoint & , int )), this, + SLOT (childListClicked(TQListViewItem *, const TQPoint &, int))); //right mouse button connect (menu->dynamicList, - SIGNAL (contextMenuRequested(QListViewItem *, const QPoint & , int )), this, - SLOT (slotContextMenu(QListViewItem *, const QPoint &, int))); + SIGNAL (contextMenuRequested(TQListViewItem *, const TQPoint & , int )), this, + SLOT (slotContextMenu(TQListViewItem *, const TQPoint &, int))); connect (menu->rootList, - SIGNAL (contextMenuRequested(QListViewItem *, const QPoint & , int )), this, - SLOT (slotContextMenu(QListViewItem *, const QPoint &, int))); + SIGNAL (contextMenuRequested(TQListViewItem *, const TQPoint & , int )), this, + SLOT (slotContextMenu(TQListViewItem *, const TQPoint &, int))); connect (menu->childList, - SIGNAL (contextMenuRequested(QListViewItem *, const QPoint & , int )), this, - SLOT (slotContextMenu(QListViewItem *, const QPoint &, int))); + SIGNAL (contextMenuRequested(TQListViewItem *, const TQPoint & , int )), this, + SLOT (slotContextMenu(TQListViewItem *, const TQPoint &, int))); //don't open categories on mouseover on childlist //menu->childList->setEasyOpen( true ); @@ -191,15 +191,15 @@ void MenuHandler::loadNewInstalledApps() //Notification for newly installed apps xdgMenuLister = new KDirLister( ); KStandardDirs *standardDir=new KStandardDirs(); - QStringList appDirs = standardDir->findDirs("xdgdata-apps", "."); + TQStringList appDirs = standardDir->findDirs("xdgdata-apps", "."); firstListing = 0; - for(QStringList::Iterator it = appDirs.begin(); it != appDirs.end(); ++it) + for(TQStringList::Iterator it = appDirs.begin(); it != appDirs.end(); ++it) { xdgMenuLister->openURL(*it, true); /*HACK: links to kde programs are often installed in a kde subdirectory of one of these, so i duplicate all the entries with entry+"kde/"*/ - QString appDirWithKde = (*it)+"kde/"; - if( QFile::exists(appDirWithKde) ) + TQString appDirWithKde = (*it)+"kde/"; + if( TQFile::exists(appDirWithKde) ) { xdgMenuLister->openURL(appDirWithKde, true); firstListing++; @@ -215,7 +215,7 @@ void MenuHandler::loadNewInstalledApps() xdgMenuWatch = new KDirWatch(this); xdgMenuWatch->addFile(locateLocal("xdgconf-menu", "applications-kmenuedit.menu")); //connect with slotApplicationRemoved() because we need to wait a while... - connect( xdgMenuWatch, SIGNAL(dirty(const QString&)), this, + connect( xdgMenuWatch, SIGNAL(dirty(const TQString&)), this, SLOT(slotApplicationRemoved()) ); newInstalledList = prefSkel->newInstalledApps(); @@ -236,12 +236,12 @@ void MenuHandler::loadNewInstalledApps() void MenuHandler::setupColumns() { menu->dynamicList->header()->hide(); - menu->dynamicList->setResizeMode(QListView::AllColumns); + menu->dynamicList->setResizeMode(TQListView::AllColumns); menu->dynamicList->addColumn("name"); menu->dynamicList->setShowToolTips(true); menu->dynamicList->setSortColumn(-1); menu->dynamicList->header()->setResizeEnabled(false); - menu->dynamicList->setHScrollBarMode(QScrollView::AlwaysOff); + menu->dynamicList->setHScrollBarMode(TQScrollView::AlwaysOff); menu->dynamicList->setActionIconSize( _actionIconSize ); menu->dynamicList->setRootIsDecorated( _showExpander ); //manage drag'n drop @@ -251,21 +251,21 @@ void MenuHandler::setupColumns() this, SLOT(dynListElemMoved()) ); menu->rootList->header()->hide(); - menu->rootList->setResizeMode(QListView::AllColumns); + menu->rootList->setResizeMode(TQListView::AllColumns); menu->rootList->addColumn("name"); menu->rootList->setSortColumn(-1); menu->rootList->header()->setResizeEnabled(false); - menu->rootList->setHScrollBarMode(QScrollView::AlwaysOff); + menu->rootList->setHScrollBarMode(TQScrollView::AlwaysOff); menu->rootList->setHighLightGroups( false ); menu->rootList->setActionIconSize( _actionIconSize ); menu->rootList->setDragEnabled(true); menu->childList->header()->hide(); - menu->childList->setResizeMode(QListView::AllColumns); + menu->childList->setResizeMode(TQListView::AllColumns); menu->childList->addColumn("name"); menu->childList->setSortColumn(_alphabetical?0:-1); menu->childList->header()->setResizeEnabled(false); - menu->childList->setHScrollBarMode(QScrollView::AlwaysOff); + menu->childList->setHScrollBarMode(TQScrollView::AlwaysOff); menu->childList->setActionIconSize( _actionIconSize ); menu->childList->setRootIsDecorated( _showExpander ); menu->childList->setDragEnabled(true); @@ -276,7 +276,7 @@ void MenuHandler::dynListElemMoved( ) { //very stupid: iterate the entire list and rewrite the favouriteList favouriteList.clear(); - QListViewItemIterator it( menu->dynamicList ); + TQListViewItemIterator it( menu->dynamicList ); while ( it.current() ) { @@ -294,31 +294,31 @@ void MenuHandler::dynListElemMoved( ) } -bool MenuHandler::eventFilter( QObject *o, QEvent * e ) +bool MenuHandler::eventFilter( TQObject *o, TQEvent * e ) { - if ( e->type() == QEvent::KeyPress ) + if ( e->type() == TQEvent::KeyPress ) { - QKeyEvent *keyEvent = (QKeyEvent *)e; - QFocusData *fData = focusData(); + TQKeyEvent *keyEvent = (TQKeyEvent *)e; + TQFocusData *fData = focusData(); fData->home(); switch( keyEvent->key() ) { - case Qt::Key_Up: - if( dynamic_cast<QComboBox *>(o) ) + case TQt::Key_Up: + if( dynamic_cast<TQComboBox *>(o) ) return false; fData->prev()->setFocus(); break; - case Qt::Key_Down: + case TQt::Key_Down: { - if( dynamic_cast<QComboBox *>(o) ) + if( dynamic_cast<TQComboBox *>(o) ) return false; //this is a workaround in order to set the focus on the //right widget when the combobox is disabled - QWidget *nextWidget = fData->next(); + TQWidget *nextWidget = fData->next(); if( nextWidget->isEnabled() ) nextWidget->setFocus(); else @@ -326,29 +326,29 @@ bool MenuHandler::eventFilter( QObject *o, QEvent * e ) } break; - case Qt::Key_Right: + case TQt::Key_Right: if( dynamic_cast<KListViewSearchLine *>(o) ) return false; fData->next()->setFocus(); break; - case Qt::Key_Left: + case TQt::Key_Left: if( dynamic_cast<KListViewSearchLine *>(o) ) return false; fData->prev()->setFocus(); break; - case Qt::Key_Enter: - case Qt::Key_Return: + case TQt::Key_Enter: + case TQt::Key_Return: { //only filter enter on search line if( o != menu->searchLine ) return false; - QListViewItem *listItem = NULL; + TQListViewItem *listItem = NULL; //execute the only list item when there is exactly one - QListViewItemIterator it( menu->dynamicList, - QListViewItemIterator::Visible); + TQListViewItemIterator it( menu->dynamicList, + TQListViewItemIterator::Visible); //listItem = it.current(); int count = 0; //ensure the first level have only one result @@ -367,7 +367,7 @@ bool MenuHandler::eventFilter( QObject *o, QEvent * e ) if( listItem ) { - dynListClicked(listItem, QPoint(0,0), 0); + dynListClicked(listItem, TQPoint(0,0), 0); menu->searchLine->clear(); } @@ -381,11 +381,11 @@ bool MenuHandler::eventFilter( QObject *o, QEvent * e ) return true; } //for some reasons clicking with the right mouse button on the searchline everything crashes... -/* else if( e->type() == QEvent::MouseButtonPress && o == menu->searchLine ) +/* else if( e->type() == TQEvent::MouseButtonPress && o == menu->searchLine ) {return true; - QMouseEvent *mouseEvent = (QMouseEvent *)e; + TQMouseEvent *mouseEvent = (TQMouseEvent *)e; - if( mouseEvent->button() != QMouseEvent::RightButton ) + if( mouseEvent->button() != TQMouseEvent::RightButton ) return true; if( menu->searchLine->text().length() < 4 ) @@ -443,7 +443,7 @@ void MenuHandler::readConfig() //menu size _menuWidth = 100.0/prefSkel->menuWidth(); _menuHeight = 100.0/prefSkel->menuHeight(); - QRect r = QDesktopWidget().screenGeometry(this); + TQRect r = TQDesktopWidget().screenGeometry(this); int w = (int)(r.width()/_menuWidth); int h = (int)(r.height()/_menuHeight); resize(w,h); @@ -454,48 +454,48 @@ void MenuHandler::readConfig() _isNormalWindow = prefSkel->isNormalWindow(); if( _isNormalWindow ) { - menu->detachButton->setIconSet(QPixmap(uic_findImage("attach.png"))); - QToolTip::add( menu->detachButton, tr2i18n( "Make this window a popup menu" ) ); + menu->detachButton->setIconSet(TQPixmap(uic_findImage("attach.png"))); + TQToolTip::add( menu->detachButton, tr2i18n( "Make this window a popup menu" ) ); } else { - menu->detachButton->setIconSet(QPixmap(uic_findImage("detach.png"))); - QToolTip::add( menu->detachButton, tr2i18n( "Make this menu a normal window" ) ); + menu->detachButton->setIconSet(TQPixmap(uic_findImage("detach.png"))); + TQToolTip::add( menu->detachButton, tr2i18n( "Make this menu a normal window" ) ); } // disconnect(menu->searchLine, 0, 0, 0); if( !_kerryIntegration && !_strigiIntegration ) { //menu->searchLine->setListView((KListView *)(menu->dynamicList)); - disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (kerrySearch( const QString &)) ); - disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (strigiSearch( const QString &)) ); - connect(menu->searchLine, SIGNAL(textChanged( const QString &)), - this, SLOT (initializeSearch( const QString &)) ); + disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (kerrySearch( const TQString &)) ); + disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (strigiSearch( const TQString &)) ); + connect(menu->searchLine, SIGNAL(textChanged( const TQString &)), + this, SLOT (initializeSearch( const TQString &)) ); } else if( _kerryIntegration ) { menu->searchLine->setListView(NULL); menu->searchLine->setEnabled(true); - disconnect(menu->searchLine, SIGNAL(textChanged( const QString &)), - this, SLOT (initializeSearch( const QString &)) ); - disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (strigiSearch( const QString &)) ); - connect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (kerrySearch( const QString &)) ); + disconnect(menu->searchLine, SIGNAL(textChanged( const TQString &)), + this, SLOT (initializeSearch( const TQString &)) ); + disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (strigiSearch( const TQString &)) ); + connect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (kerrySearch( const TQString &)) ); menu->searchLine->setContextMenuEnabled(false); } else //strigi { menu->searchLine->setListView(NULL); menu->searchLine->setEnabled(true); - disconnect(menu->searchLine, SIGNAL(textChanged( const QString &)), - this, SLOT (initializeSearch( const QString &)) ); - disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (kerrySearch( const QString &)) ); - connect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (strigiSearch( const QString &)) ); + disconnect(menu->searchLine, SIGNAL(textChanged( const TQString &)), + this, SLOT (initializeSearch( const TQString &)) ); + disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (kerrySearch( const TQString &)) ); + connect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (strigiSearch( const TQString &)) ); menu->searchLine->setContextMenuEnabled(false); } } @@ -518,20 +518,20 @@ void MenuHandler::updateConfig() } -void MenuHandler::mousePressEvent( QMouseEvent *e) +void MenuHandler::mousePressEvent( TQMouseEvent *e) { - if(static_cast<QWidget *>(parent())->hasMouse()) + if(static_cast<TQWidget *>(parent())->hasMouse()) { close(); } else if(!_isNormalWindow && !(rect().contains(e->pos())) ) { hide(); - QTimer::singleShot(200, this,SLOT(close())); + TQTimer::singleShot(200, this,SLOT(close())); } } -void MenuHandler::closeEvent ( QCloseEvent *e) +void MenuHandler::closeEvent ( TQCloseEvent *e) { e=e; @@ -546,11 +546,11 @@ void MenuHandler::closeEvent ( QCloseEvent *e) //HACK: I wait a little bit to permit closing the menu // when user clicks on the menu button again - QTimer::singleShot(50, this, SLOT(hide())); + TQTimer::singleShot(50, this, SLOT(hide())); emit(hidden()); } -void MenuHandler::popup(QPoint pos) +void MenuHandler::popup(TQPoint pos) { if(isVisible()) { @@ -564,7 +564,7 @@ void MenuHandler::popup(QPoint pos) int h; if( !_isNormalWindow ) { - QRect r = QDesktopWidget().screenGeometry(this); + TQRect r = TQDesktopWidget().screenGeometry(this); w = (int)(r.width()/_menuWidth); h = (int)(r.height()/_menuHeight); } @@ -642,7 +642,7 @@ void MenuHandler::initNewInstalledApps(KServiceGroup::Ptr group) KService *s = static_cast < KService * > ( p ); - QString path(s->desktopEntryPath()); + TQString path(s->desktopEntryPath()); if( oldInstalledList.findIndex(path) == -1 && newInstalledList.findIndex(path) == -1 ) { @@ -695,7 +695,7 @@ bool MenuHandler::searchNewItems(KServiceGroup::Ptr group) /*KServiceGroup::List MenuHandler::getServiceGroupList( KServiceGroup *serviceGroup ) { - QString key(serviceGroup->directoryEntryPath()); + TQString key(serviceGroup->directoryEntryPath()); if( sListMap.contains(key) ) return sListMap[key]; @@ -709,7 +709,7 @@ bool MenuHandler::searchNewItems(KServiceGroup::Ptr group) void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *listView, TastyListViewItem *listItemFather, - bool recursive, const QString & query ) + bool recursive, const TQString & query ) { if( !serviceGroup || !serviceGroup->isValid() ) return; @@ -749,15 +749,15 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list if(numChilds == 0) continue; - QPixmap iconPix = iconLoader->loadIcon(g->icon(), KIcon::Toolbar,iconSize); + TQPixmap iconPix = iconLoader->loadIcon(g->icon(), KIcon::Toolbar,iconSize); if ( iconPix.height () != iconSize) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( iconSize, iconSize); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } @@ -792,8 +792,8 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list if( _currentCategory == listItem->text(0) && listView == menu->rootList ) { listView->setCurrentItem(listItem); - listView->setOpenItem(static_cast<QListViewItem *>(listItem)); - rootListClicked(listItem, QPoint(0,0), 0); + listView->setOpenItem(static_cast<TQListViewItem *>(listItem)); + rootListClicked(listItem, TQPoint(0,0), 0); } if(searchNewItems(g)) listItem->setHighLight(true); @@ -841,8 +841,8 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list //Name and comment - QString itemName = s->name(); - QString subText= QString(); + TQString itemName = s->name(); + TQString subText= TQString(); if( !isSeparator ) { if( s->comment() != NULL && !s->comment().isEmpty() ) @@ -899,14 +899,14 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list prevListItem = listItem; - QPixmap iconPix = s->pixmap( KIcon::Toolbar, iconSize ); + TQPixmap iconPix = s->pixmap( KIcon::Toolbar, iconSize ); if ( iconPix.height () != iconSize) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( iconSize, iconSize); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } listItem->setPixmap(0, iconPix); @@ -936,15 +936,15 @@ void MenuHandler::initializeRecentlyUsed( ) kickerConf->reparseConfiguration(); kickerConf->setGroup("menus"); - QStringList recentUsedList = QStringList::split(',',kickerConf->readEntry("RecentAppsStat")); + TQStringList recentUsedList = TQStringList::split(',',kickerConf->readEntry("RecentAppsStat")); - for (QStringList::ConstIterator it = recentUsedList.begin(); + for (TQStringList::ConstIterator it = recentUsedList.begin(); it != recentUsedList.end(); ++it ) { - QString item = (*it); + TQString item = (*it); - QString desktopPath = item.section(' ',2,2); - if(desktopPath.isEmpty() || !QFile::exists(desktopPath)) + TQString desktopPath = item.section(' ',2,2); + if(desktopPath.isEmpty() || !TQFile::exists(desktopPath)) continue; recentlyUsedMap[-item.section(' ',1,1).toULong()] = desktopPath; @@ -973,14 +973,14 @@ void MenuHandler::fillRecentDocuments( ) menu->dynamicList->clear(); setupDynList( RecentDocuments ); - QStringList recentDocsList = KRecentDocument::recentDocuments(); + TQStringList recentDocsList = KRecentDocument::recentDocuments(); TastyListViewItem *listItem = NULL; if( recentDocsList.isEmpty() ) return; - for (QStringList::Iterator it = recentDocsList.begin(); + for (TQStringList::Iterator it = recentDocsList.begin(); it != recentDocsList.end(); ++it ) { KDesktopFile *f= new KDesktopFile(*it, true /* read only */); @@ -994,14 +994,14 @@ void MenuHandler::fillRecentDocuments( ) listItem->setDeskopEntryPath(*it); listItem->setType( TastyListViewItem::DesktopFile ); - QPixmap iconPix = iconLoader->loadIcon(f->readIcon(), KIcon::Panel, _iconSize1); + TQPixmap iconPix = iconLoader->loadIcon(f->readIcon(), KIcon::Panel, _iconSize1); if ( iconPix.height () > _iconSize1) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( _iconSize1, _iconSize1); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } listItem->setPixmap(0, iconPix); @@ -1021,7 +1021,7 @@ void MenuHandler::fillMoreUsed( ) TastyListViewItem *listItem = NULL; - for (QStringList::Iterator it = moreUsedList.begin(); + for (TQStringList::Iterator it = moreUsedList.begin(); it != moreUsedList.end(); ++it ) { //FIXME: yeah, I know, this is U G L Y :-) @@ -1041,16 +1041,16 @@ void MenuHandler::fillMoreUsed( ) listItem->setDisplaySubText(_displaySubText); - QPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); + TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); if( !iconPix.isNull() ) { if ( iconPix.height () != _iconSize1) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( _iconSize1, _iconSize1); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } listItem->setPixmap(0, iconPix); @@ -1090,16 +1090,16 @@ void MenuHandler::fillRecentlyUsed( ) listItem->setDisplaySubText(_displaySubText); - QPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); + TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); if( !iconPix.isNull() ) { if ( iconPix.height () != _iconSize1) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( _iconSize1, _iconSize1); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } listItem->setPixmap(0, iconPix); @@ -1119,7 +1119,7 @@ void MenuHandler::fillFavourites( ) TastyListViewItem *listItem = NULL; - for (QStringList::Iterator it = favouriteList.begin(); + for (TQStringList::Iterator it = favouriteList.begin(); it != favouriteList.end(); ++it ) { @@ -1135,14 +1135,14 @@ void MenuHandler::fillFavourites( ) listItem->setDisplaySubText(_displaySubText); - QPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); + TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); if ( iconPix.height () > _iconSize1) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( _iconSize1, _iconSize1); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } listItem->setPixmap(0, iconPix); @@ -1181,7 +1181,7 @@ void MenuHandler::slotApplicationsAdded(const KFileItemList & newItems) for(KFileItemListIterator it(newItems); it.current(); ++it) { KFileItem *item = (*it); - QString path(item->url().path()); + TQString path(item->url().path()); kdDebug() << "new item: " << item->name() << endl; //ignore items already here @@ -1202,13 +1202,13 @@ void MenuHandler::slotApplicationsAdded(const KFileItemList & newItems) //It's necessary to wait some seconds, otherwise apps won't be listed //I do it two times for being sure, because I still haven't the clear idea //where the right files to watch are... - QTimer::singleShot(15000, this, SLOT(slotUpdateApplications())); + TQTimer::singleShot(15000, this, SLOT(slotUpdateApplications())); } void MenuHandler::slotApplicationRemoved() { - QTimer::singleShot(15000, this, SLOT(slotUpdateApplications())); + TQTimer::singleShot(15000, this, SLOT(slotUpdateApplications())); slotUpdateApplications(); } @@ -1222,7 +1222,7 @@ void MenuHandler::slotUpdateApplications() populateList( service, menu->rootList, NULL, false ); } -void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coord ) +void MenuHandler::listClicked( TastyListViewItem * listItem, const TQPoint & coord ) { if( !listItem ) return; @@ -1234,7 +1234,7 @@ void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coor int x = coord.x(); - QString servicePath = listItem->getDeskopEntryPath(); + TQString servicePath = listItem->getDeskopEntryPath(); switch( listItem->getType() ) { @@ -1291,7 +1291,7 @@ void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coor { DCOPRef kickerKMenuIface ("kicker", "KMenu"); - kickerKMenuIface.call("slotServiceStartedByStorageId(QString,QString)", "tastymenu", servicePath); + kickerKMenuIface.call("slotServiceStartedByStorageId(TQString,TQString)", "tastymenu", servicePath); if( (currentMenuMode == MoreUsed || currentMenuMode == RecentlyUsed) && !searchMode) @@ -1349,7 +1349,7 @@ void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coor } -void MenuHandler::dynListClicked( QListViewItem * listItem, const QPoint & coord, int c ) +void MenuHandler::dynListClicked( TQListViewItem * listItem, const TQPoint & coord, int c ) { c=c; if( !listItem ) @@ -1362,7 +1362,7 @@ void MenuHandler::dynListClicked( QListViewItem * listItem, const QPoint & coord listClicked( static_cast<TastyListViewItem *>(listItem), coord ); } -void MenuHandler::childListClicked( QListViewItem * listItem, const QPoint & coord, int c ) +void MenuHandler::childListClicked( TQListViewItem * listItem, const TQPoint & coord, int c ) { c=c; if( !listItem ) @@ -1382,7 +1382,7 @@ void MenuHandler::childListClicked( QListViewItem * listItem, const QPoint & coo listClicked( static_cast<TastyListViewItem *>(listItem), coord ); } -void MenuHandler::rootListClicked( QListViewItem * listItem, const QPoint & coord, int c ) +void MenuHandler::rootListClicked( TQListViewItem * listItem, const TQPoint & coord, int c ) { c=c; if( !listItem ) @@ -1408,7 +1408,7 @@ void MenuHandler::rootListClicked( QListViewItem * listItem, const QPoint & coor menu->childList->setSorting(0); } -void MenuHandler::slotContextMenu(QListViewItem *listItem, const QPoint &coord, int c) +void MenuHandler::slotContextMenu(TQListViewItem *listItem, const TQPoint &coord, int c) { if( !listItem ) @@ -1454,7 +1454,7 @@ void MenuHandler::slotContextMenu(QListViewItem *listItem, const QPoint &coord, break; case 2: - listClicked( tastyListItem, QPoint(tastyListItem->listView()->width(), 0) ); + listClicked( tastyListItem, TQPoint(tastyListItem->listView()->width(), 0) ); break; case 3: @@ -1590,7 +1590,7 @@ void MenuHandler::doNewSession( bool lock ) } -void MenuHandler::initializeSearch( const QString & query ) +void MenuHandler::initializeSearch( const TQString & query ) { if( !searchMode && query.length() > 2 ) { @@ -1600,9 +1600,9 @@ void MenuHandler::initializeSearch( const QString & query ) menu->menuModes->setEnabled(false); KServiceGroup::Ptr service = KServiceGroup::root(); menu->dynamicList->clear(); - setCursor(QCursor(Qt::BusyCursor)); + setCursor(TQCursor(TQt::BusyCursor)); populateList( service, menu->dynamicList, NULL, true, query ); - setCursor(QCursor(Qt::ArrowCursor)); + setCursor(TQCursor(TQt::ArrowCursor)); } else if( query.length() < 3 ) { @@ -1620,14 +1620,14 @@ void MenuHandler::initializeSearch( const QString & query ) } } -void MenuHandler::kerrySearch( const QString & query ) +void MenuHandler::kerrySearch( const TQString & query ) { close(); DCOPRef kdesktopKScreensaverIface ("kerry", "search"); - kdesktopKScreensaverIface.call ("search(QString)", query); + kdesktopKScreensaverIface.call ("search(TQString)", query); } -void MenuHandler::strigiSearch( const QString & query ) +void MenuHandler::strigiSearch( const TQString & query ) { close(); KRun::runCommand ("konqueror strigi:/?q="+query); @@ -1685,23 +1685,23 @@ void MenuHandler::menuModeChanged( int index ) void MenuHandler::switchWindowMode() { - if( !_isNormalWindow /*testWFlags(Qt::WType_Popup)*/ ) + if( !_isNormalWindow /*testWFlags(TQt::WType_Popup)*/ ) { _isNormalWindow = true; hide(); - reparent(static_cast<QWidget *>(parent()),Qt::WType_Dialog, pos(), true); + reparent(static_cast<TQWidget *>(parent()),TQt::WType_Dialog, pos(), true); - menu->detachButton->setIconSet(QPixmap(uic_findImage("attach.png"))); + menu->detachButton->setIconSet(TQPixmap(uic_findImage("attach.png"))); prefSkel->setIsNormalWindow(true); } else { hide(); - reparent(static_cast<QWidget *>(parent()), - Qt::WType_Popup|Qt::WNoAutoErase, + reparent(static_cast<TQWidget *>(parent()), + TQt::WType_Popup|TQt::WNoAutoErase, pos(), true); - menu->detachButton->setIconSet(QPixmap(uic_findImage("detach.png"))); + menu->detachButton->setIconSet(TQPixmap(uic_findImage("detach.png"))); prefSkel->setIsNormalWindow(false); _isNormalWindow = false; } |