Changeset View
Changeset View
Standalone View
Standalone View
src/engine/database.cpp
Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Line(s) | 228 | { | |||
---|---|---|---|---|---|
230 | return m_env != nullptr; | 230 | return m_env != nullptr; | ||
231 | } | 231 | } | ||
232 | 232 | | |||
233 | QString Database::path() const | 233 | QString Database::path() const | ||
234 | { | 234 | { | ||
235 | QMutexLocker locker(&m_mutex); | 235 | QMutexLocker locker(&m_mutex); | ||
236 | return m_path; | 236 | return m_path; | ||
237 | } | 237 | } | ||
238 | | ||||
239 | bool Database::copy(const QString& destination, bool omitFreePages) const | ||||
240 | { | ||||
241 | // Copying | ||||
242 | int rc = mdb_env_copy2(m_env, destination.toLocal8Bit().data(), omitFreePages ? MDB_CP_COMPACT : 0); | ||||
243 | Q_ASSERT_X(rc == 0, "Database::copy", mdb_strerror(rc)); | ||||
244 | return rc == 0; | ||||
245 | } |