author | tille <tille> | 2002-07-24 11:49:21 (UTC) |
---|---|---|
committer | tille <tille> | 2002-07-24 11:49:21 (UTC) |
commit | 919228ff6aeb72b6d2585ae108e86d27d0b6bdb1 (patch) (side-by-side diff) | |
tree | 329dae48711cda4d05b0e7c02ae3a329b80606ff | |
parent | adfb21cd5e2fcf750543570ab9c6427f1fba9968 (diff) | |
download | opie-919228ff6aeb72b6d2585ae108e86d27d0b6bdb1.zip opie-919228ff6aeb72b6d2585ae108e86d27d0b6bdb1.tar.gz opie-919228ff6aeb72b6d2585ae108e86d27d0b6bdb1.tar.bz2 |
hopeing to fix bug #119
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 11c0f97..7682d49 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp @@ -137,65 +137,65 @@ QStringList* PmIpkg::getList( QString packFileName, QString d ) out( "Could not open:\n"+packFileDir ); f.close(); packFileDir = "/"+statusDir+"/info/"+packFileName+".list"; f.setName( packFileDir ); qDebug("Try to open %s", packFileDir.latin1()); if ( ! f.open(IO_ReadOnly) ) { qDebug(" Panik! Could not open"+packFileDir); out( "Could not open:\n"+packFileDir+"\n Panik!" ); return (QStringList*)0; } } QStringList *fileList = new QStringList(); QTextStream t( &f ); while ( !t.eof() ) { *fileList += t.readLine(); } f.close(); return fileList; } void PmIpkg::linkPackage( QString packFileName, QString dest ) { if (dest == "root" || dest == "/" ) return; QStringList *fileList = getList( packFileName, dest ); processFileList( fileList, dest ); delete fileList; } void PmIpkg::processFileList( QStringList *fileList, QString d ) { - if (!fileList) return; + if (!fileList || fileList->isEmpty()) return; for (uint i=0; i < fileList->count(); i++) { QString dest = settings->getDestinationUrlByName( d ); dest = dest==""?d:dest; processLinkDir( (*fileList)[i], dest ); } } void PmIpkg::processLinkDir( QString file, QString dest ) { pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest); if (linkOpp==createLink) pvDebug( 4,"opp: createLink"); if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); if ( dest == "???" || dest == "" ) return; QString destFile = file; file = dest+"/"+file; if (file == dest) return; // if (linkOpp==createLink) out( "\ncreating links\n" ); // if (linkOpp==removeLink) out( "\nremoving links\n" ); QFileInfo fileInfo( file ); if ( fileInfo.isDir() ) { pvDebug(4, "process dir "+file); QDir destDir( destFile ); if (linkOpp==createLink) destDir.mkdir( destFile, true ); QDir d( file ); // d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); QFileInfo *fi; while ( (fi=it.current()) ) |