[Kde-pim] kmail network-awareness patch

laurent Montel montel at kde.org
Sat Aug 20 16:56:49 BST 2011


Le Saturday 20 August 2011 13:45:58 Martin Bednár a écrit :
> Le Samedi 20 d'août 2011 12:53:19 vous avez écrit :
> > Le Saturday 20 August 2011 11:59:08 Martin Bednár a écrit :
> > > Hi,
> > > 
> > > I played around with some kmail code to make it a bit more
> > > networkstatus-
> > 
> > aware
> > 
> > > (via solid) than it was. I'm not sure it's really needed
> > > functionality-wise, but my ultimate goal being a connected/disconnected
> > > icon in the status bar,
> > I
> > 
> > > think these changes are useful.
> > > 
> > > Also, what's your view on merging setAccountOnline() and
> > > setAccountOffline() from kmkernel.cpp into one function
> > > setAccountStatus(bool) ?
> > > 
> > > Cheers,
> > > 
> > > Martin
> > 
> > Hi,
> > for me patch is good.
> > And yes please merge setAccountOnline/Offline
> 
> Will do but in another patch.

ok

> > 
> > Just a little pb:
> > "+void KMMainWidget::slotNetworkStatusChanged ( Solid::Networking::Status
> > status)
> > +{
> > +  if ( status == Solid::Networking::Connected && GlobalSettings::self()-
> > 
> > >networkState() == GlobalSettings::EnumNetworkState::Online ) {
> > 
> > +    BroadcastStatus::instance()->setStatusMsg(i18n("Network connection
> > detected, all network jobs resumed"));
> > +    kmkernel->setAccountOnline();
> > +  }
> > +  else {
> > +    BroadcastStatus::instance()->setStatusMsg(i18n("No network connection
> > detected, all network jobs are suspended"));
> > +    kmkernel->setAccountOffline();
> > +  }
> > +}
> > " if ( status == Solid::Networking::Connected && GlobalSettings::self()-
> > networkState() == GlobalSettings::EnumNetworkState::Online ) {"
> > 
> > When status is connected and "GlobalSettings::EnumNetworkState::Offline" you
> > display "No network connection detected, all network jobs are suspended"
> > it's not right. for me because you are connection but just kmail is
> > offline.
> > 
> > 
> > => perhaps:
> > 
> > Not necessary to display change network status when we are offline.
> > 
> > void KMMainWidget::slotNetworkStatusChanged ( Solid::Networking::Status
> > status)
> > {
> >  if( GlobalSettings::self()->networkState() ==
> > GlobalSettings::EnumNetworkState::Offline )
> >     return;
> > 
> > 
> >   if ( status == Solid::Networking::Connected  ) {
> >     BroadcastStatus::instance()->setStatusMsg(i18n("Network connection
> > detected, all network jobs resumed"));
> >     kmkernel->setAccountOnline();
> >   }
> >   else {
> >     BroadcastStatus::instance()->setStatusMsg(i18n("No network connection
> > detected, all network jobs are suspended"));
> >     kmkernel->setAccountOffline();
> >   }
> > }
> 
> Hadn't noticed that, modified accordingly.
> I also added another i18n for the case that the user chooses to go online, 
but 
> there is no network connection. Now I'm left wondering what to do with this 
: 
>   if ( MessageComposer::MessageComposerSettings::self()->sendImmediate() ) {
>     kmkernel->msgSender()->sendQueued();
>   }
> Should I add it to setAccountOnline()? Does it make sense to call it when a 
> network connection appears?


If we are not network access not call sendQueued it will not work I think.


> > 
> > 
> > Otherwise it's ok to commit in master (not in 4.7 because it adds new 
i18n)
> 
> Someone else will have to do that, I can't.

Ok will do it if you want.

> > 
> > 
> > Thanks
> > Regards
_______________________________________________
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