Description: fixes for building against Qt5
 remove Qhttp code
Author: Laurence Abbott <laurence.abbott@york.ac.uk> 
Tested-By: Christian T. Steigies <cts@debian.org>
Last-Update: 2019-08-29
Index: gle-graphics/src/gui/3dviewer.cpp
===================================================================
--- gle-graphics.orig/src/gui/3dviewer.cpp
+++ gle-graphics/src/gui/3dviewer.cpp
@@ -162,7 +162,7 @@ GLuint QGLE3DWidget::makeObject()
     if (z != NULL) {
     	GLEColorList* colors = GLEGetColorList();
     	QString gle_color = QString::fromUtf8(sf->top_color).toUpper();
-    	GLEColor* color = colors->getSafeDefaultBlack(gle_color.toAscii().constData());
+    	GLEColor* color = colors->getSafeDefaultBlack(gle_color.toLatin1().constData());
     	glEnable(GL_POLYGON_OFFSET_FILL); // Avoid Stitching!
     	glPolygonOffset(1.0, 1.0);
     	double l = 0.8;
Index: gle-graphics/src/gui/dialogues.cpp
===================================================================
--- gle-graphics.orig/src/gui/dialogues.cpp
+++ gle-graphics/src/gui/dialogues.cpp
@@ -482,7 +482,7 @@ void SoftwareLocateDialogue::print(const
 
 CrashRecoverDialogue::CrashRecoverDialogue(const QString& file) : QDialog(NULL)
 {
-	http = NULL;
+//	http = NULL;
 	crashLog = file;
 	requestID = -1;
 	setWindowIcon(QIcon(":images/gle_shadow.png"));
@@ -628,7 +628,7 @@ void CrashRecoverDialogue::viewReport()
 	QVBoxLayout *layout = new QVBoxLayout();
 	layout->addWidget(new QLabel(tr("Report:")));
 	QTextEdit* txt = new QTextEdit();
-	txt->setReadOnly(TRUE);
+	txt->setReadOnly(true);
 	txt->insertPlainText(report);
 	QTextCursor cursor = txt->textCursor();
 	cursor.movePosition(QTextCursor::Start);
@@ -663,14 +663,14 @@ void CrashRecoverDialogue::requestFinish
 		}
 		else
 		{
-			QString err_s = http->errorString();
+			QString err_s = ""; // QString err_s = http->errorString();
 			QDialog mydial(this);
 			mydial.setWindowTitle("GLE Internal Error");
 			QVBoxLayout *layout = new QVBoxLayout();
 			layout->addWidget(new QLabel(tr("Result of sending report:")));
 			QTextBrowser* txt = new QTextBrowser();
 			txt->setOpenLinks(false);
-			txt->setReadOnly(TRUE);
+			txt->setReadOnly(true);
 			if (error) txt->insertPlainText(err_s);
 			else txt->setPlainText(result_txt);
 			layout->addWidget(txt);
@@ -691,7 +691,7 @@ void CrashRecoverDialogue::requestFinish
 
 void CrashRecoverDialogue::performRequest(QString url, QString script)
 {
-	http->setHost(url, 80);
+/*	http->setHost(url, 80);
 	QHttpRequestHeader header("POST", script);
 	header.setValue("Host", url);
 	header.setContentType("application/x-www-form-urlencoded");
@@ -704,7 +704,7 @@ void CrashRecoverDialogue::performReques
 	QByteArray tosend = tosend_s.toUtf8().constData();
 	buffer = new QBuffer();
 	buffer->open(QBuffer::ReadWrite);
-	requestID = http->request(header, tosend, buffer);
+	requestID = http->request(header, tosend, buffer); */
 }
 
 void CrashRecoverDialogue::sendReport()
@@ -712,7 +712,7 @@ void CrashRecoverDialogue::sendReport()
 	cancelButton->setEnabled(false);
 	sendButton->setEnabled(false);
 	saveEmail();
-	http = new QHttp(this);
-	connect(http, SIGNAL(requestFinished(int,bool)), this, SLOT(requestFinished(int,bool)));
+//	http = new QHttp(this);
+//	connect(http, SIGNAL(requestFinished(int,bool)), this, SLOT(requestFinished(int,bool)));
 	performRequest("www.gle-graphics.org", "/gle-crash-report.php");
 }
Index: gle-graphics/src/gui/dialogues.h
===================================================================
--- gle-graphics.orig/src/gui/dialogues.h
+++ gle-graphics/src/gui/dialogues.h
@@ -162,7 +162,7 @@ public slots:
 	void requestFinished(int id, bool error);
 protected:
 	int requestID, closeID;
-	QHttp* http;
+//	QHttp* http;
 	QBuffer *buffer;
 	QFileInfo gleFileName;
 	QString crashLog;
Index: gle-graphics/src/gui/mainwindow.cpp
===================================================================
--- gle-graphics.orig/src/gui/mainwindow.cpp
+++ gle-graphics/src/gui/mainwindow.cpp
@@ -1974,7 +1974,7 @@ void GLEMainWindow::openGhostScriptLogDi
 	QLabel *stdoutlab = new QLabel(tr("Output:"));
 	layout->addWidget(stdoutlab);
 	QTextEdit* stdouttxt = new QTextEdit();
-	stdouttxt->setReadOnly(TRUE);
+	stdouttxt->setReadOnly(true);
 	stdouttxt->insertPlainText(renderThread->getGhostScriptOutput());
 	layout->addWidget(stdouttxt);
 	QPushButton *okButton = new QPushButton(tr("OK"));
Index: gle-graphics/src/gui/objectblocks.cpp
===================================================================
--- gle-graphics.orig/src/gui/objectblocks.cpp
+++ gle-graphics/src/gui/objectblocks.cpp
@@ -61,7 +61,7 @@ void GLEObjectBlocksList::updateFile(QSt
 
 void GLEObjectBlocksList::selectEntry(const QModelIndex& mi) {
 	QStandardItem* item = model->itemFromIndex(mi);
-	GLEObjectDOConstructor* cons = (GLEObjectDOConstructor*)qVariantValue<void*>(item->data());
+	GLEObjectDOConstructor* cons = (GLEObjectDOConstructor*)item->data().value<void*>();
 	if (cons == NULL) return;
 	mainWin->clearConsoleWindow();
 	GLEObjectBlock* block = drawingArea->createNewObjectBlock(cons);
Index: gle-graphics/src/gui/qgs.h
===================================================================
--- gle-graphics.orig/src/gui/qgs.h
+++ gle-graphics/src/gui/qgs.h
@@ -335,7 +335,7 @@ protected:
 	bool m_wasPage; //! True if page() was called by the Ghostscript library and the page rendering is finished
 
 	QImage m_img;  //! Image on which we do the rendering
-	void *ghostScriptInstance; //! Pointer to the Ghostscript library instance
+	void *ghostScriptInstance = NULL; //! Pointer to the Ghostscript library instance
 
 	QString m_buffer; //! The IO buffer
 
Index: gle-graphics/src/gui/qgslibloader.cpp
===================================================================
--- gle-graphics.orig/src/gui/qgslibloader.cpp
+++ gle-graphics/src/gui/qgslibloader.cpp
@@ -293,7 +293,7 @@ int GSLibFunctions::loadLibrary(const QS
 	/* Error message if loading fails */
 	if (hmodule == NULL) {
 		/* Failed */
-		last_error = QString::fromAscii(dlerror());
+		last_error = QString::fromLatin1(dlerror());
 		return 2;
 	}
 	/* Get pointers to functions */
