Some updates to the updater thread.

This commit is contained in:
LoRd_MuldeR 2013-11-29 01:18:36 +01:00
parent dd39addb39
commit 4eef80fdc3
4 changed files with 18 additions and 8 deletions

View File

@ -87,7 +87,10 @@ UpdateDialog::UpdateDialog(SettingsModel *settings, QWidget *parent)
m_firstShow(true), m_firstShow(true),
m_updateReadyToInstall(false), m_updateReadyToInstall(false),
m_updaterProcess(NULL), m_updaterProcess(NULL),
m_binaryUpdater(lamexp_lookup_tool("wupdate.exe")) m_binaryUpdater(lamexp_lookup_tool("wupdate.exe")),
m_binaryWGet(lamexp_lookup_tool("wget.exe")),
m_binaryGnuPG(lamexp_lookup_tool("gpgv.exe")),
m_binaryKeys(lamexp_lookup_tool("gpgv.gpg"))
{ {
if(m_binaryUpdater.isEmpty()) if(m_binaryUpdater.isEmpty())
{ {
@ -156,7 +159,7 @@ void UpdateDialog::showEvent(QShowEvent *event)
{ {
if(!m_thread) if(!m_thread)
{ {
m_thread = new UpdateCheckThread(m_betaUpdates); m_thread = new UpdateCheckThread(m_binaryWGet, m_binaryGnuPG, m_binaryKeys, m_betaUpdates);
connect(m_thread, SIGNAL(statusChanged(int)), this, SLOT(threadStatusChanged(int))); connect(m_thread, SIGNAL(statusChanged(int)), this, SLOT(threadStatusChanged(int)));
connect(m_thread, SIGNAL(progressChanged(int)), this, SLOT(threadProgressChanged(int))); connect(m_thread, SIGNAL(progressChanged(int)), this, SLOT(threadProgressChanged(int)));
connect(m_thread, SIGNAL(messageLogged(QString)), this, SLOT(threadMessageLogged(QString))); connect(m_thread, SIGNAL(messageLogged(QString)), this, SLOT(threadMessageLogged(QString)));
@ -456,7 +459,7 @@ void UpdateDialog::testKnownHosts(void)
{ {
ui->statusLabel->setText("Testing all known hosts, this may take a few minutes..."); ui->statusLabel->setText("Testing all known hosts, this may take a few minutes...");
if(UpdateCheckThread *testThread = new UpdateCheckThread(m_betaUpdates, true)) if(UpdateCheckThread *testThread = new UpdateCheckThread(m_binaryWGet, m_binaryGnuPG, m_binaryKeys, m_betaUpdates, true))
{ {
QEventLoop loop; QEventLoop loop;
m_logFile->clear(); m_logFile->clear();

View File

@ -71,6 +71,9 @@ protected:
private: private:
Ui::UpdateDialog *ui; //for Qt UIC Ui::UpdateDialog *ui; //for Qt UIC
const QString m_binaryWGet;
const QString m_binaryGnuPG;
const QString m_binaryKeys;
const QString m_binaryUpdater; const QString m_binaryUpdater;
UpdateCheckThread *m_thread; UpdateCheckThread *m_thread;

View File

@ -109,8 +109,10 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites
"http://imgur.com/", "http://imgur.com/",
"http://en.jd.com/", "http://en.jd.com/",
"http://mirrors.kernel.org/", "http://mirrors.kernel.org/",
"http://lame.sourceforge.net/",
"http://www.libav.org/", "http://www.libav.org/",
"http://www.linkedin.com/about-us", "http://www.linkedin.com/about-us",
"http://www.linuxmint.com/",
"http://www.livedoor.com/", "http://www.livedoor.com/",
"http://www.livejournal.com/", "http://www.livejournal.com/",
"http://mail.ru/", "http://mail.ru/",
@ -137,10 +139,12 @@ static const char *known_hosts[] = //Taken form: http://www.alexa.com/topsites
"http://www.uol.com.br/", "http://www.uol.com.br/",
"http://www.videohelp.com/", "http://www.videohelp.com/",
"http://www.videolan.org/", "http://www.videolan.org/",
"http://virtualdub.org/",
"http://www.weibo.com/", "http://www.weibo.com/",
"http://www.wikipedia.org/", "http://www.wikipedia.org/",
"http://www.winamp.com/", "http://www.winamp.com/",
"http://wordpress.com/", "http://wordpress.com/",
"http://xiph.org/",
"http://us.yahoo.com/", "http://us.yahoo.com/",
"http://www.yandex.ru/", "http://www.yandex.ru/",
"http://www.youtube.com/", "http://www.youtube.com/",
@ -185,14 +189,14 @@ void UpdateInfo::resetInfo(void)
// Constructor & Destructor // Constructor & Destructor
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
UpdateCheckThread::UpdateCheckThread(const bool betaUpdates, const bool testMode) UpdateCheckThread::UpdateCheckThread(const QString &binWGet, const QString &binGnuPG, const QString &binKeys, const bool betaUpdates, const bool testMode)
: :
m_updateInfo(new UpdateInfo()), m_updateInfo(new UpdateInfo()),
m_binaryWGet(binWGet),
m_binaryGnuPG(binGnuPG),
m_binaryKeys(binKeys),
m_betaUpdates(betaUpdates), m_betaUpdates(betaUpdates),
m_testMode(testMode), m_testMode(testMode),
m_binaryWGet(lamexp_lookup_tool("wget.exe")),
m_binaryGnuPG(lamexp_lookup_tool("gpgv.exe")),
m_binaryKeys(lamexp_lookup_tool("gpgv.gpg")),
m_maxProgress(getMaxProgress()) m_maxProgress(getMaxProgress())
{ {
m_success = false; m_success = false;

View File

@ -62,7 +62,7 @@ public:
} }
update_status_t; update_status_t;
UpdateCheckThread(const bool betaUpdates, const bool testMode = false); UpdateCheckThread(const QString &binWGet, const QString &binGnuPG, const QString &binKeys, const bool betaUpdates, const bool testMode = false);
~UpdateCheckThread(void); ~UpdateCheckThread(void);
const int getUpdateStatus(void) const { return m_status; } const int getUpdateStatus(void) const { return m_status; }