summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/oconfitem.h7
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp7
-rw-r--r--noncore/settings/packagemanager/opie-packagemanager.control4
3 files changed, 5 insertions, 13 deletions
diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h
index 7b52ce4..9972c00 100644
--- a/noncore/settings/packagemanager/oconfitem.h
+++ b/noncore/settings/packagemanager/oconfitem.h
@@ -25,38 +25,33 @@ _;:, .> :=|. This program is free software; you can
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OCONFITEM_H
#define OCONFITEM_H
#include <qlist.h>
#include <qstring.h>
class OConfItem
{
public:
- enum Type { Source=0x01,
- GzSource=0x02,
- Destination=0x04,
- Option=0x08,
- Arch=0x10,
- NotDefined=0x20 };
+ enum Type { Source, Destination, Option, Arch, NotDefined };
OConfItem( Type type = NotDefined, const QString &name = QString::null,
const QString &value = QString::null, const QString &features = QString::null,
bool active = true );
Type type() { return m_type; }
const QString &name() { return m_name; }
const QString &value() { return m_value; }
const QString &features() { return m_features; }
bool active() { return m_active; }
void setType( Type type ) { m_type = type; }
void setName( const QString &name ) { m_name = name; }
void setValue( const QString &value ) { m_value = value; }
void setFeatures( const QString &features ) { m_features = features; }
void setActive( bool active ) { m_active = active; }
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp
index a885ef8..f2d7e39 100644
--- a/noncore/settings/packagemanager/oipkg.cpp
+++ b/noncore/settings/packagemanager/oipkg.cpp
@@ -101,34 +101,33 @@ OIpkg::~OIpkg()
if ( m_confInfo )
m_confInfo->setAutoDelete( true );
// Free up libipkg resources
ipkg_deinit( &m_ipkgArgs );
}
OConfItemList *OIpkg::configItems()
{
// Retrieve all configuration items
return filterConfItems();
}
OConfItemList *OIpkg::servers()
{
// Retrieve only servers
- return filterConfItems( (OConfItem::Type)((int)OConfItem::Source |
- (int)OConfItem::GzSource) );
+ return filterConfItems( OConfItem::Source );
}
OConfItemList *OIpkg::destinations()
{
// Retrieve only destinations
return filterConfItems( OConfItem::Destination );
}
OConfItemList *OIpkg::options()
{
// Retrieve only destinations
return filterConfItems( OConfItem::Option );
}
void OIpkg::setConfigItems( OConfItemList *configList )
{
@@ -531,33 +530,32 @@ void OIpkg::loadConfiguration()
// Read in file
QFile f( absFile );
if ( f.open( IO_ReadOnly ) )
{
QTextStream s( &f );
while ( !s.eof() )
{
QString line = s.readLine().simplifyWhiteSpace();
// Parse line and save info to the conf options list
if ( !line.isEmpty() )
{
if ( !line.startsWith( "#" ) ||
line.startsWith( "#src" ) ||
- line.startsWith( "#src/gz" ) ||
line.startsWith( "#dest" ) ||
line.startsWith( "#arch" ) ||
line.startsWith( "#option" ) )
{
int pos = line.find( ' ', 1 );
// Type
QString typeStr = line.left( pos );
OConfItem::Type type;
QString features;
if ( typeStr == "src" || typeStr == "#src" )
type = OConfItem::Source;
else if ( typeStr == "src/gz" || typeStr == "#src/gz" )
{
type = OConfItem::Source;
features = "Compressed";
@@ -607,34 +605,33 @@ OConfItemList *OIpkg::filterConfItems( OConfItem::Type typefilter )
{
// Load Ipkg configuration info if not already cached
if ( !m_confInfo )
loadConfiguration();
// Build new server list (caller is responsible for deleting)
OConfItemList *sl = new OConfItemList;
// If typefilter is empty, retrieve all items
bool retrieveAll = ( typefilter == OConfItem::NotDefined );
// Parse configuration info for servers
OConfItemListIterator it( *m_confInfo );
for ( ; it.current(); ++it )
{
OConfItem *item = it.current();
- if ( retrieveAll ||
- ( item->type() & typefilter ) )
+ if ( retrieveAll || item->type() == typefilter )
{
sl->append( item );
}
}
return sl;
}
const QString &OIpkg::rootPath()
{
if ( m_rootPath.isEmpty() )
{
OConfItem *rootDest = findConfItem( OConfItem::Destination, "root" );
rootDest ? m_rootPath = rootDest->value()
: m_rootPath = '/';
if ( m_rootPath.right( 1 ) == '/' )
diff --git a/noncore/settings/packagemanager/opie-packagemanager.control b/noncore/settings/packagemanager/opie-packagemanager.control
index 0153d40..da3ddfe 100644
--- a/noncore/settings/packagemanager/opie-packagemanager.control
+++ b/noncore/settings/packagemanager/opie-packagemanager.control
@@ -1,10 +1,10 @@
Package: opie-packagemanager
Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop
Priority: optional
Section: opie/settings
-Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg0 (>=0.99.120), ipkg-link
+Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg (>=0.99.120)
Replaces: packagemanager
Architecture: arm
Maintainer: Dan Williams (drw@handhelds.org)
Description: Opie package management client
-Version: $QPE_VERSION$EXTRAVERSION
+Version: 0.6.1$EXTRAVERSION