diff --git a/CMakeLists.txt b/CMakeLists.txt index e4f612e..3c40aed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,8 @@ set(HBNSC_LICENSES "" CACHE PATH "Semicolon separated list of licenses to includ option(HBNSC_WITH_OPENSSL "Adds the OpenSSL license information to the licenses model. Requires openssl header files." ON) option(HBNSC_WITH_NEMONOTIFY "Adds the Nemo Notify lib license information to the licenses model." OFF) -option(HBNSC_WITH_SQLITE "Adds the SQLite license information to the licenses model. Requires the sqlite header files." OFF) +option(HBNSC_WITH_FIRFUORIDA "Add libfirfuorida lincense information to the licenses model." OFF) +option(HBNSC_WITH_SQLITE "Adds the SQLite license information to the licenses model. Requires the sqlite header files." ${HBNSC_WITH_FIRFUORIDA}) option(HBNSC_WITH_DBUS "Adds hhe DBus license information to the licenses model. Requires the dbus header files." OFF) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/hbnSfosComponents-config.cmake.in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 718aec1..7efbae5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -46,10 +46,12 @@ target_link_libraries(HbnSfosComponentsQt${QT_VERSION_MAJOR} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick + PRIVATE $<$:OpenSSL::SSL> $<$:PkgConfig::NemoNotify> $<$:SQLite::SQLite3> $<$:PkgConfig::DBus> + $<$:FirfuoridaQt${QT_VERSION_MAJOR}::Core> PkgConfig::Sailfish PkgConfig::Silica ) @@ -71,6 +73,7 @@ target_compile_definitions(HbnSfosComponentsQt${QT_VERSION_MAJOR} $<$:HBNSC_WITH_NEMONOTIFY> $<$:HBNSC_WITH_SQLITE> $<$:HBNSC_WITH_DBUS> + $<$:HBNSC_WITH_FIRFUORIDA> ) if(ENABLE_MAINTAINER_FLAGS) diff --git a/src/hbnsclicensemodel.cpp b/src/hbnsclicensemodel.cpp index e538f94..6238581 100644 --- a/src/hbnsclicensemodel.cpp +++ b/src/hbnsclicensemodel.cpp @@ -41,6 +41,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifdef HBNSC_WITH_DBUS #include #endif +#ifdef HBNSC_WITH_FIRFUORIDA +#include +#endif using namespace Hbnsc; @@ -203,6 +206,22 @@ LicenseModel::LicenseModel(QObject *parent) : QAbstractListModel(parent) QUrl() ); #endif + +#ifdef HBNSC_WITH_FIRFUORIDA + m_items.emplace_back( + QStringLiteral("libFirfuorida"), + QStringLiteral("Matthias Fehring"), + Firfuorida::version().toString(), + QUrl(QStringLiteral("https://github.com/Huessenbergnetz/libfirfuorida")), + //: Description for the libFirfuorida in the list of used 3rd party components. + //% "libFirfuorida is a Qt based library to perform database migrations." + qtTrId("hbnsc-components-firfuorida-desc"), + QStringLiteral("GNU Lesser General Public License, Version 3"), + QStringLiteral("LGPLv3.qml"), + QUrl(QStringLiteral("https://github.com/Huessenbergnetz/libfirfuorida/blob/master/LICENSE")), + QUrl() + ); +#endif } LicenseModel::~LicenseModel() diff --git a/src/hbnsclicensemodel.h b/src/hbnsclicensemodel.h index 25e5d15..15f4960 100644 --- a/src/hbnsclicensemodel.h +++ b/src/hbnsclicensemodel.h @@ -47,6 +47,9 @@ namespace Hbnsc { class HBNSC_EXPORT LicenseModel : public QAbstractListModel { Q_OBJECT + Q_DISABLE_COPY(LicenseModel) + LicenseModel(LicenseModel &&other) = delete; + LicenseModel &operator=(LicenseModel &&other) = delete; public: explicit LicenseModel(QObject *parent = nullptr); ~LicenseModel() override; @@ -68,10 +71,6 @@ class HBNSC_EXPORT LicenseModel : public QAbstractListModel QHash roleNames() const final; QVariant data(const QModelIndex &index, int role = Qt::UserRole) const final; - Q_DISABLE_COPY(LicenseModel) - LicenseModel(LicenseModel &&other) = delete; - LicenseModel &operator=(LicenseModel &&other) = delete; - protected: void add(const QString &name, const QString &author, const QString &version, const QUrl &website, const QString &description, const QString &license, const QString &licenseFile, const QUrl &licenseWebsite, const QUrl &customLicenseFile); void sortLicenses();