~ubuntu-branches/ubuntu/raring/calligra/raring-proposed

« back to all changes in this revision

Viewing changes to libs/main/KoApplication.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-01-15 17:26:10 UTC
  • mfrom: (1.1.17)
  • Revision ID: package-import@ubuntu.com-20130115172610-b193s9546hyssmym
Tags: 1:2.5.94-0ubuntu1
New upstream RC release

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
#include <QSplashScreen>
52
52
#include <QSysInfo>
53
53
 
 
54
#include <QDesktopServices>
 
55
#include <QProcessEnvironment>
 
56
#include <QDir>
 
57
 
 
58
#include <stdlib.h>
 
59
 
54
60
bool KoApplication::m_starting = true;
55
61
 
56
62
namespace {
141
147
 
142
148
bool KoApplication::start()
143
149
{
 
150
#ifdef Q_OS_WIN
 
151
    QDir appdir(applicationDirPath());
 
152
    appdir.cdUp();
 
153
    QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
 
154
    // If there's no kdehome, set it and restart the process.
 
155
    if (!env.contains("KDEHOME")) {
 
156
        qputenv("KDEHOME", QFile::encodeName(QDesktopServices::storageLocation(QDesktopServices::DataLocation)));
 
157
    }
 
158
    if (!env.contains("KDESYCOCA")) {
 
159
        qputenv("KDESYCOCA", QFile::encodeName(appdir.absolutePath() + "/sycoca"));
 
160
    }
 
161
    if (!env.contains("XDG_DATA_DIRS")) {
 
162
        qputenv("XDG_DATA_DIRS", QFile::encodeName(appdir.absolutePath() + "/share"));
 
163
    }
 
164
    if (!env.contains("KDEDIR")) {
 
165
        qputenv("KDEDIR", QFile::encodeName(appdir.absolutePath()));
 
166
    }
 
167
    if (!env.contains("KDEDIRS")) {
 
168
        qputenv("KDEDIRS", QFile::encodeName(appdir.absolutePath()));
 
169
    }
 
170
    qputenv("PATH", QFile::encodeName(appdir.absolutePath() + "/bin" + ";"
 
171
              + appdir.absolutePath() + "/lib" + ";"
 
172
              + appdir.absolutePath() + "/lib"  +  "/kde4" + ";"
 
173
              + appdir.absolutePath()));
 
174
#endif
 
175
 
144
176
    if (d->splashScreen) {
145
177
        d->splashScreen->show();
146
178
        d->splashScreen->showMessage(".");