projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f459259
)
pv::prop::String: Do not create a widget if the initial value could not be retrieved
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sat, 25 Jan 2014 12:06:25 +0000
(12:06 +0000)
committer
Bert Vermeulen
<bert@biot.com>
Sat, 25 Jan 2014 14:34:00 +0000
(15:34 +0100)
pv/prop/string.cpp
patch
|
blob
|
history
diff --git
a/pv/prop/string.cpp
b/pv/prop/string.cpp
index 37efc148255848be1103e8cb5beca9ea48485c20..7fcc656958b9fed74d6f91c89f29e2ebe58d429e 100644
(file)
--- a/
pv/prop/string.cpp
+++ b/
pv/prop/string.cpp
@@
-41,14
+41,14
@@
QWidget* String::get_widget(QWidget *parent, bool auto_commit)
if (_line_edit)
return _line_edit;
if (_line_edit)
return _line_edit;
- _line_edit = new QLineEdit(parent);
-
GVariant *const value = _getter ? _getter() : NULL;
GVariant *const value = _getter ? _getter() : NULL;
- if (value) {
- _line_edit->setText(QString::fromUtf8(
- g_variant_get_string(value, NULL)));
- g_variant_unref(value);
- }
+ if (!value)
+ return NULL;
+
+ _line_edit = new QLineEdit(parent);
+ _line_edit->setText(QString::fromUtf8(
+ g_variant_get_string(value, NULL)));
+ g_variant_unref(value);
if (auto_commit)
connect(_line_edit, SIGNAL(textEdited(const QString&)),
if (auto_commit)
connect(_line_edit, SIGNAL(textEdited(const QString&)),