Commit 9a1a124e authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Make methods const when possible

parent 8280fa0c
......@@ -180,7 +180,7 @@ FlatpakRemote * FlatpakBackend::getFlatpakRemoteByUrl(const QString &url, Flatpa
return nullptr;
}
FlatpakInstalledRef * FlatpakBackend::getInstalledRefForApp(FlatpakInstallation *flatpakInstallation, FlatpakResource *resource)
FlatpakInstalledRef * FlatpakBackend::getInstalledRefForApp(FlatpakInstallation *flatpakInstallation, FlatpakResource *resource) const
{
AppStream::Component component = resource->appstreamComponent();
AppStream::Component::Kind appKind = component.kind();
......@@ -225,7 +225,7 @@ FlatpakInstalledRef * FlatpakBackend::getInstalledRefForApp(FlatpakInstallation
return ref;
}
FlatpakResource * FlatpakBackend::getAppForInstalledRef(FlatpakInstallation *flatpakInstallation, FlatpakInstalledRef *ref)
FlatpakResource * FlatpakBackend::getAppForInstalledRef(FlatpakInstallation *flatpakInstallation, FlatpakInstalledRef *ref) const
{
foreach (FlatpakResource *resource, m_resources) {
if (compareAppFlatpakRef(flatpakInstallation, resource, ref)) {
......@@ -236,7 +236,7 @@ FlatpakResource * FlatpakBackend::getAppForInstalledRef(FlatpakInstallation *fla
return nullptr;
}
FlatpakResource * FlatpakBackend::getRuntimeForApp(FlatpakResource *resource)
FlatpakResource * FlatpakBackend::getRuntimeForApp(FlatpakResource *resource) const
{
FlatpakResource *runtime = nullptr;
const auto runtimeInfo = resource->runtime().split(QLatin1Char('/'));
......@@ -518,7 +518,7 @@ void FlatpakBackend::addResource(FlatpakResource *resource)
m_resources.insert(resource->uniqueId(), resource);
}
bool FlatpakBackend::compareAppFlatpakRef(FlatpakInstallation *flatpakInstallation, FlatpakResource *resource, FlatpakInstalledRef *ref)
bool FlatpakBackend::compareAppFlatpakRef(FlatpakInstallation *flatpakInstallation, FlatpakResource *resource, FlatpakInstalledRef *ref) const
{
const QString arch = QString::fromUtf8(flatpak_ref_get_arch(FLATPAK_REF(ref)));
const QString branch = QString::fromUtf8(flatpak_ref_get_branch(FLATPAK_REF(ref)));
......
......@@ -75,14 +75,14 @@ private:
FlatpakInstallation * preferredInstallation() const { return m_installations.constFirst(); }
void integrateRemote(FlatpakInstallation *flatpakInstallation, FlatpakRemote *remote);
FlatpakRemote * getFlatpakRemoteByUrl(const QString &url, FlatpakInstallation *installation) const;
FlatpakInstalledRef * getInstalledRefForApp(FlatpakInstallation *flatpakInstallation, FlatpakResource *resource);
FlatpakResource * getAppForInstalledRef(FlatpakInstallation *flatpakInstallation, FlatpakInstalledRef *ref);
FlatpakResource * getRuntimeForApp(FlatpakResource *resource);
FlatpakInstalledRef * getInstalledRefForApp(FlatpakInstallation *flatpakInstallation, FlatpakResource *resource) const;
FlatpakResource * getAppForInstalledRef(FlatpakInstallation *flatpakInstallation, FlatpakInstalledRef *ref) const;
FlatpakResource * getRuntimeForApp(FlatpakResource *resource) const;
FlatpakResource * addAppFromFlatpakBundle(const QUrl &url);
FlatpakResource * addAppFromFlatpakRef(const QUrl &url);
void addResource(FlatpakResource *resource);
bool compareAppFlatpakRef(FlatpakInstallation *flatpakInstallation, FlatpakResource *resource, FlatpakInstalledRef *ref);
bool compareAppFlatpakRef(FlatpakInstallation *flatpakInstallation, FlatpakResource *resource, FlatpakInstalledRef *ref) const;
bool loadAppsFromAppstreamData(FlatpakInstallation *flatpakInstallation);
bool loadInstalledApps(FlatpakInstallation *flatpakInstallation);
void loadLocalUpdates(FlatpakInstallation *flatpakInstallation);
......
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