author | zecke <zecke> | 2004-10-15 21:04:08 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-15 21:04:08 (UTC) |
commit | 0bdebb46227ea403a07707cf0a967c8ea036e03f (patch) (unidiff) | |
tree | d6e724a055475f3938ee5a8955692209d490ba37 | |
parent | ac36bfe2794741188da1d6d4b471f96fd15d47ee (diff) | |
download | opie-0bdebb46227ea403a07707cf0a967c8ea036e03f.zip opie-0bdebb46227ea403a07707cf0a967c8ea036e03f.tar.gz opie-0bdebb46227ea403a07707cf0a967c8ea036e03f.tar.bz2 |
Make sure that qpeDir() has a QDir::seperator() as last character. This code
comes from Qtopia1.7
Conversion to it is done by myself
-rw-r--r-- | library/qpeapplication.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 3efba20..0b6d56d 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -388,9 +388,9 @@ public: | |||
388 | } | 388 | } |
389 | 389 | ||
390 | void loadTextCodecs() | 390 | void loadTextCodecs() |
391 | { | 391 | { |
392 | QString path = QPEApplication::qpeDir() + "/plugins/textcodecs"; | 392 | QString path = QPEApplication::qpeDir() + "plugins/textcodecs"; |
393 | #ifdef Q_OS_MACX | 393 | #ifdef Q_OS_MACX |
394 | QDir dir( path, "lib*.dylib" ); | 394 | QDir dir( path, "lib*.dylib" ); |
395 | #else | 395 | #else |
396 | QDir dir( path, "lib*.so" ); | 396 | QDir dir( path, "lib*.so" ); |
@@ -417,9 +417,9 @@ public: | |||
417 | } | 417 | } |
418 | 418 | ||
419 | void loadImageCodecs() | 419 | void loadImageCodecs() |
420 | { | 420 | { |
421 | QString path = QPEApplication::qpeDir() + "/plugins/imagecodecs"; | 421 | QString path = QPEApplication::qpeDir() + "plugins/imagecodecs"; |
422 | #ifdef Q_OS_MACX | 422 | #ifdef Q_OS_MACX |
423 | QDir dir( path, "lib*.dylib" ); | 423 | QDir dir( path, "lib*.dylib" ); |
424 | #else | 424 | #else |
425 | QDir dir( path, "lib*.so" ); | 425 | QDir dir( path, "lib*.so" ); |
@@ -1186,13 +1186,26 @@ QPEApplication::~QPEApplication() | |||
1186 | Returns <tt>$OPIEDIR/</tt>. | 1186 | Returns <tt>$OPIEDIR/</tt>. |
1187 | */ | 1187 | */ |
1188 | QString QPEApplication::qpeDir() | 1188 | QString QPEApplication::qpeDir() |
1189 | { | 1189 | { |
1190 | const char * base = getenv( "OPIEDIR" ); | 1190 | QString base, dir; |
1191 | if ( base ) | 1191 | |
1192 | return QString( base ) + "/"; | 1192 | if (getenv( "OPIEDIR" )) |
1193 | base = QString(getenv("OPIEDIR")).stripWhiteSpace(); | ||
1194 | if ( !base.isNull() && (base.length() > 0 )){ | ||
1195 | #ifdef Q_OS_WIN32 | ||
1196 | QString temp(base); | ||
1197 | if (temp[(int)temp.length()-1] != QDir::separator()) | ||
1198 | temp.append(QDir::separator()); | ||
1199 | dir = temp; | ||
1200 | #else | ||
1201 | dir = QString( base ) + "/"; | ||
1202 | #endif | ||
1203 | }else{ | ||
1204 | dir = QString( ".." ) + QDir::separator(); | ||
1205 | } | ||
1193 | 1206 | ||
1194 | return QString( "../" ); | 1207 | return dir; |
1195 | } | 1208 | } |
1196 | 1209 | ||
1197 | /*! | 1210 | /*! |
1198 | Returns the user's current Document directory. There is a trailing "/". | 1211 | Returns the user's current Document directory. There is a trailing "/". |
@@ -1834,9 +1847,9 @@ void QPEApplication::internalSetStyle( const QString &style ) | |||
1834 | #endif | 1847 | #endif |
1835 | 1848 | ||
1836 | else { | 1849 | else { |
1837 | QStyle *sty = 0; | 1850 | QStyle *sty = 0; |
1838 | QString path = QPEApplication::qpeDir ( ) + "/plugins/styles/"; | 1851 | QString path = QPEApplication::qpeDir ( ) + "plugins/styles/"; |
1839 | 1852 | ||
1840 | #ifdef Q_OS_MACX | 1853 | #ifdef Q_OS_MACX |
1841 | if ( style. find ( ".dylib" ) > 0 ) | 1854 | if ( style. find ( ".dylib" ) > 0 ) |
1842 | path += style; | 1855 | path += style; |