范朋程 95e85b7119 fix: 添加命名空间,防止和控制中心中的类产生符号冲突
GSettingWatcher这个类在控制中心和个性化的任务栏配置插件中均存在,用命名空间进行区分

Log:
Bug: https://pms.uniontech.com/zentao/bug-view-101282.html
Influence: 控制中心闪退问题
Change-Id: If71613fcdf4d7f7f931c8df58e4aac93c7098686
2021-11-05 10:19:57 +08:00

54 lines
1.4 KiB
C++

/*
* Copyright (C) 2011 ~ 2021 Uniontech Technology Co., Ltd.
*
* Author: fanpengcheng <fanpengcheng@uniontech.com>
*
* Maintainer: fanpengcheng <fanpengcheng@uniontech.com>
*
* This program 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
* 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 General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GSETTINGWATCHER_H
#define GSETTINGWATCHER_H
#include <QObject>
#include <QHash>
#include <QMap>
class QGSettings;
class QListView;
class QStandardItem;
namespace dcc_dock_plugin {
class GSettingWatcher : public QObject
{
Q_OBJECT
public:
GSettingWatcher(const QString &baseSchemasId, const QString &module, QObject *parent = nullptr);
~GSettingWatcher();
void bind(const QString &key, QWidget *binder);
private:
void setStatus(const QString &key, QWidget *binder);
void onStatusModeChanged(const QString &key);
private:
QMultiHash<QString, QWidget *> m_map;
QGSettings *m_gsettings;
};
}
#endif // GSETTINGWATCHER_H