summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/package.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/oipkg/package.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/package.cpp54
1 files changed, 44 insertions, 10 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp
index 1705f78..9f602b5 100644
--- a/noncore/unsupported/oipkg/package.cpp
+++ b/noncore/unsupported/oipkg/package.cpp
@@ -10,6 +10,12 @@ Package::~Package()
10} 10}
11 11
12Package::Package() 12Package::Package( PackageManagerSettings *s )
13{ 13{
14 init(s);
15}
16
17void Package::init( PackageManagerSettings *s )
18{
19 settings = s;
14 _size = ""; 20 _size = "";
15 _section = ""; 21 _section = "";
@@ -20,16 +26,17 @@ Package::Package()
20 _toProcess = false; 26 _toProcess = false;
21 _status = ""; 27 _status = "";
28 _dest = "";
22} 29}
23 30
24Package::Package( QStringList pack ) 31Package::Package( QStringList pack, PackageManagerSettings *s )
25 { 32 {
26 Package(); 33 init(s);
27 parsePackage( pack ); 34 parsePackage( pack );
28 _toProcess = false; 35 _toProcess = false;
29} 36}
30 37
31Package::Package( QString n ) 38Package::Package( QString n, PackageManagerSettings *s )
32 { 39 {
33 Package(); 40 init(s);
34 _name = QString( n ); 41 _name = QString( n );
35 _toProcess = false; 42 _toProcess = false;
@@ -38,5 +45,5 @@ Package::Package( QString n )
38Package::Package( Package *pi ) 45Package::Package( Package *pi )
39{ 46{
40 Package(); 47 init(pi->settings);
41 copyValues( pi ); 48 copyValues( pi );
42 _toProcess = false; 49 _toProcess = false;
@@ -173,5 +180,5 @@ void Package::copyValues( Package* pack )
173} 180}
174 181
175QString Package::getSection() 182QString Package::section()
176{ 183{
177 return _section; 184 return _section;
@@ -191,5 +198,5 @@ void Package::setSection( QString s)
191} 198}
192 199
193QString Package::getSubSection() 200QString Package::subSection()
194{ 201{
195 return _subsection; 202 return _subsection;
@@ -254,10 +261,37 @@ QString Package::details()
254} 261}
255 262
256/** No descriptions */
257void Package::processed() 263void Package::processed()
258{ 264{
259 _toProcess = false; 265 _toProcess = false;
260 //hack, but we're mot writing status anyway... 266 //hack, but we're not writing status anyway...
261 if ( installed() ) _status = "install"; 267 if ( installed() ) _status = "install";
262 else _status = "installed"; 268 else _status = "installed";
263} 269}
270
271QString Package::dest()
272{
273 if ( installed()||(!installed() && _toProcess) )
274 return _dest!=""?_dest:settings->getDestinationName();
275 else return "";
276}
277
278void Package::setDest( QString d )
279{
280 _dest = d;
281}
282
283void Package::setOn()
284{
285 _toProcess = true;
286}
287
288bool Package::link()
289{
290 if ( _dest == "root" || (!installed() && !_toProcess) ) return false;
291 return _link;
292}
293
294void Package::setLink(bool b)
295{
296 _link = b;
297}