Skip to content

Commit 8e7fb22

Browse files
authored
v.next versioning (#423)
Changing versioning so old versions can still be imported.
1 parent c6a2d25 commit 8e7fb22

File tree

8 files changed

+101
-32
lines changed

8 files changed

+101
-32
lines changed

uitools/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Prototype repo for new qt toolkit
2-
31
## Introduction
42

53
This toolkit is an open source resource intended for use with the ArcGIS Runtime
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*******************************************************************************
2+
* Copyright 2012-2021 Esri
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
17+
import QtQml 2.12
18+
19+
/*!
20+
\internal
21+
This QML file is only used for incrementing the current version of the toolkit and
22+
should not be used in your application.
23+
*/
24+
25+
QtObject {}

uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/esri_arcgisruntime_toolkit_controller.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<file>CoordinateConversionController.qml</file>
88
<file>CoordinateConversionOption.qml</file>
99
<file>CoordinateConversionResult.qml</file>
10+
<file>CurrentVersion.qml</file>
1011
<file>NorthArrowController.qml</file>
1112
<file>PopupViewController.qml</file>
1213
<file>TimeSliderController.qml</file>

uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/qmldir

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
# limitations under the License.
1414

1515
module Esri.ArcGISRuntime.Toolkit.Controller
16+
# Current version increment
17+
CurrentVersion 100.12 CurrentVersion.qml
1618
# Controller components
17-
AuthenticationController 100.12 AuthenticationController.qml
19+
AuthenticationController 100.10 AuthenticationController.qml
1820
BasemapGalleryController 100.12 BasemapGalleryController.qml
1921
BasemapGalleryItem 100.12 BasemapGalleryItem.qml
20-
CoordinateConversionController 100.12 CoordinateConversionController.qml
21-
CoordinateConversionOption 100.12 CoordinateConversionOption.qml
22-
CoordinateConversionResult 100.12 CoordinateConversionResult.qml
23-
NorthArrowController 100.12 NorthArrowController.qml
24-
PopupViewController 100.12 PopupViewController.qml
25-
TimeSliderController 100.12 TimeSliderController.qml
22+
CoordinateConversionController 100.10 CoordinateConversionController.qml
23+
CoordinateConversionOption 100.10 CoordinateConversionOption.qml
24+
CoordinateConversionResult 100.10 CoordinateConversionResult.qml
25+
NorthArrowController 100.10 NorthArrowController.qml
26+
PopupViewController 100.10 PopupViewController.qml
27+
TimeSliderController 100.10 TimeSliderController.qml
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*******************************************************************************
2+
* Copyright 2012-2021 Esri
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
17+
import QtQml 2.12
18+
19+
/*!
20+
\internal
21+
This QML file is only used for incrementing the current version of the toolkit and
22+
should not be used in your application.
23+
*/
24+
25+
QtObject {}

uitools/import/Esri/ArcGISRuntime/Toolkit/esri_arcgisruntime_toolkit_view.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<file>Callout.qml</file>
77
<file>ClientCertificateView.qml</file>
88
<file>CoordinateConversion.qml</file>
9+
<file>CurrentVersion.qml</file>
910
<file>FlashImage.qml</file>
1011
<file>LeaderPosition.js</file>
1112
<file>NorthArrow.qml</file>

uitools/import/Esri/ArcGISRuntime/Toolkit/qmldir

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ module Esri.ArcGISRuntime.Toolkit
1616

1717
depends Esri.ArcGISRuntime.Toolkit.Controller 100.12
1818

19+
# Current version increment
20+
CurrentVersion 100.12 CurrentVersion.qml
21+
1922
# View components
20-
AuthenticationView 100.12 AuthenticationView.qml
23+
AuthenticationView 100.10 AuthenticationView.qml
2124
BasemapGallery 100.12 BasemapGallery.qml
22-
Callout 100.12 Callout.qml
23-
ClientCertificateView 100.12 ClientCertificateView.qml
24-
CoordinateConversion 100.12 CoordinateConversion.qml
25+
Callout 100.10 Callout.qml
26+
ClientCertificateView 100.10 ClientCertificateView.qml
27+
CoordinateConversion 100.10 CoordinateConversion.qml
2528
internal FlashImage FlashImage.qml
26-
LeaderPosition 100.12 LeaderPosition.js
27-
NorthArrow 100.12 NorthArrow.qml
28-
OAuth2View 100.12 OAuth2View.qml
29-
PopupStackView 100.12 PopupStackView.qml
30-
PopupView 100.12 PopupView.qml
31-
SslHandshakeView 100.12 SslHandshakeView.qml
32-
TimeSlider 100.12 TimeSlider.qml
33-
UserCredentialsView 100.12 UserCredentialsView.qml
29+
LeaderPosition 100.10 LeaderPosition.js
30+
NorthArrow 100.10 NorthArrow.qml
31+
OAuth2View 100.10 OAuth2View.qml
32+
PopupStackView 100.10 PopupStackView.qml
33+
PopupView 100.10 PopupView.qml
34+
SslHandshakeView 100.10 SslHandshakeView.qml
35+
TimeSlider 100.10 TimeSlider.qml
36+
UserCredentialsView 100.10 UserCredentialsView.qml

uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_cpp.cpp

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,28 @@ constexpr int VERSION_MINOR = 12;
6666
6767
\list
6868
\li \c T Type to register in QML.
69+
\li \a minorVersion The version at which the component was created.
6970
\endlist
7071
*/
7172
template <typename T>
72-
void registerComponent()
73+
void registerComponent(int minorVersion)
7374
{
7475
static_assert(std::is_base_of<QObject, T>::value, "Must inherit QObject");
7576
auto name = QString{T::staticMetaObject.className()};
7677
name.remove("Esri::ArcGISRuntime::Toolkit::");
77-
qmlRegisterType<T>(NAMESPACE, VERSION_MAJOR, VERSION_MINOR, name.toLatin1());
78+
qmlRegisterType<T>(NAMESPACE, VERSION_MAJOR, minorVersion, name.toLatin1());
79+
}
80+
81+
/*
82+
\internal
83+
\brief Ensures a Module revision is available from 100.10 onwards
84+
to the current version of the Toolkit.
85+
*/
86+
void registerModuleRevisions()
87+
{
88+
constexpr int START_VERSION = 10;
89+
for (int i = START_VERSION; i <= VERSION_MINOR; ++i)
90+
qmlRegisterModule(NAMESPACE, VERSION_MAJOR, i);
7891
}
7992

8093
} // namespace
@@ -83,15 +96,16 @@ void registerComponents_cpp_(QQmlEngine& appEngine)
8396
{
8497
appEngine.addImageProvider(BasemapGalleryImageProvider::PROVIDER_ID, BasemapGalleryImageProvider::instance());
8598
appEngine.addImportPath(ESRI_COM_PATH);
86-
registerComponent<AuthenticationController>();
87-
registerComponent<BasemapGalleryController>();
88-
registerComponent<BasemapGalleryItem>();
89-
registerComponent<CoordinateConversionController>();
90-
registerComponent<CoordinateConversionOption>();
91-
registerComponent<CoordinateConversionResult>();
92-
registerComponent<NorthArrowController>();
93-
registerComponent<PopupViewController>();
94-
registerComponent<TimeSliderController>();
99+
registerModuleRevisions();
100+
registerComponent<AuthenticationController>(10);
101+
registerComponent<BasemapGalleryController>(12);
102+
registerComponent<BasemapGalleryItem>(12);
103+
registerComponent<CoordinateConversionController>(10);
104+
registerComponent<CoordinateConversionOption>(10);
105+
registerComponent<CoordinateConversionResult>(10);
106+
registerComponent<NorthArrowController>(10);
107+
registerComponent<PopupViewController>(10);
108+
registerComponent<TimeSliderController>(10);
95109

96110
qRegisterMetaType<Point>("Esri::ArcGISRuntime::Point");
97111
}

0 commit comments

Comments
 (0)