static void delEventAlarm( const Event &ev ) { QDateTime when; int warn; if ( nextAlarm(ev,when,warn) ) AlarmServer::deleteAlarm( when, "QPE/Application/datebook", "alarm(QDateTime,int)", warn ); }
void NotesManager::checkAlarm() { QString currStr = QDateTime::currentDateTime().toString(Qt::ISODate); QDateTime curr = QDateTime::fromString(currStr, Qt::ISODate); if (getAlarmTime() == curr) emit soundAlarm(getAlarmTime()); nextAlarm(); }
void QAppointmentIO::addAlarm(const QAppointment &appointment) { #ifdef Q_WS_QWS // TODO Needs to be able to set up the return to be a service. QDateTime when = nextAlarm(appointment); if (!when.isNull()) Qtopia::addAlarm(when, "Calendar", "alarm(QDateTime,int)", appointment.alarmDelay()); #else Q_UNUSED( appointment ); #endif }
bool NotesManager::init() { QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName(QCoreApplication::applicationDirPath() + "/notesmanager.db"); if (!db.open()) db.setDatabaseName(QDir::homePath() + "/notesmanager.db"); if (db.open()) { QSqlQuery create; create.exec("CREATE TABLE todolist(id INTEGER PRIMARY KEY, notes VARCHAR(255), date VARCHAR(255))"); nextAlarm(); QTimer *timer = new QTimer(this); QObject::connect(timer, SIGNAL(timeout()), this, SLOT(checkAlarm())); timer->start(1000); } else { return false; } return true; }