-rw-r--r-- | library/qpeapplication.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index c107a08..bdf67b9 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -759,100 +759,101 @@ bool QPEApplication::qwsEventFilter( QWSEvent * e ) | |||
759 | } | 759 | } |
760 | if ( d->kbregrab ) { | 760 | if ( d->kbregrab ) { |
761 | grabKeyboard(); | 761 | grabKeyboard(); |
762 | d->kbregrab = FALSE; | 762 | d->kbregrab = FALSE; |
763 | } | 763 | } |
764 | } | 764 | } |
765 | if ( fe->simpleData.get_focus && inputMethodDict ) { | 765 | if ( fe->simpleData.get_focus && inputMethodDict ) { |
766 | InputMethodHint m = inputMethodHint( QWidget::find( e->window() ) ); | 766 | InputMethodHint m = inputMethodHint( QWidget::find( e->window() ) ); |
767 | if ( m == AlwaysOff ) | 767 | if ( m == AlwaysOff ) |
768 | Global::hideInputMethod(); | 768 | Global::hideInputMethod(); |
769 | if ( m == AlwaysOn ) | 769 | if ( m == AlwaysOn ) |
770 | Global::showInputMethod(); | 770 | Global::showInputMethod(); |
771 | } | 771 | } |
772 | } | 772 | } |
773 | return QApplication::qwsEventFilter( e ); | 773 | return QApplication::qwsEventFilter( e ); |
774 | } | 774 | } |
775 | #endif | 775 | #endif |
776 | 776 | ||
777 | /*! | 777 | /*! |
778 | Destroys the QPEApplication. | 778 | Destroys the QPEApplication. |
779 | */ | 779 | */ |
780 | QPEApplication::~QPEApplication() | 780 | QPEApplication::~QPEApplication() |
781 | { | 781 | { |
782 | ungrabKeyboard(); | 782 | ungrabKeyboard(); |
783 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 783 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
784 | // Need to delete QCopChannels early, since the display will | 784 | // Need to delete QCopChannels early, since the display will |
785 | // be gone by the time we get to ~QObject(). | 785 | // be gone by the time we get to ~QObject(). |
786 | delete sysChannel; | 786 | delete sysChannel; |
787 | delete pidChannel; | 787 | delete pidChannel; |
788 | #endif | 788 | #endif |
789 | 789 | ||
790 | delete d; | 790 | delete d; |
791 | } | 791 | } |
792 | 792 | ||
793 | /*! | 793 | /*! |
794 | Returns <tt>$OPIEDIR/</tt>. | 794 | Returns <tt>$OPIEDIR/</tt>. |
795 | */ | 795 | */ |
796 | QString QPEApplication::qpeDir() | 796 | QString QPEApplication::qpeDir() |
797 | { | 797 | { |
798 | const char * base = getenv( "OPIEDIR" ); | 798 | const char * base = getenv( "OPIEDIR" ); |
799 | if ( base ) | 799 | if ( base ) |
800 | return QString( base ) + "/"; | 800 | return QString( base ) + "/"; |
801 | 801 | ||
802 | return QString( "../" ); | 802 | return QString( "../" ); |
803 | } | 803 | } |
804 | 804 | ||
805 | /*! | 805 | /*! |
806 | Returns the user's current Document directory. There is a trailing "/". | 806 | Returns the user's current Document directory. There is a trailing "/". |
807 | .. well, it does now,, and there's no trailing '/' | ||
807 | */ | 808 | */ |
808 | QString QPEApplication::documentDir() | 809 | QString QPEApplication::documentDir() |
809 | { | 810 | { |
810 | return QString( qpeDir() + "Documents"); | 811 | return QString( QDir::homeDirPath() + "/Documents"); |
811 | } | 812 | } |
812 | 813 | ||
813 | static int deforient = -1; | 814 | static int deforient = -1; |
814 | 815 | ||
815 | /*! | 816 | /*! |
816 | \internal | 817 | \internal |
817 | */ | 818 | */ |
818 | int QPEApplication::defaultRotation() | 819 | int QPEApplication::defaultRotation() |
819 | { | 820 | { |
820 | if ( deforient < 0 ) { | 821 | if ( deforient < 0 ) { |
821 | QString d = getenv( "QWS_DISPLAY" ); | 822 | QString d = getenv( "QWS_DISPLAY" ); |
822 | if ( d.contains( "Rot90" ) ) { | 823 | if ( d.contains( "Rot90" ) ) { |
823 | deforient = 90; | 824 | deforient = 90; |
824 | } | 825 | } |
825 | else if ( d.contains( "Rot180" ) ) { | 826 | else if ( d.contains( "Rot180" ) ) { |
826 | deforient = 180; | 827 | deforient = 180; |
827 | } | 828 | } |
828 | else if ( d.contains( "Rot270" ) ) { | 829 | else if ( d.contains( "Rot270" ) ) { |
829 | deforient = 270; | 830 | deforient = 270; |
830 | } | 831 | } |
831 | else { | 832 | else { |
832 | deforient = 0; | 833 | deforient = 0; |
833 | } | 834 | } |
834 | } | 835 | } |
835 | return deforient; | 836 | return deforient; |
836 | } | 837 | } |
837 | 838 | ||
838 | /*! | 839 | /*! |
839 | \internal | 840 | \internal |
840 | */ | 841 | */ |
841 | void QPEApplication::setDefaultRotation( int r ) | 842 | void QPEApplication::setDefaultRotation( int r ) |
842 | { | 843 | { |
843 | if ( qApp->type() == GuiServer ) { | 844 | if ( qApp->type() == GuiServer ) { |
844 | deforient = r; | 845 | deforient = r; |
845 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); | 846 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); |
846 | Config config("qpe"); | 847 | Config config("qpe"); |
847 | config.setGroup( "Rotation" ); | 848 | config.setGroup( "Rotation" ); |
848 | config.writeEntry( "Screen", getenv("QWS_DISPLAY") ); | 849 | config.writeEntry( "Screen", getenv("QWS_DISPLAY") ); |
849 | } else { | 850 | } else { |
850 | #ifndef QT_NO_COP | 851 | #ifndef QT_NO_COP |
851 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); e << r; } | 852 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); e << r; } |
852 | #endif | 853 | #endif |
853 | } | 854 | } |
854 | } | 855 | } |
855 | 856 | ||
856 | /*! | 857 | /*! |
857 | \internal | 858 | \internal |
858 | */ | 859 | */ |