From 23e8154a1fdc5246211f950438e5266d047a7e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 19 Jun 2022 23:05:01 +0200 Subject: [PATCH] Fixed map dir loading on Android --- src/GUI/mapitem.cpp | 6 +++++- src/map/maplist.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/GUI/mapitem.cpp b/src/GUI/mapitem.cpp index 770e19f2..996c7f8d 100644 --- a/src/GUI/mapitem.cpp +++ b/src/GUI/mapitem.cpp @@ -76,7 +76,7 @@ ToolTip MapItem::info() const if (!_name.isEmpty()) tt.insert(tr("Name"), _name); if (!_fileName.isEmpty()) - tt.insert(tr("File"), _fileName); + tt.insert(tr("File"), Util::displayName(_fileName)); return tt; } @@ -212,6 +212,10 @@ void MapItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) _pen.setWidthF((_width + 1) * pow(2, -_digitalZoom)); update(); + +#ifdef Q_OS_ANDROID + Popup::show(event->screenPos(), info(), event->widget()); +#endif // Q_OS_ANDROID } void MapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) diff --git a/src/map/maplist.cpp b/src/map/maplist.cpp index e853e95f..def15a73 100644 --- a/src/map/maplist.cpp +++ b/src/map/maplist.cpp @@ -101,7 +101,11 @@ TreeNode MapList::loadDir(const QString &path, const Projection &proj, md.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot); md.setSorting(QDir::DirsLast); QFileInfoList ml = md.entryInfoList(); - TreeNode tree(md.dirName()); +#ifdef Q_OS_ANDROID + TreeNode tree(Util::displayName(path)); +#else // Q_OS_ANDROID + TreeNode tree(Util::displayName(md.dirName())); +#endif // Q_OS_ANDROID for (int i = 0; i < ml.size(); i++) { const QFileInfo &fi = ml.at(i);