X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fprop%2Fstring.cpp;h=e7af45973cc92950aef95c8c4ba50d0357b8132b;hp=511fe6c4352de19356c36604b5d1479e8ab46319;hb=4c60462b00cc329e61daedd1c2e66724077bd412;hpb=e8d009288de28cb194bc7964f96677c2baf900c9 diff --git a/pv/prop/string.cpp b/pv/prop/string.cpp index 511fe6c4..e7af4597 100644 --- a/pv/prop/string.cpp +++ b/pv/prop/string.cpp @@ -23,7 +23,7 @@ #include #include -#include "string.h" +#include "string.hpp" using std::string; @@ -36,44 +36,44 @@ String::String(QString name, Getter getter, Setter setter) : Property(name, getter, setter), - _line_edit(NULL) + line_edit_(nullptr) { } QWidget* String::get_widget(QWidget *parent, bool auto_commit) { - if (_line_edit) - return _line_edit; + if (line_edit_) + return line_edit_; - if (!_getter) - return NULL; + if (!getter_) + return nullptr; - Glib::VariantBase variant = _getter(); + Glib::VariantBase variant = getter_(); if (!variant.gobj()) - return NULL; + return nullptr; string value = Glib::VariantBase::cast_dynamic>( variant).get(); - _line_edit = new QLineEdit(parent); - _line_edit->setText(QString::fromStdString(value)); + line_edit_ = new QLineEdit(parent); + line_edit_->setText(QString::fromStdString(value)); if (auto_commit) - connect(_line_edit, SIGNAL(textEdited(const QString&)), + connect(line_edit_, SIGNAL(textEdited(const QString&)), this, SLOT(on_text_edited(const QString&))); - return _line_edit; + return line_edit_; } void String::commit() { - assert(_setter); + assert(setter_); - if (!_line_edit) + if (!line_edit_) return; - QByteArray ba = _line_edit->text().toLocal8Bit(); - _setter(Glib::Variant::create(ba.data())); + QByteArray ba = line_edit_->text().toLocal8Bit(); + setter_(Glib::Variant::create(ba.data())); } void String::on_text_edited(const QString&)