]> sigrok.org Git - pulseview.git/blobdiff - pv/prop/string.cpp
AnalogSignal: Make threshold neutral area darker
[pulseview.git] / pv / prop / string.cpp
index ebad62ba03510f8b8213c272b17d6cf462b77c51..96a83422e0a3e2a026336845ac20c72c876e7d35 100644 (file)
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <assert.h>
+#include <cassert>
 
 #include <QLineEdit>
 #include <QSpinBox>
 
-#include "string.h"
+#include "string.hpp"
 
 using std::string;
 
@@ -33,10 +32,11 @@ namespace pv {
 namespace prop {
 
 String::String(QString name,
+       QString desc,
        Getter getter,
        Setter setter) :
-       Property(name, getter, setter),
-       line_edit_(NULL)
+       Property(name, desc, getter, setter),
+       line_edit_(nullptr)
 {
 }
 
@@ -46,11 +46,11 @@ QWidget* String::get_widget(QWidget *parent, bool auto_commit)
                return line_edit_;
 
        if (!getter_)
-               return NULL;
+               return nullptr;
 
        Glib::VariantBase variant = getter_();
        if (!variant.gobj())
-               return NULL;
+               return nullptr;
 
        string value = Glib::VariantBase::cast_dynamic<Glib::Variant<ustring>>(
                variant).get();
@@ -81,5 +81,5 @@ void String::on_text_edited(const QString&)
        commit();
 }
 
-} // prop
-} // pv
+}  // namespace prop
+}  // namespace pv