Ignore:
Timestamp:
05/05/10 15:56:14 (12 years ago)
Author:
kirilma <kirilma@…>
Branches:
master, qt5
Children:
58eb7cc
Parents:
3cdaf7d
Message:

store path to conference map in database

path stored as additional field in conference table
if it's null or empty, "Show map" button is not shown
if existing database does not have the field, it will be automatically added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/conference.h

    r3cdaf7d rcec47c6  
    5050    int timeslotDuration() const { return value("timeslot_duration").toInt(); } // in seconds
    5151    bool isActive() const { return value("active").toBool(); }
    52     QString url() const
    53     {
    54         QVariant val = value("url");
    55         qDebug() << __PRETTY_FUNCTION__ << val;
    56         if (val.isValid()) {
    57             return val.toString();
    58         } else {
    59             return QString();
    60         }
    61     }
     52    QString url() const { return stringFromNullable(value("url")); }
     53    QString map() const { return stringFromNullable(value("map")); }
    6254
    6355    #if 0
     
    7971        update("url");
    8072    }
     73
     74private:
     75    static QString stringFromNullable(const QVariant& v)
     76    {
     77        if (v.isValid()) {
     78            return v.toString();
     79        } else {
     80            return QString();
     81        }
     82    }
    8183};
    8284
Note: See TracChangeset for help on using the changeset viewer.