author | ar <ar> | 2004-05-02 21:32:48 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-02 21:32:48 (UTC) |
commit | 0a4cac124105a5732e55cb34c6b37be75083a395 (patch) (side-by-side diff) | |
tree | 33b4d2cab08c9b58893540b4ddee089b69fc9c61 | |
parent | 109ed5f2a1cdfeb3680c9ec057a1083fcf8fab95 (diff) | |
download | opie-0a4cac124105a5732e55cb34c6b37be75083a395.zip opie-0a4cac124105a5732e55cb34c6b37be75083a395.tar.gz opie-0a4cac124105a5732e55cb34c6b37be75083a395.tar.bz2 |
- convert qWarning to owarn
-rw-r--r-- | core/launcher/launcher.cpp | 296 | ||||
-rw-r--r-- | core/launcher/packageslave.cpp | 191 | ||||
-rw-r--r-- | core/launcher/transferserver.cpp | 3 | ||||
-rw-r--r-- | core/obex/obex.cc | 47 | ||||
-rw-r--r-- | core/opie-login/loginapplication.cpp | 315 | ||||
-rw-r--r-- | core/pim/addressbook/namelineedit.cpp | 6 | ||||
-rw-r--r-- | core/qws/transferserver.cpp | 6 |
7 files changed, 439 insertions, 425 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 ) : connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), - this, SLOT(appMessage(const QCString&,const QByteArray&))); + this, SLOT(appMessage(const QCString&,const QByteArray&))); #endif @@ -171,3 +171,3 @@ void LauncherTabWidget::appMessage(const QCString& message, const QByteArray&) if ( message == "nextView()" ) - categoryBar->nextTab(); + categoryBar->nextTab(); } @@ -177,7 +177,7 @@ 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() ); } @@ -194,3 +194,3 @@ void LauncherTabWidget::tabProperties() if ( rv >= 0 && rv != view->viewMode() ) { - view->setViewMode( (LauncherView::ViewMode)rv ); + view->setViewMode( (LauncherView::ViewMode)rv ); } @@ -204,5 +204,5 @@ void LauncherTabWidget::deleteView( const QString& id ) if ( t ) { - stack->removeWidget( t->view ); - delete t->view; - categoryBar->removeTab( t ); + stack->removeWidget( t->view ); + delete t->view; + categoryBar->removeTab( t ); } @@ -214,5 +214,5 @@ LauncherView* LauncherTabWidget::newView( const QString& id, const QPixmap& pm, 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*))); @@ -225,3 +225,3 @@ LauncherView* LauncherTabWidget::newView( const QString& id, const QPixmap& pm, if ( id == "Documents" ) - docview = view; + docview = view; @@ -242,3 +242,3 @@ LauncherView *LauncherTabWidget::view( const QString &id ) if ( !t ) - return 0; + return 0; return t->view; @@ -254,4 +254,4 @@ void LauncherTabWidget::setLoadingWidgetEnabled( bool v ) if ( v != docLoadingWidgetEnabled && docLoadingWidget ) { - docLoadingWidgetEnabled = v; - raiseTabWidget(); + docLoadingWidgetEnabled = v; + raiseTabWidget(); } @@ -270,12 +270,12 @@ void LauncherTabWidget::setTabViewAppearance( LauncherView *v, Config &cfg ) 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 ); } @@ -283,5 +283,5 @@ void LauncherTabWidget::setTabViewAppearance( LauncherView *v, Config &cfg ) if ( textCol.isEmpty() ) - v->setTextColor( QColor() ); + v->setTextColor( QColor() ); else - v->setTextColor( QColor(textCol) ); + v->setTextColor( QColor(textCol) ); // bool customFont = cfg.readBoolEntry( "CustomFont", FALSE ); @@ -307,10 +307,10 @@ void LauncherTabWidget::setTabAppearance( LauncherTab *tab, Config &cfg ) 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); } @@ -335,6 +335,6 @@ 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 ); } @@ -345,8 +345,8 @@ 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 ); + } } @@ -372,47 +372,47 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray & 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)" ) { @@ -466,9 +466,9 @@ 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*))); @@ -496,3 +496,3 @@ Launcher::~Launcher() if ( tb ) - destroyGUI(); + destroyGUI(); } @@ -523,13 +523,13 @@ bool Launcher::eventFilter( QObject*, QEvent *ev ) 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; + } } @@ -562,4 +562,4 @@ static bool isVisibleWindow(int wid) for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { - if ( w->winId() == wid ) - return !w->isFullyObscured(); + if ( w->winId() == wid ) + return !w->isFullyObscured(); } @@ -583,18 +583,18 @@ 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(); } @@ -605,8 +605,8 @@ 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 ); } @@ -623,10 +623,10 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data) 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(); } @@ -636,3 +636,3 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data) void Launcher::typeAdded( const QString& type, const QString& name, - const QPixmap& pixmap, const QPixmap& ) + const QPixmap& pixmap, const QPixmap& ) { @@ -645,3 +645,3 @@ void Launcher::typeAdded( const QString& type, const QString& name, if ( first ) { - first = FALSE; + first = FALSE; tabs->categoryBar->showTab(type); @@ -665,3 +665,3 @@ void Launcher::applicationAdded( const QString& type, const AppLnk& app ) if ( app.type() == "Separator" ) // No tr - return; + return; @@ -669,6 +669,6 @@ void Launcher::applicationAdded( const QString& type, const AppLnk& app ) 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() << "!", @@ -681,3 +681,3 @@ void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) if ( view ) - view->removeLink( app.linkFile() ); + view->removeLink( app.linkFile() ); else @@ -690,3 +690,3 @@ void Launcher::allApplicationsRemoved() for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) - tabs->view( (*it) )->removeAllItems(); + tabs->view( (*it) )->removeAllItems(); } @@ -716,3 +716,3 @@ void Launcher::showDocTab() if ( tabs->categoryBar->currentView() == tabs->docView() ) - tabs->docView()->show(); + tabs->docView()->show(); } @@ -744,15 +744,15 @@ void Launcher::applicationScanningProgress( int 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; } @@ -767,17 +767,17 @@ void Launcher::documentScanningProgress( int 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 @@ -55,3 +55,3 @@ PackageHandler::PackageHandler( QObject *parent, char* name ) connect( packageChannel, SIGNAL( received(const QCString&,const QByteArray&) ), - this, SLOT( qcopMessage(const QCString&,const QByteArray&) ) ); + this, SLOT( qcopMessage(const QCString&,const QByteArray&) ) ); #endif @@ -68,3 +68,3 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) } else if ( msg == "removePackage(QString)" ) { - QString file; + QString file; stream >> file; @@ -72,3 +72,3 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) } else if ( msg == "addPackageFiles(QString,QString)" ) { - QString location, listfile; + QString location, listfile; stream >> location >> listfile; @@ -76,3 +76,3 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) } else if ( msg == "addPackages(QString)" ) { - QString location; + QString location; stream >> location; @@ -80,7 +80,7 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) } 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; @@ -88,6 +88,6 @@ void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) } 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 ); } @@ -98,8 +98,8 @@ 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 @@ -136,4 +136,4 @@ 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 ) { @@ -146,5 +146,5 @@ void PackageHandler::addPackageFiles( const QString &location, 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()); @@ -152,34 +152,33 @@ void PackageHandler::addPackageFiles( const QString &location, - - 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(); + } } @@ -190,10 +189,10 @@ void PackageHandler::addPackages( const QString &location ) 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 ); } @@ -205,31 +204,31 @@ 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() ); + + } } @@ -240,13 +239,13 @@ void PackageHandler::cleanupPackages( const QString &location ) 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 //### @@ -259,5 +258,5 @@ void PackageHandler::prepareInstall( const QString& size, const QString& path ) unsigned int s = size.toUInt( &ok ); - + if ( !ok ) - return; + return; @@ -267,6 +266,6 @@ void PackageHandler::prepareInstall( const QString& size, const QString& path ) 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 @@ -277,11 +276,11 @@ 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; @@ -300,5 +299,5 @@ 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 ); @@ -314,8 +313,8 @@ 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 } @@ -326,4 +325,4 @@ 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 @@ -1158,4 +1158,3 @@ void ServerDTP::connected() if ( !createTargzProc->start() ) - qWarning("Error starting %s", - createTargzProc->arguments().join(" ").latin1()); + owarn << "Error starting " << createTargzProc->arguments().join(" ").latin1() << oendl; break; diff --git a/core/obex/obex.cc b/core/obex/obex.cc index 3c99af6..7c40b90 100644 --- a/core/obex/obex.cc +++ b/core/obex/obex.cc @@ -1,2 +1,9 @@ +#include "obex.h" + +/* OPIE */ +#include <opie2/oprocess.h> +#include <opie2/odebug.h> + +/* QT */ #include <qfileinfo.h> @@ -4,4 +11,2 @@ -#include <opie2/oprocess.h> -#include "obex.h" @@ -31,3 +36,3 @@ void Obex::receive() { m_outp = QString::null; - qWarning("Receive" ); + owarn << "Receive" << oendl; m_rec = new OProcess(); @@ -42,3 +47,3 @@ void Obex::receive() { if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { - qWarning("could not start :("); + owarn << "could not start :(" oendl; emit done( false ); @@ -53,8 +58,8 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se m_file = fileName; - qWarning("send %s", fileName.latin1() ); + owarn << "send " << fileName.latin1() << oendl; if (m_rec != 0 ) { - qWarning("running"); + owarn << "running" oendl; if (m_rec->isRunning() ) { emit error(-1 ); - qWarning("is running"); + owarn << "is running" << oendl; delete m_rec; @@ -63,3 +68,3 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se }else{ - qWarning("is not running"); + owarn << "is not running" << oendl; emit error( -1 ); // we did not delete yet but it's not running slotExited is pending @@ -71,3 +76,3 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se void Obex::sendNow(){ - qWarning("sendNow"); + owarn << "sendNow" << oendl; if ( m_count >= 25 ) { // could not send @@ -90,3 +95,3 @@ void Obex::sendNow(){ if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { - qWarning("could not send" ); + owarn << "could not send" << oendl; m_count = 25; @@ -112,3 +117,3 @@ void Obex::slotStdOut(OProcess* proc, char* buf, int len){ memcpy( ar.data(), buf, len ); - qWarning("parsed: %s", ar.data() ); + owarn << "parsed: " << ar.data() << oendl; m_outp.append( ar ); @@ -121,3 +126,3 @@ void Obex::received() { QString filename = parseOut(); - qWarning("ACHTUNG %s", filename.latin1() ); + owarn << "ACHTUNG " << filename.latin1() << oendl; emit receivedFile( filename ); @@ -137,3 +142,3 @@ void Obex::sendEnd() { m_send=0; - qWarning("done" ); + owarn << "done" << oendl; emit sent(true); @@ -143,3 +148,3 @@ void Obex::sendEnd() { m_send = 0; - qWarning("try sending again" ); + owarn << "try sending again" << oendl; sendNow(); @@ -160,10 +165,10 @@ QString Obex::parseOut( ){ if ( pos > 0 ) { - qWarning( "%d %s", pos, (*it).mid(6 ).latin1() ) ; - qWarning("%d %d", (*it).length(), (*it).length()-pos ); + owarn << pos << " " << (*it).mid(6 ).latin1() << oendl; + owarn << (*it).length() << " " << (*it).length()-pos << oendl; path = (*it).remove( pos, (*it).length() - pos ); - qWarning("%s", path.latin1() ); + owarn << path.latin1() << oendl; path = path.mid(6 ); path = path.stripWhiteSpace(); - qWarning("path %s", path.latin1() ); + owarn << "path " << path.latin1() << oendl; } @@ -177,3 +182,3 @@ QString Obex::parseOut( ){ void Obex::slotError() { - qWarning("slotError"); + owarn << "slotError" << oendl; if ( m_receive ) @@ -190,6 +195,6 @@ void Obex::shutDownReceive() { if (m_rec != 0 ) { - qWarning("running"); + owarn << "running" << oendl; if (m_rec->isRunning() ) { emit error(-1 ); - qWarning("is running"); + owarn << "is running" << oendl; delete m_rec; diff --git a/core/opie-login/loginapplication.cpp b/core/opie-login/loginapplication.cpp index 1facf2d..764b24b 100644 --- a/core/opie-login/loginapplication.cpp +++ b/core/opie-login/loginapplication.cpp @@ -27,2 +27,10 @@ +#include "loginapplication.h" + +/* OPIE */ +#include <opie2/odebug.h> + +/* QT */ + +/* STD */ #include <pwd.h> @@ -44,3 +52,2 @@ extern "C" { -#include "loginapplication.h" @@ -49,6 +56,6 @@ LoginApplication *lApp; LoginApplication::LoginApplication ( int &argc, char **argv, pid_t parentpid ) - : QPEApplication ( argc, argv, GuiServer ) + : QPEApplication ( argc, argv, GuiServer ) { - lApp = this; - m_parentpid = parentpid; + lApp = this; + m_parentpid = parentpid; } @@ -63,35 +70,35 @@ int LoginApplication::pam_helper ( int num_msg, const struct pam_message **msg, { - int replies = 0; - struct pam_response *reply = 0; - int size = sizeof( struct pam_response ); - - for ( int i = 0; i < num_msg; i++ ) { - switch ( msg [i]-> msg_style ) { - case PAM_PROMPT_ECHO_ON: // user name given to PAM already - return PAM_CONV_ERR; - - case PAM_PROMPT_ECHO_OFF: // wants password - reply = (struct pam_response *) ::realloc ( reply, size ); - if ( !reply ) - return PAM_CONV_ERR; - size += sizeof( struct pam_response ); - - reply [replies]. resp_retcode = PAM_SUCCESS; - reply [replies]. resp = ::strdup ( s_pam_password ); - replies++; // PAM frees resp - break; - - case PAM_TEXT_INFO: - break; - - default: - /* unknown or PAM_ERROR_MSG */ - if ( reply ) - ::free ( reply ); - return PAM_CONV_ERR; - } - } - if ( reply ) - *resp = reply; - return PAM_SUCCESS; + int replies = 0; + struct pam_response *reply = 0; + int size = sizeof( struct pam_response ); + + for ( int i = 0; i < num_msg; i++ ) { + switch ( msg [i]-> msg_style ) { + case PAM_PROMPT_ECHO_ON: // user name given to PAM already + return PAM_CONV_ERR; + + case PAM_PROMPT_ECHO_OFF: // wants password + reply = (struct pam_response *) ::realloc ( reply, size ); + if ( !reply ) + return PAM_CONV_ERR; + size += sizeof( struct pam_response ); + + reply [replies]. resp_retcode = PAM_SUCCESS; + reply [replies]. resp = ::strdup ( s_pam_password ); + replies++; // PAM frees resp + break; + + case PAM_TEXT_INFO: + break; + + default: + /* unknown or PAM_ERROR_MSG */ + if ( reply ) + ::free ( reply ); + return PAM_CONV_ERR; + } + } + if ( reply ) + *resp = reply; + return PAM_SUCCESS; } @@ -101,15 +108,15 @@ bool LoginApplication::checkPassword ( const char *user, const char *pass ) { - static struct pam_conv conv = { &LoginApplication::pam_helper, 0 }; - - int pam_error; - pam_handle_t *pamh = 0; - - pam_error = ::pam_start( "xdm", user, &conv, &pamh ); - if ( pam_error == PAM_SUCCESS ) { - s_pam_password = pass; - pam_error = ::pam_authenticate ( pamh, 0 ); - s_pam_password = 0; - } - ::pam_end ( pamh, pam_error ); - return ( pam_error == PAM_SUCCESS ); + static struct pam_conv conv = { &LoginApplication::pam_helper, 0 }; + + int pam_error; + pam_handle_t *pamh = 0; + + pam_error = ::pam_start( "xdm", user, &conv, &pamh ); + if ( pam_error == PAM_SUCCESS ) { + s_pam_password = pass; + pam_error = ::pam_authenticate ( pamh, 0 ); + s_pam_password = 0; + } + ::pam_end ( pamh, pam_error ); + return ( pam_error == PAM_SUCCESS ); } @@ -120,29 +127,29 @@ bool LoginApplication::checkPassword ( const char *user, const char *pass ) { - char *encrypted, *correct; - struct passwd *pw; + char *encrypted, *correct; + struct passwd *pw; - if ( !user || !pass ) - return false; + if ( !user || !pass ) + return false; - pw = ::getpwnam ( user ); + pw = ::getpwnam ( user ); - if ( !pw ) - return false; + if ( !pw ) + return false; - if (( ::strcmp ( pw-> pw_passwd, "x" ) == 0 ) || ( ::strcmp ( pw-> pw_passwd, "*" ) == 0 )) { - struct spwd *sp = ::getspnam ( pw-> pw_name ); + if (( ::strcmp ( pw-> pw_passwd, "x" ) == 0 ) || ( ::strcmp ( pw-> pw_passwd, "*" ) == 0 )) { + struct spwd *sp = ::getspnam ( pw-> pw_name ); - if ( !sp ) - return false; + if ( !sp ) + return false; - correct = sp-> sp_pwdp; - } - else - correct = pw-> pw_passwd; + correct = sp-> sp_pwdp; + } + else + correct = pw-> pw_passwd; - if ( correct == 0 || correct[0] == '\0' ) - return true; + if ( correct == 0 || correct[0] == '\0' ) + return true; - encrypted = ::crypt ( pass, correct ); - return ( ::strcmp ( encrypted, correct ) == 0 ); + encrypted = ::crypt ( pass, correct ); + return ( ::strcmp ( encrypted, correct ) == 0 ); } @@ -153,30 +160,30 @@ bool LoginApplication::changeIdentity ( ) { - const char *DEFAULT_LOGIN_PATH = "/bin:/usr/bin"; - const char *DEFAULT_ROOT_LOGIN_PATH = "/usr/sbin:/bin:/usr/bin:/sbin"; - - if ( !s_username ) - return false; - struct passwd *pw = ::getpwnam ( s_username ); - if ( !pw ) - return false; - - // we are still root at this point - try to run the pre-session script - if ( !runRootScript ( "OPIEDIR", "share/opie-login/pre-session", s_username )) - qWarning ( "failed to run $OPIEDIR/share/opie-login/pre-session" ); - - bool fail = false; - fail |= ( ::initgroups ( pw-> pw_name, pw-> pw_gid )); - ::endgrent ( ); - fail |= ( ::setgid ( pw-> pw_gid )); - fail |= ( ::setuid ( pw-> pw_uid )); - - fail |= ( ::chdir ( pw-> pw_dir ) && ::chdir ( "/" )); - - fail |= ( ::setenv ( "HOME", pw-> pw_dir, 1 )); - fail |= ( ::setenv ( "SHELL", pw-> pw_shell, 1 )); - fail |= ( ::setenv ( "USER", pw-> pw_name, 1 )); - fail |= ( ::setenv ( "LOGNAME", pw-> pw_name, 1 )); - fail |= ( ::setenv ( "PATH", ( pw-> pw_uid ? DEFAULT_LOGIN_PATH : DEFAULT_ROOT_LOGIN_PATH ), 1 )); - - return !fail; + const char *DEFAULT_LOGIN_PATH = "/bin:/usr/bin"; + const char *DEFAULT_ROOT_LOGIN_PATH = "/usr/sbin:/bin:/usr/bin:/sbin"; + + if ( !s_username ) + return false; + struct passwd *pw = ::getpwnam ( s_username ); + if ( !pw ) + return false; + + // we are still root at this point - try to run the pre-session script + if ( !runRootScript ( "OPIEDIR", "share/opie-login/pre-session", s_username )) + owarn << "failed to run $OPIEDIR/share/opie-login/pre-session" << oendl; + + bool fail = false; + fail |= ( ::initgroups ( pw-> pw_name, pw-> pw_gid )); + ::endgrent ( ); + fail |= ( ::setgid ( pw-> pw_gid )); + fail |= ( ::setuid ( pw-> pw_uid )); + + fail |= ( ::chdir ( pw-> pw_dir ) && ::chdir ( "/" )); + + fail |= ( ::setenv ( "HOME", pw-> pw_dir, 1 )); + fail |= ( ::setenv ( "SHELL", pw-> pw_shell, 1 )); + fail |= ( ::setenv ( "USER", pw-> pw_name, 1 )); + fail |= ( ::setenv ( "LOGNAME", pw-> pw_name, 1 )); + fail |= ( ::setenv ( "PATH", ( pw-> pw_uid ? DEFAULT_LOGIN_PATH : DEFAULT_ROOT_LOGIN_PATH ), 1 )); + + return !fail; } @@ -185,8 +192,8 @@ bool LoginApplication::login ( ) { - execUserScript ( "HOME", ".opie-session" ); - execUserScript ( "OPIEDIR", "share/opie-login/opie-session" ); - execUserScript ( "OPIEDIR", "bin/qpe" ); - - qWarning ( "failed to start an Opie session" ); - return false; + execUserScript ( "HOME", ".opie-session" ); + execUserScript ( "OPIEDIR", "share/opie-login/opie-session" ); + execUserScript ( "OPIEDIR", "bin/qpe" ); + + owarn << "failed to start an Opie session" << oendl; + return false; } @@ -195,5 +202,5 @@ void LoginApplication::logout ( ) { - // we are now root again - try to run the post-session script - if ( !runRootScript ( "OPIEDIR", "share/opie-login/post-session" )) - qWarning ( "failed to run $OPIEDIR/scripts/post-session" ); + // we are now root again - try to run the post-session script + if ( !runRootScript ( "OPIEDIR", "share/opie-login/post-session" )) + owarn << "failed to run $OPIEDIR/scripts/post-session" << oendl; } @@ -203,10 +210,10 @@ static char *buildarg ( const char *base, const char *script ) { - const char *dir = base ? ::getenv ( base ) : "/"; - char *arg = new char [::strlen ( dir ) + ::strlen ( script ) + 2]; + const char *dir = base ? ::getenv ( base ) : "/"; + char *arg = new char [::strlen ( dir ) + ::strlen ( script ) + 2]; - ::strcpy ( arg, dir ); - ::strcat ( arg, "/" ); - ::strcat ( arg, script ); + ::strcpy ( arg, dir ); + ::strcat ( arg, "/" ); + ::strcat ( arg, script ); - return arg; + return arg; } @@ -215,23 +222,23 @@ bool LoginApplication::runRootScript ( const char *base, const char *script, con { - bool res = false; - char *arg = buildarg ( base, script ); - - struct stat st; - if (( ::stat ( arg, &st ) == 0 ) && ( st. st_uid == 0 )) { - pid_t child = ::fork ( ); - - if ( child == 0 ) { - ::execl ( "/bin/sh", "-sh", arg, param, 0 ); - ::_exit ( -1 ); - } - else if ( child > 0 ) { - int status = 0; - - while ( ::waitpid ( child, &status, 0 ) < 0 ) { } - res = ( WIFEXITED( status )) && ( WEXITSTATUS( status ) == 0 ); - } - } - - delete [] arg; - return res; + bool res = false; + char *arg = buildarg ( base, script ); + + struct stat st; + if (( ::stat ( arg, &st ) == 0 ) && ( st. st_uid == 0 )) { + pid_t child = ::fork ( ); + + if ( child == 0 ) { + ::execl ( "/bin/sh", "-sh", arg, param, 0 ); + ::_exit ( -1 ); + } + else if ( child > 0 ) { + int status = 0; + + while ( ::waitpid ( child, &status, 0 ) < 0 ) { } + res = ( WIFEXITED( status )) && ( WEXITSTATUS( status ) == 0 ); + } + } + + delete [] arg; + return res; } @@ -240,11 +247,11 @@ void LoginApplication::execUserScript ( const char *base, const char *script ) { - char *arg = buildarg ( base, script ); - - struct stat st; - if ( ::stat ( arg, &st ) == 0 ) { - if ( st. st_mode & S_IXUSR ) - ::execl ( "/bin/sh", "-sh", "-c", arg, 0 ); - else - ::execl ( "/bin/sh", "-sh", arg, 0 ); - } + char *arg = buildarg ( base, script ); + + struct stat st; + if ( ::stat ( arg, &st ) == 0 ) { + if ( st. st_mode & S_IXUSR ) + ::execl ( "/bin/sh", "-sh", "-c", arg, 0 ); + else + ::execl ( "/bin/sh", "-sh", arg, 0 ); + } } @@ -253,3 +260,3 @@ const char *LoginApplication::loginAs ( ) { - return s_username; + return s_username; } @@ -258,3 +265,3 @@ void LoginApplication::setLoginAs ( const char *name ) { - s_username = name; + s_username = name; } @@ -263,13 +270,13 @@ QStringList LoginApplication::allUsers ( ) { - struct passwd *pwd; - QStringList sl; + struct passwd *pwd; + QStringList sl; - while (( pwd = ::getpwent ( ))) { - if (( pwd-> pw_uid == 0 ) || ( pwd-> pw_uid >= 500 && pwd-> pw_uid < 65534 )) - sl << QString ( pwd-> pw_name ); - } + while (( pwd = ::getpwent ( ))) { + if (( pwd-> pw_uid == 0 ) || ( pwd-> pw_uid >= 500 && pwd-> pw_uid < 65534 )) + sl << QString ( pwd-> pw_name ); + } - ::endpwent ( ); + ::endpwent ( ); - return sl; + return sl; } @@ -278,4 +285,4 @@ void LoginApplication::quitToConsole ( ) { - QPEApplication::quit ( ); - ::kill ( m_parentpid, SIGTERM ); + QPEApplication::quit ( ); + ::kill ( m_parentpid, SIGTERM ); } diff --git a/core/pim/addressbook/namelineedit.cpp b/core/pim/addressbook/namelineedit.cpp index ba16e2c..81b959b 100644 --- a/core/pim/addressbook/namelineedit.cpp +++ b/core/pim/addressbook/namelineedit.cpp @@ -2,2 +2,6 @@ +/* OPIE */ +#include <opie2/odebug.h> + + namespace ABOOK { @@ -24,3 +28,3 @@ void NameLineEdit::keyPressEvent( QKeyEvent* ev ) { key != Key_Return && key != Key_Enter ) { - qWarning( "str " + ev->text() + " %d", m_prevSpace ); + owarn << "str " << ev->text() << " " << m_prevSpace << oendl; diff --git a/core/qws/transferserver.cpp b/core/qws/transferserver.cpp index 777c384..7bf6719 100644 --- a/core/qws/transferserver.cpp +++ b/core/qws/transferserver.cpp @@ -23,2 +23,3 @@ +/* STD */ #define _XOPEN_SOURCE @@ -1129,5 +1130,4 @@ void ServerDTP::connected() if ( !createTargzProc->start(Opie::Core::OProcess::NotifyOnExit, Opie::Core::OProcess::Stdout) ) - qWarning("Error starting %s or %s", - createTargzProc->args()[0].data(), - gzipProc->args()[0].data()); + owarn << "Error starting " << createTargzProc->args()[0].data() + << " or " << gzipProc->args()[0].data() << oendl; break; |