summaryrefslogtreecommitdiff
path: root/core/launcher
authorar <ar>2004-05-02 21:32:48 (UTC)
committer ar <ar>2004-05-02 21:32:48 (UTC)
commit0a4cac124105a5732e55cb34c6b37be75083a395 (patch) (side-by-side diff)
tree33b4d2cab08c9b58893540b4ddee089b69fc9c61 /core/launcher
parent109ed5f2a1cdfeb3680c9ec057a1083fcf8fab95 (diff)
downloadopie-0a4cac124105a5732e55cb34c6b37be75083a395.zip
opie-0a4cac124105a5732e55cb34c6b37be75083a395.tar.gz
opie-0a4cac124105a5732e55cb34c6b37be75083a395.tar.bz2
- convert qWarning to owarn
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
@@ -99,5 +99,5 @@ LauncherTabWidget::LauncherTabWidget( Launcher* parent ) :
this, SLOT(launcherMessage(const QCString&,const QByteArray&)) );
connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)),
- this, SLOT(appMessage(const QCString&,const QByteArray&)));
+ this, SLOT(appMessage(const QCString&,const QByteArray&)));
#endif
@@ -170,5 +170,5 @@ void LauncherTabWidget::appMessage(const QCString& message, const QByteArray&)
{
if ( message == "nextView()" )
- categoryBar->nextTab();
+ categoryBar->nextTab();
}
@@ -176,9 +176,9 @@ void LauncherTabWidget::raiseTabWidget()
{
if ( categoryBar->currentView() == docView()
- && docLoadingWidgetEnabled ) {
- stack->raiseWidget( docLoadingWidget );
- docLoadingWidget->updateGeometry();
+ && docLoadingWidgetEnabled ) {
+ stack->raiseWidget( docLoadingWidget );
+ docLoadingWidget->updateGeometry();
} else {
- stack->raiseWidget( categoryBar->currentView() );
+ stack->raiseWidget( categoryBar->currentView() );
}
}
@@ -193,5 +193,5 @@ void LauncherTabWidget::tabProperties()
int rv = m->exec( QCursor::pos() );
if ( rv >= 0 && rv != view->viewMode() ) {
- view->setViewMode( (LauncherView::ViewMode)rv );
+ view->setViewMode( (LauncherView::ViewMode)rv );
}
@@ -203,7 +203,7 @@ void LauncherTabWidget::deleteView( const QString& id )
LauncherTab *t = categoryBar->launcherTab(id);
if ( t ) {
- stack->removeWidget( t->view );
- delete t->view;
- categoryBar->removeTab( t );
+ stack->removeWidget( t->view );
+ delete t->view;
+ categoryBar->removeTab( t );
}
}
@@ -213,7 +213,7 @@ LauncherView* LauncherTabWidget::newView( const QString& id, const QPixmap& pm,
LauncherView* view = new LauncherView( stack );
connect( view, SIGNAL(clicked(const AppLnk*)),
- this, SIGNAL(clicked(const AppLnk*)));
+ this, SIGNAL(clicked(const AppLnk*)));
connect( view, SIGNAL(rightPressed(AppLnk*)),
- this, SIGNAL(rightPressed(AppLnk*)));
+ this, SIGNAL(rightPressed(AppLnk*)));
int n = categoryBar->count();
@@ -224,5 +224,5 @@ LauncherView* LauncherTabWidget::newView( const QString& id, const QPixmap& pm,
if ( id == "Documents" )
- docview = view;
+ docview = view;
odebug << "inserting " << id << " at " << n-1 << "" << oendl;
@@ -241,5 +241,5 @@ LauncherView *LauncherTabWidget::view( const QString &id )
LauncherTab *t = categoryBar->launcherTab(id);
if ( !t )
- return 0;
+ return 0;
return t->view;
}
@@ -253,6 +253,6 @@ void LauncherTabWidget::setLoadingWidgetEnabled( bool v )
{
if ( v != docLoadingWidgetEnabled && docLoadingWidget ) {
- docLoadingWidgetEnabled = v;
- raiseTabWidget();
+ docLoadingWidgetEnabled = v;
+ raiseTabWidget();
}
}
@@ -269,20 +269,20 @@ void LauncherTabWidget::setTabViewAppearance( LauncherView *v, Config &cfg )
QString view = cfg.readEntry( "View", "Icon" );
if ( view == "List" ) // No tr
- v->setViewMode( LauncherView::List );
+ v->setViewMode( LauncherView::List );
QString bgType = cfg.readEntry( "BackgroundType", "Image" );
if ( bgType == "Image" ) { // No tr
- QString pm = cfg.readEntry( "BackgroundImage", "launcher/opie-background" );
- v->setBackgroundType( LauncherView::Image, pm );
+ QString pm = cfg.readEntry( "BackgroundImage", "launcher/opie-background" );
+ v->setBackgroundType( LauncherView::Image, pm );
} else if ( bgType == "SolidColor" ) {
- QString c = cfg.readEntry( "BackgroundColor" );
- v->setBackgroundType( LauncherView::SolidColor, c );
+ QString c = cfg.readEntry( "BackgroundColor" );
+ v->setBackgroundType( LauncherView::SolidColor, c );
} else {
- v->setBackgroundType( LauncherView::Ruled, QString::null );
+ v->setBackgroundType( LauncherView::Ruled, QString::null );
}
QString textCol = cfg.readEntry( "TextColor" );
if ( textCol.isEmpty() )
- v->setTextColor( QColor() );
+ v->setTextColor( QColor() );
else
- v->setTextColor( QColor(textCol) );
+ v->setTextColor( QColor(textCol) );
// bool customFont = cfg.readBoolEntry( "CustomFont", FALSE );
@@ -306,12 +306,12 @@ void LauncherTabWidget::setTabAppearance( LauncherTab *tab, Config &cfg )
QString tabCol = cfg.readEntry( "TabColor" );
if ( tabCol.isEmpty() )
- tab->bgColor = QColor();
+ tab->bgColor = QColor();
else
- tab->bgColor = QColor(tabCol);
+ tab->bgColor = QColor(tabCol);
QString tabTextCol = cfg.readEntry( "TabTextColor" );
if ( tabTextCol.isEmpty() )
- tab->fgColor = QColor();
+ tab->fgColor = QColor();
else
- tab->fgColor = QColor(tabTextCol);
+ tab->fgColor = QColor(tabTextCol);
}
@@ -334,8 +334,8 @@ void LauncherTabWidget::setProgressStyle()
{
if (docLoadingWidgetProgress) {
- docLoadingWidgetProgress->setFrameShape( QProgressBar::Box );
- docLoadingWidgetProgress->setFrameShadow( QProgressBar::Plain );
- docLoadingWidgetProgress->setMargin( 1 );
- docLoadingWidgetProgress->setLineWidth( 1 );
+ docLoadingWidgetProgress->setFrameShape( QProgressBar::Box );
+ docLoadingWidgetProgress->setFrameShadow( QProgressBar::Plain );
+ docLoadingWidgetProgress->setMargin( 1 );
+ docLoadingWidgetProgress->setLineWidth( 1 );
}
}
@@ -344,10 +344,10 @@ void LauncherTabWidget::setBusy(bool on)
{
if ( on )
- currentView()->setBusy(TRUE);
+ currentView()->setBusy(TRUE);
else {
- for ( int i = 0; i < categoryBar->count(); i++ ) {
- LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view;
- view->setBusy( FALSE );
- }
+ for ( int i = 0; i < categoryBar->count(); i++ ) {
+ LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view;
+ view->setBusy( FALSE );
+ }
}
}
@@ -371,49 +371,49 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
QDataStream stream( data, IO_ReadOnly );
if ( msg == "setTabView(QString,int)" ) {
- QString id;
- stream >> id;
- int mode;
- stream >> mode;
- if ( view(id) )
- view(id)->setViewMode( (LauncherView::ViewMode)mode );
+ QString id;
+ stream >> id;
+ int mode;
+ stream >> mode;
+ if ( view(id) )
+ view(id)->setViewMode( (LauncherView::ViewMode)mode );
} else if ( msg == "setTabBackground(QString,int,QString)" ) {
- QString id;
- stream >> id;
- int mode;
- stream >> mode;
- QString pixmapOrColor;
- stream >> pixmapOrColor;
- if ( view(id) )
- view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor );
- if ( id == "Documents" )
- docLoadingWidget->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor );
+ QString id;
+ stream >> id;
+ int mode;
+ stream >> mode;
+ QString pixmapOrColor;
+ stream >> pixmapOrColor;
+ if ( view(id) )
+ view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor );
+ if ( id == "Documents" )
+ docLoadingWidget->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor );
} else if ( msg == "setTextColor(QString,QString)" ) {
- QString id;
- stream >> id;
- QString color;
- stream >> color;
- if ( view(id) )
- view(id)->setTextColor( QColor(color) );
- if ( id == "Documents" )
- docLoadingWidget->setTextColor( QColor(color) );
+ QString id;
+ stream >> id;
+ QString color;
+ stream >> color;
+ if ( view(id) )
+ view(id)->setTextColor( QColor(color) );
+ if ( id == "Documents" )
+ docLoadingWidget->setTextColor( QColor(color) );
} else if ( msg == "setFont(QString,QString,int,int,int)" ) {
- QString id;
- stream >> id;
- QString fam;
- stream >> fam;
- int size;
- stream >> size;
- int weight;
- stream >> weight;
- int italic;
- stream >> italic;
- if ( view(id) ) {
- if ( !fam.isEmpty() ) {
- view(id)->setViewFont( QFont(fam, size, weight, italic!=0) );
+ QString id;
+ stream >> id;
+ QString fam;
+ stream >> fam;
+ int size;
+ stream >> size;
+ int weight;
+ stream >> weight;
+ int italic;
+ stream >> italic;
+ if ( view(id) ) {
+ if ( !fam.isEmpty() ) {
+ view(id)->setViewFont( QFont(fam, size, weight, italic!=0) );
odebug << "setFont: " << fam << ", " << size << ", " << weight << ", " << italic << "" << oendl;
- } else {
- view(id)->clearViewFont();
- }
- }
+ } else {
+ view(id)->clearViewFont();
+ }
+ }
}else if ( msg == "setBusyIndicatorType(QString)" ) {
QString type;
@@ -465,11 +465,11 @@ void Launcher::createGUI()
connect( tb, SIGNAL(tabSelected(const QString&)),
- this, SLOT(showTab(const QString&)) );
+ this, SLOT(showTab(const QString&)) );
connect( tabs, SIGNAL(selected(const QString&)),
- this, SLOT(viewSelected(const QString&)) );
+ this, SLOT(viewSelected(const QString&)) );
connect( tabs, SIGNAL(clicked(const AppLnk*)),
- this, SLOT(select(const AppLnk*)));
+ this, SLOT(select(const AppLnk*)));
connect( tabs, SIGNAL(rightPressed(AppLnk*)),
- this, SLOT(properties(AppLnk*)));
+ this, SLOT(properties(AppLnk*)));
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
@@ -495,5 +495,5 @@ Launcher::~Launcher()
{
if ( tb )
- destroyGUI();
+ destroyGUI();
}
@@ -522,15 +522,15 @@ bool Launcher::eventFilter( QObject*, QEvent *ev )
#ifdef QT_QWS_CUSTOM
if ( ev->type() == QEvent::KeyPress ) {
- QKeyEvent *ke = (QKeyEvent *)ev;
- if ( ke->key() == Qt::Key_F11 ) { // menu key
- QWidget *active = qApp->activeWindow();
- if ( active && active->isPopup() )
- active->close();
- else {
- Global::terminateBuiltin("calibrate"); // No tr
- tb->launchStartMenu();
- }
- return TRUE;
- }
+ QKeyEvent *ke = (QKeyEvent *)ev;
+ if ( ke->key() == Qt::Key_F11 ) { // menu key
+ QWidget *active = qApp->activeWindow();
+ if ( active && active->isPopup() )
+ active->close();
+ else {
+ Global::terminateBuiltin("calibrate"); // No tr
+ tb->launchStartMenu();
+ }
+ return TRUE;
+ }
}
#else
@@ -561,6 +561,6 @@ static bool isVisibleWindow(int wid)
QWSWindow* w;
for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) {
- if ( w->winId() == wid )
- return !w->isFullyObscured();
+ if ( w->winId() == wid )
+ return !w->isFullyObscured();
}
#endif
@@ -582,20 +582,20 @@ void Launcher::select( const AppLnk *appLnk )
{
if ( appLnk->type() == "Folder" ) { // No tr
- // Not supported: flat is simpler for the user
+ // Not supported: flat is simpler for the user
} else {
- if ( appLnk->exec().isNull() ) {
- int i = QMessageBox::information(this,tr("No application"),
- tr("<p>No application is defined for this document."
- "<p>Type is %1.").arg(appLnk->type()), tr("OK"), tr("View as text"), 0, 0, 1);
+ if ( appLnk->exec().isNull() ) {
+ int i = QMessageBox::information(this,tr("No application"),
+ tr("<p>No application is defined for this document."
+ "<p>Type is %1.").arg(appLnk->type()), tr("OK"), tr("View as text"), 0, 0, 1);
/* ### Fixme */
- if ( i == 1 )
- Global::execute("textedit",appLnk->file());
-
- return;
- }
- tabs->setBusy(TRUE);
- emit executing( appLnk );
- appLnk->execute();
+ if ( i == 1 )
+ Global::execute("textedit",appLnk->file());
+
+ return;
+ }
+ tabs->setBusy(TRUE);
+ emit executing( appLnk );
+ appLnk->execute();
}
}
@@ -604,10 +604,10 @@ void Launcher::properties( AppLnk *appLnk )
{
if ( appLnk->type() == "Folder" ) { // No tr
- // Not supported: flat is simpler for the user
+ // Not supported: flat is simpler for the user
} else {
/* ### libqtopia FIXME also moving docLnks... */
- LnkProperties prop(appLnk,0 );
+ LnkProperties prop(appLnk,0 );
- QPEApplication::execDialog( &prop );
+ QPEApplication::execDialog( &prop );
}
}
@@ -622,12 +622,12 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
QDataStream stream( data, IO_ReadOnly );
if ( msg == "busy()" ) {
- tb->startWait();
+ tb->startWait();
} else if ( msg == "notBusy(QString)" ) {
- QString app;
- stream >> app;
- tabs->setBusy(FALSE);
- tb->stopWait(app);
+ QString app;
+ stream >> app;
+ tabs->setBusy(FALSE);
+ tb->stopWait(app);
} else if (msg == "applyStyle()") {
- tabs->currentView()->relayout();
+ tabs->currentView()->relayout();
}
}
@@ -635,5 +635,5 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
// These are the update functions from the server
void Launcher::typeAdded( const QString& type, const QString& name,
- const QPixmap& pixmap, const QPixmap& )
+ const QPixmap& pixmap, const QPixmap& )
{
tabs->newView( type, pixmap, name );
@@ -644,5 +644,5 @@ void Launcher::typeAdded( const QString& type, const QString& name,
static bool first = TRUE;
if ( first ) {
- first = FALSE;
+ first = FALSE;
tabs->categoryBar->showTab(type);
}
@@ -664,12 +664,12 @@ void Launcher::applicationAdded( const QString& type, const AppLnk& app )
{
if ( app.type() == "Separator" ) // No tr
- return;
+ return;
LauncherView *view = tabs->view( type );
if ( view )
- view->addItem( new AppLnk( app ), FALSE );
+ view->addItem( new AppLnk( app ), FALSE );
else
- qWarning("addAppLnk: No view for type %s. Can't add app %s!",
- type.latin1(),app.name().latin1() );
+ owarn << "addAppLnk: No view for type " << type.latin1() << ". Can't add app "
+ << app.name().latin1() << "!",
MimeType::registerApp( app );
@@ -680,5 +680,5 @@ void Launcher::applicationRemoved( const QString& type, const AppLnk& app )
LauncherView *view = tabs->view( type );
if ( view )
- view->removeLink( app.linkFile() );
+ view->removeLink( app.linkFile() );
else
owarn << "removeAppLnk: No view for " << type << "!" << oendl;
@@ -689,5 +689,5 @@ void Launcher::allApplicationsRemoved()
MimeType::clear();
for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it)
- tabs->view( (*it) )->removeAllItems();
+ tabs->view( (*it) )->removeAllItems();
}
@@ -715,5 +715,5 @@ void Launcher::showDocTab()
{
if ( tabs->categoryBar->currentView() == tabs->docView() )
- tabs->docView()->show();
+ tabs->docView()->show();
}
@@ -743,17 +743,17 @@ void Launcher::applicationScanningProgress( int percent )
switch ( percent ) {
case 0: {
- for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
- tabs->view( (*it) )->setUpdatesEnabled( FALSE );
- tabs->view( (*it) )->setSortEnabled( FALSE );
- }
- break;
+ for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
+ tabs->view( (*it) )->setUpdatesEnabled( FALSE );
+ tabs->view( (*it) )->setSortEnabled( FALSE );
+ }
+ break;
}
case 100: {
- for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
- tabs->view( (*it) )->setUpdatesEnabled( TRUE );
- tabs->view( (*it) )->setSortEnabled( TRUE );
- }
+ for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
+ tabs->view( (*it) )->setUpdatesEnabled( TRUE );
+ tabs->view( (*it) )->setSortEnabled( TRUE );
+ }
tb->refreshStartMenu();
- break;
+ break;
}
default:
@@ -766,19 +766,19 @@ void Launcher::documentScanningProgress( int percent )
switch ( percent ) {
case 0: {
- tabs->setLoadingProgress( 0 );
- tabs->setLoadingWidgetEnabled( TRUE );
- tabs->docView()->setUpdatesEnabled( FALSE );
- tabs->docView()->setSortEnabled( FALSE );
- break;
+ tabs->setLoadingProgress( 0 );
+ tabs->setLoadingWidgetEnabled( TRUE );
+ tabs->docView()->setUpdatesEnabled( FALSE );
+ tabs->docView()->setSortEnabled( FALSE );
+ break;
}
case 100: {
- tabs->docView()->updateTools();
- tabs->docView()->setSortEnabled( TRUE );
- tabs->docView()->setUpdatesEnabled( TRUE );
- tabs->setLoadingWidgetEnabled( FALSE );
- break;
+ tabs->docView()->updateTools();
+ tabs->docView()->setSortEnabled( TRUE );
+ tabs->docView()->setUpdatesEnabled( TRUE );
+ tabs->setLoadingWidgetEnabled( FALSE );
+ break;
}
default:
- tabs->setLoadingProgress( percent );
+ tabs->setLoadingProgress( percent );
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
@@ -54,5 +54,5 @@ PackageHandler::PackageHandler( QObject *parent, char* name )
packageChannel = new QCopChannel( "QPE/Package", this );
connect( packageChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
- this, SLOT( qcopMessage(const QCString&,const QByteArray&) ) );
+ this, SLOT( qcopMessage(const QCString&,const QByteArray&) ) );
#endif
}
@@ -67,28 +67,28 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data )
installPackage( file );
} else if ( msg == "removePackage(QString)" ) {
- QString file;
+ QString file;
stream >> file;
removePackage( file );
} else if ( msg == "addPackageFiles(QString,QString)" ) {
- QString location, listfile;
+ QString location, listfile;
stream >> location >> listfile;
addPackageFiles( location, listfile);
} else if ( msg == "addPackages(QString)" ) {
- QString location;
+ QString location;
stream >> location;
addPackages( location );
} else if ( msg == "cleanupPackageFiles(QString)" ) {
- QString listfile;
+ QString listfile;
stream >> listfile;
- cleanupPackageFiles( listfile );
+ cleanupPackageFiles( listfile );
} else if ( msg == "cleanupPackages(QString)" ) {
- QString location;
+ QString location;
stream >> location;
cleanupPackages( location );
} else if ( msg == "prepareInstall(QString,QString)" ) {
- QString size, path;
- stream >> size;
- stream >> path;
- prepareInstall( size, path );
+ QString size, path;
+ stream >> size;
+ stream >> path;
+ prepareInstall( size, path );
}
}
@@ -97,10 +97,10 @@ void PackageHandler::installPackage( const QString &package )
{
if ( mNoSpaceLeft ) {
- mNoSpaceLeft = FALSE;
- // Don't emit that for now, I still couldn't test it (Wener)
- //sendReply( "installFailed(QString)", package );
- //return;
+ mNoSpaceLeft = FALSE;
+ // Don't emit that for now, I still couldn't test it (Wener)
+ //sendReply( "installFailed(QString)", package );
+ //return;
}
-
+
currentProcess = new QProcess( QStringList() << "ipkg" << "install" << package ); // No tr
connect( currentProcess, SIGNAL( processExited() ), SLOT( iProcessExited() ) );
@@ -135,6 +135,6 @@ void PackageHandler::sendReply( const QCString& msg, const QString& arg )
}
-void PackageHandler::addPackageFiles( const QString &location,
- const QString &listfile )
+void PackageHandler::addPackageFiles( const QString &location,
+ const QString &listfile )
{
QFile f(listfile);
@@ -145,42 +145,41 @@ void PackageHandler::addPackageFiles( const QString &location,
#else
QDir d;
- //#### revise
+ //#### revise
odebug << "Copy file at " << __FILE__ << ": " << __LINE__ << "" << oendl;
- d.mkdir(("/usr/lib/ipkg/info/" + location).ascii());
+ d.mkdir(("/usr/lib/ipkg/info/" + location).ascii());
system(("copy " + f.name() + " /usr/lib/ipkg/info/"+location).ascii());
#endif
-
- if ( f.open(IO_ReadOnly) ) {
- QTextStream ts(&f);
- QString s;
- while ( !ts.eof() ) { // until end of file...
- s = ts.readLine(); // line of text excluding '\n'
- // for s, do link/mkdir.
- if ( s.right(1) == "/" ) {
+ if ( f.open(IO_ReadOnly) ) {
+ QTextStream ts(&f);
+
+ QString s;
+ while ( !ts.eof() ) { // until end of file...
+ s = ts.readLine(); // line of text excluding '\n'
+ // for s, do link/mkdir.
+ if ( s.right(1) == "/" ) {
odebug << "do mkdir for " << s.ascii() << "" << oendl;
#ifndef Q_OS_WIN32
- mkdir( s.ascii(), 0777 );
- //possible optimization: symlink directories
- //that don't exist already. -- Risky.
+ mkdir( s.ascii(), 0777 );
+ //possible optimization: symlink directories
+ //that don't exist already. -- Risky.
#else
- d.mkdir( s.ascii());
+ d.mkdir( s.ascii());
#endif
- } else {
+ } else {
#ifndef Q_OS_WIN32
odebug << "do symlink for " << s.ascii() << "" << oendl;
- symlink( (location + s).ascii(), s.ascii() );
+ symlink( (location + s).ascii(), s.ascii() );
#else
odebug << "Copy file instead of a symlink for WIN32" << oendl;
- if (!CopyFile((TCHAR*)qt_winTchar((location + s), TRUE), (TCHAR*)qt_winTchar(s, TRUE), FALSE))
- qWarning("Unable to create symlinkfor %s",
- (location + s).ascii());
+ if (!CopyFile((TCHAR*)qt_winTchar((location + s), TRUE), (TCHAR*)qt_winTchar(s, TRUE), FALSE))
+ owarn << "Unable to create symlinkfor " << (location + s).ascii() << oendl;
#endif
- }
- }
- f.close();
- }
+ }
+ }
+ f.close();
+ }
}
@@ -189,12 +188,12 @@ void PackageHandler::addPackages( const QString &location )
// get list of *.list in location/usr/lib/ipkg/info/*.list
QDir dir(location + "/usr/lib/ipkg/info", "*.list", // No tr
- QDir::Name, QDir::Files);
+ QDir::Name, QDir::Files);
if ( !dir.exists() )
- return;
-
+ return;
+
QStringList packages = dir.entryList();
for ( QStringList::Iterator it = packages.begin();
- it != packages.end(); ++it ) {
- addPackageFiles( location, *it );
+ it != packages.end(); ++it ) {
+ addPackageFiles( location, *it );
}
}
@@ -204,33 +203,33 @@ void PackageHandler::cleanupPackageFiles( const QString &listfile )
{
QFile f(listfile);
-
- if ( f.open(IO_ReadOnly) ) {
- QTextStream ts(&f);
-
- QString s;
- while ( !ts.eof() ) { // until end of file...
- s = ts.readLine(); // line of text excluding '\n'
- // for s, do link/mkdir.
- if ( s.right(1) == "/" ) {
- //should rmdir if empty, after all files have been removed
- } else {
+
+ if ( f.open(IO_ReadOnly) ) {
+ QTextStream ts(&f);
+
+ QString s;
+ while ( !ts.eof() ) { // until end of file...
+ s = ts.readLine(); // line of text excluding '\n'
+ // for s, do link/mkdir.
+ if ( s.right(1) == "/" ) {
+ //should rmdir if empty, after all files have been removed
+ } else {
#ifndef Q_OS_WIN32
odebug << "remove symlink for " << s.ascii() << "" << oendl;
- //check if it is a symlink first (don't remove /etc/passwd...)
- char buf[10]; //we don't care about the contents
- if ( ::readlink( s.ascii(),buf, 10 >= 0 ) )
- ::unlink( s.ascii() );
-#else
- // ### revise
+ //check if it is a symlink first (don't remove /etc/passwd...)
+ char buf[10]; //we don't care about the contents
+ if ( ::readlink( s.ascii(),buf, 10 >= 0 ) )
+ ::unlink( s.ascii() );
+#else
+ // ### revise
owarn << "Unable to remove symlink " << __FILE__ << ":" << __LINE__ << "" << oendl;
#endif
- }
- }
- f.close();
+ }
+ }
+ f.close();
//remove the list file
- ::unlink( listfile.ascii() );
-
- }
+ ::unlink( listfile.ascii() );
+
+ }
}
@@ -239,15 +238,15 @@ void PackageHandler::cleanupPackages( const QString &location )
// get list of *.list in location/usr/lib/ipkg/info/*.list
QDir dir( "/usr/lib/ipkg/info/"+location, "*.list", // No tr
- QDir::Name, QDir::Files);
+ QDir::Name, QDir::Files);
if ( !dir.exists() )
- return;
-
+ return;
+
QStringList packages = dir.entryList();
for ( QStringList::Iterator it = packages.begin();
- it != packages.end(); ++it ) {
- cleanupPackageFiles( *it );
+ it != packages.end(); ++it ) {
+ cleanupPackageFiles( *it );
}
-
- //remove the backup directory
+
+ //remove the backup directory
//###
}
@@ -258,7 +257,7 @@ void PackageHandler::prepareInstall( const QString& size, const QString& path )
bool ok;
unsigned int s = size.toUInt( &ok );
-
+
if ( !ok )
- return;
+ return;
// Shamelessly stolen from the sysinfo application (Werner)
@@ -266,8 +265,8 @@ void PackageHandler::prepareInstall( const QString& size, const QString& path )
struct statfs fs;
if ( statfs( path.latin1(), &fs ) == 0 )
- if ( s > fs.f_bsize * fs.f_bavail ) {
+ if ( s > fs.f_bsize * fs.f_bavail ) {
//odebug << "############### Not enough space left ###############" << oendl;
- mNoSpaceLeft = TRUE;
- }
+ mNoSpaceLeft = TRUE;
+ }
#endif
}
@@ -276,13 +275,13 @@ void PackageHandler::iProcessExited()
{
if ( currentProcess->normalExit() && currentProcess->exitStatus() == 0 )
- sendReply( "installDone(QString)", currentPackage );
+ sendReply( "installDone(QString)", currentPackage );
else {
#ifndef QT_NO_COP
- QCopEnvelope e( "QPE/Desktop", "installFailed(QString,int,QString)" );
- e << currentPackage << currentProcess->exitStatus()
- << currentProcessError;
+ QCopEnvelope e( "QPE/Desktop", "installFailed(QString,int,QString)" );
+ e << currentPackage << currentProcess->exitStatus()
+ << currentProcessError;
#endif
}
-
+
delete currentProcess;
currentProcess = 0;
@@ -299,7 +298,7 @@ void PackageHandler::rmProcessExited()
{
if ( currentProcess->normalExit() && currentProcess->exitStatus() == 0 )
- sendReply( "removeDone(QString)", currentPackage );
+ sendReply( "removeDone(QString)", currentPackage );
else
- sendReply( "removeFailed(QString)", currentPackage );
+ sendReply( "removeFailed(QString)", currentPackage );
#ifndef QT_NO_COP
@@ -313,10 +312,10 @@ void PackageHandler::readyReadStdout()
{
while ( currentProcess->canReadLineStdout() ) {
- QString line = currentProcess->readLineStdout();
- currentProcessError.append("OUT:"+line);
- if ( line.contains( "Unpacking" ) ) // No tr
- sendReply( "installStep(QString)", "one" ); // No tr
- else if ( line.contains( "Configuring" ) ) // No tr
- sendReply( "installStep(QString)", "two" ); // No tr
+ QString line = currentProcess->readLineStdout();
+ currentProcessError.append("OUT:"+line);
+ if ( line.contains( "Unpacking" ) ) // No tr
+ sendReply( "installStep(QString)", "one" ); // No tr
+ else if ( line.contains( "Configuring" ) ) // No tr
+ sendReply( "installStep(QString)", "two" ); // No tr
}
}
@@ -325,6 +324,6 @@ void PackageHandler::readyReadStderr()
{
while ( currentProcess->canReadLineStderr() ) {
- QString line = currentProcess->readLineStderr();
- currentProcessError.append("ERR:"+line);
+ QString line = currentProcess->readLineStderr();
+ currentProcessError.append("ERR:"+line);
}
}
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
@@ -1157,6 +1157,5 @@ void ServerDTP::connected()
odebug << "==>start send tar process" << oendl;
if ( !createTargzProc->start() )
- qWarning("Error starting %s",
- createTargzProc->arguments().join(" ").latin1());
+ owarn << "Error starting " << createTargzProc->arguments().join(" ").latin1() << oendl;
break;
case SendBuffer: