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

List:       kde-commits
Subject:    KDE/kdebase/kdeprint/slave
From:       Laurent Montel <montel () kde ! org>
Date:       2006-02-28 13:46:06
Message-ID: 1141134366.771800.22786.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 514443 by mlaurent:

Compile/link


 M  +30 -22    kio_print.cpp  


--- trunk/KDE/kdebase/kdeprint/slave/kio_print.cpp #514442:514443
@@ -41,7 +41,7 @@
 #include <ktempfile.h>
 #include <qfile.h>
 #include <qdom.h>
-
+#include <Q3PtrListIterator>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/stat.h>
@@ -194,18 +194,19 @@
 			return;
 		}
 
-		Q3PtrListIterator<KMPrinter>	it(*(KMManager::self()->printerList()));
-		for (;it.current();++it)
+		QListIterator<KMPrinter*>	it(*(KMManager::self()->printerList()));
+		while (it.hasNext())
 		{
-			if (!(it.current()->type() & mask) || !it.current()->instanceName().isEmpty())
+			KMPrinter *itr = it.next();
+			if (!(itr->type() & mask) || !itr->instanceName().isEmpty())
 			{
-				PRINT_DEBUG << "rejecting " << it.current()->name() << endl;
+				PRINT_DEBUG << "rejecting " << itr->name() << endl;
 				continue;
 			}
 
 			//createFileEntry(entry, it.current()->name(), \
                ("print:/"+path[0]+"/"+it.current()->name()), mimeType, "text/html", \
                S_IFDIR);
-			createDirEntry(entry, it.current()->name(), \
                ("print:/"+group+"/"+KUrl::encode_string_no_slash(it.current()->name())), \
                mimeType);
-			PRINT_DEBUG << "accepting " << it.current()->name() << endl;
+			createDirEntry(entry, itr->name(), \
("print:/"+group+"/"+KUrl::encode_string_no_slash(itr->name())), mimeType); \
+			PRINT_DEBUG << "accepting " << itr->name() << endl;  listEntry(entry, false);
 		}
 
@@ -800,12 +801,15 @@
 		mgr->addPrinter(prt->printerName(), type);
 	else
 	{
-		Q3PtrListIterator<KMPrinter>	pit(*(KMManager::self()->printerList()));
-		for (; pit.current(); ++pit)
-			if (pit.current()->isVirtual() || pit.current()->isSpecial())
+		QListIterator<KMPrinter *> pit(*(KMManager::self()->printerList()));
+		while (pit.hasNext())
+		{
+			KMPrinter *itprint = pit.next();
+			if (itprint->isVirtual() || itprint->isSpecial())
 				continue;
 			else
-				mgr->addPrinter(pit.current()->printerName(), type);
+				mgr->addPrinter(itprint->printerName(), type);
+		}
 	}
 
 	QString	content;
@@ -844,16 +848,17 @@
 	content = content.arg(i18n("ID")).arg(i18n("Owner")).arg(i18n("Printer")).arg(i18n("Name")).arg(i18n("State"));
  
 	QString	jobContent, cellContent("<td>%1</td>\n");
-	Q3PtrListIterator<KMJob>	it(mgr->jobList());
+	QListIterator<KMJob *> it(mgr->jobList());
 	bool	flag(true);
-	for (; it.current(); ++it, flag = !flag)
+	while (it.hasNext() && (flag = !flag))
 	{
+		KMJob *job = it.next();
 		jobContent.append("<tr class=\"").append(flag ? "contentyellow" : \
                "contentwhite").append("\">\n");
-		jobContent.append(cellContent.arg(it.current()->id()));
-		jobContent.append(cellContent.arg(it.current()->owner()));
-		jobContent.append(cellContent.arg(it.current()->printer()));
-		jobContent.append(cellContent.arg(it.current()->name()));
-		jobContent.append(cellContent.arg(it.current()->stateString()));
+		jobContent.append(cellContent.arg(job->id()));
+		jobContent.append(cellContent.arg(job->owner()));
+		jobContent.append(cellContent.arg(job->printer()));
+		jobContent.append(cellContent.arg(job->name()));
+		jobContent.append(cellContent.arg(job->stateString()));
 		jobContent.append("</tr>\n");
 	}
 	content = content.arg(jobContent);
@@ -863,12 +868,15 @@
 		mgr->removePrinter(prt->printerName(), type);
 	else
 	{
-		Q3PtrListIterator<KMPrinter>	pit(*(KMManager::self()->printerList()));
-		for (; pit.current(); ++pit)
-			if (pit.current()->isVirtual() || pit.current()->isSpecial())
+		QListIterator<KMPrinter *> pit(*(KMManager::self()->printerList()));
+		while (pit.hasNext())
+		{
+			KMPrinter *pitCurrent = pit.next();
+			if (pitCurrent->isVirtual() || pitCurrent->isSpecial())
 				continue;
 			else
-				mgr->removePrinter(pit.current()->printerName(), type);
+				mgr->removePrinter(pitCurrent->printerName(), type);
+		}
 	}
 
 	data(content.toLocal8Bit());


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

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