[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdebase/kcontrol/kio
From: Dawit Alemayehu <adawit () kde ! org>
Date: 2004-10-30 17:08:00
Message-ID: 20041030170800.00FE016C09 () office ! kde ! org
[Download RAW message or body]
CVS commit by adawit:
Clean up...
M +53 -61 kcookiesmanagement.cpp 1.44
--- kdebase/kcontrol/kio/kcookiesmanagement.cpp #1.43:1.44
@@ -146,9 +146,5 @@ void KCookiesManagement::save()
if(m_bDeleteAll)
{
- if(DCOPRef("kded", "kcookiejar").send("deleteAllCookies"))
- {
- m_bDeleteAll = false; // deleted[Cookies|Domains] have been cleared yet
- }
- else
+ if(!DCOPRef("kded", "kcookiejar").send("deleteAllCookies"))
{
QString caption = i18n ("DCOP Communication Error");
@@ -157,4 +153,6 @@ void KCookiesManagement::save()
return;
}
+
+ m_bDeleteAll = false; // deleted[Cookies|Domains] have been cleared yet
}
@@ -169,9 +167,5 @@ void KCookiesManagement::save()
callStream << *dIt;
- if(DCOPRef("kded", "kcookiejar").send("deleteCookiesFromDomain", (*dIt)))
- {
- dIt = deletedDomains.remove(dIt);
- }
- else
+ if( !DCOPRef("kded", "kcookiejar").send("deleteCookiesFromDomain", (*dIt)) )
{
QString caption = i18n ("DCOP Communication Error");
@@ -180,4 +174,6 @@ void KCookiesManagement::save()
return;
}
+
+ dIt = deletedDomains.remove(dIt);
}
@@ -185,4 +181,5 @@ void KCookiesManagement::save()
bool success = true; // Maybe we can go on...
QDictIterator<CookiePropList> cookiesDom(deletedCookies);
+
while(cookiesDom.current())
{
@@ -192,22 +189,21 @@ void KCookiesManagement::save()
while(*cookie)
{
- if( DCOPRef("kded", "kcookiejar").send("deleteCookie",(*cookie)->domain,
+ if( !DCOPRef("kded", "kcookiejar").send("deleteCookie",(*cookie)->domain,
(*cookie)->host, (*cookie)->path,
(*cookie)->name) )
{
- list->removeRef(*cookie);
- }
- else
- {
success = false;
break;
}
+
+ list->removeRef(*cookie);
}
- if(success)
- deletedCookies.remove(cookiesDom.currentKey());
- else
+ if(!success)
break;
+
+ deletedCookies.remove(cookiesDom.currentKey());
}
+
emit changed( false );
}
@@ -224,4 +220,5 @@ void KCookiesManagement::reset(bool dele
if ( !deleteAll )
m_bDeleteAll = false;
+
clearCookieDetails();
dlg->lvCookies->clear();
@@ -252,6 +249,13 @@ void KCookiesManagement::getDomains()
DCOPReply reply = DCOPRef("kded", "kcookiejar").call("findDomains");
- if(reply.isValid())
+ if( !reply.isValid() )
{
+ QString caption = i18n ("Information Lookup Failure");
+ QString message = i18n ("Unable to retrieve information about the "
+ "cookies stored on your computer.");
+ KMessageBox::sorry (this, caption, message);
+ return;
+ }
+
QStringList domains = reply;
@@ -263,19 +267,9 @@ void KCookiesManagement::getDomains()
CookieListViewItem *dom;
- QStringList::Iterator dIt = domains.begin();
- for( ; dIt != domains.end(); dIt++)
+ for(QStringList::Iterator dIt = domains.begin(); dIt != domains.end(); dIt++)
{
dom = new CookieListViewItem(dlg->lvCookies, *dIt);
dom->setExpandable(true);
}
- }
- else
- {
- QString caption = i18n ("Information Lookup Failure");
- QString message = i18n ("Unable to retrieve information about the "
- "cookies stored on your computer.");
- KMessageBox::sorry (this, caption, message);
- return;
- }
// are ther any cookies?
@@ -329,6 +323,7 @@ bool KCookiesManagement::cookieDetails(C
cookie->path,
cookie->name);
- if( reply.isValid() )
- {
+ if( !reply.isValid() )
+ return false;
+
QStringList fieldVal = reply;
@@ -350,7 +345,4 @@ bool KCookiesManagement::cookieDetails(C
cookie->allLoaded = true;
return true;
- }
-
- return false;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic