コード例 #1
0
// DCOP function
QStringList KCookieServer::findCookies(QValueList< int > fields, QString domain, QString fqdn, QString path, QString name)
{
    QStringList result;
    bool allDomCookies = name.isEmpty();

    const KHttpCookieList *list = mCookieJar->getCookieList(domain, fqdn);
    if(list && !list->isEmpty())
    {
        QPtrListIterator< KHttpCookie > it(*list);
        for(; it.current(); ++it)
        {
            if(!allDomCookies)
            {
                if(cookieMatches(it.current(), domain, fqdn, path, name))
                {
                    putCookie(result, it.current(), fields);
                    break;
                }
            }
            else
                putCookie(result, it.current(), fields);
        }
    }
    return result;
}
コード例 #2
0
ファイル: kcookieserver.cpp プロジェクト: KDE/kio
 Q_FOREACH (const QString &domain, domainList) {
     const KHttpCookieList *list =  mCookieJar->getCookieList(domain, fqdn);
     if (!list) {
         continue;
     }
     Q_FOREACH (const KHttpCookie &cookie, *list) {
         if (cookie.isExpired()) {
             continue;
         }
         if (cookieMatches(cookie, domain, fqdn, path, name)) {
             putCookie(result, cookie, fields);
             break;
         }
     }
 }
コード例 #3
0
// DCOP function
void KCookieServer::deleteCookie(QString domain, QString fqdn, QString path, QString name)
{
    const KHttpCookieList *list = mCookieJar->getCookieList(domain, fqdn);
    if(list && !list->isEmpty())
    {
        QPtrListIterator< KHttpCookie > it(*list);
        for(; it.current(); ++it)
        {
            if(cookieMatches(it.current(), domain, fqdn, path, name))
            {
                mCookieJar->eatCookie(it.current());
                saveCookieJar();
                break;
            }
        }
    }
}