Package: brewtarget Version: 1.2.4-1 Severity: grave Tags: patch Justification: renders package unusable
Crashes every time on start up. I applied a patch from upstream to simplify checkForNewVersion(). Recompiled and it works. -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 3.2.0-2-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages brewtarget depends on: ii libc6 2.13-33 ii libgcc1 1:4.7.1-1 ii libphonon4 4:4.6.0.0-2 ii libqt4-dbus 4:4.8.2-1 ii libqt4-network 4:4.8.2-1 ii libqt4-svg 4:4.8.2-1 ii libqt4-xml 4:4.8.2-1 ii libqt4-xmlpatterns 4:4.8.2-1 ii libqtcore4 4:4.8.2-1 ii libqtgui4 4:4.8.2-1 ii libqtwebkit4 2.2.1-4+b1 ii libstdc++6 4.7.1-1 ii phonon 4:4.6.0.0-2 brewtarget recommends no packages. brewtarget suggests no packages. -- no debconf information
--- a/src/brewtarget.cpp +++ b/src/brewtarget.cpp @@ -56,6 +56,7 @@ #include "CelsiusTempUnitSystem.h" #include "ImperialVolumeUnitSystem.h" #include "BtSplashScreen.h" +#include "MainWindow.h" QApplication* Brewtarget::app; MainWindow* Brewtarget::mainWindow; @@ -127,7 +128,7 @@ return true; } -void Brewtarget::checkForNewVersion() +void Brewtarget::checkForNewVersion(MainWindow* mw) { // Don't do anything if the checkVersion flag was set false @@ -135,53 +136,10 @@ return; QNetworkAccessManager manager; - QEventLoop loop; QUrl url("http://brewtarget.sourceforge.net/version"); - QSharedPointer<QNetworkReply> reply = QSharedPointer<QNetworkReply>(manager.get( QNetworkRequest(url) )); - QObject::connect( reply.data(), SIGNAL(finished()), &loop, SLOT(quit())); + QNetworkReply* reply = manager.get( QNetworkRequest(url) ); + QObject::connect( reply, SIGNAL(finished()), mw, SLOT(finishCheckingVersion())); - loop.exec(); // Waits until the reply comes back. - - QString remoteVersion(reply->readAll()); - - // If there is an error, just return. - if( reply->error() != QNetworkReply::NoError ) - return; - - // If the remote version is newer... - if( !remoteVersion.startsWith(VERSIONSTRING) ) - { - // ...and the user wants to download the new version... - if( QMessageBox::information(mainWindow, - QObject::tr("New Version"), - QObject::tr("Version %1 is now available. Download it?").arg(remoteVersion), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::Yes) == QMessageBox::Yes ) - { - // ...take them to the website. - QDesktopServices::openUrl(QUrl("http://brewtarget.sourceforge.net")); - } - else // ... and the user does NOT want to download the new version... - { - // ... and they want us to stop bothering them... - if( QMessageBox::question(mainWindow, - QObject::tr("New Version"), - QObject::tr("Stop bothering you about new versions?"), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::Yes) == QMessageBox::Yes) - { - // ... tell brewtarget to stop bothering the user about the new version. - checkVersion = false; - } - } - } - else // The current version is newest so... - { - // ...tell brewtarget to bother users about future new versions. - // This means that when a user downloads the new version, this - // variable will always get reset to true. - checkVersion = true; - } } bool Brewtarget::copyDataFiles(QString newPath) @@ -544,7 +502,7 @@ splashScreen.finish(mainWindow); - checkForNewVersion(); + checkForNewVersion(mainWindow); ret = app->exec(); savePersistentOptions(); --- a/src/brewtarget.h +++ b/src/brewtarget.h @@ -137,7 +137,7 @@ //! Load translation files. static void loadTranslations(); //! Checks for a newer version and prompts user to download. - static void checkForNewVersion(); + static void checkForNewVersion(MainWindow* mw); //! If this option is false, do not bother the user about new versions. static bool checkVersion;