author | tille <tille> | 2002-04-27 13:06:45 (UTC) |
---|---|---|
committer | tille <tille> | 2002-04-27 13:06:45 (UTC) |
commit | db90999f6298c1107888f062f2c25cb8817b528a (patch) (unidiff) | |
tree | 020ebe65beb9286f3c63e4329fc3a0f298d34460 /noncore/unsupported/oipkg/package.cpp | |
parent | e2f3288d468508f2cf7c0a327044963ca4b1b54a (diff) | |
download | opie-db90999f6298c1107888f062f2c25cb8817b528a.zip opie-db90999f6298c1107888f062f2c25cb8817b528a.tar.gz opie-db90999f6298c1107888f062f2c25cb8817b528a.tar.bz2 |
added popup menu to choose inst dest (and more...)
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 | |||
@@ -6,41 +6,48 @@ | |||
6 | #include "debug.h" | 6 | #include "debug.h" |
7 | 7 | ||
8 | Package::~Package() | 8 | Package::~Package() |
9 | { | 9 | { |
10 | } | 10 | } |
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 = ""; |
15 | _section = ""; | 21 | _section = ""; |
16 | _subsection = ""; | 22 | _subsection = ""; |
17 | _shortDesc = ""; | 23 | _shortDesc = ""; |
18 | _desc = ""; | 24 | _desc = ""; |
19 | _name = ""; | 25 | _name = ""; |
20 | _toProcess = false; | 26 | _toProcess = false; |
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 ); |
28 | _toProcess = false; | 35 | _toProcess = false; |
29 | } | 36 | } |
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 ); |
35 | _toProcess = false; | 42 | _toProcess = false; |
36 | } | 43 | } |
37 | 44 | ||
38 | Package::Package( Package *pi ) | 45 | Package::Package( Package *pi ) |
39 | { | 46 | { |
40 | Package(); | 47 | init(pi->settings); |
41 | copyValues( pi ); | 48 | copyValues( pi ); |
42 | _toProcess = false; | 49 | _toProcess = false; |
43 | } | 50 | } |
44 | 51 | ||
45 | 52 | ||
46 | void Package::setValue( QString n, QString t ) | 53 | void Package::setValue( QString n, QString t ) |
@@ -169,13 +176,13 @@ void Package::copyValues( Package* pack ) | |||
169 | if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc ); | 176 | if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc ); |
170 | if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc ); | 177 | if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc ); |
171 | if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name ); | 178 | if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name ); |
172 | if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); | 179 | if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); |
173 | } | 180 | } |
174 | 181 | ||
175 | QString Package::getSection() | 182 | QString Package::section() |
176 | { | 183 | { |
177 | return _section; | 184 | return _section; |
178 | } | 185 | } |
179 | 186 | ||
180 | void Package::setSection( QString s) | 187 | void Package::setSection( QString s) |
181 | { | 188 | { |
@@ -187,13 +194,13 @@ void Package::setSection( QString s) | |||
187 | }else{ | 194 | }else{ |
188 | _section = s; | 195 | _section = s; |
189 | _subsection = ""; | 196 | _subsection = ""; |
190 | } | 197 | } |
191 | } | 198 | } |
192 | 199 | ||
193 | QString Package::getSubSection() | 200 | QString Package::subSection() |
194 | { | 201 | { |
195 | return _subsection; | 202 | return _subsection; |
196 | } | 203 | } |
197 | 204 | ||
198 | void Package::parsePackage( QStringList pack ) | 205 | void Package::parsePackage( QStringList pack ) |
199 | { | 206 | { |
@@ -250,14 +257,41 @@ QString Package::details() | |||
250 | } | 257 | } |
251 | } | 258 | } |
252 | } | 259 | } |
253 | return description; | 260 | return description; |
254 | } | 261 | } |
255 | 262 | ||
256 | /** No descriptions */ | ||
257 | void Package::processed() | 263 | void 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 | |||
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 | } | ||