[Kde-print-devel] [Bug 97342] network filenames end up the same in kprinter

Lubos Lunak l.lunak at kde.org
Fri Nov 3 18:43:11 CET 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=97342         
l.lunak kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From l.lunak kde org  2006-11-03 18:43 -------
SVN commit 601577 by lunakl:

Clean up handling of filenames and urls. Apparently "kde-filelist"
can contain urls, so just use those. Results in less ugly filenames
and fixes incorrect NetAccess::download() usage as a side-effect.
BUG: 97342



 M  +1 -1      kdebase/kdeprint/kprinter/printwrapper.cpp  
 M  +7 -13     kdelibs/kdeprint/kfilelist.cpp  


--- branches/KDE/3.5/kdebase/kdeprint/kprinter/printwrapper.cpp #601576:601577
 @ -304,7 +304,7  @
 	for (QStringList::ConstIterator it=files.begin(); it!=files.end(); ++it)
 	{
 		QString	tmpFile;
-		KURL	url(*it);
+		KURL	url = KURL::fromPathOrURL(*it);
 		kdDebug( 500 ) << url.url() << endl;
 		if (KIO::NetAccess::download(url, tmpFile, this))
 		{
--- branches/KDE/3.5/kdelibs/kdeprint/kfilelist.cpp #601576:601577
 @ -189,17 +189,12  @
 		while (item && item->nextSibling())
 			item = item->nextSibling();
 
-		// for each file, download it (if necessary) and add it
-		QString	downloaded;
 		for (KURL::List::ConstIterator it=files.begin(); it!=files.end(); ++it)
-			if (KIO::NetAccess::download(*it, downloaded, this))
-			{
-				KURL	url;
-				url.setPath(downloaded);
-				KMimeType::Ptr	mime = KMimeType::findByURL(url, 0, true, false);
-				item = new QListViewItem(m_files, item, url.fileName(), mime->comment(), downloaded);
-				item->setPixmap(0, mime->pixmap(url, KIcon::Small));
-			}
+		{
+			KMimeType::Ptr	mime = KMimeType::findByURL( *it, 0, true, false);
+			item = new QListViewItem(m_files, item, (*it).fileName(), mime->comment(), (*it).url());
+			item->setPixmap(0, mime->pixmap(*it, KIcon::Small));
+		}
 
 		slotSelectionChanged();
 		/*
 @ -220,10 +215,9  @
 	QListViewItem *item = 0;
 	for (QStringList::ConstIterator it=files.begin(); it!=files.end(); ++it)
 	{
-		KURL	url;
-		url.setPath(*it);
+		KURL	url = KURL::fromPathOrURL( *it );
 		KMimeType::Ptr	mime = KMimeType::findByURL(url, 0, true, false);
-		item = new QListViewItem(m_files, item, url.fileName(), mime->comment(), *it);
+		item = new QListViewItem(m_files, item, url.fileName(), mime->comment(), url.url());
 		item->setPixmap(0, mime->pixmap(url, KIcon::Small));
 	}
 	slotSelectionChanged();


More information about the Kde-print-devel mailing list