diff --git a/CMakeLists.txt b/CMakeLists.txt index 76cce4d73..d6db04247 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,179 +1,179 @@ project(Kdenlive) # An odd patch version number means development version, while an even one means # stable release. An additional number can be used for bugfix-only releases. # KDE Application Version, managed by release script set(KDE_APPLICATIONS_VERSION_MAJOR "19") set(KDE_APPLICATIONS_VERSION_MINOR "04") set(KDE_APPLICATIONS_VERSION_MICRO "1") set(KDENLIVE_VERSION ${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}) cmake_minimum_required(VERSION 3.0) if(POLICY CMP0063) cmake_policy(SET CMP0063 NEW) endif() if(POLICY CMP0053) cmake_policy(SET CMP0053 NEW) endif() if(BUILD_FUZZING) set(CMAKE_CXX_FLAGS "${KDENLIVE_CXX_FLAGS} -fsanitize=fuzzer-no-link,address") endif() if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option") endif() # To be switched on when releasing. option(RELEASE_BUILD "Remove Git revision from program version" ON) option(BUILD_TESTING "Build tests" ON) option(BUILD_FUZZING "Build fuzzing target" OFF) # Minimum versions of main dependencies. set(MLT_MIN_MAJOR_VERSION 6) set(MLT_MIN_MINOR_VERSION 12) set(MLT_MIN_PATCH_VERSION 0) set(MLT_MIN_VERSION ${MLT_MIN_MAJOR_VERSION}.${MLT_MIN_MINOR_VERSION}.${MLT_MIN_PATCH_VERSION}) # KDE Frameworks find_package(ECM 5.18.0 REQUIRED CONFIG) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules) include(KDECompilerSettings NO_POLICY_SCOPE) include(FeatureSummary) include(ECMInstallIcons) include(GenerateExportHeader) include(KDEInstallDirs) include(KDECMakeSettings) include(ECMOptionalAddSubdirectory) include(ECMMarkNonGuiExecutable) include(ECMAddAppIcon) include(ECMQtDeclareLoggingCategory) include(ECMEnableSanitizers) add_definitions(-DTRANSLATION_DOMAIN=\"kdenlive\") -find_package(KF5 5.45.0 REQUIRED COMPONENTS Archive Bookmarks CoreAddons Config ConfigWidgets +find_package(KF5 REQUIRED COMPONENTS Archive Bookmarks CoreAddons Config ConfigWidgets DBusAddons KIO WidgetsAddons NotifyConfig NewStuff XmlGui Notifications GuiAddons TextWidgets IconThemes Declarative Solid OPTIONAL_COMPONENTS DocTools FileMetaData Crash Purpose) # Qt set(QT_MIN_VERSION 5.7.0) find_package(Qt5 REQUIRED COMPONENTS Core DBus Widgets Svg Quick Concurrent QuickWidgets Multimedia) find_package(Qt5 OPTIONAL_COMPONENTS WebKitWidgets QUIET) add_definitions(-DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING) set(DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") # MLT find_package(MLT ${MLT_MIN_VERSION} REQUIRED) set_package_properties(MLT PROPERTIES DESCRIPTION "Multimedia framework" URL "https://mltframework.org" PURPOSE "Required to do video processing") message(STATUS "Found MLT++: ${MLTPP_LIBRARIES}") # Windows include(CheckIncludeFiles) check_include_files(malloc.h HAVE_MALLOC_H) check_include_files(pthread.h HAVE_PTHREAD_H) if(WIN32) find_package(DrMinGW) set(MLT_PREFIX "..") else() set(MLT_PREFIX ${MLT_ROOT_DIR}) endif() # Optional deps status find_package(KF5 5.23.0 OPTIONAL_COMPONENTS XmlGui QUIET) if(KF5XmlGui_FOUND) message(STATUS "Found KF5 >= 5.23.0 enabling icon coloring") else() message(STATUS "KF5 < 5.23.0 Disable icon coloring") set(KF5_ICON_COMPATIBILITY TRUE) endif() if(KF5FileMetaData_FOUND) message(STATUS "Found KF5 FileMetadata to extract file metadata") set(KF5_FILEMETADATA TRUE) else() message(STATUS "KF5 FileMetadata not found, file metadata will not be available") endif() if(KF5Purpose_FOUND) message(STATUS "Found KF5 Purpose, filesharing enabled") set(KF5_PURPOSE TRUE) else() message(STATUS "KF5 Purpose not found, filesharing disabled") endif() if(KF5DocTools_FOUND) add_subdirectory(doc) kdoctools_install(po) endif() # Get current version. set(KDENLIVE_VERSION_STRING "${KDENLIVE_VERSION}") if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_SOURCE_DIR}/.git) # Probably a Git workspace; determine the revision. find_package(Git QUIET) if(GIT_FOUND) exec_program(${GIT_EXECUTABLE} ${CMAKE_SOURCE_DIR} ARGS "log -n 1 --pretty=format:\"%h\"" OUTPUT_VARIABLE KDENLIVE_GIT_REVISION) message(STATUS "Kdenlive Git revision: ${KDENLIVE_GIT_REVISION}") set(KDENLIVE_VERSION_STRING "${KDENLIVE_VERSION} (rev. ${KDENLIVE_GIT_REVISION})") else() message(STATUS "Kdenlive Git revision could not be determined") endif() endif() find_package(RTTR 0.9.6 QUIET) if(NOT RTTR_FOUND) message(STATUS "RTTR not found on system, will download source and build it") include(rttr.CMakeLists.txt) endif() feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) set(FFMPEG_SUFFIX "" CACHE STRING "FFmpeg custom suffix") configure_file(config-kdenlive.h.cmake config-kdenlive.h @ONLY) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wno-suggest-override") # Sources add_subdirectory(src) add_subdirectory(renderer) add_subdirectory(thumbnailer) add_subdirectory(data) ki18n_install(po) include(GNUInstallDirs) install(FILES AUTHORS COPYING README.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) install(FILES kdenlive.categories DESTINATION ${KDE_INSTALL_CONFDIR}) ############################ # Tests ############################ if(BUILD_TESTING) message(STATUS "Building tests") add_subdirectory(tests) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexceptions") include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/src ${MLT_INCLUDE_DIR} ${MLTPP_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib/external ${CMAKE_CURRENT_SOURCE_DIR}/lib src) add_executable(runTests ${Tests_SRCS}) set_property(TARGET runTests PROPERTY CXX_STANDARD 14) target_link_libraries(runTests kdenliveLib) add_test(runTests runTests -d yes) endif() if(BUILD_FUZZING) message(STATUS "Building fuzzing") set(CMAKE_CXX_COMPILER /usr/bin/clang++) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDENLIVE_CXX_FLAGS} -fsanitize=fuzzer-no-link,address") add_subdirectory(fuzzer) endif() diff --git a/src/dialogs/splash.cpp b/src/dialogs/splash.cpp index 29fd92c89..d96685912 100644 --- a/src/dialogs/splash.cpp +++ b/src/dialogs/splash.cpp @@ -1,73 +1,77 @@ /*************************************************************************** * Copyright (C) 2017 by Nicolas Carion * * This file is part of Kdenlive. See www.kdenlive.org. * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) version 3 or any later version accepted by the * * membership of KDE e.V. (or its successor approved by the membership * * of KDE e.V.), which shall act as a proxy defined in Section 14 of * * version 3 of the license. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ #include "splash.hpp" #include #include #include #include #include Splash::Splash(QObject *parent) : QObject(parent) , m_engine(new QQmlEngine()) , childItem(nullptr) { KDeclarative::KDeclarative kdeclarative; kdeclarative.setDeclarativeEngine(m_engine); +#if KDECLARATIVE_VERSION >= QT_VERSION_CHECK(5, 45, 0) kdeclarative.setupEngine(m_engine); kdeclarative.setupContext(); +#else + kdeclarative.setupBindings(); +#endif component = new QQmlComponent(m_engine); QQuickWindow::setDefaultAlphaBuffer(true); component->loadUrl(QUrl(QStringLiteral("qrc:/qml/splash.qml"))); if (component->isLoading()) QObject::connect(component, SIGNAL(statusChanged(QQmlComponent::Status)), this, SLOT(continueLoading())); else { continueLoading(); } } void Splash::continueLoading() { if (component->isReady()) { childItem = qobject_cast(component->create()); } else { qWarning() << component->errorString(); } } Splash::~Splash() { delete childItem; delete component; delete m_engine; } void Splash::endSplash() { if (childItem) { QMetaObject::invokeMethod(childItem, "endSplash"); } else { qDebug()<<"** ERROR NO SPLASH COMPO"; } emit sigEndSplash(); } diff --git a/src/effects/effectstack/view/builtstack.cpp b/src/effects/effectstack/view/builtstack.cpp index f2fe841f7..e7dd16fa5 100644 --- a/src/effects/effectstack/view/builtstack.cpp +++ b/src/effects/effectstack/view/builtstack.cpp @@ -1,64 +1,68 @@ /*************************************************************************** * Copyright (C) 2017 by Jean-Baptiste Mardelle (jb@kdenlive.org) * * This file is part of Kdenlive. See www.kdenlive.org. * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) version 3 or any later version accepted by the * * membership of KDE e.V. (or its successor approved by the membership * * of KDE e.V.), which shall act as a proxy defined in Section 14 of * * version 3 of the license. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ #include "builtstack.hpp" #include "assets/assetpanel.hpp" #include "core.h" #include "effects/effectstack/model/effectstackmodel.hpp" //#include "qml/colorwheelitem.h" #include #include #include BuiltStack::BuiltStack(AssetPanel *parent) : QQuickWidget(parent) , m_model(nullptr) { KDeclarative::KDeclarative kdeclarative; QQmlEngine *eng = engine(); kdeclarative.setDeclarativeEngine(eng); - kdeclarative.setupContext(); +#if KDECLARATIVE_VERSION >= QT_VERSION_CHECK(5, 45, 0) kdeclarative.setupEngine(eng); + kdeclarative.setupContext(); +#else + kdeclarative.setupBindings(); +#endif // qmlRegisterType("Kdenlive.Controls", 1, 0, "ColorWheelItem"); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); setMinimumHeight(300); // setClearColor(palette().base().color()); // setSource(QUrl(QStringLiteral("qrc:/qml/BuiltStack.qml"))); setFocusPolicy(Qt::StrongFocus); QQuickItem *root = rootObject(); QObject::connect(root, SIGNAL(valueChanged(QString, int)), parent, SLOT(parameterChanged(QString, int))); setResizeMode(QQuickWidget::SizeRootObjectToView); } BuiltStack::~BuiltStack() = default; void BuiltStack::setModel(const std::shared_ptr &model, ObjectId ownerId) { m_model = model; if (ownerId.first == ObjectType::TimelineClip) { QVariant current_speed((int)(100.0 * pCore->getClipSpeed(ownerId.second))); qDebug() << " CLIP SPEED OFR: " << ownerId.second << " = " << current_speed; QMetaObject::invokeMethod(rootObject(), "setSpeed", Qt::QueuedConnection, Q_ARG(QVariant, current_speed)); } rootContext()->setContextProperty("effectstackmodel", model.get()); QMetaObject::invokeMethod(rootObject(), "resetStack", Qt::QueuedConnection); }