summaryrefslogtreecommitdiff
authordrw <drw>2004-12-21 00:37:22 (UTC)
committer drw <drw>2004-12-21 00:37:22 (UTC)
commit769f2a09ccfcc639a87600ecb046e9140fe2f691 (patch) (side-by-side diff)
tree27f74b9403d9d41be40e759b7ce238d601b6ef45
parent8c316a01b28879b9f4fc6df736773245c8358ffc (diff)
downloadopie-769f2a09ccfcc639a87600ecb046e9140fe2f691.zip
opie-769f2a09ccfcc639a87600ecb046e9140fe2f691.tar.gz
opie-769f2a09ccfcc639a87600ecb046e9140fe2f691.tar.bz2
Preliminary support for src/gz feeds, it works if you manually update ipkg.conf. Still need to add configuration option on server config dialog tab.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/oconfitem.cpp47
-rw-r--r--noncore/settings/packagemanager/oconfitem.h14
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp17
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp15
4 files changed, 57 insertions, 36 deletions
diff --git a/noncore/settings/packagemanager/oconfitem.cpp b/noncore/settings/packagemanager/oconfitem.cpp
index a90730c..ffa936e 100644
--- a/noncore/settings/packagemanager/oconfitem.cpp
+++ b/noncore/settings/packagemanager/oconfitem.cpp
@@ -1,28 +1,28 @@
/*
-                This file is part of the Opie Project
+ This file is part of the Opie Project
-              Copyright (c) 2003 Dan Williams <drw@handhelds.org>
+ Copyright (c) 2003 Dan Williams <drw@handhelds.org>
=.
.=l.
-           .>+-=
- _;:,     .>    :=|. This program is free software; you can
-.> <`_,   >  .   <= redistribute it and/or modify it under
-:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
-.="- .-=="i,     .._ License as published by the Free Software
- - .   .-<_>     .<> Foundation; either version 2 of the License,
-     ._= =}       : or (at your option) any later version.
-    .%`+i>       _;_.
-    .i_,=:_.      -<s. This program is distributed in the hope that
-     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
-    : ..    .:,     . . . without even the implied warranty of
-    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
-  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
-..}^=.=       =       ; Library General Public License for more
-++=   -.     .`     .: details.
- :     =  ...= . :.=-
- -.   .:....=;==+<; You should have received a copy of the GNU
-  -_. . .   )=.  = Library General Public License along with
-    --        :-=` this library; see the file COPYING.LIB.
+ .>+-=
+_;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
+.="- .-=="i, .._ License as published by the Free Software
+- . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+: = ...= . :.=-
+-. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` 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.
@@ -31,11 +31,12 @@
#include "oconfitem.h"
-OConfItem::OConfItem( Type type, const QString &name,
- const QString &value, bool active )
+OConfItem::OConfItem( Type type, const QString &name, const QString &value,
+ const QString &features, bool active )
: m_type( type )
, m_name( name )
, m_value( value )
+ , m_features( features )
, m_active( active )
{
}
diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h
index 7c158c9..9972c00 100644
--- a/noncore/settings/packagemanager/oconfitem.h
+++ b/noncore/settings/packagemanager/oconfitem.h
@@ -41,22 +41,26 @@ public:
enum Type { Source, Destination, Option, Arch, NotDefined };
OConfItem( Type type = NotDefined, const QString &name = QString::null,
- const QString &value = QString::null, bool active = true );
+ 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 setActive( bool active ) { m_active = 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; }
private:
Type m_type; // Type of configuration item
QString m_name; // Name of item
QString m_value; // Value of item
+ QString m_features; // Comma-deliminated list of features this item supports
bool m_active; // Indicates whether item is currently active
};
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp
index b0cc94d..a66bd51 100644
--- a/noncore/settings/packagemanager/oipkg.cpp
+++ b/noncore/settings/packagemanager/oipkg.cpp
@@ -153,7 +153,14 @@ void OIpkg::setConfigItems( OConfItemList *configList )
switch ( item->type() )
{
- case OConfItem::Source : confLine.append( "src " ); break;
+ case OConfItem::Source :
+ {
+ if ( item->features().contains( "Compressed" ) )
+ confLine.append( "src/gz " );
+ else
+ confLine.append( "src " );
+ }
+ break;
case OConfItem::Destination : confLine.append( "dest " ); break;
case OConfItem::Option : confLine.append( "option " ); break;
case OConfItem::Arch : confLine.append( "arch " ); break;
@@ -508,8 +515,14 @@ void OIpkg::loadConfiguration()
// 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";
+ }
else if ( typeStr == "dest" || typeStr == "#dest" )
type = OConfItem::Destination;
else if ( typeStr == "option" || typeStr == "#option" )
@@ -533,7 +546,7 @@ void OIpkg::loadConfiguration()
bool active = !line.startsWith( "#" );
// Add to list
- m_confInfo->append( new OConfItem( type, name, value, active ) );
+ m_confInfo->append( new OConfItem( type, name, value, features, active ) );
}
}
}
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index 886430f..d9a67f3 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -101,7 +101,8 @@ void OIpkgConfigDlg::accept()
}
else
m_configs->append( new OConfItem( OConfItem::Option, "http_proxy",
- m_proxyHttpServer->text(), m_proxyHttpActive->isChecked() ) );
+ m_proxyHttpServer->text(), QString::null,
+ m_proxyHttpActive->isChecked() ) );
confItem = findConfItem( OConfItem::Option, "ftp_proxy" );
if ( confItem )
@@ -111,7 +112,8 @@ void OIpkgConfigDlg::accept()
}
else
m_configs->append( new OConfItem( OConfItem::Option, "ftp_proxy",
- m_proxyFtpServer->text(), m_proxyFtpActive->isChecked() ) );
+ m_proxyFtpServer->text(), QString::null,
+ m_proxyFtpActive->isChecked() ) );
confItem = findConfItem( OConfItem::Option, "proxy_username" );
if ( confItem )
@@ -535,9 +537,10 @@ void OIpkgConfigDlg::slotServerUpdate()
}
else
{
- // Add new destination to configuration list
- m_configs->append( new OConfItem( OConfItem::Source, newName,
- m_serverLocation->text(), m_serverActive->isChecked() ) );
+ // Add new server to configuration list
+ // TODO - support src/gz
+ m_configs->append( new OConfItem( OConfItem::Source, newName, m_serverLocation->text(),
+ QString::null, m_serverActive->isChecked() ) );
m_configs->sort();
m_serverList->insertItem( newName );
@@ -630,7 +633,7 @@ void OIpkgConfigDlg::slotDestUpdate()
{
// Add new destination to configuration list
m_configs->append( new OConfItem( OConfItem::Destination, newName,
- m_destLocation->text(), m_destActive->isChecked() ) );
+ m_destLocation->text(), QString::null, m_destActive->isChecked() ) );
m_configs->sort();
m_destList->insertItem( newName );