author | zecke <zecke> | 2004-07-17 17:48:36 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-07-17 17:48:36 (UTC) |
commit | 0f64024dc631d9043d2f6f4f6bcafaac7eddd545 (patch) (side-by-side diff) | |
tree | 1919517cd70c2b74caeee24cccb0ac239b867b74 | |
parent | 8cc200a72b547bb7e313cfa197c72f91dfe0c759 (diff) | |
download | opie-0f64024dc631d9043d2f6f4f6bcafaac7eddd545.zip opie-0f64024dc631d9043d2f6f4f6bcafaac7eddd545.tar.gz opie-0f64024dc631d9043d2f6f4f6bcafaac7eddd545.tar.bz2 |
Fix compiler warning about unused variable
-rw-r--r-- | core/launcher/launcher.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index aa357ca..010a2e9 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp @@ -418,364 +418,364 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray & 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 if ( msg == "setBusyIndicatorType(QString)" ) { QString type; stream >> type; setBusyIndicatorType( type ); }else if ( msg == "home()" ) { if ( isVisibleWindow( static_cast<QWidget*>(parent())->winId() ) ) { if (categoryBar) categoryBar->nextTab(); }else static_cast<QWidget*>(parent())->raise(); } } //--------------------------------------------------------------------------- Launcher::Launcher() : QMainWindow( 0, "PDA User Interface", QWidget::WStyle_Customize | QWidget::WGroupLeader ) { tabs = 0; tb = 0; Config cfg( "Launcher" ); cfg.setGroup( "DocTab" ); docTabEnabled = cfg.readBoolEntry( "Enable", true ); } void Launcher::createGUI() { setCaption( tr("Launcher") ); // we have a pretty good idea how big we'll be setGeometry( 0, 0, qApp->desktop()->width(), qApp->desktop()->height() ); tb = new TaskBar; tabs = new LauncherTabWidget( this ); setCentralWidget( tabs ); ServerInterface::dockWidget( tb, ServerInterface::Bottom ); tb->show(); qApp->installEventFilter( this ); connect( tb, SIGNAL(tabSelected(const QString&)), this, SLOT(showTab(const QString&)) ); connect( tabs, SIGNAL(selected(const QString&)), this, SLOT(viewSelected(const QString&)) ); connect( tabs, SIGNAL(clicked(const AppLnk*)), this, SLOT(select(const AppLnk*))); connect( tabs, SIGNAL(rightPressed(AppLnk*)), this, SLOT(properties(AppLnk*))); #if defined(Q_WS_QWS) && !defined(QT_NO_COP) QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); connect( sysChannel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(systemMessage(const QCString&,const QByteArray&)) ); #endif // all documents QImage img( Resource::loadImage( "DocsIcon" ) ); QPixmap pm; pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); // It could add this itself if it handles docs tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE ); QTimer::singleShot( 0, tabs, SLOT( initLayout() ) ); qApp->setMainWidget( this ); QTimer::singleShot( 500, this, SLOT( makeVisible() ) ); } Launcher::~Launcher() { if ( tb ) destroyGUI(); } bool Launcher::requiresDocuments() const { Config cfg( "Launcher" ); cfg.setGroup( "DocTab" ); return cfg.readBoolEntry( "Enable", true ); } void Launcher::makeVisible() { showMaximized(); } void Launcher::destroyGUI() { delete tb; tb = 0; delete tabs; tabs =0; } 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; } } #else Q_UNUSED(ev); #endif return FALSE; } static bool isVisibleWindow(int wid) { #ifdef Q_WS_QWS const QList<QWSWindow> &list = qwsServer->clientWindows(); QWSWindow* w; for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { if ( w->winId() == wid ) return !w->isFullyObscured(); } #endif return FALSE; } void Launcher::viewSelected(const QString& s) { setCaption( s + tr(" - Launcher") ); } void Launcher::showTab(const QString& id) { tabs->categoryBar->showTab(id); raise(); } void Launcher::select( const AppLnk *appLnk ) { if ( appLnk->type() == "Folder" ) { // No tr // 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); /* ### Fixme */ if ( i == 1 ) Global::execute("textedit",appLnk->file()); return; } tabs->setBusy(TRUE); emit executing( appLnk ); appLnk->execute(); } } void Launcher::properties( AppLnk *appLnk ) { if ( appLnk->type() == "Folder" ) { // No tr // Not supported: flat is simpler for the user } else { /* ### libqtopia FIXME also moving docLnks... */ LnkProperties prop(appLnk,0 ); QPEApplication::execDialog( &prop ); } } -void Launcher::storageChanged( const QList<FileSystem> &fs ) +void Launcher::storageChanged( const QList<FileSystem> & ) { // ### update combo boxes if we had a combo box for the storage type } void Launcher::systemMessage( const QCString &msg, const QByteArray &data) { QDataStream stream( data, IO_ReadOnly ); if ( msg == "busy()" ) { tb->startWait(); } else if ( msg == "notBusy(QString)" ) { QString app; stream >> app; tabs->setBusy(FALSE); tb->stopWait(app); } else if (msg == "applyStyle()") { tabs->currentView()->relayout(); } } // These are the update functions from the server void Launcher::typeAdded( const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& ) { tabs->newView( type, pixmap, name ); ids.append( type ); /* this will be called in applicationScanningProgress with value 100! */ // tb->refreshStartMenu(); static bool first = TRUE; if ( first ) { first = FALSE; tabs->categoryBar->showTab(type); } tabs->view( type )->setUpdatesEnabled( FALSE ); tabs->view( type )->setSortEnabled( FALSE ); } void Launcher::typeRemoved( const QString& type ) { tabs->view( type )->removeAllItems(); tabs->deleteView( type ); ids.remove( type ); /* this will be called in applicationScanningProgress with value 100! */ // tb->refreshStartMenu(); } void Launcher::applicationAdded( const QString& type, const AppLnk& app ) { if ( app.type() == "Separator" ) // No tr return; LauncherView *view = tabs->view( type ); if ( view ) view->addItem( new AppLnk( app ), FALSE ); else owarn << "addAppLnk: No view for type " << type.latin1() << ". Can't add app " << app.name().latin1() << "!", MimeType::registerApp( app ); } void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) { LauncherView *view = tabs->view( type ); if ( view ) view->removeLink( app.linkFile() ); else owarn << "removeAppLnk: No view for " << type << "!" << oendl; } void Launcher::allApplicationsRemoved() { MimeType::clear(); for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) tabs->view( (*it) )->removeAllItems(); } void Launcher::documentAdded( const DocLnk& doc ) { tabs->docView()->addItem( new DocLnk( doc ), FALSE ); } void Launcher::aboutToAddBegin() { tabs->docView()->setUpdatesEnabled( false ); } void Launcher::aboutToAddEnd() { tabs->docView()->setUpdatesEnabled( true ); } void Launcher::showLoadingDocs() { tabs->docView()->hide(); } void Launcher::showDocTab() { if ( tabs->categoryBar->currentView() == tabs->docView() ) tabs->docView()->show(); } void Launcher::documentRemoved( const DocLnk& doc ) { tabs->docView()->removeLink( doc.linkFile() ); } void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) { documentRemoved( oldDoc ); documentAdded( newDoc ); } void Launcher::allDocumentsRemoved() { tabs->docView()->removeAllItems(); } void Launcher::applicationStateChanged( const QString& name, ApplicationState state ) { tb->setApplicationState( name, state ); } 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; } case 100: { for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { tabs->view( (*it) )->setUpdatesEnabled( TRUE ); tabs->view( (*it) )->setSortEnabled( TRUE ); } tb->refreshStartMenu(); break; } default: break; } } void Launcher::documentScanningProgress( int percent ) { switch ( percent ) { case 0: { 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; } default: tabs->setLoadingProgress( percent ); break; } } |