[Kde-pim] [patch] handling of static data in akonadi and mailtransport

Ingo Klöcker kloecker at kde.org
Mon May 19 23:14:23 BST 2008


On Monday 19 May 2008, Jarosław Staniek wrote:
> Index: mailtransport/socket.cpp
> ===================================================================
> --- mailtransport/socket.cpp    (wersja 809997)
> +++ mailtransport/socket.cpp    (kopia robocza)
> @@ -54,6 +54,8 @@
>        void slotModeChanged( QSslSocket::SslMode  state );
>        void slotSocketRead();
>        void slotSslErrors( const QList<QSslError> &errors );
> +    private:
> +      QString msg;

This should be
+      QString m_msg;

>    };
>  }
>  
> @@ -102,19 +104,19 @@
>      return;
>    }
>  
> -  static QString msg;
> -  msg += QLatin1String( socket->readAll() );
> +  QString m_msg;

The above line has to be deleted.

> +  m_msg += QLatin1String( socket->readAll() );
>  
> -  if ( !msg.endsWith( QLatin1Char( '\n' ) ) ) {
> +  if ( !m_msg.endsWith( QLatin1Char( '\n' ) ) ) {
>      return;
>    }
>  
>  #ifdef comm_debug
> -  kDebug() << socket->isEncrypted() << msg.trimmed();
> +  kDebug() << socket->isEncrypted() << m_msg.trimmed();
>  #endif
>  
> -  emit q->data( msg );
> -  msg.clear();
> +  emit q->data( m_msg );
> +  m_msg.clear();
>  }



Concerning mailtransport/smtpjob.cpp I'm wondering whether SlavePool can 
be destroyed before the last SmtpJob is destroyed. I guess it would be 
saner to make the last SmtpJob destroy the slave pool. The pool is 
anyway cleared each time the reference count drops to 0, so the slave 
pool could as well be destroyed at that point. And in the c'tor of 
SmtpJob the pool would be created if it does not exist. I don't think 
K_GLOBAL_STATIC is the correct tool for the job, but I'm too tired to 
really think about it right now.


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20080520/00c6eb91/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