diff options
author | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-04-29 08:36:33 (GMT) |
---|---|---|
committer | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-04-29 08:36:33 (GMT) |
commit | fbeba14bda563256846459b78b29cb888da695a4 (patch) | |
tree | 38b87098e90650630a0c4ecbcf385441fd520f03 | |
parent | 57a60d49a5d9d031144388b0fdf4d92e5e6c8571 (diff) | |
parent | 39ee4f868bb0415875413c224f44fd9d7c2a4496 (diff) | |
download | Qt-fbeba14bda563256846459b78b29cb888da695a4.zip Qt-fbeba14bda563256846459b78b29cb888da695a4.tar.gz Qt-fbeba14bda563256846459b78b29cb888da695a4.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
-rw-r--r-- | src/network/access/qnetworkcookiejar.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp | 15 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 24 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.h | 5 |
4 files changed, 38 insertions, 9 deletions
diff --git a/src/network/access/qnetworkcookiejar.cpp b/src/network/access/qnetworkcookiejar.cpp index 8727095..0b3a918 100644 --- a/src/network/access/qnetworkcookiejar.cpp +++ b/src/network/access/qnetworkcookiejar.cpp @@ -269,6 +269,7 @@ QList<QNetworkCookie> QNetworkCookieJar::cookiesForUrl(const QUrl &url) const Q_D(const QNetworkCookieJar); QDateTime now = QDateTime::currentDateTime(); QList<QNetworkCookie> result; + bool isEncrypted = url.scheme().toLower() == QLatin1String("https"); // scan our cookies for something that matches QList<QNetworkCookie>::ConstIterator it = d->allCookies.constBegin(), @@ -280,6 +281,8 @@ QList<QNetworkCookie> QNetworkCookieJar::cookiesForUrl(const QUrl &url) const continue; if (!(*it).isSessionCookie() && (*it).expirationDate() < now) continue; + if ((*it).isSecure() && !isEncrypted) + continue; // insert this cookie into result, sorted by path QList<QNetworkCookie>::Iterator insertIt = result.begin(); diff --git a/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp index f4c4429..01b9c0c 100644 --- a/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp +++ b/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp @@ -304,6 +304,21 @@ void tst_QNetworkCookieJar::cookiesForUrl_data() QTest::newRow("path-match-2") << allCookies << "http://nokia.com/web/" << result; QTest::newRow("path-match-3") << allCookies << "http://nokia.com/web/content" << result; + // secure cookies + allCookies.clear(); + result.clear(); + QNetworkCookie secureCookie; + secureCookie.setName("a"); + secureCookie.setPath("/web"); + secureCookie.setDomain(".nokia.com"); + secureCookie.setSecure(true); + allCookies += secureCookie; + QTest::newRow("no-match-secure-1") << allCookies << "http://nokia.com/web" << result; + QTest::newRow("no-match-secure-2") << allCookies << "http://qt.nokia.com/web" << result; + result += secureCookie; + QTest::newRow("match-secure-1") << allCookies << "https://nokia.com/web" << result; + QTest::newRow("match-secure-2") << allCookies << "https://qt.nokia.com/web" << result; + } void tst_QNetworkCookieJar::cookiesForUrl() diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 4b3c6e2..80dc6e3 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1263,7 +1263,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, } } - generateHeader(title, inner, marker, true); + generateHeader(title, inner, marker); sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); generateTableOfContents(inner,marker,§ions); generateTitle(title, subtitleText, SmallSubTitle, inner, marker); @@ -1474,7 +1474,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) htmlTitle = fullTitle; } - generateHeader(htmlTitle, fake, marker, true); + generateHeader(htmlTitle, fake, marker); /* Generate the TOC for the new doc format. @@ -1682,6 +1682,7 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, if (node->type() == Node::Class) { const ClassNode* cn = static_cast<const ClassNode*>(node); QString name = node->moduleName(); + out() << " <li><a href=\"modules.html\">All Modules</a></li>"; if (!name.isEmpty()) { out() << " <li>"; breadcrumb << Atom(Atom::AutoLink,name); @@ -1699,8 +1700,18 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, else if (node->type() == Node::Fake) { const FakeNode* fn = static_cast<const FakeNode*>(node); if (node->subType() == Node::Module) { + out() << " <li><a href=\"modules.html\">All Modules</a></li>"; + QString name = node->name(); + if (!name.isEmpty()) { + out() << " <li>"; + breadcrumb << Atom(Atom::AutoLink,name); + generateText(breadcrumb, 0, marker); + out() << "</li>\n"; + } } - else if (node->subType() == Node::Page) { + else if (node->subType() == Node::Group) { + if (fn->name() == QString("modules")) + out() << " <li><a href=\"modules.html\">All Modules</a></li>"; } else if (node->subType() == Node::QmlClass) { } @@ -1715,8 +1726,7 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title, void HtmlGenerator::generateHeader(const QString& title, const Node *node, - CodeMarker *marker, - bool mainPage) + CodeMarker *marker) { out() << QString("<?xml version=\"1.0\" encoding=\"%1\"?>\n").arg(outputEncoding); out() << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"; @@ -2082,7 +2092,7 @@ QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner, QString fileName = fileBase(inner) + "-members." + fileExtension(inner); beginSubPage(inner->location(), fileName); QString title = "List of All Members for " + inner->name(); - generateHeader(title, inner, marker, false); + generateHeader(title, inner, marker); generateTitle(title, Text(), SmallSubTitle, inner, marker); out() << "<p>This is the complete list of members for "; generateFullName(inner, 0, marker); @@ -2126,7 +2136,7 @@ QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner, } beginSubPage(inner->location(), fileName); - generateHeader(title, inner, marker, false); + generateHeader(title, inner, marker); generateTitle(title, Text(), SmallSubTitle, inner, marker); if (status == CodeMarker::Compat) { diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 68e620e..d80cbdb 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -134,8 +134,9 @@ class HtmlGenerator : public PageGenerator void generateBreadCrumbs(const QString& title, const Node *node, CodeMarker *marker); - void generateHeader(const QString& title, const Node *node = 0, - CodeMarker *marker = 0, bool mainPage = true); + void generateHeader(const QString& title, + const Node *node = 0, + CodeMarker *marker = 0); void generateTitle(const QString& title, const Text &subTitle, SubTitleSize subTitleSize, |