Diffstat (limited to 'noncore/unsupported/oipkg/package.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index e317308..1705f78 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp @@ -1,68 +1,68 @@ #include "package.h" #include <qpe/process.h> #include <qpe/stringutil.h> #include "debug.h" Package::~Package() { } Package::Package() { _size = ""; _section = ""; _subsection = ""; _shortDesc = ""; _desc = ""; _name = ""; - _toProcess = true; + _toProcess = false; _status = ""; } Package::Package( QStringList pack ) { Package(); parsePackage( pack ); _toProcess = false; } Package::Package( QString n ) { Package(); _name = QString( n ); _toProcess = false; } Package::Package( Package *pi ) { Package(); copyValues( pi ); _toProcess = false; } void Package::setValue( QString n, QString t ) { if ( n == "Status" && installed() ) return; if ( n == "Package" ) { _name = QString( t ); } if ( n == "Installed-Size" ) { _size = t; } if ( n == "Priority") { } if ( n == "Section") { setSection( t ); } if ( n == "Maintainer") { } @@ -208,48 +208,56 @@ void Package::parsePackage( QStringList pack ) QString tag = line.left(sep); QString value = line.mid(sep+2).simplifyWhiteSpace(); setValue( tag, value ); }else{ } } return; } QString Package::details() { QString status; Process ipkg_status(QStringList() << "ipkg" << "info" << name() ); QString description; if ( ipkg_status.exec("",status) ) { QStringList lines = QStringList::split('\n',status,TRUE); for (QStringList::Iterator it = lines.begin(); it!=lines.end(); ++it) { QString line = *it; if ( line == " ." ) { description.append("<p>"); } else if ( line[0] == ' ' || line[0] == '\t' ) { // continuation description.append(" "); description.append(Qtopia::escapeString(line)); } else { int sep = line.find(QRegExp(":[\t ]+")); if ( sep >= 0 ) { QString tag = line.left(sep); description.append("<br>"); description.append("<b>"); description.append(Qtopia::escapeString(tag)); description.append(":</b> "); description.append(Qtopia::escapeString(line.mid(sep+2))); } else { description.append(" "); description.append(Qtopia::escapeString(line)); } } } } return description; } +/** No descriptions */ +void Package::processed() +{ + _toProcess = false; + //hack, but we're mot writing status anyway... + if ( installed() ) _status = "install"; + else _status = "installed"; +} |