From e70acff8b5cf8b266cc98bec13bec6385279928e Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Tue, 24 Oct 2023 12:54:07 +0100 Subject: [PATCH] Remove PaletteChangeNotifier --- source/shared/CMakeLists.txt | 2 - source/shared/utils/palettechangenotifier.cpp | 43 ------------------- source/shared/utils/palettechangenotifier.h | 39 ----------------- 3 files changed, 84 deletions(-) delete mode 100644 source/shared/utils/palettechangenotifier.cpp delete mode 100644 source/shared/utils/palettechangenotifier.h diff --git a/source/shared/CMakeLists.txt b/source/shared/CMakeLists.txt index 6e953bbc7..244dbde03 100644 --- a/source/shared/CMakeLists.txt +++ b/source/shared/CMakeLists.txt @@ -103,7 +103,6 @@ list(APPEND HEADERS ${CMAKE_CURRENT_LIST_DIR}/utils/movablepointer.h ${CMAKE_CURRENT_LIST_DIR}/utils/msvcwarningsuppress.h ${CMAKE_CURRENT_LIST_DIR}/utils/pair_iterator.h - ${CMAKE_CURRENT_LIST_DIR}/utils/palettechangenotifier.h ${CMAKE_CURRENT_LIST_DIR}/utils/passkey.h ${CMAKE_CURRENT_LIST_DIR}/utils/performancecounter.h ${CMAKE_CURRENT_LIST_DIR}/utils/preferences.h @@ -169,7 +168,6 @@ list(APPEND SHARED_SOURCES ${CMAKE_CURRENT_LIST_DIR}/utils/failurereason.cpp ${CMAKE_CURRENT_LIST_DIR}/utils/macosfileopeneventfilter.cpp ${CMAKE_CURRENT_LIST_DIR}/utils/modelcompleter.cpp - ${CMAKE_CURRENT_LIST_DIR}/utils/palettechangenotifier.cpp ${CMAKE_CURRENT_LIST_DIR}/utils/performancecounter.cpp ${CMAKE_CURRENT_LIST_DIR}/utils/qmlcontrolcolors.cpp ${CMAKE_CURRENT_LIST_DIR}/utils/random.cpp diff --git a/source/shared/utils/palettechangenotifier.cpp b/source/shared/utils/palettechangenotifier.cpp deleted file mode 100644 index cbee26082..000000000 --- a/source/shared/utils/palettechangenotifier.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright © 2013-2023 Graphia Technologies Ltd. - * - * This file is part of Graphia. - * - * Graphia 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 3 of the License, or - * (at your option) any later version. - * - * Graphia 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 Graphia. If not, see . - */ - -#include "palettechangenotifier.h" - -#include "shared/utils/static_block.h" - -#include -#include - -PaletteChangeNotifier::PaletteChangeNotifier(QQuickItem* parent) : QQuickItem(parent) -{} - -bool PaletteChangeNotifier::event(QEvent* event) -{ - if(event->type() == QEvent::ApplicationPaletteChange) - { - emit paletteChanged(); - return true; - } - - return QObject::event(event); -} - -static_block -{ - qmlRegisterType(APP_URI, APP_MAJOR_VERSION, APP_MINOR_VERSION, "PaletteChangeNotifier"); -} diff --git a/source/shared/utils/palettechangenotifier.h b/source/shared/utils/palettechangenotifier.h deleted file mode 100644 index bcc88abba..000000000 --- a/source/shared/utils/palettechangenotifier.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright © 2013-2023 Graphia Technologies Ltd. - * - * This file is part of Graphia. - * - * Graphia 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 3 of the License, or - * (at your option) any later version. - * - * Graphia 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 Graphia. If not, see . - */ - -#ifndef PALETTECHANGENOTIFIER_H -#define PALETTECHANGENOTIFIER_H - -#include -#include - -class PaletteChangeNotifier : public QQuickItem -{ - Q_OBJECT - -public: - explicit PaletteChangeNotifier(QQuickItem* parent = nullptr); - -signals: - void paletteChanged(); - -protected: - bool event(QEvent* event) override; -}; - -#endif // PALETTECHANGENOTIFIER_H