Might revisit this later.
QDebug operator<<(QDebug, QList<RTComElAttachment*> &);
RtcomEventLogger::RtcomEventLogger(const Settings &settings) :
QDebug operator<<(QDebug, QList<RTComElAttachment*> &);
RtcomEventLogger::RtcomEventLogger(const Settings &settings) :
- m_Settings(settings), mk_DBPath("/.rtcom-eventlogger/el-v1.db")
{
RTComEl *el(rtcom_el_new());
if(NULL != el)
{
RTComEl *el(rtcom_el_new());
if(NULL != el)
}
RtcomEventLogger::RtcomEventLogger(const Settings &settings, const EventTypes::RtcomEvent &event) :
}
RtcomEventLogger::RtcomEventLogger(const Settings &settings, const EventTypes::RtcomEvent &event) :
- m_Settings(settings), mk_DBPath("/.rtcom-eventlogger/el-v1.db")
void RtcomEventLogger::Reindex()
{
// Set up the database connection...
void RtcomEventLogger::Reindex()
{
// Set up the database connection...
- QSqlDatabase db(QSqlDatabase::addDatabase( "QSQLITE" ));
+ QSqlDatabase db(QSqlDatabase::addDatabase("QSQLITE"));
- db.setDatabaseName( QDir::homePath() + mk_DBPath );
- if ( ! db.open() )
+ db.setDatabaseName(CurrentSettings().DBPath());
+ if(!db.open())
{
throw std::runtime_error("Cannot open database: Unable to establish database connection");
}
{
throw std::runtime_error("Cannot open database: Unable to establish database connection");
}
void Reindex();
const Settings &m_Settings;
void Reindex();
const Settings &m_Settings;
- const QString mk_DBPath;
QHash<EventTypes::eEventTypes, int> m_ServiceIDs;
QHash<EventTypes::eEventTypes, int> m_ServiceIDs;
Settings::Settings()
{
// Default to console
Settings::Settings()
{
// Default to console
// It's OK to disable the radio by default
setDisableCellular(true);
// It's OK to disable the radio by default
setDisableCellular(true);
+
+ // Where it lives...
+ DBPath(QDir::homePath() + "/.rtcom-eventlogger/el-v1.db");
// Is it OK to disable the cellular radio to prevent calls and messages?
bool m_DisableCellular;
// Is it OK to disable the cellular radio to prevent calls and messages?
bool m_DisableCellular;
+ // RtcomEventLogger path
+ QString m_DBPath;
+ void DBPath(QString dbPath) { m_DBPath = dbPath; }
+
bool const DisableCellular() const { return m_DisableCellular; }
bool const setDisableCellular(const bool disableCellular) { return m_DisableCellular = disableCellular; }
bool const DisableCellular() const { return m_DisableCellular; }
bool const setDisableCellular(const bool disableCellular) { return m_DisableCellular = disableCellular; }
+
+ const QString &DBPath() const { return m_DBPath; }