diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-28 15:49:45 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-29 15:24:40 +0000 |
commit | 992766754ed7216f0347cb581d4756cfe114646d (patch) | |
tree | fc4c95fd84b7fa1f9f25e74c10b29904c32cc085 /src/controls | |
parent | 8d622ea022298b5296962475aec486a38e8c0d03 (diff) |
Move QQuickStyleSelector::allSelector() to private
Change-Id: I6ba9d1c41b2ab6766faef6cdbdfb780e6ca37dfd
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Diffstat (limited to 'src/controls')
-rw-r--r-- | src/controls/qquickstyleselector.cpp | 17 | ||||
-rw-r--r-- | src/controls/qquickstyleselector_p.h | 3 | ||||
-rw-r--r-- | src/controls/qquickstyleselector_p_p.h | 4 |
3 files changed, 11 insertions, 13 deletions
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 <QtCore/qurl.h> -#include <QtCore/qstringlist.h> #include <QtCore/qscopedpointer.h> 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 <QtCore/QString> #include <QtCore/QUrl> #include <private/qobject_p.h> +#include <QtCore/qstringlist.h> #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; |