Skip to content

Commit

Permalink
Q_GLOBAL_STATIC for QgsCustomization
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 2, 2019
1 parent 5c9416b commit ce8f25a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/app/qgscustomization.cpp
Expand Up @@ -39,6 +39,8 @@
#include <QMetaObject>
#include <QSettings>

Q_GLOBAL_STATIC_WITH_ARGS( QStringList, sInternalWidgets, ( { QLatin1String( "qt_tabwidget_stackedwidget" ), QLatin1String( "qt_tabwidget_tabbar" ) } ) )

#ifdef Q_OS_MACX
QgsCustomizationDialog::QgsCustomizationDialog( QWidget *parent, QSettings *settings )
: QMainWindow( parent, Qt::WindowSystemMenuHint ) // Modeless dialog with close button only
Expand Down Expand Up @@ -501,7 +503,7 @@ QString QgsCustomizationDialog::widgetPath( QWidget *widget, const QString &path

QString pathCopy = path;

if ( !QgsCustomization::sInternalWidgets.contains( name ) )
if ( !sInternalWidgets()->contains( name ) )
{
if ( !pathCopy.isEmpty() )
{
Expand Down Expand Up @@ -686,8 +688,6 @@ void QgsCustomization::createTreeItemStatus()
mMainWindowItems << topItem;
}

QStringList QgsCustomization::sInternalWidgets = QStringList() << QStringLiteral( "qt_tabwidget_stackedwidget" ) << QStringLiteral( "qt_tabwidget_tabbar" );

QgsCustomization *QgsCustomization::sInstance = nullptr;
QgsCustomization *QgsCustomization::instance()
{
Expand Down Expand Up @@ -906,7 +906,7 @@ void QgsCustomization::customizeWidget( const QString &path, QWidget *widget, QS
// qt_tabwidget_stackedwidget, such widgets do not appear in the tree generated
// from ui files and do not have sense from user point of view -> skip

if ( !QgsCustomization::sInternalWidgets.contains( name ) )
if ( !sInternalWidgets()->contains( name ) )
{
myPath = path + '/' + name;
}
Expand Down
3 changes: 0 additions & 3 deletions src/app/qgscustomization.h
Expand Up @@ -143,9 +143,6 @@ class APP_EXPORT QgsCustomization : public QObject
// Loads and sets default customization
void loadDefault();

// Internal Qt widget which has to be skipped in paths
static QStringList sInternalWidgets;

QString statusPath() const { return mStatusPath; }

public slots:
Expand Down

0 comments on commit ce8f25a

Please sign in to comment.