summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp1
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp2
-rw-r--r--noncore/unsupported/oipkg/utils.cpp2
-rw-r--r--noncore/unsupported/oipkg/utils.h2
4 files changed, 3 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 11ab406..233eae6 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -152,308 +152,307 @@ void MainWindow::makeMenu()
152 setSections(); 152 setSections();
153 setSubSections(); 153 setSubSections();
154 sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); 154 sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 );
155 connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); 155 connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) );
156 sectionAction->setToggleAction( true ); 156 sectionAction->setToggleAction( true );
157 sectionAction->addTo( viewMenu ); 157 sectionAction->addTo( viewMenu );
158 sectionBar->setStretchableWidget( section ); 158 sectionBar->setStretchableWidget( section );
159 159
160 //FIND 160 //FIND
161 findBar = new QPEToolBar(this); 161 findBar = new QPEToolBar(this);
162 addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); 162 addToolBar( findBar, "Filter", QMainWindow::Top, TRUE );
163 label = new QLabel( tr("Filter: "), findBar ); 163 label = new QLabel( tr("Filter: "), findBar );
164 label->setBackgroundColor( findBar->backgroundColor() ); 164 label->setBackgroundColor( findBar->backgroundColor() );
165 findBar->setHorizontalStretchable( TRUE ); 165 findBar->setHorizontalStretchable( TRUE );
166 findEdit = new QLineEdit( findBar, "findEdit" ); 166 findEdit = new QLineEdit( findBar, "findEdit" );
167 findBar->setStretchableWidget( findEdit ); 167 findBar->setStretchableWidget( findEdit );
168 connect( findEdit, SIGNAL( textChanged( const QString & ) ), 168 connect( findEdit, SIGNAL( textChanged( const QString & ) ),
169 this, SLOT( displayList() ) ); 169 this, SLOT( displayList() ) );
170 a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); 170 a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
171 connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); 171 connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) );
172 a->addTo( findBar ); 172 a->addTo( findBar );
173 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 173 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
174 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); 174 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
175 a->addTo( findBar ); 175 a->addTo( findBar );
176 findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); 176 findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 );
177 connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); 177 connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) );
178 findAction->setToggleAction( true ); 178 findAction->setToggleAction( true );
179 findAction->addTo( viewMenu ); 179 findAction->addTo( viewMenu );
180 180
181 //SEARCH 181 //SEARCH
182 searchBar = new QPEToolBar(this); 182 searchBar = new QPEToolBar(this);
183 addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); 183 addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
184 label = new QLabel( tr("ipkgfind: "), searchBar ); 184 label = new QLabel( tr("ipkgfind: "), searchBar );
185 label->setBackgroundColor( searchBar->backgroundColor() ); 185 label->setBackgroundColor( searchBar->backgroundColor() );
186 searchBar->setHorizontalStretchable( TRUE ); 186 searchBar->setHorizontalStretchable( TRUE );
187 searchEdit = new QLineEdit( searchBar, "seachEdit" ); 187 searchEdit = new QLineEdit( searchBar, "seachEdit" );
188 searchBar->setStretchableWidget( searchEdit ); 188 searchBar->setStretchableWidget( searchEdit );
189// connect( searchEdit, SIGNAL( textChanged( const QString & ) ), 189// connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
190// this, SLOT( displayList() ) ); 190// this, SLOT( displayList() ) );
191 a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); 191 a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
192 connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); 192 connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) );
193 a->addTo( searchBar ); 193 a->addTo( searchBar );
194 searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); 194 searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
195 connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); 195 connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) );
196 searchCommit->addTo( searchBar ); 196 searchCommit->addTo( searchBar );
197 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 197 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
198 connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); 198 connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) );
199 a->addTo( searchBar ); 199 a->addTo( searchBar );
200 searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); 200 searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 );
201 connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); 201 connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) );
202 searchAction->setToggleAction( true ); 202 searchAction->setToggleAction( true );
203 searchAction->addTo( viewMenu ); 203 searchAction->addTo( viewMenu );
204 204
205 //DEST 205 //DEST
206 destBar = new QPEToolBar(this); 206 destBar = new QPEToolBar(this);
207 addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); 207 addToolBar( destBar, "Destination", QMainWindow::Top, TRUE );
208 label = new QLabel( tr("Destination: "), destBar ); 208 label = new QLabel( tr("Destination: "), destBar );
209 label->setBackgroundColor( destBar->backgroundColor() ); 209 label->setBackgroundColor( destBar->backgroundColor() );
210 destBar->setHorizontalStretchable( TRUE ); 210 destBar->setHorizontalStretchable( TRUE );
211 destination = new QComboBox( false, destBar ); 211 destination = new QComboBox( false, destBar );
212 destination->insertStringList( settings->getDestinationNames() ); 212 destination->insertStringList( settings->getDestinationNames() );
213 setComboName(destination,settings->getDestinationName()); 213 setComboName(destination,settings->getDestinationName());
214 connect( destination, SIGNAL(activated(int)), 214 connect( destination, SIGNAL(activated(int)),
215 settings, SLOT(activeDestinationChange(int)) ); 215 settings, SLOT(activeDestinationChange(int)) );
216 spacer = new QLabel( " ", destBar ); 216 spacer = new QLabel( " ", destBar );
217 spacer->setBackgroundColor( destBar->backgroundColor() ); 217 spacer->setBackgroundColor( destBar->backgroundColor() );
218 CheckBoxLink = new QCheckBox( tr("Link"), destBar); 218 CheckBoxLink = new QCheckBox( tr("Link"), destBar);
219 CheckBoxLink->setBackgroundColor( destBar->backgroundColor() ); 219 CheckBoxLink->setBackgroundColor( destBar->backgroundColor() );
220 CheckBoxLink->setChecked( settings->createLinks() ); 220 CheckBoxLink->setChecked( settings->createLinks() );
221 connect( CheckBoxLink, SIGNAL(toggled(bool)), 221 connect( CheckBoxLink, SIGNAL(toggled(bool)),
222 settings, SLOT(linkEnabled(bool)) ); 222 settings, SLOT(linkEnabled(bool)) );
223 destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); 223 destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 );
224 connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); 224 connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) );
225 a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 225 a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
226 connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); 226 connect( a, SIGNAL( activated() ), SLOT( destClose() ) );
227 a->addTo( destBar ); 227 a->addTo( destBar );
228 destBar->setStretchableWidget( CheckBoxLink ); 228 destBar->setStretchableWidget( CheckBoxLink );
229 destAction->setToggleAction( true ); 229 destAction->setToggleAction( true );
230 // destAction->addTo( viewMenu ); 230 // destAction->addTo( viewMenu );
231 231
232 // configure the menus 232 // configure the menus
233 Config cfg( "oipkg", Config::User ); 233 Config cfg( "oipkg", Config::User );
234 cfg.setGroup( "gui" ); 234 cfg.setGroup( "gui" );
235 235
236 findShow( cfg.readBoolEntry( "findBar", true ) ); 236 findShow( cfg.readBoolEntry( "findBar", true ) );
237 searchShow( cfg.readBoolEntry( "searchBar", true ) ); 237 searchShow( cfg.readBoolEntry( "searchBar", true ) );
238 sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); 238 sectionShow( cfg.readBoolEntry( "sectionBar", true ) );
239 destShow( cfg.readBoolEntry( "destBar", false ) ); 239 destShow( cfg.readBoolEntry( "destBar", false ) );
240} 240}
241 241
242MainWindow::~MainWindow() 242MainWindow::~MainWindow()
243{ 243{
244 Config cfg( "oipkg", Config::User ); 244 Config cfg( "oipkg", Config::User );
245 cfg.setGroup( "gui" ); 245 cfg.setGroup( "gui" );
246 cfg.writeEntry( "findBar", !findBar->isHidden() ); 246 cfg.writeEntry( "findBar", !findBar->isHidden() );
247 cfg.writeEntry( "searchBar", !searchBar->isHidden() ); 247 cfg.writeEntry( "searchBar", !searchBar->isHidden() );
248 cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); 248 cfg.writeEntry( "sectionBar", !sectionBar->isHidden() );
249 cfg.writeEntry( "destBar", !destBar->isHidden() ); 249 cfg.writeEntry( "destBar", !destBar->isHidden() );
250 250
251} 251}
252 252
253void MainWindow::runIpkg() 253void MainWindow::runIpkg()
254{ 254{
255 packageListServers.allPackages(); 255 packageListServers.allPackages();
256 ipkg->loadList( &packageListSearch ); 256 ipkg->loadList( &packageListSearch );
257 ipkg->loadList( &packageListDocLnk ); 257 ipkg->loadList( &packageListDocLnk );
258 ipkg->loadList( &packageListServers ); 258 ipkg->loadList( &packageListServers );
259 ipkg->commit(); 259 ipkg->commit();
260 ipkg->clearLists(); 260 ipkg->clearLists();
261 // ##### If we looked in the list of files, we could send out accurate 261 // ##### If we looked in the list of files, we could send out accurate
262 // ##### messages. But we don't bother yet, and just do an "all". 262 // ##### messages. But we don't bother yet, and just do an "all".
263 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 263 QCopEnvelope e("QPE/System", "linkChanged(QString)");
264 QString lf = QString::null; 264 QString lf = QString::null;
265 e << lf; 265 e << lf;
266 displayList(); 266 displayList();
267} 267}
268 268
269void MainWindow::updateList() 269void MainWindow::updateList()
270{ 270{
271 packageListServers.clear(); 271 packageListServers.clear();
272 packageListSearch.clear(); 272 packageListSearch.clear();
273 packageListDocLnk.clear(); 273 packageListDocLnk.clear();
274 ipkg->update(); 274 ipkg->update();
275 packageListServers.update(); 275 packageListServers.update();
276 packageListSearch.update(); 276 packageListSearch.update();
277 packageListDocLnk.update(); 277 packageListDocLnk.update();
278} 278}
279 279
280void MainWindow::filterList() 280void MainWindow::filterList()
281{ 281{
282 QString f = ""; 282 QString f = "";
283 if ( findAction->isOn() ) f = findEdit->text(); 283 if ( findAction->isOn() ) f = findEdit->text();
284 packageListServers.filterPackages( f ); 284 packageListServers.filterPackages( f );
285} 285}
286 286
287void MainWindow::displayList() 287void MainWindow::displayList()
288{ 288{
289 filterList(); 289 filterList();
290 listViewPackages->display(); 290 listViewPackages->display();
291} 291}
292 292
293void MainWindow::sectionChanged() 293void MainWindow::sectionChanged()
294{ 294{
295 disconnect( section, SIGNAL( activated(int) ), 295 disconnect( section, SIGNAL( activated(int) ),
296 this, SLOT( sectionChanged() ) ); 296 this, SLOT( sectionChanged() ) );
297 disconnect( subsection, SIGNAL(activated(int) ), 297 disconnect( subsection, SIGNAL(activated(int) ),
298 this, SLOT( subSectionChanged() ) ); 298 this, SLOT( subSectionChanged() ) );
299 subsection->clear(); 299 subsection->clear();
300 packageListServers.setSection( section->currentText() ); 300 packageListServers.setSection( section->currentText() );
301 setSubSections(); 301 setSubSections();
302 connect( section, SIGNAL( activated(int) ), 302 connect( section, SIGNAL( activated(int) ),
303 this, SLOT( sectionChanged() ) ); 303 this, SLOT( sectionChanged() ) );
304 connect( subsection, SIGNAL(activated(int) ), 304 connect( subsection, SIGNAL(activated(int) ),
305 this, SLOT( subSectionChanged() ) ); 305 this, SLOT( subSectionChanged() ) );
306 displayList(); 306 displayList();
307} 307}
308 308
309void MainWindow::subSectionChanged() 309void MainWindow::subSectionChanged()
310{ 310{
311 disconnect( section, SIGNAL( activated(int) ), 311 disconnect( section, SIGNAL( activated(int) ),
312 this, SLOT( sectionChanged() ) ); 312 this, SLOT( sectionChanged() ) );
313 disconnect( subsection, SIGNAL(activated(int) ), 313 disconnect( subsection, SIGNAL(activated(int) ),
314 this, SLOT( subSectionChanged() ) ); 314 this, SLOT( subSectionChanged() ) );
315 packageListServers.setSubSection( subsection->currentText() ); 315 packageListServers.setSubSection( subsection->currentText() );
316 connect( section, SIGNAL( activated(int) ), 316 connect( section, SIGNAL( activated(int) ),
317 this, SLOT( sectionChanged() ) ); 317 this, SLOT( sectionChanged() ) );
318 connect( subsection, SIGNAL(activated(int) ), 318 connect( subsection, SIGNAL(activated(int) ),
319 this, SLOT( subSectionChanged() ) ); 319 this, SLOT( subSectionChanged() ) );
320 displayList(); 320 displayList();
321} 321}
322 322
323void MainWindow::setSections() 323void MainWindow::setSections()
324{ 324{
325 section->clear(); 325 section->clear();
326 section->insertStringList( packageListServers.getSections() ); 326 section->insertStringList( packageListServers.getSections() );
327} 327}
328 328
329void MainWindow::setSubSections() 329void MainWindow::setSubSections()
330{ 330{
331 subsection->clear(); 331 subsection->clear();
332 subsection->insertStringList( packageListServers.getSubSections() ); 332 subsection->insertStringList( packageListServers.getSubSections() );
333} 333}
334 334
335 335
336void MainWindow::showSettings() 336void MainWindow::showSettings()
337{ 337{
338 if ( settings->showDialog( 0 ) ) 338 if ( settings->showDialog( 0 ) )
339 updateList(); 339 updateList();
340} 340}
341void MainWindow::showSettingsSrv() 341void MainWindow::showSettingsSrv()
342{ 342{
343 if ( settings->showDialog( 1 ) ) 343 if ( settings->showDialog( 1 ) )
344 updateList(); 344 updateList();
345} 345}
346void MainWindow::showSettingsDst() 346void MainWindow::showSettingsDst()
347{ 347{
348 if ( settings->showDialog( 2 ) ) 348 if ( settings->showDialog( 2 ) )
349 updateList(); 349 updateList();
350} 350}
351 351
352void MainWindow::sectionShow(bool b) 352void MainWindow::sectionShow(bool b)
353{ 353{
354 if (b) sectionBar->show(); 354 if (b) sectionBar->show();
355 else sectionBar->hide(); 355 else sectionBar->hide();
356 sectionAction->setOn( b ); 356 sectionAction->setOn( b );
357} 357}
358 358
359void MainWindow::sectionClose() 359void MainWindow::sectionClose()
360{ 360{
361 sectionAction->setOn( false ); 361 sectionAction->setOn( false );
362} 362}
363 363
364void MainWindow::findShow(bool b) 364void MainWindow::findShow(bool b)
365{ 365{
366 if (b) findBar->show(); 366 if (b) findBar->show();
367 else findBar->hide(); 367 else findBar->hide();
368 findAction->setOn( b ); 368 findAction->setOn( b );
369} 369}
370 370
371void MainWindow::findClose() 371void MainWindow::findClose()
372{ 372{
373 findAction->setOn( false ); 373 findAction->setOn( false );
374} 374}
375 375
376void MainWindow::searchShow(bool b) 376void MainWindow::searchShow(bool b)
377{ 377{
378 if (b) searchBar->show(); 378 if (b) searchBar->show();
379 else searchBar->hide(); 379 else searchBar->hide();
380 searchAction->setOn( b ); 380 searchAction->setOn( b );
381} 381}
382 382
383void MainWindow::searchClose() 383void MainWindow::searchClose()
384{ 384{
385 searchAction->setOn( false ); 385 searchAction->setOn( false );
386} 386}
387 387
388 388
389void MainWindow::destShow(bool b) 389void MainWindow::destShow(bool b)
390{ 390{
391 if (b) destBar->show(); 391 if (b) destBar->show();
392 else destBar->hide(); 392 else destBar->hide();
393 destAction->setOn( b ); 393 destAction->setOn( b );
394} 394}
395 395
396void MainWindow::destClose() 396void MainWindow::destClose()
397{ 397{
398 destAction->setOn( false ); 398 destAction->setOn( false );
399} 399}
400 400
401void MainWindow::setDocument(const QString &fileName) 401void MainWindow::setDocument(const QString &fileName)
402{ 402{
403 if ( !QFile::exists( fileName ) ) return; 403 if ( !QFile::exists( fileName ) ) return;
404 ipkg->installFile( fileName ); 404 ipkg->installFile( fileName );
405 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 405 QCopEnvelope e("QPE/System", "linkChanged(QString)");
406 QString lf = QString::null; 406 QString lf = QString::null;
407 e << lf; 407 e << lf;
408 exit;
409} 408}
410 409
411 410
412void MainWindow::makeChannel() 411void MainWindow::makeChannel()
413 { 412 {
414 channel = new QCopChannel( "QPE/Application/oipkg", this ); 413 channel = new QCopChannel( "QPE/Application/oipkg", this );
415 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 414 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
416 this, SLOT(receive(const QCString&, const QByteArray&)) ); 415 this, SLOT(receive(const QCString&, const QByteArray&)) );
417} 416}
418 417
419 418
420 419
421void MainWindow::receive(const QCString &msg, const QByteArray &arg) 420void MainWindow::receive(const QCString &msg, const QByteArray &arg)
422{ 421{
423 pvDebug(3, "QCop "+msg+" "+QCString(arg)); 422 pvDebug(3, "QCop "+msg+" "+QCString(arg));
424 if ( msg == "installFile(QString)" ) 423 if ( msg == "installFile(QString)" )
425 { 424 {
426 ipkg->installFile( QString(arg) ); 425 ipkg->installFile( QString(arg) );
427 }else if( msg == "removeFile(QString)" ) 426 }else if( msg == "removeFile(QString)" )
428 { 427 {
429 ipkg->removeFile( QString(arg) ); 428 ipkg->removeFile( QString(arg) );
430 }else if( msg == "createLinks(QString)" ) 429 }else if( msg == "createLinks(QString)" )
431 { 430 {
432 ipkg->createLinks( QString(arg) ); 431 ipkg->createLinks( QString(arg) );
433 }else if( msg == "removeLinks(QString)" ) 432 }else if( msg == "removeLinks(QString)" )
434 { 433 {
435 ipkg->removeLinks( QString(arg) ); 434 ipkg->removeLinks( QString(arg) );
436 }else{ 435 }else{
437 pvDebug(2,"Huh what do ya want") 436 pvDebug(2,"Huh what do ya want")
438 } 437 }
439} 438}
440 439
441 440
442void MainWindow::createLinks() 441void MainWindow::createLinks()
443{ 442{
444 pvDebug(2,"creating links..."); 443 pvDebug(2,"creating links...");
445 ipkg->createLinks( settings->destinationurl->text() ); 444 ipkg->createLinks( settings->destinationurl->text() );
446} 445}
447 446
448void MainWindow::removeLinks() 447void MainWindow::removeLinks()
449{ 448{
450 pvDebug(2,"removing links..."); 449 pvDebug(2,"removing links...");
451 ipkg->removeLinks( settings->destinationurl->text() ); 450 ipkg->removeLinks( settings->destinationurl->text() );
452} 451}
453 452
454void MainWindow::remotePackageQuery() 453void MainWindow::remotePackageQuery()
455{ 454{
456 packageListSearch.query( searchEdit->text() ); 455 packageListSearch.query( searchEdit->text() );
457 packageListSearch.update(); 456 packageListSearch.update();
458 displayList(); 457 displayList();
459} 458}
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 2a534d2..0817247 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -210,257 +210,257 @@ void PmIpkg::processLinkDir( QString file, QString dest )
210 if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); 210 if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink");
211 if ( dest == "???" || dest == "" ) return; 211 if ( dest == "???" || dest == "" ) return;
212 QString destFile = file; 212 QString destFile = file;
213 file = dest+"/"+file; 213 file = dest+"/"+file;
214 if (file == dest) return; 214 if (file == dest) return;
215// if (linkOpp==createLink) out( "\ncreating links\n" ); 215// if (linkOpp==createLink) out( "\ncreating links\n" );
216 // if (linkOpp==removeLink) out( "\nremoving links\n" ); 216 // if (linkOpp==removeLink) out( "\nremoving links\n" );
217 QFileInfo fileInfo( file ); 217 QFileInfo fileInfo( file );
218 if ( fileInfo.isDir() ) 218 if ( fileInfo.isDir() )
219 { 219 {
220 pvDebug(4, "process dir "+file); 220 pvDebug(4, "process dir "+file);
221 QDir destDir( destFile ); 221 QDir destDir( destFile );
222 if (linkOpp==createLink) destDir.mkdir( destFile, true ); 222 if (linkOpp==createLink) destDir.mkdir( destFile, true );
223 QDir d( file ); 223 QDir d( file );
224// d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); 224// d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
225 const QFileInfoList *list = d.entryInfoList(); 225 const QFileInfoList *list = d.entryInfoList();
226 QFileInfoListIterator it( *list ); 226 QFileInfoListIterator it( *list );
227 QFileInfo *fi; 227 QFileInfo *fi;
228 while ( (fi=it.current()) ) 228 while ( (fi=it.current()) )
229 { 229 {
230 pvDebug(4, "processLinkDir "+fi->absFilePath()); 230 pvDebug(4, "processLinkDir "+fi->absFilePath());
231 processLinkDir( fi->absFilePath(), dest ); 231 processLinkDir( fi->absFilePath(), dest );
232 ++it; 232 ++it;
233 } 233 }
234 } else 234 } else
235 if ( fileInfo.isFile() ) 235 if ( fileInfo.isFile() )
236 { 236 {
237 const char *instFile = strdup( (file).ascii() ); 237 const char *instFile = strdup( (file).ascii() );
238 const char *linkFile = strdup( (destFile).ascii()); 238 const char *linkFile = strdup( (destFile).ascii());
239 if( linkOpp==createLink ) 239 if( linkOpp==createLink )
240 { 240 {
241 pvDebug(4, "linking: "+file+" -> "+destFile ); 241 pvDebug(4, "linking: "+file+" -> "+destFile );
242 symlink( instFile, linkFile ); 242 symlink( instFile, linkFile );
243 } 243 }
244 } else { 244 } else {
245 const char *linkFile = strdup( (destFile).ascii()); 245 const char *linkFile = strdup( (destFile).ascii());
246 if( linkOpp==removeLink ) 246 if( linkOpp==removeLink )
247 { 247 {
248 QFileInfo toRemoveLink( destFile ); 248 QFileInfo toRemoveLink( destFile );
249 if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) 249 if ( !QFile::exists( file ) && toRemoveLink.isSymLink() )
250 { 250 {
251 pvDebug(4,"removing "+destFile+" no "+file); 251 pvDebug(4,"removing "+destFile+" no "+file);
252 unlink( linkFile ); 252 unlink( linkFile );
253 } 253 }
254 } 254 }
255 } 255 }
256} 256}
257 257
258void PmIpkg::loadList( PackageList *pl ) 258void PmIpkg::loadList( PackageList *pl )
259 { 259 {
260 for( Package *pack = pl->first();pack ; (pack = pl->next()) ) 260 for( Package *pack = pl->first();pack ; (pack = pl->next()) )
261 { 261 {
262 if ( pack && (pack->name() != "") && pack) 262 if ( pack && (pack->name() != "") && pack)
263 { 263 {
264 if ( pack->toInstall() ) 264 if ( pack->toInstall() )
265 to_install.append( pack ); 265 to_install.append( pack );
266 if ( pack->toRemove() ) 266 if ( pack->toRemove() )
267 to_remove.append( pack ); 267 to_remove.append( pack );
268 } 268 }
269 } 269 }
270} 270}
271 271
272void PmIpkg::commit() 272void PmIpkg::commit()
273 { 273 {
274 int sizecount = 0; 274 int sizecount = 0;
275 installDialog = new InstallDialog(settings,0,0,true); 275 installDialog = new InstallDialog(settings,0,0,true);
276 installDialog->toRemoveItem->setOpen( true ); 276 installDialog->toRemoveItem->setOpen( true );
277 installDialog->toInstallItem->setOpen( true ); 277 installDialog->toInstallItem->setOpen( true );
278 for (uint i=0; i < to_remove.count(); i++) 278 for (uint i=0; i < to_remove.count(); i++)
279 { 279 {
280 sizecount += 1; 280 sizecount += 1;
281 installDialog->toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) ); 281 installDialog->toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) );
282 } 282 }
283 for (uint i=0; i < to_install.count(); i++) 283 for (uint i=0; i < to_install.count(); i++)
284 { 284 {
285 sizecount += to_install.at(i)->size().toInt(); 285 sizecount += to_install.at(i)->size().toInt();
286 installDialog->toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) ); 286 installDialog->toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) );
287 } 287 }
288 runwindow->progress->setTotalSteps(sizecount); 288 runwindow->progress->setTotalSteps(sizecount);
289 qDebug("Install size %i",sizecount); 289 qDebug("Install size %i",sizecount);
290 installDialog->showMaximized(); 290 installDialog->showMaximized();
291 installDialog->show(); 291 installDialog->show();
292 if ( installDialog->exec() ) 292 if ( installDialog->exec() )
293 { 293 {
294 doIt(); 294 doIt();
295 runwindow->showMaximized(); 295 runwindow->showMaximized();
296 runwindow->show(); 296 runwindow->show();
297 } 297 }
298 installDialog->close(); 298 installDialog->close();
299 delete installDialog; 299 delete installDialog;
300 installDialog = 0; 300 installDialog = 0;
301 out(tr("\nAll done.")); 301 out(tr("\nAll done."));
302} 302}
303 303
304void PmIpkg::doIt() 304void PmIpkg::doIt()
305{ 305{
306 runwindow->progress->setProgress(0); 306 runwindow->progress->setProgress(0);
307 show(); 307 show();
308 remove(); 308 remove();
309 install(); 309 install();
310} 310}
311 311
312 312
313void PmIpkg::remove() 313void PmIpkg::remove()
314{ 314{
315 if ( to_remove.count() == 0 ) return; 315 if ( to_remove.count() == 0 ) return;
316 316
317 out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); 317 out(tr("Removing")+"\n"+tr("please wait")+"\n\n");
318 318
319 QStringList *fileList; 319 QStringList *fileList;
320 for (uint i=0; i < to_remove.count(); i++) 320 for (uint i=0; i < to_remove.count(); i++)
321 { 321 {
322 if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); 322 if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() );
323 if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) 323 if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() ))
324 { 324 {
325 runwindow->progress->setProgress( 1 ); 325 runwindow->progress->setProgress( 1 );
326 linkOpp = removeLink; 326 linkOpp = removeLink;
327 to_remove.at(i)->processed(); 327 to_remove.at(i)->processed();
328 pvDebug(3,"link "+QString::number(i)); 328 pvDebug(3,"link "+QString::number(i));
329 if ( to_remove.at(i)->link() ) 329 if ( to_remove.at(i)->link() )
330 processFileList( fileList, to_remove.at(i)->dest() ); 330 processFileList( fileList, to_remove.at(i)->dest() );
331 //pvDebug(3,"take "+QString::number(i)+" of "+QString::number(to_remove.count())); 331 //pvDebug(3,"take "+QString::number(i)+" of "+QString::number(to_remove.count()));
332 //if ( to_remove.at(i) ) to_remove.take( i ); 332 //if ( to_remove.at(i) ) to_remove.take( i );
333 333
334 out("\n"); 334 out("\n");
335 }else{ 335 }else{
336 out(tr("Error while removing ")+to_remove.at(i)->name()+"\n"); 336 out(tr("Error while removing ")+to_remove.at(i)->name()+"\n");
337 if ( to_remove.at(i)->link() ) 337 if ( to_remove.at(i)->link() )
338 processFileList( fileList, to_remove.at(i)->dest() ); 338 processFileList( fileList, to_remove.at(i)->dest() );
339 } 339 }
340 if ( to_remove.at(i)->link() ) 340 if ( to_remove.at(i)->link() )
341 processFileList( fileList, to_remove.at(i)->dest() ); 341 processFileList( fileList, to_remove.at(i)->dest() );
342 if ( to_remove.at(i)->link() )delete fileList; 342 if ( to_remove.at(i)->link() )delete fileList;
343 } 343 }
344 to_remove.clear(); 344 to_remove.clear();
345 out("\n"); 345 out("\n");
346} 346}
347 347
348 348
349void PmIpkg::install() 349void PmIpkg::install()
350{ 350{
351 if ( to_install.count() == 0 ) return; 351 if ( to_install.count() == 0 ) return;
352 out(tr("Installing")+"\n"+tr("please wait")+"\n"); 352 out(tr("Installing")+"\n"+tr("please wait")+"\n");
353 for (uint i=0; i < to_install.count(); i++) 353 for (uint i=0; i < to_install.count(); i++)
354 { 354 {
355 qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug 355 qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug
356 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) 356 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() ))
357 { 357 {
358 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); 358 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress());
359 to_install.at(i)->processed(); 359 to_install.at(i)->processed();
360 linkOpp = createLink; 360 linkOpp = createLink;
361 if ( to_install.at(i)->link() ) 361 if ( to_install.at(i)->link() )
362 makeLinks( to_install.at(i) ); 362 makeLinks( to_install.at(i) );
363 // to_install.take( i ); 363 // to_install.take( i );
364 out("\n"); 364 out("\n");
365 }else{ 365 }else{
366 out(tr("Error while installing")+to_install.at(i)->name()+"\n"); 366 out(tr("Error while installing")+to_install.at(i)->name()+"\n");
367 linkOpp = createLink; 367 linkOpp = createLink;
368 if ( to_install.at(i)->link() ) 368 if ( to_install.at(i)->link() )
369 makeLinks( to_install.at(i) ); 369 makeLinks( to_install.at(i) );
370 } 370 }
371 } 371 }
372 out("\n"); 372 out("\n");
373 to_install.clear(); 373 to_install.clear();
374} 374}
375 375
376void PmIpkg::createLinks( const QString &dest ) 376void PmIpkg::createLinks( const QString &dest )
377{ 377{
378 pvDebug(2,"PmIpkg::createLinks "+dest); 378 pvDebug(2,"PmIpkg::createLinks "+dest);
379 linkOpp=createLink; 379 linkOpp=createLink;
380 QString url = settings->getDestinationUrlByName( dest ); 380 QString url = settings->getDestinationUrlByName( dest );
381 url = url==""?dest:url; 381 url = url==""?dest:url;
382 processLinkDir( "/opt", url ); 382 processLinkDir( "/opt", url );
383 processLinkDir( "/usr", url ); 383 processLinkDir( "/usr", url );
384} 384}
385 385
386void PmIpkg::removeLinks( const QString &dest ) 386void PmIpkg::removeLinks( const QString &dest )
387{ 387{
388 pvDebug(2,"PmIpkg::removeLinks "+dest); 388 pvDebug(2,"PmIpkg::removeLinks "+dest);
389 linkOpp=removeLink; 389 linkOpp=removeLink;
390 QString url = settings->getDestinationUrlByName( dest ); 390 QString url = settings->getDestinationUrlByName( dest );
391 url = url==""?dest:url; 391 url = url==""?dest:url;
392 processLinkDir( "/opt", url ); 392 processLinkDir( "/opt", url );
393 processLinkDir( "/usr", url ); 393 processLinkDir( "/usr", url );
394} 394}
395 395
396void PmIpkg::update() 396void PmIpkg::update()
397{ 397{
398 show(); 398 show();
399 if ( runIpkg( "update" ) ) 399 if ( runIpkg( "update" ) )
400 runwindow->close(); 400 runwindow->close();
401 else out("An error occurred!\nPlease check the log."); 401 else out("An error occurred!\nPlease check the log.");
402} 402}
403 403
404void PmIpkg::out( QString o ) 404void PmIpkg::out( QString o )
405{ 405{
406 runwindow->outPut->append(o); 406 runwindow->outPut->append(o);
407 runwindow->outPut->setCursorPosition(runwindow->outPut->numLines() + 1,0,FALSE); 407 runwindow->outPut->setCursorPosition(runwindow->outPut->numLines() + 1,0,FALSE);
408} 408}
409 409
410 410
411 411
412 412
413void PmIpkg::show() 413void PmIpkg::show()
414{ 414{
415 if (!runwindow->isVisible()) 415 if (!runwindow->isVisible())
416 { 416 {
417 runwindow->showMaximized(); 417 runwindow->showMaximized();
418 runwindow->show(); 418 runwindow->show();
419 } 419 }
420 runwindow->outPut->setText(""); 420 runwindow->outPut->setText("");
421} 421}
422 422
423void PmIpkg::installFile(const QString &fileName, const QString &dest) 423void PmIpkg::installFile(const QString &fileName, const QString &dest)
424{ 424{
425 425
426 to_install.clear(); 426 to_install.clear();
427 to_remove.clear(); 427 to_remove.clear();
428 pvDebug( 2,"PmIpkg::installFile "+ fileName); 428 pvDebug( 2,"PmIpkg::installFile "+ fileName);
429 Package *p = new Package(fileName,settings); 429 Package *p = new Package(fileName,settings);
430 if ( dest!="") p->setDest( dest ); 430 if ( dest!="") p->setDest( dest );
431 to_install.append( p ); 431 to_install.append( p );
432 commit(); 432 commit();
433 delete p; 433 delete p;
434} 434}
435 435
436void PmIpkg::removeFile(const QString &fileName, const QString &dest) 436void PmIpkg::removeFile(const QString &fileName, const QString &dest)
437{ 437{
438 438
439 to_install.clear(); 439 to_install.clear();
440 to_remove.clear(); 440 to_remove.clear();
441 pvDebug( 2,"PmIpkg::removeFile "+ fileName); 441 pvDebug( 2,"PmIpkg::removeFile "+ fileName);
442 Package *p = new Package(fileName,settings); 442 Package *p = new Package(fileName,settings);
443 if ( dest!="") p->setDest( dest ); 443 if ( dest!="") p->setDest( dest );
444 to_remove.append( p ); 444 to_remove.append( p );
445 commit(); 445 commit();
446 delete p; 446 delete p;
447} 447}
448 448
449 449
450void PmIpkg::clearLists() 450void PmIpkg::clearLists()
451{ 451{
452 to_remove.clear(); 452 to_remove.clear();
453 to_install.clear(); 453 to_install.clear();
454} 454}
455 455
456 456
457void PmIpkg::getIpkgOutput(OProcess *proc, char *buffer, int buflen) 457void PmIpkg::getIpkgOutput(OProcess *proc, char *buffer, int buflen)
458{ 458{
459 QString lineStr, lineStrOld; 459 QString lineStr, lineStrOld;
460 lineStr = buffer; 460 lineStr = buffer;
461 lineStr=lineStr.left(buflen); 461 lineStr=lineStr.left(buflen);
462 //Configuring opie-oipkg...Done 462 //Configuring opie-oipkg...Done
463 if (lineStr!=lineStrOld) 463 if (lineStr!=lineStrOld)
464 out(lineStr); 464 out(lineStr);
465 lineStrOld = lineStr; 465 lineStrOld = lineStr;
466} \ No newline at end of file 466}
diff --git a/noncore/unsupported/oipkg/utils.cpp b/noncore/unsupported/oipkg/utils.cpp
index 13b17fb..66dcf10 100644
--- a/noncore/unsupported/oipkg/utils.cpp
+++ b/noncore/unsupported/oipkg/utils.cpp
@@ -1,27 +1,27 @@
1/*************************************************************************** 1/***************************************************************************
2 utils.cpp - description 2 utils.cpp - description
3 ------------------- 3 -------------------
4 begin : Sun Apr 28 2002 4 begin : Sun Apr 28 2002
5 copyright : (C) 2002 by tille 5 copyright : (C) 2002 by tille
6 email : tille@handhelds.org 6 email : tille@handhelds.org
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#include <qcombobox.h> 18#include <qcombobox.h>
19#include <qstring.h> 19#include <qstring.h>
20#include "utils.h" 20#include "utils.h"
21 21
22void setComboName( QComboBox* combo, QString s) 22void setComboName( QComboBox* combo, QString s)
23{ 23{
24 for ( int i = 0; i < combo->count(); i++) 24 for ( int i = 0; i < combo->count(); i++)
25 if ( combo->text( i ) == s ) 25 if ( combo->text( i ) == s )
26 combo->setCurrentItem( i ); 26 combo->setCurrentItem( i );
27} \ No newline at end of file 27}
diff --git a/noncore/unsupported/oipkg/utils.h b/noncore/unsupported/oipkg/utils.h
index bb033c5..ecc70dc 100644
--- a/noncore/unsupported/oipkg/utils.h
+++ b/noncore/unsupported/oipkg/utils.h
@@ -1,18 +1,18 @@
1/*************************************************************************** 1/***************************************************************************
2 utils.h - description 2 utils.h - description
3 ------------------- 3 -------------------
4 begin : Sun Apr 28 2002 4 begin : Sun Apr 28 2002
5 copyright : (C) 2002 by tille 5 copyright : (C) 2002 by tille
6 email : tille@handhelds.org 6 email : tille@handhelds.org
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18void setComboName( QComboBox*, QString ); \ No newline at end of file 18void setComboName( QComboBox*, QString );