summaryrefslogtreecommitdiff
authortille <tille>2002-07-24 11:37:36 (UTC)
committer tille <tille>2002-07-24 11:37:36 (UTC)
commitadfb21cd5e2fcf750543570ab9c6427f1fba9968 (patch) (unidiff)
tree1a55eb15bd48b373cd3a88a41cb5733af9f9a4b9
parent0948a167e4e46e6d2082809ec47be6a08a5de9d7 (diff)
downloadopie-adfb21cd5e2fcf750543570ab9c6427f1fba9968.zip
opie-adfb21cd5e2fcf750543570ab9c6427f1fba9968.tar.gz
opie-adfb21cd5e2fcf750543570ab9c6427f1fba9968.tar.bz2
fix bug #116 -- subsections
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagelist.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp
index 998dae9..edb9cc5 100644
--- a/noncore/unsupported/oipkg/packagelist.cpp
+++ b/noncore/unsupported/oipkg/packagelist.cpp
@@ -138,46 +138,45 @@ QStringList PackageList::getSubSections()
138} 138}
139 139
140void PackageList::setSection( QString sec ) 140void PackageList::setSection( QString sec )
141{ 141{
142 aktSection = sec; 142 aktSection = sec;
143} 143}
144 144
145void PackageList::setSubSection( QString ssec ) 145void PackageList::setSubSection( QString ssec )
146{ 146{
147 aktSubSection = ssec; 147 aktSubSection = ssec;
148} 148}
149 149
150void PackageList::updateSections( Package* pack ) 150void PackageList::updateSections( Package* pack )
151{ 151{
152 QString s = pack->section(); 152 QString s = pack->section();
153 if ( s.isEmpty() || s == "") return; 153 if ( s.isEmpty() || s == "") return;
154 if ( sections.contains(s) ) return; 154 if ( !sections.contains(s) ) sections += s;
155 sections += s;
156 QString ss = pack->subSection(); 155 QString ss = pack->subSection();
157 if ( ss.isEmpty() || ss == "" ) return; 156 if ( ss.isEmpty() || ss == "" ) return;
158 if ( !subSections[s] ) { 157 if ( !subSections[s] ) {
159 subSections.insert( s, new QStringList() ); 158 subSections.insert( s, new QStringList() );
160 QStringList *subsecs = subSections[s]; 159 QStringList *subsecs = subSections[s];
161 *subsecs += "All"; 160 *subsecs += "All";
162 } 161 }
163 QStringList *subsecs = subSections[s]; 162 QStringList *subsecs = subSections[s];
164 *subsecs += ss; 163 if ( !subsecs->contains(ss) ) *subsecs += ss;
165 if ( !subSections["All"] ) subSections.insert( "All", new QStringList() ); 164// if ( !subSections["All"] ) subSections.insert( "All", new QStringList() );
166 subsecs = subSections["All"]; 165// subsecs = subSections["All"];
167 *subsecs += ss; 166// *subsecs += ss;
168} 167}
169 168
170 169
171void PackageList::readFileEntries( QString filename, QString dest ) 170void PackageList::readFileEntries( QString filename, QString dest )
172 { 171 {
173 pvDebug(5,"PackageList::readFileEntries "+filename+" dest "+dest); 172 pvDebug(5,"PackageList::readFileEntries "+filename+" dest "+dest);
174 QStringList packEntry; 173 QStringList packEntry;
175 QFile f( filename ); 174 QFile f( filename );
176 if ( !f.open(IO_ReadOnly) ) return; 175 if ( !f.open(IO_ReadOnly) ) return;
177 QTextStream *statusStream = new QTextStream( &f ); 176 QTextStream *statusStream = new QTextStream( &f );
178 while ( !statusStream ->eof() ) 177 while ( !statusStream ->eof() )
179 { 178 {
180 QString line = statusStream->readLine(); 179 QString line = statusStream->readLine();
181 if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) 180 if ( line.find(QRegExp("[\n\t ]*")) || line == "" )
182 { 181 {
183 //end of package 182 //end of package