Diffstat (limited to 'noncore/settings/packagemanager') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oconfitem.h | 7 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkg.cpp | 7 | ||||
-rw-r--r-- | noncore/settings/packagemanager/opie-packagemanager.control | 4 |
3 files changed, 13 insertions, 5 deletions
diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h index 9972c00..7b52ce4 100644 --- a/noncore/settings/packagemanager/oconfitem.h +++ b/noncore/settings/packagemanager/oconfitem.h | |||
@@ -29,25 +29,30 @@ _;:, .> :=|. This program is free software; you can | |||
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef OCONFITEM_H | 32 | #ifndef OCONFITEM_H |
33 | #define OCONFITEM_H | 33 | #define OCONFITEM_H |
34 | 34 | ||
35 | #include <qlist.h> | 35 | #include <qlist.h> |
36 | #include <qstring.h> | 36 | #include <qstring.h> |
37 | 37 | ||
38 | class OConfItem | 38 | class OConfItem |
39 | { | 39 | { |
40 | public: | 40 | public: |
41 | enum Type { Source, Destination, Option, Arch, NotDefined }; | 41 | enum Type { Source=0x01, |
42 | GzSource=0x02, | ||
43 | Destination=0x04, | ||
44 | Option=0x08, | ||
45 | Arch=0x10, | ||
46 | NotDefined=0x20 }; | ||
42 | 47 | ||
43 | OConfItem( Type type = NotDefined, const QString &name = QString::null, | 48 | OConfItem( Type type = NotDefined, const QString &name = QString::null, |
44 | const QString &value = QString::null, const QString &features = QString::null, | 49 | const QString &value = QString::null, const QString &features = QString::null, |
45 | bool active = true ); | 50 | bool active = true ); |
46 | 51 | ||
47 | Type type() { return m_type; } | 52 | Type type() { return m_type; } |
48 | const QString &name() { return m_name; } | 53 | const QString &name() { return m_name; } |
49 | const QString &value() { return m_value; } | 54 | const QString &value() { return m_value; } |
50 | const QString &features() { return m_features; } | 55 | const QString &features() { return m_features; } |
51 | bool active() { return m_active; } | 56 | bool active() { return m_active; } |
52 | 57 | ||
53 | void setType( Type type ) { m_type = type; } | 58 | void setType( Type type ) { m_type = type; } |
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp index f2d7e39..a885ef8 100644 --- a/noncore/settings/packagemanager/oipkg.cpp +++ b/noncore/settings/packagemanager/oipkg.cpp | |||
@@ -105,25 +105,26 @@ OIpkg::~OIpkg() | |||
105 | ipkg_deinit( &m_ipkgArgs ); | 105 | ipkg_deinit( &m_ipkgArgs ); |
106 | } | 106 | } |
107 | 107 | ||
108 | OConfItemList *OIpkg::configItems() | 108 | OConfItemList *OIpkg::configItems() |
109 | { | 109 | { |
110 | // Retrieve all configuration items | 110 | // Retrieve all configuration items |
111 | return filterConfItems(); | 111 | return filterConfItems(); |
112 | } | 112 | } |
113 | 113 | ||
114 | OConfItemList *OIpkg::servers() | 114 | OConfItemList *OIpkg::servers() |
115 | { | 115 | { |
116 | // Retrieve only servers | 116 | // Retrieve only servers |
117 | return filterConfItems( OConfItem::Source ); | 117 | return filterConfItems( (OConfItem::Type)((int)OConfItem::Source | |
118 | (int)OConfItem::GzSource) ); | ||
118 | } | 119 | } |
119 | 120 | ||
120 | OConfItemList *OIpkg::destinations() | 121 | OConfItemList *OIpkg::destinations() |
121 | { | 122 | { |
122 | // Retrieve only destinations | 123 | // Retrieve only destinations |
123 | return filterConfItems( OConfItem::Destination ); | 124 | return filterConfItems( OConfItem::Destination ); |
124 | } | 125 | } |
125 | 126 | ||
126 | OConfItemList *OIpkg::options() | 127 | OConfItemList *OIpkg::options() |
127 | { | 128 | { |
128 | // Retrieve only destinations | 129 | // Retrieve only destinations |
129 | return filterConfItems( OConfItem::Option ); | 130 | return filterConfItems( OConfItem::Option ); |
@@ -534,24 +535,25 @@ void OIpkg::loadConfiguration() | |||
534 | { | 535 | { |
535 | QTextStream s( &f ); | 536 | QTextStream s( &f ); |
536 | while ( !s.eof() ) | 537 | while ( !s.eof() ) |
537 | { | 538 | { |
538 | 539 | ||
539 | QString line = s.readLine().simplifyWhiteSpace(); | 540 | QString line = s.readLine().simplifyWhiteSpace(); |
540 | 541 | ||
541 | // Parse line and save info to the conf options list | 542 | // Parse line and save info to the conf options list |
542 | if ( !line.isEmpty() ) | 543 | if ( !line.isEmpty() ) |
543 | { | 544 | { |
544 | if ( !line.startsWith( "#" ) || | 545 | if ( !line.startsWith( "#" ) || |
545 | line.startsWith( "#src" ) || | 546 | line.startsWith( "#src" ) || |
547 | line.startsWith( "#src/gz" ) || | ||
546 | line.startsWith( "#dest" ) || | 548 | line.startsWith( "#dest" ) || |
547 | line.startsWith( "#arch" ) || | 549 | line.startsWith( "#arch" ) || |
548 | line.startsWith( "#option" ) ) | 550 | line.startsWith( "#option" ) ) |
549 | { | 551 | { |
550 | int pos = line.find( ' ', 1 ); | 552 | int pos = line.find( ' ', 1 ); |
551 | 553 | ||
552 | // Type | 554 | // Type |
553 | QString typeStr = line.left( pos ); | 555 | QString typeStr = line.left( pos ); |
554 | OConfItem::Type type; | 556 | OConfItem::Type type; |
555 | QString features; | 557 | QString features; |
556 | if ( typeStr == "src" || typeStr == "#src" ) | 558 | if ( typeStr == "src" || typeStr == "#src" ) |
557 | type = OConfItem::Source; | 559 | type = OConfItem::Source; |
@@ -609,25 +611,26 @@ OConfItemList *OIpkg::filterConfItems( OConfItem::Type typefilter ) | |||
609 | 611 | ||
610 | // Build new server list (caller is responsible for deleting) | 612 | // Build new server list (caller is responsible for deleting) |
611 | OConfItemList *sl = new OConfItemList; | 613 | OConfItemList *sl = new OConfItemList; |
612 | 614 | ||
613 | // If typefilter is empty, retrieve all items | 615 | // If typefilter is empty, retrieve all items |
614 | bool retrieveAll = ( typefilter == OConfItem::NotDefined ); | 616 | bool retrieveAll = ( typefilter == OConfItem::NotDefined ); |
615 | 617 | ||
616 | // Parse configuration info for servers | 618 | // Parse configuration info for servers |
617 | OConfItemListIterator it( *m_confInfo ); | 619 | OConfItemListIterator it( *m_confInfo ); |
618 | for ( ; it.current(); ++it ) | 620 | for ( ; it.current(); ++it ) |
619 | { | 621 | { |
620 | OConfItem *item = it.current(); | 622 | OConfItem *item = it.current(); |
621 | if ( retrieveAll || item->type() == typefilter ) | 623 | if ( retrieveAll || |
624 | ( item->type() & typefilter ) ) | ||
622 | { | 625 | { |
623 | sl->append( item ); | 626 | sl->append( item ); |
624 | } | 627 | } |
625 | } | 628 | } |
626 | 629 | ||
627 | return sl; | 630 | return sl; |
628 | } | 631 | } |
629 | 632 | ||
630 | const QString &OIpkg::rootPath() | 633 | const QString &OIpkg::rootPath() |
631 | { | 634 | { |
632 | if ( m_rootPath.isEmpty() ) | 635 | if ( m_rootPath.isEmpty() ) |
633 | { | 636 | { |
diff --git a/noncore/settings/packagemanager/opie-packagemanager.control b/noncore/settings/packagemanager/opie-packagemanager.control index da3ddfe..0153d40 100644 --- a/noncore/settings/packagemanager/opie-packagemanager.control +++ b/noncore/settings/packagemanager/opie-packagemanager.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-packagemanager | 1 | Package: opie-packagemanager |
2 | Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop | 2 | Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/settings | 4 | Section: opie/settings |
5 | Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg (>=0.99.120) | 5 | Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg0 (>=0.99.120), ipkg-link |
6 | Replaces: packagemanager | 6 | Replaces: packagemanager |
7 | Architecture: arm | 7 | Architecture: arm |
8 | Maintainer: Dan Williams (drw@handhelds.org) | 8 | Maintainer: Dan Williams (drw@handhelds.org) |
9 | Description: Opie package management client | 9 | Description: Opie package management client |
10 | Version: 0.6.1$EXTRAVERSION | 10 | Version: $QPE_VERSION$EXTRAVERSION |