author | zecke <zecke> | 2002-09-25 18:15:58 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-25 18:15:58 (UTC) |
commit | c96507591791d48a6d6dad3de6c15739c84e1c93 (patch) (unidiff) | |
tree | f5476860497023dd6d9e1c82c61cc6bb3f61a6da /library | |
parent | d44c455b86d6cccbc497e3e8d8aa399096eff7db (diff) | |
download | opie-c96507591791d48a6d6dad3de6c15739c84e1c93.zip opie-c96507591791d48a6d6dad3de6c15739c84e1c93.tar.gz opie-c96507591791d48a6d6dad3de6c15739c84e1c93.tar.bz2 |
ljps patch was/is correct
but for some reason TT is not using QFile
so I made it use getenv(HOME) instead
-rw-r--r-- | library/qpeapplication.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index bdf67b9..533d7bd 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -779,65 +779,69 @@ bool QPEApplication::qwsEventFilter( QWSEvent * e ) | |||
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 | .. well, it does now,, and there's no trailing '/' |
808 | */ | 808 | */ |
809 | QString QPEApplication::documentDir() | 809 | QString QPEApplication::documentDir() |
810 | { | 810 | { |
811 | return QString( QDir::homeDirPath() + "/Documents"); | 811 | const char* base = getenv( "HOME"); |
812 | if( base ) | ||
813 | return QString( base ) + "/Documents"; | ||
814 | |||
815 | return QString( "../Documents" ); | ||
812 | } | 816 | } |
813 | 817 | ||
814 | static int deforient = -1; | 818 | static int deforient = -1; |
815 | 819 | ||
816 | /*! | 820 | /*! |
817 | \internal | 821 | \internal |
818 | */ | 822 | */ |
819 | int QPEApplication::defaultRotation() | 823 | int QPEApplication::defaultRotation() |
820 | { | 824 | { |
821 | if ( deforient < 0 ) { | 825 | if ( deforient < 0 ) { |
822 | QString d = getenv( "QWS_DISPLAY" ); | 826 | QString d = getenv( "QWS_DISPLAY" ); |
823 | if ( d.contains( "Rot90" ) ) { | 827 | if ( d.contains( "Rot90" ) ) { |
824 | deforient = 90; | 828 | deforient = 90; |
825 | } | 829 | } |
826 | else if ( d.contains( "Rot180" ) ) { | 830 | else if ( d.contains( "Rot180" ) ) { |
827 | deforient = 180; | 831 | deforient = 180; |
828 | } | 832 | } |
829 | else if ( d.contains( "Rot270" ) ) { | 833 | else if ( d.contains( "Rot270" ) ) { |
830 | deforient = 270; | 834 | deforient = 270; |
831 | } | 835 | } |
832 | else { | 836 | else { |
833 | deforient = 0; | 837 | deforient = 0; |
834 | } | 838 | } |
835 | } | 839 | } |
836 | return deforient; | 840 | return deforient; |
837 | } | 841 | } |
838 | 842 | ||
839 | /*! | 843 | /*! |
840 | \internal | 844 | \internal |
841 | */ | 845 | */ |
842 | void QPEApplication::setDefaultRotation( int r ) | 846 | void QPEApplication::setDefaultRotation( int r ) |
843 | { | 847 | { |