mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Map Short Names - add preference setting
Adds a preference setting in the "Default" settings tab to toggle whether to display shortened names in the Map. TODO: instead of using the generic "settingsChanged" signal, it would be much more efficient to only update items based on the actual setting which was changed. Signed-off-by: Michael WERLE <micha@michaelwerle.com>
This commit is contained in:
parent
3dbba5ae69
commit
efb1832db8
7 changed files with 44 additions and 3 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "divelocationmodel.h"
|
||||
#include "core/divesite.h"
|
||||
#include "core/divefilter.h"
|
||||
#include "core/settings/qPrefDisplay.h"
|
||||
#if !defined(SUBSURFACE_MOBILE) && !defined(SUBSURFACE_DOWNLOADER)
|
||||
#include "qt-models/filtermodels.h"
|
||||
#include "desktop-widgets/mapwidget.h"
|
||||
|
@ -19,8 +20,12 @@ static QString siteMapDisplayName(const char *sitename)
|
|||
{
|
||||
const char Separator = '/';
|
||||
QString fullname(sitename);
|
||||
QString name = fullname.section(Separator, -1).trimmed();
|
||||
|
||||
if (!qPrefDisplay::map_short_names() ) {
|
||||
return fullname;
|
||||
}
|
||||
|
||||
QString name = fullname.section(Separator, -1).trimmed();
|
||||
if (name.isEmpty()) {
|
||||
name = fullname;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue