X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lib%2Fqtcamcapability_p.h;h=51b36f22aad1c6b67d43c1c0aafd35357f3356ea;hb=0da718e86100458cc336d51ca79554e4fbac415d;hp=4cc43a9ce611b0d7018ef9abd6814883f11e43e1;hpb=83aa2ca8c533cace99d5dddfd424ddcd83d1f7f5;p=harmattan%2Fcameraplus diff --git a/lib/qtcamcapability_p.h b/lib/qtcamcapability_p.h index 4cc43a9..51b36f2 100644 --- a/lib/qtcamcapability_p.h +++ b/lib/qtcamcapability_p.h @@ -1,9 +1,30 @@ // -*- c++ -*- +/*! + * This file is part of CameraPlus. + * + * Copyright (C) 2012-2013 Mohammed Sameer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + #ifndef QT_CAM_CAPABILITY_P_H #define QT_CAM_CAPABILITY_P_H #include +#include "qtcamcapability.h" #include "qtcamdevice.h" #include "qtcamdevice_p.h" @@ -34,10 +55,18 @@ public: } + GParamSpec *paramSpec() { + if (!src || prop.isEmpty()) { + return 0; + } + + return g_object_class_find_property(G_OBJECT_GET_CLASS(src), prop.toUtf8().constData()); + } + 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); } } @@ -52,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; } @@ -62,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; } @@ -72,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; } @@ -83,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; @@ -102,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; } @@ -112,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; }