-rw-r--r-- | library/qpeapplication.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 2432b65..65fac84 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -416,129 +416,129 @@ static void setMic( int t = 0, int percent = -1 ) | |||
416 | 416 | ||
417 | ### | 417 | ### |
418 | */ | 418 | */ |
419 | 419 | ||
420 | /*! | 420 | /*! |
421 | \fn void QPEApplication::reload() | 421 | \fn void QPEApplication::reload() |
422 | 422 | ||
423 | */ | 423 | */ |
424 | 424 | ||
425 | /*! | 425 | /*! |
426 | \fn void QPEApplication::appMessage( const QCString& msg, const QByteArray& data ) | 426 | \fn void QPEApplication::appMessage( const QCString& msg, const QByteArray& data ) |
427 | 427 | ||
428 | This signal is emitted when a message is received on this | 428 | This signal is emitted when a message is received on this |
429 | application's QPE/Application/<i>appname</i> \link qcop.html | 429 | application's QPE/Application/<i>appname</i> \link qcop.html |
430 | QCop\endlink channel. | 430 | QCop\endlink channel. |
431 | 431 | ||
432 | The slot to which you connect this signal uses \a msg and \a data | 432 | The slot to which you connect this signal uses \a msg and \a data |
433 | in the following way: | 433 | in the following way: |
434 | 434 | ||
435 | \code | 435 | \code |
436 | void MyWidget::receive( const QCString& msg, const QByteArray& data ) | 436 | void MyWidget::receive( const QCString& msg, const QByteArray& data ) |
437 | { | 437 | { |
438 | QDataStream stream( data, IO_ReadOnly ); | 438 | QDataStream stream( data, IO_ReadOnly ); |
439 | if ( msg == "someMessage(int,int,int)" ) { | 439 | if ( msg == "someMessage(int,int,int)" ) { |
440 | int a,b,c; | 440 | int a,b,c; |
441 | stream >> a >> b >> c; | 441 | stream >> a >> b >> c; |
442 | ... | 442 | ... |
443 | } else if ( msg == "otherMessage(QString)" ) { | 443 | } else if ( msg == "otherMessage(QString)" ) { |
444 | ... | 444 | ... |
445 | } | 445 | } |
446 | } | 446 | } |
447 | \endcode | 447 | \endcode |
448 | 448 | ||
449 | \sa qcop.html | 449 | \sa qcop.html |
450 | Note that messages received here may be processed by qpe application | 450 | Note that messages received here may be processed by qpe application |
451 | and emitted as signals, such as flush() and reload(). | 451 | and emitted as signals, such as flush() and reload(). |
452 | */ | 452 | */ |
453 | 453 | ||
454 | /*! | 454 | /*! |
455 | Constructs a QPEApplication just as you would construct | 455 | Constructs a QPEApplication just as you would construct |
456 | a QApplication, passing \a argc, \a argv, and \a t. | 456 | a QApplication, passing \a argc, \a argv, and \a t. |
457 | 457 | ||
458 | For applications, \a t should be the default, GuiClient. Only | 458 | For applications, \a t should be the default, GuiClient. Only |
459 | the Qtopia server passes GuiServer. | 459 | the Qtopia server passes GuiServer. |
460 | */ | 460 | */ |
461 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) | 461 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) |
462 | : QApplication( argc, argv, t ) | 462 | : QApplication( argc, argv, t ) |
463 | { | 463 | { |
464 | d = new QPEApplicationData; | 464 | d = new QPEApplicationData; |
465 | d->loadTextCodecs(); | 465 | d->loadTextCodecs(); |
466 | d->loadImageCodecs(); | 466 | d->loadImageCodecs(); |
467 | int dw = desktop() ->width(); | 467 | int dw = desktop() ->width(); |
468 | qWarning( "Width %d", dw ); | 468 | qWarning( "Width %d", dw ); |
469 | if ( dw < 200 ) { | 469 | if ( dw < 200 ) { |
470 | setFont( QFont( "helvetica", 8 ) ); | 470 | setFont( QFont( "helvetica", 8 ) ); |
471 | AppLnk::setSmallIconSize( 10 ); | 471 | AppLnk::setSmallIconSize( 10 ); |
472 | AppLnk::setBigIconSize( 28 ); | 472 | AppLnk::setBigIconSize( 28 ); |
473 | } | 473 | } |
474 | else if ( dw > 600 ) { | 474 | else if ( dw > 600 ) { |
475 | setFont( QFont( "helvetica", 12 ) ); | 475 | setFont( QFont( "helvetica", 12 ) ); |
476 | AppLnk::setSmallIconSize( 24 ); | 476 | AppLnk::setSmallIconSize( 24 ); |
477 | AppLnk::setBigIconSize( 48 ); | 477 | AppLnk::setBigIconSize( 48 ); |
478 | } | 478 | } |
479 | else if ( dw > 200 ) { | 479 | else if ( dw > 200 ) { |
480 | setFont( QFont( "helvetica", 12 ) ); | 480 | setFont( QFont( "helvetica", 10 ) ); |
481 | AppLnk::setSmallIconSize( 16 ); | 481 | AppLnk::setSmallIconSize( 16 ); |
482 | AppLnk::setBigIconSize( 32 ); | 482 | AppLnk::setBigIconSize( 32 ); |
483 | } | 483 | } |
484 | 484 | ||
485 | 485 | ||
486 | QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory ); | 486 | QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory ); |
487 | 487 | ||
488 | connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) ); | 488 | connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) ); |
489 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 489 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
490 | 490 | ||
491 | QString qcopfn( "/tmp/qcop-msg-" ); | 491 | QString qcopfn( "/tmp/qcop-msg-" ); |
492 | qcopfn += QString( argv[ 0 ] ); // append command name | 492 | qcopfn += QString( argv[ 0 ] ); // append command name |
493 | 493 | ||
494 | QFile f( qcopfn ); | 494 | QFile f( qcopfn ); |
495 | if ( f.open( IO_ReadOnly ) ) { | 495 | if ( f.open( IO_ReadOnly ) ) { |
496 | flock( f.handle(), LOCK_EX ); | 496 | flock( f.handle(), LOCK_EX ); |
497 | } | 497 | } |
498 | 498 | ||
499 | sysChannel = new QCopChannel( "QPE/System", this ); | 499 | sysChannel = new QCopChannel( "QPE/System", this ); |
500 | connect( sysChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), | 500 | connect( sysChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), |
501 | this, SLOT( systemMessage( const QCString &, const QByteArray & ) ) ); | 501 | this, SLOT( systemMessage( const QCString &, const QByteArray & ) ) ); |
502 | 502 | ||
503 | QCString channel = QCString( argv[ 0 ] ); | 503 | QCString channel = QCString( argv[ 0 ] ); |
504 | channel.replace( QRegExp( ".*/" ), "" ); | 504 | channel.replace( QRegExp( ".*/" ), "" ); |
505 | d->appName = channel; | 505 | d->appName = channel; |
506 | channel = "QPE/Application/" + channel; | 506 | channel = "QPE/Application/" + channel; |
507 | pidChannel = new QCopChannel( channel, this ); | 507 | pidChannel = new QCopChannel( channel, this ); |
508 | connect( pidChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), | 508 | connect( pidChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), |
509 | this, SLOT( pidMessage( const QCString &, const QByteArray & ) ) ); | 509 | this, SLOT( pidMessage( const QCString &, const QByteArray & ) ) ); |
510 | 510 | ||
511 | if ( f.isOpen() ) { | 511 | if ( f.isOpen() ) { |
512 | d->keep_running = FALSE; | 512 | d->keep_running = FALSE; |
513 | QDataStream ds( &f ); | 513 | QDataStream ds( &f ); |
514 | QCString channel, message; | 514 | QCString channel, message; |
515 | QByteArray data; | 515 | QByteArray data; |
516 | while ( !ds.atEnd() ) { | 516 | while ( !ds.atEnd() ) { |
517 | ds >> channel >> message >> data; | 517 | ds >> channel >> message >> data; |
518 | d->enqueueQCop( channel, message, data ); | 518 | d->enqueueQCop( channel, message, data ); |
519 | } | 519 | } |
520 | 520 | ||
521 | flock( f.handle(), LOCK_UN ); | 521 | flock( f.handle(), LOCK_UN ); |
522 | f.close(); | 522 | f.close(); |
523 | f.remove(); | 523 | f.remove(); |
524 | } | 524 | } |
525 | 525 | ||
526 | for ( int a = 0; a < argc; a++ ) { | 526 | for ( int a = 0; a < argc; a++ ) { |
527 | if ( qstrcmp( argv[ a ], "-preload" ) == 0 ) { | 527 | if ( qstrcmp( argv[ a ], "-preload" ) == 0 ) { |
528 | argv[ a ] = argv[ a + 1 ]; | 528 | argv[ a ] = argv[ a + 1 ]; |
529 | a++; | 529 | a++; |
530 | d->preloaded = TRUE; | 530 | d->preloaded = TRUE; |
531 | argc -= 1; | 531 | argc -= 1; |
532 | } | 532 | } |
533 | else if ( qstrcmp( argv[ a ], "-preload-show" ) == 0 ) { | 533 | else if ( qstrcmp( argv[ a ], "-preload-show" ) == 0 ) { |
534 | argv[ a ] = argv[ a + 1 ]; | 534 | argv[ a ] = argv[ a + 1 ]; |
535 | a++; | 535 | a++; |
536 | d->preloaded = TRUE; | 536 | d->preloaded = TRUE; |
537 | d->forceshow = TRUE; | 537 | d->forceshow = TRUE; |
538 | argc -= 1; | 538 | argc -= 1; |
539 | } | 539 | } |
540 | } | 540 | } |
541 | 541 | ||
542 | /* overide stored arguments */ | 542 | /* overide stored arguments */ |
543 | setArgs( argc, argv ); | 543 | setArgs( argc, argv ); |
544 | 544 | ||