Commit ce330abd authored by Nate Graham's avatar Nate Graham 🔩

Merge branch 'Plasma/5.15'

parents 2d8c028c 84f70236
......@@ -215,6 +215,7 @@ DiscoverPage {
Label {
text: display + (toolTip ? " - <i>" + toolTip + "</i>" : "")
elide: Text.ElideRight
textFormat: Text.StyledText
Layout.fillWidth: true
}
}
......
......@@ -311,6 +311,7 @@ DiscoverPage
State {
name: "progressing"
PropertyChanges { target: page; title: i18nc("@info", "Updating...") }
PropertyChanges { target: page; supportsRefreshing: false }
PropertyChanges { target: page; footerLabel: resourcesUpdatesModel.progress<=0 ? i18nc("@info", "Fetching updates") : "" }
},
State {
......
......@@ -65,7 +65,7 @@ static FlatpakResource::Id idForInstalledRef(FlatpakInstallation *installation,
{
const FlatpakResource::ResourceType appType = flatpak_ref_get_kind(FLATPAK_REF(ref)) == FLATPAK_REF_KIND_APP ? FlatpakResource::DesktopApp : FlatpakResource::Runtime;
const QString name = QLatin1String(flatpak_ref_get_name(FLATPAK_REF(ref)));
const QString appId = appType == FlatpakResource::DesktopApp ? QLatin1String(flatpak_ref_get_name(FLATPAK_REF(ref))) + QStringLiteral(".desktop") : name;
const QString appId = appType == FlatpakResource::DesktopApp ? QLatin1String(flatpak_ref_get_name(FLATPAK_REF(ref))) : name;
const QString arch = QString::fromUtf8(flatpak_ref_get_arch(FLATPAK_REF(ref)));
const QString branch = QString::fromUtf8(flatpak_ref_get_branch(FLATPAK_REF(ref)));
......@@ -791,7 +791,8 @@ void FlatpakBackend::onFetchUpdatesFinished(FlatpakInstallation *flatpakInstalla
if (resource) {
resource->setState(AbstractResource::Upgradeable);
updateAppSize(flatpakInstallation, resource);
}
} else
qWarning() << "could not find updated resource" << idForInstalledRef(flatpakInstallation, ref).id << m_resources.size();
}
}
......
......@@ -120,6 +120,12 @@ void FlatpakNotifier::onFetchUpdatesFinished(FlatpakInstallation *flatpakInstall
void FlatpakNotifier::loadRemoteUpdates(FlatpakInstallation *installation)
{
auto fw = new QFutureWatcher<GPtrArray *>(this);
connect(fw, &QFutureWatcher<GPtrArray *>::finished, this, [this, installation, fw](){
auto refs = fw->result();
if (refs)
onFetchUpdatesFinished(installation, refs);
fw->deleteLater();
});
fw->setFuture(QtConcurrent::run( [installation]() -> GPtrArray * {
g_autoptr(GCancellable) cancellable = g_cancellable_new();
g_autoptr(GError) localError = nullptr;
......@@ -129,12 +135,6 @@ void FlatpakNotifier::loadRemoteUpdates(FlatpakInstallation *installation)
}
return refs;
}));
connect(fw, &QFutureWatcher<GPtrArray *>::finished, this, [this, installation, fw](){
auto refs = fw->result();
if (refs)
onFetchUpdatesFinished(installation, refs);
fw->deleteLater();
});
}
bool FlatpakNotifier::hasUpdates()
......
......@@ -157,6 +157,9 @@ void FlatpakTransactionThread::run()
// We are done so we can set the progress to 100
m_result = flatpak_transaction_run(m_transaction, m_cancellable, &localError);
if (!m_result) {
m_errorMessage = QString::fromUtf8(localError->message);
}
setProgress(100);
}
......
......@@ -27,8 +27,8 @@
#include <QDirIterator>
// Attica includes
#include <attica/content.h>
#include <attica/providermanager.h>
#include <Attica/Content>
#include <Attica/ProviderManager>
// KDE includes
#include <knewstuffcore_version.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment