Diffstat (limited to 'noncore/unsupported/oipkg/package.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 54 |
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 | |||
@@ -11,4 +11,10 @@ Package::~Package() | |||
11 | 11 | ||
12 | Package::Package() | 12 | Package::Package( PackageManagerSettings *s ) |
13 | { | 13 | { |
14 | init(s); | ||
15 | } | ||
16 | |||
17 | void Package::init( PackageManagerSettings *s ) | ||
18 | { | ||
19 | settings = s; | ||
14 | _size = ""; | 20 | _size = ""; |
@@ -21,7 +27,8 @@ Package::Package() | |||
21 | _status = ""; | 27 | _status = ""; |
28 | _dest = ""; | ||
22 | } | 29 | } |
23 | 30 | ||
24 | Package::Package( QStringList pack ) | 31 | Package::Package( QStringList pack, PackageManagerSettings *s ) |
25 | { | 32 | { |
26 | Package(); | 33 | init(s); |
27 | parsePackage( pack ); | 34 | parsePackage( pack ); |
@@ -30,5 +37,5 @@ Package::Package( QStringList pack ) | |||
30 | 37 | ||
31 | Package::Package( QString n ) | 38 | Package::Package( QString n, PackageManagerSettings *s ) |
32 | { | 39 | { |
33 | Package(); | 40 | init(s); |
34 | _name = QString( n ); | 41 | _name = QString( n ); |
@@ -39,3 +46,3 @@ Package::Package( Package *pi ) | |||
39 | { | 46 | { |
40 | Package(); | 47 | init(pi->settings); |
41 | copyValues( pi ); | 48 | copyValues( pi ); |
@@ -174,3 +181,3 @@ void Package::copyValues( Package* pack ) | |||
174 | 181 | ||
175 | QString Package::getSection() | 182 | QString Package::section() |
176 | { | 183 | { |
@@ -192,3 +199,3 @@ void Package::setSection( QString s) | |||
192 | 199 | ||
193 | QString Package::getSubSection() | 200 | QString Package::subSection() |
194 | { | 201 | { |
@@ -255,3 +262,2 @@ QString Package::details() | |||
255 | 262 | ||
256 | /** No descriptions */ | ||
257 | void Package::processed() | 263 | void Package::processed() |
@@ -259,3 +265,3 @@ void Package::processed() | |||
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"; |
@@ -263 +269,29 @@ void Package::processed() | |||
263 | } | 269 | } |
270 | |||
271 | QString Package::dest() | ||
272 | { | ||
273 | if ( installed()||(!installed() && _toProcess) ) | ||
274 | return _dest!=""?_dest:settings->getDestinationName(); | ||
275 | else return ""; | ||
276 | } | ||
277 | |||
278 | void Package::setDest( QString d ) | ||
279 | { | ||
280 | _dest = d; | ||
281 | } | ||
282 | |||
283 | void Package::setOn() | ||
284 | { | ||
285 | _toProcess = true; | ||
286 | } | ||
287 | |||
288 | bool Package::link() | ||
289 | { | ||
290 | if ( _dest == "root" || (!installed() && !_toProcess) ) return false; | ||
291 | return _link; | ||
292 | } | ||
293 | |||
294 | void Package::setLink(bool b) | ||
295 | { | ||
296 | _link = b; | ||
297 | } | ||