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 <assert.h>
|
||||
|
||||
DString::DString()
|
||||
{
|
||||
|
||||
@ -35,9 +33,11 @@ DString::~DString()
|
||||
|
||||
std::vector<std::string> DString::splitChars(const char *cs, char c)
|
||||
{
|
||||
assert(cs);
|
||||
|
||||
std::vector<std::string> ret;
|
||||
if (!cs) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned long idx = 0;
|
||||
unsigned long size = strlen(cs);
|
||||
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)
|
||||
{
|
||||
assert(chars);
|
||||
assert(prefix);
|
||||
if (!chars || !prefix) {
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t len;
|
||||
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)
|
||||
{
|
||||
assert(chars);
|
||||
assert(suffix);
|
||||
if (!chars || !suffix) {
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t charsLen = strlen(chars);
|
||||
size_t suffixLen = strlen(suffix);
|
||||
|
@ -22,18 +22,17 @@
|
||||
#include "docksettings.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <DConfig>
|
||||
#include <QDebug>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
#include <DConfig>
|
||||
|
||||
DCORE_USE_NAMESPACE
|
||||
|
||||
static DConfig *dockSettings = Settings::ConfigPtr(configDock);
|
||||
static DConfig *appearanceSettings = Settings::ConfigPtr(configAppearance);
|
||||
|
||||
DockSettings::DockSettings(QObject *parent)
|
||||
: QObject (parent)
|
||||
, dockSettings(Settings::ConfigPtr(configDock))
|
||||
, appearanceSettings(Settings::ConfigPtr(configAppearance))
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
@ -187,6 +187,13 @@ public:
|
||||
};
|
||||
|
||||
class Settings;
|
||||
namespace Dtk {
|
||||
namespace Core {
|
||||
class DConfig;
|
||||
}
|
||||
}
|
||||
|
||||
using namespace Dtk::Core;
|
||||
|
||||
// 任务栏组策略配置类
|
||||
class DockSettings: public QObject
|
||||
@ -246,6 +253,9 @@ private:
|
||||
DockSettings(QObject *paret = nullptr);
|
||||
DockSettings(const DockSettings &);
|
||||
DockSettings& operator= (const DockSettings &);
|
||||
|
||||
DConfig *dockSettings;
|
||||
DConfig *appearanceSettings;
|
||||
};
|
||||
|
||||
#endif // DOCKSETTINGS_H
|
||||
|
@ -22,17 +22,16 @@
|
||||
#include "launchersettings.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <DConfig>
|
||||
#include <QDebug>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
#include <DConfig>
|
||||
|
||||
DCORE_USE_NAMESPACE
|
||||
|
||||
static DConfig *dconfig = Settings::ConfigPtr(configLauncher);
|
||||
|
||||
LauncherSettings::LauncherSettings(QObject *parent)
|
||||
: QObject(parent)
|
||||
, dconfig(Settings::ConfigPtr(configLauncher))
|
||||
{
|
||||
// 绑定属性
|
||||
connect(dconfig, &DConfig::valueChanged, this, [&] (const QString &key) {
|
||||
|
@ -27,6 +27,14 @@
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
|
||||
namespace Dtk {
|
||||
namespace Core {
|
||||
class DConfig;
|
||||
}
|
||||
}
|
||||
|
||||
using namespace Dtk::Core;
|
||||
|
||||
// 启动器相关配置
|
||||
class LauncherSettings : public QObject
|
||||
{
|
||||
@ -34,6 +42,7 @@ class LauncherSettings : public QObject
|
||||
LauncherSettings(QObject *paret = nullptr);
|
||||
LauncherSettings(const LauncherSettings &);
|
||||
LauncherSettings& operator= (const LauncherSettings &);
|
||||
DConfig *dconfig;
|
||||
|
||||
public:
|
||||
static inline LauncherSettings *instance() {
|
||||
|
@ -23,16 +23,21 @@
|
||||
#include "settings.h"
|
||||
#include "gsetting.h"
|
||||
|
||||
#include <DConfig>
|
||||
#include <QDebug>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
#include <DConfig>
|
||||
|
||||
DCORE_USE_NAMESPACE
|
||||
|
||||
static DConfig *launchConfig = Settings::ConfigPtr(configLauncher);
|
||||
static DConfig *startConfig = Settings::ConfigPtr(configStartdde);
|
||||
static DConfig *xsettingsConfig = Settings::ConfigPtr(configXsettings);
|
||||
StartManagerSettings::StartManagerSettings(QObject *parent)
|
||||
: QObject (parent)
|
||||
, launchConfig(Settings::ConfigPtr(configLauncher))
|
||||
, startConfig(Settings::ConfigPtr(configStartdde))
|
||||
, xsettingsConfig(Settings::ConfigPtr(configXsettings))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QVector<QString> StartManagerSettings::getUseProxyApps()
|
||||
{
|
||||
@ -101,8 +106,3 @@ QString StartManagerSettings::getDefaultTerminalExecArg()
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
StartManagerSettings::StartManagerSettings(QObject *paret)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -28,10 +28,17 @@
|
||||
#include "common.h"
|
||||
#include "gsetting.h"
|
||||
|
||||
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
|
||||
namespace Dtk {
|
||||
namespace Core {
|
||||
class DConfig;
|
||||
}
|
||||
}
|
||||
|
||||
using namespace Dtk::Core;
|
||||
|
||||
class StartManagerSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -54,9 +61,13 @@ public:
|
||||
Q_SIGNALS:
|
||||
|
||||
private:
|
||||
StartManagerSettings(QObject *paret = nullptr);
|
||||
StartManagerSettings(QObject *parent = nullptr);
|
||||
StartManagerSettings(const StartManagerSettings &);
|
||||
StartManagerSettings& operator= (const StartManagerSettings &);
|
||||
|
||||
DConfig *launchConfig;
|
||||
DConfig *startConfig;
|
||||
DConfig *xsettingsConfig;
|
||||
};
|
||||
|
||||
#endif // STARTMANAGERSETTINGS_H
|
||||
|
Loading…
Reference in New Issue
Block a user