summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/packagelist.h
blob: 88a8793560b9b18888b2a9eceae78764e927d7f9 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/
// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
#ifndef PACKAGELIST_H
#define PACKAGELIST_H

#include <qdict.h>
#include "package.h"
#include "pksettings.h"
#include "debug.h"

class PackageList : public QObject
{
  Q_OBJECT
public:
//	static QString all = QObject::tr("All");

  PackageList (QObject *parent=0, const char *name=0);
  PackageList( PackageManagerSettings *s, QObject *parent=0, const char *name=0);
 	virtual ~PackageList();
  void insertPackage( OipkgPackage* );
  OipkgPackage* find( QString );
  OipkgPackage* next();
  OipkgPackage* first();

  QStringList getSections();
  QStringList getSubSections();
  void setSettings( PackageManagerSettings* );
  void filterPackages( QString );
  OipkgPackage* getByName( QString );
  void clear();
  void allPackages();

  QDict<OipkgPackage> *versions;

public slots:
  void setSection(QString);
  void setSubSection(QString);
 // virtual void update();

protected:
  int currentPackage;
  int packageCount;

  PackageManagerSettings     *settings;
  QDict<OipkgPackage>         packageList;
  QDict<OipkgPackage>         origPackageList;
  QDictIterator<OipkgPackage> packageIter;

  bool empty;
  QString            aktSection;
  QString            aktSubSection;
  QStringList        sections;
  QDict<QStringList> subSections;
  QDict<bool> sectionsDict;


  void updateSections( OipkgPackage* );
  void readFileEntries( QString file, QString dest="" );
};


#endif