author | drw <drw> | 2005-03-11 16:32:21 (UTC) |
---|---|---|
committer | drw <drw> | 2005-03-11 16:32:21 (UTC) |
commit | abcc52307706794537bb579daff1a82668ebde00 (patch) (side-by-side diff) | |
tree | 4c25d4ea425a22d0b881c79418ff5b51b829be49 | |
parent | 3dc7db665775377453f999a3eaee8c225af45a79 (diff) | |
download | opie-abcc52307706794537bb579daff1a82668ebde00.zip opie-abcc52307706794537bb579daff1a82668ebde00.tar.gz opie-abcc52307706794537bb579daff1a82668ebde00.tar.bz2 |
Fix bug where lists_dir was not being honored at startup - thanks to hrw for identifying, also provide default value for lists_dir when none is entered in the configuration dialog
-rw-r--r-- | noncore/settings/packagemanager/oipkg.cpp | 14 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 7 |
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 @@ -245,4 +245,12 @@ OPackageList *OIpkg::availablePackages( const QString &server ) + // 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 ) ) @@ -609,2 +617,6 @@ void OIpkg::loadConfiguration() name = typeStr; + + // Default value when not defined + if ( value == QString::null || value == "" ) + value = IPKG_PKG_PATH; } 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 @@ -130,8 +130,11 @@ void OIpkgConfigDlg::accept() + 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" ) ); |