summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2010-12-15 16:53:26 +0200
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2010-12-15 16:53:26 +0200
commit75b60beadf7299ce491095582904fa0deda42358 (patch)
tree00ee9ec21abbb31d62104c2d7d14cf0c4717f486
parent176e229dc99aafe116f6859fd16362bd156f3b7a (diff)
Remove ugly casts that were used previously to make this code compile.
When we had a template Value(const T &) constructor, the compiler thought that passing a GValue* should make use of this template constructor instead of converting to const GValue* and using the Value(const GValue*) constructor.
-rw-r--r--src/QGlib/signal.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/QGlib/signal.cpp b/src/QGlib/signal.cpp
index 8c22c98..b2a8406 100644
--- a/src/QGlib/signal.cpp
+++ b/src/QGlib/signal.cpp
@@ -204,11 +204,11 @@ Value Signal::emit(void *instance, const char *detailedSignal, const QList<Value
g_signal_emitv(values, signal.id(), detail, &returnValue);
if (G_IS_VALUE(&returnValue)) {
- result = Value(static_cast<const GValue*>(&returnValue));
+ result = Value(&returnValue);
g_value_unset(&returnValue);
}
} catch (const QString & msg) {
- QString instanceName = Value(static_cast<const GValue*>(&values[0])).get<QString>();
+ QString instanceName = Value(&values[0]).toString();
qCritical() << "Error during emission of signal" << detailedSignal
<< "on object"<< instanceName << ":" << msg;
@@ -259,7 +259,7 @@ static void c_marshaller(GClosure *closure, GValue *returnValue, uint paramValue
}
try {
- Value result(static_cast<const GValue*>(returnValue));
+ Value result(returnValue);
cdata->marshaller(result, params);
if (returnValue) {