Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/http/kcookiejar/kcookiejar.cpp
Show First 20 Lines • Show All 1093 Lines • ▼ Show 20 Line(s) | 1084 | { | |||
---|---|---|---|---|---|
1094 | return advice; | 1094 | return advice; | ||
1095 | } | 1095 | } | ||
1096 | 1096 | | |||
1097 | // | 1097 | // | ||
1098 | // This function sets the advice for all cookies originating from | 1098 | // This function sets the advice for all cookies originating from | ||
1099 | // _domain. | 1099 | // _domain. | ||
1100 | // | 1100 | // | ||
1101 | void KCookieJar::setDomainAdvice(const QString &_domain, KCookieAdvice _advice) | 1101 | void KCookieJar::setDomainAdvice(const QString &_domain, KCookieAdvice _advice) | ||
1102 | { | 1102 | { | ||
1103 | QString domain(_domain); | 1103 | KHttpCookieList *cookieList = m_cookieDomains.value(_domain); | ||
kossebau: This here seems some overleft from when the method actually needed a modfyable copy of _domain. | |||||
Hm, why the change of all _domain to domain, not the other way around? So: void foo(const Type arg) { // need to do non-const things with arg value, meh } -> void foo(const Type _arg) { Type arg(_arg); // do non-const things with arg value } kossebau: Hm, why the change of all _domain to domain, not the other way around?
The _xyz naming of… | |||||
1104 | KHttpCookieList *cookieList = m_cookieDomains.value(domain); | | |||
1105 | 1104 | | |||
1106 | if (cookieList) { | 1105 | if (cookieList) { | ||
1107 | if (cookieList->getAdvice() != _advice) { | 1106 | if (cookieList->getAdvice() != _advice) { | ||
1108 | m_configChanged = true; | 1107 | m_configChanged = true; | ||
1109 | // domain is already known | 1108 | // domain is already known | ||
1110 | cookieList->setAdvice(_advice); | 1109 | cookieList->setAdvice(_advice); | ||
1111 | } | 1110 | } | ||
1112 | 1111 | | |||
1113 | if ((cookieList->isEmpty()) && (_advice == KCookieDunno)) { | 1112 | if ((cookieList->isEmpty()) && (_advice == KCookieDunno)) { | ||
1114 | // This deletes cookieList! | 1113 | // This deletes cookieList! | ||
1115 | delete m_cookieDomains.take(domain); | 1114 | delete m_cookieDomains.take(_domain); | ||
1116 | m_domainList.removeAll(domain); | 1115 | m_domainList.removeAll(_domain); | ||
1117 | } | 1116 | } | ||
1118 | } else { | 1117 | } else { | ||
1119 | // domain is not yet known | 1118 | // domain is not yet known | ||
1120 | if (_advice != KCookieDunno) { | 1119 | if (_advice != KCookieDunno) { | ||
1121 | // We should create a domain entry | 1120 | // We should create a domain entry | ||
1122 | m_configChanged = true; | 1121 | m_configChanged = true; | ||
1123 | // Make a new cookie list | 1122 | // Make a new cookie list | ||
1124 | cookieList = new KHttpCookieList(); | 1123 | cookieList = new KHttpCookieList(); | ||
1125 | cookieList->setAdvice(_advice); | 1124 | cookieList->setAdvice(_advice); | ||
1126 | m_cookieDomains.insert(domain, cookieList); | 1125 | m_cookieDomains.insert(_domain, cookieList); | ||
1127 | // Update the list of domains | 1126 | // Update the list of domains | ||
1128 | m_domainList.append(domain); | 1127 | m_domainList.append(_domain); | ||
1129 | } | 1128 | } | ||
1130 | } | 1129 | } | ||
1131 | } | 1130 | } | ||
1132 | 1131 | | |||
1133 | // | 1132 | // | ||
1134 | // This function sets the advice for all cookies originating from | 1133 | // This function sets the advice for all cookies originating from | ||
1135 | // the same domain as _cookie | 1134 | // the same domain as _cookie | ||
1136 | // | 1135 | // | ||
▲ Show 20 Lines • Show All 479 Lines • Show Last 20 Lines |
This here seems some overleft from when the method actually needed a modfyable copy of _domain. Seems this in no longer the case.
So we can just rename _domain to domain in the arg list instead, and be done.