summaryrefslogtreecommitdiffstats
path: root/kio/misc/kwalletd/kwalletd.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 03:46:01 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-11 03:46:01 +0000
commit865f314dd5ed55508f45a32973b709b79a541e36 (patch)
treedc1a3a884bb2fc10a89a3c46313897d22c5771eb /kio/misc/kwalletd/kwalletd.cpp
parentce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (diff)
downloadtdelibs-865f314dd5ed55508f45a32973b709b79a541e36.tar.gz
tdelibs-865f314dd5ed55508f45a32973b709b79a541e36.zip
kdelibs update to Trinity v3.5.11
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1061230 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kio/misc/kwalletd/kwalletd.cpp')
-rw-r--r--kio/misc/kwalletd/kwalletd.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/kio/misc/kwalletd/kwalletd.cpp b/kio/misc/kwalletd/kwalletd.cpp
index 686a99d6f..3fa32ff71 100644
--- a/kio/misc/kwalletd/kwalletd.cpp
+++ b/kio/misc/kwalletd/kwalletd.cpp
@@ -829,6 +829,12 @@ bool KWalletD::removeFolder(int handle, const QString& f) {
if ((b = getWallet(friendlyDCOPPeerName(), handle))) {
bool rc = b->removeFolder(f);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
QByteArray data;
QDataStream ds(data, IO_WriteOnly);
ds << b->walletName();
@@ -845,6 +851,12 @@ bool KWalletD::createFolder(int handle, const QString& f) {
if ((b = getWallet(friendlyDCOPPeerName(), handle))) {
bool rc = b->createFolder(f);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
QByteArray data;
QDataStream ds(data, IO_WriteOnly);
ds << b->walletName();
@@ -987,6 +999,12 @@ int KWalletD::writeMap(int handle, const QString& folder, const QString& key, co
e.setValue(value);
e.setType(KWallet::Wallet::Map);
b->writeEntry(&e);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return 0;
}
@@ -1005,6 +1023,12 @@ int KWalletD::writeEntry(int handle, const QString& folder, const QString& key,
e.setValue(value);
e.setType(KWallet::Wallet::EntryType(entryType));
b->writeEntry(&e);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return 0;
}
@@ -1023,6 +1047,12 @@ int KWalletD::writeEntry(int handle, const QString& folder, const QString& key,
e.setValue(value);
e.setType(KWallet::Wallet::Stream);
b->writeEntry(&e);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return 0;
}
@@ -1041,6 +1071,12 @@ int KWalletD::writePassword(int handle, const QString& folder, const QString& ke
e.setValue(value);
e.setType(KWallet::Wallet::Password);
b->writeEntry(&e);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return 0;
}
@@ -1090,6 +1126,12 @@ int KWalletD::removeEntry(int handle, const QString& folder, const QString& key)
}
b->setFolder(folder);
bool rc = b->removeEntry(key);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return rc ? 0 : -3;
}
@@ -1183,6 +1225,12 @@ int KWalletD::renameEntry(int handle, const QString& folder, const QString& oldN
if ((b = getWallet(friendlyDCOPPeerName(), handle))) {
b->setFolder(folder);
int rc = b->renameEntry(oldName, newName);
+ // write changes to disk immediately
+ QByteArray p;
+ QString wallet = b->walletName();
+ p.duplicate(_passwords[wallet].data(), _passwords[wallet].length());
+ b->sync(p);
+ p.fill(0);
emitFolderUpdated(b->walletName(), folder);
return rc;
}