diff --git a/AicsKnowledgeBase/qml/page/ContentPage.qml b/AicsKnowledgeBase/qml/page/ContentPage.qml index fccba38..5e248c2 100644 --- a/AicsKnowledgeBase/qml/page/ContentPage.qml +++ b/AicsKnowledgeBase/qml/page/ContentPage.qml @@ -193,9 +193,7 @@ FluArea { } onClicked: { emit: content_area.download(content_area.knowledgeFileId) - // FileTransferManager.download(content_area.knowledgeFileId) - FileTransferManager.download( - "4973c59e-3ba1-41f2-a57e-3b53c2b5e2a4") + FileTransferManager.download(content_area.knowledgeFileId) } } } diff --git a/AicsKnowledgeBase/src/FileTransferManager.cpp b/AicsKnowledgeBase/src/FileTransferManager.cpp index 592df5c..35888fc 100644 --- a/AicsKnowledgeBase/src/FileTransferManager.cpp +++ b/AicsKnowledgeBase/src/FileTransferManager.cpp @@ -339,11 +339,8 @@ bool httpDownload(const std::string &url, const FileItem &item) return res == CURLE_OK; } -void FileTransferManager::download(QString fileId) +void FileTransferManager::download(const QString& fileId) { - static int _fileId = 0; - //fileId = QString::number(_fileId++); - QtConcurrent::run([fileId, this] { qDebug() << "Start Get"; @@ -364,7 +361,7 @@ void FileTransferManager::download(QString fileId) FileTransferListModel::instance().insertItem(item); });*/ - auto fileUrl = "https://curl.se/download/curl-8.1.2.zip"; + auto fileUrl = "File/" + fileId.toStdString(); /* curl_slist *headers = nullptr; diff --git a/AicsKnowledgeBase/src/FileTransferManager.h b/AicsKnowledgeBase/src/FileTransferManager.h index 256aec0..2f2406a 100644 --- a/AicsKnowledgeBase/src/FileTransferManager.h +++ b/AicsKnowledgeBase/src/FileTransferManager.h @@ -24,7 +24,7 @@ public: Q_INVOKABLE QString getFileMd5(const QUrl& fileUrl); Q_INVOKABLE void upload(const QUrl& fileUrl, const QString& fileId, const QString& ticket, const QString &fileName); - Q_INVOKABLE void download(QString fileId); + Q_INVOKABLE void download(const QString& fileId); Q_INVOKABLE void pause(const QString& fileId); Q_INVOKABLE void resume(const QString& fileId);