##// END OF EJS Templates
Add fix for default repository init
perrinel -
r1256:f8c4dc0020e5
parent child
Show More
@@ -41,8 +41,7 public:
41 /// retrieveEvents with empty repository retrieve them from the default repository
41 /// retrieveEvents with empty repository retrieve them from the default repository
42 std::list<std::shared_ptr<DBEvent> > retrieveEvents(const QString &repository) const;
42 std::list<std::shared_ptr<DBEvent> > retrieveEvents(const QString &repository) const;
43 std::list<std::shared_ptr<DBEvent> > retrieveAllEvents() const;
43 std::list<std::shared_ptr<DBEvent> > retrieveAllEvents() const;
44 std::list<std::shared_ptr<DBEvent> >
44
45 retrieveEventsFromCatalogue(std::shared_ptr<DBCatalogue> catalogue) const;
46 void addEvent(std::shared_ptr<DBEvent> event);
45 void addEvent(std::shared_ptr<DBEvent> event);
47 void updateEvent(std::shared_ptr<DBEvent> event);
46 void updateEvent(std::shared_ptr<DBEvent> event);
48 void updateEventProduct(std::shared_ptr<DBEventProduct> eventProduct);
47 void updateEventProduct(std::shared_ptr<DBEventProduct> eventProduct);
@@ -54,6 +53,8 public:
54 bool eventHasChanges(std::shared_ptr<DBEvent> event) const;
53 bool eventHasChanges(std::shared_ptr<DBEvent> event) const;
55
54
56 // Catalogue
55 // Catalogue
56 std::list<std::shared_ptr<DBEvent> >
57 retrieveEventsFromCatalogue(std::shared_ptr<DBCatalogue> catalogue) const;
57 // bool createCatalogue(const QString &name, QVector<QUuid> eventList);
58 // bool createCatalogue(const QString &name, QVector<QUuid> eventList);
58 /// retrieveEvents with empty repository retrieve them from the default repository
59 /// retrieveEvents with empty repository retrieve them from the default repository
59 std::list<std::shared_ptr<DBCatalogue> > retrieveCatalogues(const QString &repository
60 std::list<std::shared_ptr<DBCatalogue> > retrieveCatalogues(const QString &repository
@@ -339,9 +339,23 void CatalogueController::initialize()
339 if (defaultRepositoryLocationDir.mkpath(defaultRepositoryLocation)) {
339 if (defaultRepositoryLocationDir.mkpath(defaultRepositoryLocation)) {
340 defaultRepositoryLocationDir.cd(defaultRepositoryLocation);
340 defaultRepositoryLocationDir.cd(defaultRepositoryLocation);
341 auto defaultRepository = defaultRepositoryLocationDir.absoluteFilePath(REPOSITORY_DEFAULT);
341 auto defaultRepository = defaultRepositoryLocationDir.absoluteFilePath(REPOSITORY_DEFAULT);
342
342 qCInfo(LOG_CatalogueController()) << tr("Persistant data loading from: ")
343 qCInfo(LOG_CatalogueController()) << tr("Persistant data loading from: ")
343 << defaultRepository;
344 << defaultRepository;
344 this->addDB(defaultRepository);
345
346 QDir dbDir(defaultRepository);
347 impl->m_RepositoryList << REPOSITORY_DEFAULT;
348 if (dbDir.exists()) {
349 auto dirName = dbDir.dirName();
350
351 if (impl->m_CatalogueDao.addDB(defaultRepository, dirName)) {
352 impl->copyDBtoDB(dirName, impl->toWorkRepository(dirName));
353 }
354 }
355 else {
356 qCInfo(LOG_CatalogueController()) << tr("Initialisation of Default repository detected")
357 << defaultRepository;
358 }
345 }
359 }
346 else {
360 else {
347 qCWarning(LOG_CatalogueController())
361 qCWarning(LOG_CatalogueController())
General Comments 0
You need to be logged in to leave comments. Login now