Commit 464203c6 authored by Méven Car's avatar Méven Car Committed by Méven Car
Browse files

Clean #if version check blocks

Since 08a21ae7 we now depend on Qt 5.14
parent c54d069d
......@@ -41,17 +41,10 @@ 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
}
}
......
......@@ -68,15 +68,9 @@ KCMKWinDecoration::KCMKWinDecoration(QObject *parent, const QVariantList &argume
QStringLiteral("vpilo@coldshock.net"));
setAboutData(about);
setButtons(Apply | Default | Help);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
qmlRegisterType<QAbstractListModel>();
qmlRegisterType<QSortFilterProxyModel>();
qmlRegisterType<KWinDecorationSettings>();
#else
qmlRegisterAnonymousType<QAbstractListModel>("org.kde.kwin.KWinDecoration", 1);
qmlRegisterAnonymousType<QSortFilterProxyModel>("org.kde.kwin.KWinDecoration", 1);
qmlRegisterAnonymousType<KWinDecorationSettings>("org.kde.kwin.KWinDecoration", 1);
#endif
m_proxyThemesModel->setSourceModel(m_themesModel);
m_proxyThemesModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
m_proxyThemesModel->setSortCaseSensitivity(Qt::CaseInsensitive);
......
......@@ -88,11 +88,7 @@ void Integration::initialize()
);
QPlatformIntegration::initialize();
auto dummyScreen = new Screen(-1);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
QWindowSystemInterface::handleScreenAdded(dummyScreen);
#else
screenAdded(dummyScreen);
#endif
m_screens << dummyScreen;
m_inputContext.reset(QPlatformInputContextFactory::create(QStringLiteral("qtvirtualkeyboard")));
qunsetenv("QT_IM_MODULE");
......@@ -182,28 +178,16 @@ void Integration::initScreens()
newScreens.reserve(qMax(screens()->count(), 1));
for (int i = 0; i < screens()->count(); i++) {
auto screen = new Screen(i);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
QWindowSystemInterface::handleScreenAdded(screen);
#else
screenAdded(screen);
#endif
newScreens << screen;
}
if (newScreens.isEmpty()) {
auto dummyScreen = new Screen(-1);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
QWindowSystemInterface::handleScreenAdded(dummyScreen);
#else
screenAdded(dummyScreen);
#endif
newScreens << dummyScreen;
}
while (!m_screens.isEmpty()) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
QWindowSystemInterface::handleScreenRemoved(m_screens.takeLast());
#else
destroyScreen(m_screens.takeLast());
#endif
}
m_screens = newScreens;
}
......
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