[Kde-pim] Akonadi Resource - setOnline troubles

Martin Koller kollix at aon.at
Mon Feb 17 21:21:09 GMT 2014


In the patch I created for the DAV resource (to make it automatically offline when it can not reach the server)
I see a problem with the online/offline switching:
When I use setOnline(false), the baseclass stores this as "desired status == offline", which also means
whenever the network goes away (e.g. suspend Laptop) and comes again (resume Laptop) detected by Solid,
it would not automatically try to set the resource to online, because the baseclass still thinks,
my desire is to have it offline.

How can I overcome this ?

I want to set the resource to "temporarily offline" and therefore to activate the change recorder,
but as soon as possible (either via my QTimer or when Solid detects network activation) I want that
the resource retries to go online.

I could also listen to the Solid events, but I see this as an ugly solution, as this is something
every network needing resource should do.

What about a new method in AgentBase ?, e.g.
void setTemporaryOffline() { setOnlineInternal(false); }  // not storing state as desired state

(or maybe setTemporaryOnline(bool state), don't know if "true" would ever be used here)
-- 
Best regards/Schöne Grüße

Martin
A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

()  ascii ribbon campaign - against html e-mail 
/\                                   - against proprietary attachments

Geschenkideen, Accessoires, Seifen, Kulinarisches: www.bibibest.at
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list