Fix host/id file download bug

main
Doug McLain 1 year ago
parent ba99cbe675
commit f050489a92

@ -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

@ -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();
}

Loading…
Cancel
Save