fix bug caused by changing the file path

This commit is contained in:
likehomedream 2023-10-30 10:51:14 +08:00
parent f6e3b3286b
commit 5e885ea339
2 changed files with 7 additions and 7 deletions

View File

@ -17,7 +17,7 @@ HistoryInfoLoad::HistoryInfoLoad(const QString &date, QObject *parent)
QString HistoryInfoLoad::getCover() QString HistoryInfoLoad::getCover()
{ {
QString filePath = m_historyInfo.filepath + "/config/preview"; QString filePath = m_historyInfo.filepath + "/src/config/preview";
QString previewFilePath; QString previewFilePath;
QFileInfo pngFileInfo(filePath + ".png"); QFileInfo pngFileInfo(filePath + ".png");
@ -37,7 +37,7 @@ QString HistoryInfoLoad::getCover()
QString HistoryInfoLoad::getThemeName() QString HistoryInfoLoad::getThemeName()
{ {
QString filePath = m_historyInfo.filepath + "/debian/control"; QString filePath = m_historyInfo.filepath + "/src/debian/control";
QFile file(filePath); QFile file(filePath);
if (file.exists() && file.open(QIODevice::ReadOnly)) { if (file.exists() && file.open(QIODevice::ReadOnly)) {
@ -64,7 +64,7 @@ QString HistoryInfoLoad::getThemeName()
QString HistoryInfoLoad::getThemeType() QString HistoryInfoLoad::getThemeType()
{ {
QString filePath = m_historyInfo.filepath; QString filePath = m_historyInfo.filepath + "/src";
QDir themeDir(filePath); QDir themeDir(filePath);
if (themeDir.exists("globalTheme")) { if (themeDir.exists("globalTheme")) {
@ -81,7 +81,7 @@ QString HistoryInfoLoad::getThemeType()
void HistoryInfoLoad::getRadius() void HistoryInfoLoad::getRadius()
{ {
QString filePath = m_historyInfo.filepath + "/config/default.json"; QString filePath = m_historyInfo.filepath + "/src/config/default.json";
QFile file(filePath); QFile file(filePath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
@ -110,7 +110,7 @@ void HistoryInfoLoad::getRadius()
void HistoryInfoLoad::getWallpaper() void HistoryInfoLoad::getWallpaper()
{ {
QString filePath = m_historyInfo.filepath + "/config/theme.conf"; QString filePath = m_historyInfo.filepath + "/src/config/theme.conf";
// 读取文件内容 // 读取文件内容
QFile file(filePath); QFile file(filePath);
if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) { if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) {
@ -142,7 +142,7 @@ void HistoryInfoLoad::getWallpaper()
void HistoryInfoLoad::getAccentColor() void HistoryInfoLoad::getAccentColor()
{ {
QString filePath = m_historyInfo.filepath + "/config/theme.conf"; QString filePath = m_historyInfo.filepath + "/src/config/theme.conf";
// 读取文件内容 // 读取文件内容
QFile file(filePath); QFile file(filePath);
if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) { if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) {

View File

@ -301,7 +301,7 @@ QMap<QString, QString>* IconThemeWidget::getAppIconsMap()
void IconThemeWidget::setHistoryAppIcon() void IconThemeWidget::setHistoryAppIcon()
{ {
QString directoryPath = m_info.filepath + "/iconTheme/appicon/"; QString directoryPath = m_info.filepath + "/src/iconTheme/appicon/";
// QStringList widgetNames = getWidgetNamesFromFilesInDirectory(directoryPath); // QStringList widgetNames = getWidgetNamesFromFilesInDirectory(directoryPath);
QDir directory(directoryPath); QDir directory(directoryPath);
QStringList filters; QStringList filters;