KStars Lite issues
Jasem Mutlaq
mutlaqja at ikarustech.com
Tue Nov 8 19:41:51 UTC 2016
So it took me all day, but it seems there are two different files used.
When using KSharedConfig::openConfig(), the opened file in KStars startup
is:
/data/user/0/org.kde.kstars/files/settings/kstarsrc
Calling KSharedConfig::openConfig()->save() saves to the same file as above.
When we save data on exit, we use Options::self()->save(). That calls saves
to:
/data/data/org.kde.kstars/files/settings/kstarsrc
But another problem is that it was called within a slot that was triggered
by aboutToQuit() signal from qApp, but that signal is never generated on
Android, so instead it is now attached to applicationStateChanged(..)
signal and I save the options when the state is Qt::ApplicationSuspended.
However, it won't work unless I make two calls:
KSharedConfig::openConfig()->sync();
Options::self()->save();
The first one saves the color scheme files, without it, the color scheme
used by KStars is never saved and always returns empty. The 2nd call saves
the rest of the options. There is something wrong here but I don't know
what it is. For now, calling it as above saves all options on Android.
Regards,
Jasem
On Tue, Nov 8, 2016 at 4:03 AM, Aleix Pol <aleixpol at kde.org> wrote:
> Hi Jasem,
> Maybe it would be interesting to add some debug information in:
> bool KConfigIniBackend::writeConfig(const QByteArray &locale,
> KEntryMap &entryMap,
> WriteOptions options)
>
> It would be especially interesting what's the filePath() and in
> general to see what's the output of the function itself, which is the
> one responsible for saving the file.
>
> Aleix
>
> On Mon, Nov 7, 2016 at 10:03 PM, Jasem Mutlaq <mutlaqja at ikarustech.com>
> wrote:
> > Ok so I checked on desktop it's kstarsrc, and on Android it's
> > libkstars.sorc, there is no absolute file path given. I added a few debug
> > and I'm not sure if aboutToQuit() signal is being caught in Android,
> because
> > save save config to disk when we receive that signal. Btw, I added a
> manual
> > Options::self()->save() after changing the color scheme, and still I
> cannot
> > see it getting saved, it resets to default values when restarted.
> >
> > Here is a link to the log file generated from adb logcat
> > (https://www.dropbox.com/s/dt824eddkhzg4up/log.txt?dl=0)
> >
> > On Mon, Nov 7, 2016 at 4:48 PM, Aleix Pol <aleixpol at kde.org> wrote:
> >>
> >> A good first step would be to print where the file is being written.
> >> Also you can check with "adb logcat" what error messages you're
> >> getting.
> >>
> >> Aleix
> >>
> >> On Mon, Nov 7, 2016 at 2:38 PM, Jasem Mutlaq <mutlaqja at ikarustech.com>
> >> wrote:
> >> > Hi Aleix,
> >> >
> >> > So The KStars Lite QML works fine when compiled and test on the
> desktop,
> >> > but
> >> > the settings do not get saved on Android for some reason. Is there a
> way
> >> > to
> >> > find out? On the desktop it creates ~/.config/kstarsrc, where does it
> >> > keep
> >> > the same file on Android? I looked under org.kde.kstars (in Samsung
> S5)
> >> > but
> >> > couldn't find any file. Is there anything special we need to add to
> >> > KStars
> >> > to make it save settings on Android?
> >> >
> >> > Regards,
> >> > Jasem
> >> >
> >> >
> >> > On Mon, Nov 7, 2016 at 2:14 PM, Aleix Pol <aleixpol at kde.org> wrote:
> >> >>
> >> >> On Sun, Nov 6, 2016 at 7:06 PM, Jasem Mutlaq <
> mutlaqja at ikarustech.com>
> >> >> wrote:
> >> >> > Hello,
> >> >> >
> >> >> > So I made some changes to the code to make loading faster, it's now
> >> >> > 2-3x
> >> >> > faster on Android but can still see more improvement especially
> >> >> > splashscreen
> >> >> > only appears after 3-4 seconds which might lead to think there is a
> >> >> > problem
> >> >> > loading the app, so that has to be address.
> >> >> >
> >> >> > Another problem we have is that the KStars options are not saved.
> We
> >> >> > are
> >> >> > using KConfig just like in regular KStars. on KStars Lite for
> >> >> > desktop,
> >> >> > it
> >> >> > creates a kstarsrc file under ~/.config and loading/saving of
> >> >> > configuration
> >> >> > options appears to be OK, but it's not working on Android.
> >> >> >
> >> >> > I'm CC KDE Android list, is there something special we have to do
> get
> >> >> > this
> >> >> > working on Android? We are using this repo to build KF5 for
> Android:
> >> >> >
> >> >> > git://anongit.kde.org/scratch/cordlandwehr/kdesrc-conf-android.git
> >> >> >
> >> >> > Check here for more details:
> >> >> >
> >> >> >
> >> >> >
> >> >> > http://thelastpolaris.blogspot.de/2016/05/how-to-
> build-kstars-lite-for-android.html
> >> >> >
> >> >> > Any ideas? I found another repo here while writing this email:
> >> >> >
> >> >> > https://quickgit.kde.org/?p=android-builder.git
> >> >> >
> >> >> > Is this the one we should be using?
> >> >>
> >> >> Hi Jasem,
> >> >> First please register to this mailing list, or I have to moderate you
> >> >> in every time and people can't answer directly.
> >> >>
> >> >> kdesrc-conf-android is what Andreas was experimenting with and should
> >> >> be the right thing to use, proof is that you managed to compile your
> >> >> application. This doesn't mean KConfig is not going to have bugs. I
> >> >> encourage you to look into KConfig and debug the error.
> >> >>
> >> >> From there, I'll be happy to help you fix the issue.
> >> >>
> >> >> Aleix
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > Best Regards,
> >> > Jasem Mutlaq
> >> >
> >
> >
> >
> >
> > --
> > Best Regards,
> > Jasem Mutlaq
> >
>
--
Best Regards,
Jasem Mutlaq
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kstars-devel/attachments/20161108/fd624226/attachment.html>
More information about the Kstars-devel
mailing list