<value key="192.168.1.4" type="QDateTime">2010-06-26T16:09:16</value>
<value key="localhost" type="QDateTime">2010-06-26T16:55:11</value>
</valuemap>
- <value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">8</value>
+ <value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">16</value>
<valuemap key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployed" type="QVariantMap">
<value key="192.168.1.4" type="QDateTime">2010-06-27T15:34:11</value>
- <value key="localhost" type="QDateTime">2010-06-27T15:12:49</value>
+ <value key="localhost" type="QDateTime">2010-06-28T19:25:15</value>
</valuemap>
</valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
class AlarmdBackend : public QObject {
Q_OBJECT
private:
- static time_t toTime_t(QTime t) {
+ static time_t toTime_t(const QTime &t) {
int time_diff = QTime::currentTime().secsTo(t);
if(time_diff < 0) {
// Add 24 hours
static void deleteEvents() {
// Get events cookies
QSettings settings("TimedSilencer", "TimedSilencer");
- cookie_t silent_cookie = settings.value("silencing_cookie", 0).toLongLong();
+ const cookie_t silent_cookie = settings.value("silencing_cookie", 0).toLongLong();
if(silent_cookie != 0) {
qDebug("Deleting silent profile event with cookie %ld", (long) silent_cookie);
alarmd_event_del(silent_cookie);
}
- cookie_t general_cookie = settings.value("unsilencing_cookie", 0).toLongLong();
+ const cookie_t general_cookie = settings.value("unsilencing_cookie", 0).toLongLong();
if(general_cookie != 0) {
qDebug("Deleting general profile event with cookie %ld", (long) general_cookie);
alarmd_event_del(general_cookie);
}
}
- static void setProfileEvent(Profile p, QTime event_time) {
+ static void setProfileEvent(Profile p, const QTime &event_time) {
// Get event cookie
QSettings settings("TimedSilencer", "TimedSilencer");
cookie_t cookie;
}
protected:
- static void newProfileEvent(Profile p, QTime event_time) {
+ static void newProfileEvent(Profile p, const QTime &event_time) {
// Create the default alarm struct.
alarm_event_t *newEvent = alarm_event_create();
// Set the APP ID
}
// Finally with everything setup, try to add your event to the alarm queue
- cookie_t cookie = alarmd_event_add(newEvent);
+ const cookie_t &cookie = alarmd_event_add(newEvent);
if(cookie != 0) {
// Save cookie
QSettings settings("TimedSilencer", "TimedSilencer");
if(p == SILENT) {
qDebug("Saving silent profile event cookie: %ld", (long)cookie);
- settings.setValue("silencing_cookie", static_cast<qlonglong>(cookie));
+ settings.setValue("silencing_cookie", static_cast<const qlonglong>(cookie));
} else {
qDebug("Saving silent general event cookie: %ld", (long)cookie);
- settings.setValue("unsilencing_cookie", static_cast<qlonglong>(cookie));
+ settings.setValue("unsilencing_cookie", static_cast<const qlonglong>(cookie));
}
return;
}