Diffstat (limited to 'x11/libqpe-x11/qpe/qpeapplication.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | x11/libqpe-x11/qpe/qpeapplication.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/x11/libqpe-x11/qpe/qpeapplication.cpp b/x11/libqpe-x11/qpe/qpeapplication.cpp index 73e7ce4..c49f3ad 100644 --- a/x11/libqpe-x11/qpe/qpeapplication.cpp +++ b/x11/libqpe-x11/qpe/qpeapplication.cpp | |||
@@ -412,13 +412,13 @@ void QPEApplication::applyStyle() { | |||
412 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); | 412 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); |
413 | setFont( QFont(ff, fs) ); | 413 | setFont( QFont(ff, fs) ); |
414 | } | 414 | } |
415 | int QPEApplication::defaultRotation() { | 415 | int QPEApplication::defaultRotation() { |
416 | return 0; | 416 | return 0; |
417 | } | 417 | } |
418 | void QPEApplication::setDefaultRotation(int r ) { | 418 | void QPEApplication::setDefaultRotation(int) { |
419 | 419 | ||
420 | } | 420 | } |
421 | void QPEApplication::grabKeyboard() { | 421 | void QPEApplication::grabKeyboard() { |
422 | QPEApplication::Private * d = ( ( QPEApplication* ) qApp ) ->d; | 422 | QPEApplication::Private * d = ( ( QPEApplication* ) qApp ) ->d; |
423 | if ( qApp->type() == QApplication::GuiServer ) | 423 | if ( qApp->type() == QApplication::GuiServer ) |
424 | d->kbgrabber = 0; | 424 | d->kbgrabber = 0; |
@@ -446,12 +446,20 @@ void QPEApplication::showMainDocumentWidget( QWidget* mw, bool m) { | |||
446 | if ( mw && argc() == 2 ) | 446 | if ( mw && argc() == 2 ) |
447 | Global::setDocument( mw, QString::fromUtf8(argv()[1] ) ); | 447 | Global::setDocument( mw, QString::fromUtf8(argv()[1] ) ); |
448 | 448 | ||
449 | d->show(mw, m ); | 449 | d->show(mw, m ); |
450 | } | 450 | } |
451 | void QPEApplication::showDialog( QDialog* d, bool nomax ) { | 451 | void QPEApplication::showDialog( QDialog* d, bool nomax ) { |
452 | showWidget( d, nomax ); | ||
453 | } | ||
454 | int QPEApplication::execDialog( QDialog* d, bool nomax) { | ||
455 | showDialog(d,nomax); | ||
456 | return d->exec(); | ||
457 | } | ||
458 | |||
459 | void QPEApplication::showWidget( QWidget* d, bool nomax ) { | ||
452 | QSize sh = d->sizeHint(); | 460 | QSize sh = d->sizeHint(); |
453 | int w = QMAX(sh.width(),d->width()); | 461 | int w = QMAX(sh.width(),d->width()); |
454 | int h = QMAX(sh.height(),d->height()); | 462 | int h = QMAX(sh.height(),d->height()); |
455 | if ( !nomax | 463 | if ( !nomax |
456 | && ( w > qApp->desktop()->width()*3/4 | 464 | && ( w > qApp->desktop()->width()*3/4 |
457 | || h > qApp->desktop()->height()*3/4 ) ) | 465 | || h > qApp->desktop()->height()*3/4 ) ) |
@@ -459,16 +467,13 @@ void QPEApplication::showDialog( QDialog* d, bool nomax ) { | |||
459 | d->showMaximized(); | 467 | d->showMaximized(); |
460 | } else { | 468 | } else { |
461 | d->resize(w,h); | 469 | d->resize(w,h); |
462 | d->show(); | 470 | d->show(); |
463 | } | 471 | } |
464 | } | 472 | } |
465 | int QPEApplication::execDialog( QDialog* d, bool nomax) { | 473 | |
466 | showDialog(d,nomax); | ||
467 | return d->exec(); | ||
468 | } | ||
469 | void QPEApplication::setKeepRunning() { | 474 | void QPEApplication::setKeepRunning() { |
470 | if ( qApp && qApp->inherits( "QPEApplication" ) ) { | 475 | if ( qApp && qApp->inherits( "QPEApplication" ) ) { |
471 | QPEApplication * qpeApp = ( QPEApplication* ) qApp; | 476 | QPEApplication * qpeApp = ( QPEApplication* ) qApp; |
472 | qpeApp->d->keep_running = TRUE; | 477 | qpeApp->d->keep_running = TRUE; |
473 | } | 478 | } |
474 | } | 479 | } |
@@ -754,12 +759,13 @@ int QPEApplication::x11ClientMessage(QWidget* w, XEvent* event, bool b ) { | |||
754 | } | 759 | } |
755 | 760 | ||
756 | #define KeyPress XKeyPress | 761 | #define KeyPress XKeyPress |
757 | #define KeyRelease XKeyRelease | 762 | #define KeyRelease XKeyRelease |
758 | 763 | ||
759 | #if defined(OPIE_NEW_MALLOC) | 764 | #if defined(OPIE_NEW_MALLOC) |
765 | #define likely(x) x | ||
760 | 766 | ||
761 | // The libraries with the skiff package (and possibly others) have | 767 | // The libraries with the skiff package (and possibly others) have |
762 | // completely useless implementations of builtin new and delete that | 768 | // completely useless implementations of builtin new and delete that |
763 | // use about 50% of your CPU. Here we revert to the simple libc | 769 | // use about 50% of your CPU. Here we revert to the simple libc |
764 | // functions. | 770 | // functions. |
765 | 771 | ||
@@ -772,25 +778,29 @@ void* operator new( size_t size ) | |||
772 | { | 778 | { |
773 | return malloc( size ); | 779 | return malloc( size ); |
774 | } | 780 | } |
775 | 781 | ||
776 | void operator delete[]( void* p ) | 782 | void operator delete[]( void* p ) |
777 | { | 783 | { |
784 | if ( likely(p) ) | ||
778 | free( p ); | 785 | free( p ); |
779 | } | 786 | } |
780 | 787 | ||
781 | void operator delete[]( void* p, size_t /*size*/ ) | 788 | void operator delete[]( void* p, size_t /*size*/ ) |
782 | { | 789 | { |
790 | if ( likely(p) ) | ||
783 | free( p ); | 791 | free( p ); |
784 | } | 792 | } |
785 | 793 | ||
786 | void operator delete( void* p ) | 794 | void operator delete( void* p ) |
787 | { | 795 | { |
796 | if ( likely(p) ) | ||
788 | free( p ); | 797 | free( p ); |
789 | } | 798 | } |
790 | 799 | ||
791 | void operator delete( void* p, size_t /*size*/ ) | 800 | void operator delete( void* p, size_t /*size*/ ) |
792 | { | 801 | { |
802 | if ( likely(p) ) | ||
793 | free( p ); | 803 | free( p ); |
794 | } | 804 | } |
795 | 805 | ||
796 | #endif | 806 | #endif |