fix some bug

This commit is contained in:
likehomedream 2023-12-14 18:09:26 +08:00
parent 4b6adb7b30
commit cc000dbda6
5 changed files with 5 additions and 13 deletions

View File

@ -27,9 +27,9 @@ buildWidget::buildWidget(QWidget *parent)
if(m_buildProgressBar->value()==100){
this->close();
//拷贝deb包至用户目录中
QString sourceDirPath = FileProcess::g_debPath;
QString sourceDirPath = QDir::homePath()+"/.cache/theme-build/"+FileProcess::g_date;
QDir sourceDir = sourceDirPath;
QDir homePath =QDir::homePath();
QDir homePath =FileProcess::g_debPath;
QStringList debFiles = sourceDir.entryList(QStringList() << "*.deb", QDir::Files);
// 遍历文件列表并复制文件到目标目录

View File

@ -89,6 +89,7 @@ bool ConfigFileManager::createSavePathConfig()
QTextStream stream(&file);
stream << QDir::homePath() + "/桌面";
file.close();
FileProcess::g_debPath = QDir::homePath() + "/桌面";
return true;
} else {
return false;
@ -481,9 +482,7 @@ bool ConfigFileManager::copyFileContent(const QString &sourceFilePath, const QSt
*/
bool ConfigFileManager::copyIcontoCacheDir(QMap<QString, QString> *map, QDir cachedir)
{
bool success = true;
// Delete files not in the map
QStringList fileList = cachedir.entryList(QDir::Files);
for (const QString &file : fileList) {
@ -501,7 +500,6 @@ bool ConfigFileManager::copyIcontoCacheDir(QMap<QString, QString> *map, QDir cac
QFile inputFile(value);
QFileInfo fileInfo(inputFile.fileName());
QString destinationPath = cachedir.filePath(key + "." + fileInfo.completeSuffix());
if (!inputFile.exists()){
success = false;
continue;

View File

@ -92,7 +92,7 @@ MainWindow::MainWindow(QWidget *parent)
});
connect(m_maininterface, &MainInterface::gohomesignals, this, &MainWindow::onGoHomeClicked);
connect(m_titlebar,&TitleBar::savePathUpdate,this,[&](const QString& path){
FileProcess::g_debPath= path;
FileProcess::g_debPath = path;
m_bridge->savePathConfigChanged(path);
});
this->setContentsMargins(0,2,0,0);

View File

@ -366,9 +366,7 @@ QMap<QString, QString> *IconThemeWidget::getResourcesAppIconMap(QString Type)
m_iconpathmap = new QMap<QString, QString>;
QString directoryPath = ":/resource/appicons/";
QStringList widgetNames = getWidgetNamesFromFilesInDirectory(directoryPath);
for (int i = 0; i < widgetNames.size(); ++i) {
qDebug() << widgetNames[i];
QString cursorFileName = directoryPath + widgetNames[i] + ".png";
m_iconpathmap->insert(widgetNames[i], cursorFileName);
}
@ -379,7 +377,6 @@ QMap<QString, QString> *IconThemeWidget::getResourcesAppIconMap(QString Type)
QStringList widgetNames = getWidgetNamesFromFilesInDirectory(directoryPath);
for (int i = 0; i < widgetNames.size(); ++i) {
qDebug() << widgetNames[i];
QString cursorFileName = directoryPath + widgetNames[i] + ".png";
m_systemiconpathmap->insert(widgetNames[i], cursorFileName);
}
@ -471,7 +468,7 @@ void IconThemeWidget::initRightWidget()
*/
QMap<QString, QString>* IconThemeWidget::getAppIconsMap()
{
getResourcesAppIconMap("icon");
getResourcesAppIconMap("appicon");
return m_iconpathmap;
}

View File

@ -190,8 +190,6 @@ ImageWidget::ImageWidget(QWidget *parent, const QMap<QString, QString>* iconMap)
item->setData(0, widgetName); // 将widgetName数据保存到该项的第一个数据槽中
item->setData(1, filePath); // 将filePath数据保存到该项的第二个数据槽中
qDebug()<<"widgetName"<<widgetName<<"filePath"<<filePath;
// 增加列计数器
col++;
@ -290,7 +288,6 @@ void ImageWidget::updateIconMap(const QMap<QString, QString>* newIconMap)
item->setScale(1.0);
item->setData(0, widgetName);
item->setData(1, filePath);
qDebug() << "widgetName" << widgetName << "filePath" << filePath;
col++;
if (col >= columnCount) {
col = 2;