##// END OF EJS Templates
CatalogueController: add few basic methods + commit the one not yet implemented
trabillard -
r1161:043d6b3a4bf6
parent child
Show More
@@ -32,25 +32,28 public:
32 virtual ~CatalogueController();
32 virtual ~CatalogueController();
33
33
34 // DB
34 // DB
35 QStringList getRepositories() const;
35 // QStringList getRepositories() const;
36 void addDB(const QString &dbPath);
36 void addDB(const QString &dbPath);
37 void saveDB(const QString &destinationPath, const QString &repository);
37 void saveDB(const QString &destinationPath, const QString &repository);
38
38
39 // Event
39 // Event
40 bool createEvent(const QString &name);
40 // bool createEvent(const QString &name);
41 std::list<std::shared_ptr<DBEvent> > retrieveEvents(const QString &repository) const;
41 std::list<std::shared_ptr<DBEvent> > retrieveEvents(const QString &repository) const;
42 std::list<std::shared_ptr<DBEvent> > retrieveAllEvents() const;
42 std::list<std::shared_ptr<DBEvent> > retrieveAllEvents() const;
43 void updateEvent(std::shared_ptr<DBEvent> event);
43 std::list<std::shared_ptr<DBEvent> >
44 void trashEvent(std::shared_ptr<DBEvent> event);
44 retrieveEventsFromCatalogue(const QString &repository,
45 void removeEvent(std::shared_ptr<DBEvent> event);
45 std::shared_ptr<DBCatalogue> catalogue) const;
46 void restore(QUuid eventId);
46 // void updateEvent(std::shared_ptr<DBEvent> event);
47 void saveEvent(std::shared_ptr<DBEvent> event);
47 // void trashEvent(std::shared_ptr<DBEvent> event);
48 // void removeEvent(std::shared_ptr<DBEvent> event);
49 // void restore(QUuid eventId);
50 // void saveEvent(std::shared_ptr<DBEvent> event);
48
51
49 // Catalogue
52 // Catalogue
50 bool createCatalogue(const QString &name, QVector<QUuid> eventList);
53 // bool createCatalogue(const QString &name, QVector<QUuid> eventList);
51 void getCatalogues(const QString &repository) const;
54 std::list<std::shared_ptr<DBCatalogue> > getCatalogues(const QString &repository) const;
52 void removeEvent(QUuid catalogueId, const QString &repository);
55 // void removeEvent(QUuid catalogueId, const QString &repository);
53 void saveCatalogue(std::shared_ptr<DBEvent> event);
56 // void saveCatalogue(std::shared_ptr<DBEvent> event);
54
57
55 public slots:
58 public slots:
56 /// Manage init/end of the controller
59 /// Manage init/end of the controller
@@ -102,6 +102,29 std::list<std::shared_ptr<DBEvent> > CatalogueController::retrieveAllEvents() co
102 return eventsShared;
102 return eventsShared;
103 }
103 }
104
104
105 std::list<std::shared_ptr<DBEvent> >
106 CatalogueController::retrieveEventsFromCatalogue(const QString &repository,
107 std::shared_ptr<DBCatalogue> catalogue) const
108 {
109 auto eventsShared = std::list<std::shared_ptr<DBEvent> >{};
110 auto events = impl->m_CatalogueDao.getCatalogueEvents(*catalogue);
111 for (auto event : events) {
112 eventsShared.push_back(std::make_shared<DBEvent>(event));
113 }
114 return eventsShared;
115 }
116
117 std::list<std::shared_ptr<DBCatalogue> >
118 CatalogueController::getCatalogues(const QString &repository) const
119 {
120 auto cataloguesShared = std::list<std::shared_ptr<DBCatalogue> >{};
121 auto catalogues = impl->m_CatalogueDao.getCatalogues(repository);
122 for (auto catalogue : catalogues) {
123 cataloguesShared.push_back(std::make_shared<DBCatalogue>(catalogue));
124 }
125 return cataloguesShared;
126 }
127
105 void CatalogueController::initialize()
128 void CatalogueController::initialize()
106 {
129 {
107 qCDebug(LOG_CatalogueController()) << tr("CatalogueController init")
130 qCDebug(LOG_CatalogueController()) << tr("CatalogueController init")
General Comments 3
Under Review
author

Auto status change to "Under Review"

Approved

Status change > Approved

You need to be logged in to leave comments. Login now