More consistent handling of feature timezone
Follow-up to commit ae6186c7e8
* require the feature in headers that should only be seen when it's
enabled,
* expose the auto-test to being run even when the feature is disabled
(the parts of that depend on the feature have needed #if-ery) and
* fix the Darwin-specific test's misguided #if-ery.
Pick-to: 6.7 6.5
Task-number: QTBUG-108199
Change-Id: I398cf44c33ffdcb4bb04f54a9d8ccfef68741e4e
Reviewed-by: Mate Barany <mate.barany@qt.io>
bb10
parent
a256e574f1
commit
98581c54fe
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include <QtCore/qtimezone.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(timezone);
|
||||
QT_REQUIRE_CONFIG(timezone_locale);
|
||||
|
||||
namespace QtTimeZoneLocale {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include "qbytearrayview.h"
|
||||
#include "qstring.h"
|
||||
|
||||
QT_REQUIRE_CONFIG(timezone);
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtTimeZoneCldr {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSTimeZone);
|
|||
#include <QJniObject>
|
||||
#endif
|
||||
|
||||
QT_REQUIRE_CONFIG(timezone);
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Q_AUTOTEST_EXPORT QTimeZonePrivate : public QSharedData
|
||||
|
|
|
|||
|
|
@ -6,6 +6,4 @@ add_subdirectory(qdate)
|
|||
add_subdirectory(qdatetime)
|
||||
add_subdirectory(qdatetimeparser)
|
||||
add_subdirectory(qtime)
|
||||
if(QT_FEATURE_timezone)
|
||||
add_subdirectory(qtimezone)
|
||||
endif()
|
||||
add_subdirectory(qtimezone)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
void tst_QTimeZone_darwinTypes()
|
||||
{
|
||||
#if !defined(QT_NO_SYSTEMLOCALE)
|
||||
#if QT_CONFIG(timezone)
|
||||
// QTimeZone <-> CFTimeZone
|
||||
{
|
||||
QTimeZone qtTimeZone("America/Los_Angeles");
|
||||
|
|
@ -39,5 +39,5 @@ void tst_QTimeZone_darwinTypes()
|
|||
QVERIFY([qtTimeZone.toNSTimeZone() isEqual:nsTimeZone]);
|
||||
[autoreleasepool release];
|
||||
}
|
||||
#endif
|
||||
#endif // feature timezone
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue