X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fprop%2Fstring.cpp;h=7fcc656958b9fed74d6f91c89f29e2ebe58d429e;hp=c2b2c67c26a5c97377dff2b853759206ef65ffe7;hb=19adbc2c342b190161ec1223377a3619974b91f7;hpb=4e5a4405482a296ebb6014e627298ad156c78d55 diff --git a/pv/prop/string.cpp b/pv/prop/string.cpp index c2b2c67c..7fcc6569 100644 --- a/pv/prop/string.cpp +++ b/pv/prop/string.cpp @@ -25,9 +25,6 @@ #include "string.h" -using namespace std; -using namespace boost; - namespace pv { namespace prop { @@ -44,14 +41,14 @@ QWidget* String::get_widget(QWidget *parent, bool auto_commit) if (_line_edit) return _line_edit; - _line_edit = new QLineEdit(parent); - GVariant *const value = _getter ? _getter() : NULL; - if (value) { - _line_edit->setText(QString( - 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&)),