aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlfileselector.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace old Q_DECL statements with modern C++Allan Sandfeld Jensen2020-10-311-1/+1
| | | | | | | Since we depend on C++17 now, all of these can go. Change-Id: I0484fd4bb99e4367ec211c29146c316453729959 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Clean up QQmlFileSelectorUlf Hermann2020-03-191-13/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | The global static map of file selectors is not thread safe. If you add a file selector to engine A running in thread 1, you cannot at the same time retrieve the file selector of engine B running in thread 2. Alas, we only need the static map to discern file selectors from other URL interceptors, and we only need to do this on QQmlFileSelector::get(), which we don't use. Unfortunately it is public API, though. Deprecate QQmlFileSelector::get() and add a different hack to discern the interceptors for the case that it's still called. Also remove the duplicate setExtraSelectors() method. For this to work, we also add a method to QQmlApplicationEngine that allows us to pass extra file selectors and delay the initialization of QQmlApplicationEngine's QQmlFileSelector until the first file is loaded. [ChangeLog][QML] QQmlFileSelector::get() is deprecated. You can use the new method QQmlAplicationEngine::setExtraFileSelectors() to pass extra selectors to QQmlApplicationEngine's internal QQmlFileSelector. Manually created QQmlFileSelectors should be configured immediately after creation, before they are used by the QQmlEngine. Change-Id: Ia61a93777dc910b441a03ffb42d35a2a224c0e26 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow multiple URL interceptors per engineUlf Hermann2020-03-171-5/+8
| | | | | | | | | | | We may want to have, for example, a QQmlFileSelector and a component-specific interceptor that chooses a theme or similar. Also, make the API public. We want to propose this as alternative to dynamically registering QML files via qmlRegisterType(QUrl, ...). Change-Id: I4a535d3ea556da6710fde816579ec188b3f57099 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove QQmlFileSelector::setExtraSelectors overloadFabian Kosmale2020-03-131-12/+0
| | | | | | | We only need the one taking a const reference. Change-Id: I9466e71495129bfccd5a70d93a6acbc43e25b2b4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: Add missing dots (qtdeclarative)Paul Wicking2018-06-191-1/+1
| | | | | | Task-number: QTBUG-68933 Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-3/+3
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Run includemocs in qtdeclarativeThiago Macieira2017-04-261-0/+2
| | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add selector() to get underlying FileSelectorAndré Klitzing2016-01-211-0/+10
| | | | | | Change-Id: If33a23e7ba06523e964d8299365f43e8125c1619 Task-number: QTBUG-45983 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QML: file leak of QFileSelector.Erik Verbruggen2015-10-221-0/+6
| | | | | | | | When no "custom" file selector is set, the QQmlFileSelector would not delete the QFileSelector it created/owned. Change-Id: I0235d0dabdb8522db0b8b74a2a2d69ee5a20abb6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Doc: added documentation to undocumented methodsNico Vertriest2015-08-041-0/+3
| | | | | | Task-number: QTBUG-36985 Change-Id: Idc6f7961f4f02f66dc3d4a8e5d09dd15d43b7757 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* Fix some qdoc warnings.Friedemann Kleint2015-03-311-3/+3
| | | | | | | | | | | qtdeclarative/src/qml/qml/qqmlinfo.cpp:46: warning: Cannot find 'qmlInfo(...)' in '\fn' QQmlInfo qmlInfo(const QObject *object) qtdeclarative/src/qml/qml/qqmlexpression.cpp:366: warning: Undocumented parameter 'column' in QQmlExpression::setSourceLocation() qtdeclarative/src/qml/doc/src/qmlfunctions.qdoc:176: warning: Undocumented parameter 'reason' in qmlRegisterExtendedUncreatableType() qtdeclarative/src/qml/doc/src/qmlfunctions.qdoc:176: warning: No such parameter 'message' in qmlRegisterExtendedUncreatableType() Change-Id: Iec801b33b11bd57abadd968a90c49f8eba1280d5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Fix some qdoc-warnings.Friedemann Kleint2015-02-231-3/+3
| | | | | | | | | | | | | qtdeclarative/src/quick/scenegraph/coreapi/qsgmaterial.cpp:384: warning: Class RenderState has no \inmodule command; using project name by default: QtQuick qtdeclarative/src/quick/scenegraph/util/qsgsimplerectnode.cpp:39: warning: Class QSGSimpleRectNode has no \inmodule command; using project name by default: QtQuick qtdeclarative/src/quick/scenegraph/util/qsgtextureprovider.cpp:38: warning: Class QSGTextureProvider has no \inmodule command; using project name by default: QtQuick qtdeclarative/src/quick/items/qquickwindow.cpp:3156: warning: Cannot find 'closing(...)' in '\fn' void QQuickWindow::closing() qtdeclarative/src/quick/items/qquickwindow.h:160: warning: No documentation for 'QQuickWindow::closing()' qtdeclarative/src/quick/items/qquickwindow.cpp:3134: warning: Can't link to 'Window.closing()' qtdeclarative/src/qml/qml/qqmlfileselector.cpp:90: warning: Undocumented parameter 'parent' in QQmlFileSelector::QQmlFileSelector() Change-Id: I42cf1e06c9e7a63327acc470bd33a726acc69bfc Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-6/+6
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Add const & to argumentsAlbert Astals Cid2014-08-241-0/+12
| | | | | Change-Id: I1bcf69638fee32b6e6565b8ea828c0adcff48a67 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* qml: Fix potential memory leak in the file selectorHolger Hans Peter Freyther2014-07-211-4/+4
| | | | | | | | | | | The myInstance doesn't seem to be part of a QObject parent/child relationship and Coverity complained about it. Use a QScopedPointer to make sure the data will be deleted. Fixes: CID 10606 Change-Id: I30848ab4d1e621d82281aaa7d6f84e0c2cce4084 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix some documentation errors.Friedemann Kleint2014-03-241-3/+3
| | | | | Change-Id: I5d4b3e26742202c4b634d0001fd3658c7263c50a Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Doc: Fix broken linksSze Howe Koh2013-12-301-1/+1
| | | | | Change-Id: I4c4577edde96978a986606bf30fbb925f871bd42 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Revert "Revert ffaf39e9a7f11d4e2800b3b37160a2a952795614"Alan Alpert2013-12-041-1/+1
| | | | | | | | | | This reverts commit 27052dcad9810869a9065da4c06e9f14379411d7. While the additional flexibility would be nice, I've been reminded that we already did commit to it back in July. Change-Id: Iaf990dda98ee46eb028b4737bdeeafd050d9513f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Revert ffaf39e9a7f11d4e2800b3b37160a2a952795614Alan Alpert2013-11-131-1/+1
| | | | | | | | | Making it public right now seems a little premature, given all the work happening on the engine now (and for 5.3). We'll be in a better position to commit to it or not next release. Change-Id: Ib7b14afeb9205fb8a87ed16a6d38b1f468b2bbbb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Polish up QQmlFileSelectorAlan Alpert2013-11-131-6/+63
| | | | | | | | Incorporate beta feedback, and hide QQmlAbstractUrlInterceptor as the implementation (instead of making that "the API"). Change-Id: Ib7b14afeb9205fb8a87ed16a6d38b1f468b2aaaa Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Apply file selectors to QQmlApplicationEngine appsAlan Alpert2013-09-201-0/+138
You can also manually apply them to a QQmlEngine using setUrlInterceptor(new QQmlFileSelector(parent)), or using your own QQmlAbstractUrlInterceptor subclass. Change-Id: I0c0ff8b080c138686b3c03e0bc3b9f25bcd11a85 Reviewed-by: Lars Knoll <lars.knoll@digia.com>