##// END OF EJS Templates
Add fix for default repository init
perrinel -
r1310:f8c4dc0020e5
parent child
Show More
@@ -41,8 +41,7 public:
41 41 /// retrieveEvents with empty repository retrieve them from the default repository
42 42 std::list<std::shared_ptr<DBEvent> > retrieveEvents(const QString &repository) const;
43 43 std::list<std::shared_ptr<DBEvent> > retrieveAllEvents() const;
44 std::list<std::shared_ptr<DBEvent> >
45 retrieveEventsFromCatalogue(std::shared_ptr<DBCatalogue> catalogue) const;
44
46 45 void addEvent(std::shared_ptr<DBEvent> event);
47 46 void updateEvent(std::shared_ptr<DBEvent> event);
48 47 void updateEventProduct(std::shared_ptr<DBEventProduct> eventProduct);
@@ -54,6 +53,8 public:
54 53 bool eventHasChanges(std::shared_ptr<DBEvent> event) const;
55 54
56 55 // Catalogue
56 std::list<std::shared_ptr<DBEvent> >
57 retrieveEventsFromCatalogue(std::shared_ptr<DBCatalogue> catalogue) const;
57 58 // bool createCatalogue(const QString &name, QVector<QUuid> eventList);
58 59 /// retrieveEvents with empty repository retrieve them from the default repository
59 60 std::list<std::shared_ptr<DBCatalogue> > retrieveCatalogues(const QString &repository
@@ -339,9 +339,23 void CatalogueController::initialize()
339 339 if (defaultRepositoryLocationDir.mkpath(defaultRepositoryLocation)) {
340 340 defaultRepositoryLocationDir.cd(defaultRepositoryLocation);
341 341 auto defaultRepository = defaultRepositoryLocationDir.absoluteFilePath(REPOSITORY_DEFAULT);
342
342 343 qCInfo(LOG_CatalogueController()) << tr("Persistant data loading from: ")
343 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 360 else {
347 361 qCWarning(LOG_CatalogueController())
General Comments 0
You need to be logged in to leave comments. Login now