https://bugs.kde.org/show_bug.cgi?id=443455

--- Comment #6 from Adam Williamson <ad...@happyassassin.net> ---
So I looked into this a bit today. It appears to be basically just flat-out
missing functionality; if you compare the similar FlatpakSourcesBackend.cpp,
FwupdSourcesBackend.cpp and PackageKitSourcesBackend.cpp , you can see that the
fwupd and pk backends have both code to set the initial check state of the
QStandardItems that are used for source rows here based on the source state and
also code to enable or disable a source when the box is clicked, but the
flatpak backend has neither of those.

I am no kind of C++ coder at all. I could successfully make the default state
of the box for flatpak sources match the actual state of the source with a
simple patch:

    --- a/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp
    +++ b/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp
    @@ -338,6 +361,8 @@ void FlatpakSourcesBackend::addRemote(FlatpakRemote
*remote, FlatpakInstallation
         it->setData(remoteUrl.isLocalFile() ? remoteUrl.toLocalFile() :
remoteUrl.host(), Qt::ToolTipRole);
         it->setData(remoteUrl, Qt::StatusTipRole);
         it->setData(id, IdRole);
    +    it->setCheckable(true);
    +    it->setCheckState(flatpak_remote_get_disabled(remote) ? Qt::Unchecked
: Qt::Checked);
     #if FLATPAK_CHECK_VERSION(1, 4, 0)
         it->setData(QString::fromUtf8(flatpak_remote_get_icon(remote)),
IconUrlRole);
     #endif

...but this also makes the boxes active, you can click on them, but doing so of
course doesn't actually change the source's real state as clicking on them
isn't hooked up to anything. (Note that when you first click on the box the
state won't appear to change, but if you leave the page and come back it will
be in the other state; this is https://bugs.kde.org/show_bug.cgi?id=406295 ).

I did try and implement changing the state in response to a click too, but
didn't make that compile yet, let alone work, if nobody else wants to work on
it, I'll keep trying.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to