@@ -32,25 +32,28 public: | |||
|
32 | 32 | virtual ~CatalogueController(); |
|
33 | 33 | |
|
34 | 34 | // DB |
|
35 | QStringList getRepositories() const; | |
|
35 | // QStringList getRepositories() const; | |
|
36 | 36 | void addDB(const QString &dbPath); |
|
37 | 37 | void saveDB(const QString &destinationPath, const QString &repository); |
|
38 | 38 | |
|
39 | 39 | // Event |
|
40 | bool createEvent(const QString &name); | |
|
40 | // bool createEvent(const QString &name); | |
|
41 | 41 | std::list<std::shared_ptr<DBEvent> > retrieveEvents(const QString &repository) const; |
|
42 | 42 | std::list<std::shared_ptr<DBEvent> > retrieveAllEvents() const; |
|
43 |
|
|
|
44 | void trashEvent(std::shared_ptr<DBEvent> event); | |
|
45 | void removeEvent(std::shared_ptr<DBEvent> event); | |
|
46 | void restore(QUuid eventId); | |
|
47 |
|
|
|
43 | std::list<std::shared_ptr<DBEvent> > | |
|
44 | retrieveEventsFromCatalogue(const QString &repository, | |
|
45 | std::shared_ptr<DBCatalogue> catalogue) const; | |
|
46 | // void updateEvent(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 | 52 | // Catalogue |
|
50 | bool createCatalogue(const QString &name, QVector<QUuid> eventList); | |
|
51 |
|
|
|
52 | void removeEvent(QUuid catalogueId, const QString &repository); | |
|
53 | void saveCatalogue(std::shared_ptr<DBEvent> event); | |
|
53 | // bool createCatalogue(const QString &name, QVector<QUuid> eventList); | |
|
54 | std::list<std::shared_ptr<DBCatalogue> > getCatalogues(const QString &repository) const; | |
|
55 | // void removeEvent(QUuid catalogueId, const QString &repository); | |
|
56 | // void saveCatalogue(std::shared_ptr<DBEvent> event); | |
|
54 | 57 | |
|
55 | 58 | public slots: |
|
56 | 59 | /// Manage init/end of the controller |
@@ -102,6 +102,29 std::list<std::shared_ptr<DBEvent> > CatalogueController::retrieveAllEvents() co | |||
|
102 | 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 | 128 | void CatalogueController::initialize() |
|
106 | 129 | { |
|
107 | 130 | qCDebug(LOG_CatalogueController()) << tr("CatalogueController init") |
General Comments 0
You need to be logged in to leave comments.
Login now