From bff145f5cced95c742deefcd607932a9f3728dd3 Mon Sep 17 00:00:00 2001 From: kergoth Date: Thu, 27 Mar 2003 18:41:00 +0000 Subject: 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. --- (limited to 'noncore/settings/aqpkg/package.cpp') 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 @@ -70,9 +70,17 @@ QString Package :: toString() void Package :: setStatus( const QString &s ) { - status = s; + QString state_status; + int two, three; - if ( status.find( "ok installed" ) != -1 ) + status = s.simplifyWhiteSpace( ); + + two = status.find( " " ); // find second column + three = status.find( " ", two + 1 ); // find third column + + state_status = status.mid( three ).stripWhiteSpace( ); + + if ( state_status == "installed" ) installed = true; } -- cgit v0.9.0.2