Skip to content

Commit

Permalink
Merge pull request #62 from sailfishos/separate_private_headers
Browse files Browse the repository at this point in the history
Separate private headers
  • Loading branch information
pvuorela committed May 23, 2023
2 parents 22292b4 + a2c4e3c commit 461ce46
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 35 deletions.
14 changes: 8 additions & 6 deletions src/CMakeLists.txt
Expand Up @@ -12,18 +12,20 @@ set(HEADERS
extendedstorage.h
extendedstorageobserver.h
notebook.h
sqliteformat.h
sqlitestorage.h
servicehandlerif.h
servicehandler.h
dummystorage.h
mkcal_export.h
logging_p.h
semaphore_p.h
invitationhandlerif.h
config-mkcal.h)
invitationhandlerif.h)

add_library(mkcal-qt5 SHARED ${SRC} ${HEADERS})
set(PRIVATE_HEADERS
logging_p.h
semaphore_p.h
sqliteformat.h
)

add_library(mkcal-qt5 SHARED ${SRC} ${HEADERS} ${PRIVATE_HEADERS})

target_link_libraries(mkcal-qt5
PRIVATE
Expand Down
2 changes: 0 additions & 2 deletions src/config-mkcal.h

This file was deleted.

40 changes: 13 additions & 27 deletions src/sqliteformat.h
Expand Up @@ -20,10 +20,6 @@
Boston, MA 02110-1301, USA.
*/
/**
@file
This file is part of the API for handling calendar data and
defines the SqliteFormat class.
@author Tero Aho \<ext-tero.1.aho@nokia.com\>
@author Pertti Luukko \<ext-pertti.luukko@nokia.com\>
*/
Expand All @@ -41,28 +37,25 @@

namespace mKCal {

/**
Database operation type.
*/
enum DBOperation {
DBInsert,
DBUpdate,
DBMarkDeleted,
DBDelete
};

/**
@brief
/*
Sqlite format implementation.
This class implements the Sqlite format. It provides methods for
loading/saving/converting Sqlite format data into the internal
representation as Calendar and Incidences.
*/
// exported just for unit test. Would be better to avoid.
class MKCAL_EXPORT SqliteFormat
{
public:
/**
/*
The different types of rdates.
*/
enum RDateType {
Expand All @@ -72,7 +65,7 @@ class MKCAL_EXPORT SqliteFormat
XDateTime
};

/**
/*
Values stored in the flag column of the calendars table.
*/
enum CalendarFlag {
Expand All @@ -89,17 +82,10 @@ class MKCAL_EXPORT SqliteFormat
Shareable = (1 << 10)
};

/**
Constructor a new Sqlite Format object.
*/
SqliteFormat(sqlite3 *database);

/**
Destructor.
*/
virtual ~SqliteFormat();

/**
/*
Update notebook data in Calendars table.
@param notebook notebook to update
Expand All @@ -110,7 +96,7 @@ class MKCAL_EXPORT SqliteFormat
*/
bool modifyCalendars(const Notebook &notebook, DBOperation dbop, sqlite3_stmt *stmt, bool isDefault);

/**
/*
Select notebooks from Calendars table.
@param stmt prepared sqlite statement for calendars table
Expand All @@ -119,7 +105,7 @@ class MKCAL_EXPORT SqliteFormat
*/
Notebook::Ptr selectCalendars(sqlite3_stmt *stmt, bool *isDefault);

/**
/*
Update incidence data in Components table.
@param incidence incidence to update
Expand All @@ -133,7 +119,7 @@ class MKCAL_EXPORT SqliteFormat
bool purgeDeletedComponents(const KCalendarCore::Incidence &incidence,
const QString &notebook = QString());

/**
/*
Select incidences from Components table.
@param stmt1 prepared sqlite statement for components table
Expand All @@ -147,37 +133,37 @@ class MKCAL_EXPORT SqliteFormat

// Helper Functions //

/**
/*
Convert datetime to seconds relative to the origin.
@param dt datetime
@return seconds relative to origin
*/
static sqlite3_int64 toOriginTime(const QDateTime &dt);

/**
/*
Convert local datetime to seconds relative to the origin.
@param dt datetime
@return seconds relative to origin
*/
static sqlite3_int64 toLocalOriginTime(const QDateTime &dt);

/**
/*
Convert seconds from the origin to clock time.
@param seconds relative to origin.
@return clocktime datetime.
*/
static QDateTime fromLocalOriginTime(sqlite3_int64 seconds);

/**
/*
Convert seconds from the origin to UTC datetime.
@param seconds relative to origin.
@return UTC datetime.
*/
static QDateTime fromOriginTime(sqlite3_int64 seconds);

/**
/*
Convert seconds from the origin to datetime in given timezone.
@param seconds relative to origin.
@param zonename timezone name.
Expand Down

0 comments on commit 461ce46

Please sign in to comment.