00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "packagelistdoclnk.h"
00011
00012 #include <qpe/applnk.h>
00013 #include <qpe/config.h>
00014 #include <qlist.h>
00015
00016 #include "package.h"
00017 #include "pksettings.h"
00018
00019 PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s, QObject *parent, const char *name)
00020 : PackageList(s)
00021 {
00022 PackageListDocLnk(parent, name);
00023 }
00024
00025 PackageListDocLnk::PackageListDocLnk(QObject *parent, const char *name)
00026 : PackageList(parent, name)
00027 {
00028 Config cfg( "oipkg", Config::User );
00029 cfg.setGroup( "Common" );
00030 docLnkDir = cfg.readEntry( "docLnkDir", "/root/" );
00031 pvDebug(2,"opening DocLnkSet "+docLnkDir);
00032 doclnkset = new DocLnkSet(docLnkDir,"application/ipkg");
00033 }
00034
00035 PackageListDocLnk::~PackageListDocLnk()
00036 {
00037 Config cfg( "oipkg", Config::User );
00038 cfg.setGroup( "Common" );
00039 cfg.writeEntry( "docLnkDir", docLnkDir );
00040 delete doclnkset;
00041 }
00042
00043
00044
00045 void PackageListDocLnk::update()
00046 {
00047 pvDebug(2,"PackageListDocLnk::update ");
00048 QList<DocLnk> packlist = doclnkset->children();
00049 for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() )
00050 {
00051 insertPackage( new OipkgPackage(pack->file(), settings ) );
00052 }
00053 }