mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Move from a C++ library + QML plugin to a QML plugin only for simplicity, since the homescreen switching architecture will be done from Plasma, and so use of the shell library only needs to be from QML.
37 lines
818 B
C++
37 lines
818 B
C++
/*
|
|
* SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
|
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
|
|
#include <KConfigWatcher>
|
|
#include <KSharedConfig>
|
|
|
|
class ShellUtil : public QObject
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(bool isSystem24HourFormat READ isSystem24HourFormat NOTIFY isSystem24HourFormatChanged);
|
|
|
|
public:
|
|
ShellUtil(QObject *parent = nullptr);
|
|
~ShellUtil() override;
|
|
static ShellUtil *instance();
|
|
|
|
public Q_SLOTS:
|
|
void executeCommand(const QString &command);
|
|
void launchApp(const QString &app);
|
|
|
|
bool isSystem24HourFormat();
|
|
|
|
Q_SIGNALS:
|
|
void isSystem24HourFormatChanged();
|
|
|
|
private:
|
|
KConfigWatcher::Ptr m_localeConfigWatcher;
|
|
KSharedConfig::Ptr m_localeConfig;
|
|
};
|