author | drw <drw> | 2004-11-17 00:43:35 (UTC) |
---|---|---|
committer | drw <drw> | 2004-11-17 00:43:35 (UTC) |
commit | 718a7a8ba68e10faa1a22fcc6bdc26e1723b2a40 (patch) (unidiff) | |
tree | a6bf4f10db4141ba7098d76d0444bd4d1dd759c1 /noncore/settings/packagemanager/opackagemanager.cpp | |
parent | 216434aff5921f3c3c2efc9adb58e653a5d224b3 (diff) | |
download | opie-718a7a8ba68e10faa1a22fcc6bdc26e1723b2a40.zip opie-718a7a8ba68e10faa1a22fcc6bdc26e1723b2a40.tar.gz opie-718a7a8ba68e10faa1a22fcc6bdc26e1723b2a40.tar.bz2 |
Some code clean-up items (thanks to zecke)
Diffstat (limited to 'noncore/settings/packagemanager/opackagemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/opackagemanager.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp index f75d3b3..cbddfe7 100644 --- a/noncore/settings/packagemanager/opackagemanager.cpp +++ b/noncore/settings/packagemanager/opackagemanager.cpp | |||
@@ -1,37 +1,37 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2003 Dan Williams <drw@handhelds.org> | 4 | Copyright (c) 2003 Dan Williams <drw@handhelds.org> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include "opackagemanager.h" | 32 | #include "opackagemanager.h" |
33 | #include "oipkgconfigdlg.h" | 33 | #include "oipkgconfigdlg.h" |
34 | 34 | ||
35 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
36 | 36 | ||
37 | #include <ctype.h> | 37 | #include <ctype.h> |
@@ -218,58 +218,58 @@ OPackageList *OPackageManager::filterPackages( const QString &name,const QString | |||
218 | default : statusMatch = true; | 218 | default : statusMatch = true; |
219 | break; | 219 | break; |
220 | }; | 220 | }; |
221 | bool categoryMatch = ( category.isNull() || package->category() == category ); | 221 | bool categoryMatch = ( category.isNull() || package->category() == category ); |
222 | 222 | ||
223 | if ( nameMatch && serverMatch && destinationMatch && statusMatch && categoryMatch ) | 223 | if ( nameMatch && serverMatch && destinationMatch && statusMatch && categoryMatch ) |
224 | pl->append( packageIt.current() ); | 224 | pl->append( packageIt.current() ); |
225 | } | 225 | } |
226 | 226 | ||
227 | return pl; | 227 | return pl; |
228 | } | 228 | } |
229 | 229 | ||
230 | QStringList *OPackageManager::servers() | 230 | QStringList OPackageManager::servers() |
231 | { | 231 | { |
232 | QStringList *sl = new QStringList(); | 232 | QStringList sl; |
233 | 233 | ||
234 | OConfItemList *serverList = m_ipkg.servers(); | 234 | OConfItemList *serverList = m_ipkg.servers(); |
235 | if ( serverList ) | 235 | if ( serverList ) |
236 | { | 236 | { |
237 | for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt ) | 237 | for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt ) |
238 | { | 238 | { |
239 | OConfItem *server = serverIt.current(); | 239 | OConfItem *server = serverIt.current(); |
240 | 240 | ||
241 | // Add only active servers | 241 | // Add only active servers |
242 | if ( server->active() ) | 242 | if ( server->active() ) |
243 | *sl << server->name(); | 243 | sl << server->name(); |
244 | } | 244 | } |
245 | } | 245 | } |
246 | 246 | ||
247 | return sl; | 247 | return sl; |
248 | } | 248 | } |
249 | 249 | ||
250 | QStringList *OPackageManager::destinations() | 250 | QStringList OPackageManager::destinations() |
251 | { | 251 | { |
252 | QStringList *dl = new QStringList(); | 252 | QStringList dl; |
253 | 253 | ||
254 | OConfItemList *destList = m_ipkg.destinations(); | 254 | OConfItemList *destList = m_ipkg.destinations(); |
255 | if ( destList ) | 255 | if ( destList ) |
256 | { | 256 | { |
257 | for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt ) | 257 | for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt ) |
258 | { | 258 | { |
259 | OConfItem *destination = destIt.current(); | 259 | OConfItem *destination = destIt.current(); |
260 | 260 | ||
261 | // Add only active destinations | 261 | // Add only active destinations |
262 | if ( destination->active() ) | 262 | if ( destination->active() ) |
263 | *dl << destination->name(); | 263 | dl << destination->name(); |
264 | } | 264 | } |
265 | } | 265 | } |
266 | 266 | ||
267 | return dl; | 267 | return dl; |
268 | } | 268 | } |
269 | 269 | ||
270 | OConfItem *OPackageManager::findConfItem( OConfItem::Type type, const QString &name ) | 270 | OConfItem *OPackageManager::findConfItem( OConfItem::Type type, const QString &name ) |
271 | { | 271 | { |
272 | OConfItem *confItem = 0x0; | 272 | OConfItem *confItem = 0x0; |
273 | OConfItemList *confList = m_ipkg.configItems(); | 273 | OConfItemList *confList = m_ipkg.configItems(); |
274 | if ( confList ) | 274 | if ( confList ) |
275 | { | 275 | { |
@@ -321,25 +321,25 @@ int OPackageManager::compareVersions( const QString &ver1, const QString &ver2 ) | |||
321 | 321 | ||
322 | bool OPackageManager::configureDlg( bool installOptions ) | 322 | bool OPackageManager::configureDlg( bool installOptions ) |
323 | { | 323 | { |
324 | OIpkgConfigDlg dlg( &m_ipkg, installOptions, static_cast<QWidget *>(parent()) ); | 324 | OIpkgConfigDlg dlg( &m_ipkg, installOptions, static_cast<QWidget *>(parent()) ); |
325 | return ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); | 325 | return ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); |
326 | } | 326 | } |
327 | 327 | ||
328 | void OPackageManager::saveSettings() | 328 | void OPackageManager::saveSettings() |
329 | { | 329 | { |
330 | m_ipkg.saveSettings(); | 330 | m_ipkg.saveSettings(); |
331 | } | 331 | } |
332 | 332 | ||
333 | bool OPackageManager::executeCommand( OPackage::Command command, QStringList *packages, | 333 | bool OPackageManager::executeCommand( OPackage::Command command, const QStringList &packages, |
334 | const QString &destination, const QObject *receiver, | 334 | const QString &destination, const QObject *receiver, |
335 | const char *slotOutput, bool rawOutput ) | 335 | const char *slotOutput, bool rawOutput ) |
336 | { | 336 | { |
337 | return m_ipkg.executeCommand( command, packages, destination, receiver, slotOutput, rawOutput ); | 337 | return m_ipkg.executeCommand( command, packages, destination, receiver, slotOutput, rawOutput ); |
338 | } | 338 | } |
339 | 339 | ||
340 | void OPackageManager::parseVersion( const QString &verstr, int *epoch, QString *version, | 340 | void OPackageManager::parseVersion( const QString &verstr, int *epoch, QString *version, |
341 | QString *revision ) | 341 | QString *revision ) |
342 | { | 342 | { |
343 | *epoch = 0; | 343 | *epoch = 0; |
344 | *revision = QString::null; | 344 | *revision = QString::null; |
345 | 345 | ||