1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-11-22 09:15:18 +00:00

Propagate version number from yaml to QML

* The application now will use the version number from the Spectacle
  yaml in HTTP-requests and display it in the about page as well.
This commit is contained in:
Chris Josten 2020-09-27 22:41:35 +02:00
parent 419e97a882
commit 4a9be69c07
5 changed files with 27 additions and 6 deletions

View file

@ -17,7 +17,12 @@ QT += multimedia
CONFIG += sailfishapp c++11
# Help, something keeps eating my quotes and backslashes
DEFINES += "SAILFIN_VERSION=\"\\\"0.1.0\\\"\""
!defined(SAILFIN_VERSION, var) {
SAILFIN_VERSION = "(UNKNOWN VERSION)"
}
DEFINES += "SAILFIN_VERSION=\"\\\"$$SAILFIN_VERSION\\\"\""
SOURCES += \
src/credentialmanager.cpp \

View file

@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
import QtQuick 2.6
import Sailfish.Silica 1.0
import nl.netsoj.chris.Jellyfin 1.0
import "../components"
Page {
@ -49,10 +51,11 @@ Page {
anchors.leftMargin: Theme.horizontalPageMargin
anchors.rightMargin: Theme.horizontalPageMargin
wrapMode: Text.WordWrap
text: "<p><b>Sailfin version 0.1.0</b><br/>" +
text: qsTr("<p><b>Sailfin version %1</b><br/>" +
"Copyright © Chris Josten 2020</p>" +
"<p>Sailfin is Free Software licensed under the <a href='lgpl'>LGPL-v2.1</a> or later, at your choice. " +
"Parts of the code of Sailfin are from other libraries. <a href='3rdparty'>View their licenses here</a>.</p>"
"Parts of the code of Sailfin are from other libraries. <a href='3rdparty'>View their licenses here</a>.</p>")
.arg(ApiClient.version)
textFormat: Text.StyledText
color: Theme.secondaryHighlightColor
linkColor: Theme.primaryColor

View file

@ -1,6 +1,6 @@
Name: harbour-sailfin
Summary: Sailfin
Version: 0.1
Version: &version 0.1.0
Release: 1
# The contents of the Group field should be one of the groups listed here:
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
@ -38,5 +38,8 @@ Files:
- '%{_datadir}/applications/%{name}.desktop'
- '%{_datadir}/icons/hicolor/*/apps/%{name}.png'
QMakeOptions:
- SAILFIN_VERSION='%{version}-%{release}'
# For more information about yaml and what's supported in Sailfish OS
# build system, please see https://wiki.merproject.org/wiki/Spectacle

View file

@ -73,6 +73,7 @@ public:
Q_PROPERTY(QString baseUrl MEMBER m_baseUrl READ baseUrl NOTIFY baseUrlChanged)
Q_PROPERTY(bool authenticated READ authenticated WRITE setAuthenticated NOTIFY authenticatedChanged)
Q_PROPERTY(QString userId READ userId NOTIFY userIdChanged)
Q_PROPERTY(QString version READ version)
/*QNetworkReply *handleRequest(QString path, QStringList sort, Pagination *pagination,
QVariantMap filters, QStringList fields, QStringList expand, QString id);*/
@ -101,6 +102,7 @@ public:
QString &userId() { return m_userId; }
QJsonObject &deviceProfile() { return m_deviceProfile; }
QJsonObject &playbackDeviceProfile() { return m_playbackDeviceProfile; }
QString version() const { return QString(m_version); }
signals:
/*
* Emitted when the server requires authentication. Please authenticate your user via authenticate.

View file

@ -15,6 +15,10 @@
<source>LGPL 2.1 License</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&lt;p&gt;&lt;b&gt;Sailfin version %1&lt;/b&gt;&lt;br/&gt;Copyright © Chris Josten 2020&lt;/p&gt;&lt;p&gt;Sailfin is Free Software licensed under the &lt;a href=&apos;lgpl&apos;&gt;LGPL-v2.1&lt;/a&gt; or later, at your choice. Parts of the code of Sailfin are from other libraries. &lt;a href=&apos;3rdparty&apos;&gt;View their licenses here&lt;/a&gt;.&lt;/p&gt;</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AddServerConnectingPage</name>
@ -107,7 +111,11 @@
<context>
<name>EpisodeDetails</name>
<message>
<source>Released: %1 Run time: %2</source>
<source>Episode %1%2 Season %3</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Episode %1 Season %2</source>
<translation type="unfinished"></translation>
</message>
</context>