QString encoding fix

This commit is contained in:
scrawl 2015-02-06 18:05:02 +01:00
parent 801c0eb57c
commit 03257ecae5
3 changed files with 7 additions and 7 deletions

View File

@ -67,7 +67,7 @@ bool Launcher::GraphicsPage::setupOgre()
} }
catch(Ogre::Exception &ex) catch(Ogre::Exception &ex)
{ {
QString ogreError = QString::fromStdString(ex.getFullDescription().c_str()); QString ogreError = QString::fromUtf8(ex.getFullDescription().c_str());
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setWindowTitle("Error creating Ogre::Root"); msgBox.setWindowTitle("Error creating Ogre::Root");
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
@ -135,7 +135,7 @@ bool Launcher::GraphicsPage::setupSDL()
msgBox.setWindowTitle(tr("Error receiving number of screens")); msgBox.setWindowTitle(tr("Error receiving number of screens"));
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(tr("<br><b>SDL_GetNumDisplayModes failed:</b><br><br>") + QString::fromStdString(SDL_GetError()) + "<br>"); msgBox.setText(tr("<br><b>SDL_GetNumDisplayModes failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
msgBox.exec(); msgBox.exec();
return false; return false;
} }
@ -237,7 +237,7 @@ QStringList Launcher::GraphicsPage::getAvailableOptions(const QString &key, Ogre
opt_it != i->second.possibleValues.end(); ++opt_it, ++idx) opt_it != i->second.possibleValues.end(); ++opt_it, ++idx)
{ {
if (strcmp (key.toStdString().c_str(), i->first.c_str()) == 0) { if (strcmp (key.toStdString().c_str(), i->first.c_str()) == 0) {
result << ((key == "FSAA") ? QString("MSAA ") : QString("")) + QString::fromStdString((*opt_it).c_str()).simplified(); result << ((key == "FSAA") ? QString("MSAA ") : QString("")) + QString::fromUtf8((*opt_it).c_str()).simplified();
} }
} }
} }
@ -266,7 +266,7 @@ QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen)
msgBox.setWindowTitle(tr("Error receiving resolutions")); msgBox.setWindowTitle(tr("Error receiving resolutions"));
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(tr("<br><b>SDL_GetNumDisplayModes failed:</b><br><br>") + QString::fromStdString(SDL_GetError()) + "<br>"); msgBox.setText(tr("<br><b>SDL_GetNumDisplayModes failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
msgBox.exec(); msgBox.exec();
return result; return result;
} }
@ -279,7 +279,7 @@ QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen)
msgBox.setWindowTitle(tr("Error receiving resolutions")); msgBox.setWindowTitle(tr("Error receiving resolutions"));
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(tr("<br><b>SDL_GetDisplayMode failed:</b><br><br>") + QString::fromStdString(SDL_GetError()) + "<br>"); msgBox.setText(tr("<br><b>SDL_GetDisplayMode failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
msgBox.exec(); msgBox.exec();
return result; return result;
} }

View File

@ -24,7 +24,7 @@ int main(int argc, char *argv[])
SDL_SetMainReady(); SDL_SetMainReady();
if (SDL_Init(SDL_INIT_VIDEO) != 0) if (SDL_Init(SDL_INIT_VIDEO) != 0)
{ {
qDebug() << "SDL_Init failed: " << QString::fromStdString(SDL_GetError()); qDebug() << "SDL_Init failed: " << QString::fromUtf8(SDL_GetError());
return 0; return 0;
} }
signal(SIGINT, SIG_DFL); // We don't want to use the SDL event loop in the launcher, signal(SIGINT, SIG_DFL); // We don't want to use the SDL event loop in the launcher,

View File

@ -459,7 +459,7 @@ void ContentSelectorModel::ContentModel::addFiles(const QString &path)
EsmFile *file = new EsmFile(path); EsmFile *file = new EsmFile(path);
foreach (const ESM::Header::MasterData &item, fileReader.getGameFiles()) foreach (const ESM::Header::MasterData &item, fileReader.getGameFiles())
file->addGameFile(QString::fromStdString(item.name)); file->addGameFile(QString::fromUtf8(item.name.c_str()));
file->setAuthor (QString::fromUtf8(fileReader.getAuthor().c_str())); file->setAuthor (QString::fromUtf8(fileReader.getAuthor().c_str()));
file->setDate (info.lastModified()); file->setDate (info.lastModified());