Commit 0a33db39 authored by Julius Künzel's avatar Julius Künzel 💬
Browse files

Dependency change! Require at least KDE Frameworks 5.92

So far we required at least 5.86 to support Ubuntu 21.10 ("Impish"),
since this reached end of life on July 14, we can require 5.92 now,
which is the version available on Ubuntu 22.04 LTS ("Jammy")
parent 7e534c71
Pipeline #252129 canceled with stage
in 1 minute and 30 seconds
......@@ -41,7 +41,7 @@ set(MLT_MIN_PATCH_VERSION 0)
set(MLT_MIN_VERSION ${MLT_MIN_MAJOR_VERSION}.${MLT_MIN_MINOR_VERSION}.${MLT_MIN_PATCH_VERSION})
# KDE Frameworks
set(KF_DEP_VERSION "5.86.0")
set(KF_DEP_VERSION "5.92.0")
find_package(ECM ${KF_DEP_VERSION} REQUIRED CONFIG)
set(KDE_COMPILERSETTINGS_LEVEL 5.80)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)
......@@ -57,12 +57,8 @@ include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
include(ECMEnableSanitizers)
include(ECMAddQch)
if (ECM_VERSION VERSION_GREATER_EQUAL "5.89.0")
include(QtVersionOption)
endif()
if (ECM_VERSION VERSION_GREATER_EQUAL "5.91.0")
include(ECMDeprecationSettings)
endif()
include(QtVersionOption)
include(ECMDeprecationSettings)
add_definitions(-DTRANSLATION_DOMAIN=\"kdenlive\")
find_package(KF5 ${KF_DEP_VERSION}
......@@ -102,12 +98,10 @@ if (QT_MAJOR_VERSION STREQUAL "6")
set(USE_VERSIONLESS_TARGETS ON)
endif()
if (ECM_VERSION VERSION_GREATER_EQUAL "5.91.0")
ecm_set_disabled_deprecation_versions(
QT ${QT_MIN_VERSION}
KF ${KF_DEP_VERSION}
)
endif()
ecm_set_disabled_deprecation_versions(
QT ${QT_MIN_VERSION}
KF ${KF_DEP_VERSION}
)
find_package(Qt${QT_MAJOR_VERSION}
REQUIRED COMPONENTS
......
......@@ -37,11 +37,7 @@ install(FILES
DESTINATION ${KDE_INSTALL_DATADIR}${DATA_INSTALL_PREFIX})
if (ECM_VERSION VERSION_GREATER_EQUAL "5.89.0")
install(FILES kdenlive.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
else()
install(FILES kdenlive.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR})
endif()
install(FILES kdenlive.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
install(FILES profiles.xml DESTINATION ${KDE_INSTALL_DATADIR}${DATA_INSTALL_PREFIX}/export)
install(FILES org.kde.kdenlive.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES org.kde.kdenlive.desktop DESTINATION ${KDE_INSTALL_APPDIR})
......
......@@ -32,9 +32,7 @@ UrlListParamWidget::UrlListParamWidget(std::shared_ptr<AssetParameterModel> mode
setMinimumHeight(m_list->sizeHint().height());
// setup download
if (!configFile.isEmpty()) {
#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 91, 0)
// TODO: ones we require at least KF 5.91 move this to the *.ui file
m_knsbutton = new KNSWidgets::Button(QString(), configFile, this);
m_knsbutton->setConfigFile(configFile);
connect(m_knsbutton, &KNSWidgets::Button::dialogFinished, this, [&](const QList<KNSCore::Entry> &changedEntries) {
if (changedEntries.count() > 0) {
if (configFile.contains(QStringLiteral("kdenlive_wipes.knsrc"))) {
......@@ -43,12 +41,8 @@ UrlListParamWidget::UrlListParamWidget(std::shared_ptr<AssetParameterModel> mode
slotRefresh();
}
});
#else
m_knsbutton = new QToolButton(this);
m_knsbutton->setIcon(QIcon::fromTheme(QStringLiteral("edit-download"));
connect(m_knsbutton, &QToolButton::clicked, this, &UrlListParamWidget::downloadNewItems);
#endif
m_value_box->layout()->addWidget(m_knsbutton);
} else {
m_knsbutton->hide();
}
// setup the name
m_labelName->setText(m_model->data(m_index, Qt::DisplayRole).toString());
......@@ -267,20 +261,3 @@ void UrlListParamWidget::openFile()
}
m_list->setCurrentIndex(m_currentIndex);
}
#if KNEWSTUFF_VERSION < QT_VERSION_CHECK(5, 91, 0)
void UrlListParamWidget::downloadNewItems()
{
const QString configFile = m_model->data(m_index, AssetParameterModel::NewStuffRole).toString();
if (configFile.isEmpty()) {
return;
}
if (pCore->getNewStuff(configFile) > 0) {
if (configFile.contains(QStringLiteral("kdenlive_wipes.knsrc"))) {
MltConnection::refreshLumas();
}
slotRefresh();
}
}
#endif
......@@ -10,9 +10,7 @@
#include <QVariant>
#include <QWidget>
#include <knewstuff_version.h>
#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 91, 0)
#include <KNSWidgets/Button>
#endif
class AssetParameterModel;
......@@ -66,11 +64,7 @@ private:
int m_currentIndex;
bool m_isLutList;
bool m_isLumaList;
#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 91, 0)
KNSWidgets::Button *m_knsbutton;
#else
QToolButton *m_knsbutton;
#endif
/** @brief Reads the first 30 lines of a .cube LUT file and check for validity
*/
bool isValidCubeFile(const QString &path);
......@@ -87,10 +81,4 @@ public slots:
/** @brief Open fileopen dialog
*/
void openFile();
#if KNEWSTUFF_VERSION < QT_VERSION_CHECK(5, 91, 0)
/** @brief Open KNewStuff dialog to download new LUTs
*/
void downloadNewItems();
#endif
};
......@@ -154,6 +154,7 @@ RenderWidget::RenderWidget(bool enableProxy, QWidget *parent)
m_view.buttonEdit->setIconSize(iconSize);
m_view.buttonNew->setIconSize(iconSize);
m_view.buttonSaveAs->setIconSize(iconSize);
m_view.m_knsbutton->setIconSize(iconSize);
m_view.buttonRender->setEnabled(false);
m_view.buttonGenerateScript->setEnabled(false);
......@@ -174,28 +175,12 @@ RenderWidget::RenderWidget(bool enableProxy, QWidget *parent)
refreshView();
});
connect(m_view.buttonSaveAs, &QAbstractButton::clicked, this, &RenderWidget::slotSavePresetAs);
#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 91, 0)
// TODO: ones we require at least KF 5.91 move this to the *.ui file
m_knsbutton = new KNSWidgets::Button(QString(), QStringLiteral(":data/kdenlive_renderprofiles.knsrc"), this);
m_knsbutton->setFlat(true);
connect(m_knsbutton, &KNSWidgets::Button::dialogFinished, this, [&](const QList<KNSCore::Entry> &changedEntries) {
connect(m_view.m_knsbutton, &KNSWidgets::Button::dialogFinished, this, [&](const QList<KNSCore::Entry> &changedEntries) {
if (changedEntries.count() > 0) {
parseProfiles();
}
});
#else
m_knsbutton = new QToolButton(this);
m_knsbutton->setIcon(QIcon::fromTheme(QStringLiteral("edit-download"));
m_knsbutton->setAutoRaise(true);
connect(m_view.buttonDownload, &QAbstractButton::clicked, this, [&]() {
if (pCore->getNewStuff(QStringLiteral(":data/kdenlive_renderprofiles.knsrc")) > 0) {
parseProfiles();
}
});
#endif
m_knsbutton->setIconSize(iconSize);
m_knsbutton->setToolTip(i18n("Download New Render Presets…"));
m_view.downloadButtonBox->addWidget(m_knsbutton);
m_view.optionsGroup->setVisible(m_view.options->isChecked());
m_view.optionsGroup->setMinimumWidth(m_view.optionsGroup->width() + m_view.optionsGroup->verticalScrollBar()->width());
......
......@@ -21,9 +21,7 @@ class Menu;
#include "renderpresets/tree/renderpresettreemodel.hpp"
#include "ui_renderwidget_ui.h"
#include <knewstuff_version.h>
#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 91, 0)
#include <KNSWidgets/Button>
#endif
class QDomElement;
class QKeyEvent;
......@@ -215,11 +213,6 @@ private:
QString m_renderer;
QMap<int, QString> m_errorMessages;
std::weak_ptr<MarkerListModel> m_guidesModel;
#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 91, 0)
KNSWidgets::Button *m_knsbutton;
#else
QToolButton *m_knsbutton;
#endif
std::shared_ptr<RenderPresetTreeModel> m_treeModel;
QString m_currentProfile;
......
......@@ -252,10 +252,6 @@ int main(int argc, char *argv[])
aboutData.setTranslator(i18n("NAME OF TRANSLATORS"), i18n("EMAIL OF TRANSLATORS"));
aboutData.setOrganizationDomain(QByteArray("kde.org"));
#if KXMLGUI_VERSION < QT_VERSION_CHECK(5, 87, 0)
aboutData.setOtherText(
i18n("Using:\n<a href=\"https://mltframework.org\">MLT</a> version %1\n<a href=\"https://ffmpeg.org\">FFmpeg</a> libraries", mlt_version_get_string()));
#endif
aboutData.addComponent(i18n("MLT"), i18n("Open source multimedia framework."), mlt_version_get_string(),
QStringLiteral("https://mltframework.org") /*, KAboutLicense::LGPL_V2_1*/);
......
......@@ -4008,39 +4008,6 @@ void MainWindow::slotToggleAutoPreview(bool enable)
}
}
#if KXMLGUI_VERSION < QT_VERSION_CHECK(5, 91, 0)
void MainWindow::configureToolbars()
{
// Since our timeline toolbar is a non-standard toolbar (as it is docked in a custom widget, not
// in a QToolBarDockArea, we have to hack KXmlGuiWindow to avoid a crash when saving toolbar config.
// This is why we hijack the configureToolbars() and temporarily move the toolbar to a standard location
// Fixed upstream since KF 5.91.0
auto *ctnLay = static_cast<QVBoxLayout *>(m_timelineToolBarContainer->layout());
ctnLay->removeWidget(m_timelineToolBar);
addToolBar(Qt::BottomToolBarArea, m_timelineToolBar);
auto *toolBarEditor = new KEditToolBar(guiFactory(), this);
toolBarEditor->setAttribute(Qt::WA_DeleteOnClose);
connect(toolBarEditor, &KEditToolBar::newToolBarConfig, this, &MainWindow::saveNewToolbarConfig);
connect(toolBarEditor, &QDialog::finished, this, &MainWindow::rebuildTimlineToolBar);
toolBarEditor->show();
}
void MainWindow::rebuildTimlineToolBar()
{
// Timeline toolbar settings changed, we can now re-add our toolbar to custom location
m_timelineToolBar = toolBar(QStringLiteral("timelineToolBar"));
removeToolBar(m_timelineToolBar);
m_timelineToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
auto *ctnLay = static_cast<QVBoxLayout *>(m_timelineToolBarContainer->layout());
if (ctnLay) {
ctnLay->insertWidget(0, m_timelineToolBar);
}
m_timelineToolBar->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_timelineToolBar, &QWidget::customContextMenuRequested, this, &MainWindow::showTimelineToolbarMenu);
m_timelineToolBar->setVisible(true);
}
#endif
void MainWindow::showTimelineToolbarMenu(const QPoint &pos)
{
QMenu menu;
......
......@@ -327,9 +327,6 @@ public slots:
void connectDocument();
/** @brief Reload project profile in config dialog if changed. */
void slotRefreshProfiles();
#if KXMLGUI_VERSION < QT_VERSION_CHECK(5,91,0)
void configureToolbars() override;
#endif
/** @brief Decreases the timeline zoom level by 1. */
void slotZoomIn(bool zoomOnMouse = false);
/** @brief Increases the timeline zoom level by 1. */
......@@ -532,10 +529,6 @@ private slots:
void slotCheckTabPosition();
/** @brief Toggle automatic timeline preview on/off */
void slotToggleAutoPreview(bool enable);
#if KXMLGUI_VERSION < QT_VERSION_CHECK(5,91,0)
/** @brief Rebuild/reload timeline toolbar. */
void rebuildTimlineToolBar();
#endif
void showTimelineToolbarMenu(const QPoint &pos);
/** @brief Open Cached Data management dialog. */
void slotManageCache();
......
......@@ -411,13 +411,6 @@ TitleWidget::TitleWidget(const QUrl &url, QString projectTitlePath, Monitor *mon
m_buttonSave->setToolTip(i18n("Save As") + QLatin1Char(' ') + m_buttonSave->shortcut().toString());
connect(m_buttonSave, SIGNAL(triggered()), this, SLOT(saveTitle()));
#if KNEWSTUFF_VERSION < QT_VERSION_CHECK(5, 90, 0)
m_buttonDownload = m_toolbar->addAction(QIcon::fromTheme(QStringLiteral("edit-download")), i18n("Download New Title Templates..."));
m_buttonDownload->setCheckable(false);
m_buttonDownload->setShortcut(Qt::ALT | Qt::Key_D);
m_buttonDownload->setToolTip(i18n("Download New Title Templates...") + QLatin1Char(' ') + m_buttonDownload->shortcut().toString());
connect(m_buttonDownload, &QAction::triggered, this, &TitleWidget::downloadTitleTemplates);
#else
m_buttonDownload = new KNSWidgets::Action(i18n("Download New Title Templates..."), QStringLiteral(":data/kdenlive_titles.knsrc"), this);
m_buttonDownload->setShortcut(Qt::ALT | Qt::Key_D);
m_buttonDownload->setToolTip(i18n("Download New Title Templates...") + QLatin1Char(' ') + m_buttonDownload->shortcut().toString());
......@@ -432,7 +425,6 @@ TitleWidget::TitleWidget(const QUrl &url, QString projectTitlePath, Monitor *mon
refreshTemplateBoxContents();
}
});
#endif
layout->addWidget(m_toolbar);
......@@ -2207,16 +2199,6 @@ QUrl TitleWidget::saveTitle(QUrl url)
return QUrl();
}
#if KNEWSTUFF_VERSION < QT_VERSION_CHECK(5, 90, 0)
void TitleWidget::downloadTitleTemplates()
{
if (pCore->getNewStuff(QStringLiteral(":data/kdenlive_titles.knsrc")) > 0) {
refreshTitleTemplates(m_projectTitlePath);
refreshTemplateBoxContents();
}
}
#endif
QDomDocument TitleWidget::xml()
{
QDomDocument doc = m_titledocument.xml(m_startViewport, m_endViewport);
......
......@@ -20,9 +20,7 @@
#include "ui_titlewidget_ui.h"
#include <knewstuff_version.h>
#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 90, 0)
#include <KNSWidgets/Action>
#endif
#include <QMap>
#include <QModelIndex>
#include <QSignalMapper>
......@@ -139,11 +137,7 @@ private:
QAction *m_buttonCursor;
QAction *m_buttonSave;
QAction *m_buttonLoad;
#if KNEWSTUFF_VERSION < QT_VERSION_CHECK(5, 90, 0)
QAction *m_buttonDownload;
#else
KNSWidgets::Action *m_buttonDownload;
#endif
QAction *m_unicodeAction;
QAction *m_zUp;
......@@ -238,11 +232,6 @@ private:
void loadGradients();
void storeGradient(const QString &gradientData);
#if KNEWSTUFF_VERSION < QT_VERSION_CHECK(5, 90, 0)
/** @brief Open title download dialog */
void downloadTitleTemplates();
#endif
/** @brief Read patterns from config file
*/
void readPatterns();
......
......@@ -227,11 +227,20 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="downloadButtonBox">
<property name="spacing">
<number>0</number>
<widget class="KNSWidgets::Button" name="m_knsbutton">
<property name="toolTip">
<string>Download New Render Presets…</string>
</property>
<property name="text">
<string/>
</property>
<property name="flat">
<bool>true</bool>
</property>
</layout>
<property name="configFile">
<string>:data/kdenlive_renderprofiles.knsrc</string>
</property>
</widget>
</item>
<item>
<widget class="KSeparator" name="kseparator">
......@@ -1095,6 +1104,11 @@
<header>kurlrequester.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KNSWidgets::Button</class>
<extends>QPushButton</extends>
<header>KNSWidgets/Button</header>
</customwidget>
<customwidget>
<class>KMessageWidget</class>
<extends>QFrame</extends>
......
......@@ -113,11 +113,25 @@
</property>
</widget>
</item>
<item>
<widget class="KNSWidgets::Button" name="m_knsbutton">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KNSWidgets::Button</class>
<extends>QPushButton</extends>
<header>KNSWidgets/Button</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -24,9 +24,7 @@
ThemeManager::ThemeManager(QObject *parent)
: KColorSchemeManager(parent)
{
#if KCONFIGWIDGETS_VERSION >= QT_VERSION_CHECK(5, 89, 0)
setAutosaveChanges(false);
#endif
const auto schemePath(loadCurrentPath());
// KColorSchemeManager includes a system color scheme option that reacts to system scheme changes.
......
......@@ -18,8 +18,4 @@ target_link_libraries(mltpreview
)
#FIXME: For some reason the plugin only seems to work if installed in $lib/qt5/plugins and not in $lib/plugins like KF5 recommends
install(TARGETS mltpreview DESTINATION ${KDE_INSTALL_PLUGINDIR})
if (ECM_VERSION VERSION_GREATER_EQUAL "5.89.0")
install(FILES mltpreview.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR})
else()
install(FILES mltpreview.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
endif()
install(FILES mltpreview.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR})
Supports Markdown
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