summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c6229d7)
We don't want to always clear and rewrite them all, in order to not lose additional
accountValues. So remember which accounts have been removed from the model, and only
delete those.
Also, useSsl should be on by default.
void setJumpKeyMap(const QHash<int, BufferId> &keyMap);
QHash<int, BufferId> jumpKeyMap();
void setJumpKeyMap(const QHash<int, BufferId> &keyMap);
QHash<int, BufferId> jumpKeyMap();
void setAccountValue(const QString &key, const QVariant &data);
QVariant accountValue(const QString &key, const QVariant &def = QVariant());
void setAccountValue(const QString &key, const QVariant &data);
QVariant accountValue(const QString &key, const QVariant &def = QVariant());
_internal = false;
_port = 4242;
_storePassword = false;
_internal = false;
_port = 4242;
_storePassword = false;
_useProxy = false;
_proxyType = QNetworkProxy::Socks5Proxy;
_proxyPort = 8080;
_useProxy = false;
_proxyType = QNetworkProxy::Socks5Proxy;
_proxyPort = 8080;
beginInsertRows(QModelIndex(), 0, other->_accounts.count() -1);
_internalAccount = other->internalAccount();
_accounts = other->_accounts;
beginInsertRows(QModelIndex(), 0, other->_accounts.count() -1);
_internalAccount = other->internalAccount();
_accounts = other->_accounts;
+ _removedAccounts = other->_removedAccounts;
void CoreAccountModel::save() {
CoreAccountSettings s;
void CoreAccountModel::save() {
CoreAccountSettings s;
+ foreach(AccountId id, _removedAccounts) {
+ s.removeAccount(id);
+ }
+ _removedAccounts.clear();
foreach(const CoreAccount &acc, accounts()) {
QVariantMap map = acc.toVariantMap(false); // TODO Hook into kwallet/password saving stuff
s.storeAccountData(acc.accountId(), map);
foreach(const CoreAccount &acc, accounts()) {
QVariantMap map = acc.toVariantMap(false); // TODO Hook into kwallet/password saving stuff
s.storeAccountData(acc.accountId(), map);
AccountId newId = 0;
const QList<AccountId> &ids = accountIds();
for(int i = 1; ; i++) {
AccountId newId = 0;
const QList<AccountId> &ids = accountIds();
for(int i = 1; ; i++) {
+ if(!_removedAccounts.contains(i) && !ids.contains(i)) {
void CoreAccountModel::removeAccount(AccountId accId) {
takeAccount(accId);
void CoreAccountModel::removeAccount(AccountId accId) {
takeAccount(accId);
+ _removedAccounts.insert(accId);
}
QModelIndex CoreAccountModel::accountIndex(AccountId accId) const {
}
QModelIndex CoreAccountModel::accountIndex(AccountId accId) const {
int listIndex(AccountId);
QList<CoreAccount> _accounts;
int listIndex(AccountId);
QList<CoreAccount> _accounts;
+ QSet<AccountId> _removedAccounts;
AccountId _internalAccount;
AccountId _internalAccount;