Description: Disable "check for updates" feature, not appropriate for a Debian package.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

--- a/resources/forms/mainWindow.ui
+++ b/resources/forms/mainWindow.ui
@@ -1610,15 +1610,6 @@
     <string>Erase all Annotations</string>
    </property>
   </action>
-  <action name="actionCheckUpdate">
-   <property name="icon">
-    <iconset resource="../OpenBoard.qrc">
-     <normaloff>:/images/toolbar/updates.png</normaloff>:/images/toolbar/updates.png</iconset>
-   </property>
-   <property name="text">
-    <string>Check Update</string>
-   </property>
-  </action>
   <action name="actionHideApplication">
    <property name="icon">
     <iconset resource="../OpenBoard.qrc">
--- a/resources/forms/preferences.ui
+++ b/resources/forms/preferences.ui
@@ -3242,44 +3242,6 @@
          </property>
         </widget>
        </item>
-       <item>
-        <widget class="QGroupBox" name="softwareUpdateGroupBox">
-         <property name="minimumSize">
-          <size>
-           <width>0</width>
-           <height>70</height>
-          </size>
-         </property>
-         <property name="maximumSize">
-          <size>
-           <width>16777215</width>
-           <height>70</height>
-          </size>
-         </property>
-         <property name="title">
-          <string>Software Update</string>
-         </property>
-         <widget class="QCheckBox" name="checkSoftwareUpdateAtLaunchCheckBox">
-          <property name="enabled">
-           <bool>true</bool>
-          </property>
-          <property name="geometry">
-           <rect>
-            <x>10</x>
-            <y>30</y>
-            <width>551</width>
-            <height>21</height>
-           </rect>
-          </property>
-          <property name="text">
-           <string>Check software update at launch</string>
-          </property>
-          <property name="checked">
-           <bool>true</bool>
-          </property>
-         </widget>
-        </widget>
-       </item>
       </layout>
      </widget>
     </widget>
--- a/src/core/UBPreferencesController.cpp
+++ b/src/core/UBPreferencesController.cpp
@@ -263,7 +263,6 @@
     connect(mMarkerProperties->opacitySlider, SIGNAL(valueChanged(int)), this, SLOT(opacitySliderChanged(int)));
 
     // about tab
-    connect(mPreferencesUI->checkSoftwareUpdateAtLaunchCheckBox, SIGNAL(clicked(bool)), settings->appEnableAutomaticSoftwareUpdates, SLOT(setBool(bool)));
 }
 
 void UBPreferencesController::init()
@@ -273,7 +271,6 @@
     UBSettings* settings = UBSettings::settings();
 
     // about tab
-    mPreferencesUI->checkSoftwareUpdateAtLaunchCheckBox->setChecked(settings->appEnableAutomaticSoftwareUpdates->get().toBool());
 
     // display tab
     for(int i=0; i<mPreferencesUI->keyboardPaletteKeyButtonSize->count(); i++)
@@ -411,8 +408,6 @@
     }
     else if (mPreferencesUI->mainTabWidget->currentWidget() == mPreferencesUI->aboutTab)
     {
-        bool defaultValue = settings->appEnableAutomaticSoftwareUpdates->reset().toBool();
-        mPreferencesUI->checkSoftwareUpdateAtLaunchCheckBox->setChecked(defaultValue);
 
     }
     else if(mPreferencesUI->mainTabWidget->currentWidget() == mPreferencesUI->networkTab){
--- a/src/core/UBApplication.cpp
+++ b/src/core/UBApplication.cpp
@@ -337,7 +337,6 @@
     mPreferencesController = new UBPreferencesController(mainWindow);
 
     connect(mainWindow->actionPreferences, SIGNAL(triggered()), mPreferencesController, SLOT(show()));
-    connect(mainWindow->actionCheckUpdate, SIGNAL(triggered()), applicationController, SLOT(checkUpdateRequest()));
 
 
     toolBarPositionChanged(UBSettings::settings()->appToolBarPositionedAtTop->get());
@@ -535,8 +534,6 @@
             menu->addSeparator();
             menu->addAction(mainWindow->actionPreferences);
             menu->addAction(mainWindow->actionMultiScreen);
-            if (!UBSettings::settings()->appHideCheckForSoftwareUpdate->get().toBool())
-                menu->addAction(mainWindow->actionCheckUpdate);
             menu->addSeparator();
 
             menu->addAction(mainWindow->actionPodcast);
--- a/src/core/UBApplicationController.h
+++ b/src/core/UBApplicationController.h
@@ -148,13 +148,6 @@
         void actionCopy();
         void actionPaste();
 
-        void checkUpdateRequest();
-        void checkAtLaunch();
-
-    private slots:
-        void updateRequestFinished(QNetworkReply * reply);
-
-
     protected:
         void initPreviousViews();
 
--- a/src/core/UBApplicationController.cpp
+++ b/src/core/UBApplicationController.cpp
@@ -121,7 +121,6 @@
             , this, SLOT(addCapturedPixmap(const QPixmap &, bool, const QUrl&)));
 
     mNetworkAccessManager = new QNetworkAccessManager (this);
-    QTimer::singleShot (1000, this, SLOT (checkAtLaunch()));
 }
 
 
@@ -489,56 +489,6 @@ void UBApplicationController::showDesktop(bool dontSwitchFrontProcess)
 }
 
 
-void UBApplicationController::checkUpdate(const QUrl& url)
-{
-    QUrl jsonUrl = url;
-    if (url.isEmpty())
-        jsonUrl = UBSettings::settings()->appSoftwareUpdateURL->get().toUrl();
-
-    qDebug() << "Checking for update at url: " << jsonUrl.toString();
-
-    connect(mNetworkAccessManager, SIGNAL(finished(QNetworkReply*)),
-            this, SLOT(updateRequestFinished(QNetworkReply*)));
-
-    mNetworkAccessManager->get(QNetworkRequest(jsonUrl));
-
-}
-
-
-
-void UBApplicationController::updateRequestFinished(QNetworkReply * reply)
-{
-    if (reply->error()) {
-        qWarning() << "Error downloading update file: " << reply->errorString();
-        return;
-    }
-
-    // Check if we are being redirected. If so, call checkUpdate again
-
-    QVariant redirect_target = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
-    if (!redirect_target.isNull()) {
-        // The returned URL might be relative. resolved() creates an absolute url from it
-        QUrl redirect_url(reply->url().resolved(redirect_target.toUrl()));
-
-        checkUpdate(redirect_url);
-        return;
-    }
-
-    // No error and no redirect => we read the whole response
-
-    QString responseString = QString(reply->readAll());
-
-    if (!responseString.isEmpty() &&
-            responseString.contains("version") &&
-            responseString.contains("url")) {
-
-        reply->close();
-        reply->deleteLater();
-
-        downloadJsonFinished(responseString);
-    }
-}
-
 void UBApplicationController::initPreviousViews()
 {
     int numPreviousViews = UBApplication::displayManager->numPreviousViews();
@@ -560,53 +510,6 @@ void UBApplicationController::initPreviousViews()
 }
 
 
-void UBApplicationController::downloadJsonFinished(QString currentJson)
-{
-    /*
-      The .json files simply specify the latest version number available, and
-      the URL to send the user to, so they can download it.
-
-      They look like:
-
-          {
-            "version": "1.3.5",
-            "url": "http://openboard.ch"
-          }
-    */
-
-    QJsonObject jsonObject = QJsonDocument::fromJson(currentJson.toUtf8()).object();
-
-    UBVersion installedVersion (qApp->applicationVersion());
-    UBVersion jsonVersion (jsonObject.value("version").toString());
-
-    qDebug() << "json version: " << jsonVersion.toUInt();
-    qDebug() << "installed version: " << installedVersion.toUInt();
-
-    if (jsonVersion > installedVersion) {
-        if (UBApplication::mainWindow->yesNoQuestion(tr("Update available"), tr ("New update available, would you go to the web page ?"))){
-            QUrl url(jsonObject.value("url").toString());
-            QDesktopServices::openUrl(url);
-        }
-    }
-    else if (isNoUpdateDisplayed) {
-        mMainWindow->information(tr("Update"), tr("No update available"));
-    }
-}
-
-void UBApplicationController::checkAtLaunch()
-{
-    if(UBSettings::settings()->appEnableAutomaticSoftwareUpdates->get().toBool()){
-        isNoUpdateDisplayed = false;
-        checkUpdate();
-    }
-}
-
-void UBApplicationController::checkUpdateRequest()
-{
-    isNoUpdateDisplayed = true;
-    checkUpdate();
-}
-
 void UBApplicationController::hideDesktop()
 {
     if (mMainMode == Board)
