author | tille <tille> | 2002-04-29 22:45:35 (UTC) |
---|---|---|
committer | tille <tille> | 2002-04-29 22:45:35 (UTC) |
commit | b794af4c50efffe239c94e5a015e90565ff991c3 (patch) (unidiff) | |
tree | dd4e20851eba8052a07396b57388f9216f85ae7f /noncore/unsupported/oipkg/package.cpp | |
parent | e4d0908ec054b71a9b97e9c35efbd5a697d0b58d (diff) | |
download | opie-b794af4c50efffe239c94e5a015e90565ff991c3.zip opie-b794af4c50efffe239c94e5a015e90565ff991c3.tar.gz opie-b794af4c50efffe239c94e5a015e90565ff991c3.tar.bz2 |
removes links again
Diffstat (limited to 'noncore/unsupported/oipkg/package.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 89 |
1 files changed, 48 insertions, 41 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 | |||
@@ -6,15 +6,15 @@ | |||
6 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <unistd.h> | 8 | #include <unistd.h> |
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 | { |
18 | init(s); | 18 | init(s); |
19 | } | 19 | } |
20 | 20 | ||
@@ -58,71 +58,62 @@ Package::Package( Package *pi ) | |||
58 | copyValues( pi ); | 58 | copyValues( pi ); |
59 | } | 59 | } |
60 | 60 | ||
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" ) | 68 | { |
70 | { | ||
71 | _size = t; | 69 | _size = t; |
72 | } | 70 | }else if ( n == "Priority") |
73 | if ( n == "Priority") | 71 | { |
74 | { | ||
75 | 72 | ||
76 | } | 73 | }else if ( n == "Section") |
77 | if ( n == "Section") | 74 | { |
78 | { | ||
79 | setSection( t ); | 75 | setSection( t ); |
80 | } | 76 | }else if ( n == "Maintainer") |
81 | if ( n == "Maintainer") | 77 | { |
82 | { | ||
83 | 78 | ||
84 | } | 79 | }else if ( n == "Architecture") |
85 | if ( n == "Architecture") | 80 | { |
86 | { | ||
87 | 81 | ||
88 | } | 82 | }else if ( n == "Version") |
89 | if ( n == "Version") | 83 | { |
90 | { | ||
91 | 84 | ||
92 | } | 85 | }else if ( n == "Pre-Depends") |
93 | if ( n == "Pre-Depends") | 86 | { |
94 | { | ||
95 | 87 | ||
96 | } | 88 | }else if ( n == "Depends") |
97 | if ( n == "Depends") | 89 | { |
98 | { | ||
99 | 90 | ||
100 | }else if ( n == "Filename") | 91 | }else if ( n == "Filename") |
101 | { | 92 | { |
102 | 93 | ||
103 | }else if ( n == "Size") | 94 | }else if ( n == "Size") |
104 | { | 95 | { |
105 | 96 | ||
106 | }else if ( n == "MD5Sum") | 97 | }else if ( n == "MD5Sum") |
107 | { | 98 | { |
108 | 99 | ||
109 | } | 100 | } |
110 | if ( n == "Description") | 101 | if ( n == "Description") |
111 | { | 102 | { |
112 | setDesc( t ); | 103 | setDesc( t ); |
113 | } | 104 | } |
114 | if ( n == "Status") | 105 | if ( n == "Status") |
115 | { | 106 | { |
116 | if ( installed() ) return; | 107 | if ( installed() ) return; |
117 | _status = t; | 108 | _status = t; |
118 | } | 109 | } |
119 | if ( t == "Essential") | 110 | if ( t == "Essential") |
120 | { | 111 | { |
121 | 112 | ||
122 | } | 113 | } |
123 | }; | 114 | }; |
124 | 115 | ||
125 | QString Package::name() | 116 | QString Package::name() |
126 | { | 117 | { |
127 | return _name; | 118 | return _name; |
128 | } | 119 | } |
@@ -150,12 +141,28 @@ QString Package::shortDesc() | |||
150 | 141 | ||
151 | QString Package::size() | 142 | QString Package::size() |
152 | { | 143 | { |
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; |
159 | } | 166 | } |
160 | 167 | ||
161 | bool Package::toRemove() | 168 | bool Package::toRemove() |