rbutil: Fix encoding for themes info data.

The themes info data uses utf-8 encoding, while QSettings defaults to
ASCII and uses escape sequences, resulting in non-ASCII characters being
garbled. Use the correct encoding.

Change-Id: Ibee58b51926f6d7c3885dead0b42579e21bfb1db
This commit is contained in:
Dominik Riebeling 2020-12-10 21:30:01 +01:00
parent 52d437b33e
commit 9ad1ef0e55

View file

@ -116,6 +116,7 @@ void ThemesInstallWindow::downloadDone(bool error)
themesInfo.open();
QSettings iniDetails(themesInfo.fileName(), QSettings::IniFormat, this);
iniDetails.setIniCodec(QTextCodec::codecForName("UTF-8"));
QStringList tl = iniDetails.childGroups();
LOG_INFO() << "Theme site result:"
<< iniDetails.value("error/code").toString()
@ -189,6 +190,7 @@ void ThemesInstallWindow::updateSize(void)
long size = 0;
// sum up size for all selected themes
QSettings iniDetails(themesInfo.fileName(), QSettings::IniFormat, this);
iniDetails.setIniCodec(QTextCodec::codecForName("UTF-8"));
int items = ui.listThemes->selectedItems().size();
for(int i = 0; i < items; i++) {
iniDetails.beginGroup(ui.listThemes->selectedItems()
@ -207,6 +209,7 @@ void ThemesInstallWindow::updateDetails(QListWidgetItem* cur, QListWidgetItem* p
return;
QSettings iniDetails(themesInfo.fileName(), QSettings::IniFormat, this);
iniDetails.setIniCodec(QTextCodec::codecForName("UTF-8"));
QCoreApplication::processEvents();
ui.themeDescription->setText(tr("fetching details for %1")