summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/packagelistdoclnk.cpp
blob: f31f742e302940f4a7ce10428dd1d0238a280e62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

#include "packagelistdoclnk.h"

#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qlist.h>

#include "package.h"
#include "pksettings.h"

PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s)
	: PackageList(s)
{
	PackageListDocLnk();
}

PackageListDocLnk::PackageListDocLnk()
	: PackageList()
{
	Config cfg( "oipkg", Config::User );
	cfg.setGroup( "Common" );
	docLnkDir = cfg.readEntry( "docLnkDir", "/root/" );
 	pvDebug(2,"opening DocLnkSet "+docLnkDir);
	doclnkset = new DocLnkSet(docLnkDir,"application/ipkg");
}

PackageListDocLnk::~PackageListDocLnk()
{
	Config cfg( "oipkg", Config::User );
	cfg.setGroup( "Common" );
	cfg.writeEntry( "docLnkDir", docLnkDir );
	delete doclnkset;
}



void PackageListDocLnk::update()
{
	pvDebug(2,"PackageListDocLnk::update ");	
	QList<DocLnk> packlist = doclnkset->children();
  for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() )
  {
    insertPackage( new Package(pack->file(), settings ) );
  }
}