Use QString::toLatin1() instead of QString::toAscii()
authorMohammed Sameer <msameer@foolab.org>
Thu, 25 Jul 2013 16:33:52 +0000 (19:33 +0300)
committerMohammed Sameer <msameer@foolab.org>
Thu, 25 Jul 2013 16:33:52 +0000 (19:33 +0300)
lib/qtcamcapability_p.h
lib/qtcamdevice_p.h
lib/qtcammode_p.h
lib/qtcamscanner.cpp
lib/qtcamviewfinderrenderermeego.cpp

index 419c944..51b36f2 100644 (file)
@@ -66,7 +66,7 @@ public:
   void startMonitoring() {
     if (src) {
       QString p = QString("notify::%1").arg(prop);
-      handler = g_signal_connect(src, p.toAscii().data(), G_CALLBACK(camera_src_notify), this);
+      handler = g_signal_connect(src, p.toLatin1().data(), G_CALLBACK(camera_src_notify), this);
     }
   }
 
@@ -81,7 +81,7 @@ public:
       return false;
     }
 
-    g_object_get(src, prop.toAscii().data(), val, NULL);
+    g_object_get(src, prop.toLatin1().data(), val, NULL);
 
     return true;
   }
@@ -91,7 +91,7 @@ public:
       return false;
     }
 
-    g_object_set(src, prop.toAscii().data(), val, NULL);
+    g_object_set(src, prop.toLatin1().data(), val, NULL);
 
     return true;
   }
@@ -101,7 +101,7 @@ public:
       return false;
     }
 
-    g_object_get(src, prop.toAscii().data(), val, NULL);
+    g_object_get(src, prop.toLatin1().data(), val, NULL);
 
     return true;
   }
@@ -112,15 +112,15 @@ public:
     }
 
     if (force) {
-      g_object_set(src, prop.toAscii().data(), val, NULL);
+      g_object_set(src, prop.toLatin1().data(), val, NULL);
       return true;
     }
 
     int old = 0;
-    g_object_get(src, prop.toAscii().data(), &old, NULL);
+    g_object_get(src, prop.toLatin1().data(), &old, NULL);
 
     if (old != val) {
-      g_object_set(src, prop.toAscii().data(), val, NULL);
+      g_object_set(src, prop.toLatin1().data(), val, NULL);
     }
 
     return true;
@@ -131,7 +131,7 @@ public:
       return false;
     }
 
-    g_object_get(src, prop.toAscii().data(), val, NULL);
+    g_object_get(src, prop.toLatin1().data(), val, NULL);
 
     return true;
   }
@@ -141,7 +141,7 @@ public:
       return false;
     }
 
-    g_object_set(src, prop.toAscii().data(), val, NULL);
+    g_object_set(src, prop.toLatin1().data(), val, NULL);
 
     return true;
   }
index 2699ba3..3334cb4 100644 (file)
@@ -55,7 +55,7 @@ public:
   }
 
   GstElement *createAndAddElement(const QString& elementName, const char *prop, const char *name) {
-    GstElement *elem = gst_element_factory_make(elementName.toAscii(), name);
+    GstElement *elem = gst_element_factory_make(elementName.toLatin1(), name);
     if (!elem) {
       qWarning() << "Failed to create" << elementName;
       return 0;
@@ -105,12 +105,12 @@ public:
     if (videoSource) {
       if (conf->deviceScannerType() == SCANNER_TYPE_ENUM) {
        int dev = id.toInt();
-       g_object_set(videoSource, conf->deviceScannerProperty().toAscii().constData(), dev, NULL);
+       g_object_set(videoSource, conf->deviceScannerProperty().toLatin1().constData(), dev, NULL);
       }
       else {
        QString dev = id.toString();
-       g_object_set(videoSource, conf->deviceScannerProperty().toAscii().constData(),
-                    dev.toAscii().constData(), NULL);
+       g_object_set(videoSource, conf->deviceScannerProperty().toLatin1().constData(),
+                    dev.toLatin1().constData(), NULL);
       }
     }
   }
@@ -173,7 +173,7 @@ public:
   void setAudioCaptureCaps() {
     QString captureCaps = conf->audioCaptureCaps();
     if (!captureCaps.isEmpty()) {
-      GstCaps *caps = gst_caps_from_string(captureCaps.toAscii().data());
+      GstCaps *caps = gst_caps_from_string(captureCaps.toLatin1().data());
       if (caps) {
        g_object_set(cameraBin, "audio-capture-caps", caps, NULL);
        gst_caps_unref(caps);
index 69b6fc7..02139b9 100644 (file)
@@ -185,7 +185,7 @@ public:
     else {
       QString preview = QString(PREVIEW_CAPS).arg(size.width()).arg(size.height());
 
-      GstCaps *caps = gst_caps_from_string(preview.toAscii());
+      GstCaps *caps = gst_caps_from_string(preview.toLatin1());
 
       g_object_set(dev->cameraBin, "preview-caps", caps, "post-previews", TRUE, NULL);
 
index 3acb000..2a56139 100644 (file)
@@ -40,13 +40,13 @@ public:
 
 void QtCamScannerPrivate::scanEnum() {
   // Too bad there's no way to get the values of an enum without creating the element :(
-  GstElement *elem = gst_element_factory_make(conf->videoSource().toAscii(), NULL);
+  GstElement *elem = gst_element_factory_make(conf->videoSource().toLatin1(), NULL);
   if (!elem) {
     return;
   }
 
   GParamSpec *spec = g_object_class_find_property(G_OBJECT_GET_CLASS(elem),
-                                                 conf->deviceScannerProperty().toAscii());
+                                                 conf->deviceScannerProperty().toLatin1());
   if (!spec) {
     gst_object_unref(elem);
     return;
index f996c9e..b6a205c 100644 (file)
@@ -155,7 +155,7 @@ GstElement *QtCamViewfinderRendererMeeGo::sinkElement() {
   }
 
   if (!m_sink) {
-    m_sink = gst_element_factory_make(m_conf->viewfinderSink().toAscii().data(),
+    m_sink = gst_element_factory_make(m_conf->viewfinderSink().toLatin1().data(),
                                      "QtCamViewfinderRendererMeeGoSink");
     if (!m_sink) {
       qCritical() << "Failed to create" << m_conf->viewfinderSink();