[Kde-pim] Review Request: making kmail network-aware

Martin Bednár serafean at gmail.com
Wed Aug 31 21:51:29 BST 2011


Le Wednesday 31 of August 2011 21:20:43 Andras Mantia a écrit :
> On Wednesday, August 31, 2011 18:03:50 Martin Bednar wrote:
> > > On Aug. 25, 2011, 4:42 p.m., Martin Bednar wrote:
> > > > kmail/kmkernel.cpp, line 991
> > > > <http://git.reviewboard.kde.org/r/102431/diff/2/?file=32875#file
> > > > 32
> > > > 875line991>> >
> > > > 
> > > >     Because isOffline now returns based on the system's
> > > >     network
> > > >     status, with which this dialog can't do anything. We
> > > >     only
> > > >     want this dialog to change KMail's internal online
> > > >     status. It
> > > >     is most visible when starting KMail without any network
> > > >     connection : this dialog pops up (regularly if periodic
> > > >     mail
> > > >     checking is enabled) and does absolutely nothing.>
> > > 
> > > Andras Mantia wrote:
> > >     isOffline doesn't check the Solid status if the global
> > >     network
> 
> state is Offline:
> > >       if ( ( GlobalSettings::self()->networkState() ==
> > >       GlobalSettings::EnumNetworkState::Offline ) ||>
> > >       
> > >            ( Solid::Networking::status() ==
> > >            Solid::Networking::Unconnected ) || (
> > >            Solid::Networking::status() ==
> > >            Solid::Networking::Disconnecting ) )>
> > >         
> > >         return true;
> > >     
> > >     And yes, I have a setup where solid says i'm not in a
> > >     connected
> > >     state, and got no warning dialog on startup about being
> > >     offline, so everything works fine (as expected).
> > 
> > Not sure if you're saying that isOffline should check the Solid status
> > even if the internal status is offline (which it shouldn't IMO), or
> > just that everything works as it should. And sorry about this
> > previous post, it was meant as a reply to your first post (I missed
> > the Add comment button)
> 
> I was saying that everything works as it should. :) Because isOffline first
> checks the networkState() and if that returns offline mode, the solid
> state is not checked at all. 

IMO this fact doesn't help the askToGoOnline() issue at all.

> So the actual change made in line 991 you
> made does exactly the same thing as isOffline.

Sure, but the point was that when I was using ==Solid::Connected, isOffline 
returned true for all Solid::Status except Connected, which made me see the 
"askToGoOnline" window a lot. Now We check for !=Unconnected || 
!=Disconnecting. Solid apparently being smart, uses the Unknown status when it 
doesn't know, which I think is why it works on your setup (and mine too). I 
admit I hadn't realized that when I wrote the second patch. The thing here is 
now that the window will be shown when KMail tries checking for mail eg the 
"Check Mail" button when the network is Unconnected || Disconnecting (checked 
for in isOffline), which is unwanted because kmail can't do anything with the 
global network state.

> 
> Please commit the other change, line 940.

I would if I could : I don't have commit rights.

Regards, 

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110831/8fa244dc/attachment.sig>
-------------- next part --------------
_______________________________________________
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