Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline mode #9

Open
clawoflight opened this issue Jun 24, 2016 · 8 comments
Open

Offline mode #9

clawoflight opened this issue Jun 24, 2016 · 8 comments

Comments

@clawoflight
Copy link
Contributor

It would be great to have an offline mode. That's the biggest advantage of a desktop app IMHO, though it also looks very slick and reacts very fast.

I only have a basic understanding of QT and not that much more of C++, but it looks like you download the list of headings on program start and the selected article on-demand, is that correct?

The most straightforward thing to do would be to keep a (hash-indexed) cache of the headings whenever they get downloaded. The cache could be entirely rebuilt whenever a network connection is available.

I am willing to help with this after my exams are done in the next few weeks, but I would need some guidance (and your opinion and design decisions in advance, since this would not be a minor change).

@jeena
Copy link
Owner

jeena commented Jun 26, 2016

You are right, and I had this in mind for a long time actually, the only problem is that right now once you press reload the already read articles are gone. But I guess this would still be ok for a first offline version to just save what we have right now into a datastructure and on the harddisk and read it back into the memory while starting.

@jeena
Copy link
Owner

jeena commented Jun 29, 2016

What one would need to do is make the Post class serializable and then save the whole list in a file or something every time something changes, eithen when the list is updated or if the read state changes, etc. The easiest way would be to reuse the Settings.

@clawoflight
Copy link
Contributor Author

It that works like in Java, a list of serializable objects can be
serialized directly, but I don't know much about C++.

I found this from a quick search:

http://www.devarticles.com/c/a/Cplusplus/Serialize-Your-Class-into-Streams-in-C/1/
http://www.boost.org/doc/libs/1_61_0/libs/serialization/doc/index.html

I don't know if pulling in Boost is necessary, but I also don't know
whether the first option is enough for this case.

On 06/29/2016 10:58 PM, Jeena Paradies wrote:

What one would need to do is make the Post class serializable and
then save the whole list in a file or something every time something
changes, eithen when the list is updated or if the read state

changes, etc. The easiest way would be to reuse the Settings.

GPG fingerprint: 871F 1047 7DB3 DDED 5FC4 47B2 26C7 E577 EF96 7808

@jeena
Copy link
Owner

jeena commented Jun 30, 2016

No we don't really need boost, we kan do that with Qt, I just need to find the time to research it. It is a list of custom objects which themselves are build of strings, boleans, integers and dates.

@jeena
Copy link
Owner

jeena commented Jun 30, 2016

It looks like we mostly need to overload the << and >> operators http://stackoverflow.com/a/2571212/63779

@clawoflight
Copy link
Contributor Author

Cool, looks like it shouldn't take all that long then :)

My last exam is on Wednesday. I will need some rest after that, but I will gladly look into this afterwards :) I would need a quick primer on the life cycle of a QML app and what events I would need to look into, but I could probably figure the rest out :)

@jeena
Copy link
Owner

jeena commented Jul 1, 2016

I think that is a nice beginners feature to fix because it isn't too big and complex. Actually this app as as small scale because it is/was my own intro into QML apps with C++ qmlplugins and so on. I'll be happy to help and explain stuff too.

@clawoflight
Copy link
Contributor Author

I will probably start giving this a shot over the weekend. Where in your code should I start looking? (apart from overloading << and >> for the Post class)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants