| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
|---|---|
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #include "windowstyle.h" |
| 6 | #include "util/custompaths.h" |
| 7 | |
| 8 | #include <QJsonDocument> |
| 9 | |
| 10 | namespace support_file { |
| 11 | |
| 12 | namespace documents { |
| 13 | |
| 14 | inline static QJsonDocument windowStyleGlobal; |
| 15 | inline static QJsonDocument windowStyleUser; |
| 16 | bool windowStyleIsLoaded(); |
| 17 | |
| 18 | } // namespace documents |
| 19 | |
| 20 | bool documents::windowStyleIsLoaded() |
| 21 | { |
| 22 | return !windowStyleGlobal.isEmpty() && !windowStyleGlobal.isEmpty(); |
| 23 | } |
| 24 | |
| 25 | QString WindowStyle::globalPath() |
| 26 | { |
| 27 | auto result = CustomPaths::endSeparator(CustomPaths::global(CustomPaths::Configures)); |
| 28 | return result + QString("windowstyle.support"); |
| 29 | } |
| 30 | |
| 31 | QString WindowStyle::userPath() |
| 32 | { |
| 33 | auto result = CustomPaths::endSeparator(CustomPaths::user(CustomPaths::Configures)); |
| 34 | return result + QString("windowstyle.support"); |
| 35 | } |
| 36 | |
| 37 | } // namespace support_file |
| 38 |