Changeset 6123b48


Ignore:
Timestamp:
01/27/10 13:31:23 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
33b5c34
Parents:
1bcd66f
Message:

implemented 'links' in Event/EventDialog?

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/gui/eventdialog.cpp

    r1bcd66f r6123b48  
    2424    abstract->setText(event.abstract());
    2525    description->setText(event.description());
     26    links->setText(static_cast<QStringList>(event.links().values()).join("\n"));
    2627
    2728    connect(favouriteButton, SIGNAL(clicked()), SLOT(favouriteClicked()));
  • src/mvc/event.cpp

    r1bcd66f r6123b48  
    125125}
    126126
     127QMap<QString,QString> Event::links() const
     128{
     129    QSqlQuery query;
     130    query.prepare("SELECT name,url FROM link WHERE xid_event = :id AND xid_conference = :conf");
     131    query.bindValue(":id", id());
     132    query.bindValue(":conf", conferenceId());
     133    query.exec();
     134    // TODO: handle qeury error
     135    //qDebug() << query.lastError();
     136
     137    QMap<QString,QString> links;
     138    while(query.next())
     139        links.insert(query.record().value("name").toString(), query.record().value("url").toString());
     140
     141    return links;
     142}
     143
    127144QList<int> Event::conflicts() const
    128145{
     
    232249}
    233250
     251void Event::setLinks(const QMap<QString,QString> &aLinks)
     252{
     253    Q_UNUSED(aLinks);
     254
     255    qWarning("WARINING: setLinks() is NOT IMPLEMENTED YET");
     256    // TODO: implement
     257}
     258
    234259QList<Event> Event::getSearchResultByDate(const QDate& date, int conferenceId, QString orderBy)
    235260{
  • src/mvc/event.h

    r1bcd66f r6123b48  
    4949    QStringList persons() const;
    5050    QList<int> conflicts() const;
     51    QMap<QString,QString> links() const;
    5152
    5253    void setId(int id) { setValue("id", id); }
     
    6768    void setRoom(const QString& room);
    6869    void setPersons(const QStringList &persons);
     70    void setLinks(const QMap<QString,QString> &aLinks);
    6971    void updateConflicts();
    7072
Note: See TracChangeset for help on using the changeset viewer.