summaryrefslogtreecommitdiff
path: root/core/launcher
Unidiff
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp296
-rw-r--r--core/launcher/packageslave.cpp191
-rw-r--r--core/launcher/transferserver.cpp3
3 files changed, 244 insertions, 246 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 6afbcd8..779fe54 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -100,3 +100,3 @@ LauncherTabWidget::LauncherTabWidget( Launcher* parent ) :
100 connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), 100 connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)),
101 this, SLOT(appMessage(const QCString&,const QByteArray&))); 101 this, SLOT(appMessage(const QCString&,const QByteArray&)));
102#endif 102#endif
@@ -171,3 +171,3 @@ void LauncherTabWidget::appMessage(const QCString& message, const QByteArray&)
171 if ( message == "nextView()" ) 171 if ( message == "nextView()" )
172 categoryBar->nextTab(); 172 categoryBar->nextTab();
173} 173}
@@ -177,7 +177,7 @@ void LauncherTabWidget::raiseTabWidget()
177 if ( categoryBar->currentView() == docView() 177 if ( categoryBar->currentView() == docView()
178 && docLoadingWidgetEnabled ) { 178 && docLoadingWidgetEnabled ) {
179 stack->raiseWidget( docLoadingWidget ); 179 stack->raiseWidget( docLoadingWidget );
180 docLoadingWidget->updateGeometry(); 180 docLoadingWidget->updateGeometry();
181 } else { 181 } else {
182 stack->raiseWidget( categoryBar->currentView() ); 182 stack->raiseWidget( categoryBar->currentView() );
183 } 183 }
@@ -194,3 +194,3 @@ void LauncherTabWidget::tabProperties()
194 if ( rv >= 0 && rv != view->viewMode() ) { 194 if ( rv >= 0 && rv != view->viewMode() ) {
195 view->setViewMode( (LauncherView::ViewMode)rv ); 195 view->setViewMode( (LauncherView::ViewMode)rv );
196 } 196 }
@@ -204,5 +204,5 @@ void LauncherTabWidget::deleteView( const QString& id )
204 if ( t ) { 204 if ( t ) {
205 stack->removeWidget( t->view ); 205 stack->removeWidget( t->view );
206 delete t->view; 206 delete t->view;
207 categoryBar->removeTab( t ); 207 categoryBar->removeTab( t );
208 } 208 }
@@ -214,5 +214,5 @@ LauncherView* LauncherTabWidget::newView( const QString& id, const QPixmap& pm,
214 connect( view, SIGNAL(clicked(const AppLnk*)), 214 connect( view, SIGNAL(clicked(const AppLnk*)),
215 this, SIGNAL(clicked(const AppLnk*))); 215 this, SIGNAL(clicked(const AppLnk*)));
216 connect( view, SIGNAL(rightPressed(AppLnk*)), 216 connect( view, SIGNAL(rightPressed(AppLnk*)),
217 this, SIGNAL(rightPressed(AppLnk*))); 217 this, SIGNAL(rightPressed(AppLnk*)));
218 218
@@ -225,3 +225,3 @@ LauncherView* LauncherTabWidget::newView( const QString& id, const QPixmap& pm,
225 if ( id == "Documents" ) 225 if ( id == "Documents" )
226 docview = view; 226 docview = view;
227 227
@@ -242,3 +242,3 @@ LauncherView *LauncherTabWidget::view( const QString &id )
242 if ( !t ) 242 if ( !t )
243 return 0; 243 return 0;
244 return t->view; 244 return t->view;
@@ -254,4 +254,4 @@ void LauncherTabWidget::setLoadingWidgetEnabled( bool v )
254 if ( v != docLoadingWidgetEnabled && docLoadingWidget ) { 254 if ( v != docLoadingWidgetEnabled && docLoadingWidget ) {
255 docLoadingWidgetEnabled = v; 255 docLoadingWidgetEnabled = v;
256 raiseTabWidget(); 256 raiseTabWidget();
257 } 257 }
@@ -270,12 +270,12 @@ void LauncherTabWidget::setTabViewAppearance( LauncherView *v, Config &cfg )
270 if ( view == "List" ) // No tr 270 if ( view == "List" ) // No tr
271 v->setViewMode( LauncherView::List ); 271 v->setViewMode( LauncherView::List );
272 QString bgType = cfg.readEntry( "BackgroundType", "Image" ); 272 QString bgType = cfg.readEntry( "BackgroundType", "Image" );
273 if ( bgType == "Image" ) { // No tr 273 if ( bgType == "Image" ) { // No tr
274 QString pm = cfg.readEntry( "BackgroundImage", "launcher/opie-background" ); 274 QString pm = cfg.readEntry( "BackgroundImage", "launcher/opie-background" );
275 v->setBackgroundType( LauncherView::Image, pm ); 275 v->setBackgroundType( LauncherView::Image, pm );
276 } else if ( bgType == "SolidColor" ) { 276 } else if ( bgType == "SolidColor" ) {
277 QString c = cfg.readEntry( "BackgroundColor" ); 277 QString c = cfg.readEntry( "BackgroundColor" );
278 v->setBackgroundType( LauncherView::SolidColor, c ); 278 v->setBackgroundType( LauncherView::SolidColor, c );
279 } else { 279 } else {
280 v->setBackgroundType( LauncherView::Ruled, QString::null ); 280 v->setBackgroundType( LauncherView::Ruled, QString::null );
281 } 281 }
@@ -283,5 +283,5 @@ void LauncherTabWidget::setTabViewAppearance( LauncherView *v, Config &cfg )
283 if ( textCol.isEmpty() ) 283 if ( textCol.isEmpty() )
284 v->setTextColor( QColor() ); 284 v->setTextColor( QColor() );
285 else 285 else
286 v->setTextColor( QColor(textCol) ); 286 v->setTextColor( QColor(textCol) );
287// bool customFont = cfg.readBoolEntry( "CustomFont", FALSE ); 287// bool customFont = cfg.readBoolEntry( "CustomFont", FALSE );
@@ -307,10 +307,10 @@ void LauncherTabWidget::setTabAppearance( LauncherTab *tab, Config &cfg )
307 if ( tabCol.isEmpty() ) 307 if ( tabCol.isEmpty() )
308 tab->bgColor = QColor(); 308 tab->bgColor = QColor();
309 else 309 else
310 tab->bgColor = QColor(tabCol); 310 tab->bgColor = QColor(tabCol);
311 QString tabTextCol = cfg.readEntry( "TabTextColor" ); 311 QString tabTextCol = cfg.readEntry( "TabTextColor" );
312 if ( tabTextCol.isEmpty() ) 312 if ( tabTextCol.isEmpty() )
313 tab->fgColor = QColor(); 313 tab->fgColor = QColor();
314 else 314 else
315 tab->fgColor = QColor(tabTextCol); 315 tab->fgColor = QColor(tabTextCol);
316} 316}
@@ -335,6 +335,6 @@ void LauncherTabWidget::setProgressStyle()
335 if (docLoadingWidgetProgress) { 335 if (docLoadingWidgetProgress) {
336 docLoadingWidgetProgress->setFrameShape( QProgressBar::Box ); 336 docLoadingWidgetProgress->setFrameShape( QProgressBar::Box );
337 docLoadingWidgetProgress->setFrameShadow( QProgressBar::Plain ); 337 docLoadingWidgetProgress->setFrameShadow( QProgressBar::Plain );
338 docLoadingWidgetProgress->setMargin( 1 ); 338 docLoadingWidgetProgress->setMargin( 1 );
339 docLoadingWidgetProgress->setLineWidth( 1 ); 339 docLoadingWidgetProgress->setLineWidth( 1 );
340 } 340 }
@@ -345,8 +345,8 @@ void LauncherTabWidget::setBusy(bool on)
345 if ( on ) 345 if ( on )
346 currentView()->setBusy(TRUE); 346 currentView()->setBusy(TRUE);
347 else { 347 else {
348 for ( int i = 0; i < categoryBar->count(); i++ ) { 348 for ( int i = 0; i < categoryBar->count(); i++ ) {
349 LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view; 349 LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view;
350 view->setBusy( FALSE ); 350 view->setBusy( FALSE );
351 } 351 }
352 } 352 }
@@ -372,47 +372,47 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
372 if ( msg == "setTabView(QString,int)" ) { 372 if ( msg == "setTabView(QString,int)" ) {
373 QString id; 373 QString id;
374 stream >> id; 374 stream >> id;
375 int mode; 375 int mode;
376 stream >> mode; 376 stream >> mode;
377 if ( view(id) ) 377 if ( view(id) )
378 view(id)->setViewMode( (LauncherView::ViewMode)mode ); 378 view(id)->setViewMode( (LauncherView::ViewMode)mode );
379 } else if ( msg == "setTabBackground(QString,int,QString)" ) { 379 } else if ( msg == "setTabBackground(QString,int,QString)" ) {
380 QString id; 380 QString id;
381 stream >> id; 381 stream >> id;
382 int mode; 382 int mode;
383 stream >> mode; 383 stream >> mode;
384 QString pixmapOrColor; 384 QString pixmapOrColor;
385 stream >> pixmapOrColor; 385 stream >> pixmapOrColor;
386 if ( view(id) ) 386 if ( view(id) )
387 view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); 387 view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor );
388 if ( id == "Documents" ) 388 if ( id == "Documents" )
389 docLoadingWidget->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); 389 docLoadingWidget->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor );
390 } else if ( msg == "setTextColor(QString,QString)" ) { 390 } else if ( msg == "setTextColor(QString,QString)" ) {
391 QString id; 391 QString id;
392 stream >> id; 392 stream >> id;
393 QString color; 393 QString color;
394 stream >> color; 394 stream >> color;
395 if ( view(id) ) 395 if ( view(id) )
396 view(id)->setTextColor( QColor(color) ); 396 view(id)->setTextColor( QColor(color) );
397 if ( id == "Documents" ) 397 if ( id == "Documents" )
398 docLoadingWidget->setTextColor( QColor(color) ); 398 docLoadingWidget->setTextColor( QColor(color) );
399 } else if ( msg == "setFont(QString,QString,int,int,int)" ) { 399 } else if ( msg == "setFont(QString,QString,int,int,int)" ) {
400 QString id; 400 QString id;
401 stream >> id; 401 stream >> id;
402 QString fam; 402 QString fam;
403 stream >> fam; 403 stream >> fam;
404 int size; 404 int size;
405 stream >> size; 405 stream >> size;
406 int weight; 406 int weight;
407 stream >> weight; 407 stream >> weight;
408 int italic; 408 int italic;
409 stream >> italic; 409 stream >> italic;
410 if ( view(id) ) { 410 if ( view(id) ) {
411 if ( !fam.isEmpty() ) { 411 if ( !fam.isEmpty() ) {
412 view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); 412 view(id)->setViewFont( QFont(fam, size, weight, italic!=0) );
413 odebug << "setFont: " << fam << ", " << size << ", " << weight << ", " << italic << "" << oendl; 413 odebug << "setFont: " << fam << ", " << size << ", " << weight << ", " << italic << "" << oendl;
414 } else { 414 } else {
415 view(id)->clearViewFont(); 415 view(id)->clearViewFont();
416 } 416 }
417 } 417 }
418 }else if ( msg == "setBusyIndicatorType(QString)" ) { 418 }else if ( msg == "setBusyIndicatorType(QString)" ) {
@@ -466,9 +466,9 @@ void Launcher::createGUI()
466 connect( tb, SIGNAL(tabSelected(const QString&)), 466 connect( tb, SIGNAL(tabSelected(const QString&)),
467 this, SLOT(showTab(const QString&)) ); 467 this, SLOT(showTab(const QString&)) );
468 connect( tabs, SIGNAL(selected(const QString&)), 468 connect( tabs, SIGNAL(selected(const QString&)),
469 this, SLOT(viewSelected(const QString&)) ); 469 this, SLOT(viewSelected(const QString&)) );
470 connect( tabs, SIGNAL(clicked(const AppLnk*)), 470 connect( tabs, SIGNAL(clicked(const AppLnk*)),
471 this, SLOT(select(const AppLnk*))); 471 this, SLOT(select(const AppLnk*)));
472 connect( tabs, SIGNAL(rightPressed(AppLnk*)), 472 connect( tabs, SIGNAL(rightPressed(AppLnk*)),
473 this, SLOT(properties(AppLnk*))); 473 this, SLOT(properties(AppLnk*)));
474 474
@@ -496,3 +496,3 @@ Launcher::~Launcher()
496 if ( tb ) 496 if ( tb )
497 destroyGUI(); 497 destroyGUI();
498} 498}
@@ -523,13 +523,13 @@ bool Launcher::eventFilter( QObject*, QEvent *ev )
523 if ( ev->type() == QEvent::KeyPress ) { 523 if ( ev->type() == QEvent::KeyPress ) {
524 QKeyEvent *ke = (QKeyEvent *)ev; 524 QKeyEvent *ke = (QKeyEvent *)ev;
525 if ( ke->key() == Qt::Key_F11 ) { // menu key 525 if ( ke->key() == Qt::Key_F11 ) { // menu key
526 QWidget *active = qApp->activeWindow(); 526 QWidget *active = qApp->activeWindow();
527 if ( active && active->isPopup() ) 527 if ( active && active->isPopup() )
528 active->close(); 528 active->close();
529 else { 529 else {
530 Global::terminateBuiltin("calibrate"); // No tr 530 Global::terminateBuiltin("calibrate"); // No tr
531 tb->launchStartMenu(); 531 tb->launchStartMenu();
532 } 532 }
533 return TRUE; 533 return TRUE;
534 } 534 }
535 } 535 }
@@ -562,4 +562,4 @@ static bool isVisibleWindow(int wid)
562 for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { 562 for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) {
563 if ( w->winId() == wid ) 563 if ( w->winId() == wid )
564 return !w->isFullyObscured(); 564 return !w->isFullyObscured();
565 } 565 }
@@ -583,18 +583,18 @@ void Launcher::select( const AppLnk *appLnk )
583 if ( appLnk->type() == "Folder" ) { // No tr 583 if ( appLnk->type() == "Folder" ) { // No tr
584 // Not supported: flat is simpler for the user 584 // Not supported: flat is simpler for the user
585 } else { 585 } else {
586 if ( appLnk->exec().isNull() ) { 586 if ( appLnk->exec().isNull() ) {
587 int i = QMessageBox::information(this,tr("No application"), 587 int i = QMessageBox::information(this,tr("No application"),
588 tr("<p>No application is defined for this document." 588 tr("<p>No application is defined for this document."
589 "<p>Type is %1.").arg(appLnk->type()), tr("OK"), tr("View as text"), 0, 0, 1); 589 "<p>Type is %1.").arg(appLnk->type()), tr("OK"), tr("View as text"), 0, 0, 1);
590 590
591 /* ### Fixme */ 591 /* ### Fixme */
592 if ( i == 1 ) 592 if ( i == 1 )
593 Global::execute("textedit",appLnk->file()); 593 Global::execute("textedit",appLnk->file());
594 594
595 return; 595 return;
596 } 596 }
597 tabs->setBusy(TRUE); 597 tabs->setBusy(TRUE);
598 emit executing( appLnk ); 598 emit executing( appLnk );
599 appLnk->execute(); 599 appLnk->execute();
600 } 600 }
@@ -605,8 +605,8 @@ void Launcher::properties( AppLnk *appLnk )
605 if ( appLnk->type() == "Folder" ) { // No tr 605 if ( appLnk->type() == "Folder" ) { // No tr
606 // Not supported: flat is simpler for the user 606 // Not supported: flat is simpler for the user
607 } else { 607 } else {
608/* ### libqtopia FIXME also moving docLnks... */ 608/* ### libqtopia FIXME also moving docLnks... */
609 LnkProperties prop(appLnk,0 ); 609 LnkProperties prop(appLnk,0 );
610 610
611 QPEApplication::execDialog( &prop ); 611 QPEApplication::execDialog( &prop );
612 } 612 }
@@ -623,10 +623,10 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
623 if ( msg == "busy()" ) { 623 if ( msg == "busy()" ) {
624 tb->startWait(); 624 tb->startWait();
625 } else if ( msg == "notBusy(QString)" ) { 625 } else if ( msg == "notBusy(QString)" ) {
626 QString app; 626 QString app;
627 stream >> app; 627 stream >> app;
628 tabs->setBusy(FALSE); 628 tabs->setBusy(FALSE);
629 tb->stopWait(app); 629 tb->stopWait(app);
630 } else if (msg == "applyStyle()") { 630 } else if (msg == "applyStyle()") {
631 tabs->currentView()->relayout(); 631 tabs->currentView()->relayout();
632 } 632 }
@@ -636,3 +636,3 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
636void Launcher::typeAdded( const QString& type, const QString& name, 636void Launcher::typeAdded( const QString& type, const QString& name,
637 const QPixmap& pixmap, const QPixmap& ) 637 const QPixmap& pixmap, const QPixmap& )
638{ 638{
@@ -645,3 +645,3 @@ void Launcher::typeAdded( const QString& type, const QString& name,
645 if ( first ) { 645 if ( first ) {
646 first = FALSE; 646 first = FALSE;
647 tabs->categoryBar->showTab(type); 647 tabs->categoryBar->showTab(type);
@@ -665,3 +665,3 @@ void Launcher::applicationAdded( const QString& type, const AppLnk& app )
665 if ( app.type() == "Separator" ) // No tr 665 if ( app.type() == "Separator" ) // No tr
666 return; 666 return;
667 667
@@ -669,6 +669,6 @@ void Launcher::applicationAdded( const QString& type, const AppLnk& app )
669 if ( view ) 669 if ( view )
670 view->addItem( new AppLnk( app ), FALSE ); 670 view->addItem( new AppLnk( app ), FALSE );
671 else 671 else
672 qWarning("addAppLnk: No view for type %s. Can't add app %s!", 672 owarn << "addAppLnk: No view for type " << type.latin1() << ". Can't add app "
673 type.latin1(),app.name().latin1() ); 673 << app.name().latin1() << "!",
674 674
@@ -681,3 +681,3 @@ void Launcher::applicationRemoved( const QString& type, const AppLnk& app )
681 if ( view ) 681 if ( view )
682 view->removeLink( app.linkFile() ); 682 view->removeLink( app.linkFile() );
683 else 683 else
@@ -690,3 +690,3 @@ void Launcher::allApplicationsRemoved()
690 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) 690 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it)
691 tabs->view( (*it) )->removeAllItems(); 691 tabs->view( (*it) )->removeAllItems();
692} 692}
@@ -716,3 +716,3 @@ void Launcher::showDocTab()
716 if ( tabs->categoryBar->currentView() == tabs->docView() ) 716 if ( tabs->categoryBar->currentView() == tabs->docView() )
717 tabs->docView()->show(); 717 tabs->docView()->show();
718} 718}
@@ -744,15 +744,15 @@ void Launcher::applicationScanningProgress( int percent )
744 case 0: { 744 case 0: {
745 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { 745 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
746 tabs->view( (*it) )->setUpdatesEnabled( FALSE ); 746 tabs->view( (*it) )->setUpdatesEnabled( FALSE );
747 tabs->view( (*it) )->setSortEnabled( FALSE ); 747 tabs->view( (*it) )->setSortEnabled( FALSE );
748 } 748 }
749 break; 749 break;
750 } 750 }
751 case 100: { 751 case 100: {
752 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { 752 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
753 tabs->view( (*it) )->setUpdatesEnabled( TRUE ); 753 tabs->view( (*it) )->setUpdatesEnabled( TRUE );
754 tabs->view( (*it) )->setSortEnabled( TRUE ); 754 tabs->view( (*it) )->setSortEnabled( TRUE );
755 } 755 }
756 tb->refreshStartMenu(); 756 tb->refreshStartMenu();
757 break; 757 break;
758 } 758 }
@@ -767,17 +767,17 @@ void Launcher::documentScanningProgress( int percent )
767 case 0: { 767 case 0: {
768 tabs->setLoadingProgress( 0 ); 768 tabs->setLoadingProgress( 0 );
769 tabs->setLoadingWidgetEnabled( TRUE ); 769 tabs->setLoadingWidgetEnabled( TRUE );
770 tabs->docView()->setUpdatesEnabled( FALSE ); 770 tabs->docView()->setUpdatesEnabled( FALSE );
771 tabs->docView()->setSortEnabled( FALSE ); 771 tabs->docView()->setSortEnabled( FALSE );
772 break; 772 break;
773 } 773 }
774 case 100: { 774 case 100: {
775 tabs->docView()->updateTools(); 775 tabs->docView()->updateTools();
776 tabs->docView()->setSortEnabled( TRUE ); 776 tabs->docView()->setSortEnabled( TRUE );
777 tabs->docView()->setUpdatesEnabled( TRUE ); 777 tabs->docView()->setUpdatesEnabled( TRUE );
778 tabs->setLoadingWidgetEnabled( FALSE ); 778 tabs->setLoadingWidgetEnabled( FALSE );
779 break; 779 break;
780 } 780 }
781 default: 781 default:
782 tabs->setLoadingProgress( percent ); 782 tabs->setLoadingProgress( percent );
783 break; 783 break;
diff --git a/core/launcher/packageslave.cpp b/core/launcher/packageslave.cpp
index a11ac86..0461432 100644
--- a/core/launcher/packageslave.cpp
+++ b/core/launcher/packageslave.cpp
@@ -55,3 +55,3 @@ PackageHandler::PackageHandler( QObject *parent, char* name )
55 connect( packageChannel, SIGNAL( received(const QCString&,const QByteArray&) ), 55 connect( packageChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
56 this, SLOT( qcopMessage(const QCString&,const QByteArray&) ) ); 56 this, SLOT( qcopMessage(const QCString&,const QByteArray&) ) );
57#endif 57#endif
@@ -68,3 +68,3 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data )
68 } else if ( msg == "removePackage(QString)" ) { 68 } else if ( msg == "removePackage(QString)" ) {
69 QString file; 69 QString file;
70 stream >> file; 70 stream >> file;
@@ -72,3 +72,3 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data )
72 } else if ( msg == "addPackageFiles(QString,QString)" ) { 72 } else if ( msg == "addPackageFiles(QString,QString)" ) {
73 QString location, listfile; 73 QString location, listfile;
74 stream >> location >> listfile; 74 stream >> location >> listfile;
@@ -76,3 +76,3 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data )
76 } else if ( msg == "addPackages(QString)" ) { 76 } else if ( msg == "addPackages(QString)" ) {
77 QString location; 77 QString location;
78 stream >> location; 78 stream >> location;
@@ -80,7 +80,7 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data )
80 } else if ( msg == "cleanupPackageFiles(QString)" ) { 80 } else if ( msg == "cleanupPackageFiles(QString)" ) {
81 QString listfile; 81 QString listfile;
82 stream >> listfile; 82 stream >> listfile;
83 cleanupPackageFiles( listfile ); 83 cleanupPackageFiles( listfile );
84 } else if ( msg == "cleanupPackages(QString)" ) { 84 } else if ( msg == "cleanupPackages(QString)" ) {
85 QString location; 85 QString location;
86 stream >> location; 86 stream >> location;
@@ -88,6 +88,6 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data )
88 } else if ( msg == "prepareInstall(QString,QString)" ) { 88 } else if ( msg == "prepareInstall(QString,QString)" ) {
89 QString size, path; 89 QString size, path;
90 stream >> size; 90 stream >> size;
91 stream >> path; 91 stream >> path;
92 prepareInstall( size, path ); 92 prepareInstall( size, path );
93 } 93 }
@@ -98,8 +98,8 @@ void PackageHandler::installPackage( const QString &package )
98 if ( mNoSpaceLeft ) { 98 if ( mNoSpaceLeft ) {
99 mNoSpaceLeft = FALSE; 99 mNoSpaceLeft = FALSE;
100 // Don't emit that for now, I still couldn't test it (Wener) 100 // Don't emit that for now, I still couldn't test it (Wener)
101 //sendReply( "installFailed(QString)", package ); 101 //sendReply( "installFailed(QString)", package );
102 //return; 102 //return;
103 } 103 }
104 104
105 currentProcess = new QProcess( QStringList() << "ipkg" << "install" << package ); // No tr 105 currentProcess = new QProcess( QStringList() << "ipkg" << "install" << package ); // No tr
@@ -136,4 +136,4 @@ void PackageHandler::sendReply( const QCString& msg, const QString& arg )
136 136
137void PackageHandler::addPackageFiles( const QString &location, 137void PackageHandler::addPackageFiles( const QString &location,
138 const QString &listfile ) 138 const QString &listfile )
139{ 139{
@@ -146,5 +146,5 @@ void PackageHandler::addPackageFiles( const QString &location,
146 QDir d; 146 QDir d;
147 //#### revise 147 //#### revise
148 odebug << "Copy file at " << __FILE__ << ": " << __LINE__ << "" << oendl; 148 odebug << "Copy file at " << __FILE__ << ": " << __LINE__ << "" << oendl;
149 d.mkdir(("/usr/lib/ipkg/info/" + location).ascii()); 149 d.mkdir(("/usr/lib/ipkg/info/" + location).ascii());
150 system(("copy " + f.name() + " /usr/lib/ipkg/info/"+location).ascii()); 150 system(("copy " + f.name() + " /usr/lib/ipkg/info/"+location).ascii());
@@ -152,34 +152,33 @@ void PackageHandler::addPackageFiles( const QString &location,
152 152
153
154 if ( f.open(IO_ReadOnly) ) {
155 QTextStream ts(&f);
156 153
157 QString s; 154 if ( f.open(IO_ReadOnly) ) {
158 while ( !ts.eof() ) { // until end of file... 155 QTextStream ts(&f);
159 s = ts.readLine(); // line of text excluding '\n' 156
160 // for s, do link/mkdir. 157 QString s;
161 if ( s.right(1) == "/" ) { 158 while ( !ts.eof() ) { // until end of file...
159 s = ts.readLine(); // line of text excluding '\n'
160 // for s, do link/mkdir.
161 if ( s.right(1) == "/" ) {
162 odebug << "do mkdir for " << s.ascii() << "" << oendl; 162 odebug << "do mkdir for " << s.ascii() << "" << oendl;
163#ifndef Q_OS_WIN32 163#ifndef Q_OS_WIN32
164 mkdir( s.ascii(), 0777 ); 164 mkdir( s.ascii(), 0777 );
165 //possible optimization: symlink directories 165 //possible optimization: symlink directories
166 //that don't exist already. -- Risky. 166 //that don't exist already. -- Risky.
167#else 167#else
168 d.mkdir( s.ascii()); 168 d.mkdir( s.ascii());
169#endif 169#endif
170 170
171 } else { 171 } else {
172#ifndef Q_OS_WIN32 172#ifndef Q_OS_WIN32
173 odebug << "do symlink for " << s.ascii() << "" << oendl; 173 odebug << "do symlink for " << s.ascii() << "" << oendl;
174 symlink( (location + s).ascii(), s.ascii() ); 174 symlink( (location + s).ascii(), s.ascii() );
175#else 175#else
176 odebug << "Copy file instead of a symlink for WIN32" << oendl; 176 odebug << "Copy file instead of a symlink for WIN32" << oendl;
177 if (!CopyFile((TCHAR*)qt_winTchar((location + s), TRUE), (TCHAR*)qt_winTchar(s, TRUE), FALSE)) 177 if (!CopyFile((TCHAR*)qt_winTchar((location + s), TRUE), (TCHAR*)qt_winTchar(s, TRUE), FALSE))
178 qWarning("Unable to create symlinkfor %s", 178 owarn << "Unable to create symlinkfor " << (location + s).ascii() << oendl;
179 (location + s).ascii());
180#endif 179#endif
181 } 180 }
182 } 181 }
183 f.close(); 182 f.close();
184 } 183 }
185} 184}
@@ -190,10 +189,10 @@ void PackageHandler::addPackages( const QString &location )
190 QDir dir(location + "/usr/lib/ipkg/info", "*.list", // No tr 189 QDir dir(location + "/usr/lib/ipkg/info", "*.list", // No tr
191 QDir::Name, QDir::Files); 190 QDir::Name, QDir::Files);
192 if ( !dir.exists() ) 191 if ( !dir.exists() )
193 return; 192 return;
194 193
195 QStringList packages = dir.entryList(); 194 QStringList packages = dir.entryList();
196 for ( QStringList::Iterator it = packages.begin(); 195 for ( QStringList::Iterator it = packages.begin();
197 it != packages.end(); ++it ) { 196 it != packages.end(); ++it ) {
198 addPackageFiles( location, *it ); 197 addPackageFiles( location, *it );
199 } 198 }
@@ -205,31 +204,31 @@ void PackageHandler::cleanupPackageFiles( const QString &listfile )
205 QFile f(listfile); 204 QFile f(listfile);
206 205
207 if ( f.open(IO_ReadOnly) ) { 206 if ( f.open(IO_ReadOnly) ) {
208 QTextStream ts(&f); 207 QTextStream ts(&f);
209 208
210 QString s; 209 QString s;
211 while ( !ts.eof() ) { // until end of file... 210 while ( !ts.eof() ) { // until end of file...
212 s = ts.readLine(); // line of text excluding '\n' 211 s = ts.readLine(); // line of text excluding '\n'
213 // for s, do link/mkdir. 212 // for s, do link/mkdir.
214 if ( s.right(1) == "/" ) { 213 if ( s.right(1) == "/" ) {
215 //should rmdir if empty, after all files have been removed 214 //should rmdir if empty, after all files have been removed
216 } else { 215 } else {
217#ifndef Q_OS_WIN32 216#ifndef Q_OS_WIN32
218 odebug << "remove symlink for " << s.ascii() << "" << oendl; 217 odebug << "remove symlink for " << s.ascii() << "" << oendl;
219 //check if it is a symlink first (don't remove /etc/passwd...) 218 //check if it is a symlink first (don't remove /etc/passwd...)
220 char buf[10]; //we don't care about the contents 219 char buf[10]; //we don't care about the contents
221 if ( ::readlink( s.ascii(),buf, 10 >= 0 ) ) 220 if ( ::readlink( s.ascii(),buf, 10 >= 0 ) )
222 ::unlink( s.ascii() ); 221 ::unlink( s.ascii() );
223 #else 222#else
224 // ### revise 223 // ### revise
225 owarn << "Unable to remove symlink " << __FILE__ << ":" << __LINE__ << "" << oendl; 224 owarn << "Unable to remove symlink " << __FILE__ << ":" << __LINE__ << "" << oendl;
226#endif 225#endif
227 } 226 }
228 } 227 }
229 f.close(); 228 f.close();
230 229
231 //remove the list file 230 //remove the list file
232 ::unlink( listfile.ascii() ); 231 ::unlink( listfile.ascii() );
233 232
234 } 233 }
235} 234}
@@ -240,13 +239,13 @@ void PackageHandler::cleanupPackages( const QString &location )
240 QDir dir( "/usr/lib/ipkg/info/"+location, "*.list", // No tr 239 QDir dir( "/usr/lib/ipkg/info/"+location, "*.list", // No tr
241 QDir::Name, QDir::Files); 240 QDir::Name, QDir::Files);
242 if ( !dir.exists() ) 241 if ( !dir.exists() )
243 return; 242 return;
244 243
245 QStringList packages = dir.entryList(); 244 QStringList packages = dir.entryList();
246 for ( QStringList::Iterator it = packages.begin(); 245 for ( QStringList::Iterator it = packages.begin();
247 it != packages.end(); ++it ) { 246 it != packages.end(); ++it ) {
248 cleanupPackageFiles( *it ); 247 cleanupPackageFiles( *it );
249 } 248 }
250 249
251 //remove the backup directory 250 //remove the backup directory
252 //### 251 //###
@@ -259,5 +258,5 @@ void PackageHandler::prepareInstall( const QString& size, const QString& path )
259 unsigned int s = size.toUInt( &ok ); 258 unsigned int s = size.toUInt( &ok );
260 259
261 if ( !ok ) 260 if ( !ok )
262 return; 261 return;
263 262
@@ -267,6 +266,6 @@ void PackageHandler::prepareInstall( const QString& size, const QString& path )
267 if ( statfs( path.latin1(), &fs ) == 0 ) 266 if ( statfs( path.latin1(), &fs ) == 0 )
268 if ( s > fs.f_bsize * fs.f_bavail ) { 267 if ( s > fs.f_bsize * fs.f_bavail ) {
269 //odebug << "############### Not enough space left ###############" << oendl; 268 //odebug << "############### Not enough space left ###############" << oendl;
270 mNoSpaceLeft = TRUE; 269 mNoSpaceLeft = TRUE;
271 } 270 }
272#endif 271#endif
@@ -277,11 +276,11 @@ void PackageHandler::iProcessExited()
277 if ( currentProcess->normalExit() && currentProcess->exitStatus() == 0 ) 276 if ( currentProcess->normalExit() && currentProcess->exitStatus() == 0 )
278 sendReply( "installDone(QString)", currentPackage ); 277 sendReply( "installDone(QString)", currentPackage );
279 else { 278 else {
280#ifndef QT_NO_COP 279#ifndef QT_NO_COP
281 QCopEnvelope e( "QPE/Desktop", "installFailed(QString,int,QString)" ); 280 QCopEnvelope e( "QPE/Desktop", "installFailed(QString,int,QString)" );
282 e << currentPackage << currentProcess->exitStatus() 281 e << currentPackage << currentProcess->exitStatus()
283 << currentProcessError; 282 << currentProcessError;
284#endif 283#endif
285 } 284 }
286 285
287 delete currentProcess; 286 delete currentProcess;
@@ -300,5 +299,5 @@ void PackageHandler::rmProcessExited()
300 if ( currentProcess->normalExit() && currentProcess->exitStatus() == 0 ) 299 if ( currentProcess->normalExit() && currentProcess->exitStatus() == 0 )
301 sendReply( "removeDone(QString)", currentPackage ); 300 sendReply( "removeDone(QString)", currentPackage );
302 else 301 else
303 sendReply( "removeFailed(QString)", currentPackage ); 302 sendReply( "removeFailed(QString)", currentPackage );
304 303
@@ -314,8 +313,8 @@ void PackageHandler::readyReadStdout()
314 while ( currentProcess->canReadLineStdout() ) { 313 while ( currentProcess->canReadLineStdout() ) {
315 QString line = currentProcess->readLineStdout(); 314 QString line = currentProcess->readLineStdout();
316 currentProcessError.append("OUT:"+line); 315 currentProcessError.append("OUT:"+line);
317 if ( line.contains( "Unpacking" ) ) // No tr 316 if ( line.contains( "Unpacking" ) ) // No tr
318 sendReply( "installStep(QString)", "one" ); // No tr 317 sendReply( "installStep(QString)", "one" ); // No tr
319 else if ( line.contains( "Configuring" ) ) // No tr 318 else if ( line.contains( "Configuring" ) ) // No tr
320 sendReply( "installStep(QString)", "two" ); // No tr 319 sendReply( "installStep(QString)", "two" ); // No tr
321 } 320 }
@@ -326,4 +325,4 @@ void PackageHandler::readyReadStderr()
326 while ( currentProcess->canReadLineStderr() ) { 325 while ( currentProcess->canReadLineStderr() ) {
327 QString line = currentProcess->readLineStderr(); 326 QString line = currentProcess->readLineStderr();
328 currentProcessError.append("ERR:"+line); 327 currentProcessError.append("ERR:"+line);
329 } 328 }
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index c3f936e..1d4ca40 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -1158,4 +1158,3 @@ void ServerDTP::connected()
1158 if ( !createTargzProc->start() ) 1158 if ( !createTargzProc->start() )
1159 qWarning("Error starting %s", 1159 owarn << "Error starting " << createTargzProc->arguments().join(" ").latin1() << oendl;
1160 createTargzProc->arguments().join(" ").latin1());
1161 break; 1160 break;