屏保崩溃问题修复
This commit is contained in:
parent
367492e0dc
commit
526a633b61
|
@ -147,19 +147,24 @@ QString SCConfiguration::getDefaultBackground()
|
||||||
if(ispicture(backgroundFile)) {
|
if(ispicture(backgroundFile)) {
|
||||||
return backgroundFile;
|
return backgroundFile;
|
||||||
} else {
|
} else {
|
||||||
|
QString defaultBackground;
|
||||||
#ifdef KDKINFO_FOUND
|
#ifdef KDKINFO_FOUND
|
||||||
char *systemName = kdk_system_get_systemName();
|
char *systemName = nullptr; // 初始化为 nullptr
|
||||||
#else
|
systemName = kdk_system_get_systemName();
|
||||||
char *systemName = "none";
|
|
||||||
#endif
|
|
||||||
if (systemName) {
|
if (systemName) {
|
||||||
if (QString(systemName) == "openKylin") {
|
if (QString(systemName) == "openKylin") {
|
||||||
free(systemName);
|
defaultBackground = "/usr/share/backgrounds/1-openkylin.jpg";
|
||||||
return "/usr/share/backgrounds/1-openkylin.jpg";
|
} else {
|
||||||
|
defaultBackground = "/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg";
|
||||||
}
|
}
|
||||||
free(systemName);
|
} else {
|
||||||
|
defaultBackground = "/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg";
|
||||||
}
|
}
|
||||||
return "/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg";
|
free(systemName);
|
||||||
|
#else
|
||||||
|
defaultBackground = "/usr/share/backgrounds/1-openkylin.jpg";
|
||||||
|
#endif
|
||||||
|
return defaultBackground;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue