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

List:       kde-commits
Subject:    kdebase/kicker/applets/media
From:       Kévin Ottens <ervin () ipsquad ! net>
Date:       2005-02-15 13:37:12
Message-ID: 20050215133712.943B71BAB0 () office ! kde ! org
[Download RAW message or body]

CVS commit by ervin: 

We don't simply add a button when we get a "new" signal. Sometimes the button
is already there, in this case simply refresh it.

BUGS:99321


  M +16 -2     mediaapplet.cpp   1.14


--- kdebase/kicker/applets/media/mediaapplet.cpp  #1.13:1.14
@@ -188,5 +188,19 @@ void MediaApplet::slotNewItems(const KFi
         for(KFileItemListIterator it(entries); it.current(); ++it)
         {
-                if( !mExcludedList.contains(it.current()->url().url()) )
+                kdDebug() << "item: " << it.current()->url() << endl;
+
+                bool found = false;
+                for(MediumButton *button = mButtonList.first();
+                    button; button = mButtonList.next())
+                {
+                        if(button->fileItem().url()==it.current()->url())
+                        {
+                                found = true;
+                                button->setFileItem(*it.current());
+                                break;
+                        }
+                }
+                
+                if(!found && !mExcludedList.contains(it.current()->url().url()) )
                 {
                         MediumButton *button = new MediumButton(this, *it.current());
@@ -201,5 +215,5 @@ void MediaApplet::slotNewItems(const KFi
 void MediaApplet::slotDeleteItem(KFileItem *fileItem)
 {
-        kdDebug()<<"MediumApplet::slotDeleteItems"<<endl;
+        kdDebug()<<"MediumApplet::slotDeleteItem:"<< fileItem->url() << endl;
 
         for(MediumButton *button = mButtonList.first(); button; button = mButtonList.next())


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

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