Diffstat (limited to 'noncore/unsupported/oipkg/package.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 5f0e5fa..0499e19 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -9,9 +9,9 @@ | |||
9 | 9 | ||
10 | #include "debug.h" | 10 | #include "debug.h" |
11 | 11 | ||
12 | Package::~Package() | 12 | //Package::~Package() |
13 | { | 13 | //{ |
14 | } | 14 | //} |
15 | 15 | ||
16 | Package::Package( PackageManagerSettings *s ) | 16 | Package::Package( PackageManagerSettings *s ) |
17 | { | 17 | { |
@@ -61,40 +61,31 @@ Package::Package( Package *pi ) | |||
61 | 61 | ||
62 | void Package::setValue( QString n, QString t ) | 62 | void Package::setValue( QString n, QString t ) |
63 | { | 63 | { |
64 | if ( n == "Status" && installed() ) return; | ||
65 | if ( n == "Package" ) | 64 | if ( n == "Package" ) |
66 | { | 65 | { |
67 | _name = QString( t ); | 66 | _name = QString( t ); |
68 | } | 67 | }else if ( n == "Installed-Size" ) |
69 | if ( n == "Installed-Size" ) | ||
70 | { | 68 | { |
71 | _size = t; | 69 | _size = t; |
72 | } | 70 | }else if ( n == "Priority") |
73 | if ( n == "Priority") | ||
74 | { | 71 | { |
75 | 72 | ||
76 | } | 73 | }else if ( n == "Section") |
77 | if ( n == "Section") | ||
78 | { | 74 | { |
79 | setSection( t ); | 75 | setSection( t ); |
80 | } | 76 | }else if ( n == "Maintainer") |
81 | if ( n == "Maintainer") | ||
82 | { | 77 | { |
83 | 78 | ||
84 | } | 79 | }else if ( n == "Architecture") |
85 | if ( n == "Architecture") | ||
86 | { | 80 | { |
87 | 81 | ||
88 | } | 82 | }else if ( n == "Version") |
89 | if ( n == "Version") | ||
90 | { | 83 | { |
91 | 84 | ||
92 | } | 85 | }else if ( n == "Pre-Depends") |
93 | if ( n == "Pre-Depends") | ||
94 | { | 86 | { |
95 | 87 | ||
96 | } | 88 | }else if ( n == "Depends") |
97 | if ( n == "Depends") | ||
98 | { | 89 | { |
99 | 90 | ||
100 | }else if ( n == "Filename") | 91 | }else if ( n == "Filename") |
@@ -153,6 +144,22 @@ QString Package::size() | |||
153 | return _size; | 144 | return _size; |
154 | } | 145 | } |
155 | 146 | ||
147 | QString Package::sizeUnits() | ||
148 | { | ||
149 | int i = _size.toInt(); | ||
150 | int c = 0; | ||
151 | QString ret; | ||
152 | QStringList unit; | ||
153 | unit << "B" << "KB" << "MB" << "GB" << "TB"; //prepair for the future ;) | ||
154 | while (i > 1) | ||
155 | { | ||
156 | ret=QString::number(i)+" "+unit[c]; | ||
157 | c++; | ||
158 | i /= 1024; | ||
159 | } | ||
160 | return ret; | ||
161 | } | ||
162 | |||
156 | bool Package::toProcess() | 163 | bool Package::toProcess() |
157 | { | 164 | { |
158 | return _toProcess; | 165 | return _toProcess; |