|
@ -1,28 +1,28 @@ |
|
|
#include <dirent.h>
|
|
|
|
|
|
#include <iterator>
|
|
|
|
|
|
#include <cstdlib>
|
|
|
#include <cstdlib>
|
|
|
#include <cstring>
|
|
|
#include <cstring>
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
|
#include <dirent.h>
|
|
|
#include <iostream>
|
|
|
#include <iostream>
|
|
|
|
|
|
#include <iterator>
|
|
|
|
|
|
#include <sstream>
|
|
|
#include <stdlib.h>
|
|
|
#include <stdlib.h>
|
|
|
#include <string>
|
|
|
#include <string>
|
|
|
#include <sys/stat.h>
|
|
|
#include <sys/stat.h>
|
|
|
#include <syslog.h>
|
|
|
#include <syslog.h>
|
|
|
|
|
|
#include <thread>
|
|
|
#include <unistd.h>
|
|
|
#include <unistd.h>
|
|
|
#include <vector>
|
|
|
#include <vector>
|
|
|
#include <thread>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <db/db.h>
|
|
|
|
|
|
|
|
|
#include <db/FSWatcher.h>
|
|
|
#include <db/create.h>
|
|
|
#include <db/create.h>
|
|
|
#include <db/update.h>
|
|
|
|
|
|
|
|
|
#include <db/db.h>
|
|
|
#include <db/fetch_alarms.h>
|
|
|
#include <db/fetch_alarms.h>
|
|
|
#include <db/FSWatcher.h>
|
|
|
|
|
|
#include <util/notifications.h>
|
|
|
|
|
|
#include <util/calendar_parsing.h>
|
|
|
|
|
|
|
|
|
#include <db/update.h>
|
|
|
#include <ical/IcalObject.h>
|
|
|
#include <ical/IcalObject.h>
|
|
|
|
|
|
|
|
|
#include <io/debug.h>
|
|
|
#include <io/debug.h>
|
|
|
|
|
|
#include <util/calendar_parsing.h>
|
|
|
|
|
|
#include <util/notifications.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const int MINUTE = 60; |
|
|
const int MINUTE = 60; |
|
|
const int SLEEP_INTERVAL = 60 * MINUTE; |
|
|
const int SLEEP_INTERVAL = 60 * MINUTE; |
|
@ -30,7 +30,6 @@ const int SLEEP_INTERVAL = 60 * MINUTE; |
|
|
sql::Database* init_database(std::string calendar) { |
|
|
sql::Database* init_database(std::string calendar) { |
|
|
return db::init(calendar + ".db"); |
|
|
return db::init(calendar + ".db"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void update_database(std::string directory, sql::Database *db) { |
|
|
void update_database(std::string directory, sql::Database *db) { |
|
|
std::vector<ical::IcalObject*> objects = util::parse_cal_dir(directory); |
|
|
std::vector<ical::IcalObject*> objects = util::parse_cal_dir(directory); |
|
|
for(auto const& obj : objects) { |
|
|
for(auto const& obj : objects) { |
|
|