- rollback to SQLCipher 3.0.1 - upgrade to 4.x requires more work

This commit is contained in:
Dmytro Bogovych 2023-12-21 10:46:17 +03:00
parent 3af11417aa
commit f347e6c32e
4 changed files with 22 additions and 2 deletions

View File

@ -138,6 +138,15 @@ bool date::operator >= (const date& rhs)
return std::tie(mYear, mMonth, mDay) >= std::tie(rhs.mYear, rhs.mMonth, rhs.mDay);
}
std::string date::toString() const
{
char buffer[32];
sprintf(buffer, "%02d:%02d:%02d", mDay, mMonth, mYear);
return buffer;
}
time::time(int h, int m, int s)
:mHour(h), mMinute(m), mSecond(s)
{}

View File

@ -39,6 +39,8 @@ namespace helper
bool operator > (const date& rhs);
bool operator == (const date& rhs);
bool operator >= (const date& rhs);
std::string toString() const;
};
struct time

View File

@ -228,7 +228,6 @@ bool Storage::open()
mDatabase->exec("pragma locking_mode=EXCLUSIVE");
mDatabase->exec("pragma journal_mode=MEMORY");
mDatabase->exec("pragma temp_store=MEMORY");
}
catch(std::exception& e)
{

View File

@ -3,7 +3,7 @@
#include "helper.h"
#include <QVariant>
#include <assert.h>
#include <iostream>
#if defined(TARGET_OSX) || defined(TARGET_LINUX)
# include <uuid/uuid.h>
@ -720,6 +720,16 @@ int TimeLine::month()
if (date::fromTimestamp(lowIter->endTime(), date::To_LocalTime).mMonth >= this_month.mMonth)
{
// For tests only
// auto date_start = date::fromTimestamp(lowIter->startTime(), date::To_LocalTime);
// auto time_start = time::fromTimestamp(lowIter->startTime(), date::To_LocalTime);
// auto date_end = date::fromTimestamp(lowIter->endTime(), date::To_LocalTime);
// auto time_end = time::fromTimestamp(lowIter->endTime(), date::To_LocalTime);
// std::cout << date_start.toString() << " " << time_start.toString() << " - "
// << date_end.toString() << " " << time_end.toString()
// << " id: " << lowIter->id() << std::endl;
// GMT time!
time_t month_begin = this_month.toTimestamp();
time_t month_end = month_begin + date::daysInMonth(this_month.mYear, this_month.mMonth) * 86400 - 1;