summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Grulich <[email protected]>2017-02-03 13:09:21 +0100
committerJan Grulich <[email protected]>2017-02-03 13:09:21 +0100
commit166dcc2cab0f150dfe7adadb69c2861511087ebc (patch)
tree9151c76056e0168db3c35238124ff31c78cd6a83
parent50823c45071f7493a15a3d86f24ac74e11b946a5 (diff)
Get rid of compile warnings
-rw-r--r--libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp4
-rw-r--r--libdiscover/backends/FlatpakBackend/FlatpakTransaction.cpp2
-rw-r--r--libdiscover/backends/FlatpakBackend/FlatpakTransactionJob.cpp5
-rw-r--r--libdiscover/backends/FlatpakBackend/FlatpakTransactionJob.h3
4 files changed, 9 insertions, 5 deletions
diff --git a/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp b/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
index 351529b..eefa9da 100644
--- a/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
+++ b/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
@@ -403,7 +403,6 @@ void FlatpakBackend::reloadPackageList(GCancellable *cancellable)
// TODO maybe not to store AsApp internally and set every info in FlatpakResource properties
FlatpakResource *resource = new FlatpakResource(app, this);
- AsAppState appState = as_app_get_state(app);
AsAppScope appScope = as_app_get_scope(app);
if (!parseMetadataFromAppBundle(resource)) {
@@ -533,7 +532,6 @@ bool FlatpakBackend::updateAppMetadata(FlatpakInstallation* flatpakInstallation,
bool FlatpakBackend::updateAppSize(FlatpakInstallation *flatpakInstallation, FlatpakResource *resource, GCancellable *cancellable)
{
- int size;
guint64 downloadSize = 0;
guint64 installedSize = 0;
@@ -707,7 +705,7 @@ void FlatpakBackend::removeApplication(AbstractResource *app)
{
FlatpakResource *resource = qobject_cast<FlatpakResource*>(app);
FlatpakInstallation *installation = as_app_get_scope(resource->appstreamApp()) == AS_APP_SCOPE_SYSTEM ? m_flatpakInstallationSystem : m_flatpakInstallationUser;
- FlatpakTransaction *transaction = new FlatpakTransaction(installation, resource, Transaction::RemoveRole);
+ new FlatpakTransaction(installation, resource, Transaction::RemoveRole);
}
void FlatpakBackend::checkForUpdates()
diff --git a/libdiscover/backends/FlatpakBackend/FlatpakTransaction.cpp b/libdiscover/backends/FlatpakBackend/FlatpakTransaction.cpp
index 766d41f..b185ad9 100644
--- a/libdiscover/backends/FlatpakBackend/FlatpakTransaction.cpp
+++ b/libdiscover/backends/FlatpakBackend/FlatpakTransaction.cpp
@@ -80,7 +80,7 @@ void FlatpakTransaction::onJobProgressChanged(int progress)
void FlatpakTransaction::finishTransaction()
{
setStatus(DoneStatus);
- AbstractResource::State newState;
+ AbstractResource::State newState = AbstractResource::None;
switch(role()) {
case InstallRole:
case ChangeAddonsRole:
diff --git a/libdiscover/backends/FlatpakBackend/FlatpakTransactionJob.cpp b/libdiscover/backends/FlatpakBackend/FlatpakTransactionJob.cpp
index 5789858..9634e97 100644
--- a/libdiscover/backends/FlatpakBackend/FlatpakTransactionJob.cpp
+++ b/libdiscover/backends/FlatpakBackend/FlatpakTransactionJob.cpp
@@ -45,6 +45,11 @@ FlatpakTransactionJob::FlatpakTransactionJob(FlatpakInstallation *installation,
m_cancellable = g_cancellable_new();
}
+FlatpakTransactionJob::~FlatpakTransactionJob()
+{
+ g_object_unref(m_cancellable);
+}
+
void FlatpakTransactionJob::cancel()
{
g_cancellable_cancel(m_cancellable);
diff --git a/libdiscover/backends/FlatpakBackend/FlatpakTransactionJob.h b/libdiscover/backends/FlatpakBackend/FlatpakTransactionJob.h
index 7945fb6..442663b 100644
--- a/libdiscover/backends/FlatpakBackend/FlatpakTransactionJob.h
+++ b/libdiscover/backends/FlatpakBackend/FlatpakTransactionJob.h
@@ -36,6 +36,7 @@ class FlatpakTransactionJob : public QThread
Q_OBJECT
public:
FlatpakTransactionJob(FlatpakInstallation *installation, FlatpakResource *app, Transaction::Role role);
+ ~FlatpakTransactionJob();
void cancel();
void run() override;
@@ -45,7 +46,7 @@ Q_SIGNALS:
void progressChanged(int progress);
private:
- g_autoptr(GCancellable) m_cancellable;
+ GCancellable *m_cancellable;
FlatpakResource *m_app;
FlatpakInstallation *m_installation;
Transaction::Role m_role;