Diffstat (limited to 'noncore/settings/packagemanager/opackagemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/opackagemanager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp index c9fdec1..ac16954 100644 --- a/noncore/settings/packagemanager/opackagemanager.cpp +++ b/noncore/settings/packagemanager/opackagemanager.cpp | |||
@@ -74,27 +74,28 @@ void OPackageManager::loadAvailablePackages() | |||
74 | ++serverCount; | 74 | ++serverCount; |
75 | emit statusBar( serverCount ); | 75 | emit statusBar( serverCount ); |
76 | qApp->processEvents(); | 76 | qApp->processEvents(); |
77 | 77 | ||
78 | OPackageList *packageList = m_ipkg.availablePackages( server->name() ); | 78 | OPackageList *packageList = m_ipkg.availablePackages( server->name() ); |
79 | if ( packageList ) | 79 | if ( packageList ) |
80 | { | 80 | { |
81 | for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) | 81 | for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) |
82 | { | 82 | { |
83 | OPackage *package = packageIt.current(); | 83 | OPackage *package = packageIt.current(); |
84 | 84 | ||
85 | // Load package info | 85 | // Load package info |
86 | if ( !m_packages.find( package->name() ) ) | 86 | if ( !m_packages.find( package->name() ) ) { |
87 | printf( "ADD AVAILABLE '%s'\n", package->name().latin1()); | ||
87 | m_packages.insert( package->name(), package ); | 88 | m_packages.insert( package->name(), package ); |
88 | else | 89 | } else |
89 | { | 90 | { |
90 | // If new package is newer version, replace existing package | 91 | // If new package is newer version, replace existing package |
91 | OPackage *currPackage = m_packages[package->name()]; | 92 | OPackage *currPackage = m_packages[package->name()]; |
92 | if ( compareVersions( package->version(), currPackage->version() ) == 1 ) | 93 | if ( compareVersions( package->version(), currPackage->version() ) == 1 ) |
93 | m_packages.replace( package->name(), package ); | 94 | m_packages.replace( package->name(), package ); |
94 | } | 95 | } |
95 | 96 | ||
96 | // Add category to list if it doesn't already exist | 97 | // Add category to list if it doesn't already exist |
97 | if ( m_categories.grep( package->category() ).isEmpty() ) | 98 | if ( m_categories.grep( package->category() ).isEmpty() ) |
98 | { | 99 | { |
99 | m_categories << package->category(); | 100 | m_categories << package->category(); |
100 | categoryAdded = true; | 101 | categoryAdded = true; |
@@ -129,43 +130,45 @@ void OPackageManager::loadInstalledPackages() | |||
129 | 130 | ||
130 | // Process destination only if it is active | 131 | // Process destination only if it is active |
131 | if ( destination->active() ) | 132 | if ( destination->active() ) |
132 | { | 133 | { |
133 | // Update status | 134 | // Update status |
134 | QString status = tr( "Reading installed packages:\n\t" ); | 135 | QString status = tr( "Reading installed packages:\n\t" ); |
135 | status.append( destination->name() ); | 136 | status.append( destination->name() ); |
136 | emit statusText( status ); | 137 | emit statusText( status ); |
137 | ++destCount; | 138 | ++destCount; |
138 | emit statusBar( destCount ); | 139 | emit statusBar( destCount ); |
139 | qApp->processEvents(); | 140 | qApp->processEvents(); |
140 | 141 | ||
142 | printf( "DESGTINATION %s\n", destination->name().latin1()); | ||
141 | OPackageList *packageList = m_ipkg.installedPackages( destination->name(), | 143 | OPackageList *packageList = m_ipkg.installedPackages( destination->name(), |
142 | destination->value() ); | 144 | destination->value() ); |
143 | if ( packageList ) | 145 | if ( packageList ) |
144 | { | 146 | { |
145 | for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) | 147 | for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) |
146 | { | 148 | { |
147 | OPackage *package = packageIt.current(); | 149 | OPackage *package = packageIt.current(); |
148 | OPackage *currPackage = m_packages[package->name()]; | 150 | OPackage *currPackage = m_packages[package->name()]; |
149 | if ( currPackage ) | 151 | if ( currPackage ) |
150 | { | 152 | { |
151 | // Package is in a current feed, update installed version, destination | 153 | // Package is in a current feed, update installed version, destination |
152 | currPackage->setVersionInstalled( package->versionInstalled() ); | 154 | currPackage->setVersionInstalled( package->versionInstalled() ); |
153 | currPackage->setDestination( package->destination() ); | 155 | currPackage->setDestination( package->destination() ); |
154 | 156 | ||
155 | delete package; | 157 | delete package; |
156 | } | 158 | } |
157 | else | 159 | else |
158 | { | 160 | { |
159 | // Package isn't in a current feed, add to list | 161 | // Package isn't in a current feed, add to list |
162 | printf( "ADD INSTALLED '%s'\n", package->name().latin1()); | ||
160 | m_packages.insert( package->name(), package ); | 163 | m_packages.insert( package->name(), package ); |
161 | 164 | ||
162 | // Add category to list if it doesn't already exist | 165 | // Add category to list if it doesn't already exist |
163 | if ( m_categories.grep( package->category() ).isEmpty() ) | 166 | if ( m_categories.grep( package->category() ).isEmpty() ) |
164 | { | 167 | { |
165 | m_categories << package->category(); | 168 | m_categories << package->category(); |
166 | categoryAdded = true; | 169 | categoryAdded = true; |
167 | } | 170 | } |
168 | } | 171 | } |
169 | } | 172 | } |
170 | } | 173 | } |
171 | } | 174 | } |