summaryrefslogtreecommitdiff
authordrw <drw>2005-03-11 16:32:21 (UTC)
committer drw <drw>2005-03-11 16:32:21 (UTC)
commitabcc52307706794537bb579daff1a82668ebde00 (patch) (unidiff)
tree4c25d4ea425a22d0b881c79418ff5b51b829be49
parent3dc7db665775377453f999a3eaee8c225af45a79 (diff)
downloadopie-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
Diffstat (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 )
243 // Build new server list (caller is responsible for deleting) 243 // Build new server list (caller is responsible for deleting)
244 OPackageList *pl = new OPackageList; 244 OPackageList *pl = new OPackageList;
245 245
246 // Get directory where server lists are located
247 QString listsDir;
248 OConfItem *confItem = findConfItem( OConfItem::Other, "lists_dir" );
249 if ( confItem )
250 listsDir = confItem->value();
251 else
252 listsDir = IPKG_PKG_PATH;
253
246 // Open package list file 254 // Open package list file
247 QFile f( IPKG_PKG_PATH + "/" + server ); 255 QFile f( listsDir + "/" + server );
248 if ( !f.open( IO_ReadOnly ) ) 256 if ( !f.open( IO_ReadOnly ) )
249 return NULL; 257 return NULL;
250 QTextStream t( &f ); 258 QTextStream t( &f );
@@ -607,6 +615,10 @@ void OIpkg::loadConfiguration()
607 type = OConfItem::Other; 615 type = OConfItem::Other;
608 features = name; 616 features = name;
609 name = typeStr; 617 name = typeStr;
618
619 // Default value when not defined
620 if ( value == QString::null || value == "" )
621 value = IPKG_PKG_PATH;
610 } 622 }
611 else 623 else
612 recognizedOption = false; 624 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()
128 m_configs->append( new OConfItem( OConfItem::Option, "proxy_password", 128 m_configs->append( new OConfItem( OConfItem::Option, "proxy_password",
129 m_proxyPassword->text() ) ); 129 m_proxyPassword->text() ) );
130 130
131 QString listsDir = m_optSourceLists->text();
132 if ( listsDir == QString::null || listsDir == "" )
133 listsDir = "/usr/lib/ipkg/lists"; // TODO - use proper libipkg define
131 confItem = m_ipkg->findConfItem( OConfItem::Other, "lists_dir" ); 134 confItem = m_ipkg->findConfItem( OConfItem::Other, "lists_dir" );
132 if ( confItem ) 135 if ( confItem )
133 confItem->setValue( m_optSourceLists->text() ); 136 confItem->setValue( listsDir );
134 else 137 else
135 m_configs->append( new OConfItem( OConfItem::Other, "lists_dir", 138 m_configs->append( new OConfItem( OConfItem::Other, "lists_dir",
136 m_optSourceLists->text(), "name" ) ); 139 listsDir, "name" ) );
137 140
138 m_ipkg->setConfigItems( m_configs ); 141 m_ipkg->setConfigItems( m_configs );
139 } 142 }