mirror of
https://github.com/leozide/leocad
synced 2025-01-28 19:58:12 +01:00
Fixed connecting to rebrickable on Linux.
This commit is contained in:
parent
0ec956e700
commit
a3995efa36
3 changed files with 14 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#ifndef LC_GLOBAL_H
|
||||
#define LC_GLOBAL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
|
@ -65,3 +66,5 @@ class lcMemFile;
|
|||
class lcDiskFile;
|
||||
|
||||
#endif
|
||||
|
||||
#endif // LC_GLOBAL_H
|
||||
|
|
|
@ -69,7 +69,7 @@ lcSetsDatabaseDialog::lcSetsDatabaseDialog(QWidget* Parent)
|
|||
connect(ui->SetsTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(accept()));
|
||||
connect(this, SIGNAL(finished(int)), this, SLOT(Finished(int)));
|
||||
#ifndef Q_OS_WIN
|
||||
connect(&mNetworkManager, SIGNAL(finished(QNetworkReply*)), SLOT(DownloadFinished(lcHttpReply*)));
|
||||
connect(&mNetworkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(DownloadFinished(QNetworkReply*)));
|
||||
#endif
|
||||
|
||||
mKeyListReply = RequestURL("http://www.leocad.org/rebrickable.json");
|
||||
|
@ -84,7 +84,7 @@ lcHttpReply* lcSetsDatabaseDialog::RequestURL(const QString& URL)
|
|||
{
|
||||
#ifdef Q_OS_WIN
|
||||
lcHttpReply* Reply = new lcHttpReply(this, URL);
|
||||
connect(Reply, &QThread::finished, [this, Reply] { DownloadFinished(Reply); });
|
||||
connect(Reply, &QThread::finished, [this, Reply] { ProcessReply(Reply); });
|
||||
Reply->start();
|
||||
return Reply;
|
||||
#else
|
||||
|
@ -221,7 +221,12 @@ void lcSetsDatabaseDialog::on_SearchButton_clicked()
|
|||
}
|
||||
}
|
||||
|
||||
void lcSetsDatabaseDialog::DownloadFinished(lcHttpReply* Reply)
|
||||
void lcSetsDatabaseDialog::DownloadFinished(QNetworkReply* Reply)
|
||||
{
|
||||
ProcessReply(Reply);
|
||||
}
|
||||
|
||||
void lcSetsDatabaseDialog::ProcessReply(lcHttpReply* Reply)
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
if (Reply == mKeyListReply)
|
||||
|
|
|
@ -68,13 +68,14 @@ public:
|
|||
virtual bool eventFilter(QObject* Object, QEvent* Event) override;
|
||||
|
||||
public slots:
|
||||
void DownloadFinished(lcHttpReply* Reply);
|
||||
void DownloadFinished(QNetworkReply* Reply);
|
||||
void on_SearchButton_clicked();
|
||||
void accept() override;
|
||||
void Finished(int Result);
|
||||
|
||||
protected:
|
||||
lcHttpReply* RequestURL(const QString& URL);
|
||||
void ProcessReply(lcHttpReply* Reply);
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
QNetworkAccessManager mNetworkManager;
|
||||
|
|
Loading…
Add table
Reference in a new issue