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

List:       kde-commits
Subject:    kdesupport/kdewin32/installer/shared
From:       Ralf Habacker <Ralf.Habacker () freenet ! de>
Date:       2007-01-31 22:09:11
Message-ID: 1170281351.264739.8102.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 628907 by habacker:

downloadPackageLists(): first try to implement "exclude package" option by \
downloading package list of a given site every time to be able to exclude packages. \
not sure if this is the best method. Especially the handling with installed package \
of the same name need to be fixed. 


 M  +24 -34    installerengine.cpp  


--- trunk/kdesupport/kdewin32/installer/shared/installerengine.cpp #628906:628907
@@ -76,46 +76,36 @@
 
 		// FIXME: it is probably better to download package list every 
 		//        time and to sync with local copy 
-        if ( !packageList->hasConfig() )
-        {
-            // download package list
-            qDebug() << (*s)->url();
+
+		// download package list
+        qDebug() << (*s)->url();
 #ifdef DEBUG
-            QFileInfo tmpFile(installer->Root() + \
                "/packages-"+(*s)->Name()+".html");
-            if (!tmpFile.exists())
-                m_downloader->start((*s)->URL(), ba));
+        QFileInfo tmpFile(installer->Root() + "/packages-"+(*s)->Name()+".html");
+        if (!tmpFile.exists())
+            m_downloader->start((*s)->URL(), ba));
 
-            // load and parse
-            if (!packageList->readHTMLFromFile(tmpFile.absoluteFilePath(),(*s)->Type() \
== Site::ApacheModIndex ? PackageList::ApacheModIndex : PackageList::SourceForge )) + \
// load and parse +        if \
(!packageList->readHTMLFromFile(tmpFile.absoluteFilePath(),(*s)->Type() == \
Site::ApacheModIndex ? PackageList::ApacheModIndex : PackageList::SourceForge ))  \
                #else            
-            QByteArray ba;
-            m_downloader->start((*s)->url(), ba);
-            if (!packageList->readHTMLFromByteArray(ba,(*s)->Type() == \
Site::ApacheModIndex ? PackageList::ApacheModIndex : PackageList::SourceForge )) +    \
QByteArray ba; +        m_downloader->start((*s)->url(), ba);
+        if (!packageList->readHTMLFromByteArray(ba,(*s)->Type() == \
Site::ApacheModIndex ? PackageList::ApacheModIndex : PackageList::SourceForge ))  \
                #endif
-            {
-                qDebug() << "error reading package list from download html file";
-                continue;
-            }
-
-            // save into file
-            if (!packageList->writeToFile())
-            {
-                qDebug() << "error writing package list to file";
-                continue;
-            }
-
-        }
-        else
         {
-            // read list from file
-            if (!packageList->readFromFile())
-            {
-                qDebug() << "error reading package list from file";
-                continue;
-            }
+            qDebug() << "error reading package list from download html file";
+            continue;
         }
-    }
-    return true;
+	
+		if (packageList->hasConfig())
+			packageList->syncWithFile();
+
+		if (!packageList->writeToFile())
+		{
+			  qDebug() << "error writing package list to file";
+			continue;
+		}
+	}
+	return true;
 }
 
 #ifdef USE_GUI


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

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