Move game_data to RW directory inside user folder for linux

This commit is contained in:
Live session user 2024-07-13 16:19:02 -07:00
parent 83c8204d23
commit a1fbab5de7
5 changed files with 14 additions and 13 deletions

View file

@ -114,8 +114,9 @@ void GameGridFrame::SetGridBackgroundImage(int row, int column) {
if (item) {
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");
QDir::currentPath() +
QString::fromStdString("/user/game_data/" + (*m_games_shared)[itemID].serial +
"/pic1.png");
backgroundImage = QImage(blurredPic1Path);
if (backgroundImage.isNull()) {
@ -123,7 +124,7 @@ void GameGridFrame::SetGridBackgroundImage(int row, int column) {
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::filesystem::path("user/game_data/") / (*m_games_shared)[itemID].serial;
std::filesystem::create_directories(img_path);
if (!backgroundImage.save(blurredPic1Path, "PNG")) {
// qDebug() << "Error: Unable to save image.";
@ -142,4 +143,4 @@ void GameGridFrame::RefreshGridBackgroundImage() {
palette.setColor(QPalette::Highlight, transparentColor);
this->setPalette(palette);
}
}
}