Skip to content

Commit

Permalink
Maybe
Browse files Browse the repository at this point in the history
test
  • Loading branch information
ryzendew committed Jul 11, 2024
1 parent cf45729 commit 6c742a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/qt_gui/game_grid_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ void GameGridFrame::SetGridBackgroundImage(int row, int column) {
QString pic1Path = QString::fromStdString((*m_games_shared)[itemID].pic_path);
QString blurredPic1Path =
qApp->applicationDirPath() +
QString::fromStdString("/game_data/" + (*m_games_shared)[itemID].serial + "/pic1.png");
QString gameDataPath = qApp->applicationDirPath() + "/game_data/" + (*m_games_shared)[itemID].serial + "/pic1.png");

backgroundImage = QImage(blurredPic1Path);
if (backgroundImage.isNull()) {
QImage image(pic1Path);
backgroundImage = m_game_list_utils.BlurImage(image, image.rect(), 16);

std::filesystem::path img_path =
std::filesystem::path("game_data/") / (*m_games_shared)[itemID].serial;
std::string stdStr = std::string(config_dir) + "/game_data/" / (*m_games_shared)[itemID].serial;
std::filesystem::create_directories(img_path);
if (!backgroundImage.save(blurredPic1Path, "PNG")) {
// qDebug() << "Error: Unable to save image.";
Expand All @@ -142,4 +142,4 @@ void GameGridFrame::RefreshGridBackgroundImage() {
palette.setColor(QPalette::Highlight, transparentColor);
this->setPalette(palette);
}
}
}
6 changes: 3 additions & 3 deletions src/qt_gui/game_list_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void GameListFrame::SetListBackgroundImage(QTableWidgetItem* item) {
QString pic1Path = QString::fromStdString(m_game_info->m_games[item->row()].pic_path);
QString blurredPic1Path =
qApp->applicationDirPath() +
QString::fromStdString("/game_data/" + m_game_info->m_games[item->row()].serial +
QString gameDataPath = qApp->applicationDirPath() + "/game_data/" + m_game_info->m_games[item->row()].serial +
"/pic1.png");

backgroundImage = QImage(blurredPic1Path);
Expand All @@ -109,7 +109,7 @@ void GameListFrame::SetListBackgroundImage(QTableWidgetItem* item) {
backgroundImage = m_game_list_utils.BlurImage(image, image.rect(), 16);

std::filesystem::path img_path =
std::filesystem::path("game_data/") / m_game_info->m_games[item->row()].serial;
std::string stdStr = std::string(config_dir) + "/game_data/") / m_game_info->m_games[item->row()].serial;
std::filesystem::create_directories(img_path);
if (!backgroundImage.save(blurredPic1Path, "PNG")) {
// qDebug() << "Error: Unable to save image.";
Expand Down Expand Up @@ -206,4 +206,4 @@ void GameListFrame::SetRegionFlag(int row, int column, QString itemStr) {
widget->setLayout(layout);
this->setItem(row, column, item);
this->setCellWidget(row, column, widget);
}
}
4 changes: 2 additions & 2 deletions src/qt_gui/trophy_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ TrophyViewer::TrophyViewer(QString trophyPath, QString gameTrpPath) : QMainWindo
}

void TrophyViewer::PopulateTrophyWidget(QString title) {
QString trophyDir = qApp->applicationDirPath() + "/game_data/" + title + "/TrophyFiles";
QString gameDataPath = qApp->applicationDirPath() + "/game_data/" + title + "/TrophyFiles";
QDir dir(trophyDir);
if (!dir.exists()) {
std::filesystem::path path(gameTrpPath_.toStdString());
Expand Down Expand Up @@ -142,4 +142,4 @@ void TrophyViewer::SetTableItem(QTableWidget* parent, int row, int column, QStri
widget->setLayout(layout);
parent->setItem(row, column, item);
parent->setCellWidget(row, column, widget);
}
}

0 comments on commit 6c742a4

Please sign in to comment.