X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/5acfb27760f3da1d4f794e820008f8a4c8ff7533..f5fd8e5cfb43deb1ccb0fef76e335afbde088965:/src/main.cpp diff --git a/src/main.cpp b/src/main.cpp index cbfc6b72f..b4ca2c6af 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,10 +19,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ +#include "dolphin_version.h" #include "dolphinmainwindow.h" #include "dolphin_generalsettings.h" #include "dbusinterface.h" #include "global.h" +#include "dolphindebug.h" #include #include @@ -30,21 +32,20 @@ #include #include #include -#include "dolphindebug.h" -#include +#include extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) { QApplication app(argc, argv); app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); + app.setWindowIcon(QIcon::fromTheme("system-file-manager")); + Kdelibs4ConfigMigrator migrate(QStringLiteral("dolphin")); migrate.setConfigFiles(QStringList() << QStringLiteral("dolphinrc")); migrate.setUiFiles(QStringList() << QStringLiteral("dolphinpart.rc") << QStringLiteral("dolphinui.rc")); migrate.migrate(); - app.setWindowIcon(QIcon::fromTheme("system-file-manager")); - - KAboutData aboutData("dolphin", i18n("Dolphin"), "14.12.95", + KAboutData aboutData("dolphin", i18n("Dolphin"), QStringLiteral(DOLPHIN_VERSION_STRING), i18nc("@title", "File Manager"), KAboutLicense::GPL, i18nc("@info:credit", "(C) 2006-2014 Peter Penz, Frank Reininghaus, and Emmanuel Pescosta")); @@ -107,9 +108,6 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) return app.exec(); } - DolphinMainWindow* m_mainWindow = new DolphinMainWindow(); - m_mainWindow->setAttribute(Qt::WA_DeleteOnClose); - const QStringList args = parser.positionalArguments(); QList urls = Dolphin::validateUris(args); @@ -125,18 +123,21 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) urls.append(urls.last()); } + DolphinMainWindow* mainWindow = new DolphinMainWindow(); + mainWindow->setAttribute(Qt::WA_DeleteOnClose); + if (parser.isSet("select")) { - m_mainWindow->openFiles(urls, splitView); + mainWindow->openFiles(urls, splitView); } else { - m_mainWindow->openDirectories(urls, splitView); + mainWindow->openDirectories(urls, splitView); } - m_mainWindow->show(); + mainWindow->show(); if (app.isSessionRestored()) { const QString className = KXmlGuiWindow::classNameOfToplevel(1); if (className == QLatin1String("DolphinMainWindow")) { - m_mainWindow->restore(1); + mainWindow->restore(1); } else { qCWarning(DolphinDebug) << "Unknown class " << className << " in session saved data!"; }