mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Adjust KCMs to no longer do cast manually
KCModule::widget returns the widget that should be a parent for widgets the KCM creates
This commit is contained in:
parent
1c393f50d5
commit
3d0c946eef
|
@ -20,16 +20,15 @@
|
|||
K_PLUGIN_CLASS_WITH_JSON(DolphinGeneralConfigModule, "kcmdolphingeneral.json")
|
||||
|
||||
DolphinGeneralConfigModule::DolphinGeneralConfigModule(QObject *parent, const KPluginMetaData &data)
|
||||
: KCModule(qobject_cast<QWidget *>(parent), data)
|
||||
: KCModule(parent, data)
|
||||
, m_pages()
|
||||
{
|
||||
setButtons(KCModule::Default | KCModule::Help | KCModule::Apply);
|
||||
|
||||
const auto parentWidget = qobject_cast<QWidget *>(parent);
|
||||
QVBoxLayout *topLayout = new QVBoxLayout(parentWidget);
|
||||
QVBoxLayout *topLayout = new QVBoxLayout(widget());
|
||||
topLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QTabWidget *tabWidget = new QTabWidget(parentWidget);
|
||||
QTabWidget *tabWidget = new QTabWidget(widget());
|
||||
|
||||
// initialize 'Behavior' tab
|
||||
BehaviorSettingsPage *behaviorPage = new BehaviorSettingsPage(QUrl::fromLocalFile(QDir::homePath()), tabWidget);
|
||||
|
|
|
@ -16,16 +16,15 @@
|
|||
K_PLUGIN_CLASS_WITH_JSON(DolphinNavigationConfigModule, "kcmdolphinnavigation.json")
|
||||
|
||||
DolphinNavigationConfigModule::DolphinNavigationConfigModule(QObject *parent)
|
||||
: KCModule(qobject_cast<QWidget *>(parent))
|
||||
: KCModule(parent)
|
||||
, m_navigation(nullptr)
|
||||
{
|
||||
setButtons(KCModule::Default | KCModule::Help | KCModule::Apply);
|
||||
|
||||
const auto parentWidget = qobject_cast<QWidget *>(parent);
|
||||
QVBoxLayout *topLayout = new QVBoxLayout(parentWidget);
|
||||
QVBoxLayout *topLayout = new QVBoxLayout(widget());
|
||||
topLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
m_navigation = new NavigationSettingsPage(parentWidget);
|
||||
m_navigation = new NavigationSettingsPage(widget());
|
||||
connect(m_navigation, &NavigationSettingsPage::changed, this, &DolphinNavigationConfigModule::markAsChanged);
|
||||
topLayout->addWidget(m_navigation, 0, {});
|
||||
}
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
#include "settings/viewmodes/viewsettingstab.h"
|
||||
|
||||
#include <KCModule>
|
||||
#include <KLocalizedString>
|
||||
#include <KPluginFactory>
|
||||
#include <KCModule>
|
||||
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusMessage>
|
||||
|
@ -21,16 +21,15 @@
|
|||
K_PLUGIN_CLASS_WITH_JSON(DolphinViewModesConfigModule, "kcmdolphinviewmodes.json")
|
||||
|
||||
DolphinViewModesConfigModule::DolphinViewModesConfigModule(QObject *parent, const KPluginMetaData &data)
|
||||
: KCModule(qobject_cast<QWidget *>(parent), data)
|
||||
: KCModule(parent, data)
|
||||
, m_tabs()
|
||||
{
|
||||
setButtons(KCModule::Default | KCModule::Help | KCModule::Apply);
|
||||
|
||||
const auto parentWidget = qobject_cast<QWidget *>(parent);
|
||||
QVBoxLayout *topLayout = new QVBoxLayout(parentWidget);
|
||||
QVBoxLayout *topLayout = new QVBoxLayout(widget());
|
||||
topLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QTabWidget *tabWidget = new QTabWidget(parentWidget);
|
||||
QTabWidget *tabWidget = new QTabWidget(widget());
|
||||
|
||||
// Initialize 'Icons' tab
|
||||
ViewSettingsTab *iconsTab = new ViewSettingsTab(ViewSettingsTab::IconsMode, tabWidget);
|
||||
|
|
Loading…
Reference in a new issue