summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagelist.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp
index 844f43f..998dae9 100644
--- a/noncore/unsupported/oipkg/packagelist.cpp
+++ b/noncore/unsupported/oipkg/packagelist.cpp
@@ -173,13 +173,13 @@ void PackageList::readFileEntries( QString filename, QString dest )
173 pvDebug(5,"PackageList::readFileEntries "+filename+" dest "+dest); 173 pvDebug(5,"PackageList::readFileEntries "+filename+" dest "+dest);
174 QStringList packEntry; 174 QStringList packEntry;
175 QFile f( filename ); 175 QFile f( filename );
176 if ( !f.open(IO_ReadOnly) ) return; 176 if ( !f.open(IO_ReadOnly) ) return;
177 QTextStream *statusStream = new QTextStream( &f ); 177 QTextStream *statusStream = new QTextStream( &f );
178 while ( !statusStream ->eof() ) 178 while ( !statusStream ->eof() )
179 { 179 {
180 QString line = statusStream->readLine(); 180 QString line = statusStream->readLine();
181 if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) 181 if ( line.find(QRegExp("[\n\t ]*")) || line == "" )
182 { 182 {
183 //end of package 183 //end of package
184 if ( ! packEntry.isEmpty() ) 184 if ( ! packEntry.isEmpty() )
185 { 185 {
@@ -192,12 +192,23 @@ void PackageList::readFileEntries( QString filename, QString dest )
192 } 192 }
193 } 193 }
194 }else{ 194 }else{
195 packEntry << line; 195 packEntry << line;
196 }; 196 };
197 } 197 }
198 //there might be no nl at the end of the package file
199 if ( ! packEntry.isEmpty() )
200 {
201 Package *p = new Package( packEntry, settings );
202 if ( p )
203 {
204 p->setDest( dest );
205 insertPackage( p );
206 packEntry.clear();
207 }
208 }
198 delete statusStream; 209 delete statusStream;
199 return; 210 return;
200} 211}
201 212
202void PackageList::setSettings( PackageManagerSettings *s ) 213void PackageList::setSettings( PackageManagerSettings *s )
203{ 214{