[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.2/kdenetwork/kopete/libkopete
From:       Roman Jarosz <kedgedev () gmail ! com>
Date:       2009-02-13 21:19:06
Message-ID: 1234559946.809898.9323.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 925685 by rjarosz:

Backport thiago's commit 922100.
CCBUG:182996



 M  +24 -10    kopeteutils.cpp  


--- branches/KDE/4.2/kdenetwork/kopete/libkopete/kopeteutils.cpp #925684:925685
@@ -34,19 +34,33 @@
 #include "kopeteutils.h"
 #include "kopeteuiglobal.h"
 
-static const QString notifyConnectionLost_DefaultMessage = i18n("You have been \
                disconnected.");
-static const QString notifyConnectionLost_DefaultCaption = i18n("Connection Lost.");
-static const QString notifyConnectionLost_DefaultExplanation = i18n("Kopete lost the \
channel used to talk to the instant messaging system.\nThis can be because either \
your internet access went down, the service is experiencing problems, or the service \
disconnected you because you tried to connect with the same account from another \
                location. Try connecting again later.");
-
-static const QString notifyCannotConnect_DefaultMessage = i18n("Cannot connect with \
                the instant messaging server or peers.");
-static const QString notifyCannotConnect_DefaultCaption = i18n("Cannot connect.");
-static const QString notifyCannotConnect_DefaultExplanation = i18n("This means \
Kopete cannot reach the instant messaging server or peers.\nThis can be because \
either your internet access is down or the server is experiencing problems. Try \
                connecting again later.");
-
 namespace Kopete
 {
 namespace Utils
 {
 
+struct DefaultStrings
+{
+    DefaultStrings() :
+        notifyConnectionLost_DefaultMessage(i18n("You have been disconnected.")),
+        notifyConnectionLost_DefaultCaption(i18n("Connection Lost.")),
+        notifyConnectionLost_DefaultExplanation(i18n("Kopete lost the channel used \
to talk to the instant messaging system.\nThis can be because either your internet \
access went down, the service is experiencing problems, or the service disconnected \
you because you tried to connect with the same account from another location. Try \
connecting again later.")), +
+        notifyCannotConnect_DefaultMessage(i18n("Cannot connect with the instant \
messaging server or peers.")), +        \
notifyCannotConnect_DefaultCaption(i18n("Cannot connect.")), +        \
notifyCannotConnect_DefaultExplanation(i18n("This means Kopete cannot reach the \
instant messaging server or peers.\nThis can be because either your internet access \
is down or the server is experiencing problems. Try connecting again later.")) +    {
+    }
+    const QString notifyConnectionLost_DefaultMessage;
+    const QString notifyConnectionLost_DefaultCaption;
+    const QString notifyConnectionLost_DefaultExplanation;
+
+    const QString notifyCannotConnect_DefaultMessage;
+    const QString notifyCannotConnect_DefaultCaption;
+    const QString notifyCannotConnect_DefaultExplanation;
+};
+K_GLOBAL_STATIC(DefaultStrings, defaultStrings)
+
 void notify( QPixmap pic, const QString &eventid, const QString &caption, const \
QString &message, const QString explanation, const QString debugInfo)  {
 	Q_UNUSED(caption);
@@ -75,7 +89,7 @@
 	if (!account)
 		return;
 
-	notify( account->accountIcon(32), QString::fromLatin1("connection_lost"), \
caption.isEmpty() ? notifyConnectionLost_DefaultCaption : caption, message.isEmpty() \
? notifyConnectionLost_DefaultMessage : message, explanation.isEmpty() ? \
notifyConnectionLost_DefaultExplanation : explanation, debugInfo); +	notify( \
account->accountIcon(32), QString::fromLatin1("connection_lost"), caption.isEmpty() ? \
defaultStrings->notifyConnectionLost_DefaultCaption : caption, message.isEmpty() ? \
defaultStrings->notifyConnectionLost_DefaultMessage : message, explanation.isEmpty() \
? defaultStrings->notifyConnectionLost_DefaultExplanation : explanation, debugInfo);  \
}  
 void notifyCannotConnect( const Account *account, const QString explanation, const \
QString debugInfo) @@ -85,7 +99,7 @@
 	if (!account)
 		return;
 
-	notify( account->accountIcon(), QString::fromLatin1("cannot_connect"), \
notifyCannotConnect_DefaultCaption, notifyCannotConnect_DefaultMessage, \
notifyCannotConnect_DefaultExplanation, debugInfo); +	notify( account->accountIcon(), \
QString::fromLatin1("cannot_connect"), \
defaultStrings->notifyCannotConnect_DefaultCaption, \
defaultStrings->notifyCannotConnect_DefaultMessage, \
defaultStrings->notifyCannotConnect_DefaultExplanation, debugInfo);  }
 
 } // end ns ErrorNotifier


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic