| 43 | } |
| 44 | |
| 45 | bool DatabaseThreadWorker::createDatabase(QString const& filename, openmittsu::protocol::ContactId const& selfContact, openmittsu::crypto::KeyPair const& selfLongTermKeyPair, QString const& password, QDir const& mediaStorageLocation) { |
| 46 | std::shared_ptr<openmittsu::database::Database> newDatabase = std::make_shared<openmittsu::database::SimpleDatabase>(filename, selfContact, selfLongTermKeyPair, password, mediaStorageLocation); |
| 47 | if (newDatabase) { |
| 48 | m_database = newDatabase; |
| 49 | return true; |
| 50 | } else { |
| 51 | LOGGER()->warn("Failed to create database!"); |
| 52 | return false; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | bool DatabaseThreadWorker::hasDatabase() const { |
| 57 | return m_database != nullptr; |
nothing calls this directly
no outgoing calls
no test coverage detected