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 @@ -11,5 +11,5 @@ -Package::~Package() -{ -} +//Package::~Package() +//{ +//} @@ -63,3 +63,2 @@ void Package::setValue( QString n, QString t ) { - if ( n == "Status" && installed() ) return; if ( n == "Package" ) @@ -67,32 +66,24 @@ void Package::setValue( QString n, QString t ) _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") { @@ -155,2 +146,18 @@ QString Package::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() |