@@ -63,9 +63,8 void CatalogueController::addDB(const QString &dbPath) | |||
|
63 | 63 | qCCritical(LOG_CatalogueController()) |
|
64 | 64 | << tr("Impossible to addDB %1 from %2 ").arg(dirName, dbPath); |
|
65 | 65 | } |
|
66 | else | |
|
67 | { | |
|
68 | impl->m_RepositoryList << dirName; | |
|
66 | else { | |
|
67 | impl->m_RepositoryList.push_back(dirName); | |
|
69 | 68 | } |
|
70 | 69 | } |
|
71 | 70 | else { |
@@ -109,15 +108,24 void CatalogueController::initialize() | |||
|
109 | 108 | << QThread::currentThread(); |
|
110 | 109 | impl->m_WorkingMutex.lock(); |
|
111 | 110 | impl->m_CatalogueDao.initialize(); |
|
112 |
auto defaultRepository |
|
|
113 |
QStandardPaths:: |
|
|
114 | QDir defaultRepositoryDir(defaultRepository); | |
|
115 |
|
|
|
116 | qCInfo(LOG_CatalogueController()) << tr("Persistant data loading from: ") | |
|
117 | << defaultRepository; | |
|
111 | auto defaultRepositoryLocation | |
|
112 | = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); | |
|
113 | ||
|
114 | QDir defaultRepositoryLocationDir; | |
|
115 | if (defaultRepositoryLocationDir.mkpath(defaultRepositoryLocation)) { | |
|
116 | defaultRepositoryLocationDir.cd(defaultRepositoryLocation); | |
|
117 | auto defaultRepository = defaultRepositoryLocationDir.absoluteFilePath(REPOSITORY_DEFAULT); | |
|
118 | qCInfo(LOG_CatalogueController()) | |
|
119 | << tr("Persistant data loading from: ") << defaultRepository; | |
|
118 | 120 | this->addDB(defaultRepository); |
|
119 | qCDebug(LOG_CatalogueController()) << tr("CatalogueController init END"); | |
|
120 | 121 | } |
|
122 | else { | |
|
123 | qCWarning(LOG_CatalogueController()) | |
|
124 | << tr("Cannot load the persistent default repository from ") | |
|
125 | << defaultRepositoryLocation; | |
|
126 | } | |
|
127 | ||
|
128 | qCDebug(LOG_CatalogueController()) << tr("CatalogueController init END"); | |
|
121 | 129 | } |
|
122 | 130 | |
|
123 | 131 | void CatalogueController::finalize() |
General Comments 0
You need to be logged in to leave comments.
Login now