Changeset d06ae27 for src/mvc


Ignore:
Timestamp:
04/15/10 14:01:48 (12 years ago)
Author:
kirilma <kirilma@…>
Branches:
master, qt5
Children:
f5b68a4
Parents:
be9b645
Message:

store URL's for conferences

  • use it at update
  • let user update the url before request
Location:
src/mvc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/conference.cpp

    rbe9b645 rd06ae27  
    3030    << QSqlField("day_change", QVariant::Int)
    3131    << QSqlField("timeslot_duration", QVariant::Int)
    32     << QSqlField("active", QVariant::Bool));
     32    << QSqlField("active", QVariant::Bool)
     33    << QSqlField("url", QVariant::String));
    3334
    3435QString const Conference::sTableName = QString("conference");
     
    5859        activeConfs.append(query.record().value("id").toInt());
    5960
     61    qDebug() << __PRETTY_FUNCTION__
     62        << "activeConfs.count()" << activeConfs.count()
     63        ;
     64
    6065    if(activeConfs.count()==0) // no active DB
    6166        return 1;
  • src/mvc/conference.h

    rbe9b645 rd06ae27  
    4949    int timeslotDuration() const { return value("timeslot_duration").toInt(); } // in seconds
    5050    bool isActive() const { return value("active").toBool(); }
     51    QString getUrl() const
     52    {
     53        QVariant val = value("url");
     54        qDebug() << __PRETTY_FUNCTION__ << val;
     55        if (val.isValid()) {
     56            return val.toString();
     57        } else {
     58            return QString();
     59        }
     60    }
    5161
    5262    void setId(int id) { setValue("id", id); }
     
    6171    void setTimeslotDuration(int timeslotDuration) { setValue("timeslot_duration", timeslotDuration); }
    6272    void setActive(bool active) { setValue("active", (int)((active))); }
     73    void setUrl(const QString& url) { setValue("url", url.isNull() ? QVariant() : url); }
    6374};
    6475
Note: See TracChangeset for help on using the changeset viewer.