mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
feat: 配置项规范化
配置项规范化 Log: Influence: 无 Task: https://pms.uniontech.com/task-view-104239.html Change-Id: I1e07db653a74f2ecc36d6c82d6abc77efe6ba89a
This commit is contained in:
parent
acff30b1e8
commit
7793031f37
@ -110,7 +110,7 @@ endif ()
|
||||
## qm files
|
||||
file(GLOB QM_FILES "translations/*.qm")
|
||||
install(FILES ${QM_FILES}
|
||||
DESTINATION share/dde-dock/translations)
|
||||
DESTINATION share/org.deepin.dde.dock/translations)
|
||||
|
||||
## dev files
|
||||
install(FILES ${INTERFACES}
|
||||
@ -126,8 +126,7 @@ install(FILES gschema/com.deepin.dde.dock.module.gschema.xml
|
||||
DESTINATION share/glib-2.0/schemas)
|
||||
|
||||
#dconfig
|
||||
file(GLOB DCONFIG_FILES "configs/*.json")
|
||||
install(FILES ${DCONFIG_FILES} DESTINATION /usr/share/dsg/apps/dde-dock/configs/)
|
||||
dconfig_meta_files(APPID org.deepin.dde.dock FILES configs/org.deepin.dde.dock.json)
|
||||
|
||||
# Address Sanitizer 内存错误检测工具,打开下面的编译选项可以看到调试信息,正常运行时不需要这些信息
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fsanitize=address -O2")
|
||||
|
1
debian/dde-dock.install
vendored
1
debian/dde-dock.install
vendored
@ -10,4 +10,3 @@ usr/lib/dde-dock/plugins/system-trays
|
||||
usr/lib/dde-dock/plugins/libmultitasking.so
|
||||
usr/lib/dde-dock/plugins/libshow-desktop.so
|
||||
usr/lib/dde-dock/plugins/system-trays/libkeyboard-layout.so
|
||||
usr/share/dsg/apps/dde-dock/configs/
|
||||
|
@ -667,7 +667,7 @@ void AppItem::showPreview()
|
||||
connect(m_appPreviewTips, &PreviewContainer::requestHidePopup, this, &AppItem::onResetPreview);
|
||||
|
||||
// 预览标题显示方式的配置
|
||||
DConfig config(QString("org.deepin.dock"), QString());
|
||||
DConfig config(QString("org.deepin.dde.dock"), QString());
|
||||
if (config.isValid() && config.keyList().contains("showWindowName"))
|
||||
m_appPreviewTips->setTitleDisplayMode(config.value("showWindowName").toInt());
|
||||
|
||||
|
@ -182,7 +182,7 @@ int main(int argc, char *argv[])
|
||||
signal(SIGFPE, sig_crash);
|
||||
|
||||
app.setOrganizationName("deepin");
|
||||
app.setApplicationName("dde-dock");
|
||||
app.setApplicationName("org.deepin.dde.dock");
|
||||
app.setApplicationDisplayName("DDE Dock");
|
||||
app.setApplicationVersion("2.0");
|
||||
app.loadTranslator();
|
||||
@ -209,7 +209,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// 任务栏单进程限制
|
||||
DGuiApplicationHelper::setSingleInstanceInterval(-1);
|
||||
if (!app.setSingleInstance(QString("dde-dock_%1").arg(getuid()))) {
|
||||
if (!app.setSingleInstance(QString("org.deepin.dde.dock_%1").arg(getuid()))) {
|
||||
qDebug() << "set single instance failed!";
|
||||
return -1;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
cp ".transifexrc" ${HOME}/
|
||||
|
||||
lupdate ./ -ts -no-obsolete translations/dde-dock.ts
|
||||
lupdate ./ -ts -no-obsolete translations/org.deepin.dde.dock.ts
|
||||
lupdate ./ -ts -no-obsolete plugins/dcc-dock-plugin/translations/dcc-dock-plugin.ts
|
||||
|
||||
tx push -s -b m20
|
||||
|
@ -47,7 +47,7 @@ add_custom_target(translations ALL DEPENDS ${QM_FILES})
|
||||
install(FILES ${QM_FILES} DESTINATION share/${PLUGIN_NAME}/translations)
|
||||
|
||||
# dconfig
|
||||
file(GLOB DCONFIG_FILES "org.deepin.dock.plugin.json")
|
||||
file(GLOB DCONFIG_FILES "org.deepin.dde.dock.plugin.json")
|
||||
dconfig_meta_files(APPID dde-control-center FILES ${DCONFIG_FILES})
|
||||
|
||||
install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-control-center/modules)
|
||||
|
@ -74,7 +74,7 @@ ModuleWidget::ModuleWidget(QWidget *parent)
|
||||
, m_pluginModel(new QStandardItemModel(this))
|
||||
, m_daemonDockInter(new DBusDock("com.deepin.dde.daemon.Dock", "/com/deepin/dde/daemon/Dock", QDBusConnection::sessionBus(), this))
|
||||
, m_dockInter(new DBusInter("com.deepin.dde.Dock", "/com/deepin/dde/Dock", QDBusConnection::sessionBus(), this))
|
||||
, m_dconfigWatcher(new ConfigWatcher("org.deepin.dock.plugin", this))
|
||||
, m_dconfigWatcher(new ConfigWatcher("org.deepin.dde.dock.plugin", this))
|
||||
, m_sliderPressed(false)
|
||||
{
|
||||
//~ contents_path /personalization/Dock
|
||||
|
@ -34,7 +34,7 @@ SettingsModule::SettingsModule()
|
||||
: QObject()
|
||||
, ModuleInterface()
|
||||
, m_moduleWidget(nullptr)
|
||||
, m_config(new DConfig("org.deepin.dock.plugin", QString(), this))
|
||||
, m_config(new DConfig("org.deepin.dde.dock.plugin", QString(), this))
|
||||
{
|
||||
QTranslator *translator = new QTranslator(this);
|
||||
translator->load(QString("/usr/share/dcc-dock-plugin/translations/dcc-dock-plugin_%1.qm").arg(QLocale::system().name()));
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "config_watcher.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QApplication>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
@ -11,7 +12,9 @@ class Test_GSettingWatcher : public QObject, public ::testing::Test
|
||||
|
||||
TEST_F(Test_GSettingWatcher, bind)
|
||||
{
|
||||
ConfigWatcher watcher("org.deepin.dock.plugin");
|
||||
const QString &appName = qApp->applicationName();
|
||||
qApp->setApplicationName("dde-dock");
|
||||
ConfigWatcher watcher("org.deepin.dde.dock.plugin");
|
||||
|
||||
QWidget widget;
|
||||
watcher.bind("dockPlugins", &widget);
|
||||
@ -19,20 +22,24 @@ TEST_F(Test_GSettingWatcher, bind)
|
||||
watcher.bind("invalid", &widget);
|
||||
watcher.bind("", &widget);
|
||||
watcher.bind("", nullptr);
|
||||
qApp->setApplicationName(appName);
|
||||
}
|
||||
|
||||
TEST_F(Test_GSettingWatcher, setStatus)
|
||||
{
|
||||
ConfigWatcher watcher("org.deepin.dock.plugin");
|
||||
const QString &appName = qApp->applicationName();
|
||||
qApp->setApplicationName("dde-control-center");
|
||||
ConfigWatcher watcher("org.deepin.dde.dock.plugin");
|
||||
|
||||
QWidget widget;
|
||||
watcher.bind("dockPlugins", &widget);
|
||||
watcher.setStatus("dockPlugins", &widget);
|
||||
qApp->setApplicationName(appName);
|
||||
}
|
||||
|
||||
TEST_F(Test_GSettingWatcher, onStatusModeChanged)
|
||||
{
|
||||
ConfigWatcher watcher("org.deepin.dock.plugin");
|
||||
ConfigWatcher watcher("org.deepin.dde.dock.plugin");
|
||||
|
||||
QWidget widget;
|
||||
watcher.bind("dockPlugins", &widget);
|
||||
|
Loading…
x
Reference in New Issue
Block a user