From b2b92dad82db4ed07a7eeb10f8e225d22d54a6c1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 3 May 2012 16:58:59 +0200 Subject: Change uses of {to,from}Ascii to {to,from}Latin1 This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: Ic591779a3431999c007fb0ff362c7e25ce54097e Reviewed-by: Jonas Rabbe --- .../qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp | 2 +- examples/video/qmlvideofx/filereader.cpp | 2 +- .../qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.cpp | 2 +- examples/video/snippets/frequencymonitor/frequencymonitor.cpp | 2 +- src/multimedia/audio/qsoundeffect_pulse_p.cpp | 2 +- src/multimedia/video/qabstractvideobuffer.cpp | 2 +- src/multimedia/video/qvideoframe.cpp | 2 +- src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp | 2 +- src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp | 8 ++++---- .../gstreamer/mediacapture/qgstreamercapturesession.cpp | 8 ++++---- src/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp | 10 +++++----- src/plugins/pulseaudio/qpulseaudioengine.cpp | 2 +- .../unit/qabstractvideobuffer/tst_qabstractvideobuffer.cpp | 4 ++-- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp index a124133ea..cc594ee60 100644 --- a/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/examples/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -68,7 +68,7 @@ QString QmlApplicationViewerPrivate::adjustPath(const QString &path) #else QString pathInInstallDir; const QString applicationDirPath = QCoreApplication::applicationDirPath(); - pathInInstallDir = QString::fromAscii("%1/../%2").arg(applicationDirPath, path); + pathInInstallDir = QString::fromLatin1("%1/../%2").arg(applicationDirPath, path); if (QFileInfo(pathInInstallDir).exists()) return pathInInstallDir; diff --git a/examples/video/qmlvideofx/filereader.cpp b/examples/video/qmlvideofx/filereader.cpp index 1d6b03279..676b95fac 100644 --- a/examples/video/qmlvideofx/filereader.cpp +++ b/examples/video/qmlvideofx/filereader.cpp @@ -57,7 +57,7 @@ QString adjustPath(const QString &path) #else QString pathInInstallDir; const QString applicationDirPath = QCoreApplication::applicationDirPath(); - pathInInstallDir = QString::fromAscii("%1/../%2").arg(applicationDirPath, path); + pathInInstallDir = QString::fromLatin1("%1/../%2").arg(applicationDirPath, path); if (QFileInfo(pathInInstallDir).exists()) return pathInInstallDir; diff --git a/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.cpp index 40d140f56..bcefca846 100644 --- a/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/examples/video/qmlvideofx/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -68,7 +68,7 @@ QString QmlApplicationViewerPrivate::adjustPath(const QString &path) #else QString pathInInstallDir; const QString applicationDirPath = QCoreApplication::applicationDirPath(); - pathInInstallDir = QString::fromAscii("%1/../%2").arg(applicationDirPath, path); + pathInInstallDir = QString::fromLatin1("%1/../%2").arg(applicationDirPath, path); if (QFileInfo(pathInInstallDir).exists()) return pathInInstallDir; diff --git a/examples/video/snippets/frequencymonitor/frequencymonitor.cpp b/examples/video/snippets/frequencymonitor/frequencymonitor.cpp index 8021d64df..55acde849 100644 --- a/examples/video/snippets/frequencymonitor/frequencymonitor.cpp +++ b/examples/video/snippets/frequencymonitor/frequencymonitor.cpp @@ -192,7 +192,7 @@ void FrequencyMonitor::notify() void FrequencyMonitor::trace() { Q_D(FrequencyMonitor); - const QString value = QString::fromAscii("instant %1 average %2") + const QString value = QString::fromLatin1("instant %1 average %2") .arg(d->m_instantaneousFrequency, 0, 'f', 2) .arg(d->m_averageFrequency, 0, 'f', 2); if (d->m_label.isEmpty()) diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp index f3a91cc9e..94dcb0bd5 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp @@ -170,7 +170,7 @@ private: m_mainLoopApi = pa_threaded_mainloop_get_api(m_mainLoop); lock(); - m_context = pa_context_new(m_mainLoopApi, QString(QLatin1String("QtPulseAudio:%1")).arg(::getpid()).toAscii().constData()); + m_context = pa_context_new(m_mainLoopApi, QString(QLatin1String("QtPulseAudio:%1")).arg(::getpid()).toLatin1().constData()); pa_context_set_state_callback(m_context, context_state_callback, this); diff --git a/src/multimedia/video/qabstractvideobuffer.cpp b/src/multimedia/video/qabstractvideobuffer.cpp index d3978be26..0d0ff597e 100644 --- a/src/multimedia/video/qabstractvideobuffer.cpp +++ b/src/multimedia/video/qabstractvideobuffer.cpp @@ -232,7 +232,7 @@ QDebug operator<<(QDebug dbg, QAbstractVideoBuffer::HandleType type) case QAbstractVideoBuffer::QPixmapHandle: return dbg.nospace() << "QPixmapHandle"; default: - return dbg.nospace() << QString(QLatin1String("UserHandle(%1)")).arg(int(type)).toAscii().constData(); + return dbg.nospace() << QString(QLatin1String("UserHandle(%1)")).arg(int(type)).toLatin1().constData(); } } diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp index bfc6c0c34..b2c8102b2 100644 --- a/src/multimedia/video/qvideoframe.cpp +++ b/src/multimedia/video/qvideoframe.cpp @@ -930,7 +930,7 @@ QDebug operator<<(QDebug dbg, QVideoFrame::PixelFormat pf) return dbg.nospace() << "Format_CameraRaw"; default: - return dbg.nospace() << QString(QLatin1String("UserType(%1)" )).arg(int(pf)).toAscii().constData(); + return dbg.nospace() << QString(QLatin1String("UserType(%1)" )).arg(int(pf)).toLatin1().constData(); } } diff --git a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp index 7019092b7..4983678c4 100644 --- a/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinimageprocessing.cpp @@ -105,7 +105,7 @@ bool CameraBinImageProcessing::setColorBalanceValue(const QString& channel, int for (item = controls; item; item = g_list_next (item)) { colorBalanceChannel = (GstColorBalanceChannel *)item->data; - if (!g_ascii_strcasecmp (colorBalanceChannel->label, channel.toAscii())) { + if (!g_ascii_strcasecmp (colorBalanceChannel->label, channel.toLatin1())) { gst_color_balance_set_value (balance, colorBalanceChannel, value); return true; } diff --git a/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp b/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp index 02e45617b..5e17ba1e5 100644 --- a/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp +++ b/src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp @@ -261,16 +261,16 @@ GstElement *QGstreamerAudioEncode::createEncoder() switch (value.type()) { case QVariant::Int: - g_object_set(G_OBJECT(encoderElement), option.toAscii(), value.toInt(), NULL); + g_object_set(G_OBJECT(encoderElement), option.toLatin1(), value.toInt(), NULL); break; case QVariant::Bool: - g_object_set(G_OBJECT(encoderElement), option.toAscii(), value.toBool(), NULL); + g_object_set(G_OBJECT(encoderElement), option.toLatin1(), value.toBool(), NULL); break; case QVariant::Double: - g_object_set(G_OBJECT(encoderElement), option.toAscii(), value.toDouble(), NULL); + g_object_set(G_OBJECT(encoderElement), option.toLatin1(), value.toDouble(), NULL); break; case QVariant::String: - g_object_set(G_OBJECT(encoderElement), option.toAscii(), value.toString().toUtf8().constData(), NULL); + g_object_set(G_OBJECT(encoderElement), option.toLatin1(), value.toString().toUtf8().constData(), NULL); break; default: qWarning() << "unsupported option type:" << option << value; diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp index 56174c4c0..38a45a262 100644 --- a/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp +++ b/src/plugins/gstreamer/mediacapture/qgstreamercapturesession.cpp @@ -220,7 +220,7 @@ GstElement *QGstreamerCaptureSession::buildAudioSrc() elementName = "autoaudiosrc"; } - audioSrc = gst_element_factory_make(elementName.toAscii().constData(), "audio_src"); + audioSrc = gst_element_factory_make(elementName.toLatin1().constData(), "audio_src"); if (audioSrc && !device.isEmpty()) g_object_set(G_OBJECT(audioSrc), "device", device.toLocal8Bit().constData(), NULL); } @@ -309,7 +309,7 @@ GstElement *QGstreamerCaptureSession::buildVideoPreview() structureTypes << "video/x-raw-yuv" << "video/x-raw-rgb"; foreach(const QString &structureType, structureTypes) { - GstStructure *structure = gst_structure_new(structureType.toAscii().constData(), NULL); + GstStructure *structure = gst_structure_new(structureType.toLatin1().constData(), NULL); if (!resolution.isEmpty()) { gst_structure_set(structure, "width", G_TYPE_INT, resolution.width(), NULL); @@ -667,7 +667,7 @@ bool QGstreamerCaptureSession::rebuildGraph(QGstreamerCaptureSession::PipelineMo if (m_encodeBin) { QString fileName = QString("rebuild_graph_encode_%1_%2").arg(m_pipelineMode).arg(newMode); #if !(GST_DISABLE_GST_DEBUG) && (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 19) - _gst_debug_bin_to_dot_file(GST_BIN(m_encodeBin), GST_DEBUG_GRAPH_SHOW_ALL, fileName.toAscii()); + _gst_debug_bin_to_dot_file(GST_BIN(m_encodeBin), GST_DEBUG_GRAPH_SHOW_ALL, fileName.toLatin1()); #endif } @@ -696,7 +696,7 @@ void QGstreamerCaptureSession::dumpGraph(const QString &fileName) #if !(GST_DISABLE_GST_DEBUG) && (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 19) _gst_debug_bin_to_dot_file(GST_BIN(m_pipeline), GstDebugGraphDetails(/*GST_DEBUG_GRAPH_SHOW_ALL |*/ GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE | GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS | GST_DEBUG_GRAPH_SHOW_STATES), - fileName.toAscii()); + fileName.toLatin1()); #endif } diff --git a/src/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp b/src/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp index fa84b81d2..67cfd38d8 100644 --- a/src/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp +++ b/src/plugins/gstreamer/mediacapture/qgstreamervideoencode.cpp @@ -240,16 +240,16 @@ GstElement *QGstreamerVideoEncode::createEncoder() switch (value.type()) { case QVariant::Int: - g_object_set(G_OBJECT(encoderElement), option.toAscii(), value.toInt(), NULL); + g_object_set(G_OBJECT(encoderElement), option.toLatin1(), value.toInt(), NULL); break; case QVariant::Bool: - g_object_set(G_OBJECT(encoderElement), option.toAscii(), value.toBool(), NULL); + g_object_set(G_OBJECT(encoderElement), option.toLatin1(), value.toBool(), NULL); break; case QVariant::Double: - g_object_set(G_OBJECT(encoderElement), option.toAscii(), value.toDouble(), NULL); + g_object_set(G_OBJECT(encoderElement), option.toLatin1(), value.toDouble(), NULL); break; case QVariant::String: - g_object_set(G_OBJECT(encoderElement), option.toAscii(), value.toString().toUtf8().constData(), NULL); + g_object_set(G_OBJECT(encoderElement), option.toLatin1(), value.toString().toUtf8().constData(), NULL); break; default: qWarning() << "unsupported option type:" << option << value; @@ -265,7 +265,7 @@ GstElement *QGstreamerVideoEncode::createEncoder() structureTypes << "video/x-raw-yuv" << "video/x-raw-rgb"; foreach(const QString &structureType, structureTypes) { - GstStructure *structure = gst_structure_new(structureType.toAscii().constData(), NULL); + GstStructure *structure = gst_structure_new(structureType.toLatin1().constData(), NULL); if (!m_videoSettings.resolution().isEmpty()) { gst_structure_set(structure, "width", G_TYPE_INT, m_videoSettings.resolution().width(), NULL); diff --git a/src/plugins/pulseaudio/qpulseaudioengine.cpp b/src/plugins/pulseaudio/qpulseaudioengine.cpp index 2bb36fe1c..03a8dbd05 100644 --- a/src/plugins/pulseaudio/qpulseaudioengine.cpp +++ b/src/plugins/pulseaudio/qpulseaudioengine.cpp @@ -208,7 +208,7 @@ QPulseAudioEngine::QPulseAudioEngine(QObject *parent) pa_threaded_mainloop_lock(m_mainLoop); - m_context = pa_context_new(m_mainLoopApi, QString(QLatin1String("QtmPulseContext:%1")).arg(::getpid()).toAscii().constData()); + m_context = pa_context_new(m_mainLoopApi, QString(QLatin1String("QtmPulseContext:%1")).arg(::getpid()).toLatin1().constData()); pa_context_set_state_callback(m_context, contextStateCallbackInit, this); if (!m_context) { diff --git a/tests/auto/unit/qabstractvideobuffer/tst_qabstractvideobuffer.cpp b/tests/auto/unit/qabstractvideobuffer/tst_qabstractvideobuffer.cpp index 60c70f252..0c382a275 100644 --- a/tests/auto/unit/qabstractvideobuffer/tst_qabstractvideobuffer.cpp +++ b/tests/auto/unit/qabstractvideobuffer/tst_qabstractvideobuffer.cpp @@ -122,9 +122,9 @@ void tst_QAbstractVideoBuffer::handleType_data() // User handles are different QTest::newRow("user1") - << QAbstractVideoBuffer::UserHandle << QString::fromAscii("UserHandle(1000)"); + << QAbstractVideoBuffer::UserHandle << QString::fromLatin1("UserHandle(1000)"); QTest::newRow("user2") - << QAbstractVideoBuffer::HandleType(QAbstractVideoBuffer::UserHandle + 1) << QString::fromAscii("UserHandle(1001)"); + << QAbstractVideoBuffer::HandleType(QAbstractVideoBuffer::UserHandle + 1) << QString::fromLatin1("UserHandle(1001)"); } void tst_QAbstractVideoBuffer::handleType() -- cgit v1.2.3