author | tille <tille> | 2002-04-29 22:45:35 (UTC) |
---|---|---|
committer | tille <tille> | 2002-04-29 22:45:35 (UTC) |
commit | b794af4c50efffe239c94e5a015e90565ff991c3 (patch) (side-by-side diff) | |
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 @@ -1,26 +1,26 @@ #include "package.h" #include <qpe/process.h> #include <qpe/stringutil.h> #include <qfile.h> #include <qtextstream.h> #include <stdlib.h> #include <unistd.h> #include "debug.h" -Package::~Package() -{ -} +//Package::~Package() +//{ +//} Package::Package( PackageManagerSettings *s ) { init(s); } void Package::init( PackageManagerSettings *s ) { settings = s; _size = ""; _section = ""; _subsection = ""; @@ -52,83 +52,74 @@ Package::Package( QString n, PackageManagerSettings *s ) } } Package::Package( Package *pi ) { init(pi->settings); copyValues( pi ); } void Package::setValue( QString n, QString t ) { - if ( n == "Status" && installed() ) return; if ( n == "Package" ) - { + { _name = QString( t ); - } - if ( n == "Installed-Size" ) - { + }else if ( n == "Installed-Size" ) + { _size = t; - } - if ( n == "Priority") - { + }else if ( n == "Priority") + { - } - if ( n == "Section") - { + }else if ( n == "Section") + { setSection( t ); - } - if ( n == "Maintainer") - { + }else if ( n == "Maintainer") + { - } - if ( n == "Architecture") - { + }else if ( n == "Architecture") + { - } - if ( n == "Version") - { + }else if ( n == "Version") + { - } - if ( n == "Pre-Depends") - { + }else if ( n == "Pre-Depends") + { - } - if ( n == "Depends") - { + }else if ( n == "Depends") + { - }else if ( n == "Filename") - { + }else if ( n == "Filename") + { - }else if ( n == "Size") + }else if ( n == "Size") { - + }else if ( n == "MD5Sum") - { + { - } + } if ( n == "Description") - { + { setDesc( t ); - } + } if ( n == "Status") - { + { if ( installed() ) return; _status = t; - } + } if ( t == "Essential") - { + { - } + } }; QString Package::name() { return _name; } bool Package::installed() { return _status.contains("installed"); } @@ -144,24 +135,40 @@ QString Package::desc() } QString Package::shortDesc() { return _shortDesc; } QString Package::size() { return _size; } +QString Package::sizeUnits() +{ + int i = _size.toInt(); + int c = 0; + QString ret; + QStringList unit; + unit << "B" << "KB" << "MB" << "GB" << "TB"; //prepair for the future ;) + while (i > 1) + { + ret=QString::number(i)+" "+unit[c]; + c++; + i /= 1024; + } + return ret; +} + bool Package::toProcess() { return _toProcess; } bool Package::toRemove() { if ( _toProcess && installed() ) return true; else return false; } bool Package::toInstall() |