fix: 修复V23环境下AM崩溃问题
修复V23环境下AM崩溃问题 Log: Task: https://pms.uniontech.com/task-view-144473.html Influence: AM正常运行 Change-Id: I07ee273d5105a51deb056821be315371312bdc16
This commit is contained in:
parent
a74c02d4c5
commit
290a45c6e8
@ -21,8 +21,6 @@
|
|||||||
|
|
||||||
#include "dstring.h"
|
#include "dstring.h"
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
DString::DString()
|
DString::DString()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -35,9 +33,11 @@ DString::~DString()
|
|||||||
|
|
||||||
std::vector<std::string> DString::splitChars(const char *cs, char c)
|
std::vector<std::string> DString::splitChars(const char *cs, char c)
|
||||||
{
|
{
|
||||||
assert(cs);
|
|
||||||
|
|
||||||
std::vector<std::string> ret;
|
std::vector<std::string> ret;
|
||||||
|
if (!cs) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned long idx = 0;
|
unsigned long idx = 0;
|
||||||
unsigned long size = strlen(cs);
|
unsigned long size = strlen(cs);
|
||||||
bool found = false;
|
bool found = false;
|
||||||
@ -90,8 +90,9 @@ std::vector<std::string> DString::splitVectorChars(const std::vector<char> &cont
|
|||||||
|
|
||||||
bool DString::startWith(const char *chars, const char *prefix)
|
bool DString::startWith(const char *chars, const char *prefix)
|
||||||
{
|
{
|
||||||
assert(chars);
|
if (!chars || !prefix) {
|
||||||
assert(prefix);
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
size_t len;
|
size_t len;
|
||||||
len = strlen(prefix);
|
len = strlen(prefix);
|
||||||
@ -105,8 +106,9 @@ bool DString::startWith(const std::string &str, const std::string &prefix)
|
|||||||
|
|
||||||
bool DString::endWith(const char *chars, const char *suffix)
|
bool DString::endWith(const char *chars, const char *suffix)
|
||||||
{
|
{
|
||||||
assert(chars);
|
if (!chars || !suffix) {
|
||||||
assert(suffix);
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
size_t charsLen = strlen(chars);
|
size_t charsLen = strlen(chars);
|
||||||
size_t suffixLen = strlen(suffix);
|
size_t suffixLen = strlen(suffix);
|
||||||
|
@ -22,18 +22,17 @@
|
|||||||
#include "docksettings.h"
|
#include "docksettings.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
#include <DConfig>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
#include <DConfig>
|
||||||
|
|
||||||
DCORE_USE_NAMESPACE
|
DCORE_USE_NAMESPACE
|
||||||
|
|
||||||
static DConfig *dockSettings = Settings::ConfigPtr(configDock);
|
|
||||||
static DConfig *appearanceSettings = Settings::ConfigPtr(configAppearance);
|
|
||||||
|
|
||||||
DockSettings::DockSettings(QObject *parent)
|
DockSettings::DockSettings(QObject *parent)
|
||||||
: QObject (parent)
|
: QObject (parent)
|
||||||
|
, dockSettings(Settings::ConfigPtr(configDock))
|
||||||
|
, appearanceSettings(Settings::ConfigPtr(configAppearance))
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
@ -187,6 +187,13 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
class Settings;
|
class Settings;
|
||||||
|
namespace Dtk {
|
||||||
|
namespace Core {
|
||||||
|
class DConfig;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
using namespace Dtk::Core;
|
||||||
|
|
||||||
// 任务栏组策略配置类
|
// 任务栏组策略配置类
|
||||||
class DockSettings: public QObject
|
class DockSettings: public QObject
|
||||||
@ -246,6 +253,9 @@ private:
|
|||||||
DockSettings(QObject *paret = nullptr);
|
DockSettings(QObject *paret = nullptr);
|
||||||
DockSettings(const DockSettings &);
|
DockSettings(const DockSettings &);
|
||||||
DockSettings& operator= (const DockSettings &);
|
DockSettings& operator= (const DockSettings &);
|
||||||
|
|
||||||
|
DConfig *dockSettings;
|
||||||
|
DConfig *appearanceSettings;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DOCKSETTINGS_H
|
#endif // DOCKSETTINGS_H
|
||||||
|
@ -22,17 +22,16 @@
|
|||||||
#include "launchersettings.h"
|
#include "launchersettings.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
#include <DConfig>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
#include <DConfig>
|
||||||
|
|
||||||
DCORE_USE_NAMESPACE
|
DCORE_USE_NAMESPACE
|
||||||
|
|
||||||
static DConfig *dconfig = Settings::ConfigPtr(configLauncher);
|
|
||||||
|
|
||||||
LauncherSettings::LauncherSettings(QObject *parent)
|
LauncherSettings::LauncherSettings(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
, dconfig(Settings::ConfigPtr(configLauncher))
|
||||||
{
|
{
|
||||||
// 绑定属性
|
// 绑定属性
|
||||||
connect(dconfig, &DConfig::valueChanged, this, [&] (const QString &key) {
|
connect(dconfig, &DConfig::valueChanged, this, [&] (const QString &key) {
|
||||||
|
@ -27,6 +27,14 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
|
namespace Dtk {
|
||||||
|
namespace Core {
|
||||||
|
class DConfig;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
using namespace Dtk::Core;
|
||||||
|
|
||||||
// 启动器相关配置
|
// 启动器相关配置
|
||||||
class LauncherSettings : public QObject
|
class LauncherSettings : public QObject
|
||||||
{
|
{
|
||||||
@ -34,6 +42,7 @@ class LauncherSettings : public QObject
|
|||||||
LauncherSettings(QObject *paret = nullptr);
|
LauncherSettings(QObject *paret = nullptr);
|
||||||
LauncherSettings(const LauncherSettings &);
|
LauncherSettings(const LauncherSettings &);
|
||||||
LauncherSettings& operator= (const LauncherSettings &);
|
LauncherSettings& operator= (const LauncherSettings &);
|
||||||
|
DConfig *dconfig;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline LauncherSettings *instance() {
|
static inline LauncherSettings *instance() {
|
||||||
|
@ -23,16 +23,21 @@
|
|||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "gsetting.h"
|
#include "gsetting.h"
|
||||||
|
|
||||||
#include <DConfig>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
#include <DConfig>
|
||||||
|
|
||||||
DCORE_USE_NAMESPACE
|
DCORE_USE_NAMESPACE
|
||||||
|
|
||||||
static DConfig *launchConfig = Settings::ConfigPtr(configLauncher);
|
StartManagerSettings::StartManagerSettings(QObject *parent)
|
||||||
static DConfig *startConfig = Settings::ConfigPtr(configStartdde);
|
: QObject (parent)
|
||||||
static DConfig *xsettingsConfig = Settings::ConfigPtr(configXsettings);
|
, launchConfig(Settings::ConfigPtr(configLauncher))
|
||||||
|
, startConfig(Settings::ConfigPtr(configStartdde))
|
||||||
|
, xsettingsConfig(Settings::ConfigPtr(configXsettings))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
QVector<QString> StartManagerSettings::getUseProxyApps()
|
QVector<QString> StartManagerSettings::getUseProxyApps()
|
||||||
{
|
{
|
||||||
@ -101,8 +106,3 @@ QString StartManagerSettings::getDefaultTerminalExecArg()
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
StartManagerSettings::StartManagerSettings(QObject *paret)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -28,10 +28,17 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "gsetting.h"
|
#include "gsetting.h"
|
||||||
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
|
namespace Dtk {
|
||||||
|
namespace Core {
|
||||||
|
class DConfig;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
using namespace Dtk::Core;
|
||||||
|
|
||||||
class StartManagerSettings : public QObject
|
class StartManagerSettings : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -54,9 +61,13 @@ public:
|
|||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StartManagerSettings(QObject *paret = nullptr);
|
StartManagerSettings(QObject *parent = nullptr);
|
||||||
StartManagerSettings(const StartManagerSettings &);
|
StartManagerSettings(const StartManagerSettings &);
|
||||||
StartManagerSettings& operator= (const StartManagerSettings &);
|
StartManagerSettings& operator= (const StartManagerSettings &);
|
||||||
|
|
||||||
|
DConfig *launchConfig;
|
||||||
|
DConfig *startConfig;
|
||||||
|
DConfig *xsettingsConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // STARTMANAGERSETTINGS_H
|
#endif // STARTMANAGERSETTINGS_H
|
||||||
|
Loading…
Reference in New Issue
Block a user