# HG changeset patch # User sheepluva # Date 1335426455 -7200 # Node ID 0053936169259e750a1fefa71fbd1922082db809 # Parent 86c951cd0f3f661179622e13405fc9fa0af5ac69 make DLC trigger data reload diff -r 86c951cd0f3f -r 005393616925 QTfrontend/ui/page/pagedata.cpp --- a/QTfrontend/ui/page/pagedata.cpp Thu Apr 26 07:44:44 2012 +0200 +++ b/QTfrontend/ui/page/pagedata.cpp Thu Apr 26 09:47:35 2012 +0200 @@ -30,6 +30,7 @@ #include "pagedata.h" #include "databrowser.h" #include "hwconsts.h" +#include "DataManager.h" #include "quazip.h" #include "quazipfile.h" @@ -52,6 +53,7 @@ void PageDataDownload::connectSignals() { connect(web, SIGNAL(anchorClicked(QUrl)), this, SLOT(request(const QUrl&))); + connect(this, SIGNAL(goBack()), this, SLOT(onPageLeave())); } PageDataDownload::PageDataDownload(QWidget* parent) : AbstractPage(parent) @@ -60,6 +62,8 @@ web->setOpenLinks(false); // fetchList(); + + m_contentDownloaded = false; } void PageDataDownload::request(const QUrl &url) @@ -217,6 +221,8 @@ qWarning("read all but not EOF"); return false; } + + m_contentDownloaded = true; } file.close(); @@ -232,3 +238,13 @@ return true; } + + +void PageDataDownload::onPageLeave() +{ + if (m_contentDownloaded) + { + m_contentDownloaded = false; + DataManager::instance().reload(); + } +} diff -r 86c951cd0f3f -r 005393616925 QTfrontend/ui/page/pagedata.h --- a/QTfrontend/ui/page/pagedata.h Thu Apr 26 07:44:44 2012 +0200 +++ b/QTfrontend/ui/page/pagedata.h Thu Apr 26 09:47:35 2012 +0200 @@ -46,6 +46,8 @@ QHash progressBars; QVBoxLayout *progressBarsLayout; + bool m_contentDownloaded; ///< true if something was downloaded since last page leave + bool extractDataPack(QByteArray * buf); private slots: @@ -54,6 +56,8 @@ void pageDownloaded(); void fileDownloaded(); void downloadProgress(qint64, qint64); + + void onPageLeave(); }; #endif