summaryrefslogtreecommitdiff
path: root/library
authorzecke <zecke>2002-09-25 18:15:58 (UTC)
committer zecke <zecke>2002-09-25 18:15:58 (UTC)
commitc96507591791d48a6d6dad3de6c15739c84e1c93 (patch) (unidiff)
treef5476860497023dd6d9e1c82c61cc6bb3f61a6da /library
parentd44c455b86d6cccbc497e3e8d8aa399096eff7db (diff)
downloadopie-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
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp6
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
@@ -787,49 +787,53 @@ QPEApplication::~QPEApplication()
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*/
796QString QPEApplication::qpeDir() 796QString 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*/
809QString QPEApplication::documentDir() 809QString 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
814static int deforient = -1; 818static int deforient = -1;
815 819
816/*! 820/*!
817 \internal 821 \internal
818*/ 822*/
819int QPEApplication::defaultRotation() 823int 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 }