QList<AccountId> CoreAccountSettings::knownAccounts() {
QList<AccountId> ids;
foreach(QString key, localChildGroups()) {
- ids << key.toInt();
+ AccountId acc = key.toInt();
+ if(acc.isValid()) ids << acc;
}
return ids;
}
return localValue(QString("%1/%2/%3").arg(Client::currentCoreAccount().toInt()).arg(_subgroup).arg(key), def);
}
+void CoreAccountSettings::setJumpKeyMap(const QHash<int, BufferId> &keyMap) {
+ QVariantMap variants;
+ QHash<int, BufferId>::const_iterator mapIter = keyMap.constBegin();
+ while(mapIter != keyMap.constEnd()) {
+ variants[QString::number(mapIter.key())] = qVariantFromValue(mapIter.value());
+ mapIter++;
+ }
+ setLocalValue("JumpKeyMap", variants);
+}
+
+QHash<int, BufferId> CoreAccountSettings::jumpKeyMap() {
+ QHash<int, BufferId> keyMap;
+ QVariantMap variants = localValue("JumpKeyMap", QVariant()).toMap();
+ QVariantMap::const_iterator mapIter = variants.constBegin();
+ while(mapIter != variants.constEnd()) {
+ keyMap[mapIter.key().toInt()] = mapIter.value().value<BufferId>();
+ mapIter++;
+ }
+ return keyMap;
+}
+
void CoreAccountSettings::removeAccount(AccountId id) {
removeLocalKey(QString("%1").arg(id.toInt()));
}
+
/***********************************************************************************************/
+// NotificationSettings:
+
+NotificationSettings::NotificationSettings() : ClientSettings("Notification") {
+}
+
+void NotificationSettings::setHighlightList(const QVariantList &highlightList) {
+ setLocalValue("highlightList", highlightList);
+}
-BufferSettings::BufferSettings(BufferId bufferId)
- : CoreAccountSettings(QString("Buffers/%1").arg(bufferId.toInt()))
-{
+QVariantList NotificationSettings::highlightList() {
+ return localValue("highlightList").toList();
}
-void BufferSettings::setLastSeen(QDateTime seenDate) {
- setAccountValue("LastSeen", seenDate);
+void NotificationSettings::setHighlightNick(NotificationSettings::HighlightNickType highlightNickType) {
+ setLocalValue("highlightNick", highlightNickType);
}
-QDateTime BufferSettings::lastSeen() {
- return accountValue("LastSeen", QDateTime()).value<QDateTime>();
+NotificationSettings::HighlightNickType NotificationSettings::highlightNick() {
+ return (NotificationSettings::HighlightNickType) localValue("highlightNick", CurrentNick).toInt();
}