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/qquickstyleselector.cpp | |
parent | 8d622ea022298b5296962475aec486a38e8c0d03 (diff) |
Move QQuickStyleSelector::allSelector() to private
Change-Id: I6ba9d1c41b2ab6766faef6cdbdfb780e6ca37dfd
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Diffstat (limited to 'src/controls/qquickstyleselector.cpp')
-rw-r--r-- | src/controls/qquickstyleselector.cpp | 17 |
1 files changed, 8 insertions, 9 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; } |