diff --git a/krita/main.cc b/krita/main.cc index a3a3df3ab45..f9729c42df0 100644 --- a/krita/main.cc +++ b/krita/main.cc @@ -1,77 +1,88 @@ /* * main.cc - part of KImageShop * * Copyright (c) 1999 Matthias Elter * Copyright (c) 2002 Patrick Julien * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software */ #include #include #include #include +#include +#include +#include #include #include #include #include #include #include "data/splash/splash_screen.xpm" #include "ui/kis_aboutdata.h" extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { #ifdef Q_WS_X11 setenv("QT_NO_GLIB", "1", true); #endif int state; KAboutData *aboutData = newKritaAboutData(); KCmdLineArgs::init(argc, argv, aboutData); KCmdLineOptions options; options.add("+[file(s)]", ki18n("File(s) or URL(s) to open")); KCmdLineArgs::addCmdLineOptions(options); // first create the application so we can create a pixmap KoApplication app; // then create the pixmap from an xpm: we cannot get the // location of our datadir before we've started our components, // so use an xpm. QPixmap pm(splash_screen_xpm); QSplashScreen *splash = new KSplashScreen(pm); app.setSplashScreen(splash); if (!app.start()) { return 1; } // now save some memory. app.setSplashScreen(0); delete splash; state = app.exec(); delete aboutData; +#ifdef Q_OS_WIN + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + QDir appdir(app.applicationDirPath()); + //const QString path = KStandardDirs::findExe( QLatin1String("kdeinit4" ) ); + Q_ASSERT(QFile(appdir.canonicalPath() + "kdeinit4.exe").exists()); + QProcess::startDetached(appdir.canonicalPath() + "kdeinit4 --terminate"); +#endif + return state; }