Setting primary computer

Linus Torvalds torvalds at linux-foundation.org
Sat Apr 2 15:30:39 PDT 2022


On Sat, Apr 2, 2022 at 2:18 PM Dirk Hohndel via subsurface
<subsurface at subsurface-divelog.org> wrote:
>
> I'd appreciate some other eyeballs on this :)

I have a suspicion.

Notable, the mobile side does:

        importModel.recordDives()

from the qml code.

And look what the default flags are:

   Q_INVOKABLE void recordDives(int flags = IMPORT_PREFER_IMPORTED |
IMPORT_IS_DOWNLOADED);

so basically the mobile import seems to do what the desktop app does
when 'preferDownloaded' is checked.

And I think that's the reason people see this odd behavior, and why
"download on mobile" is an issue.

I suspect it's intentional - so that when you import on mobile, you
always see the dive you just imported (since mobile doesn't support
showing multiple dive computers).

That default flag was added by commit b6f821886 ("mobile: unify
download code on mobile and desktop"), but as far as I can tell, it
acted that way even before (it used to do

        add_imported_dives(&tables.first, nullptr, &tables.second,
                IMPORT_PREFER_IMPORTED | IMPORT_IS_DOWNLOADED);

in the qt-model code before that. And it looked to be true regardless
of how far back I went.

But I don't know this code as well as I used to. Berthold?

            Linus


More information about the subsurface mailing list