Diffstat (limited to 'noncore/unsupported/oipkg/package.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 65 |
1 files changed, 38 insertions, 27 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 6bb53a9..0787ece 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp @@ -60,73 +60,73 @@ Package::Package( Package *pi ) copyValues( pi ); } void Package::setValue( QString n, QString t ) { if ( n == "Package" ) { _name = QString( t ); }else if ( n == "Installed-Size" ) { _size = t; - }else if ( n == "Priority") - { +// }else if ( n == "Priority") +// { }else if ( n == "Section") { setSection( t ); - }else if ( n == "Maintainer") - { - - }else if ( n == "Architecture") - { +// }else if ( n == "Maintainer") +// { +// +// }else if ( n == "Architecture") +// { }else if ( n == "Version") { - - }else if ( n == "Pre-Depends") - { - - }else if ( n == "Depends") - { + _version = t; +// }else if ( n == "Pre-Depends") +// { +// +// }else if ( n == "Depends") +// { }else if ( n == "Filename") { _fileName = t; - }else if ( n == "Size") - { - - }else if ( n == "MD5Sum") - { +// }else if ( n == "Size") +// { +// +// }else if ( n == "MD5Sum") +// { - } - if ( n == "Description") + }else if ( n == "Description") { setDesc( t ); - } - if ( n == "Status") + }else if ( n == "Status") { if ( installed() ) return; _status = t; - } - if ( t == "Essential") - { +// }else if ( n == "Essential") +// { + }else{ + _values.insert(n,new QString(t)); } -}; +} QString Package::name() { - return _name; + if (_displayName.isEmpty() ) return _name; + else return _displayName; } QString Package::installName() { if (_useFileName) return _fileName; else return _name; } bool Package::installed() { return _status.contains("installed"); @@ -144,24 +144,30 @@ QString Package::desc() } QString Package::shortDesc() { return _shortDesc; } QString Package::size() { return _size; } + +QString Package::version() +{ + return _version; +} + 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; @@ -341,12 +347,17 @@ void Package::parseIpkgFile( QString file) } //QString Package::getPackageName() //{ // if ( _packageName.isEmpty() ) return _name; // else return _packageName; //} void Package::instalFromFile(bool iff) { _useFileName = iff; } + +void Package::setName(QString n) +{ + _displayName = n; +} |