Changeset 5842349


Ignore:
Timestamp:
01/18/10 15:00:32 (12 years ago)
Author:
fortefr <fortefr@…>
Branches:
master, qt5
Children:
5ff01fe
Parents:
ffd878f
Message:

Fav table update
M trunk/src/gui/mainwindow.h
M trunk/src/gui/mainwindow.cpp
M trunk/src/mvc/treeview.h
M trunk/src/mvc/eventmodel.cpp
M trunk/src/mvc/event.h
M trunk/src/fosdem.pro

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/fosdem.pro

    rffd878f r5842349  
    44maemo : SUBDIRS += alarm
    55#SUBDIRS += test
    6 CONFIG += ordered
     6CONFIG += ordered debug
    77
  • src/gui/mainwindow.cpp

    rffd878f r5842349  
    3737    connect(dayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateDayView(const QDate &)));
    3838
     39
    3940    // DAY EVENTS View
    4041    dayTreeView->setHeaderHidden(true);
     
    6768        dayNavigator->setDates(Conference::getById(confId).start(),Conference::getById(confId).end());
    6869    }
     70
     71    connect(static_cast<EventModel*>(dayTreeView->model()), SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), SLOT(updateFavView()));
     72    connect(static_cast<EventModel*>(favTreeView->model()), SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), SLOT(updateFavView()));
    6973}
    7074
     
    127131}
    128132
     133void MainWindow::updateFavView()
     134{
     135    int confId = 1;
     136    static_cast<EventModel*>(favTreeView->model())->loadFavEvents(Conference::getById(confId).start(),confId);
     137    favTreeView->reset();
     138    updateDayView(Conference::getById(confId).start());
     139}
  • src/gui/mainwindow.h

    rffd878f r5842349  
    2020    void aboutApp();
    2121    void updateDayView(const QDate &aDate);
     22    void updateFavView();
    2223private:
    2324    SqlEngine *mSqlEngine;
  • src/mvc/event.h

    rffd878f r5842349  
    2727public:
    2828    static Event getById(int id, int conferenceId);
    29     static Event getVirtualById(int id, int conferenceId);
    3029    static QList<Event> getByDate(const QDate& date, int conferenceId);
    3130    static QList<Event> getFavByDate(const QDate& date, int conferenceId); // get Favourities by Date
  • src/mvc/eventmodel.cpp

    rffd878f r5842349  
    4848    {
    4949        if (index.internalId() == 0)
    50         {   //range of time data
    51             //qDebug() << qVariantValue<QString>(mGroups.at(index.row()).mTitle);
     50        {
    5251            return mGroups.at(index.row()).mTitle;
    5352        }
    5453        else //event data
    5554        {
    56             //qDebug() << qVariantValue<QString>(static_cast<Event*>(index.internalPointer())->id());
    57             //return static_cast<Event*>(index.internalPointer())->id();
    58             //qDebug() << Event::getVirtualById(static_cast<Event*>(index.internalPointer())->id(), 1).title();// Id Conference is 1 by now
    59             //return 1;
    6055            return static_cast<Event*>(index.internalPointer())->id();
    6156        }
  • src/mvc/treeview.h

    rffd878f r5842349  
    33
    44#include <QTreeView>
     5
    56
    67class TreeView : public QTreeView
Note: See TracChangeset for help on using the changeset viewer.