Commit e3b89106 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Port away from deprecated KDELibs4Support

Summary: kmenuedit seems to work, adding new submenus and items

Reviewers: mlaurent, vkrause

Reviewed By: mlaurent, vkrause

Subscribers: vkrause, plasma-devel, kde-frameworks-devel

Tags: #plasma

Maniphest Tasks: T11566

Differential Revision: https://phabricator.kde.org/D24603
parent 0b151434
......@@ -27,10 +27,10 @@ find_package(KF5 REQUIRED COMPONENTS
DBusAddons
IconThemes
KIO
ItemViews
Sonnet
DocTools
Init
KDELibs4Support
)
find_package(KHotKeysDBusInterface QUIET)
......@@ -72,10 +72,10 @@ target_link_libraries(kdeinit_kmenuedit
KF5::IconThemes
KF5::KIOCore
KF5::KIOWidgets
KF5::ItemViews
KF5::SonnetCore
KF5::SonnetUi
KF5::XmlGui
KF5::KDELibs4Support
)
install(TARGETS kdeinit_kmenuedit DESTINATION ${KDE_INSTALL_LIBDIR} )
......
......@@ -26,8 +26,8 @@
#include <QVBoxLayout>
#include <QGridLayout>
#include <KConfigGroup>
#include <KLocalizedString>
#include <KDialog>
#include <KKeySequenceWidget>
#include <KLineEdit>
#include <KIconButton>
......@@ -62,8 +62,6 @@ void BasicTab::initGeneralTab()
// general tab
QWidget *generalTab = new QWidget();
QGridLayout *generalTabLayout = new QGridLayout(generalTab);
generalTabLayout->setContentsMargins(KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint());
generalTabLayout->setSpacing(KDialog::spacingHint());
generalTab->setAcceptDrops(false);
// name
......@@ -143,8 +141,6 @@ void BasicTab::initAdvancedTab()
// work path
_workPathGroup = new QGroupBox();
QHBoxLayout *workPathGroupLayout = new QHBoxLayout(_workPathGroup);
workPathGroupLayout->setSpacing(KDialog::spacingHint());
workPathGroupLayout->setContentsMargins(KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint());
_pathLabel = new QLabel(i18n("&Work path:"));
workPathGroupLayout->addWidget(_pathLabel);
_pathEdit = new KUrlRequester();
......@@ -157,14 +153,11 @@ void BasicTab::initAdvancedTab()
// terminal CB
_terminalGroup = new QGroupBox();
QVBoxLayout *terminalGroupLayout = new QVBoxLayout(_terminalGroup);
terminalGroupLayout->setContentsMargins(KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint());
terminalGroupLayout->setSpacing(KDialog::spacingHint());
_terminalCB = new QCheckBox(i18n("Run in term&inal"));
terminalGroupLayout->addWidget(_terminalCB);
// terminal options
QWidget *terminalOptionsGroup = new QWidget();
QHBoxLayout *terminalOptionsGroupLayout = new QHBoxLayout(terminalOptionsGroup);
terminalOptionsGroupLayout->setSpacing(KDialog::spacingHint());
_terminalOptionsLabel = new QLabel(i18n("Terminal &options:"));
terminalOptionsGroupLayout->addWidget(_terminalOptionsLabel);
_terminalOptionsEdit = new KLineEdit();
......@@ -178,14 +171,11 @@ void BasicTab::initAdvancedTab()
// user name CB
_userGroup = new QGroupBox();
QVBoxLayout *userGroupLayout = new QVBoxLayout(_userGroup);
userGroupLayout->setContentsMargins(KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint());
userGroupLayout->setSpacing(KDialog::spacingHint());
_userCB = new QCheckBox(i18n("&Run as a different user"));
userGroupLayout->addWidget(_userCB);
// user name
QWidget *userNameGroup = new QWidget();
QHBoxLayout *userNameGroupLayout = new QHBoxLayout(userNameGroup);
userNameGroupLayout->setSpacing(KDialog::spacingHint());
_userNameLabel = new QLabel(i18n("&Username:"));
userNameGroupLayout->addWidget(_userNameLabel);
_userNameEdit = new KLineEdit();
......@@ -199,8 +189,6 @@ void BasicTab::initAdvancedTab()
// key binding
_keyBindingGroup = new QGroupBox();
QHBoxLayout *keyBindingGroupLayout = new QHBoxLayout(_keyBindingGroup);
keyBindingGroupLayout->setContentsMargins(KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint(), KDialog::marginHint());
keyBindingGroupLayout->setSpacing(KDialog::spacingHint());
_keyBindingLabel = new QLabel(i18n("Current shortcut &key:"));
keyBindingGroupLayout->addWidget(_keyBindingLabel);
_keyBindingEdit = new KKeySequenceWidget();
......
......@@ -33,17 +33,18 @@
#include <QDropEvent>
#include <QHeaderView>
#include <QIcon>
#include <QInputDialog>
#include <QMenu>
#include <QPainter>
#include <QRegExp>
#include <QSignalMapper>
#include <QUrl>
#include <KActionCollection>
#include <KBuildSycocaProgressDialog>
#include "kmenuedit_debug.h"
#include <KDesktopFile>
#include <KIconLoader>
#include <KInputDialog>
#include <KLocalizedString>
#include <KMessageBox>
#include <KService>
......@@ -51,7 +52,6 @@
#include <KConfig>
#include <KConfigGroup>
#include <KUrlMimeData>
#include <KUrl>
#include <KStringHandler>
#include <QStandardPaths>
......@@ -813,11 +813,11 @@ bool TreeView::dropMimeData(QTreeWidgetItem *item, int index, const QMimeData *d
if (!data->hasFormat(QLatin1String(s_internalMimeType))) {
// External drop
if (!KUrl::List::canDecode(data)) {
if (!data->hasUrls()) {
return false;
}
KUrl::List urls = KUrl::List::fromMimeData(data);
QList<QUrl> urls = KUrlMimeData::urlsFromMimeData(data);
if (urls.isEmpty() || !urls[0].isLocalFile()) {
return false;
}
......@@ -1023,8 +1023,8 @@ void TreeView::newsubmenu()
TreeItem *item = (TreeItem *)selectedItem();
bool ok;
QString caption = KInputDialog::getText(i18n("New Submenu"),
i18n("Submenu name:"), QString(), &ok, this);
QString caption = QInputDialog::getText(this, i18n("New Submenu"), i18n("Submenu name:"),
QLineEdit::Normal, QString(), &ok);
if (!ok) {
return;
......@@ -1091,8 +1091,8 @@ void TreeView::newitem()
TreeItem *item = (TreeItem *)selectedItem();
bool ok;
QString caption = KInputDialog::getText(i18n("New Item"),
i18n("Item name:"), QString(), &ok, this);
QString caption = QInputDialog::getText(this, i18n("New Item"), i18n("Item name:"),
QLineEdit::Normal, QString(), &ok);
if (!ok) {
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment