- Implement `cleanupOldData` in `DatabaseManager` to remove outdated entries and optimize storage. - Introduce `unlockScreen` in `AdbUtils` and integrate it into common scripts for screen unlocking. - Enhance `GeneralLogDAO` to support screenshot storage and retrieval. - Expand `FileLogWindow` with screenshot viewer and horizontal layout. - Add device ID migration logic in `BankProfileDAO` and `MaterialDAO`. - Improve error handling in `EventHandler` by saving and logging screenshots for critical events.
27 lines
510 B
C++
27 lines
510 B
C++
#pragma once
|
|
|
|
#include <QSqlDatabase>
|
|
#include <QString>
|
|
#include <QMap>
|
|
#include <QMutex>
|
|
#include <QSet>
|
|
|
|
class DatabaseManager {
|
|
public:
|
|
static DatabaseManager& instance();
|
|
|
|
QSqlDatabase database();
|
|
void initSchema();
|
|
void cleanupOldData(int days = 5);
|
|
void closeConnection();
|
|
|
|
private:
|
|
DatabaseManager();
|
|
~DatabaseManager();
|
|
|
|
static QString connectionName();
|
|
|
|
QRecursiveMutex mutex;
|
|
QSet<QString> activeConnections;
|
|
QMap<QString, QSqlDatabase> connectionPool;
|
|
}; |