summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2016-10-27 16:24:34 +0200
committerGatis Paeglis <gatis.paeglis@qt.io>2016-11-02 12:26:03 +0000
commit6913a729ad49fd8421491c5526f7a5a02f754144 (patch)
tree2112eeea224a2db52dbbba1c5f0dac3f79663bdf
parentccbb82ad8495284f49338c1122eb061afbf03bc2 (diff)
Rename QOTAClient -> QOtaClient
.. Qt class naming convention. Change-Id: I5ce00450f724e56ed7d0b7402c2aab1e12677335 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
-rw-r--r--examples/qml/basic/main.qml46
-rw-r--r--src/imports/pluginmain.cpp86
-rw-r--r--src/lib/qotaclient.cpp240
-rw-r--r--src/lib/qotaclient.h14
-rw-r--r--src/lib/qotaclient_p.h16
-rw-r--r--src/lib/qotaclientasync.cpp52
-rw-r--r--src/lib/qotaclientasync_p.h8
-rw-r--r--src/lib/qotarepositoryconfig.h4
8 files changed, 233 insertions, 233 deletions
diff --git a/examples/qml/basic/main.qml b/examples/qml/basic/main.qml
index 9c8ccf1..b48697e 100644
--- a/examples/qml/basic/main.qml
+++ b/examples/qml/basic/main.qml
@@ -51,11 +51,11 @@ Window {
}
function otaReady() {
- if (!OTAClient.otaEnabled) {
+ if (!OtaClient.otaEnabled) {
log("OTA Update functionality is not enabled on this device")
return false;
}
- if (!OTAClient.initialized) {
+ if (!OtaClient.initialized) {
log("Initialization is not ready")
return false;
}
@@ -63,11 +63,11 @@ Window {
}
function configureRemote(config) {
- if (!OTAClient.removeRepositoryConfig()) {
+ if (!OtaClient.removeRepositoryConfig()) {
logError("Failed to remove repository configuration")
return;
}
- if (!OTAClient.setRepositoryConfig(config)) {
+ if (!OtaClient.setRepositoryConfig(config)) {
logError("Failed to update repository configuration")
return;
}
@@ -88,14 +88,14 @@ Window {
anchors.topMargin: 10
Label { text: "BOOTED"; Layout.bottomMargin: 14; font.underline: true; }
- Label { text: "<b>Version:</b> " + OTAClient.bootedVersion }
- Label { text: "<b>Description:</b> " + OTAClient.bootedDescription }
- Label { text: "<b>Revision:</b> " + OTAClient.bootedRevision }
+ Label { text: "<b>Version:</b> " + OtaClient.bootedVersion }
+ Label { text: "<b>Description:</b> " + OtaClient.bootedDescription }
+ Label { text: "<b>Revision:</b> " + OtaClient.bootedRevision }
Label { text: "REMOTE"; Layout.bottomMargin: 14; Layout.topMargin: 14; font.underline: true }
- Label { text: "<b>Version:</b> " + OTAClient.remoteVersion }
- Label { text: "<b>Description:</b> " + OTAClient.remoteDescription }
- Label { text: "<b>Revision:</b> " + OTAClient.remoteRevision; Layout.bottomMargin: 10; }
+ Label { text: "<b>Version:</b> " + OtaClient.remoteVersion }
+ Label { text: "<b>Description:</b> " + OtaClient.remoteDescription }
+ Label { text: "<b>Revision:</b> " + OtaClient.remoteRevision; Layout.bottomMargin: 10; }
Label { id: repoUrl; }
Label { id: repoGpgVerify; }
@@ -105,9 +105,9 @@ Window {
Label { id: repoCa; }
Label { text: "ROLLBACK"; Layout.bottomMargin: 14; Layout.topMargin: 14; font.underline: true }
- Label { text: "<b>Version:</b> " + OTAClient.rollbackVersion }
- Label { text: "<b>Description:</b> " + OTAClient.rollbackDescription }
- Label { text: "<b>Revision:</b> " + OTAClient.rollbackRevision }
+ Label { text: "<b>Version:</b> " + OtaClient.rollbackVersion }
+ Label { text: "<b>Description:</b> " + OtaClient.rollbackDescription }
+ Label { text: "<b>Revision:</b> " + OtaClient.rollbackRevision }
RowLayout {
Layout.topMargin: 20
@@ -119,31 +119,31 @@ Window {
if (!otaReady())
return;
log("Fetcing OTA info...")
- OTAClient.fetchRemoteInfo()
+ OtaClient.fetchRemoteInfo()
}
}
Button {
- visible: OTAClient.rollbackAvailable
+ visible: OtaClient.rollbackAvailable
text: "Rollback"
onClicked: {
if (!otaReady())
return;
log("Roolback...")
- OTAClient.rollback()
+ OtaClient.rollback()
}
}
Button {
- visible: OTAClient.updateAvailable
+ visible: OtaClient.updateAvailable
text: "Update"
onClicked: {
if (!otaReady())
return;
log("Updating...")
- OTAClient.update()
+ OtaClient.update()
}
}
Button {
- visible: OTAClient.restartRequired
+ visible: OtaClient.restartRequired
text: "Restart"
onClicked: {
if (!otaReady())
@@ -181,17 +181,17 @@ Window {
}
Connections {
- target: OTAClient
+ target: OtaClient
onErrorChanged: logError(error)
onStatusChanged: log(status)
onInitializationFinished: {
- logWithCondition("Initialization", OTAClient.initialized)
+ logWithCondition("Initialization", OtaClient.initialized)
configureRemote(repoConfig)
}
onFetchRemoteInfoFinished: {
logWithCondition("Fetching info from a remote server", success)
if (success)
- log("Update available: " + OTAClient.updateAvailable)
+ log("Update available: " + OtaClient.updateAvailable)
}
onRollbackFinished: logWithCondition("Rollback", success)
onUpdateFinished: logWithCondition("Update", success)
@@ -199,7 +199,7 @@ Window {
}
Component.onCompleted: {
- if (!OTAClient.otaEnabled)
+ if (!OtaClient.otaEnabled)
log("OTA Update functionality is not enabled on this device")
updateConfigView(0)
}
diff --git a/src/imports/pluginmain.cpp b/src/imports/pluginmain.cpp
index 963a232..94e0d0c 100644
--- a/src/imports/pluginmain.cpp
+++ b/src/imports/pluginmain.cpp
@@ -26,7 +26,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <QtOtaUpdate/QOTAClient>
+#include <QtOtaUpdate/QOtaClient>
#include <QtOtaUpdate/QOtaRepositoryConfig>
#include <QtQml>
@@ -34,16 +34,16 @@ QT_BEGIN_NAMESPACE
/*!
\inqmlmodule QtOtaUpdate
- \qmltype OTAClient
- \instantiates QOTAClient
+ \qmltype OtaClient
+ \instantiates QOtaClient
\brief Main interface to the OTA functionality.
- OTAClient
+ OtaClient
\include qotaclient.cpp client-description
*/
/*!
- \qmlproperty string OTAClient::bootedVersion
+ \qmlproperty string OtaClient::bootedVersion
\readonly
This is a convenience property that holds a string containing the booted
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::bootedDescription
+ \qmlproperty string OtaClient::bootedDescription
\readonly
This is a convenience property that holds a string containing the booted
@@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::bootedRevision
+ \qmlproperty string OtaClient::bootedRevision
\readonly
This property holds a string containing the booted system's revision
@@ -71,7 +71,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::bootedInfo
+ \qmlproperty string OtaClient::bootedInfo
\readonly
This property holds a JSON-formatted string containing the booted system's
@@ -79,7 +79,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::remoteVersion
+ \qmlproperty string OtaClient::remoteVersion
\readonly
This is a convenience property that holds a string containing the system's
@@ -89,7 +89,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::remoteDescription
+ \qmlproperty string OtaClient::remoteDescription
\readonly
This is a convenience property that holds a string containing the system's
@@ -99,7 +99,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::remoteRevision
+ \qmlproperty string OtaClient::remoteRevision
\readonly
This property holds a string containing the system's revision on a server
@@ -107,7 +107,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::remoteInfo
+ \qmlproperty string OtaClient::remoteInfo
\readonly
This property holds a JSON-formatted string containing OTA metadata for the
@@ -115,7 +115,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::rollbackVersion
+ \qmlproperty string OtaClient::rollbackVersion
\readonly
This is a convenience property that holds a string containing the rollback
@@ -125,7 +125,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::rollbackDescription
+ \qmlproperty string OtaClient::rollbackDescription
\readonly
This is a convenience property that holds a string containing the rollback
@@ -135,7 +135,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::rollbackRevision
+ \qmlproperty string OtaClient::rollbackRevision
\readonly
This property holds a string containing the rollback system's revision (a
@@ -143,7 +143,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::rollbackInfo
+ \qmlproperty string OtaClient::rollbackInfo
\readonly
This property holds a JSON-formatted string containing the rollback
@@ -153,14 +153,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlsignal OTAClient::rollbackInfoChanged()
+ \qmlsignal OtaClient::rollbackInfoChanged()
This signal is emitted when the rollback info changes. Rollback info
changes when calling rollback().
*/
/*!
- \qmlmethod bool OTAClient::fetchRemoteInfo()
+ \qmlmethod bool OtaClient::fetchRemoteInfo()
\include qotaclient.cpp fetchremoteinfo-description
@@ -168,20 +168,20 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlsignal OTAClient::fetchRemoteInfoFinished(bool success)
+ \qmlsignal OtaClient::fetchRemoteInfoFinished(bool success)
This is a notifier signal for fetchRemoteInfo(). The \a success argument
indicates whether the operation was successful.
*/
/*!
- \qmlsignal OTAClient::remoteInfoChanged()
+ \qmlsignal OtaClient::remoteInfoChanged()
\include qotaclient.cpp remoteinfochanged-description
*/
/*!
- \qmlmethod bool OTAClient::update()
+ \qmlmethod bool OtaClient::update()
\include qotaclient.cpp update-description
@@ -189,14 +189,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlsignal OTAClient::updateFinished(bool success)
+ \qmlsignal OtaClient::updateFinished(bool success)
This is a notifier signal for update(). The \a success argument
indicates whether the operation was successful.
*/
/*!
- \qmlmethod bool OTAClient::rollback()
+ \qmlmethod bool OtaClient::rollback()
Rollback to the previous system version.
@@ -207,21 +207,21 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlsignal OTAClient::rollbackFinished(bool success)
+ \qmlsignal OtaClient::rollbackFinished(bool success)
This is a notifier signal for rollback(). The \a success argument
indicates whether the operation was successful.
*/
/*!
- \qmlproperty bool OTAClient::otaEnabled
+ \qmlproperty bool OtaClient::otaEnabled
\readonly
This property holds whether a device supports OTA updates.
*/
/*!
- \qmlproperty bool OTAClient::initialized
+ \qmlproperty bool OtaClient::initialized
\readonly
\include qotaclient.cpp initialized-description
@@ -230,7 +230,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty string OTAClient::status
+ \qmlproperty string OtaClient::status
\readonly
This property holds a string containing the last status message. Only
@@ -238,27 +238,27 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlsignal OTAClient::statusChanged(string status);
+ \qmlsignal OtaClient::statusChanged(string status);
\include qotaclient.cpp statusstringchanged-description
*/
/*!
- \qmlproperty string OTAClient::error
+ \qmlproperty string OtaClient::error
\readonly
This property holds a string containing the last error occurred.
*/
/*!
- \qmlsignal OTAClient::errorOccurred(string error);
+ \qmlsignal OtaClient::errorOccurred(string error);
This signal is emitted when an error occurs. The \a error argument holds
the error message.
*/
/*!
- \qmlproperty bool OTAClient::updateAvailable
+ \qmlproperty bool OtaClient::updateAvailable
\readonly
Holds a bool indicating the availability of a system update. This
@@ -268,7 +268,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlsignal OTAClient::updateAvailableChanged(bool available)
+ \qmlsignal OtaClient::updateAvailableChanged(bool available)
This signal is emitted when the value of updateAvailable changes. The
\a available argument holds whether a system update is available for
@@ -276,7 +276,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty bool OTAClient::rollbackAvailable
+ \qmlproperty bool OtaClient::rollbackAvailable
\readonly
Holds a bool indicating the availability of a rollback system.
@@ -285,14 +285,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlsignal OTAClient::rollbackAvailableChanged()
+ \qmlsignal OtaClient::rollbackAvailableChanged()
This signal is emitted when the value of rollbackAvailable changes. A rollback
system becomes available when a device has performed at least one system update.
*/
/*!
- \qmlproperty bool OTAClient::restartRequired
+ \qmlproperty bool OtaClient::restartRequired
\readonly
Holds a bool indicating whether a reboot is required. Reboot is required
@@ -300,21 +300,21 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlsignal OTAClient::restartRequiredChanged(bool required)
+ \qmlsignal OtaClient::restartRequiredChanged(bool required)
This signal is emitted when the value of restartRequired changes. The
\a required argument holds whether a reboot is required.
*/
/*!
- \qmlsignal OTAClient::initializationFinished()
+ \qmlsignal OtaClient::initializationFinished()
This signal is emitted when the object has finished initialization. The
object is not ready for use until this signal is received.
*/
/*!
- \qmlmethod bool OTAClient::setRepositoryConfig(OtaRepositoryConfig config)
+ \qmlmethod bool OtaClient::setRepositoryConfig(OtaRepositoryConfig config)
\include qotaclient.cpp set-repository-config
@@ -324,7 +324,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlmethod OtaRepositoryConfig OTAClient::repositoryConfig()
+ \qmlmethod OtaRepositoryConfig OtaClient::repositoryConfig()
Returns a configuration object for the repository or \c null if the
configuration file does not exist or could not be read.
@@ -333,7 +333,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlmethod bool OTAClient::removeRepositoryConfig()
+ \qmlmethod bool OtaClient::removeRepositoryConfig()
\include qotaclient.cpp remove-repository-config
@@ -341,7 +341,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlsignal OTAClient::repositoryConfigChanged(OtaRepositoryConfig config)
+ \qmlsignal OtaClient::repositoryConfigChanged(OtaRepositoryConfig config)
This signal is emitted when the configuration file was successfully updated
(\a repository holds the new configuration) or removed (\a repository
@@ -444,7 +444,7 @@ static QObject *otaClientSingleton(QQmlEngine *qmlEngine, QJSEngine *jsEngine)
{
Q_UNUSED(qmlEngine);
Q_UNUSED(jsEngine);
- return new QOTAClient;
+ return new QOtaClient;
}
class QOTAUpdatePlugin : public QQmlExtensionPlugin
{
@@ -456,7 +456,7 @@ public:
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtOtaUpdate"));
- qmlRegisterSingletonType<QOTAClient>(uri, 1, 0, "OTAClient", otaClientSingleton);
+ qmlRegisterSingletonType<QOtaClient>(uri, 1, 0, "OtaClient", otaClientSingleton);
qmlRegisterType<QOtaRepositoryConfig>(uri, 1, 0, "OtaRepositoryConfig");
}
};
diff --git a/src/lib/qotaclient.cpp b/src/lib/qotaclient.cpp
index b28237f..725dfb0 100644
--- a/src/lib/qotaclient.cpp
+++ b/src/lib/qotaclient.cpp
@@ -43,7 +43,7 @@ const QString repoConfigPath(QStringLiteral("/etc/ostree/remotes.d/qt-os.conf"))
QT_BEGIN_NAMESPACE
-QOTAClientPrivate::QOTAClientPrivate(QOTAClient *client) :
+QOtaClientPrivate::QOtaClientPrivate(QOtaClient *client) :
q_ptr(client),
m_initialized(false),
m_updateAvailable(false),
@@ -55,12 +55,12 @@ QOTAClientPrivate::QOTAClientPrivate(QOTAClient *client) :
if (m_otaEnabled) {
m_otaAsyncThread = new QThread();
m_otaAsyncThread->start();
- m_otaAsync.reset(new QOTAClientAsync());
+ m_otaAsync.reset(new QOtaClientAsync());
m_otaAsync->moveToThread(m_otaAsyncThread);
}
}
-QOTAClientPrivate::~QOTAClientPrivate()
+QOtaClientPrivate::~QOtaClientPrivate()
{
if (m_otaEnabled) {
if (m_otaAsyncThread->isRunning()) {
@@ -83,9 +83,9 @@ static void updateInfoMembers(const QJsonDocument &json, QByteArray *info, QStri
*description = root.value(QStringLiteral("description")).toString(QStringLiteral("unknown"));
}
-void QOTAClientPrivate::updateRemoteInfo(const QString &remoteRev, const QJsonDocument &remoteInfo)
+void QOtaClientPrivate::updateRemoteInfo(const QString &remoteRev, const QJsonDocument &remoteInfo)
{
- Q_Q(QOTAClient);
+ Q_Q(QOtaClient);
if (m_remoteRev == remoteRev)
return;
@@ -94,7 +94,7 @@ void QOTAClientPrivate::updateRemoteInfo(const QString &remoteRev, const QJsonDo
emit q->remoteInfoChanged();
}
-bool QOTAClientPrivate::isReady() const
+bool QOtaClientPrivate::isReady() const
{
if (!m_otaEnabled) {
qCWarning(qota) << "over-the-air update functionality is not enabled for this device";
@@ -107,9 +107,9 @@ bool QOTAClientPrivate::isReady() const
return true;
}
-void QOTAClientPrivate::refreshState()
+void QOtaClientPrivate::refreshState()
{
- Q_Q(QOTAClient);
+ Q_Q(QOtaClient);
bool updateAvailable = m_defaultRev != m_remoteRev && m_remoteRev != m_bootedRev;
if (m_updateAvailable != updateAvailable) {
@@ -124,11 +124,11 @@ void QOTAClientPrivate::refreshState()
}
}
-void QOTAClientPrivate::initializeFinished(const QString &defaultRev,
+void QOtaClientPrivate::initializeFinished(const QString &defaultRev,
const QString &bootedRev, const QJsonDocument &bootedInfo,
const QString &remoteRev, const QJsonDocument &remoteInfo)
{
- Q_Q(QOTAClient);
+ Q_Q(QOtaClient);
m_defaultRev = defaultRev;
m_bootedRev = bootedRev;
updateInfoMembers(bootedInfo, &m_bootedInfo, &m_bootedVersion, &m_bootedDescription);
@@ -138,9 +138,9 @@ void QOTAClientPrivate::initializeFinished(const QString &defaultRev,
emit q->initializationFinished();
}
-void QOTAClientPrivate::fetchRemoteInfoFinished(const QString &remoteRev, const QJsonDocument &remoteInfo, bool success)
+void QOtaClientPrivate::fetchRemoteInfoFinished(const QString &remoteRev, const QJsonDocument &remoteInfo, bool success)
{
- Q_Q(QOTAClient);
+ Q_Q(QOtaClient);
if (success) {
updateRemoteInfo(remoteRev, remoteInfo);
refreshState();
@@ -148,9 +148,9 @@ void QOTAClientPrivate::fetchRemoteInfoFinished(const QString &remoteRev, const
emit q->fetchRemoteInfoFinished(success);
}
-void QOTAClientPrivate::updateFinished(const QString &defaultRev, bool success)
+void QOtaClientPrivate::updateFinished(const QString &defaultRev, bool success)
{
- Q_Q(QOTAClient);
+ Q_Q(QOtaClient);
if (success) {
m_defaultRev = defaultRev;
refreshState();
@@ -158,9 +158,9 @@ void QOTAClientPrivate::updateFinished(const QString &defaultRev, bool success)
emit q->updateFinished(success);
}
-void QOTAClientPrivate::rollbackFinished(const QString &defaultRev, bool success)
+void QOtaClientPrivate::rollbackFinished(const QString &defaultRev, bool success)
{
- Q_Q(QOTAClient);
+ Q_Q(QOtaClient);
if (success) {
m_defaultRev = defaultRev;
refreshState();
@@ -168,23 +168,23 @@ void QOTAClientPrivate::rollbackFinished(const QString &defaultRev, bool success
emit q->rollbackFinished(success);
}
-void QOTAClientPrivate::statusStringChanged(const QString &status)
+void QOtaClientPrivate::statusStringChanged(const QString &status)
{
- Q_Q(QOTAClient);
+ Q_Q(QOtaClient);
m_status = status;
emit q->statusStringChanged(m_status);
}
-void QOTAClientPrivate::errorOccurred(const QString &error)
+void QOtaClientPrivate::errorOccurred(const QString &error)
{
- Q_Q(QOTAClient);
+ Q_Q(QOtaClient);
m_error = error;
emit q->errorOccurred(m_error);
}
-void QOTAClientPrivate::rollbackChanged(const QString &rollbackRev, const QJsonDocument &rollbackInfo, int treeCount)
+void QOtaClientPrivate::rollbackChanged(const QString &rollbackRev, const QJsonDocument &rollbackInfo, int treeCount)
{
- Q_Q(QOTAClient);
+ Q_Q(QOtaClient);
if (!m_rollbackAvailable && treeCount > 1) {
m_rollbackAvailable = true;
emit q->rollbackAvailableChanged();
@@ -194,7 +194,7 @@ void QOTAClientPrivate::rollbackChanged(const QString &rollbackRev, const QJsonD
q->rollbackInfoChanged();
}
-QString QOTAClientPrivate::version(QueryTarget target) const
+QString QOtaClientPrivate::version(QueryTarget target) const
{
if (!m_otaEnabled)
return QString();
@@ -211,7 +211,7 @@ QString QOTAClientPrivate::version(QueryTarget target) const
}
}
-QByteArray QOTAClientPrivate::info(QueryTarget target) const
+QByteArray QOtaClientPrivate::info(QueryTarget target) const
{
if (!m_otaEnabled)
return QByteArray();
@@ -228,7 +228,7 @@ QByteArray QOTAClientPrivate::info(QueryTarget target) const
}
}
-QString QOTAClientPrivate::description(QueryTarget target) const
+QString QOtaClientPrivate::description(QueryTarget target) const
{
if (!m_otaEnabled)
return QString();
@@ -245,7 +245,7 @@ QString QOTAClientPrivate::description(QueryTarget target) const
}
}
-QString QOTAClientPrivate::revision(QueryTarget target) const
+QString QOtaClientPrivate::revision(QueryTarget target) const
{
if (!m_otaEnabled)
return QString();
@@ -263,11 +263,11 @@ QString QOTAClientPrivate::revision(QueryTarget target) const
}
/*!
- \class QOTAClient
+ \class QOtaClient
\inmodule qtotaupdate
\brief Main interface to the OTA functionality.
- QOTAClient
+ QOtaClient
//! [client-description]
provides an API to execute Over-the-Air update tasks. Offline
operations include querying the booted and rollback system version details,
@@ -283,28 +283,28 @@ QString QOTAClientPrivate::revision(QueryTarget target) const
*/
/*!
- \fn void QOTAClient::fetchRemoteInfoFinished(bool success)
+ \fn void QOtaClient::fetchRemoteInfoFinished(bool success)
A notifier signal for fetchRemoteInfo(). The \a success argument indicates
whether the operation was successful.
*/
/*!
- \fn void QOTAClient::updateFinished(bool success)
+ \fn void QOtaClient::updateFinished(bool success)
A notifier signal for update(). The \a success argument indicates whether
the operation was successful.
*/
/*!
- \fn void QOTAClient::rollbackFinished(bool success)
+ \fn void QOtaClient::rollbackFinished(bool success)
This is a notifier signal for rollback(). The \a success argument
indicates whether the operation was successful.
*/
/*!
- \fn void QOTAClient::remoteInfoChanged()
+ \fn void QOtaClient::remoteInfoChanged()
//! [remoteinfochanged-description]
Remote info can change when calling fetchRemoteInfo(). If OTA metadata on
the remote server is different from the local cache, the local cache is updated
@@ -313,14 +313,14 @@ QString QOTAClientPrivate::revision(QueryTarget target) const
*/
/*!
- \fn void QOTAClient::rollbackInfoChanged()
+ \fn void QOtaClient::rollbackInfoChanged()
This signal is emitted when rollback info changes. Rollback info changes
when calling rollback().
*/
/*!
- \fn void QOTAClient::updateAvailableChanged(bool available)
+ \fn void QOtaClient::updateAvailableChanged(bool available)
This signal is emitted when the value of updateAvailable changes. The
\a available argument holds whether a system update is available for
@@ -328,21 +328,21 @@ QString QOTAClientPrivate::revision(QueryTarget target) const
*/
/*!
- \fn void QOTAClient::rollbackAvailableChanged()
+ \fn void QOtaClient::rollbackAvailableChanged()
This signal is emitted when the value of rollbackAvailable changes. A rollback
system becomes available when a device has performed at least one system update.
*/
/*!
- \fn void QOTAClient::restartRequiredChanged(bool required)
+ \fn void QOtaClient::restartRequiredChanged(bool required)
This signal is emitted when the value of restartRequired changes. The
\a required argument holds whether a reboot is required.
*/
/*!
- \fn void QOTAClient::statusStringChanged(const QString &status)
+ \fn void QOtaClient::statusStringChanged(const QString &status)
//! [statusstringchanged-description]
This signal is emitted when an additional status information is available
(for example, when a program is busy performing a long operation). The
@@ -351,47 +351,47 @@ QString QOTAClientPrivate::revision(QueryTarget target) const
*/
/*!
- \fn void QOTAClient::errorOccurred(const QString &error)
+ \fn void QOtaClient::errorOccurred(const QString &error)
This signal is emitted when an error occurs. The \a error argument holds
the error message.
*/
/*!
- \fn void QOTAClient::initializationFinished()
+ \fn void QOtaClient::initializationFinished()
This signal is emitted when the object has finished initialization. The
object is not ready for use until this signal is received.
*/
/*!
- \fn void QOTAClient::repositoryConfigChanged(QOtaRepositoryConfig *repository)
+ \fn void QOtaClient::repositoryConfigChanged(QOtaRepositoryConfig *repository)
This signal is emitted when the configuration file was updated (\a repository
holds a pointer to the new configuration) or removed (\a repository holds the
\c nullptr value).
*/
-QOTAClient::QOTAClient(QObject *parent) :
+QOtaClient::QOtaClient(QObject *parent) :
QObject(parent),
- d_ptr(new QOTAClientPrivate(this))
+ d_ptr(new QOtaClientPrivate(this))
{
- Q_D(QOTAClient);
+ Q_D(QOtaClient);
if (d->m_otaEnabled) {
- QOTAClientAsync *async = d->m_otaAsync.data();
+ QOtaClientAsync *async = d->m_otaAsync.data();
// async finished handlers
- connect(async, &QOTAClientAsync::initializeFinished, d, &QOTAClientPrivate::initializeFinished);
- connect(async, &QOTAClientAsync::fetchRemoteInfoFinished, d, &QOTAClientPrivate::fetchRemoteInfoFinished);
- connect(async, &QOTAClientAsync::updateFinished, d, &QOTAClientPrivate::updateFinished);
- connect(async, &QOTAClientAsync::rollbackFinished, d, &QOTAClientPrivate::rollbackFinished);
- connect(async, &QOTAClientAsync::errorOccurred, d, &QOTAClientPrivate::errorOccurred);
- connect(async, &QOTAClientAsync::statusStringChanged, d, &QOTAClientPrivate::statusStringChanged);
- connect(async, &QOTAClientAsync::rollbackChanged, d, &QOTAClientPrivate::rollbackChanged);
+ connect(async, &QOtaClientAsync::initializeFinished, d, &QOtaClientPrivate::initializeFinished);
+ connect(async, &QOtaClientAsync::fetchRemoteInfoFinished, d, &QOtaClientPrivate::fetchRemoteInfoFinished);
+ connect(async, &QOtaClientAsync::updateFinished, d, &QOtaClientPrivate::updateFinished);
+ connect(async, &QOtaClientAsync::rollbackFinished, d, &QOtaClientPrivate::rollbackFinished);
+ connect(async, &QOtaClientAsync::errorOccurred, d, &QOtaClientPrivate::errorOccurred);
+ connect(async, &QOtaClientAsync::statusStringChanged, d, &QOtaClientPrivate::statusStringChanged);
+ connect(async, &QOtaClientAsync::rollbackChanged, d, &QOtaClientPrivate::rollbackChanged);
d->m_otaAsync->initialize();
}
}
-QOTAClient::~QOTAClient()
+QOtaClient::~QOtaClient()
{
delete d_ptr;
}
@@ -408,9 +408,9 @@ QOTAClient::~QOTAClient()
\sa fetchRemoteInfoFinished(), updateAvailable, remoteInfo
*/
-bool QOTAClient::fetchRemoteInfo() const
+bool QOtaClient::fetchRemoteInfo() const
{
- Q_D(const QOTAClient);
+ Q_D(const QOtaClient);
if (!d->isReady())
return false;
@@ -428,9 +428,9 @@ bool QOTAClient::fetchRemoteInfo() const
\sa updateFinished(), fetchRemoteInfo(), restartRequired
*/
-bool QOTAClient::update() const
+bool QOtaClient::update() const
{
- Q_D(const QOTAClient);
+ Q_D(const QOtaClient);
if (!d->isReady() || !updateAvailable())
return false;
@@ -446,9 +446,9 @@ bool QOTAClient::update() const
\sa rollbackFinished(), restartRequired
*/
-bool QOTAClient::rollback() const
+bool QOtaClient::rollback() const
{
- Q_D(const QOTAClient);
+ Q_D(const QOtaClient);
if (!d->isReady())
return false;
@@ -469,9 +469,9 @@ bool QOTAClient::rollback() const
\sa setRepositoryConfig(), repositoryConfigChanged
*/
-bool QOTAClient::removeRepositoryConfig()
+bool QOtaClient::removeRepositoryConfig()
{
- Q_D(QOTAClient);
+ Q_D(QOtaClient);
if (!otaEnabled() || !QDir().exists(repoConfigPath))
return true;
@@ -497,9 +497,9 @@ bool QOTAClient::removeRepositoryConfig()
\sa removeRepositoryConfig(), repositoryConfigChanged
*/
-bool QOTAClient::setRepositoryConfig(QOtaRepositoryConfig *config)
+bool QOtaClient::setRepositoryConfig(QOtaRepositoryConfig *config)
{
- Q_D(QOTAClient);
+ Q_D(QOtaClient);
if (!d->isReady())
return false;
@@ -560,7 +560,7 @@ bool QOTAClient::setRepositoryConfig(QOtaRepositoryConfig *config)
\sa setRepositoryConfig(), removeRepositoryConfig()
*/
-QOtaRepositoryConfig *QOTAClient::repositoryConfig() const
+QOtaRepositoryConfig *QOtaClient::repositoryConfig() const
{
if (!otaEnabled())
return nullptr;
@@ -568,17 +568,17 @@ QOtaRepositoryConfig *QOTAClient::repositoryConfig() const
}
/*!
- \property QOTAClient::otaEnabled
+ \property QOtaClient::otaEnabled
\brief whether a device supports OTA updates.
*/
-bool QOTAClient::otaEnabled() const
+bool QOtaClient::otaEnabled() const
{
- Q_D(const QOTAClient);
+ Q_D(const QOtaClient);
return d->m_otaEnabled;
}
/*!
- \property QOTAClient::initialized
+ \property QOtaClient::initialized
//! [initialized-description]
\brief whether the object has completed the initialization.
@@ -593,163 +593,163 @@ bool QOTAClient::otaEnabled() const
\sa initializationFinished()
*/
-bool QOTAClient::initialized() const
+bool QOtaClient::initialized() const
{
- Q_D(const QOTAClient);
+ Q_D(const QOtaClient);
return d->m_initialized;
}
/*!
- \property QOTAClient::error
+ \property QOtaClient::error
\brief a string containing the last error occurred.
*/
-QString QOTAClient::errorString() const
+QString QOtaClient::errorString() const
{
- Q_D(const QOTAClient);
+ Q_D(const QOtaClient);
return d->m_error;
}
/*!
- \property QOTAClient::status
+ \property QOtaClient::status
\brief a string containing the last status message.
Only selected operations update this property.
*/
-QString QOTAClient::statusString() const
+QString QOtaClient::statusString() const
{
- Q_D(const QOTAClient);
+ Q_D(const QOtaClient);
return d->m_status;
}
/*!
- \property QOTAClient::updateAvailable
+ \property QOtaClient::updateAvailable
\brief whether a system update is available.
This information is cached; to update the local cache, call
fetchRemoteInfo().
*/
-bool QOTAClient::updateAvailable() const
+bool QOtaClient::updateAvailable() const
{
- Q_D(const QOTAClient);
+ Q_D(const QOtaClient);
if (d->m_updateAvailable)
Q_ASSERT(!d->m_remoteRev.isEmpty());
return d->m_updateAvailable;
}
/*!
- \property QOTAClient::rollbackAvailable
+ \property QOtaClient::rollbackAvailable
\brief whether a rollback system is available.
\sa rollbackAvailableChanged()
*/
-bool QOTAClient::rollbackAvailable() const
+bool QOtaClient::rollbackAvailable() const
{
- Q_D(const QOTAClient);
+ Q_D(const QOtaClient);
return d->m_rollbackAvailable;
}
/*!
- \property QOTAClient::restartRequired
+ \property QOtaClient::restartRequired
\brief whether a reboot is required.
Reboot is required after update() and rollback(), to boot into the new
default system.
*/
-bool QOTAClient::restartRequired() const
+bool QOtaClient::restartRequired() const
{
- Q_D(const QOTAClient);
+ Q_D(const QOtaClient);
return d->m_restartRequired;
}
/*!
- \property QOTAClient::bootedVersion
+ \property QOtaClient::bootedVersion
\brief a QString containing the booted system's version.
This is a convenience method.
\sa bootedInfo
*/
-QString QOTAClient::bootedVersion() const
+QString QOtaClient::bootedVersion() const
{
- return d_func()->version(QOTAClientPrivate::QueryTarget::Booted);
+ return d_func()->version(QOtaClientPrivate::QueryTarget::Booted);
}
/*!
- \property QOTAClient::bootedDescription
+ \property QOtaClient::bootedDescription
\brief a QString containing the booted system's description.
This is a convenience method.
\sa bootedInfo
*/
-QString QOTAClient::bootedDescription() const
+QString QOtaClient::bootedDescription() const
{
- return d_func()->description(QOTAClientPrivate::QueryTarget::Booted);
+ return d_func()->description(QOtaClientPrivate::QueryTarget::Booted);
}
/*!
- \property QOTAClient::bootedRevision
+ \property QOtaClient::bootedRevision
\brief a QString containing the booted system's revision.
A booted revision is a checksum in the OSTree repository.
*/
-QString QOTAClient::bootedRevision() const
+QString QOtaClient::bootedRevision() const
{
- return d_func()->revision(QOTAClientPrivate::QueryTarget::Booted);
+ return d_func()->revision(QOtaClientPrivate::QueryTarget::Booted);
}
/*!
- \property QOTAClient::bootedInfo
+ \property QOtaClient::bootedInfo
\brief a QByteArray containing the booted system's OTA metadata.
Returns a JSON-formatted QByteArray containing OTA metadata for the booted
system. Metadata is bundled with each system's version.
*/
-QByteArray QOTAClient::bootedInfo() const
+QByteArray QOtaClient::bootedInfo() const
{
- return d_func()->info(QOTAClientPrivate::QueryTarget::Booted);
+ return d_func()->info(QOtaClientPrivate::QueryTarget::Booted);
}
/*!
- \property QOTAClient::remoteVersion
+ \property QOtaClient::remoteVersion
\brief a QString containing the system's version on a server.
This is a convenience method.
\sa remoteInfo
*/
-QString QOTAClient::remoteVersion() const
+QString QOtaClient::remoteVersion() const
{
- return d_func()->version(QOTAClientPrivate::QueryTarget::Remote);
+ return d_func()->version(QOtaClientPrivate::QueryTarget::Remote);
}
/*!
- \property QOTAClient::remoteDescription
+ \property QOtaClient::remoteDescription
\brief a QString containing the system's description on a server.
This is a convenience method.
\sa remoteInfo
*/
-QString QOTAClient::remoteDescription() const
+QString QOtaClient::remoteDescription() const
{
- return d_func()->description(QOTAClientPrivate::QueryTarget::Remote);
+ return d_func()->description(QOtaClientPrivate::QueryTarget::Remote);
}
/*!
- \property QOTAClient::remoteRevision
+ \property QOtaClient::remoteRevision
\brief a QString containing the system's revision on a server.
A checksum in the OSTree repository.
*/
-QString QOTAClient::remoteRevision() const
+QString QOtaClient::remoteRevision() const
{
- return d_func()->revision(QOTAClientPrivate::QueryTarget::Remote);
+ return d_func()->revision(QOtaClientPrivate::QueryTarget::Remote);
}
/*!
- \property QOTAClient::remoteInfo
+ \property QOtaClient::remoteInfo
\brief a QByteArray containing the system's OTA metadata on a server.
Returns a JSON-formatted QByteArray containing OTA metadata for the system
@@ -757,50 +757,50 @@ QString QOTAClient::remoteRevision() const
\sa fetchRemoteInfo()
*/
-QByteArray QOTAClient::remoteInfo() const
+QByteArray QOtaClient::remoteInfo() const
{
- return d_func()->info(QOTAClientPrivate::QueryTarget::Remote);
+ return d_func()->info(QOtaClientPrivate::QueryTarget::Remote);
}
/*!
- \property QOTAClient::rollbackVersion
+ \property QOtaClient::rollbackVersion
\brief a QString containing the rollback system's version.
This is a convenience method.
\sa rollbackInfo
*/
-QString QOTAClient::rollbackVersion() const
+QString QOtaClient::rollbackVersion() const
{
- return d_func()->version(QOTAClientPrivate::QueryTarget::Rollback);
+ return d_func()->version(QOtaClientPrivate::QueryTarget::Rollback);
}
/*!
- \property QOTAClient::rollbackDescription
+ \property QOtaClient::rollbackDescription
\brief a QString containing the rollback system's description.
This is a convenience method.
\sa rollbackInfo
*/
-QString QOTAClient::rollbackDescription() const
+QString QOtaClient::rollbackDescription() const
{
- return d_func()->description(QOTAClientPrivate::QueryTarget::Rollback);
+ return d_func()->description(QOtaClientPrivate::QueryTarget::Rollback);
}
/*!
- \property QOTAClient::rollbackRevision
+ \property QOtaClient::rollbackRevision
\brief a QString containing the rollback system's revision.
A checksum in the OSTree repository.
*/
-QString QOTAClient::rollbackRevision() const
+QString QOtaClient::rollbackRevision() const
{
- return d_func()->revision(QOTAClientPrivate::QueryTarget::Rollback);
+ return d_func()->revision(QOtaClientPrivate::QueryTarget::Rollback);
}
/*!
- \property QOTAClient::rollbackInfo
+ \property QOtaClient::rollbackInfo
\brief a QByteArray containing the rollback system's OTA metadata.
Returns a JSON-formatted QByteArray containing OTA metadata for the rollback
@@ -808,9 +808,9 @@ QString QOTAClient::rollbackRevision() const
\sa rollback()
*/
-QByteArray QOTAClient::rollbackInfo() const
+QByteArray QOtaClient::rollbackInfo() const
{
- return d_func()->info(QOTAClientPrivate::QueryTarget::Rollback);
+ return d_func()->info(QOtaClientPrivate::QueryTarget::Rollback);
}
QT_END_NAMESPACE
diff --git a/src/lib/qotaclient.h b/src/lib/qotaclient.h
index 7944561..162d0f7 100644
--- a/src/lib/qotaclient.h
+++ b/src/lib/qotaclient.h
@@ -35,10 +35,10 @@
QT_BEGIN_NAMESPACE
-class QOTAClientPrivate;
+class QOtaClientPrivate;
class QOtaRepositoryConfig;
-class Q_DECL_EXPORT QOTAClient : public QObject
+class Q_DECL_EXPORT QOtaClient : public QObject
{
Q_OBJECT
Q_PROPERTY(bool otaEnabled READ otaEnabled)
@@ -61,8 +61,8 @@ class Q_DECL_EXPORT QOTAClient : public QObject
Q_PROPERTY(QString rollbackRevision READ rollbackRevision NOTIFY rollbackInfoChanged)
Q_PROPERTY(QByteArray rollbackInfo READ rollbackInfo NOTIFY rollbackInfoChanged)
public:
- explicit QOTAClient(QObject *parent = nullptr);
- virtual ~QOTAClient();
+ explicit QOtaClient(QObject *parent = nullptr);
+ virtual ~QOtaClient();
bool updateAvailable() const;
bool rollbackAvailable() const;
@@ -111,9 +111,9 @@ Q_SIGNALS:
void rollbackFinished(bool success);
private:
- Q_DISABLE_COPY(QOTAClient)
- Q_DECLARE_PRIVATE(QOTAClient)
- QOTAClientPrivate *const d_ptr;
+ Q_DISABLE_COPY(QOtaClient)
+ Q_DECLARE_PRIVATE(QOtaClient)
+ QOtaClientPrivate *const d_ptr;
};
QT_END_NAMESPACE
diff --git a/src/lib/qotaclient_p.h b/src/lib/qotaclient_p.h
index 61670bf..cabee87 100644
--- a/src/lib/qotaclient_p.h
+++ b/src/lib/qotaclient_p.h
@@ -38,14 +38,14 @@
Q_DECLARE_LOGGING_CATEGORY(qota)
class QThread;
-class QOTAClientAsync;
+class QOtaClientAsync;
class QOtaRepositoryConfig;
-class QOTAClient;
+class QOtaClient;
-class QOTAClientPrivate : public QObject
+class QOtaClientPrivate : public QObject
{
Q_OBJECT
- Q_DECLARE_PUBLIC(QOTAClient)
+ Q_DECLARE_PUBLIC(QOtaClient)
public:
enum class QueryTarget
{
@@ -55,8 +55,8 @@ public:
};
Q_ENUM(QueryTarget)
- QOTAClientPrivate(QOTAClient *client);
- virtual ~QOTAClientPrivate();
+ QOtaClientPrivate(QOtaClient *client);
+ virtual ~QOtaClientPrivate();
void refreshState();
void initializeFinished(const QString &defaultRev,
@@ -78,7 +78,7 @@ public:
bool isReady() const;
// members
- QOTAClient *const q_ptr;
+ QOtaClient *const q_ptr;
bool m_initialized;
bool m_updateAvailable;
bool m_rollbackAvailable;
@@ -87,7 +87,7 @@ public:
QString m_status;
QString m_error;
QThread *m_otaAsyncThread;
- QScopedPointer<QOTAClientAsync> m_otaAsync;
+ QScopedPointer<QOtaClientAsync> m_otaAsync;
QString m_defaultRev;
QString m_bootedVersion;
diff --git a/src/lib/qotaclientasync.cpp b/src/lib/qotaclientasync.cpp
index f638e19..a040b1c 100644
--- a/src/lib/qotaclientasync.cpp
+++ b/src/lib/qotaclientasync.cpp
@@ -37,17 +37,17 @@
QT_BEGIN_NAMESPACE
-QOTAClientAsync::QOTAClientAsync() :
+QOtaClientAsync::QOtaClientAsync() :
m_sysroot(ostree_sysroot_new(0))
{
// async mapper
- connect(this, &QOTAClientAsync::initialize, this, &QOTAClientAsync::_initialize);
- connect(this, &QOTAClientAsync::fetchRemoteInfo, this, &QOTAClientAsync::_fetchRemoteInfo);
- connect(this, &QOTAClientAsync::update, this, &QOTAClientAsync::_update);
- connect(this, &QOTAClientAsync::rollback, this, &QOTAClientAsync::_rollback);
+ connect(this, &QOtaClientAsync::initialize, this, &QOtaClientAsync::_initialize);
+ connect(this, &QOtaClientAsync::fetchRemoteInfo, this, &QOtaClientAsync::_fetchRemoteInfo);
+ connect(this, &QOtaClientAsync::update, this, &QOtaClientAsync::_update);
+ connect(this, &QOtaClientAsync::rollback, this, &QOtaClientAsync::_rollback);
}
-QOTAClientAsync::~QOTAClientAsync()
+QOtaClientAsync::~QOtaClientAsync()
{
g_object_unref (m_sysroot);
}
@@ -60,7 +60,7 @@ static void parseErrorString(QString *error)
*error = QLatin1String("Repository configuration not found");
}
-QString QOTAClientAsync::ostree(const QString &command, bool *ok, bool updateStatus)
+QString QOtaClientAsync::ostree(const QString &command, bool *ok, bool updateStatus)
{
qCDebug(qota) << command;
QProcess ostree;
@@ -105,20 +105,20 @@ QString QOTAClientAsync::ostree(const QString &command, bool *ok, bool updateSta
return out;
}
-QJsonDocument QOTAClientAsync::info(QOTAClientPrivate::QueryTarget target, bool *ok, const QString &rev)
+QJsonDocument QOtaClientAsync::info(QOtaClientPrivate::QueryTarget target, bool *ok, const QString &rev)
{
QString jsonData;
switch (target) {
- case QOTAClientPrivate::QueryTarget::Booted: {
+ case QOtaClientPrivate::QueryTarget::Booted: {
QFile metadata(QStringLiteral("/usr/etc/qt-ota.json"));
if (metadata.open(QFile::ReadOnly))
jsonData = QString::fromLatin1(metadata.readAll());
break;
}
- case QOTAClientPrivate::QueryTarget::Remote:
+ case QOtaClientPrivate::QueryTarget::Remote:
jsonData = ostree(QString(QStringLiteral("ostree cat %1 /usr/etc/qt-ota.json")).arg(rev), ok);
break;
- case QOTAClientPrivate::QueryTarget::Rollback:
+ case QOtaClientPrivate::QueryTarget::Rollback:
jsonData = ostree(QString(QStringLiteral("ostree cat %1 /usr/etc/qt-ota.json")).arg(rev), ok);
break;
default:
@@ -139,7 +139,7 @@ QJsonDocument QOTAClientAsync::info(QOTAClientPrivate::QueryTarget target, bool
return jsonInfo;
}
-bool QOTAClientAsync::multiprocessLock(const QString &method)
+bool QOtaClientAsync::multiprocessLock(const QString &method)
{
qCDebug(qota) << QTime::currentTime().toString() << method << "- waiting for lock...";
GError *error = nullptr;
@@ -150,20 +150,20 @@ bool QOTAClientAsync::multiprocessLock(const QString &method)
return true;
}
-void QOTAClientAsync::multiprocessUnlock()
+void QOtaClientAsync::multiprocessUnlock()
{
ostree_sysroot_unlock (m_sysroot);
qCDebug(qota) << QTime::currentTime().toString() << "lock released";
}
-QString QOTAClientAsync::defaultRevision()
+QString QOtaClientAsync::defaultRevision()
{
g_autoptr(GPtrArray) deployments = ostree_sysroot_get_deployments (m_sysroot);
OstreeDeployment *firstDeployment = (OstreeDeployment*)deployments->pdata[0];
return QLatin1String(ostree_deployment_get_csum (firstDeployment));
}
-void QOTAClientAsync::_initialize()
+void QOtaClientAsync::_initialize()
{
if (!multiprocessLock(QStringLiteral("_initialize")))
return;
@@ -175,18 +175,18 @@ void QOTAClientAsync::_initialize()
OstreeDeployment *bootedDeployment = (OstreeDeployment*)ostree_sysroot_get_booted_deployment (m_sysroot);
QString bootedRev = QLatin1String(ostree_deployment_get_csum (bootedDeployment));
bool ok = true;
- QJsonDocument bootedInfo = info(QOTAClientPrivate::QueryTarget::Booted, &ok);
+ QJsonDocument bootedInfo = info(QOtaClientPrivate::QueryTarget::Booted, &ok);
QString defaultRev = defaultRevision();
// prepopulate with what we think is on the remote server (head of the local repo)
QString remoteRev = ostree(QStringLiteral("ostree rev-parse linux/qt"), &ok);
- QJsonDocument remoteInfo = info(QOTAClientPrivate::QueryTarget::Remote, &ok, remoteRev);
+ QJsonDocument remoteInfo = info(QOtaClientPrivate::QueryTarget::Remote, &ok, remoteRev);
resetRollbackState();
emit initializeFinished(defaultRev, bootedRev, bootedInfo, remoteRev, remoteInfo);
multiprocessUnlock();
}
-void QOTAClientAsync::_fetchRemoteInfo()
+void QOtaClientAsync::_fetchRemoteInfo()
{
if (!multiprocessLock(QStringLiteral("_fetchRemoteInfo")))
return;
@@ -196,12 +196,12 @@ void QOTAClientAsync::_fetchRemoteInfo()
ostree(QStringLiteral("ostree pull --commit-metadata-only qt-os linux/qt"), &ok);
if (ok) ostree(QStringLiteral("ostree pull --subpath=/usr/etc/qt-ota.json qt-os linux/qt"), &ok);
if (ok) remoteRev = ostree(QStringLiteral("ostree rev-parse linux/qt"), &ok);
- if (ok) remoteInfo = info(QOTAClientPrivate::QueryTarget::Remote, &ok, remoteRev);
+ if (ok) remoteInfo = info(QOtaClientPrivate::QueryTarget::Remote, &ok, remoteRev);
emit fetchRemoteInfoFinished(remoteRev, remoteInfo, ok);
multiprocessUnlock();
}
-void QOTAClientAsync::_update(const QString &updateToRev)
+void QOtaClientAsync::_update(const QString &updateToRev)
{
if (!multiprocessLock(QStringLiteral("_update")))
return;
@@ -230,7 +230,7 @@ out:
emit updateFinished(defaultRev, ok);
}
-int QOTAClientAsync::rollbackIndex()
+int QOtaClientAsync::rollbackIndex()
{
g_autoptr(GPtrArray) deployments = ostree_sysroot_get_deployments (m_sysroot);
if (deployments->len < 2)
@@ -243,7 +243,7 @@ int QOTAClientAsync::rollbackIndex()
return 1;
}
-void QOTAClientAsync::resetRollbackState()
+void QOtaClientAsync::resetRollbackState()
{
int index = rollbackIndex();
if (index == -1)
@@ -253,18 +253,18 @@ void QOTAClientAsync::resetRollbackState()
OstreeDeployment *rollbackDeployment = (OstreeDeployment*)deployments->pdata[index];
QString rollbackRev = QLatin1String(ostree_deployment_get_csum (rollbackDeployment));
bool ok = true;
- QJsonDocument rollbackInfo = info(QOTAClientPrivate::QueryTarget::Rollback, &ok, rollbackRev);
+ QJsonDocument rollbackInfo = info(QOtaClientPrivate::QueryTarget::Rollback, &ok, rollbackRev);
emit rollbackChanged(rollbackRev, rollbackInfo, deployments->len);
}
-void QOTAClientAsync::emitRollbackFailed(const QString &error)
+void QOtaClientAsync::emitRollbackFailed(const QString &error)
{
emit errorOccurred(error);
emit rollbackFinished(QStringLiteral(""), false);
multiprocessUnlock();
}
-bool QOTAClientAsync::emitGError(GError *error)
+bool QOtaClientAsync::emitGError(GError *error)
{
if (!error)
return false;
@@ -274,7 +274,7 @@ bool QOTAClientAsync::emitGError(GError *error)
return true;
}
-void QOTAClientAsync::_rollback()
+void QOtaClientAsync::_rollback()
{
if (!multiprocessLock(QStringLiteral("_rollback")))
return;
diff --git a/src/lib/qotaclientasync_p.h b/src/lib/qotaclientasync_p.h
index c91a7fa..d9e1e28 100644
--- a/src/lib/qotaclientasync_p.h
+++ b/src/lib/qotaclientasync_p.h
@@ -42,12 +42,12 @@ struct OstreeSysroot;
// from gerror.h
typedef struct _GError GError;
-class QOTAClientAsync : public QObject
+class QOtaClientAsync : public QObject
{
Q_OBJECT
public:
- QOTAClientAsync();
- virtual ~QOTAClientAsync();
+ QOtaClientAsync();
+ virtual ~QOtaClientAsync();
QString ostree(const QString &command, bool *ok, bool updateStatus = false);
signals:
@@ -66,7 +66,7 @@ signals:
void statusStringChanged(const QString &status);
protected:
- QJsonDocument info(QOTAClientPrivate::QueryTarget target, bool *ok, const QString &rev = QString());
+ QJsonDocument info(QOtaClientPrivate::QueryTarget target, bool *ok, const QString &rev = QString());
bool multiprocessLock(const QString &method);
void multiprocessUnlock();
QString defaultRevision();
diff --git a/src/lib/qotarepositoryconfig.h b/src/lib/qotarepositoryconfig.h
index 11e7400..e4f0fb6 100644
--- a/src/lib/qotarepositoryconfig.h
+++ b/src/lib/qotarepositoryconfig.h
@@ -32,7 +32,7 @@
#include <QtCore/QObject>
#include <QtCore/QString>
-class QOTAClient;
+class QOtaClient;
class QOtaRepositoryConfigPrivate;
class Q_DECL_EXPORT QOtaRepositoryConfig : public QObject
@@ -78,7 +78,7 @@ private:
Q_DISABLE_COPY(QOtaRepositoryConfig)
Q_DECLARE_PRIVATE(QOtaRepositoryConfig)
QOtaRepositoryConfigPrivate *const d_ptr;
- friend class QOTAClient;
+ friend class QOtaClient;
};
#endif // QOTAREPOSITORYCONFIG_H