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

List:       kde-commits
Subject:    kdenonbeta/kopete/libkopete
From:       Grzegorz Jaskiewicz <gj () pointblue ! com ! pl>
Date:       2003-07-14 0:14:03
[Download RAW message or body]

CVS commit by gj: 

Adding runtime changeable status descryption facility to kopetecontact class.
Approved by Martijn.


  M +12 -3     kopetecontact.cpp   1.141
  M +14 -3     kopetecontact.h   1.109


--- kdenonbeta/kopete/libkopete/kopetecontact.cpp  #1.140:1.141
@@ -67,4 +67,5 @@ public:
         QString contactId;
         QString icon;
+        QString statusDescription;
 };
 
@@ -146,12 +147,20 @@ const KopeteOnlineStatus& KopeteContact:
 }
 
-void KopeteContact::setOnlineStatus( const KopeteOnlineStatus &status )
+void KopeteContact::setOnlineStatus( const KopeteOnlineStatus &status,
+                                        const QString &statusDescription )
 {
-        if( status == d->onlineStatus)
+        if( status == d->onlineStatus && statusDescription==d->statusDescription )
                 return;
 
         KopeteOnlineStatus oldStatus = d->onlineStatus;
         d->onlineStatus = status;
+        d->statusDescription=statusDescription;
+
         emit onlineStatusChanged( this, status, oldStatus );
+}
+
+QString KopeteContact::statusDescription() const
+{
+    return d->statusDescription;
 }
 

--- kdenonbeta/kopete/libkopete/kopetecontact.h  #1.108:1.109
@@ -130,7 +130,18 @@ public:
 
         /**
-         * Set the contact's online status
+         * Set the contact's online status and status descryption
+         * By default description is set to QString::null, this mean
+         * that it is not used 
          */
-        void setOnlineStatus( const KopeteOnlineStatus &status );
+        void setOnlineStatus(const KopeteOnlineStatus &status, 
+                        const QString &statusDescription=QString::null);
+
+        /**
+         * Returns QString::null if protocol do not use it,
+         * or status description otherwise, empty string (not null), 
+         * if current status does not require description.
+         */
+           
+        QString statusDescription() const;
 
         /**


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

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