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