┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/infosidebarpage.cpp
diff options
context:
space:
mode:
authorDaniel Molkentin <[email protected]>2007-03-22 14:08:38 +0000
committerDaniel Molkentin <[email protected]>2007-03-22 14:08:38 +0000
commit75f4f45c9879a3067dc23e00f637030e36ebab51 (patch)
tree11adc4dba13e3218cbef5121674a190065454a37 /src/infosidebarpage.cpp
parent6ee9f08e8fc90cc67cd2ed83ae6f2dd5c1846ba3 (diff)
less KDE 3 dependencies
svn path=/trunk/KDE/kdebase/apps/; revision=645388
Diffstat (limited to 'src/infosidebarpage.cpp')
-rw-r--r--src/infosidebarpage.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/infosidebarpage.cpp b/src/infosidebarpage.cpp
index c05f5a8f8..35890188f 100644
--- a/src/infosidebarpage.cpp
+++ b/src/infosidebarpage.cpp
@@ -28,10 +28,9 @@
#include <qtimer.h>
#include <qpushbutton.h>
-#include <q3popupmenu.h>
+#include <qmenu.h>
#include <qpainter.h>
#include <qfontmetrics.h>
-#include <Q3ValueList>
#include <QEvent>
#include <QInputDialog>
@@ -243,9 +242,11 @@ void InfoSidebarPage::startService(int index)
DolphinView* view = mainWindow()->activeView();
if (view->hasSelection()) {
KUrl::List selectedUrls = view->selectedUrls();
+ // TODO: Use "at()" as soon as executeService is fixed to take a const param (BIC)
KDEDesktopMimeType::executeService(selectedUrls, m_actionsVector[index]);
}
else {
+ // TODO: likewise
KDEDesktopMimeType::executeService(m_shownUrl, m_actionsVector[index]);
}
}
@@ -397,17 +398,14 @@ void InfoSidebarPage::addInfoLine(const QString& labelText, const QString& infoT
void InfoSidebarPage::insertActions()
{
- // delete all existing action widgets
- // TODO: just use children() from QObject...
- Q3PtrListIterator<QWidget> deleteIter(m_actionWidgets);
+ QListIterator<QPushButton*> deleteIter(m_actionBox->findChildren<QPushButton*>());
QWidget* widget = 0;
- while ((widget = deleteIter.current()) != 0) {
+ while (deleteIter.hasNext()) {
+ widget = deleteIter.next();
widget->close();
widget->deleteLater();
- ++deleteIter;
}
- m_actionWidgets.clear();
m_actionsVector.clear();
int actionsIndex = 0;
@@ -469,10 +467,10 @@ void InfoSidebarPage::insertActions()
if (insert) {
const QString submenuName = cfg.readEntry( "X-KDE-Submenu" );
- Q3PopupMenu* popup = 0;
+ QMenu* popup = 0;
if (!submenuName.isEmpty()) {
// create a sub menu containing all actions
- popup = new Q3PopupMenu();
+ popup = new QMenu();
connect(popup, SIGNAL(activated(int)),
this, SLOT(startService(int)));
@@ -480,14 +478,13 @@ void InfoSidebarPage::insertActions()
button->setFlat(true);
button->setMenu(popup);
button->show();
- m_actionWidgets.append(button);
}
- Q3ValueList<KDEDesktopMimeType::Service> userServices =
+ QList<KDEDesktopMimeType::Service> userServices =
KDEDesktopMimeType::userDefinedServices(*dirIt + *entryIt, true);
// iterate through all actions and add them to a widget
- Q3ValueList<KDEDesktopMimeType::Service>::Iterator serviceIt;
+ QList<KDEDesktopMimeType::Service>::Iterator serviceIt;
for (serviceIt = userServices.begin(); serviceIt != userServices.end(); ++serviceIt) {
KDEDesktopMimeType::Service service = (*serviceIt);
if (popup == 0) {
@@ -497,7 +494,6 @@ void InfoSidebarPage::insertActions()
actionsIndex);
connect(button, SIGNAL(requestServiceStart(int)),
this, SLOT(startService(int)));
- m_actionWidgets.append(button);
button->show();
}
else {