Respect selected encoding in the content selector (bug #4467)

pull/541/head
Andrei Kortunov 6 years ago
parent 0e06a25f21
commit bce8de5fe9

@ -80,6 +80,7 @@
Bug #4460: Script function "Equip" doesn't bypass beast restrictions
Bug #4461: "Open" spell from non-player caster isn't a crime
Bug #4464: OpenMW keeps AiState cached storages even after we cancel AI packages
Bug #4467: Content selector: cyrillic characters are decoded incorrectly in plugin descriptions
Bug #4469: Abot Silt Striders Model turn 90 degrees on horizontal
Bug #4470: Non-bipedal creatures with Weapon & Shield flag have inconsistent behaviour
Bug #4474: No fallback when getVampireHead fails

@ -36,6 +36,8 @@ Launcher::DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, Config:
ui.setupUi (this);
setObjectName ("DataFilesPage");
mSelector = new ContentSelectorView::ContentSelector (ui.contentSelectorWidget);
const QString encoding = mGameSettings.value("encoding", "win1252");
mSelector->setEncoding(encoding);
mProfileDialog = new TextInputDialog(tr("New Content List"), tr("Content List name:"), this);

@ -108,8 +108,9 @@ std::pair<Files::PathContainer, std::vector<std::string> > CS::Editor::readConfi
mCfgMgr.readConfiguration(variables, desc, quiet);
mDocumentManager.setEncoding (
ToUTF8::calculateEncoding (variables["encoding"].as<Files::EscapeHashString>().toStdString()));
const std::string encoding = variables["encoding"].as<Files::EscapeHashString>().toStdString();
mDocumentManager.setEncoding (ToUTF8::calculateEncoding (encoding));
mFileDialog.setEncoding (QString::fromUtf8(encoding.c_str()));
mDocumentManager.setResourceDir (mResources = variables["resources"].as<Files::EscapeHashString>().toStdString());

@ -33,6 +33,11 @@ void CSVDoc::FileDialog::addFiles(const QString &path)
mSelector->addFiles(path);
}
void CSVDoc::FileDialog::setEncoding(const QString &encoding)
{
mSelector->setEncoding(encoding);
}
void CSVDoc::FileDialog::clearFiles()
{
mSelector->clearFiles();

@ -42,6 +42,7 @@ namespace CSVDoc
void showDialog (ContentAction action);
void addFiles (const QString &path);
void setEncoding (const QString &encoding);
void clearFiles ();
QString filename() const;

@ -111,6 +111,11 @@ void ContentSelectorView::ContentSelector::clearCheckStates()
mContentModel->uncheckAll();
}
void ContentSelectorView::ContentSelector::setEncoding(const QString &encoding)
{
mContentModel->setEncoding(encoding);
}
void ContentSelectorView::ContentSelector::setContentList(const QStringList &list)
{
if (list.isEmpty())

@ -32,6 +32,7 @@ namespace ContentSelectorView
void setProfileContent (const QStringList &fileList);
void clearCheckStates();
void setEncoding (const QString &encoding);
void setContentList(const QStringList &list);
ContentSelectorModel::ContentFileList selectedFiles() const;

Loading…
Cancel
Save