summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/datamgr.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp
index d929c39..089c3e3 100644
--- a/noncore/settings/aqpkg/datamgr.cpp
+++ b/noncore/settings/aqpkg/datamgr.cpp
@@ -9,24 +9,28 @@
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <fstream>
#include <iostream>
using namespace std;
+#ifdef QWS
+#include <qpe/config.h>
+#endif
+
#include <stdio.h>
#include "datamgr.h"
#include "global.h"
DataManager::DataManager()
{
activeServer = "";
}
DataManager::~DataManager()
@@ -61,24 +65,29 @@ Destination *DataManager :: getDestination( const char *name )
}
return d;
}
void DataManager :: loadServers()
{
// First add our local server - not really a server but
// the local config (which packages are installed)
serverList.push_back( Server( LOCAL_SERVER, "" ) );
serverList.push_back( Server( LOCAL_IPKGS, "" ) );
+#ifdef QWS
+ Config cfg( "aqpkg" );
+ cfg.setGroup( "destinations" );
+#endif
+
// Read file from /etc/ipkg.conf
QString ipkg_conf = IPKG_CONF;
FILE *fp;
fp = fopen( ipkg_conf, "r" );
char line[130];
QString lineStr;
if ( fp == NULL )
{
cout << "Couldn't open " << ipkg_conf << "! err = " << fp << endl;
return;
}
else
@@ -103,24 +112,32 @@ void DataManager :: loadServers()
else
s.setActive( false );
serverList.push_back( s );
}
else if ( lineStr.startsWith( "dest" ) )
{
char alias[20];
char path[50];
sscanf( lineStr, "%*[^ ] %s %s", alias, path );
Destination d( alias, path );
+ bool linkToRoot = true;
+#ifdef QWS
+ QString key = alias;
+ key += "_linkToRoot";
+ linkToRoot = cfg.readBoolEntry( key, true );
+#endif
+ d.linkToRoot( linkToRoot );
+
destList.push_back( d );
}
}
}
fclose( fp );
vector<Server>::iterator it;
for ( it = serverList.begin() ; it != serverList.end() ; ++it )
reloadServerData( it->getServerName() );
}
void DataManager :: reloadServerData( const char *serverName )