-rw-r--r-- | noncore/settings/aqpkg/package.cpp | 12 |
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 | |||
@@ -49,51 +49,59 @@ Package::Package( char *name ) | |||
49 | packageStoredLocally = false; | 49 | packageStoredLocally = false; |
50 | installedToRoot = false; | 50 | installedToRoot = false; |
51 | installed = false; | 51 | installed = false; |
52 | installedTo = 0; | 52 | installedTo = 0; |
53 | } | 53 | } |
54 | 54 | ||
55 | Package::~Package() | 55 | Package::~Package() |
56 | { | 56 | { |
57 | } | 57 | } |
58 | 58 | ||
59 | QString Package :: toString() | 59 | QString Package :: toString() |
60 | { | 60 | { |
61 | QString ret = "Package - " + getPackageName() + | 61 | QString ret = "Package - " + getPackageName() + |
62 | "\n version - " + getVersion(); | 62 | "\n version - " + getVersion(); |
63 | 63 | ||
64 | if ( localPackage ) | 64 | if ( localPackage ) |
65 | ret += "\n inst version - " + localPackage->getVersion(); | 65 | ret += "\n inst version - " + localPackage->getVersion(); |
66 | 66 | ||
67 | 67 | ||
68 | return ret; | 68 | return ret; |
69 | } | 69 | } |
70 | 70 | ||
71 | void Package :: setStatus( const QString &s ) | 71 | void 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 | } |
78 | 86 | ||
79 | void Package :: setLocalPackage( Package *p ) | 87 | void Package :: setLocalPackage( Package *p ) |
80 | { | 88 | { |
81 | localPackage = p; | 89 | localPackage = p; |
82 | 90 | ||
83 | if ( localPackage ) | 91 | if ( localPackage ) |
84 | if ( localPackage->getVersion() != getVersion() ) | 92 | if ( localPackage->getVersion() != getVersion() ) |
85 | differentVersionAvailable = true; | 93 | differentVersionAvailable = true; |
86 | else | 94 | else |
87 | differentVersionAvailable = false; | 95 | differentVersionAvailable = false; |
88 | } | 96 | } |
89 | 97 | ||
90 | void Package :: setVersion( const QString &v ) | 98 | void Package :: setVersion( const QString &v ) |
91 | { | 99 | { |
92 | version = v; | 100 | version = v; |
93 | 101 | ||
94 | if ( localPackage ) | 102 | if ( localPackage ) |
95 | if ( localPackage->getVersion() != getVersion() ) | 103 | if ( localPackage->getVersion() != getVersion() ) |
96 | differentVersionAvailable = true; | 104 | differentVersionAvailable = true; |
97 | else | 105 | else |
98 | differentVersionAvailable = false; | 106 | differentVersionAvailable = false; |
99 | } | 107 | } |