changeset 301:2facccc60523

Remove optionality of QtHttp.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 15 May 2023 14:04:33 +0300
parents 3cca82bced54
children 52f0da883469
files Makefile Makefile.cross-mingw src/main.cpp src/main.h
diffstat 4 files changed, 6 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu May 11 13:58:28 2023 +0300
+++ b/Makefile	Mon May 15 14:04:33 2023 +0300
@@ -2,8 +2,6 @@
 ### Configuration settings for Linux and generic UNIX
 ### See other Makefile.* files for more options.
 ###
-USE_QTHTTP ?= yes
-
 
 # Miscellaneous
 ifneq ($(QT6),)
@@ -20,13 +18,9 @@
 OBJPATH = obj/unix/
 BINEXT =
 
-QT_MODULES = Core Gui Widgets Sql PrintSupport
+QT_MODULES = Core Gui Widgets Sql PrintSupport Network
 
 # Compiler flags and linker flags
-ifeq ($(USE_QTHTTP),yes)
-QT_MODULES += Network
-QT_FLAGS += -DUSE_QTHTTP
-endif
 QT_FLAGS += 
 QT_INCLUDES = -I. $(shell pkg-config --cflags $(addprefix $(QT_VERSION_PREFIX),$(QT_MODULES)))
 
--- a/Makefile.cross-mingw	Thu May 11 13:58:28 2023 +0300
+++ b/Makefile.cross-mingw	Mon May 15 14:04:33 2023 +0300
@@ -6,8 +6,6 @@
 QT_PREFIX ?= /misc/packages/qt5-src/qtbase
 QT_TOOL_PREFIX = $(QT_PREFIX)/bin/
 
-USE_QTHTTP ?= yes
-
 PREFIX =
 BINEXT = .exe
 
@@ -25,14 +23,10 @@
 OBJPATH ?= ./obj/win32/
 endif
 
-QT_MODULES = Core Gui Widgets Sql PrintSupport
+QT_MODULES = Core Gui Widgets Sql PrintSupport Network
 
 # Compiler flags and linker flags
 QT_FLAGS = -DUNICODE -DQT_NEEDS_QMAIN
-ifeq ($(USE_QTHTTP),yes)
-QT_MODULES += Network
-QT_FLAGS += -DUSE_QTHTTP
-endif
 QT_INCLUDES = -I. \
 	-I$(QT_PREFIX)/include \
 	$(addprefix -I$(QT_PREFIX)/include/Qt,$(QT_MODULES)) \
--- a/src/main.cpp	Thu May 11 13:58:28 2023 +0300
+++ b/src/main.cpp	Mon May 15 14:04:33 2023 +0300
@@ -435,7 +435,6 @@
 
     if (settings.dbBackupMode == BACKUP_HTTP)
     {
-#ifdef USE_QTHTTP
         // Check for network access
         httpBackupReply = NULL;
 
@@ -513,11 +512,6 @@
             SIGNAL(error(QNetworkReply::NetworkError)),
             this,
             SLOT(httpBackupError(QNetworkReply::NetworkError)));
-#else
-        // Disabled
-        slLog("ERROR", QStringLiteral("Backup method is HTTP/HTTPS, but support is not compiled in!"));
-        return;
-#endif
     }
     else
     {
@@ -540,7 +534,6 @@
 }
 
 
-#ifdef USE_QTHTTP
 void SyntilistaMainWindow::httpBackupProgress(qint64 bytesSent, qint64 bytesTotal)
 {
     if (bytesTotal > 0)
@@ -599,7 +592,6 @@
 
     backupDialog->close();
 }
-#endif
 
 
 //
--- a/src/main.h	Thu May 11 13:58:28 2023 +0300
+++ b/src/main.h	Mon May 15 14:04:33 2023 +0300
@@ -17,12 +17,10 @@
 #include <QPainter>
 #include <QPrinter>
 #include <QProgressDialog>
-#ifdef USE_QTHTTP
-#    include <QNetworkAccessManager>
-#    include <QNetworkRequest>
-#    include <QNetworkReply>
-#    include <QHttpMultiPart>
-#endif
+#include <QNetworkAccessManager>
+#include <QNetworkRequest>
+#include <QNetworkReply>
+#include <QHttpMultiPart>
 
 
 //
@@ -227,20 +225,16 @@
 
     void printDocument(QPrinter *printer);
 
-#ifdef USE_QTHTTP
     void httpBackupProgress(qint64 bytesSent, qint64 bytesTotal);
     void httpBackupFinished();
     void httpBackupError(QNetworkReply::NetworkError code);
-#endif
 
 
 private:
     Ui::SyntilistaMainWindow *ui;
 
     QProgressDialog *backupDialog;
-#ifdef USE_QTHTTP
     QNetworkReply *httpBackupReply;
-#endif
 
     SLTransactionSQLModel *model_Latest;
     SLPersonInfo currPerson;