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

List:       kde-commits
Subject:    kopete_0_7_branch: kdenonbeta/kopete/kopete/contactlist
From:       Olivier Goffart <ogoffart () tiscalinet ! be>
Date:       2003-08-15 16:23:36
[Download RAW message or body]

CVS commit by ogoffart: 

Backport the fix about the online notification which is displayed too often


  M +12 -14    kopetemetacontactlvi.cpp   1.31.2.2
  M +2 -9      kopetemetacontactlvi.h   1.12.2.1


--- kdenonbeta/kopete/kopete/contactlist/kopetemetacontactlvi.cpp  #1.31.2.1:1.31.2.2
@@ -89,4 +89,6 @@ void KopeteMetaContactLVI::initLVI()
         m_actionCopy = 0L;
 
+        m_oldStatus=KopeteOnlineStatus::Offline;
+
         connect( m_metaContact, SIGNAL( displayNameChanged( const QString &, const \
QString & ) ),  SLOT( slotDisplayNameChanged() ) );
@@ -115,8 +117,6 @@ void KopeteMetaContactLVI::initLVI()
         m_event=0L;
 
-        if(!mBlinkIcon)
-        {
-                mBlinkIcon = new QPixmap( KGlobal::iconLoader()->loadIcon( \
                QString::fromLatin1( "newmsg" ), KIcon::Small ) );
-        }
+
+        //if(!mBlinkIcon) mBlinkIcon = new QPixmap(KGlobal::iconLoader()->loadIcon( \
QString::fromLatin1( "newmsg" ), KIcon::Small));  
         slotUpdateIcons();
@@ -124,6 +124,4 @@ void KopeteMetaContactLVI::initLVI()
 }
 
-QPixmap *KopeteMetaContactLVI::mBlinkIcon=0L;
-
 KopeteMetaContactLVI::~KopeteMetaContactLVI()
 {
@@ -182,7 +180,11 @@ void KopeteMetaContactLVI::slotContactSt
         // FIXME: All this code should be in kopetemetacontact.cpp.. having it in \
the LVI makes it all fire  // multiple times if the user is in multiple groups - \
                Jason
-        QString event = (m_metaContact->status() == KopeteOnlineStatus::Online) ?
+
+        // NOTE: this assume that the use don't want a notification when the contact \
was away and goes online +        QString event = (m_metaContact->status() == \
KopeteOnlineStatus::Online  && ( m_oldStatus == KopeteOnlineStatus::Offline || \
m_oldStatus == KopeteOnlineStatus::Unknown )  ) ?  "kopete_online" : \
"kopete_status_change";  
+        m_oldStatus=m_metaContact->status();
+
 #if KDE_VERSION >= 0x030101
         int winId = KopeteSystemTray::systemTray() ?
@@ -559,13 +561,9 @@ void KopeteMetaContactLVI::slotBlink()
 {
         if (mIsBlinkIcon)
-        {
                 setPixmap(0,SmallIcon(m_metaContact->statusIcon()));
-                mIsBlinkIcon = false;
-        }
         else
-        {
-                setPixmap(0,*mBlinkIcon);
-                mIsBlinkIcon = true;
-        }
+                setPixmap(0,SmallIcon("newmsg"));
+
+        mIsBlinkIcon = !mIsBlinkIcon;
 }
 

--- kdenonbeta/kopete/kopete/contactlist/kopetemetacontactlvi.h  #1.12:1.12.2.1
@@ -184,4 +184,6 @@ private:
         int m_pixelWide;
 
+        /*KopeteOnlineStatus::OnlineStatus*/ unsigned int m_oldStatus;
+
         KopeteEvent *m_event;
         QTimer *mBlinkTimer;
@@ -190,13 +192,4 @@ private:
 
         bool mIsBlinkIcon;
-
-        /**
-         * this is the ison used by the LVI when a event is pending.
-         * this is a pointer because i can't create static QPixmap
-         * (QPaintDevice: Must construct a QApplication before a QPaintDevice)
-         */
-        static QPixmap *mBlinkIcon;
-
-
 };
 


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

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