-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 cd1c62e..d4734ae 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -529,129 +529,129 @@ void QPEApplication::processQCopFile() | |||
529 | ds >> channel >> message >> data; | 529 | ds >> channel >> message >> data; |
530 | d->enqueueQCop(channel,message,data); | 530 | d->enqueueQCop(channel,message,data); |
531 | } | 531 | } |
532 | ::ftruncate(f.handle(), 0); | 532 | ::ftruncate(f.handle(), 0); |
533 | #ifndef Q_OS_WIN32 | 533 | #ifndef Q_OS_WIN32 |
534 | f.flush(); | 534 | f.flush(); |
535 | flock(f.handle(), LOCK_UN); | 535 | flock(f.handle(), LOCK_UN); |
536 | #endif | 536 | #endif |
537 | } | 537 | } |
538 | #endif | 538 | #endif |
539 | } | 539 | } |
540 | 540 | ||
541 | 541 | ||
542 | /*! | 542 | /*! |
543 | \fn void QPEApplication::appMessage( const QCString& msg, const QByteArray& data ) | 543 | \fn void QPEApplication::appMessage( const QCString& msg, const QByteArray& data ) |
544 | 544 | ||
545 | This signal is emitted when a message is received on this | 545 | This signal is emitted when a message is received on this |
546 | application's QPE/Application/<i>appname</i> \link qcop.html | 546 | application's QPE/Application/<i>appname</i> \link qcop.html |
547 | QCop\endlink channel. | 547 | QCop\endlink channel. |
548 | 548 | ||
549 | The slot to which you connect this signal uses \a msg and \a data | 549 | The slot to which you connect this signal uses \a msg and \a data |
550 | in the following way: | 550 | in the following way: |
551 | 551 | ||
552 | \code | 552 | \code |
553 | void MyWidget::receive( const QCString& msg, const QByteArray& data ) | 553 | void MyWidget::receive( const QCString& msg, const QByteArray& data ) |
554 | { | 554 | { |
555 | QDataStream stream( data, IO_ReadOnly ); | 555 | QDataStream stream( data, IO_ReadOnly ); |
556 | if ( msg == "someMessage(int,int,int)" ) { | 556 | if ( msg == "someMessage(int,int,int)" ) { |
557 | int a,b,c; | 557 | int a,b,c; |
558 | stream >> a >> b >> c; | 558 | stream >> a >> b >> c; |
559 | ... | 559 | ... |
560 | } else if ( msg == "otherMessage(QString)" ) { | 560 | } else if ( msg == "otherMessage(QString)" ) { |
561 | ... | 561 | ... |
562 | } | 562 | } |
563 | } | 563 | } |
564 | \endcode | 564 | \endcode |
565 | 565 | ||
566 | \sa qcop.html | 566 | \sa qcop.html |
567 | Note that messages received here may be processed by qpe application | 567 | Note that messages received here may be processed by qpe application |
568 | and emitted as signals, such as flush() and reload(). | 568 | and emitted as signals, such as flush() and reload(). |
569 | */ | 569 | */ |
570 | 570 | ||
571 | /*! | 571 | /*! |
572 | Constructs a QPEApplication just as you would construct | 572 | Constructs a QPEApplication just as you would construct |
573 | a QApplication, passing \a argc, \a argv, and \a t. | 573 | a QApplication, passing \a argc, \a argv, and \a t. |
574 | 574 | ||
575 | For applications, \a t should be the default, GuiClient. Only | 575 | For applications, \a t should be the default, GuiClient. Only |
576 | the Qtopia server passes GuiServer. | 576 | the Qtopia server passes GuiServer. |
577 | */ | 577 | */ |
578 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) | 578 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) |
579 | : QApplication( hack(argc), argv, t ), pidChannel( 0 ) | 579 | : QApplication( hack(argc), argv, t ), pidChannel( 0 ) |
580 | { | 580 | { |
581 | QPixmapCache::setCacheLimit(256); // sensible default for smaller devices. | 581 | QPixmapCache::setCacheLimit(256); // sensible default for smaller devices. |
582 | 582 | ||
583 | d = new QPEApplicationData; | 583 | d = new QPEApplicationData; |
584 | d->loadTextCodecs(); | 584 | d->loadTextCodecs(); |
585 | d->loadImageCodecs(); | 585 | d->loadImageCodecs(); |
586 | int dw = desktop() ->width(); | 586 | int dw = desktop() ->width(); |
587 | 587 | ||
588 | if ( dw < 200 ) { | 588 | if ( dw < 200 ) { |
589 | setFont( QFont( "vera", 8 ) ); | 589 | setFont( QFont( "vera", 8 ) ); |
590 | AppLnk::setSmallIconSize( 10 ); | 590 | AppLnk::setSmallIconSize( 10 ); |
591 | AppLnk::setBigIconSize( 28 ); | 591 | AppLnk::setBigIconSize( 28 ); |
592 | } | 592 | } |
593 | #ifndef OPIE_HIGH_RES_SMALL_PHY | 593 | #if defined(OPIE_HIGH_RES_SMALL_PHY) |
594 | else if ( dw > 600 ) { | 594 | else if ( dw > 600 ) { |
595 | setFont( QFont( "vera", 16 ) ); | 595 | setFont( QFont( "vera", 16 ) ); |
596 | AppLnk::setSmallIconSize( 24 ); | 596 | AppLnk::setSmallIconSize( 24 ); |
597 | AppLnk::setBigIconSize( 48 ); | 597 | AppLnk::setBigIconSize( 48 ); |
598 | } | 598 | } |
599 | #endif | 599 | #endif |
600 | else if ( dw > 200 ) { | 600 | else if ( dw > 200 ) { |
601 | setFont( QFont( "vera", 10 ) ); | 601 | setFont( QFont( "vera", 10 ) ); |
602 | AppLnk::setSmallIconSize( 14 ); | 602 | AppLnk::setSmallIconSize( 14 ); |
603 | AppLnk::setBigIconSize( 32 ); | 603 | AppLnk::setBigIconSize( 32 ); |
604 | } | 604 | } |
605 | 605 | ||
606 | QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory ); | 606 | QMimeSourceFactory::setDefaultFactory( new ResourceMimeFactory ); |
607 | 607 | ||
608 | connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) ); | 608 | connect( this, SIGNAL( lastWindowClosed() ), this, SLOT( hideOrQuit() ) ); |
609 | 609 | ||
610 | 610 | ||
611 | sysChannel = new QCopChannel( "QPE/System", this ); | 611 | sysChannel = new QCopChannel( "QPE/System", this ); |
612 | connect( sysChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), | 612 | connect( sysChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), |
613 | this, SLOT( systemMessage( const QCString &, const QByteArray & ) ) ); | 613 | this, SLOT( systemMessage( const QCString &, const QByteArray & ) ) ); |
614 | 614 | ||
615 | /* COde now in initapp */ | 615 | /* COde now in initapp */ |
616 | #if 0 | 616 | #if 0 |
617 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 617 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
618 | 618 | ||
619 | QString qcopfn( "/tmp/qcop-msg-" ); | 619 | QString qcopfn( "/tmp/qcop-msg-" ); |
620 | qcopfn += QString( argv[ 0 ] ); // append command name | 620 | qcopfn += QString( argv[ 0 ] ); // append command name |
621 | 621 | ||
622 | QFile f( qcopfn ); | 622 | QFile f( qcopfn ); |
623 | if ( f.open( IO_ReadOnly ) ) { | 623 | if ( f.open( IO_ReadOnly ) ) { |
624 | flock( f.handle(), LOCK_EX ); | 624 | flock( f.handle(), LOCK_EX ); |
625 | } | 625 | } |
626 | 626 | ||
627 | 627 | ||
628 | 628 | ||
629 | QCString channel = QCString( argv[ 0 ] ); | 629 | QCString channel = QCString( argv[ 0 ] ); |
630 | channel.replace( QRegExp( ".*/" ), "" ); | 630 | channel.replace( QRegExp( ".*/" ), "" ); |
631 | d->appName = channel; | 631 | d->appName = channel; |
632 | channel = "QPE/Application/" + channel; | 632 | channel = "QPE/Application/" + channel; |
633 | pidChannel = new QCopChannel( channel, this ); | 633 | pidChannel = new QCopChannel( channel, this ); |
634 | connect( pidChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), | 634 | connect( pidChannel, SIGNAL( received( const QCString &, const QByteArray & ) ), |
635 | this, SLOT( pidMessage( const QCString &, const QByteArray & ) ) ); | 635 | this, SLOT( pidMessage( const QCString &, const QByteArray & ) ) ); |
636 | 636 | ||
637 | if ( f.isOpen() ) { | 637 | if ( f.isOpen() ) { |
638 | d->keep_running = FALSE; | 638 | d->keep_running = FALSE; |
639 | QDataStream ds( &f ); | 639 | QDataStream ds( &f ); |
640 | QCString channel, message; | 640 | QCString channel, message; |
641 | QByteArray data; | 641 | QByteArray data; |
642 | while ( !ds.atEnd() ) { | 642 | while ( !ds.atEnd() ) { |
643 | ds >> channel >> message >> data; | 643 | ds >> channel >> message >> data; |
644 | d->enqueueQCop( channel, message, data ); | 644 | d->enqueueQCop( channel, message, data ); |
645 | } | 645 | } |
646 | 646 | ||
647 | flock( f.handle(), LOCK_UN ); | 647 | flock( f.handle(), LOCK_UN ); |
648 | f.close(); | 648 | f.close(); |
649 | f.remove(); | 649 | f.remove(); |
650 | } | 650 | } |
651 | 651 | ||
652 | for ( int a = 0; a < argc; a++ ) { | 652 | for ( int a = 0; a < argc; a++ ) { |
653 | if ( qstrcmp( argv[ a ], "-preload" ) == 0 ) { | 653 | if ( qstrcmp( argv[ a ], "-preload" ) == 0 ) { |
654 | argv[ a ] = argv[ a + 1 ]; | 654 | argv[ a ] = argv[ a + 1 ]; |
655 | a++; | 655 | a++; |
656 | d->preloaded = TRUE; | 656 | d->preloaded = TRUE; |
657 | argc -= 1; | 657 | argc -= 1; |