summaryrefslogtreecommitdiff
path: root/library
Side-by-side diff
Diffstat (limited to 'library') (more/less context) (show whitespace changes)
-rw-r--r--library/qpeapplication.cpp27
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
@@ -391,3 +391,3 @@ public:
{
- QString path = QPEApplication::qpeDir() + "/plugins/textcodecs";
+ QString path = QPEApplication::qpeDir() + "plugins/textcodecs";
#ifdef Q_OS_MACX
@@ -420,3 +420,3 @@ public:
{
- QString path = QPEApplication::qpeDir() + "/plugins/imagecodecs";
+ QString path = QPEApplication::qpeDir() + "plugins/imagecodecs";
#ifdef Q_OS_MACX
@@ -1189,7 +1189,20 @@ QString QPEApplication::qpeDir()
{
- const char * base = getenv( "OPIEDIR" );
- if ( base )
- return QString( base ) + "/";
+ QString base, dir;
+
+ if (getenv( "OPIEDIR" ))
+ base = QString(getenv("OPIEDIR")).stripWhiteSpace();
+ if ( !base.isNull() && (base.length() > 0 )){
+#ifdef Q_OS_WIN32
+ QString temp(base);
+ if (temp[(int)temp.length()-1] != QDir::separator())
+ temp.append(QDir::separator());
+ dir = temp;
+#else
+ dir = QString( base ) + "/";
+#endif
+ }else{
+ dir = QString( ".." ) + QDir::separator();
+ }
- return QString( "../" );
+ return dir;
}
@@ -1837,3 +1850,3 @@ void QPEApplication::internalSetStyle( const QString &style )
QStyle *sty = 0;
- QString path = QPEApplication::qpeDir ( ) + "/plugins/styles/";
+ QString path = QPEApplication::qpeDir ( ) + "plugins/styles/";