1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-30 22:51:16 +01:00

Cosmetics

This commit is contained in:
Martin Tůma 2020-12-08 00:58:01 +01:00
parent 74796e3e41
commit 59b734c402

View File

@ -890,7 +890,7 @@ void GUI::openPOIFile()
bool GUI::openPOIFile(const QString &fileName) bool GUI::openPOIFile(const QString &fileName)
{ {
if (fileName.isEmpty() || _poi->files().contains(fileName)) if (_poi->files().contains(fileName))
return false; return false;
if (_poi->loadFile(fileName)) { if (_poi->loadFile(fileName)) {
@ -1235,7 +1235,7 @@ void GUI::plotMainPage(QPainter *painter, const QRectF &rect, qreal ratio,
sc = 1; sc = 1;
} }
MapView::PlotFlags flags = MapView::NoFlags; MapView::PlotFlags flags;
if (_options.hiresPrint) if (_options.hiresPrint)
flags |= MapView::HiRes; flags |= MapView::HiRes;
if (expand) if (expand)
@ -1452,7 +1452,7 @@ void GUI::loadMap()
bool GUI::loadMap(const QString &fileName, MapAction *&action, bool silent) bool GUI::loadMap(const QString &fileName, MapAction *&action, bool silent)
{ {
QString error; QString error;
QList<Map*> maps = MapList::loadMaps(fileName, error); QList<Map*> maps(MapList::loadMaps(fileName, error));
if (maps.isEmpty()) { if (maps.isEmpty()) {
error = tr("Error loading map:") + "\n\n" + fileName + "\n\n" + error; error = tr("Error loading map:") + "\n\n" + fileName + "\n\n" + error;
if (!silent) if (!silent)
@ -1488,8 +1488,8 @@ void GUI::mapLoaded()
_showMapAction->setEnabled(true); _showMapAction->setEnabled(true);
_clearMapCacheAction->setEnabled(true); _clearMapCacheAction->setEnabled(true);
} else { } else {
QString error = tr("Error loading map:") + "\n\n" QString error = tr("Error loading map:") + "\n\n" + map->name() + "\n\n"
+ map->name() + "\n\n" + map->errorString(); + map->errorString();
QMessageBox::critical(this, APP_NAME, error); QMessageBox::critical(this, APP_NAME, error);
action->deleteLater(); action->deleteLater();
} }
@ -1497,8 +1497,8 @@ void GUI::mapLoaded()
void GUI::loadMapDir() void GUI::loadMapDir()
{ {
QString dir = QFileDialog::getExistingDirectory(this, QString dir(QFileDialog::getExistingDirectory(this,
tr("Select map directory"), _mapDir, QFileDialog::ShowDirsOnly); tr("Select map directory"), _mapDir, QFileDialog::ShowDirsOnly));
if (dir.isEmpty()) if (dir.isEmpty())
return; return;
@ -1592,7 +1592,7 @@ void GUI::nextMap()
if (!checked) if (!checked)
return; return;
QList<QAction*> maps = _mapsActionGroup->actions(); QList<QAction*> maps(_mapsActionGroup->actions());
for (int i = 1; i < maps.size(); i++) { for (int i = 1; i < maps.size(); i++) {
int next = (maps.indexOf(checked) + i) % maps.count(); int next = (maps.indexOf(checked) + i) % maps.count();
if (maps.at(next)->isEnabled()) { if (maps.at(next)->isEnabled()) {
@ -1608,7 +1608,7 @@ void GUI::prevMap()
if (!checked) if (!checked)
return; return;
QList<QAction*> maps = _mapsActionGroup->actions(); QList<QAction*> maps(_mapsActionGroup->actions());
for (int i = 1; i < maps.size(); i++) { for (int i = 1; i < maps.size(); i++) {
int prev = (maps.indexOf(checked) + maps.count() - i) % maps.count(); int prev = (maps.indexOf(checked) + maps.count() - i) % maps.count();
if (maps.at(prev)->isEnabled()) { if (maps.at(prev)->isEnabled()) {