Skip to content

Commit

Permalink
Add libfirfuorida to the list of inlcuded 3rd party apps/libs
Browse files Browse the repository at this point in the history
  • Loading branch information
buschmann23 committed Jan 27, 2022
1 parent 3e687d6 commit d07fe56
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ target_link_libraries(HbnSfosComponentsQt${QT_VERSION_MAJOR}
PUBLIC
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Quick
PRIVATE
$<$<BOOL:${HBNSC_WITH_OPENSSL}>:OpenSSL::SSL>
$<$<BOOL:${HBNSC_WITH_NEMONOTIFY}>:PkgConfig::NemoNotify>
$<$<BOOL:${HBNSC_WITH_SQLITE}>:SQLite::SQLite3>
$<$<BOOL:${HBNSC_WITH_DBUS}>:PkgConfig::DBus>
$<$<BOOL:${HBNSC_WITH_FIRFUORIDA}>:FirfuoridaQt${QT_VERSION_MAJOR}::Core>
PkgConfig::Sailfish
PkgConfig::Silica
)
Expand All @@ -71,6 +73,7 @@ target_compile_definitions(HbnSfosComponentsQt${QT_VERSION_MAJOR}
$<$<BOOL:${HBNSC_WITH_NEMONOTIFY}>:HBNSC_WITH_NEMONOTIFY>
$<$<BOOL:${HBNSC_WITH_SQLITE}>:HBNSC_WITH_SQLITE>
$<$<BOOL:${HBNSC_WITH_DBUS}>:HBNSC_WITH_DBUS>
$<$<BOOL:${HBNSC_WITH_FIRFUORIDA}>:HBNSC_WITH_FIRFUORIDA>
)

if(ENABLE_MAINTAINER_FLAGS)
Expand Down
19 changes: 19 additions & 0 deletions src/hbnsclicensemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HBNSC_WITH_DBUS
#include <dbus/dbus.h>
#endif
#ifdef HBNSC_WITH_FIRFUORIDA
#include <Firfuorida/Migrator>
#endif

using namespace Hbnsc;

Expand Down Expand Up @@ -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()
Expand Down
7 changes: 3 additions & 4 deletions src/hbnsclicensemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -68,10 +71,6 @@ class HBNSC_EXPORT LicenseModel : public QAbstractListModel
QHash<int, QByteArray> 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();
Expand Down

0 comments on commit d07fe56

Please sign in to comment.