Qt: Replace remaining toLocal8Bit with toUtf8

This commit is contained in:
Jeffrey Pfau 2015-07-04 01:06:13 -07:00
parent e0a6af087e
commit ebca878c31
7 changed files with 12 additions and 12 deletions

View File

@ -68,7 +68,7 @@ bool CheatsModel::setData(const QModelIndex& index, const QVariant& value, int r
free(cheats->name); free(cheats->name);
cheats->name = nullptr; cheats->name = nullptr;
} }
cheats->name = strdup(value.toString().toLocal8Bit().constData()); cheats->name = strdup(value.toString().toUtf8().constData());
emit dataChanged(index, index); emit dataChanged(index, index);
return true; return true;
case Qt::CheckStateRole: case Qt::CheckStateRole:

View File

@ -112,7 +112,7 @@ void CheatsView::enterCheat(std::function<bool(GBACheatSet*, const char*)> callb
QStringList cheats = m_ui.codeEntry->toPlainText().split('\n', QString::SkipEmptyParts); QStringList cheats = m_ui.codeEntry->toPlainText().split('\n', QString::SkipEmptyParts);
for (const QString& string : cheats) { for (const QString& string : cheats) {
m_model.beginAppendRow(selection[0]); m_model.beginAppendRow(selection[0]);
callback(set, string.toLocal8Bit().constData()); callback(set, string.toUtf8().constData());
m_model.endAppendRow(); m_model.endAppendRow();
} }
m_controller->threadContinue(); m_controller->threadContinue();

View File

@ -214,7 +214,7 @@ void ConfigController::setOption(const char* key, const QVariant& value) {
return; return;
} }
QString stringValue(value.toString()); QString stringValue(value.toString());
setOption(key, stringValue.toLocal8Bit().constData()); setOption(key, stringValue.toUtf8().constData());
} }
void ConfigController::setQtOption(const QString& key, const QVariant& value, const QString& group) { void ConfigController::setQtOption(const QString& key, const QVariant& value, const QString& group) {

View File

@ -33,7 +33,7 @@ GIFView::~GIFView() {
} }
void GIFView::startRecording() { void GIFView::startRecording() {
if (!ImageMagickGIFEncoderOpen(&m_encoder, m_filename.toLocal8Bit().constData())) { if (!ImageMagickGIFEncoderOpen(&m_encoder, m_filename.toUtf8().constData())) {
return; return;
} }
m_ui.start->setEnabled(false); m_ui.start->setEnabled(false);

View File

@ -263,7 +263,7 @@ void GameController::openGame(bool biosOnly) {
if (biosOnly) { if (biosOnly) {
m_threadContext.fname = nullptr; m_threadContext.fname = nullptr;
} else { } else {
m_threadContext.fname = strdup(m_fname.toLocal8Bit().constData()); m_threadContext.fname = strdup(m_fname.toUtf8().constData());
if (m_dirmode) { if (m_dirmode) {
m_threadContext.gameDir = VDirOpen(m_threadContext.fname); m_threadContext.gameDir = VDirOpen(m_threadContext.fname);
m_threadContext.stateDir = m_threadContext.gameDir; m_threadContext.stateDir = m_threadContext.gameDir;

View File

@ -106,7 +106,7 @@ void InputController::loadConfiguration(uint32_t type) {
} }
void InputController::loadProfile(uint32_t type, const QString& profile) { void InputController::loadProfile(uint32_t type, const QString& profile) {
GBAInputProfileLoad(&m_inputMap, type, m_config->input(), profile.toLocal8Bit().constData()); GBAInputProfileLoad(&m_inputMap, type, m_config->input(), profile.toUtf8().constData());
recalibrateAxes(); recalibrateAxes();
} }
@ -128,7 +128,7 @@ void InputController::saveConfiguration(uint32_t type) {
} }
void InputController::saveProfile(uint32_t type, const QString& profile) { void InputController::saveProfile(uint32_t type, const QString& profile) {
GBAInputProfileSave(&m_inputMap, type, m_config->input(), profile.toLocal8Bit().constData()); GBAInputProfileSave(&m_inputMap, type, m_config->input(), profile.toUtf8().constData());
m_config->write(); m_config->write();
} }
@ -193,7 +193,7 @@ void InputController::setPreferredGamepad(uint32_t type, const QString& device)
if (!m_config) { if (!m_config) {
return; return;
} }
GBAInputSetPreferredDevice(m_config->input(), type, m_playerId, device.toLocal8Bit().constData()); GBAInputSetPreferredDevice(m_config->input(), type, m_playerId, device.toUtf8().constData());
} }
GBARumble* InputController::rumble() { GBARumble* InputController::rumble() {

View File

@ -197,7 +197,7 @@ void VideoView::startRecording() {
if (!validateSettings()) { if (!validateSettings()) {
return; return;
} }
if (!FFmpegEncoderOpen(&m_encoder, m_filename.toLocal8Bit().constData())) { if (!FFmpegEncoderOpen(&m_encoder, m_filename.toUtf8().constData())) {
return; return;
} }
m_ui.start->setEnabled(false); m_ui.start->setEnabled(false);
@ -230,7 +230,7 @@ void VideoView::setAudioCodec(const QString& codec, bool manual) {
if (m_audioCodec == "none") { if (m_audioCodec == "none") {
m_audioCodecCstr = nullptr; m_audioCodecCstr = nullptr;
} else { } else {
m_audioCodecCstr = strdup(m_audioCodec.toLocal8Bit().constData()); m_audioCodecCstr = strdup(m_audioCodec.toUtf8().constData());
} }
if (!FFmpegEncoderSetAudio(&m_encoder, m_audioCodecCstr, m_abr)) { if (!FFmpegEncoderSetAudio(&m_encoder, m_audioCodecCstr, m_abr)) {
free(m_audioCodecCstr); free(m_audioCodecCstr);
@ -246,7 +246,7 @@ void VideoView::setAudioCodec(const QString& codec, bool manual) {
void VideoView::setVideoCodec(const QString& codec, bool manual) { void VideoView::setVideoCodec(const QString& codec, bool manual) {
free(m_videoCodecCstr); free(m_videoCodecCstr);
m_videoCodec = sanitizeCodec(codec, s_vcodecMap); m_videoCodec = sanitizeCodec(codec, s_vcodecMap);
m_videoCodecCstr = strdup(m_videoCodec.toLocal8Bit().constData()); m_videoCodecCstr = strdup(m_videoCodec.toUtf8().constData());
if (!FFmpegEncoderSetVideo(&m_encoder, m_videoCodecCstr, m_vbr)) { if (!FFmpegEncoderSetVideo(&m_encoder, m_videoCodecCstr, m_vbr)) {
free(m_videoCodecCstr); free(m_videoCodecCstr);
m_videoCodecCstr = nullptr; m_videoCodecCstr = nullptr;
@ -261,7 +261,7 @@ void VideoView::setVideoCodec(const QString& codec, bool manual) {
void VideoView::setContainer(const QString& container, bool manual) { void VideoView::setContainer(const QString& container, bool manual) {
free(m_containerCstr); free(m_containerCstr);
m_container = sanitizeCodec(container, s_containerMap); m_container = sanitizeCodec(container, s_containerMap);
m_containerCstr = strdup(m_container.toLocal8Bit().constData()); m_containerCstr = strdup(m_container.toUtf8().constData());
if (!FFmpegEncoderSetContainer(&m_encoder, m_containerCstr)) { if (!FFmpegEncoderSetContainer(&m_encoder, m_containerCstr)) {
free(m_containerCstr); free(m_containerCstr);
m_containerCstr = nullptr; m_containerCstr = nullptr;