summaryrefslogtreecommitdiff
authorkergoth <kergoth>2003-03-27 18:41:00 (UTC)
committer kergoth <kergoth>2003-03-27 18:41:00 (UTC)
commitbff145f5cced95c742deefcd607932a9f3728dd3 (patch) (unidiff)
treec1d533d21e78fb0d45e94490f055651c9e5e3156
parent390a5a0c332c8c6fb380c1ed4cd6adae3e544a08 (diff)
downloadopie-bff145f5cced95c742deefcd607932a9f3728dd3.zip
opie-bff145f5cced95c742deefcd607932a9f3728dd3.tar.gz
opie-bff145f5cced95c742deefcd607932a9f3728dd3.tar.bz2
Slower, but more appropriate status parser. Now identifies the state_status column and compares against installed.. This fixes the bug introduced where it hit 'ok installed' but not 'prefer installed', both of which are valid entries.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/package.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/noncore/settings/aqpkg/package.cpp b/noncore/settings/aqpkg/package.cpp
index 99187ac..83e0706 100644
--- a/noncore/settings/aqpkg/package.cpp
+++ b/noncore/settings/aqpkg/package.cpp
@@ -71,7 +71,15 @@ QString Package :: toString()
71void Package :: setStatus( const QString &s ) 71void Package :: setStatus( const QString &s )
72{ 72{
73 status = s; 73 QString state_status;
74 int two, three;
74 75
75 if ( status.find( "ok installed" ) != -1 ) 76 status = s.simplifyWhiteSpace( );
77
78 two = status.find( " " ); // find second column
79 three = status.find( " ", two + 1 ); // find third column
80
81 state_status = status.mid( three ).stripWhiteSpace( );
82
83 if ( state_status == "installed" )
76 installed = true; 84 installed = true;
77} 85}