]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/mvc/room.h
do not draw showmap button for event is there is no map for its room
[toast/confclerk.git] / src / mvc / room.h
index 11544a217fd7738c0093e8b3cb385b1f6c31fda4..b961458ff664e3675c50ba45bb8d272e703fa5b9 100644 (file)
@@ -35,7 +35,13 @@ public:
     QString name() const { return value("name").toString(); }
     void setName(const QString & type) { setValue("name", type); }
     // TODO: make naming consistent - either "picture" or "map"
-     QVariant map() const { return value("picture"); }
+    QVariant map() const { return value("picture"); }
+    bool hasMap() const
+    {
+        // empty strings also treasted as NULL,
+        // as storing NULLs requires rewrite of storing code and DB scheme
+        return !isNull("picture") and !value("picture").toString().isEmpty();
+    }
     int insert();
 public:
     static QList<Room> getAll();