summaryrefslogtreecommitdiffstats
path: root/examples/network
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/bearercloud/bluetooth.svg24
-rw-r--r--examples/network/bearercloud/cell.svg25
-rw-r--r--examples/network/bearercloud/cloud.cpp45
-rw-r--r--examples/network/bearercloud/gprs.svg199
-rw-r--r--examples/network/bearercloud/icons.qrc4
-rwxr-xr-x[-rw-r--r--]examples/network/bearercloud/lan.svg107
-rw-r--r--examples/network/bearercloud/umts.svg200
-rw-r--r--examples/network/bearermonitor/sessionwidget.cpp4
-rw-r--r--examples/network/download/main.cpp2
-rw-r--r--examples/network/fortuneserver/fortuneserver.pro2
-rw-r--r--examples/network/fortuneserver/server.cpp24
-rw-r--r--examples/network/http/httpwindow.cpp2
-rw-r--r--examples/network/network.pro5
-rw-r--r--examples/network/torrent/torrent.pro2
-rw-r--r--examples/network/torrent/torrentclient.cpp22
15 files changed, 550 insertions, 117 deletions
diff --git a/examples/network/bearercloud/bluetooth.svg b/examples/network/bearercloud/bluetooth.svg
new file mode 100644
index 0000000..32e2fa3
--- /dev/null
+++ b/examples/network/bearercloud/bluetooth.svg
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 12.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+ <!ENTITY ns_svg "http://www.w3.org/2000/svg">
+ <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
+]>
+<svg version="1.1" id="&#x56FE;&#x5C42;_1" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="21.792" height="21.819"
+ viewBox="0 0 21.792 21.819" overflow="visible" enable-background="new 0 0 21.792 21.819" xml:space="preserve">
+<linearGradient id="XMLID_2_" gradientUnits="userSpaceOnUse" x1="11.0322" y1="2.8701" x2="11.0322" y2="21.2133">
+ <stop offset="0" style="stop-color:#95D1DB"/>
+ <stop offset="0.0684" style="stop-color:#7FBAE0"/>
+ <stop offset="0.2073" style="stop-color:#5892EA"/>
+ <stop offset="0.3506" style="stop-color:#3871F1"/>
+ <stop offset="0.4971" style="stop-color:#2058F7"/>
+ <stop offset="0.648" style="stop-color:#0E45FC"/>
+ <stop offset="0.8061" style="stop-color:#033BFE"/>
+ <stop offset="0.9831" style="stop-color:#0037FF"/>
+</linearGradient>
+<path fill="url(#XMLID_2_)" stroke="#4D4D4D" stroke-width="0.5" stroke-linejoin="round" d="M10.496,10.931l5.303-4.672
+ L9.172,0.292l-0.05,9.427L9.109,9.708v0.029L7.304,8.168L6.266,9.364l1.802,1.567l-1.802,1.567l1.038,1.195l1.806-1.569v0.029
+ l0.013-0.012l0.05,9.428l6.627-5.966L10.496,10.931z M10.672,3.993l2.502,2.252l-2.525,2.225L10.672,3.993z M13.174,15.617
+ l-2.502,2.252l-0.023-4.477L13.174,15.617z"/>
+<rect opacity="0" fill="#FFFFFF" width="21.792" height="21.792"/>
+</svg>
diff --git a/examples/network/bearercloud/cell.svg b/examples/network/bearercloud/cell.svg
new file mode 100644
index 0000000..7519868
--- /dev/null
+++ b/examples/network/bearercloud/cell.svg
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 12.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+ <!ENTITY ns_svg "http://www.w3.org/2000/svg">
+ <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
+]>
+<svg version="1.1" id="&#x56FE;&#x5C42;_1" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="15.667" height="15.794"
+ viewBox="0 0 15.667 15.794" style="overflow:visible;enable-background:new 0 0 15.667 15.794;" xml:space="preserve">
+<rect style="fill:none;" width="15.667" height="15.666"/>
+<g>
+ <rect x="3.791" y="0.583" style="fill:#996633;" width="1" height="7.963"/>
+ <rect x="10.917" y="0.583" style="fill:#996633;" width="1" height="7.963"/>
+ <linearGradient id="XMLID_2_" gradientUnits="userSpaceOnUse" x1="7.8936" y1="1.6753" x2="7.8936" y2="15.1908">
+ <stop offset="0" style="stop-color:#D9C7A8"/>
+ <stop offset="0.1575" style="stop-color:#CEB28C"/>
+ <stop offset="0.395" style="stop-color:#C09869"/>
+ <stop offset="0.6188" style="stop-color:#B58550"/>
+ <stop offset="0.8212" style="stop-color:#AF7940"/>
+ <stop offset="0.9831" style="stop-color:#AD753B"/>
+ </linearGradient>
+ <rect x="6.728" y="0.583" style="fill:url(#XMLID_2_);stroke:#000000;stroke-width:0.75;" width="2.333" height="14.836"/>
+ <rect x="3.433" y="2.541" style="fill:#C4AB96;stroke:#000000;stroke-width:0.75;" width="8.92" height="2.413"/>
+ <rect x="3.433" y="6.635" style="fill:#C4AB96;stroke:#000000;stroke-width:0.75;" width="8.92" height="2.412"/>
+</g>
+</svg>
diff --git a/examples/network/bearercloud/cloud.cpp b/examples/network/bearercloud/cloud.cpp
index 980efbf..6019d9b 100644
--- a/examples/network/bearercloud/cloud.cpp
+++ b/examples/network/bearercloud/cloud.cpp
@@ -53,7 +53,7 @@
#include <math.h>
-static QMap<QString, QSvgRenderer *> svgCache;
+static QMap<QNetworkConfiguration::BearerType, QSvgRenderer *> svgCache;
//! [0]
Cloud::Cloud(const QNetworkConfiguration &config, QGraphicsItem *parent)
@@ -261,9 +261,9 @@ void Cloud::stateChanged(QNetworkSession::State state)
tooltip += tr("<br>Id: %1").arg(configuration.identifier());
#endif
- const QString bearerName = configuration.bearerName();
- if (!bearerName.isEmpty())
- tooltip += tr("<br>Bearer: %1").arg(bearerName);
+ const QString bearerTypeName = configuration.bearerTypeName();
+ if (!bearerTypeName.isEmpty())
+ tooltip += tr("<br>Bearer: %1").arg(bearerTypeName);
QString s = tr("<br>State: %1 (%2)");
switch (state) {
@@ -313,17 +313,36 @@ void Cloud::stateChanged(QNetworkSession::State state)
//! [1]
void Cloud::newConfigurationActivated()
{
- const QString bearerName = configuration.bearerName();
- if (!svgCache.contains(bearerName)) {
- if (bearerName == QLatin1String("WLAN"))
- svgCache.insert(bearerName, new QSvgRenderer(QLatin1String(":wlan.svg")));
- else if (bearerName == QLatin1String("Ethernet"))
- svgCache.insert(bearerName, new QSvgRenderer(QLatin1String(":lan.svg")));
- else
- svgCache.insert(bearerName, new QSvgRenderer(QLatin1String(":unknown.svg")));
+ QNetworkConfiguration::BearerType bearerType = configuration.bearerType();
+ if (!svgCache.contains(bearerType)) {
+ QSvgRenderer *renderer = 0;
+ switch (bearerType) {
+ case QNetworkConfiguration::BearerWLAN:
+ renderer = new QSvgRenderer(QLatin1String(":wlan.svg"));
+ break;
+ case QNetworkConfiguration::BearerEthernet:
+ renderer = new QSvgRenderer(QLatin1String(":lan.svg"));
+ break;
+ case QNetworkConfiguration::Bearer2G:
+ renderer = new QSvgRenderer(QLatin1String(":cell.svg"));
+ break;
+ case QNetworkConfiguration::BearerBluetooth:
+ renderer = new QSvgRenderer(QLatin1String(":bluetooth.svg"));
+ break;
+ case QNetworkConfiguration::BearerCDMA2000:
+ case QNetworkConfiguration::BearerWCDMA:
+ case QNetworkConfiguration::BearerHSPA:
+ renderer = new QSvgRenderer(QLatin1String(":umts.svg"));
+ break;
+ default:
+ renderer = new QSvgRenderer(QLatin1String(":unknown.svg"));
+ }
+
+ if (renderer)
+ svgCache.insert(bearerType, renderer);
}
- icon->setSharedRenderer(svgCache[bearerName]);
+ icon->setSharedRenderer(svgCache[bearerType]);
if (configuration.name().isEmpty()) {
text->setPlainText(tr("HIDDEN NETWORK"));
diff --git a/examples/network/bearercloud/gprs.svg b/examples/network/bearercloud/gprs.svg
new file mode 100644
index 0000000..4a992c1
--- /dev/null
+++ b/examples/network/bearercloud/gprs.svg
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 12.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ id="图层_1"
+ width="13"
+ height="14"
+ viewBox="0 0 21.228 20.825"
+ style="overflow:visible;enable-background:new 0 0 21.228 20.825;"
+ xml:space="preserve"
+ sodipodi:version="0.32"
+ inkscape:version="0.44.1"
+ sodipodi:docname="GPRS-online.svg"
+ sodipodi:docbase="/home/user"><metadata
+ id="metadata76"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs74">
+ <linearGradient
+ y2="18.770201"
+ x2="19.1735"
+ y1="2.1933999"
+ x1="2.5967"
+ gradientUnits="userSpaceOnUse"
+ id="XMLID_5_"
+ gradientTransform="matrix(1.749056,0,0,1.749987,1.149567,1.483541)">
+ <stop
+ id="stop6"
+ style="stop-color:#F8DB41"
+ offset="0" />
+ <stop
+ id="stop8"
+ style="stop-color:#F8D73F"
+ offset="0.1193" />
+ <stop
+ id="stop10"
+ style="stop-color:#F9CB3A"
+ offset="0.2384" />
+ <stop
+ id="stop12"
+ style="stop-color:#FAB731"
+ offset="0.3576" />
+ <stop
+ id="stop14"
+ style="stop-color:#FC9B24"
+ offset="0.4768" />
+ <stop
+ id="stop16"
+ style="stop-color:#FE7714"
+ offset="0.595" />
+ <stop
+ id="stop18"
+ style="stop-color:#FE7513"
+ offset="0.6011" />
+ </linearGradient>
+
+ <linearGradient
+ y2="13.7331"
+ x2="24.2068"
+ y1="-2.8408"
+ x1="7.6328001"
+ gradientUnits="userSpaceOnUse"
+ id="XMLID_6_">
+ <stop
+ id="stop23"
+ style="stop-color:#F8DB41"
+ offset="0" />
+ <stop
+ id="stop25"
+ style="stop-color:#F8D73F"
+ offset="0.1193" />
+ <stop
+ id="stop27"
+ style="stop-color:#F9CB3A"
+ offset="0.2384" />
+ <stop
+ id="stop29"
+ style="stop-color:#FAB731"
+ offset="0.3576" />
+ <stop
+ id="stop31"
+ style="stop-color:#FC9B24"
+ offset="0.4768" />
+ <stop
+ id="stop33"
+ style="stop-color:#FE7714"
+ offset="0.595" />
+ <stop
+ id="stop35"
+ style="stop-color:#FE7513"
+ offset="0.6011" />
+ </linearGradient>
+
+ <linearGradient
+ y2="23.8965"
+ x2="14.043"
+ y1="7.3242002"
+ x1="-2.5293"
+ gradientUnits="userSpaceOnUse"
+ id="XMLID_7_">
+ <stop
+ id="stop40"
+ style="stop-color:#F8DB41"
+ offset="0" />
+ <stop
+ id="stop42"
+ style="stop-color:#F8D73F"
+ offset="0.1193" />
+ <stop
+ id="stop44"
+ style="stop-color:#F9CB3A"
+ offset="0.2384" />
+ <stop
+ id="stop46"
+ style="stop-color:#FAB731"
+ offset="0.3576" />
+ <stop
+ id="stop48"
+ style="stop-color:#FC9B24"
+ offset="0.4768" />
+ <stop
+ id="stop50"
+ style="stop-color:#FE7714"
+ offset="0.595" />
+ <stop
+ id="stop52"
+ style="stop-color:#FE7513"
+ offset="0.6011" />
+ </linearGradient>
+
+ <linearGradient
+ y2="18.5788"
+ x2="19.364"
+ y1="2.0039001"
+ x1="2.7890999"
+ gradientUnits="userSpaceOnUse"
+ id="XMLID_8_">
+ <stop
+ id="stop57"
+ style="stop-color:#F8DB41"
+ offset="0" />
+ <stop
+ id="stop59"
+ style="stop-color:#F8D73F"
+ offset="0.1193" />
+ <stop
+ id="stop61"
+ style="stop-color:#F9CB3A"
+ offset="0.2384" />
+ <stop
+ id="stop63"
+ style="stop-color:#FAB731"
+ offset="0.3576" />
+ <stop
+ id="stop65"
+ style="stop-color:#FC9B24"
+ offset="0.4768" />
+ <stop
+ id="stop67"
+ style="stop-color:#FE7714"
+ offset="0.595" />
+ <stop
+ id="stop69"
+ style="stop-color:#FE7513"
+ offset="0.6011" />
+ </linearGradient>
+
+</defs><sodipodi:namedview
+ inkscape:window-height="960"
+ inkscape:window-width="1183"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ width="13px"
+ height="14px"
+ inkscape:zoom="19.543817"
+ inkscape:cx="10.614"
+ inkscape:cy="10.386917"
+ inkscape:window-x="186"
+ inkscape:window-y="93"
+ inkscape:current-layer="图层_1" />
+<path
+ id="path20"
+ d="M 11.043976,12.916206 L 11.043976,9.4232323 L 19.388723,9.4232323 L 19.388723,16.573679 C 17.790085,17.616671 16.380346,18.330666 15.15076,18.708663 C 13.922922,19.084911 12.465959,19.272159 10.779869,19.272159 C 8.7054879,19.272159 7.0141507,18.934412 5.7076059,18.253667 C 4.399312,17.574672 3.3866086,16.564929 2.6677466,15.222689 C 1.9488846,13.880449 1.58683,12.336961 1.58683,10.599223 C 1.58683,8.7652372 1.9803676,7.172749 2.7674428,5.820009 C 3.5527689,4.4655191 4.7053968,3.4365268 6.2288246,2.7312819 C 7.4111865,2.190536 9.0045765,1.921038 11.008995,1.921038 C 12.939953,1.921038 14.386422,2.0890367 15.343156,2.4232842 C 16.301639,2.7610318 17.093961,3.2825279 17.728868,3.9860227 C 18.360278,4.6930174 18.834272,5.5890108 19.150851,6.6722527 L 13.938664,7.5629961 C 13.72353,6.9330008 13.361475,6.4465044 12.849002,6.1157569 C 12.33478,5.7815093 11.68588,5.6117606 10.890059,5.6117606 C 9.7111951,5.6117606 8.7632067,6.0072577 8.0653334,6.7965018 C 7.3622129,7.5839959 7.0071545,8.8352366 7.0071545,10.541474 C 7.0071545,12.35621 7.365711,13.654701 8.0740787,14.433445 C 8.7824464,15.212189 9.7776592,15.600686 11.043976,15.600686 C 11.647401,15.600686 12.224589,15.514937 12.770295,15.346938 C 13.321247,15.18069 13.943911,14.897192 14.652279,14.492945 L 14.652279,12.917956 L 11.043976,12.917956 L 11.043976,12.916206 z "
+ style="fill:black;stroke:white;stroke-width:1.30633846;stroke-miterlimit:4;stroke-dasharray:none;stroke-linejoin:round;stroke-linecap:butt;stroke-opacity:1;fill-opacity:1" />
+</svg>
diff --git a/examples/network/bearercloud/icons.qrc b/examples/network/bearercloud/icons.qrc
index 84a8939..7dea1f2 100644
--- a/examples/network/bearercloud/icons.qrc
+++ b/examples/network/bearercloud/icons.qrc
@@ -3,5 +3,9 @@
<file>wlan.svg</file>
<file>lan.svg</file>
<file>unknown.svg</file>
+ <file>bluetooth.svg</file>
+ <file>cell.svg</file>
+ <file>gprs.svg</file>
+ <file>umts.svg</file>
</qresource>
</RCC>
diff --git a/examples/network/bearercloud/lan.svg b/examples/network/bearercloud/lan.svg
index 3cce805..4f7f63d 100644..100755
--- a/examples/network/bearercloud/lan.svg
+++ b/examples/network/bearercloud/lan.svg
@@ -1,76 +1,33 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="25.000002"
- height="9.6406126"
- id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.46"
- version="1.0"
- sodipodi:docname="lan.svg"
- inkscape:output_extension="org.inkscape.output.svg.inkscape">
- <defs
- id="defs4">
- <inkscape:perspective
- sodipodi:type="inkscape:persp3d"
- inkscape:vp_x="0 : 526.18109 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_z="744.09448 : 526.18109 : 1"
- inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
- id="perspective10" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="19.416667"
- inkscape:cx="15.244635"
- inkscape:cy="11.639485"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- inkscape:window-width="1459"
- inkscape:window-height="964"
- inkscape:window-x="453"
- inkscape:window-y="166" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-4.0978193e-8,-19.359387)">
- <text
- xml:space="preserve"
- style="font-size:13.99289513px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
- x="-1.1205248"
- y="29"
- id="text3239"><tspan
- sodipodi:role="line"
- id="tspan3241"
- x="-1.1205248"
- y="29">LAN</tspan></text>
- </g>
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Generator: Adobe Illustrator 12.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+ <!ENTITY ns_svg "http://www.w3.org/2000/svg">
+ <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
+]>
+<svg version="1.1" id="&#x56FE;&#x5C42;_1" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="21.929" height="20.665"
+ viewBox="0 0 21.929 20.665" style="overflow:visible;enable-background:new 0 0 21.929 20.665;" xml:space="preserve">
+<g>
+ <linearGradient id="XMLID_3_" gradientUnits="userSpaceOnUse" x1="1.7178" y1="5.3706" x2="20.9333" y2="5.3706">
+ <stop offset="0.0393" style="stop-color:#C2DC1A"/>
+ <stop offset="0.2192" style="stop-color:#BEDA1A"/>
+ <stop offset="0.3978" style="stop-color:#B2D61B"/>
+ <stop offset="0.5758" style="stop-color:#9ECE1D"/>
+ <stop offset="0.7536" style="stop-color:#82C320"/>
+ <stop offset="0.9298" style="stop-color:#5FB423"/>
+ <stop offset="0.9326" style="stop-color:#5EB423"/>
+ </linearGradient>
+ <polygon style="fill:url(#XMLID_3_);stroke:#000000;stroke-linejoin:round;" points="21.429,7.716 10.965,7.716 10.965,0.5
+ 0.5,10.241 21.429,10.241 "/>
+ <linearGradient id="XMLID_4_" gradientUnits="userSpaceOnUse" x1="1.7178" y1="15.2944" x2="20.9333" y2="15.2944">
+ <stop offset="0.0393" style="stop-color:#C2DC1A"/>
+ <stop offset="0.2192" style="stop-color:#BEDA1A"/>
+ <stop offset="0.3978" style="stop-color:#B2D61B"/>
+ <stop offset="0.5758" style="stop-color:#9ECE1D"/>
+ <stop offset="0.7536" style="stop-color:#82C320"/>
+ <stop offset="0.9298" style="stop-color:#5FB423"/>
+ <stop offset="0.9326" style="stop-color:#5EB423"/>
+ </linearGradient>
+ <polygon style="fill:url(#XMLID_4_);stroke:#000000;stroke-linejoin:round;" points="0.5,12.949 10.965,12.949 10.965,20.165
+ 21.429,10.424 0.5,10.424 "/>
+</g>
</svg>
diff --git a/examples/network/bearercloud/umts.svg b/examples/network/bearercloud/umts.svg
new file mode 100644
index 0000000..c1b372e
--- /dev/null
+++ b/examples/network/bearercloud/umts.svg
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 12.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ id="图层_1"
+ width="13"
+ height="14"
+ viewBox="0 0 21.228 20.825"
+ style="overflow:visible;enable-background:new 0 0 21.228 20.825;"
+ xml:space="preserve"
+ sodipodi:version="0.32"
+ inkscape:version="0.44.1"
+ sodipodi:docname="umts-enabled.svg"
+ sodipodi:docbase="/home/user"><metadata
+ id="metadata76"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs74">
+ <linearGradient
+ y2="18.770201"
+ x2="19.1735"
+ y1="2.1933999"
+ x1="2.5967"
+ gradientUnits="userSpaceOnUse"
+ id="XMLID_5_"
+ gradientTransform="matrix(1.749056,0,0,1.749987,1.149567,1.483541)">
+ <stop
+ id="stop6"
+ style="stop-color:#F8DB41"
+ offset="0" />
+ <stop
+ id="stop8"
+ style="stop-color:#F8D73F"
+ offset="0.1193" />
+ <stop
+ id="stop10"
+ style="stop-color:#F9CB3A"
+ offset="0.2384" />
+ <stop
+ id="stop12"
+ style="stop-color:#FAB731"
+ offset="0.3576" />
+ <stop
+ id="stop14"
+ style="stop-color:#FC9B24"
+ offset="0.4768" />
+ <stop
+ id="stop16"
+ style="stop-color:#FE7714"
+ offset="0.595" />
+ <stop
+ id="stop18"
+ style="stop-color:#FE7513"
+ offset="0.6011" />
+ </linearGradient>
+
+ <linearGradient
+ y2="13.7331"
+ x2="24.2068"
+ y1="-2.8408"
+ x1="7.6328001"
+ gradientUnits="userSpaceOnUse"
+ id="XMLID_6_">
+ <stop
+ id="stop23"
+ style="stop-color:#F8DB41"
+ offset="0" />
+ <stop
+ id="stop25"
+ style="stop-color:#F8D73F"
+ offset="0.1193" />
+ <stop
+ id="stop27"
+ style="stop-color:#F9CB3A"
+ offset="0.2384" />
+ <stop
+ id="stop29"
+ style="stop-color:#FAB731"
+ offset="0.3576" />
+ <stop
+ id="stop31"
+ style="stop-color:#FC9B24"
+ offset="0.4768" />
+ <stop
+ id="stop33"
+ style="stop-color:#FE7714"
+ offset="0.595" />
+ <stop
+ id="stop35"
+ style="stop-color:#FE7513"
+ offset="0.6011" />
+ </linearGradient>
+
+ <linearGradient
+ y2="23.8965"
+ x2="14.043"
+ y1="7.3242002"
+ x1="-2.5293"
+ gradientUnits="userSpaceOnUse"
+ id="XMLID_7_">
+ <stop
+ id="stop40"
+ style="stop-color:#F8DB41"
+ offset="0" />
+ <stop
+ id="stop42"
+ style="stop-color:#F8D73F"
+ offset="0.1193" />
+ <stop
+ id="stop44"
+ style="stop-color:#F9CB3A"
+ offset="0.2384" />
+ <stop
+ id="stop46"
+ style="stop-color:#FAB731"
+ offset="0.3576" />
+ <stop
+ id="stop48"
+ style="stop-color:#FC9B24"
+ offset="0.4768" />
+ <stop
+ id="stop50"
+ style="stop-color:#FE7714"
+ offset="0.595" />
+ <stop
+ id="stop52"
+ style="stop-color:#FE7513"
+ offset="0.6011" />
+ </linearGradient>
+
+ <linearGradient
+ y2="18.5788"
+ x2="19.364"
+ y1="2.0039001"
+ x1="2.7890999"
+ gradientUnits="userSpaceOnUse"
+ id="XMLID_8_">
+ <stop
+ id="stop57"
+ style="stop-color:#F8DB41"
+ offset="0" />
+ <stop
+ id="stop59"
+ style="stop-color:#F8D73F"
+ offset="0.1193" />
+ <stop
+ id="stop61"
+ style="stop-color:#F9CB3A"
+ offset="0.2384" />
+ <stop
+ id="stop63"
+ style="stop-color:#FAB731"
+ offset="0.3576" />
+ <stop
+ id="stop65"
+ style="stop-color:#FC9B24"
+ offset="0.4768" />
+ <stop
+ id="stop67"
+ style="stop-color:#FE7714"
+ offset="0.595" />
+ <stop
+ id="stop69"
+ style="stop-color:#FE7513"
+ offset="0.6011" />
+ </linearGradient>
+
+</defs><sodipodi:namedview
+ inkscape:window-height="960"
+ inkscape:window-width="1183"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ width="13px"
+ height="14px"
+ inkscape:zoom="53.714286"
+ inkscape:cx="6.5"
+ inkscape:cy="7"
+ inkscape:window-x="252"
+ inkscape:window-y="164"
+ inkscape:current-layer="图层_1" />
+
+<path
+ style="font-size:26.12677002px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:black;fill-opacity:1;stroke:white;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ d="M 10.438113,0.60410378 C 9.5195858,0.60412318 8.5840584,0.67216158 7.6315264,0.80821918 C 6.6789835,0.94431518 5.6924268,1.1484304 4.7228823,1.4205653 L 4.7228823,5.0436132 C 5.5223309,4.6949314 6.3643059,4.4057684 7.1722669,4.2271517 C 7.9802179,4.0485668 8.7796689,3.9720237 9.5706225,3.9720075 C 10.64222,3.9720235 11.433166,4.1846436 12.020007,4.5843536 C 12.606829,4.9840947 12.938516,5.5369062 12.938526,6.2683055 C 12.938515,7.0592656 12.623838,7.663106 12.020007,8.054315 C 11.416156,8.4370429 10.497638,8.615644 9.2644494,8.615632 L 7.1722669,8.615632 L 7.1722669,11.779421 L 9.1623917,11.779421 C 10.548667,11.779429 11.569243,11.992048 12.275151,12.442796 C 12.989544,12.885053 13.346746,13.565437 13.346757,14.43292 C 13.346746,15.2749 13.023563,15.921266 12.32618,16.372017 C 11.637281,16.822775 10.616705,17.035395 9.3154783,17.035392 C 8.4394768,17.035395 7.5719873,16.907823 6.6619784,16.67819 C 5.7604653,16.440059 4.8249372,16.116877 3.9064208,15.657613 L 3.9064208,19.433747 C 4.8674613,19.748424 5.8370084,19.995064 6.815065,20.148151 C 7.8016169,20.309742 8.7966784,20.403295 9.7747379,20.403295 C 12.547295,20.403294 14.656485,19.901511 16.102315,18.923459 C 17.548116,17.936904 18.296539,16.474077 18.296555,14.586007 C 18.296539,13.318797 17.947843,12.289717 17.275978,11.473248 C 16.612589,10.648291 15.286744,9.8267627 14.975337,9.738267 C 15.211467,9.5707147 16.382959,8.96434 16.969805,8.2584304 C 17.556621,7.544039 17.837281,6.617016 17.837296,5.5028728 C 17.837281,3.8699658 17.233439,2.6367701 16.000257,1.8287961 C 14.775552,1.0123535 12.913001,0.60412318 10.438113,0.60410378 z M 10.570571,1.2772502 C 13.045459,1.2772695 14.306521,1.5736708 15.531226,2.3901134 C 16.764408,3.1980876 17.174992,3.8601944 17.175007,5.4931014 C 17.174992,6.6072444 16.924732,7.1976942 16.337916,7.9120856 C 15.75107,8.617996 15.186496,9.1223119 15.071966,9.2290638 L 14.321733,9.8826672 C 15.605945,10.214364 16.173958,10.84372 16.837348,11.668677 C 17.509211,12.485146 17.613621,13.298168 17.613637,14.565378 C 17.613621,16.453449 16.977028,17.365815 15.531226,18.35237 C 14.085396,19.330422 12.587467,19.720376 9.8149096,19.720377 C 8.8368504,19.720377 7.7809882,19.596424 6.7944362,19.434833 C 5.8163797,19.281747 5.4689503,19.167564 4.5079098,18.852887 L 4.4775095,16.626075 C 5.3960259,17.085338 5.6790363,17.174005 6.5805495,17.412136 C 7.4905585,17.641769 8.5827919,17.809513 9.4587934,17.80951 C 10.76002,17.809513 12.167112,17.341749 12.856012,16.89099 C 13.553395,16.440238 14.111093,15.203243 14.111104,14.361263 C 14.111093,13.493779 13.591033,12.385621 12.87664,11.943364 C 12.170732,11.492617 10.853754,11.107368 9.4674791,11.10736 L 7.8041559,11.117131 L 7.8041559,9.277922 L 9.3871358,9.257293 C 10.620324,9.257304 12.006788,8.936474 12.610639,8.553746 C 13.21447,8.1625376 13.682233,7.0288655 13.682244,6.2379054 C 13.682234,5.5065062 13.268032,4.4542632 12.681211,4.0545222 C 12.09437,3.6548121 10.824621,3.2391624 9.7530236,3.2391464 C 8.9620698,3.2391624 7.9791321,3.3048486 7.1711811,3.4834335 C 6.3632201,3.66205 6.1954773,3.6645831 5.3960287,4.0132649 L 5.3862573,1.9308538 C 6.3558019,1.6587188 6.8320701,1.5566613 7.784613,1.4205653 C 8.7371446,1.2845077 9.6520438,1.2772696 10.570571,1.2772502 z "
+ id="text1901"
+ sodipodi:nodetypes="csccsssssccccsssssccssssscsssccsssccsssssccsssssccccsssssccsc" /></svg> \ No newline at end of file
diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp
index 8b5693a..ecc2a93 100644
--- a/examples/network/bearermonitor/sessionwidget.cpp
+++ b/examples/network/bearermonitor/sessionwidget.cpp
@@ -111,11 +111,11 @@ void SessionWidget::updateSession()
killTimer(statsTimer);
if (session->configuration().type() == QNetworkConfiguration::InternetAccessPoint)
- bearer->setText(session->configuration().bearerName());
+ bearer->setText(session->configuration().bearerTypeName());
else {
QNetworkConfigurationManager mgr;
QNetworkConfiguration c = mgr.configurationFromIdentifier(session->sessionProperty("ActiveConfiguration").toString());
- bearer->setText(c.bearerName());
+ bearer->setText(c.bearerTypeName());
}
#ifndef QT_NO_NETWORKINTERFACE
diff --git a/examples/network/download/main.cpp b/examples/network/download/main.cpp
index c322a44..0fb9137 100644
--- a/examples/network/download/main.cpp
+++ b/examples/network/download/main.cpp
@@ -150,7 +150,7 @@ void DownloadManager::downloadFinished(QNetworkReply *reply)
} else {
QString filename = saveFileName(url);
if (saveToDisk(filename, reply))
- printf("Download of %s succeded (saved to %s)\n",
+ printf("Download of %s succeeded (saved to %s)\n",
url.toEncoded().constData(), qPrintable(filename));
}
diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro
index e13f309..0ef3e97 100644
--- a/examples/network/fortuneserver/fortuneserver.pro
+++ b/examples/network/fortuneserver/fortuneserver.pro
@@ -10,7 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver
INSTALLS += target sources
symbian {
- TARGET.UID3 = 0xA000CF71
+ TARGET.UID3 = 0xA000E406
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
TARGET.CAPABILITY = "NetworkServices ReadUserData"
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
diff --git a/examples/network/fortuneserver/server.cpp b/examples/network/fortuneserver/server.cpp
index b931b96..4dca38c 100644
--- a/examples/network/fortuneserver/server.cpp
+++ b/examples/network/fortuneserver/server.cpp
@@ -107,17 +107,19 @@ Server::Server(QWidget *parent)
void Server::sessionOpened()
{
// Save the used configuration
- QNetworkConfiguration config = networkSession->configuration();
- QString id;
- if (config.type() == QNetworkConfiguration::UserChoice)
- id = networkSession->sessionProperty(QLatin1String("UserChoiceConfiguration")).toString();
- else
- id = config.identifier();
-
- QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
- settings.beginGroup(QLatin1String("QtNetwork"));
- settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
- settings.endGroup();
+ if (networkSession) {
+ QNetworkConfiguration config = networkSession->configuration();
+ QString id;
+ if (config.type() == QNetworkConfiguration::UserChoice)
+ id = networkSession->sessionProperty(QLatin1String("UserChoiceConfiguration")).toString();
+ else
+ id = config.identifier();
+
+ QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ settings.beginGroup(QLatin1String("QtNetwork"));
+ settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
+ settings.endGroup();
+ }
//! [0] //! [1]
tcpServer = new QTcpServer(this);
diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp
index b1ea98c..ea48546 100644
--- a/examples/network/http/httpwindow.cpp
+++ b/examples/network/http/httpwindow.cpp
@@ -206,7 +206,7 @@ void HttpWindow::httpFinished()
void HttpWindow::httpReadyRead()
{
- // this slot gets called everytime the QNetworkReply has new data.
+ // this slot gets called every time the QNetworkReply has new data.
// We read all of its new data and write it into the file.
// That way we use less RAM than when reading it at the finished()
// signal of the QNetworkReply
diff --git a/examples/network/network.pro b/examples/network/network.pro
index 16c4087..458561a 100644
--- a/examples/network/network.pro
+++ b/examples/network/network.pro
@@ -16,9 +16,12 @@ SUBDIRS = \
threadedfortuneserver \
googlesuggest \
torrent \
- bearercloud \
bearermonitor
+ contains(QT_CONFIG, svg) {
+ SUBDIRS += bearercloud
+ }
+
# no QProcess
!vxworks:!qnx:SUBDIRS += network-chat
diff --git a/examples/network/torrent/torrent.pro b/examples/network/torrent/torrent.pro
index 7665455..44716fd 100644
--- a/examples/network/torrent/torrent.pro
+++ b/examples/network/torrent/torrent.pro
@@ -5,7 +5,7 @@ HEADERS += addtorrentdialog.h \
metainfo.h \
peerwireclient.h \
ratecontroller.h \
- filemanager.h \
+ filemanager.h \
torrentclient.h \
torrentserver.h \
trackerclient.h
diff --git a/examples/network/torrent/torrentclient.cpp b/examples/network/torrent/torrentclient.cpp
index 5e25b9a..b7607a6 100644
--- a/examples/network/torrent/torrentclient.cpp
+++ b/examples/network/torrent/torrentclient.cpp
@@ -1243,8 +1243,8 @@ void TorrentClient::schedulePieceForClient(PeerWireClient *client)
// depending on the state we're in.
int pieceIndex = 0;
if (d->state == WarmingUp || (qrand() & 4) == 0) {
- int *occurrances = new int[d->pieceCount];
- memset(occurrances, 0, d->pieceCount * sizeof(int));
+ int *occurrences = new int[d->pieceCount];
+ memset(occurrences, 0, d->pieceCount * sizeof(int));
// Count how many of each piece are available.
foreach (PeerWireClient *peer, d->connections) {
@@ -1252,38 +1252,38 @@ void TorrentClient::schedulePieceForClient(PeerWireClient *client)
int peerPiecesSize = peerPieces.size();
for (int i = 0; i < peerPiecesSize; ++i) {
if (peerPieces.testBit(i))
- ++occurrances[i];
+ ++occurrences[i];
}
}
// Find the rarest or most common pieces.
- int numOccurrances = d->state == WarmingUp ? 0 : 99999;
+ int numOccurrences = d->state == WarmingUp ? 0 : 99999;
QList<int> piecesReadyForDownload;
for (int i = 0; i < d->pieceCount; ++i) {
if (d->state == WarmingUp) {
// Add common pieces
- if (occurrances[i] >= numOccurrances
+ if (occurrences[i] >= numOccurrences
&& incompletePiecesAvailableToClient.testBit(i)) {
- if (occurrances[i] > numOccurrances)
+ if (occurrences[i] > numOccurrences)
piecesReadyForDownload.clear();
piecesReadyForDownload.append(i);
- numOccurrances = occurrances[i];
+ numOccurrences = occurrences[i];
}
} else {
// Add rare pieces
- if (occurrances[i] <= numOccurrances
+ if (occurrences[i] <= numOccurrences
&& incompletePiecesAvailableToClient.testBit(i)) {
- if (occurrances[i] < numOccurrances)
+ if (occurrences[i] < numOccurrences)
piecesReadyForDownload.clear();
piecesReadyForDownload.append(i);
- numOccurrances = occurrances[i];
+ numOccurrences = occurrences[i];
}
}
}
// Select one piece randomly
pieceIndex = piecesReadyForDownload.at(qrand() % piecesReadyForDownload.size());
- delete [] occurrances;
+ delete [] occurrences;
} else {
// Make up a list of available piece indices, and pick
// a random one.