FeedTheMonkey icon indicating copy to clipboard operation
FeedTheMonkey copied to clipboard

Offline mode

Open clawoflight opened this issue 8 years ago • 8 comments

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).

clawoflight avatar Jun 24 '16 16:06 clawoflight

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 avatar Jun 26 '16 14:06 jeena

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.

jeena avatar Jun 29 '16 20:06 jeena

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

clawoflight avatar Jun 30 '16 17:06 clawoflight

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 avatar Jun 30 '16 20:06 jeena

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

jeena avatar Jun 30 '16 20:06 jeena

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 :)

clawoflight avatar Jul 01 '16 11:07 clawoflight

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.

jeena avatar Jul 01 '16 13:07 jeena

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)

clawoflight avatar Jul 22 '16 14:07 clawoflight