~ubuntu-branches/ubuntu/jaunty/kde4libs/jaunty

« back to all changes in this revision

Viewing changes to kioslave/http/kcookiejar/kcookieserver.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Wenning, Jonathan Thomas, Andreas Wenning
  • Date: 2009-04-01 05:55:52 UTC
  • mfrom: (1.1.29 upstream)
  • Revision ID: james.westby@ubuntu.com-20090401055552-uel5di5f3xiftax3
Tags: 4:4.2.2-0ubuntu1
[ Jonathan Thomas ]
* New upstream release (LP: #344709, #348823):
  - Bump upstreamversion and runtimedeps in debian/rules
  - Remove kubuntu_65_kcmdlineargs_decoding_svn934640.diff, applied upstream

[ Andreas Wenning ]
* Remove patch kubuntu_69_do_not_show_plasma_popups_over_screensaver.diff,
  applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
    if (cookieList || list->isEmpty())
195
195
       return;
196
196
 
 
197
    // Collect all pending cookies with the same host as the first pending cookie
197
198
    const KHttpCookie& currentCookie = mPendingCookies->first();
198
 
 
199
199
    KHttpCookieList currentList;
200
200
    currentList.append(currentCookie);
201
 
    QString currentHost = currentCookie.host();
202
 
 
203
 
    Q_FOREACH(const KHttpCookie& cookie, *mPendingCookies) {
 
201
    const QString currentHost = currentCookie.host();
 
202
    QList<int> shownCookies; shownCookies << 0;
 
203
    for (int i = 1 /*first already done*/; i < mPendingCookies->count(); ++i) {
 
204
        const KHttpCookie& cookie = (*mPendingCookies)[i];
204
205
        if (cookie.host() == currentHost) {
205
206
            currentList.append(cookie);
 
207
            shownCookies << i;
206
208
        }
207
209
    }
 
210
    kDebug() << shownCookies;
208
211
 
209
212
    KCookieWin *kw = new KCookieWin( 0L, currentList,
210
213
                                     mCookieJar->preferredDefaultPolicy(),
215
218
    mCookieJar->saveConfig( mConfig );
216
219
 
217
220
    // Apply the user's choice to all cookies that are currently
218
 
    // queued for this host.
 
221
    // queued for this host (or just the first one, if the user asks for that).
219
222
    QMutableListIterator<KHttpCookie> cookieIterator2(*mPendingCookies);
 
223
    int pendingCookieIndex = -1;
220
224
    while (cookieIterator2.hasNext()) {
 
225
        ++pendingCookieIndex;
221
226
        KHttpCookie& cookie = cookieIterator2.next();
222
227
        if (cookie.host() != currentHost)
223
228
            continue;
 
229
        if (mCookieJar->preferredDefaultPolicy() == KCookieJar::ApplyToShownCookiesOnly
 
230
            && !shownCookies.contains(pendingCookieIndex)) {
 
231
            // User chose "only those cookies", and this one was added while the dialog was up -> skip
 
232
            break;
 
233
        }
224
234
        switch(userAdvice) {
225
235
           case KCookieAccept:
226
236
               mCookieJar->addCookie(cookie);