summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/installdlgimpl.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/installdlgimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp67
1 files changed, 44 insertions, 23 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index b92a245..bbb0be75 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -34,3 +34,3 @@
34 34
35InstallDlgImpl::InstallDlgImpl( vector<QString> &packageList, DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) 35InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl )
36 : InstallDlg( parent, name, modal, fl ) 36 : InstallDlg( parent, name, modal, fl )
@@ -48,3 +48,4 @@ InstallDlgImpl::InstallDlgImpl( vector<QString> &packageList, DataManager *dataM
48 // Grab flags - Turn MAKE_LINKS on by default (if no flags found) 48 // Grab flags - Turn MAKE_LINKS on by default (if no flags found)
49 flags = cfg.readNumEntry( "installFlags", MAKE_LINKS ); 49// flags = cfg.readNumEntry( "installFlags", MAKE_LINKS );
50 flags = 0;
50#else 51#else
@@ -72,3 +73,3 @@ InstallDlgImpl::InstallDlgImpl( vector<QString> &packageList, DataManager *dataM
72 73
73 vector<QString>::iterator it; 74 vector<InstallData>::iterator it;
74 // setup package data 75 // setup package data
@@ -79,17 +80,17 @@ InstallDlgImpl::InstallDlgImpl( vector<QString> &packageList, DataManager *dataM
79 { 80 {
80 QString name = *it; 81 InstallData item = *it;
81 if ( name.startsWith( "I" ) ) 82 if ( item.option == "I" )
82 { 83 {
83 installList.push_back( name.mid(1) ); 84 installList.push_back( item );
84 install += " " + name.mid(1) + "\n"; 85 install += " " + item.packageName + "\n";
85 } 86 }
86 else if ( name.startsWith( "D" ) ) 87 else if ( item.option == "D" )
87 { 88 {
88 removeList.push_back( name.mid(1) ); 89 removeList.push_back( item );
89 remove += " " + name.mid(1) + "\n"; 90 remove += " " + item.packageName + "\n";
90 } 91 }
91 else if ( name.startsWith( "U" ) ) 92 else if ( item.option == "U" )
92 { 93 {
93 updateList.push_back( name.mid(1) ); 94 updateList.push_back( item );
94 upgrade += " " + name.mid(1) + "\n"; 95 upgrade += " " + item.packageName + "\n";
95 } 96 }
@@ -138,4 +139,2 @@ void InstallDlgImpl :: optionsSelected()
138 flags |= FORCE_OVERWRITE; 139 flags |= FORCE_OVERWRITE;
139 if ( opt.makeLinks->isChecked() )
140 flags |= MAKE_LINKS;
141 140
@@ -173,2 +172,5 @@ void InstallDlgImpl :: installSelected()
173 QString destDir = d->getDestinationPath(); 172 QString destDir = d->getDestinationPath();
173 int instFlags = 0;
174 if ( d->linkToRoot() )
175 instFlags = MAKE_LINKS;
174 176
@@ -182,10 +184,17 @@ void InstallDlgImpl :: installSelected()
182 // First run through the remove list, then the install list then the upgrade list 184 // First run through the remove list, then the install list then the upgrade list
183 vector<QString>::iterator it; 185 vector<InstallData>::iterator it;
184 ipkg.setOption( "remove" ); 186 ipkg.setOption( "remove" );
185 ipkg.setDestination( dest );
186 ipkg.setDestinationDir( destDir );
187 ipkg.setFlags( flags );
188 for ( it = removeList.begin() ; it != removeList.end() ; ++it ) 187 for ( it = removeList.begin() ; it != removeList.end() ; ++it )
189 { 188 {
190 ipkg.setPackage( *it ); 189 ipkg.setDestination( it->destination->getDestinationName() );
190 ipkg.setDestinationDir( it->destination->getDestinationPath() );
191 ipkg.setPackage( it->packageName );
192
193 int tmpFlags = flags;
194 if ( it->destination->linkToRoot() )
195 tmpFlags |= MAKE_LINKS;
196 else
197 tmpFlags ^= MAKE_LINKS;
198
199 ipkg.setFlags( tmpFlags );
191 ipkg.runIpkg(); 200 ipkg.runIpkg();
@@ -194,5 +203,8 @@ void InstallDlgImpl :: installSelected()
194 ipkg.setOption( "install" ); 203 ipkg.setOption( "install" );
204 ipkg.setDestination( dest );
205 ipkg.setDestinationDir( destDir );
206 ipkg.setFlags( instFlags );
195 for ( it = installList.begin() ; it != installList.end() ; ++it ) 207 for ( it = installList.begin() ; it != installList.end() ; ++it )
196 { 208 {
197 ipkg.setPackage( *it ); 209 ipkg.setPackage( it->packageName );
198 ipkg.runIpkg(); 210 ipkg.runIpkg();
@@ -201,6 +213,15 @@ void InstallDlgImpl :: installSelected()
201 flags |= FORCE_REINSTALL; 213 flags |= FORCE_REINSTALL;
202 ipkg.setFlags( flags ); 214 ipkg.setOption( "reinstall" );
203 for ( it = updateList.begin() ; it != updateList.end() ; ++it ) 215 for ( it = updateList.begin() ; it != updateList.end() ; ++it )
204 { 216 {
205 ipkg.setPackage( *it ); 217 ipkg.setDestination( it->destination->getDestinationName() );
218 ipkg.setDestinationDir( it->destination->getDestinationPath() );
219 ipkg.setPackage( it->packageName );
220
221 int tmpFlags = flags;
222 if ( it->destination->linkToRoot() && it->recreateLinks )
223 tmpFlags |= MAKE_LINKS;
224 else
225 tmpFlags ^= MAKE_LINKS;
226 ipkg.setFlags( tmpFlags );
206 ipkg.runIpkg(); 227 ipkg.runIpkg();