all repos — mgba @ ebca878c3177f1f97c9d78df6deb0aa7ee40e17f

mGBA Game Boy Advance Emulator

Qt: Replace remaining toLocal8Bit with toUtf8
Jeffrey Pfau jeffrey@endrift.com
Sat, 04 Jul 2015 01:06:13 -0700
commit

ebca878c3177f1f97c9d78df6deb0aa7ee40e17f

parent

e0a6af087e83d79b53ad5352511c7e02c557b93f

M src/platform/qt/CheatsModel.cppsrc/platform/qt/CheatsModel.cpp

@@ -68,7 +68,7 @@ if (cheats->name) {

free(cheats->name); cheats->name = nullptr; } - cheats->name = strdup(value.toString().toLocal8Bit().constData()); + cheats->name = strdup(value.toString().toUtf8().constData()); emit dataChanged(index, index); return true; case Qt::CheckStateRole:
M src/platform/qt/CheatsView.cppsrc/platform/qt/CheatsView.cpp

@@ -112,7 +112,7 @@ m_controller->threadInterrupt();

QStringList cheats = m_ui.codeEntry->toPlainText().split('\n', QString::SkipEmptyParts); for (const QString& string : cheats) { m_model.beginAppendRow(selection[0]); - callback(set, string.toLocal8Bit().constData()); + callback(set, string.toUtf8().constData()); m_model.endAppendRow(); } m_controller->threadContinue();
M src/platform/qt/ConfigController.cppsrc/platform/qt/ConfigController.cpp

@@ -214,7 +214,7 @@ setOption(key, value.toBool());

return; } 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) {
M src/platform/qt/GIFView.cppsrc/platform/qt/GIFView.cpp

@@ -33,7 +33,7 @@ stopRecording();

} void GIFView::startRecording() { - if (!ImageMagickGIFEncoderOpen(&m_encoder, m_filename.toLocal8Bit().constData())) { + if (!ImageMagickGIFEncoderOpen(&m_encoder, m_filename.toUtf8().constData())) { return; } m_ui.start->setEnabled(false);
M src/platform/qt/GameController.cppsrc/platform/qt/GameController.cpp

@@ -263,7 +263,7 @@ m_threadContext.bootBios = biosOnly;

if (biosOnly) { m_threadContext.fname = nullptr; } else { - m_threadContext.fname = strdup(m_fname.toLocal8Bit().constData()); + m_threadContext.fname = strdup(m_fname.toUtf8().constData()); if (m_dirmode) { m_threadContext.gameDir = VDirOpen(m_threadContext.fname); m_threadContext.stateDir = m_threadContext.gameDir;
M src/platform/qt/InputController.cppsrc/platform/qt/InputController.cpp

@@ -106,7 +106,7 @@ #endif

} 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(); }

@@ -128,7 +128,7 @@ m_config->write();

} 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(); }

@@ -193,7 +193,7 @@ void InputController::setPreferredGamepad(uint32_t type, const QString& device) {

if (!m_config) { return; } - GBAInputSetPreferredDevice(m_config->input(), type, m_playerId, device.toLocal8Bit().constData()); + GBAInputSetPreferredDevice(m_config->input(), type, m_playerId, device.toUtf8().constData()); } GBARumble* InputController::rumble() {
M src/platform/qt/VideoView.cppsrc/platform/qt/VideoView.cpp

@@ -197,7 +197,7 @@ void VideoView::startRecording() {

if (!validateSettings()) { return; } - if (!FFmpegEncoderOpen(&m_encoder, m_filename.toLocal8Bit().constData())) { + if (!FFmpegEncoderOpen(&m_encoder, m_filename.toUtf8().constData())) { return; } m_ui.start->setEnabled(false);

@@ -230,7 +230,7 @@ m_audioCodec = sanitizeCodec(codec, s_acodecMap);

if (m_audioCodec == "none") { m_audioCodecCstr = nullptr; } else { - m_audioCodecCstr = strdup(m_audioCodec.toLocal8Bit().constData()); + m_audioCodecCstr = strdup(m_audioCodec.toUtf8().constData()); } if (!FFmpegEncoderSetAudio(&m_encoder, m_audioCodecCstr, m_abr)) { free(m_audioCodecCstr);

@@ -246,7 +246,7 @@

void VideoView::setVideoCodec(const QString& codec, bool manual) { free(m_videoCodecCstr); 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)) { free(m_videoCodecCstr); m_videoCodecCstr = nullptr;

@@ -261,7 +261,7 @@

void VideoView::setContainer(const QString& container, bool manual) { free(m_containerCstr); 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)) { free(m_containerCstr); m_containerCstr = nullptr;