<valuemap type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Maemo</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.MaemoDeviceTarget</value>
- <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">1</value>
+ <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
<value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
<valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
<valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
<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-29T00:09:20</value>
- <value key="localhost" type="QDateTime">2010-07-10T22:58:15</value>
+ <value key="localhost" type="QDateTime">2010-07-10T23:49:14</value>
</valuemap>
</valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
protected:
static long newProfileEvent(Profile p, const QTime &event_time, QList<int> days) {
Q_ASSERT(!days.empty());
+ qDebug("Registering an event");
if(days.empty()) days << NEVER;
// Create the default alarm struct.
alarm_event_t *newEvent = alarm_event_create();
if(days.first() == NEVER) {
newEvent->alarm_time = toTime_t(event_time); // Set event time
} else {
+ qDebug("Using the new recurrence API");
+ newEvent->recur_count = -1;
newEvent->recur_secs = 0; // We re not using this way for recurrence
alarm_recur_t* recur = alarm_event_add_recurrences(newEvent, 1);
// Set event time
- recur->mask_hour |= (1ul << event_time.hour());
- recur->mask_min |= (1ull << event_time.minute());
- recur->mask_wday |= daysToMask(days);
+ recur->special = ALARM_RECUR_SPECIAL_NONE;
+ recur->mask_mon = ALARM_RECUR_MON_ALL;
+ recur->mask_mday = ALARM_RECUR_MDAY_ALL;
+ recur->mask_hour = (1ul << event_time.hour());
+ recur->mask_min = (1ull << event_time.minute());
+ recur->mask_wday = daysToMask(days);
+ Q_ASSERT(newEvent->recurrence_cnt == 1);
}
}
//Add 1 action to our alarm event, and assign it to the "act" variable
foreach(int i, days) hasher.addData(QByteArray::number(i));
id = hasher.result();
}
- qDebug("getID(): %s", id.constData());
+ //qDebug("getID(): %s", id.constData());
return id;
}
static void clearCookies(QByteArray myid) {
QSettings settings("TimedSilencer", "TimedSilencer");
QHash<QString, QVariant> events = settings.value("events").toHash();
- Q_ASSERT(events.contains(myid));
+ //Q_ASSERT(events.contains(myid));
if(events.contains(myid)) {
qDebug("Clearing event cookies in QSettings");
ProfileEvent *pe = load(events.value(myid));
}
}
+ static void setStatus(QByteArray myid, bool status) {
+ QSettings settings("TimedSilencer", "TimedSilencer");
+ QHash<QString, QVariant> events = settings.value("events").toHash();
+ Q_ASSERT(events.contains(myid));
+ if(events.contains(myid)) {
+ qDebug("Setting event status in QSettings");
+ ProfileEvent *pe = load(events.value(myid));
+ pe->activated = status;
+ events[myid] = pe->save();
+ settings.setValue("events", events);
+ delete pe;
+ }
+ }
+
};
#endif // PROFILEEVENT_H
// Insert sort
int i = 0;
const int row = index.row();
- while(selected_rows.at(i) < row) ++i;
+ while(i < selected_rows.size() && selected_rows.at(i) < row) ++i;
selected_rows.insert(i, row);
}
emit selectedDays(selected_rows);
void SwitchingEventList::updateRow(int row, ProfileEvent *pe) {
model->setData(model->index(row, EV_STATUS), pe->activated, Qt::UserRole);
- model->setData(model->index(row, EV_FROM), pe->from_time.toString("HH:MM"));
- model->setData(model->index(row, EV_TO), pe->to_time.toString("HH:MM"));
+ model->setData(model->index(row, EV_FROM), pe->from_time.toString("HH:mm"));
+ model->setData(model->index(row, EV_TO), pe->to_time.toString("HH:mm"));
model->setData(model->index(row, EV_REPEAT), ProfileEvent::formatDays(pe->days));
model->setData(model->index(row, EV_ID), pe->getID());
}
// Toggle activated state
const bool new_status = !index.data(Qt::UserRole).toBool();
model->setData(index, new_status, Qt::UserRole);
+ ProfileEvent::setStatus(edited_id, new_status);
// Alter Alarmd events
if(new_status) {
// Was activated