Package: kdeutils (ark)
Version: 2.2.2-9
Author: Guillem Jover <guillem@hadrons.org>
Status: fixed
Debbug: 137028
Description:
 Fixed movement of files when creating an archive.
 Fixed disk space test using the destination archive directory.

--- arkwidget.cc.old	Mon Jun 18 21:29:19 2001
+++ arkwidget.cc	Mon Mar 11 06:07:45 2002
@@ -1384,7 +1384,7 @@
 
 void ArkWidget::addFile(QStringList *list)
 {
-  if (!Utilities::diskHasSpace(m_strArchName, Utilities::getSizes(list)))
+  if (!Utilities::diskHasSpace(m_strArchName.left(m_strArchName.findRev('/')), Utilities::getSizes(list)))
     return;
 
   // takes a list of KURLs.
@@ -1415,28 +1415,27 @@
     }
   else
     {
-      bool bNotLocal = true;
+      QStringList netfiles;
       // if they are URLs, we have to download them, replace the URLs
       // with filenames, and remember to delete the temporaries later.
       for (QStringList::Iterator it = list->begin(); it != list->end(); ++it)
         {
           QString str = *it;
           kdDebug(1601) << "Want to add " << str<< endl;
-          if (str.left(5) == QString("file:"))
+          KURL url = str;
+          if (url.isLocalFile())
             {
-              bNotLocal = false;
-              break;  // no need to continue
+              continue;  // maybe next is a non-local file
             }
-          KURL url = str;
           QString tempfile = m_settings->getTmpDir();
           tempfile += str.right(str.length() - str.findRev("/") - 1);
           KIO::NetAccess::download(url, tempfile); // TODO test return value
           tempfile = "file:" + tempfile;
           // replace the URL with the name of the temporary
-          *it = tempfile;
+          netfiles += *it = tempfile;
         }
-      if (bNotLocal)
-        mpDownloadedList = new QStringList(*list);
+      if (!netfiles.isEmpty())
+        mpDownloadedList = new QStringList(netfiles);
     }
   arch->addFile(list);
 }
