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

List:       kde-commits
Subject:    kdenetwork/kopete/kopete/config/appearance
From:       Richard Smith <kde () metafoo ! co ! uk>
Date:       2004-10-02 16:36:25
Message-ID: 20041002163625.E675025C2 () office ! kde ! org
[Download RAW message or body]

CVS commit by lilachaze: 

Renamed TestContact -> FakeContact, and some cleanup.


  M +18 -17    appearanceconfig.cpp   1.42


--- kdenetwork/kopete/kopete/config/appearance/appearanceconfig.cpp  #1.41:1.42
@@ -62,8 +62,11 @@
 #include <ktexteditor/view.h>
 
-#include "kopeteprefs.h"
+// Things we fake to get the message preview to work
+#include "kopetemetacontact.h"
+#include "kopetecontact.h"
 #include "kopetemessage.h"
+
+#include "kopeteprefs.h"
 #include "kopetexsl.h"
-#include "kopetecontact.h"
 #include "kopeteemoticons.h"
 #include "kopeteglobal.h"
@@ -617,10 +620,10 @@ bool AppearanceConfig::addStyle( const Q
 }
 
-//reimplement Kopete::Contact and his abstract method
-class TestContact : public Kopete::Contact
+// Reimplement Kopete::Contact and its abstract method
+class FakeContact : public Kopete::Contact
 {
 public:
-        TestContact (  const QString &id  ) : Kopete::Contact ( \
                (Kopete::Account*)0L, id, 0L ) {}
-        virtual Kopete::MessageManager* manager(bool) { return 0L; }
+        FakeContact ( const QString &id, Kopete::MetaContact *mc ) : \
Kopete::Contact( 0, id, mc ) {} +        virtual Kopete::MessageManager \
*manager(bool) { return 0L; }  };
 
@@ -633,12 +636,13 @@ void AppearanceConfig::slotUpdatePreview
         if( style && style->text() != currentStyle )
         {
-                Kopete::Contact *myself = new TestContact( i18n( "Myself" ) );
-                Kopete::Contact *jack = new TestContact( i18n( "Jack" ) );
+                Kopete::MetaContact jackMC;
+                FakeContact myself( i18n( "Myself" ), 0 );
+                FakeContact jack( i18n( "Jack" ), &jackMC );
 
-                Kopete::Message msgIn(  jack,   myself, i18n( "Hello, this is an \
                incoming message :-)" ), Kopete::Message::Inbound );
-                Kopete::Message msgOut( myself, jack,   i18n( "Ok, this is an \
                outgoing message" ), Kopete::Message::Outbound );
-                Kopete::Message msgInt( jack,   myself, i18n( "This is an internal \
                message" ), Kopete::Message::Internal );
-                Kopete::Message msgAct( jack,   myself, i18n( "performed an action" \
                ), Kopete::Message::Action );
-                //Kopete::Message msgHigh( jack, myself, i18n( "This is a \
highlighted message" ), Kopete::Message::Inbound ); +                Kopete::Message \
msgIn ( &jack,   &myself, i18n( "Hello, this is an incoming message :-)" ), \
Kopete::Message::Inbound ); +                Kopete::Message msgOut( &myself, &jack,  \
i18n( "Ok, this is an outgoing message" ), Kopete::Message::Outbound ); +             \
Kopete::Message msgInt( &jack,   &myself, i18n( "This is an internal message" ), \
Kopete::Message::Internal ); +                Kopete::Message msgAct( &jack,   \
&myself, i18n( "performed an action" ), Kopete::Message::Action ); +                \
//Kopete::Message msgHigh( &jack, &myself, i18n( "This is a highlighted message" ), \
Kopete::Message::Inbound );  
                 preview->begin();
@@ -675,7 +679,4 @@ void AppearanceConfig::slotUpdatePreview
                 preview->end();
 
-                delete myself;
-                delete jack;
-
                 emitChanged();
         }


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

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