summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp14
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp7
2 files changed, 18 insertions, 3 deletions
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp
index 3d2c621..417ee95 100644
--- a/noncore/settings/packagemanager/oipkg.cpp
+++ b/noncore/settings/packagemanager/oipkg.cpp
@@ -243,8 +243,16 @@ OPackageList *OIpkg::availablePackages( const QString &server )
// Build new server list (caller is responsible for deleting)
OPackageList *pl = new OPackageList;
+ // Get directory where server lists are located
+ QString listsDir;
+ OConfItem *confItem = findConfItem( OConfItem::Other, "lists_dir" );
+ if ( confItem )
+ listsDir = confItem->value();
+ else
+ listsDir = IPKG_PKG_PATH;
+
// Open package list file
- QFile f( IPKG_PKG_PATH + "/" + server );
+ QFile f( listsDir + "/" + server );
if ( !f.open( IO_ReadOnly ) )
return NULL;
QTextStream t( &f );
@@ -607,6 +615,10 @@ void OIpkg::loadConfiguration()
type = OConfItem::Other;
features = name;
name = typeStr;
+
+ // Default value when not defined
+ if ( value == QString::null || value == "" )
+ value = IPKG_PKG_PATH;
}
else
recognizedOption = false;
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index d234251..0ad1c82 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -128,12 +128,15 @@ void OIpkgConfigDlg::accept()
m_configs->append( new OConfItem( OConfItem::Option, "proxy_password",
m_proxyPassword->text() ) );
+ QString listsDir = m_optSourceLists->text();
+ if ( listsDir == QString::null || listsDir == "" )
+ listsDir = "/usr/lib/ipkg/lists"; // TODO - use proper libipkg define
confItem = m_ipkg->findConfItem( OConfItem::Other, "lists_dir" );
if ( confItem )
- confItem->setValue( m_optSourceLists->text() );
+ confItem->setValue( listsDir );
else
m_configs->append( new OConfItem( OConfItem::Other, "lists_dir",
- m_optSourceLists->text(), "name" ) );
+ listsDir, "name" ) );
m_ipkg->setConfigItems( m_configs );
}