[Kde-pim] kmail network-awareness patch

Martin Bednár serafean at gmail.com
Sat Aug 20 12:45:58 BST 2011


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.

> 
> 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?

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

> 
> 
> Thanks
> Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kmail-autoOffline.patch
Type: text/x-patch
Size: 5530 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110820/7f64e796/attachment.bin>
-------------- 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/20110820/7f64e796/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