diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -18,7 +18,7 @@ set(singleapp_SRCS ${singleapp_SRCS} qtlockedfile_unix.cpp) endif() -set(kdevelop_SRCS main.cpp kdevideextension.cpp splash.cpp) +set(kdevelop_SRCS main.cpp kdevideextension.cpp) if(KDEVELOP_SINGLE_APP) set(kdevelop_SRCS ${kdevelop_SRCS} ${singleapp_SRCS}) endif() @@ -50,8 +50,6 @@ KF5::Declarative KF5::IconThemes KF5::Crash - - Qt5::Quick ) IF(APPLE) target_link_libraries(kdevelop "-framework CoreFoundation") diff --git a/app/kdevelop.qrc b/app/kdevelop.qrc --- a/app/kdevelop.qrc +++ b/app/kdevelop.qrc @@ -1,8 +1,5 @@ - - splash.qml - kdeveloprc diff --git a/app/main.cpp b/app/main.cpp --- a/app/main.cpp +++ b/app/main.cpp @@ -75,8 +75,6 @@ #include -#include "splash.h" - #ifdef Q_OS_MAC #include #endif @@ -271,7 +269,6 @@ // Useful for valgrind runs, just `export KDEV_DISABLE_JIT=1` if (qEnvironmentVariableIsSet("KDEV_DISABLE_JIT")) { - qputenv("KDEV_DISABLE_SPLASH", "1"); qputenv("KDEV_DISABLE_WELCOMEPAGE", "1"); qputenv("QT_ENABLE_REGEXP_JIT", "0"); } @@ -612,13 +609,7 @@ KDevIDEExtension::init(); - KDevSplashScreen* splash = nullptr; - if (!QProcessEnvironment::systemEnvironment().contains("KDEV_DISABLE_SPLASH")) { - splash = new KDevSplashScreen; - splash->show(); - } - - if(!Core::initialize(splash, Core::Default, session)) + if(!Core::initialize(nullptr, Core::Default, session)) return 5; // register a DBUS service for this process, so that we can open files in it from other invocations diff --git a/app/splash.h b/app/splash.h deleted file mode 100644 --- a/app/splash.h +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - * Copyright 2013 Sven Brauch * - * Copyright 2013 Milian Wolff * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef KDEVSPLASH_H -#define KDEVSPLASH_H - -#include - -/** - * This class is draws the KDevelop splashscreen. - * - * The actualy splash design can be adapted via splash.qml - */ -class KDevSplashScreen : public QQuickView -{ - Q_OBJECT -public: - explicit KDevSplashScreen(); - ~KDevSplashScreen() override; - -public slots: - void progress(int progress); -}; - -#endif diff --git a/app/splash.cpp b/app/splash.cpp deleted file mode 100644 --- a/app/splash.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/*************************************************************************** - * Copyright 2013 Sven Brauch * - * Copyright 2013 Milian Wolff * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include "splash.h" - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "config.h" - -KDevSplashScreen::KDevSplashScreen() - : QQuickView() -{ - setFlags(Qt::FramelessWindowHint | Qt::SplashScreen); - setResizeMode(QQuickView::SizeViewToRootObject); - - setSource(QUrl(QStringLiteral("qrc:/kdevelop/splash.qml"))); - if (!rootObject()) { - qWarning() << "Could not load KDevelop splash screen"; - hide(); // hide instead of showing garbage - return; - } - - if (rootObject()) { - rootObject()->setProperty("appIcon", - QUrl::fromLocalFile(KIconLoader().iconPath("kdevelop", -48))); - rootObject()->setProperty("appVersionMajor", VERSION_MAJOR); - rootObject()->setProperty("appVersionMinor", VERSION_MINOR); - rootObject()->setProperty("appVersionPatch", VERSION_PATCH); - } - - QRect geo = geometry(); - geo.moveCenter(screen()->geometry().center()); - setGeometry(geo); -} - -KDevSplashScreen::~KDevSplashScreen() -{ -} - -void KDevSplashScreen::progress(int progress) -{ - // notify the QML script of the progress change - if (rootObject()) { - rootObject()->setProperty("progress", progress); - } - - // note: We don't have an eventloop running, hence we need to call both processEvents and sendPostedEvents here - // DeferredDelete events alone won't be processed until sendPostedEvents is called - // also see: http://osxr.org/qt/source/qtbase/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp#1401 - qApp->processEvents(QEventLoop::ExcludeUserInputEvents); - qApp->sendPostedEvents(0, QEvent::DeferredDelete); -} diff --git a/app/splash.qml b/app/splash.qml deleted file mode 100644 --- a/app/splash.qml +++ /dev/null @@ -1,156 +0,0 @@ -/*************************************************************************** - * Copyright 2013 Sven Brauch * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -import QtQuick 2.1 -import QtQuick.Layouts 1.1 - -// The background image for the splash is still a bitmap, provided by QSplashScreen. -// This widget has a transprent background and appears above that pixmap. -// Thus, if for some reason this doesn't work, the user still has a splash screen -// with a kdev logo and name. - -Rectangle { - id: root - - property int progress: 50 - property url appIcon - property string appVersionMajor: "01" - property string appVersionMinor: "23" - property string appVersionPatch: "45" - - // color for the non-colored rectangles - readonly property string defaultColor: "#3E3E3E" - // amount of rectangles in each column - readonly property var counts: [22, 20, 21, 19, 17, 19, 20, 17, 18, 15, 16, 15, 14, 16, 13, 11, 12, 10, 12, - 11, 8, 10, 6, 8, 9, 5, 7, 6, 4, 5, 6, 3, 5, 4, 2, 3, 2, 1, 2, 1] - // "active" colors for the rectangles - // only half as many colors, use each color twice. - // TODO could try if it looks nicer with one color each - readonly property var activeColors: ["#960A0A", "#B40F0F", "#FF4000", "#FF8400", "#FFDD00", "#CDEC00", "#99FF00", "#4CB700", "#1DB300", "#076813", - "#08BA5B", "#00DA99", "#00B5E7", "#085BBB", "#2A5CFF", "#7044FF", "#9625FF", "#F013FF", "#FF2CC0", "#FF1A1D"] - - gradient: Gradient { - GradientStop { position: 0.0; color: "#0A0A0A" } - GradientStop { position: 0.5; color: "#1F1F1F" } - GradientStop { position: 1.0; color: "#0A0A0A" } - } - - width: centerWidget.width + mainLayout.anchors.margins * 2 - height: centerWidget.height + mainLayout.anchors.margins * 2 - - // scanlines always look fancy - ListView { - id: background - - anchors.fill: parent - - model: Math.floor(parent.height / 2) - spacing: 2 - delegate: Rectangle { - width: root.width - height: 1 - color: "#555555" - opacity: 0.10 - } - } - - ColumnLayout { - id: centerWidget - - ColumnLayout { - id: mainLayout - - anchors.fill: parent - anchors.margins: 15 - - RowLayout { - Text { - Layout.fillWidth: true - - color: "white" - opacity: 0.65 - text: "www.kdevelop.org" - } - - Text { - color: "white" - opacity: 0.65 - text: root.progress+"%" - } - } - - Item { height: 10 } // spacer - - // draw the rectangles - Row { - Layout.alignment: Qt.AlignRight - - spacing: 4 - rotation: 180 - - Repeater { - // draw one column per entry in the root.counts list - model: root.counts - // this delegate draws one column of rectangles - delegate: Column { - readonly property string color: (1-root.progress/100.0) * root.counts.length <= index ? activeColors[Math.floor(index/2)] : root.defaultColor - readonly property int count: root.counts[index] - - opacity: 0.75 - spacing: 4 - - Repeater { - model: parent.count - delegate: Rectangle { - color: parent.color - width: 6 - height: 6 - } - } - } - } - } - - Item { height: 5 } // spacer - - RowLayout { - Image { - width: 48 - height: width - source: appIcon - } - - Text { - Layout.fillWidth: true - color: "white" - verticalAlignment: Text.AlignVCenter - font { - pointSize: 26 - bold: true - family: "sans" - } - style: Text.Raised; - styleColor: "black" - text: "KDevelop " + appVersionMajor + "." + appVersionMinor + - "." + appVersionPatch + "" - } - } - } - } -}