mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-27 19:49:15 +02:00
Switched to Qt5 signal/slot API
This commit is contained in:
@ -126,7 +126,7 @@ bool Downloader::doDownload(const Download &dl,
|
||||
if (reply && reply->isRunning()) {
|
||||
_currentDownloads.insert(url);
|
||||
ReplyTimeout::setTimeout(reply, _timeout);
|
||||
connect(reply, SIGNAL(finished()), this, SLOT(emitFinished()));
|
||||
connect(reply, &QNetworkReply::finished, this, &Downloader::emitFinished);
|
||||
} else if (reply)
|
||||
downloadFinished(reply);
|
||||
else
|
||||
|
@ -21,7 +21,7 @@ OnlineMap::OnlineMap(const QString &fileName, const QString &name,
|
||||
_tileLoader->setUrl(url);
|
||||
_tileLoader->setAuthorization(authorization);
|
||||
_tileLoader->setQuadTiles(quadTiles);
|
||||
connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(tilesLoaded()));
|
||||
connect(_tileLoader, &TileLoader::finished, this, &OnlineMap::tilesLoaded);
|
||||
}
|
||||
|
||||
QRectF OnlineMap::bounds()
|
||||
|
@ -61,7 +61,7 @@ TileLoader::TileLoader(const QString &dir, QObject *parent)
|
||||
qWarning("%s: %s", qPrintable(_dir), "Error creating tiles directory");
|
||||
|
||||
_downloader = new Downloader(this);
|
||||
connect(_downloader, SIGNAL(finished()), this, SIGNAL(finished()));
|
||||
connect(_downloader, &Downloader::finished, this, &TileLoader::finished);
|
||||
}
|
||||
|
||||
void TileLoader::loadTilesAsync(QVector<Tile> &list)
|
||||
@ -132,7 +132,7 @@ void TileLoader::loadTilesSync(QVector<Tile> &list)
|
||||
|
||||
if (!dl.empty()) {
|
||||
QEventLoop wait;
|
||||
QObject::connect(_downloader, SIGNAL(finished()), &wait, SLOT(quit()));
|
||||
connect(_downloader, &Downloader::finished, &wait, &QEventLoop::quit);
|
||||
if (_downloader->get(dl, _authorization))
|
||||
wait.exec();
|
||||
|
||||
|
@ -324,8 +324,8 @@ bool WMS::downloadCapabilities(const QString &url)
|
||||
{
|
||||
if (!_downloader) {
|
||||
_downloader = new Downloader(this);
|
||||
connect(_downloader, SIGNAL(finished()), this,
|
||||
SLOT(capabilitiesReady()));
|
||||
connect(_downloader, &Downloader::finished, this,
|
||||
&WMS::capabilitiesReady);
|
||||
}
|
||||
|
||||
QList<Download> dl;
|
||||
|
@ -76,10 +76,10 @@ WMSMap::WMSMap(const QString &fileName, const QString &name,
|
||||
|
||||
_tileLoader = new TileLoader(tilesDir, this);
|
||||
_tileLoader->setAuthorization(setup.authorization());
|
||||
connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(tilesLoaded()));
|
||||
connect(_tileLoader, &TileLoader::finished, this, &WMSMap::tilesLoaded);
|
||||
|
||||
_wms = new WMS(QDir(tilesDir).filePath(CAPABILITIES_FILE), setup, this);
|
||||
connect(_wms, SIGNAL(downloadFinished()), this, SLOT(wmsReady()));
|
||||
connect(_wms, &WMS::downloadFinished, this, &WMSMap::wmsReady);
|
||||
if (_wms->isReady())
|
||||
init();
|
||||
}
|
||||
|
@ -306,8 +306,8 @@ bool WMTS::downloadCapabilities(const QString &url)
|
||||
{
|
||||
if (!_downloader) {
|
||||
_downloader = new Downloader(this);
|
||||
connect(_downloader, SIGNAL(finished()), this,
|
||||
SLOT(capabilitiesReady()));
|
||||
connect(_downloader, &Downloader::finished, this,
|
||||
&WMTS::capabilitiesReady);
|
||||
}
|
||||
|
||||
QList<Download> dl;
|
||||
|
@ -21,10 +21,10 @@ WMTSMap::WMTSMap(const QString &fileName, const QString &name,
|
||||
|
||||
_tileLoader = new TileLoader(tilesDir, this);
|
||||
_tileLoader->setAuthorization(setup.authorization());
|
||||
connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(tilesLoaded()));
|
||||
connect(_tileLoader, &TileLoader::finished, this, &WMTSMap::tilesLoaded);
|
||||
|
||||
_wmts = new WMTS(QDir(tilesDir).filePath(CAPABILITIES_FILE), setup, this);
|
||||
connect(_wmts, SIGNAL(downloadFinished()), this, SLOT(wmtsReady()));
|
||||
connect(_wmts, &WMTS::downloadFinished, this, &WMTSMap::wmtsReady);
|
||||
if (_wmts->isReady())
|
||||
init();
|
||||
}
|
||||
|
Reference in New Issue
Block a user