518 lines
25 KiB
HTML
518 lines
25 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||
|
<meta name="generator" content="Doxygen 1.8.11"/>
|
||
|
<title>QSimpleUpdater: Downloader Class Reference</title>
|
||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||
|
<script type="text/javascript" src="jquery.js"></script>
|
||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||
|
<script type="text/javascript" src="search/search.js"></script>
|
||
|
<script type="text/javascript">
|
||
|
$(document).ready(function() { init_search(); });
|
||
|
</script>
|
||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||
|
<div id="titlearea">
|
||
|
<table cellspacing="0" cellpadding="0">
|
||
|
<tbody>
|
||
|
<tr style="height: 56px;">
|
||
|
<td id="projectlogo"><img alt="Logo" src="icon.png"/></td>
|
||
|
<td id="projectalign" style="padding-left: 0.5em;">
|
||
|
<div id="projectname">QSimpleUpdater
|
||
|
</div>
|
||
|
<div id="projectbrief">A simple auto-updater system for Qt applications</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<!-- end header part -->
|
||
|
<!-- Generated by Doxygen 1.8.11 -->
|
||
|
<script type="text/javascript">
|
||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||
|
</script>
|
||
|
<div id="navrow1" class="tabs">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||
|
<li>
|
||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||
|
<span class="left">
|
||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
|
alt=""/>
|
||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||
|
</span><span class="right">
|
||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||
|
</span>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div id="navrow2" class="tabs2">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
||
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
||
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
||
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<!-- window showing the filter options -->
|
||
|
<div id="MSearchSelectWindow"
|
||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||
|
</div>
|
||
|
|
||
|
<!-- iframe showing the search results (closed by default) -->
|
||
|
<div id="MSearchResultsWindow">
|
||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||
|
name="MSearchResults" id="MSearchResults">
|
||
|
</iframe>
|
||
|
</div>
|
||
|
|
||
|
</div><!-- top -->
|
||
|
<div class="header">
|
||
|
<div class="summary">
|
||
|
<a href="#pub-slots">Public Slots</a> |
|
||
|
<a href="#signals">Signals</a> |
|
||
|
<a href="#pub-methods">Public Member Functions</a> |
|
||
|
<a href="#pri-slots">Private Slots</a> |
|
||
|
<a href="#pri-methods">Private Member Functions</a> |
|
||
|
<a href="#pri-attribs">Private Attributes</a> |
|
||
|
<a href="class_downloader-members.html">List of all members</a> </div>
|
||
|
<div class="headertitle">
|
||
|
<div class="title">Downloader Class Reference</div> </div>
|
||
|
</div><!--header-->
|
||
|
<div class="contents">
|
||
|
|
||
|
<p>Implements an integrated file downloader with a nice UI.
|
||
|
<a href="class_downloader.html#details">More...</a></p>
|
||
|
|
||
|
<p><code>#include <<a class="el" href="_downloader_8h_source.html">Downloader.h</a>></code></p>
|
||
|
<div class="dynheader">
|
||
|
Inheritance diagram for Downloader:</div>
|
||
|
<div class="dyncontent">
|
||
|
<div class="center">
|
||
|
<img src="class_downloader.png" usemap="#Downloader_map" alt=""/>
|
||
|
<map id="Downloader_map" name="Downloader_map">
|
||
|
</map>
|
||
|
</div></div>
|
||
|
<table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-slots"></a>
|
||
|
Public Slots</h2></td></tr>
|
||
|
<tr class="memitem:a7f81027436d44ca52168b30a6eb0d379"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_downloader.html#a7f81027436d44ca52168b30a6eb0d379">startDownload</a> (const QUrl &url)</td></tr>
|
||
|
<tr class="separator:a7f81027436d44ca52168b30a6eb0d379"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a26a4f889029c63c11f679284397a3285"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_downloader.html#a26a4f889029c63c11f679284397a3285">setUseCustomInstallProcedures</a> (const bool &custom)</td></tr>
|
||
|
<tr class="separator:a26a4f889029c63c11f679284397a3285"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="signals"></a>
|
||
|
Signals</h2></td></tr>
|
||
|
<tr class="memitem:a7374214627efe871ac19af293f702f9a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7374214627efe871ac19af293f702f9a"></a>
|
||
|
void </td><td class="memItemRight" valign="bottom"><b>downloadFinished</b> (const QString &url, const QString &filepath)</td></tr>
|
||
|
<tr class="separator:a7374214627efe871ac19af293f702f9a"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
||
|
Public Member Functions</h2></td></tr>
|
||
|
<tr class="memitem:a4c89702786810ca23a9816dd3c762283"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4c89702786810ca23a9816dd3c762283"></a>
|
||
|
 </td><td class="memItemRight" valign="bottom"><b>Downloader</b> (QWidget *parent=0)</td></tr>
|
||
|
<tr class="separator:a4c89702786810ca23a9816dd3c762283"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a3e7a91a3cdfa68e3bc59db0af1377f9c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_downloader.html#a3e7a91a3cdfa68e3bc59db0af1377f9c">useCustomInstallProcedures</a> () const </td></tr>
|
||
|
<tr class="separator:a3e7a91a3cdfa68e3bc59db0af1377f9c"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-slots"></a>
|
||
|
Private Slots</h2></td></tr>
|
||
|
<tr class="memitem:a0117b0dd837b46ca5cdd8b4f2ea5a552"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_downloader.html#a0117b0dd837b46ca5cdd8b4f2ea5a552">openDownload</a> ()</td></tr>
|
||
|
<tr class="separator:a0117b0dd837b46ca5cdd8b4f2ea5a552"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:abd39884d0586459bdd09b490913223fe"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_downloader.html#abd39884d0586459bdd09b490913223fe">installUpdate</a> ()</td></tr>
|
||
|
<tr class="separator:abd39884d0586459bdd09b490913223fe"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a17209ffbd584af1a3e836e46e70d18d9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_downloader.html#a17209ffbd584af1a3e836e46e70d18d9">cancelDownload</a> ()</td></tr>
|
||
|
<tr class="separator:a17209ffbd584af1a3e836e46e70d18d9"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:acfd827dd6b36e82a4cc8bfbb284056e9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_downloader.html#acfd827dd6b36e82a4cc8bfbb284056e9">onDownloadFinished</a> ()</td></tr>
|
||
|
<tr class="separator:acfd827dd6b36e82a4cc8bfbb284056e9"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a2909b4a7cfb35f2709849ee2c95dae0e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_downloader.html#a2909b4a7cfb35f2709849ee2c95dae0e">calculateSizes</a> (qint64 received, qint64 total)</td></tr>
|
||
|
<tr class="separator:a2909b4a7cfb35f2709849ee2c95dae0e"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a097bee5b7d904da53427c5a5cb47ce83"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_downloader.html#a097bee5b7d904da53427c5a5cb47ce83">updateProgress</a> (qint64 received, qint64 total)</td></tr>
|
||
|
<tr class="separator:a097bee5b7d904da53427c5a5cb47ce83"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a662cc753f90f25c91721f8edeaac9b57"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_downloader.html#a662cc753f90f25c91721f8edeaac9b57">calculateTimeRemaining</a> (qint64 received, qint64 total)</td></tr>
|
||
|
<tr class="separator:a662cc753f90f25c91721f8edeaac9b57"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
|
||
|
Private Member Functions</h2></td></tr>
|
||
|
<tr class="memitem:ae4285290c22361353a36f25e742fc829"><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><a class="el" href="class_downloader.html#ae4285290c22361353a36f25e742fc829">round</a> (const qreal &input)</td></tr>
|
||
|
<tr class="separator:ae4285290c22361353a36f25e742fc829"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
|
||
|
Private Attributes</h2></td></tr>
|
||
|
<tr class="memitem:afa212578c447d8d5a2af85562f53385d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afa212578c447d8d5a2af85562f53385d"></a>
|
||
|
uint </td><td class="memItemRight" valign="bottom"><b>m_startTime</b></td></tr>
|
||
|
<tr class="separator:afa212578c447d8d5a2af85562f53385d"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:ad8fc9c6fda1015b5398300e2eb1432fd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad8fc9c6fda1015b5398300e2eb1432fd"></a>
|
||
|
QString </td><td class="memItemRight" valign="bottom"><b>m_filePath</b></td></tr>
|
||
|
<tr class="separator:ad8fc9c6fda1015b5398300e2eb1432fd"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:afed75d920ca2440bf53ebb85ba6d528c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afed75d920ca2440bf53ebb85ba6d528c"></a>
|
||
|
Ui::Downloader * </td><td class="memItemRight" valign="bottom"><b>m_ui</b></td></tr>
|
||
|
<tr class="separator:afed75d920ca2440bf53ebb85ba6d528c"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a54326eccac53a0727e57727a26ce87ab"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a54326eccac53a0727e57727a26ce87ab"></a>
|
||
|
QNetworkReply * </td><td class="memItemRight" valign="bottom"><b>m_reply</b></td></tr>
|
||
|
<tr class="separator:a54326eccac53a0727e57727a26ce87ab"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a14e5f9a42801bc219e69f01439b98581"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a14e5f9a42801bc219e69f01439b98581"></a>
|
||
|
bool </td><td class="memItemRight" valign="bottom"><b>m_useCustomProcedures</b></td></tr>
|
||
|
<tr class="separator:a14e5f9a42801bc219e69f01439b98581"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a29d51b83f23e81ab8a1c66847643e52f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a29d51b83f23e81ab8a1c66847643e52f"></a>
|
||
|
QNetworkAccessManager * </td><td class="memItemRight" valign="bottom"><b>m_manager</b></td></tr>
|
||
|
<tr class="separator:a29d51b83f23e81ab8a1c66847643e52f"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table>
|
||
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||
|
<div class="textblock"><p>Implements an integrated file downloader with a nice UI. </p>
|
||
|
</div><h2 class="groupheader">Member Function Documentation</h2>
|
||
|
<a class="anchor" id="a2909b4a7cfb35f2709849ee2c95dae0e"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void Downloader::calculateSizes </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">qint64 </td>
|
||
|
<td class="paramname"><em>received</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">qint64 </td>
|
||
|
<td class="paramname"><em>total</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">private</span><span class="mlabel">slot</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Calculates the appropiate size units (bytes, KB or MB) for the received data and the total download size. Then, this function proceeds to update the dialog controls/UI. </p>
|
||
|
|
||
|
<p>References <a class="el" href="class_downloader.html#ae4285290c22361353a36f25e742fc829">round()</a>.</p>
|
||
|
|
||
|
<p>Referenced by <a class="el" href="class_downloader.html#a097bee5b7d904da53427c5a5cb47ce83">updateProgress()</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a662cc753f90f25c91721f8edeaac9b57"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void Downloader::calculateTimeRemaining </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">qint64 </td>
|
||
|
<td class="paramname"><em>received</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">qint64 </td>
|
||
|
<td class="paramname"><em>total</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">private</span><span class="mlabel">slot</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Uses two time samples (from the current time and a previous sample) to calculate how many bytes have been downloaded.</p>
|
||
|
<p>Then, this function proceeds to calculate the appropiate units of time (hours, minutes or seconds) and constructs a user-friendly string, which is displayed in the dialog. </p>
|
||
|
|
||
|
<p>Referenced by <a class="el" href="class_downloader.html#a097bee5b7d904da53427c5a5cb47ce83">updateProgress()</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a17209ffbd584af1a3e836e46e70d18d9"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void Downloader::cancelDownload </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">private</span><span class="mlabel">slot</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Prompts the user if he/she wants to cancel the download and cancels the download if the user agrees to do that. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="abd39884d0586459bdd09b490913223fe"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void Downloader::installUpdate </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">private</span><span class="mlabel">slot</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Instructs the OS to open the downloaded file.</p>
|
||
|
<dl class="section note"><dt>Note</dt><dd>If <code><a class="el" href="class_downloader.html#a3e7a91a3cdfa68e3bc59db0af1377f9c">useCustomInstallProcedures()</a></code> returns <code>true</code>, the function will not instruct the OS to open the downloaded file. You can use the signals fired by the <code><a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a></code> to install the update with your own implementations/code. </dd></dl>
|
||
|
|
||
|
<p>References <a class="el" href="class_downloader.html#a0117b0dd837b46ca5cdd8b4f2ea5a552">openDownload()</a>, and <a class="el" href="class_downloader.html#a3e7a91a3cdfa68e3bc59db0af1377f9c">useCustomInstallProcedures()</a>.</p>
|
||
|
|
||
|
<p>Referenced by <a class="el" href="class_downloader.html#acfd827dd6b36e82a4cc8bfbb284056e9">onDownloadFinished()</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="acfd827dd6b36e82a4cc8bfbb284056e9"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void Downloader::onDownloadFinished </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">private</span><span class="mlabel">slot</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Writes the downloaded data to a temp. directory and updates the UI controls. </p><dl class="section note"><dt>Note</dt><dd>If the function detects that the downloaded data is an HTML file (e.g. a redirection notice from the server), the function will add the *.html extension to the downloaded file. This ensures that the download will be resumed when the OS opens a web-browser with the redirection notice. </dd></dl>
|
||
|
|
||
|
<p>References <a class="el" href="class_downloader.html#abd39884d0586459bdd09b490913223fe">installUpdate()</a>.</p>
|
||
|
|
||
|
<p>Referenced by <a class="el" href="class_downloader.html#a7f81027436d44ca52168b30a6eb0d379">startDownload()</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a0117b0dd837b46ca5cdd8b4f2ea5a552"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void Downloader::openDownload </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">private</span><span class="mlabel">slot</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Opens the downloaded file. </p><dl class="section note"><dt>Note</dt><dd>If the downloaded file is not found, then the function will alert the user about the error. </dd></dl>
|
||
|
|
||
|
<p>Referenced by <a class="el" href="class_downloader.html#abd39884d0586459bdd09b490913223fe">installUpdate()</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ae4285290c22361353a36f25e742fc829"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">qreal Downloader::round </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const qreal & </td>
|
||
|
<td class="paramname"><em>input</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Rounds the given <em>input</em> to two decimal places </p>
|
||
|
|
||
|
<p>Referenced by <a class="el" href="class_downloader.html#a2909b4a7cfb35f2709849ee2c95dae0e">calculateSizes()</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a26a4f889029c63c11f679284397a3285"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void Downloader::setUseCustomInstallProcedures </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const bool & </td>
|
||
|
<td class="paramname"><em>custom</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">slot</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>If the <em>custom</em> parameter is set to <code>true</code>, then the <code><a class="el" href="class_downloader.html" title="Implements an integrated file downloader with a nice UI. ">Downloader</a></code> will not attempt to open the downloaded file.</p>
|
||
|
<p>Use the signals fired by the <code><a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a></code> to implement your own install procedures. </p>
|
||
|
|
||
|
<p>Referenced by <a class="el" href="class_updater.html#ac3f35326fb62b9cf8a2421d91651ad60">Updater::setUseCustomInstallProcedures()</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a7f81027436d44ca52168b30a6eb0d379"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void Downloader::startDownload </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const QUrl & </td>
|
||
|
<td class="paramname"><em>url</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">slot</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Begins downloading the file at the given <em>url</em> </p>
|
||
|
|
||
|
<p>References <a class="el" href="class_downloader.html#acfd827dd6b36e82a4cc8bfbb284056e9">onDownloadFinished()</a>, and <a class="el" href="class_downloader.html#a097bee5b7d904da53427c5a5cb47ce83">updateProgress()</a>.</p>
|
||
|
|
||
|
<p>Referenced by <a class="el" href="class_updater.html#a1a38e54201eb876d14eb26fab40a7dc7">Updater::setUpdateAvailable()</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a097bee5b7d904da53427c5a5cb47ce83"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void Downloader::updateProgress </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">qint64 </td>
|
||
|
<td class="paramname"><em>received</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">qint64 </td>
|
||
|
<td class="paramname"><em>total</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">private</span><span class="mlabel">slot</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Uses the <em>received</em> and <em>total</em> parameters to get the download progress and update the progressbar value on the dialog. </p>
|
||
|
|
||
|
<p>References <a class="el" href="class_downloader.html#a2909b4a7cfb35f2709849ee2c95dae0e">calculateSizes()</a>, and <a class="el" href="class_downloader.html#a662cc753f90f25c91721f8edeaac9b57">calculateTimeRemaining()</a>.</p>
|
||
|
|
||
|
<p>Referenced by <a class="el" href="class_downloader.html#a7f81027436d44ca52168b30a6eb0d379">startDownload()</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a3e7a91a3cdfa68e3bc59db0af1377f9c"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool Downloader::useCustomInstallProcedures </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Returns <code>true</code> if the updater shall not intervene when the download has finished (you can use the <code><a class="el" href="class_q_simple_updater.html" title="Manages the updater instances. ">QSimpleUpdater</a></code> signals to know when the download is completed). </p>
|
||
|
|
||
|
<p>Referenced by <a class="el" href="class_downloader.html#abd39884d0586459bdd09b490913223fe">installUpdate()</a>, and <a class="el" href="class_updater.html#a7860e1643f426dc4d62cec2cdf207cd5">Updater::useCustomInstallProcedures()</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/>The documentation for this class was generated from the following files:<ul>
|
||
|
<li><a class="el" href="_downloader_8h_source.html">Downloader.h</a></li>
|
||
|
<li>Downloader.cpp</li>
|
||
|
</ul>
|
||
|
</div><!-- contents -->
|
||
|
<!-- start footer part -->
|
||
|
<hr class="footer"/><address class="footer"><small>
|
||
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||
|
</a> 1.8.11
|
||
|
</small></address>
|
||
|
</body>
|
||
|
</html>
|