mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
less KDE 3 dependencies
svn path=/trunk/KDE/kdebase/apps/; revision=645388
This commit is contained in:
parent
6ee9f08e8f
commit
75f4f45c98
|
@ -28,10 +28,9 @@
|
||||||
#include <qtimer.h>
|
#include <qtimer.h>
|
||||||
#include <qpushbutton.h>
|
#include <qpushbutton.h>
|
||||||
|
|
||||||
#include <q3popupmenu.h>
|
#include <qmenu.h>
|
||||||
#include <qpainter.h>
|
#include <qpainter.h>
|
||||||
#include <qfontmetrics.h>
|
#include <qfontmetrics.h>
|
||||||
#include <Q3ValueList>
|
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
|
|
||||||
|
@ -243,9 +242,11 @@ void InfoSidebarPage::startService(int index)
|
||||||
DolphinView* view = mainWindow()->activeView();
|
DolphinView* view = mainWindow()->activeView();
|
||||||
if (view->hasSelection()) {
|
if (view->hasSelection()) {
|
||||||
KUrl::List selectedUrls = view->selectedUrls();
|
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]);
|
KDEDesktopMimeType::executeService(selectedUrls, m_actionsVector[index]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// TODO: likewise
|
||||||
KDEDesktopMimeType::executeService(m_shownUrl, m_actionsVector[index]);
|
KDEDesktopMimeType::executeService(m_shownUrl, m_actionsVector[index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,17 +398,14 @@ void InfoSidebarPage::addInfoLine(const QString& labelText, const QString& infoT
|
||||||
|
|
||||||
void InfoSidebarPage::insertActions()
|
void InfoSidebarPage::insertActions()
|
||||||
{
|
{
|
||||||
// delete all existing action widgets
|
QListIterator<QPushButton*> deleteIter(m_actionBox->findChildren<QPushButton*>());
|
||||||
// TODO: just use children() from QObject...
|
|
||||||
Q3PtrListIterator<QWidget> deleteIter(m_actionWidgets);
|
|
||||||
QWidget* widget = 0;
|
QWidget* widget = 0;
|
||||||
while ((widget = deleteIter.current()) != 0) {
|
while (deleteIter.hasNext()) {
|
||||||
|
widget = deleteIter.next();
|
||||||
widget->close();
|
widget->close();
|
||||||
widget->deleteLater();
|
widget->deleteLater();
|
||||||
++deleteIter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_actionWidgets.clear();
|
|
||||||
m_actionsVector.clear();
|
m_actionsVector.clear();
|
||||||
|
|
||||||
int actionsIndex = 0;
|
int actionsIndex = 0;
|
||||||
|
@ -469,10 +467,10 @@ void InfoSidebarPage::insertActions()
|
||||||
|
|
||||||
if (insert) {
|
if (insert) {
|
||||||
const QString submenuName = cfg.readEntry( "X-KDE-Submenu" );
|
const QString submenuName = cfg.readEntry( "X-KDE-Submenu" );
|
||||||
Q3PopupMenu* popup = 0;
|
QMenu* popup = 0;
|
||||||
if (!submenuName.isEmpty()) {
|
if (!submenuName.isEmpty()) {
|
||||||
// create a sub menu containing all actions
|
// create a sub menu containing all actions
|
||||||
popup = new Q3PopupMenu();
|
popup = new QMenu();
|
||||||
connect(popup, SIGNAL(activated(int)),
|
connect(popup, SIGNAL(activated(int)),
|
||||||
this, SLOT(startService(int)));
|
this, SLOT(startService(int)));
|
||||||
|
|
||||||
|
@ -480,14 +478,13 @@ void InfoSidebarPage::insertActions()
|
||||||
button->setFlat(true);
|
button->setFlat(true);
|
||||||
button->setMenu(popup);
|
button->setMenu(popup);
|
||||||
button->show();
|
button->show();
|
||||||
m_actionWidgets.append(button);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Q3ValueList<KDEDesktopMimeType::Service> userServices =
|
QList<KDEDesktopMimeType::Service> userServices =
|
||||||
KDEDesktopMimeType::userDefinedServices(*dirIt + *entryIt, true);
|
KDEDesktopMimeType::userDefinedServices(*dirIt + *entryIt, true);
|
||||||
|
|
||||||
// iterate through all actions and add them to a widget
|
// 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) {
|
for (serviceIt = userServices.begin(); serviceIt != userServices.end(); ++serviceIt) {
|
||||||
KDEDesktopMimeType::Service service = (*serviceIt);
|
KDEDesktopMimeType::Service service = (*serviceIt);
|
||||||
if (popup == 0) {
|
if (popup == 0) {
|
||||||
|
@ -497,7 +494,6 @@ void InfoSidebarPage::insertActions()
|
||||||
actionsIndex);
|
actionsIndex);
|
||||||
connect(button, SIGNAL(requestServiceStart(int)),
|
connect(button, SIGNAL(requestServiceStart(int)),
|
||||||
this, SLOT(startService(int)));
|
this, SLOT(startService(int)));
|
||||||
m_actionWidgets.append(button);
|
|
||||||
button->show();
|
button->show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -22,13 +22,11 @@
|
||||||
|
|
||||||
#include <sidebarpage.h>
|
#include <sidebarpage.h>
|
||||||
|
|
||||||
#include <q3valuevector.h>
|
|
||||||
#include <qpushbutton.h>
|
#include <qpushbutton.h>
|
||||||
//Added by qt3to4:
|
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <Q3PtrList>
|
#include <QList>
|
||||||
|
|
||||||
#include <kurl.h>
|
#include <kurl.h>
|
||||||
#include <kmimetype.h>
|
#include <kmimetype.h>
|
||||||
|
@ -164,8 +162,7 @@ private:
|
||||||
QLabel* m_infos;
|
QLabel* m_infos;
|
||||||
|
|
||||||
KVBox* m_actionBox;
|
KVBox* m_actionBox;
|
||||||
Q3PtrList<QWidget> m_actionWidgets; // TODO: use children() from QObject instead
|
QVector<KDEDesktopMimeType::Service> m_actionsVector;
|
||||||
Q3ValueVector<KDEDesktopMimeType::Service> m_actionsVector;
|
|
||||||
|
|
||||||
MetaDataWidget* m_metadataWidget;
|
MetaDataWidget* m_metadataWidget;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue