Skip to content

Commit

Permalink
Fix txPath save/load.
Browse files Browse the repository at this point in the history
Fixed Texture pack path not saved correctly #456
  • Loading branch information
gonetz committed May 13, 2015
1 parent a1fdd33 commit 5329a2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/GLideNUI/ConfigDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ void ConfigDialog::accept()

QString txPath = ui->txPathLabel->text();
if (!txPath.isEmpty())
config.textureFilter.txPath[txPath.toWCharArray(config.textureFilter.txPath)] = '\0';
config.textureFilter.txPath[txPath.toWCharArray(config.textureFilter.txPath)] = L'\0';

config.font.size = m_font.pointSize();
QString fontName = m_font.family() + ".ttf";
Expand Down Expand Up @@ -422,7 +422,7 @@ void ConfigDialog::on_texPackPathButton_clicked()
QFileDialog::Options options = QFileDialog::DontResolveSymlinks | QFileDialog::ShowDirsOnly | QFileDialog::ReadOnly | QFileDialog::DontUseSheet | QFileDialog::ReadOnly | QFileDialog::HideNameFilterDetails;
QString directory = QFileDialog::getExistingDirectory(this,
"",
QString::fromWCharArray(config.textureFilter.txPath),
ui->txPathLabel->text(),
options);
if (!directory.isEmpty())
ui->txPathLabel->setText(directory);
Expand Down
4 changes: 3 additions & 1 deletion src/GLideNUI/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ void _loadSettings(QSettings & settings)
config.textureFilter.txForce16bpp = settings.value("txForce16bpp", config.textureFilter.txForce16bpp).toInt();
config.textureFilter.txCacheCompression = settings.value("txCacheCompression", config.textureFilter.txCacheCompression).toInt();
config.textureFilter.txSaveCache = settings.value("txSaveCache", config.textureFilter.txSaveCache).toInt();
settings.value("txPath", "").toString().toWCharArray(config.textureFilter.txPath);
QString txPath = QString::fromWCharArray(config.textureFilter.txPath);
config.textureFilter.txPath[settings.value("txPath", txPath).toString().toWCharArray(config.textureFilter.txPath)] = L'\0';

settings.endGroup();

settings.beginGroup("font");
Expand Down

0 comments on commit 5329a2a

Please sign in to comment.