$OpenBSD: patch-desktop-widgets_mainwindow_cpp,v 1.2 2019/07/18 11:28:49 sthen Exp $

Index: desktop-widgets/mainwindow.cpp
--- desktop-widgets/mainwindow.cpp.orig
+++ desktop-widgets/mainwindow.cpp
@@ -237,7 +237,6 @@ MainWindow::MainWindow() : QMainWindow(),
 	memset(&copyPasteDive, 0, sizeof(copyPasteDive));
 	memset(&what, 0, sizeof(what));
 
-	updateManager = new UpdateManager(this);
 	undoAction = Command::undoAction(this);
 	redoAction = Command::redoAction(this);
 	undoAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Z));
@@ -359,8 +358,21 @@ MainWindow::~MainWindow()
 	m_Instance = nullptr;
 }
 
+voodooHack *voodooHack::instance()
+{
+	static voodooHack *self = new voodooHack();
+	return self;
+}
+
+voodooHack::voodooHack(QObject *parent) :
+	QObject(parent),
+	manager(new QNetworkAccessManager(this))
+{
+}
+
 void MainWindow::setupSocialNetworkMenu()
 {
+	voodooHack *fb = voodooHack::instance();
 }
 
 void MainWindow::editDiveSite(dive_site *ds)
@@ -1207,14 +1219,6 @@ void MainWindow::on_actionAboutSubsurface_triggered()
 	dlg.exec();
 }
 
-void MainWindow::on_action_Check_for_Updates_triggered()
-{
-	if (!updateManager)
-		updateManager = new UpdateManager(this);
-
-	updateManager->checkForUpdates();
-}
-
 void MainWindow::on_actionUserManual_triggered()
 {
 #ifndef NO_USERMANUAL
@@ -1388,31 +1392,11 @@ void MainWindow::readSettings()
 
 	loadRecentFiles();
 	if (firstRun) {
-		checkSurvey();
 		firstRun = false;
 	}
 }
 
 #undef TOOLBOX_PREF_BUTTON
-
-void MainWindow::checkSurvey()
-{
-	QSettings s;
-	s.beginGroup("UserSurvey");
-	if (!s.contains("FirstUse42")) {
-		QVariant value = QDate().currentDate();
-		s.setValue("FirstUse42", value);
-	}
-	// wait a week for production versions, but not at all for non-tagged builds
-	int waitTime = 7;
-	QDate firstUse42 = s.value("FirstUse42").toDate();
-	if (run_survey || (firstUse42.daysTo(QDate().currentDate()) > waitTime && !s.contains("SurveyDone"))) {
-		if (!survey)
-			survey = new UserSurvey(this);
-		survey->show();
-	}
-	s.endGroup();
-}
 
 void MainWindow::writeSettings()
 {
