Commit 45177bb2 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove deprecated method

Summary: Remove some deprecated method

Reviewers: zzag

Reviewed By: zzag

Subscribers: davidedmundson, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25735
parent 790e717c
......@@ -41,10 +41,17 @@ void Plugin::registerTypes(const char *uri)
qmlRegisterType<KDecoration2::Preview::PreviewItem>(uri, 1, 0, "Decoration");
qmlRegisterType<KDecoration2::Preview::PreviewButtonItem>(uri, 1, 0, "Button");
qmlRegisterType<KDecoration2::Preview::ButtonsModel>(uri, 1, 0, "ButtonsModel");
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
qmlRegisterType<KDecoration2::Preview::PreviewClient>();
qmlRegisterType<KDecoration2::Decoration>();
qmlRegisterType<KDecoration2::DecorationShadow>();
qmlRegisterType<KDecoration2::Preview::PreviewBridge>();
#else
qmlRegisterAnonymousType<KDecoration2::Preview::PreviewClient>(uri, 1);
qmlRegisterAnonymousType<KDecoration2::Decoration>(uri, 1);
qmlRegisterAnonymousType<KDecoration2::DecorationShadow>(uri, 1);
qmlRegisterAnonymousType<KDecoration2::Preview::PreviewBridge>(uri, 1);
#endif
}
}
......
......@@ -100,10 +100,13 @@ KCMKWinDecoration::KCMKWinDecoration(QObject *parent, const QVariantList &argume
i18n("Author"),
QStringLiteral("vpilo@coldshock.net"));
setAboutData(about);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
qmlRegisterType<QAbstractListModel>();
qmlRegisterType<QSortFilterProxyModel>();
#else
qmlRegisterAnonymousType<QAbstractListModel>("org.kde.kwin.KWinDecoration", 1);
qmlRegisterAnonymousType<QSortFilterProxyModel>("org.kde.kwin.KWinDecoration", 1);
#endif
m_proxyThemesModel->setSourceModel(m_themesModel);
m_proxyThemesModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
m_proxyThemesModel->setSortCaseSensitivity(Qt::CaseInsensitive);
......
......@@ -167,7 +167,7 @@ void DecorationOptions::setDecoration(KDecoration2::Decoration *decoration)
}
if (m_decoration) {
// disconnect from existing decoration
disconnect(m_decoration->client().data(), &KDecoration2::DecoratedClient::activeChanged, this, &DecorationOptions::slotActiveChanged);
disconnect(m_decoration->client().toStrongRef().data(), &KDecoration2::DecoratedClient::activeChanged, this, &DecorationOptions::slotActiveChanged);
auto s = m_decoration->settings();
disconnect(s.data(), &KDecoration2::DecorationSettings::fontChanged, this, &DecorationOptions::fontChanged);
disconnect(s.data(), &KDecoration2::DecorationSettings::decorationButtonsLeftChanged, this, &DecorationOptions::titleButtonsChanged);
......@@ -175,8 +175,8 @@ void DecorationOptions::setDecoration(KDecoration2::Decoration *decoration)
disconnect(m_paletteConnection);
}
m_decoration = decoration;
connect(m_decoration->client().data(), &KDecoration2::DecoratedClient::activeChanged, this, &DecorationOptions::slotActiveChanged);
m_paletteConnection = connect(m_decoration->client().data(), &KDecoration2::DecoratedClient::paletteChanged, this,
connect(m_decoration->client().toStrongRef().data(), &KDecoration2::DecoratedClient::activeChanged, this, &DecorationOptions::slotActiveChanged);
m_paletteConnection = connect(m_decoration->client().toStrongRef().data(), &KDecoration2::DecoratedClient::paletteChanged, this,
[this] (const QPalette &pal) {
m_colors.update(pal);
emit colorsChanged();
......@@ -194,10 +194,10 @@ void DecorationOptions::slotActiveChanged()
if (!m_decoration) {
return;
}
if (m_active == m_decoration->client().data()->isActive()) {
if (m_active == m_decoration->client().toStrongRef().data()->isActive()) {
return;
}
m_active = m_decoration->client().data()->isActive();
m_active = m_decoration->client().toStrongRef().data()->isActive();
emit colorsChanged();
emit fontChanged();
}
......
......@@ -880,7 +880,7 @@ void ScreenEdges::setActionForTouchBorder(ElectricBorder border, ElectricBorderA
void ScreenEdges::updateLayout()
{
const QSize desktopMatrix = VirtualDesktopManager::self()->grid().size();
Qt::Orientations newLayout = nullptr;
Qt::Orientations newLayout = {};
if (desktopMatrix.width() > 1) {
newLayout |= Qt::Horizontal;
}
......
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