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

List:       kde-commits
Subject:    KDE/kdebase/kicker/applets/media
From:       Kévin Ottens <ervin () ipsquad ! net>
Date:       2005-06-09 11:08:24
Message-ID: 1118315304.152844.11856.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 423687 by ervin:

Don't use QPtrList anymore. It'll disappear in Qt4.


 M  +25 -4     mediaapplet.cpp  
 M  +1 -1      mediaapplet.h  


--- trunk/KDE/kdebase/kicker/applets/media/mediaapplet.cpp #423686:423687
@@ -53,7 +53,6 @@
 	setAcceptDrops(true);
 	
 	loadConfig();
-	mButtonList.setAutoDelete(true);
 
 	mpDirLister = new KDirLister();
 
@@ -76,7 +75,14 @@
 MediaApplet::~MediaApplet()
 {
 	delete mpDirLister;
-	mButtonList.clear();
+	
+	while (!mButtonList.isEmpty())
+	{
+		MediumButton *b = mButtonList.first();
+		mButtonList.remove(b);
+		delete b;
+	}
+	
         KGlobal::locale()->removeCatalogue("mediaapplet");
 }
 
@@ -225,7 +231,13 @@
 {
 	kdDebug()<<"MediaApplet::slotClear"<<endl;
 
-	mButtonList.clear();
+	while (!mButtonList.isEmpty())
+	{
+		MediumButton *b = mButtonList.first();
+		mButtonList.remove(b);
+		delete b;
+	}
+	
 	arrangeButtons();
 }
 
@@ -279,6 +291,7 @@
 		if(button->fileItem().url()==fileItem->url())
 		{
 			mButtonList.remove(button);
+			delete button;
 			break;
 		}
 	}
@@ -304,6 +317,7 @@
 				if(mExcludedTypesList.contains(mimetype))
 				{
 					mButtonList.remove(button);
+					delete button;
 				}
 				else
 				{
@@ -375,7 +389,14 @@
 void MediaApplet::reloadList()
 {
 	mpDirLister->stop();
-	mButtonList.clear();
+	
+	while (!mButtonList.isEmpty())
+	{
+		MediumButton *b = mButtonList.first();
+		mButtonList.remove(b);
+		delete b;
+	}
+	
 	mpDirLister->clearMimeFilter();
 	mpDirLister->setMimeExcludeFilter(mExcludedTypesList);
 	mpDirLister->openURL(KURL("media:/"));
--- trunk/KDE/kdebase/kicker/applets/media/mediaapplet.h #423686:423687
@@ -33,7 +33,7 @@
 
 #include <qptrlist.h>
 #include "mediumbutton.h"
-typedef QPtrList<MediumButton> MediumButtonList;
+typedef QValueList<MediumButton*> MediumButtonList;
 
 
 class MediaApplet : public KPanelApplet
[prev in list] [next in list] [prev in thread] [next in thread] 

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