From 4208387c4a6b7ecf43d756a8bba96b9cfc5227b9 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 10 Feb 2017 11:24:21 -0500 Subject: Renamed object validity checks The bool conversion operator was unfortunately Very Confusing so I've just renamed the methods to isValid. --- lib/form.h | 2 +- lib/frame.h | 2 +- lib/notion.h | 2 +- lib/part.h | 2 +- lib/pronunciation.h | 2 +- lib/word.cpp | 2 +- lib/word.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/form.h b/lib/form.h index fe0886c..f501ed2 100644 --- a/lib/form.h +++ b/lib/form.h @@ -28,7 +28,7 @@ namespace verbly { // Accessors - operator bool() const + bool isValid() const { return valid_; } diff --git a/lib/frame.h b/lib/frame.h index e049584..dfe67c0 100644 --- a/lib/frame.h +++ b/lib/frame.h @@ -26,7 +26,7 @@ namespace verbly { // Accessors - operator bool() const + bool isValid() const { return valid_; } diff --git a/lib/notion.h b/lib/notion.h index 4fd3396..69f5cef 100644 --- a/lib/notion.h +++ b/lib/notion.h @@ -25,7 +25,7 @@ namespace verbly { // Accessors - operator bool() const + bool isValid() const { return valid_; } diff --git a/lib/part.h b/lib/part.h index 450db3d..456bad0 100644 --- a/lib/part.h +++ b/lib/part.h @@ -62,7 +62,7 @@ namespace verbly { // General accessors - operator bool() const + bool isValid() const { return (type_ != part_type::invalid); } diff --git a/lib/pronunciation.h b/lib/pronunciation.h index 1162360..4723143 100644 --- a/lib/pronunciation.h +++ b/lib/pronunciation.h @@ -28,7 +28,7 @@ namespace verbly { // Accessors - operator bool() const + bool isValid() const { return valid_; } diff --git a/lib/word.cpp b/lib/word.cpp index 4dea569..e4de187 100644 --- a/lib/word.cpp +++ b/lib/word.cpp @@ -74,7 +74,7 @@ namespace verbly { throw std::domain_error("Bad access to uninitialized word"); } - if (!notion_) + if (!notion_.isValid()) { notion_ = db_->notions(notion::id == notionId_).first(); } diff --git a/lib/word.h b/lib/word.h index a16319d..dd72c39 100644 --- a/lib/word.h +++ b/lib/word.h @@ -28,7 +28,7 @@ namespace verbly { // Accessors - operator bool() const + bool isValid() const { return valid_; } -- cgit 1.4.1