diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e46d56..cc3d1e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,8 +29,6 @@ pkg_search_module(ICU REQUIRED icu-i18n) include_directories(${ICU_INCLUDE_DIRS}) set(SRCS - src/cscreenmanager.cpp - src/cscreenoutput.cpp src/application.cpp src/main.cpp src/appearance.cpp diff --git a/debian/control b/debian/control index 8a168be..c8ed97c 100644 --- a/debian/control +++ b/debian/control @@ -38,7 +38,6 @@ Depends: qml6-module-qtquick-controls, bluedevil, fishui, libcutefish, - kscreen, ${misc:Depends}, ${shlibs:Depends} Description: CutefishOS Settings diff --git a/src/cscreenmanager.cpp b/src/cscreenmanager.cpp deleted file mode 100644 index b6b6e7a..0000000 --- a/src/cscreenmanager.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "cscreenmanager.h" - -#include -#include - -CScreenManager::CScreenManager(QObject *parent) - : QObject(parent) - , m_lastOutputId(-1) -{ - for (const QScreen *qscreen : QGuiApplication::screens()) { - screenAdded(qscreen); - } - - connect(qApp, &QGuiApplication::screenAdded, this, &CScreenManager::screenAdded); - connect(qApp, &QGuiApplication::screenRemoved, this, &CScreenManager::screenRemoved); -} - -QMap CScreenManager::outputMap() const -{ - return m_outputMap; -} - -int CScreenManager::outputId(const QScreen *qscreen) -{ - QList ids; - for (auto output : qAsConst(m_outputMap)) { - if (qscreen == output->qscreen()) { - return output->id(); - } - } - m_lastOutputId++; - return m_lastOutputId; -} - -void CScreenManager::screenAdded(const QScreen *qscreen) -{ - CScreenOutput *output = new CScreenOutput; - output->setId(outputId(qscreen)); - output->setName(qscreen->name()); - m_outputMap.insert(output->id(), output); - -// if (!m_blockSignals) { -// Q_EMIT configChanged(toKScreenConfig()); -// } -} - -void CScreenManager::screenRemoved(QScreen *qscreen) -{ - int removedOutputId = -1; - - for (auto output : m_outputMap) { - if (output->qscreen() == qscreen) { - removedOutputId = output->id(); - m_outputMap.remove(removedOutputId); - delete output; - } - } - - // Q_EMIT configChanged(toKScreenConfig()); -} diff --git a/src/cscreenmanager.h b/src/cscreenmanager.h deleted file mode 100644 index 2a2b8d1..0000000 --- a/src/cscreenmanager.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef CSCREENMANAGER_H -#define CSCREENMANAGER_H - -#include -#include -#include - -#include "cscreenoutput.h" - -class CScreenManager : public QObject -{ - Q_OBJECT - -public: - explicit CScreenManager(QObject *parent = nullptr); - - QMap outputMap() const; - int outputId(const QScreen *qscreen); - -private slots: - void screenAdded(const QScreen *qscreen); - void screenRemoved(QScreen *qscreen); - -private: - QMap m_outputMap; - int m_lastOutputId; -}; - -#endif // CSCREENMANAGER_H diff --git a/src/cscreenoutput.cpp b/src/cscreenoutput.cpp deleted file mode 100644 index a251865..0000000 --- a/src/cscreenoutput.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include "cscreenoutput.h" - -CScreenOutput::CScreenOutput(QObject *parent) - : QObject(parent) -{ - -} - -int CScreenOutput::id() const -{ - return m_id; -} - -void CScreenOutput::setId(int id) -{ - if (id != m_id) { - m_id = id; - emit outputChanged(); - } -} - -QString CScreenOutput::name() const -{ - return m_name; -} - -void CScreenOutput::setName(QString name) -{ - if (name != m_name) { - m_name = name; - emit outputChanged(); - } -} - -QString CScreenOutput::hash() const -{ - return QString(); -} - -CScreenOutput::Rotation CScreenOutput::rotation() const -{ - return m_rotation; -} - -void CScreenOutput::setRotation(const Rotation &rotation) -{ - if (rotation != m_rotation) { - m_rotation = rotation; - emit rotationChanged(); - } -} - -bool CScreenOutput::connected() const -{ - return m_connected; -} - -void CScreenOutput::setConnected(bool connected) -{ - if (connected != m_connected) { - m_connected = connected; - emit connectedChanged(); - } -} - -bool CScreenOutput::primary() const -{ - return m_primary; -} - -void CScreenOutput::setPrimary(bool primary) -{ - if (primary != m_primary) { - m_primary = primary; - emit primaryChanged(); - } -} - -bool CScreenOutput::enabled() const -{ - return m_enabled; -} - -void CScreenOutput::setEnabled(bool enabled) -{ - if (enabled != m_enabled) { - m_enabled = enabled; - emit enabledChanged(); - } -} - -const QScreen *CScreenOutput::qscreen() const -{ - return m_qscreen; -} diff --git a/src/cscreenoutput.h b/src/cscreenoutput.h deleted file mode 100644 index 8abfa48..0000000 --- a/src/cscreenoutput.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef CSCREENOUTPUT_H -#define CSCREENOUTPUT_H - -#include -#include - -class CScreenOutput : public QObject -{ - Q_OBJECT - Q_PROPERTY(int id READ id CONSTANT) - Q_PROPERTY(QString name READ name WRITE setName NOTIFY outputChanged) - Q_PROPERTY(Rotation rotation READ rotation WRITE setRotation NOTIFY rotationChanged) - Q_PROPERTY(bool connected READ connected WRITE setConnected NOTIFY connectedChanged) - Q_PROPERTY(bool primary READ primary WRITE setPrimary NOTIFY primaryChanged) - Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) - -public: - enum Rotation { - None = 1, - Left = 2, - Inverted = 4, - Right = 8, - }; - Q_ENUM(Rotation); - - explicit CScreenOutput(QObject *parent = nullptr); - - int id() const; - void setId(int id); - - QString name() const; - void setName(QString name); - - QString hash() const; - - Rotation rotation() const; - void setRotation(const Rotation &rotation); - - bool connected() const; - void setConnected(bool connected); - - bool primary() const; - void setPrimary(bool primary); - - bool enabled() const; - void setEnabled(bool enabled); - - const QScreen *qscreen() const; - -signals: - void outputChanged(); - void rotationChanged(); - void primaryChanged(); - void enabledChanged(); - void connectedChanged(); - -private: - int m_id; - QString m_name; - QString m_hash; - Rotation m_rotation; - bool m_connected; - bool m_primary; - bool m_enabled; - - QScreen *m_qscreen; -}; - -#endif // CSCREENOUTPUT_H