X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/2ba33b9220feec8aebb8059c299e6db7265593d3..e990cbbe3fb00d4e4be42d4bbff8db74e11a2b2b:/src/main.cpp diff --git a/src/main.cpp b/src/main.cpp index 4c4d790bc..6df53b62e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -29,6 +30,11 @@ #include #endif +#define HAVE_STYLE_MANAGER __has_include() +#if HAVE_STYLE_MANAGER +#include +#endif + #include #include #include @@ -69,6 +75,13 @@ int main(int argc, char **argv) } #endif + /** + * trigger initialisation of proper icon theme + */ +#if KICONTHEMES_VERSION >= QT_VERSION_CHECK(6, 3, 0) + KIconTheme::initTheme(); +#endif + /** * enable high dpi support */ @@ -79,6 +92,21 @@ int main(int argc, char **argv) QApplication app(argc, argv); app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon())); +#if HAVE_STYLE_MANAGER + /** + * trigger initialisation of proper application style + */ + KStyleManager::initStyle(); +#else + /** + * For Windows and macOS: use Breeze if available + * Of all tested styles that works the best for us + */ +#if defined(Q_OS_MACOS) || defined(Q_OS_WIN) + QApplication::setStyle(QStringLiteral("breeze")); +#endif +#endif + KCrash::initialize(); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) @@ -245,6 +273,8 @@ int main(int argc, char **argv) } } + mainWindow->setSessionAutoSaveEnabled(GeneralSettings::rememberOpenedTabs()); + #if HAVE_KUSERFEEDBACK auto feedbackProvider = DolphinFeedbackProvider::instance(); Q_UNUSED(feedbackProvider)