From f050489a921c6abac815286109b37ae07e8b0ca6 Mon Sep 17 00:00:00 2001 From: Doug McLain Date: Mon, 24 Apr 2023 21:46:55 -0400 Subject: [PATCH] Fix host/id file download bug --- DroidStar.pro | 8 ++++---- httpmanager.cpp | 9 +++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/DroidStar.pro b/DroidStar.pro index cf2ce9f..752f36d 100644 --- a/DroidStar.pro +++ b/DroidStar.pro @@ -8,12 +8,12 @@ unix:!ios:QT += serialport CONFIG += c++11 LFLAGS += android:INCLUDEPATH += $$(HOME)/Android/android-build/include -LIBS += -limbe_vocoder +LIBS += -limbe_vocoder # -lvocoder !win32:LIBS += -ldl win32:QT += serialport -win32:INCLUDEPATH += /mnt/data/src/mxe/usr/include -win32:LIBS += -L/mnt/data/src/mxe/usr/lib64 -#win32:LIBS += -L/mnt/data/src/mxe/usr/lib -lws2_32 +win32:INCLUDEPATH += /mnt/data/src/winlibs/include +win32:LIBS += -L/mnt/data/src/winlibs/lib64 +#win32:LIBS += -L/mnt/data/src/winlibs/lib -lws2_32 win32:QMAKE_LFLAGS += -static QMAKE_LFLAGS_WINDOWS += --enable-stdcall-fixup RC_ICONS = images/droidstar.ico diff --git a/httpmanager.cpp b/httpmanager.cpp index 70689c4..27cda83 100644 --- a/httpmanager.cpp +++ b/httpmanager.cpp @@ -42,12 +42,11 @@ void HttpManager::doRequest() else{ m_qnam->get(QNetworkRequest(QUrl("http://www.dudetronics.com/ar-dns" + m_filename))); } - //qDebug() << "doRequest() called m_filename == " << m_filename; } void HttpManager::http_finished(QNetworkReply *reply) { - qDebug() << "http_finished() called"; + //qDebug() << "http_finished() called"; if (reply->error()) { reply->deleteLater(); reply = nullptr; @@ -59,11 +58,10 @@ void HttpManager::http_finished(QNetworkReply *reply) QStringList l = m_filename.split('/'); m_filename = "/" + l.at(l.size() - 1); } + //qDebug() << "m_config_path + m_filename = " << m_config_path + m_filename; QStringList l = m_filename.split('_'); - qDebug() << "m_filename = " << m_filename; - if(l.at(0) != "vocoder") return; + if((l.at(0) != "/vocoder") && (l.size() > 1)) return; QFile *hosts_file = new QFile(m_config_path + m_filename); - qDebug() << "m_config_path + m_filename = " << m_config_path + m_filename; hosts_file->open(QIODevice::WriteOnly); QFileInfo fileInfo(hosts_file->fileName()); QString filename(fileInfo.fileName()); @@ -72,7 +70,6 @@ void HttpManager::http_finished(QNetworkReply *reply) hosts_file->close(); delete hosts_file; emit file_downloaded(filename); - //fprintf(stderr, "Downloaded %s\n", filename.toStdString().c_str());fflush(stderr); } QThread::currentThread()->quit(); }