From 992766754ed7216f0347cb581d4756cfe114646d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 28 Jan 2016 15:49:45 +0100 Subject: Move QQuickStyleSelector::allSelector() to private Change-Id: I6ba9d1c41b2ab6766faef6cdbdfb780e6ca37dfd Reviewed-by: Liang Qi --- src/controls/qquickstyleselector.cpp | 17 ++++++++--------- src/controls/qquickstyleselector_p.h | 3 --- src/controls/qquickstyleselector_p_p.h | 4 +++- 3 files changed, 11 insertions(+), 13 deletions(-) (limited to 'src/controls') diff --git a/src/controls/qquickstyleselector.cpp b/src/controls/qquickstyleselector.cpp index 85b54045..b8a15ee9 100644 --- a/src/controls/qquickstyleselector.cpp +++ b/src/controls/qquickstyleselector.cpp @@ -90,10 +90,10 @@ QString QQuickStyleSelector::select(const QString &filePath) const if (isLocalScheme(url.scheme()) || url.isLocalFile()) { if (isLocalScheme(url.scheme())) { QString equivalentPath = QLatin1Char(':') + url.path(); - QString selectedPath = d->select(equivalentPath, allSelectors()); + QString selectedPath = d->select(equivalentPath); url.setPath(selectedPath.remove(0, 1)); } else { - url = QUrl::fromLocalFile(d->select(url.toLocalFile(), allSelectors())); + url = QUrl::fromLocalFile(d->select(url.toLocalFile())); } } return url.toString(); @@ -125,7 +125,7 @@ static QString selectionHelper(const QString &path, const QString &fileName, con return path + fileName; } -QString QQuickStyleSelectorPrivate::select(const QString &filePath, const QStringList &allSelectors) const +QString QQuickStyleSelectorPrivate::select(const QString &filePath) const { QFileInfo fi(filePath); // If file doesn't exist, don't select @@ -133,7 +133,7 @@ QString QQuickStyleSelectorPrivate::select(const QString &filePath, const QStrin return filePath; QString ret = selectionHelper(fi.path().isEmpty() ? QString() : fi.path() + QLatin1Char('/'), - fi.fileName(), allSelectors); + fi.fileName(), allSelectors()); if (!ret.isEmpty()) return ret; @@ -152,14 +152,13 @@ void QQuickStyleSelector::setStyle(const QString &s) d->style = s; } -QStringList QQuickStyleSelector::allSelectors() const +QStringList QQuickStyleSelectorPrivate::allSelectors() const { - Q_D(const QQuickStyleSelector); QMutexLocker locker(&sharedDataMutex); - QQuickStyleSelectorPrivate::updateSelectors(); + updateSelectors(); QStringList selectors = sharedData->staticSelectors; - if (!d->style.isEmpty()) - selectors.prepend(d->style); + if (!style.isEmpty()) + selectors.prepend(style); return selectors; } diff --git a/src/controls/qquickstyleselector_p.h b/src/controls/qquickstyleselector_p.h index 17204c32..2ca6ea3a 100644 --- a/src/controls/qquickstyleselector_p.h +++ b/src/controls/qquickstyleselector_p.h @@ -47,7 +47,6 @@ // #include -#include #include QT_BEGIN_NAMESPACE @@ -64,8 +63,6 @@ public: QString style() const; void setStyle(const QString &s); - QStringList allSelectors() const; - void setBaseUrl(const QUrl &base); QUrl baseUrl() const; diff --git a/src/controls/qquickstyleselector_p_p.h b/src/controls/qquickstyleselector_p_p.h index b0de326b..e4df1035 100644 --- a/src/controls/qquickstyleselector_p_p.h +++ b/src/controls/qquickstyleselector_p_p.h @@ -49,6 +49,7 @@ #include #include #include +#include #include "qquickstyleselector_p.h" @@ -67,7 +68,8 @@ public: static QStringList platformSelectors(); static void addStatics(const QStringList &); //For loading GUI statics from other Qt modules QQuickStyleSelectorPrivate(); - QString select(const QString &filePath, const QStringList &allSelectors) const; + QString select(const QString &filePath) const; + QStringList allSelectors() const; QString style; QUrl baseUrl; -- cgit v1.2.3