Merge "Merge remote-tracking branch 'origin/5.4' into 5.4.0" into refs/staging/5.4.0
@ -483,3 +483,15 @@
|
|||||||
\externalpage http://qt-project.org/doc/qtcreator/creator-developing-winrt.html
|
\externalpage http://qt-project.org/doc/qtcreator/creator-developing-winrt.html
|
||||||
\title Qt Creator: Connecting Windows Runtime Devices
|
\title Qt Creator: Connecting Windows Runtime Devices
|
||||||
*/
|
*/
|
||||||
|
/*!
|
||||||
|
\externalpage http://qt-project.org/doc/qtcreator/creator-clang-codemodel.html
|
||||||
|
\title Qt Creator: Parsing C++ Files
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
\externalpage http://qt-project.org/doc/qtcreator/creator-quick-ui-forms.html
|
||||||
|
\title Qt Creator: Qt Quick UI Forms
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
\externalpage http://qt-project.org/doc/qtcreator/creator-clang-static-analyzer.html
|
||||||
|
\title Qt Creator: Using Clang Static Analyzer
|
||||||
|
*/
|
||||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 53 KiB |
@ -2,7 +2,6 @@ body {
|
|||||||
font: normal 400 14px/1.2 Arial;
|
font: normal 400 14px/1.2 Arial;
|
||||||
margin-top: 85px;
|
margin-top: 85px;
|
||||||
font-family: Arial, Helvetica;
|
font-family: Arial, Helvetica;
|
||||||
color: #313131;
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 563 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 916 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 975 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 685 B After Width: | Height: | Size: 340 B |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 834 B After Width: | Height: | Size: 524 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 892 B |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 1.3 KiB |
@ -11,11 +11,15 @@
|
|||||||
|
|
||||||
QMAKE_COMPILER = rim_qcc gcc # qcc is mostly gcc in disguise
|
QMAKE_COMPILER = rim_qcc gcc # qcc is mostly gcc in disguise
|
||||||
|
|
||||||
|
QMAKE_CFLAGS_OPTIMIZE = -O2
|
||||||
|
QMAKE_CFLAGS_OPTIMIZE_FULL = -O3
|
||||||
|
|
||||||
QMAKE_CFLAGS += -Wno-psabi
|
QMAKE_CFLAGS += -Wno-psabi
|
||||||
QMAKE_CFLAGS_DEPS += -M
|
QMAKE_CFLAGS_DEPS += -M
|
||||||
QMAKE_CFLAGS_WARN_ON += -Wall -W
|
QMAKE_CFLAGS_WARN_ON += -Wall -W
|
||||||
QMAKE_CFLAGS_WARN_OFF += -w
|
QMAKE_CFLAGS_WARN_OFF += -w
|
||||||
QMAKE_CFLAGS_RELEASE += -O2
|
QMAKE_CFLAGS_RELEASE += $$QMAKE_CFLAGS_OPTIMIZE
|
||||||
|
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g
|
||||||
QMAKE_CFLAGS_DEBUG += -g
|
QMAKE_CFLAGS_DEBUG += -g
|
||||||
QMAKE_CFLAGS_SHLIB += -fPIC -shared
|
QMAKE_CFLAGS_SHLIB += -fPIC -shared
|
||||||
QMAKE_CFLAGS_STATIC_LIB += -fPIC
|
QMAKE_CFLAGS_STATIC_LIB += -fPIC
|
||||||
@ -36,6 +40,7 @@ QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS
|
|||||||
QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON
|
QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON
|
||||||
QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF
|
QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF
|
||||||
QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
|
QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
|
||||||
|
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
|
||||||
QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
|
QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
|
||||||
QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB
|
QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB
|
||||||
QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB
|
QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
<m2:ShowOn Tile=\"square150x150Logo\" />
|
<m2:ShowOn Tile=\"square150x150Logo\" />
|
||||||
</m2:ShowNameOnTiles>
|
</m2:ShowNameOnTiles>
|
||||||
</m2:DefaultTile>
|
</m2:DefaultTile>
|
||||||
<m2:SplashScreen Image=\"$${WINRT_MANIFEST.logo_splash}\" />
|
<m2:SplashScreen Image=\"$${WINRT_MANIFEST.logo_splash}\" />$${WINRT_MANIFEST.rotation_preference}
|
||||||
</m2:VisualElements>
|
</m2:VisualElements>
|
||||||
</Application>
|
</Application>
|
||||||
</Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies}
|
</Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies}
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
<m3:ShowOn Tile=\"square150x150Logo\" />
|
<m3:ShowOn Tile=\"square150x150Logo\" />
|
||||||
</m3:ShowNameOnTiles>
|
</m3:ShowNameOnTiles>
|
||||||
</m3:DefaultTile>
|
</m3:DefaultTile>
|
||||||
<m3:SplashScreen Image=\"$${WINRT_MANIFEST.logo_480x800}\" />
|
<m3:SplashScreen Image=\"$${WINRT_MANIFEST.logo_480x800}\" />$${WINRT_MANIFEST.rotation_preference}
|
||||||
</m3:VisualElements>
|
</m3:VisualElements>
|
||||||
</Application>
|
</Application>
|
||||||
</Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies}
|
</Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies}
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
# WINRT_MANIFEST.logo_medium: Medium logo image file. Default provided by the mkspec.
|
# WINRT_MANIFEST.logo_medium: Medium logo image file. Default provided by the mkspec.
|
||||||
# WINRT_MANIFEST.logo_large: Large logo image file. Default provided by the mkspec.
|
# WINRT_MANIFEST.logo_large: Large logo image file. Default provided by the mkspec.
|
||||||
# WINRT_MANIFEST.splash_screen: Splash screen image file. Default provided by the mkspec.
|
# WINRT_MANIFEST.splash_screen: Splash screen image file. Default provided by the mkspec.
|
||||||
|
# WINRT_MANIFEST.rotation_preference: Orientation specification. Default is empty. (portrait, landscape, landscapeFlipped)
|
||||||
# WINRT_MANIFEST.iconic_tile_icon: Image file for the "iconic" tile template icon. Default provided by the mkspec.
|
# WINRT_MANIFEST.iconic_tile_icon: Image file for the "iconic" tile template icon. Default provided by the mkspec.
|
||||||
# WINRT_MANIFEST.iconic_tile_small: Image file for the small "iconic" tile template logo. Default provided by the mkspec.
|
# WINRT_MANIFEST.iconic_tile_small: Image file for the small "iconic" tile template logo. Default provided by the mkspec.
|
||||||
# WINRT_MANIFEST.default_language: Specifies the default language of the application
|
# WINRT_MANIFEST.default_language: Specifies the default language of the application
|
||||||
@ -87,6 +88,20 @@
|
|||||||
isEmpty(WINRT_MANIFEST.foreground): WINRT_MANIFEST.foreground = light
|
isEmpty(WINRT_MANIFEST.foreground): WINRT_MANIFEST.foreground = light
|
||||||
isEmpty(WINRT_MANIFEST.default_language): WINRT_MANIFEST.default_language = en
|
isEmpty(WINRT_MANIFEST.default_language): WINRT_MANIFEST.default_language = en
|
||||||
|
|
||||||
|
INDENT = "$$escape_expand(\\r\\n) "
|
||||||
|
|
||||||
|
VS_XML_NAMESPACE = "m2"
|
||||||
|
winphone: VS_XML_NAMESPACE = "m3"
|
||||||
|
WINRT_MANIFEST.rotation_preference = $$unique(WINRT_MANIFEST.rotation_preference)
|
||||||
|
!isEmpty(WINRT_MANIFEST.rotation_preference) {
|
||||||
|
MANIFEST_ROTATION += "<$${VS_XML_NAMESPACE}:InitialRotationPreference>"
|
||||||
|
for(ROTATION, WINRT_MANIFEST.rotation_preference): \
|
||||||
|
MANIFEST_ROTATION += " <$${VS_XML_NAMESPACE}:Rotation Preference=\"$$ROTATION\" />"
|
||||||
|
MANIFEST_ROTATION += "</$${VS_XML_NAMESPACE}:InitialRotationPreference>"
|
||||||
|
|
||||||
|
WINRT_MANIFEST.rotation_preference = $$join(MANIFEST_ROTATION, $$INDENT, $$INDENT)
|
||||||
|
}
|
||||||
|
|
||||||
INDENT = "$$escape_expand(\\r\\n) "
|
INDENT = "$$escape_expand(\\r\\n) "
|
||||||
|
|
||||||
# Capabilities are given as a string list and may change with the configuration (network, sensors, etc.)
|
# Capabilities are given as a string list and may change with the configuration (network, sensors, etc.)
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
# define Q_NO_USING_KEYWORD
|
# define Q_NO_USING_KEYWORD
|
||||||
|
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
# define Q_CC_MSVC
|
# define Q_CC_MSVC (_MSC_VER)
|
||||||
# define Q_CC_MSVC_NET
|
# define Q_CC_MSVC_NET
|
||||||
# define Q_OUTOFLINE_TEMPLATE inline
|
# define Q_OUTOFLINE_TEMPLATE inline
|
||||||
# if _MSC_VER < 1600
|
# if _MSC_VER < 1600
|
||||||
@ -137,14 +137,14 @@
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
# define Q_CC_GNU
|
# define Q_CC_GNU (__GNUC__ * 100 + __GNUC_MINOR__)
|
||||||
# define Q_C_CALLBACKS
|
# define Q_C_CALLBACKS
|
||||||
# if defined(__MINGW32__)
|
# if defined(__MINGW32__)
|
||||||
# define Q_CC_MINGW
|
# define Q_CC_MINGW
|
||||||
# endif
|
# endif
|
||||||
# if defined(__INTEL_COMPILER)
|
# if defined(__INTEL_COMPILER)
|
||||||
/* Intel C++ also masquerades as GCC */
|
/* Intel C++ also masquerades as GCC */
|
||||||
# define Q_CC_INTEL
|
# define Q_CC_INTEL (__INTEL_COMPILER)
|
||||||
# define Q_ASSUME_IMPL(expr) __assume(expr)
|
# define Q_ASSUME_IMPL(expr) __assume(expr)
|
||||||
# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
|
# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
|
||||||
# if __INTEL_COMPILER >= 1300 && !defined(__APPLE__)
|
# if __INTEL_COMPILER >= 1300 && !defined(__APPLE__)
|
||||||
@ -152,7 +152,26 @@
|
|||||||
# endif
|
# endif
|
||||||
# elif defined(__clang__)
|
# elif defined(__clang__)
|
||||||
/* Clang also masquerades as GCC */
|
/* Clang also masquerades as GCC */
|
||||||
# define Q_CC_CLANG
|
# if defined(__apple_build_version__)
|
||||||
|
# /* http://en.wikipedia.org/wiki/Xcode#Toolchain_Versions */
|
||||||
|
# if __apple_build_version__ >= 600051
|
||||||
|
# define Q_CC_CLANG 305
|
||||||
|
# elif __apple_build_version__ >= 503038
|
||||||
|
# define Q_CC_CLANG 304
|
||||||
|
# elif __apple_build_version__ >= 500275
|
||||||
|
# define Q_CC_CLANG 303
|
||||||
|
# elif __apple_build_version__ >= 425024
|
||||||
|
# define Q_CC_CLANG 302
|
||||||
|
# elif __apple_build_version__ >= 318045
|
||||||
|
# define Q_CC_CLANG 301
|
||||||
|
# elif __apple_build_version__ >= 211101
|
||||||
|
# define Q_CC_CLANG 300
|
||||||
|
# else
|
||||||
|
# error "Unknown Apple Clang version"
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# define Q_CC_CLANG ((__clang_major__ * 100) + __clang_minor__)
|
||||||
|
# endif
|
||||||
# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
|
# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
|
||||||
# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
|
# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
|
||||||
# if !defined(__has_extension)
|
# if !defined(__has_extension)
|
||||||
@ -168,7 +187,7 @@
|
|||||||
# endif
|
# endif
|
||||||
# else
|
# else
|
||||||
/* Plain GCC */
|
/* Plain GCC */
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
|
# if Q_CC_GNU >= 405
|
||||||
# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
|
# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
|
||||||
# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
|
# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
|
||||||
# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
|
# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
|
||||||
@ -202,7 +221,7 @@
|
|||||||
# define QT_NO_ARM_EABI
|
# define QT_NO_ARM_EABI
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403 && !defined(Q_CC_CLANG)
|
# if Q_CC_GNU >= 403 && !defined(Q_CC_CLANG)
|
||||||
# define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
|
# define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@ -308,7 +327,7 @@
|
|||||||
|
|
||||||
/* Using the `using' keyword avoids Intel C++ for Linux warnings */
|
/* Using the `using' keyword avoids Intel C++ for Linux warnings */
|
||||||
# elif defined(__INTEL_COMPILER)
|
# elif defined(__INTEL_COMPILER)
|
||||||
# define Q_CC_INTEL
|
# define Q_CC_INTEL (__INTEL_COMPILER)
|
||||||
|
|
||||||
/* Uses CFront, make sure to read the manual how to tweak templates. */
|
/* Uses CFront, make sure to read the manual how to tweak templates. */
|
||||||
# elif defined(__ghs)
|
# elif defined(__ghs)
|
||||||
@ -566,7 +585,7 @@
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
// Variadic macros are supported for gnu++98, c++11, c99 ... since 2.9
|
// Variadic macros are supported for gnu++98, c++11, c99 ... since 2.9
|
||||||
# if ((__clang_major__ * 100) + __clang_minor__) >= 209
|
# if Q_CC_CLANG >= 209
|
||||||
# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \
|
# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \
|
||||||
|| (defined(__cplusplus) && (__cplusplus >= 201103L)) \
|
|| (defined(__cplusplus) && (__cplusplus >= 201103L)) \
|
||||||
|| (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
|| (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||||
@ -668,7 +687,7 @@
|
|||||||
# define Q_COMPILER_VARIADIC_TEMPLATES
|
# define Q_COMPILER_VARIADIC_TEMPLATES
|
||||||
# endif
|
# endif
|
||||||
/* Features that have no __has_feature() check */
|
/* Features that have no __has_feature() check */
|
||||||
# if ((__clang_major__ * 100) + __clang_minor__) >= 209 /* since clang 2.9 */
|
# if Q_CC_CLANG >= 209 /* since clang 2.9 */
|
||||||
# define Q_COMPILER_EXTERN_TEMPLATES
|
# define Q_COMPILER_EXTERN_TEMPLATES
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
@ -709,7 +728,7 @@
|
|||||||
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
|
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
|
||||||
# define Q_COMPILER_RESTRICTED_VLA
|
# define Q_COMPILER_RESTRICTED_VLA
|
||||||
# define Q_COMPILER_THREADSAFE_STATICS
|
# define Q_COMPILER_THREADSAFE_STATICS
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403
|
# if Q_CC_GNU >= 403
|
||||||
// GCC supports binary literals in C, C++98 and C++11 modes
|
// GCC supports binary literals in C, C++98 and C++11 modes
|
||||||
# define Q_COMPILER_BINARY_LITERALS
|
# define Q_COMPILER_BINARY_LITERALS
|
||||||
# endif
|
# endif
|
||||||
@ -720,13 +739,13 @@
|
|||||||
# define Q_COMPILER_VARIADIC_MACROS
|
# define Q_COMPILER_VARIADIC_MACROS
|
||||||
# endif
|
# endif
|
||||||
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
|
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403
|
# if Q_CC_GNU >= 403
|
||||||
/* C++11 features supported in GCC 4.3: */
|
/* C++11 features supported in GCC 4.3: */
|
||||||
# define Q_COMPILER_DECLTYPE
|
# define Q_COMPILER_DECLTYPE
|
||||||
# define Q_COMPILER_RVALUE_REFS
|
# define Q_COMPILER_RVALUE_REFS
|
||||||
# define Q_COMPILER_STATIC_ASSERT
|
# define Q_COMPILER_STATIC_ASSERT
|
||||||
# endif
|
# endif
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404
|
# if Q_CC_GNU >= 404
|
||||||
/* C++11 features supported in GCC 4.4: */
|
/* C++11 features supported in GCC 4.4: */
|
||||||
# define Q_COMPILER_AUTO_FUNCTION
|
# define Q_COMPILER_AUTO_FUNCTION
|
||||||
# define Q_COMPILER_AUTO_TYPE
|
# define Q_COMPILER_AUTO_TYPE
|
||||||
@ -735,7 +754,7 @@
|
|||||||
# define Q_COMPILER_UNICODE_STRINGS
|
# define Q_COMPILER_UNICODE_STRINGS
|
||||||
# define Q_COMPILER_VARIADIC_TEMPLATES
|
# define Q_COMPILER_VARIADIC_TEMPLATES
|
||||||
# endif
|
# endif
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
|
# if Q_CC_GNU >= 405
|
||||||
/* C++11 features supported in GCC 4.5: */
|
/* C++11 features supported in GCC 4.5: */
|
||||||
# define Q_COMPILER_EXPLICIT_CONVERSIONS
|
# define Q_COMPILER_EXPLICIT_CONVERSIONS
|
||||||
/* GCC 4.4 implements initializer_list but does not define typedefs required
|
/* GCC 4.4 implements initializer_list but does not define typedefs required
|
||||||
@ -745,7 +764,7 @@
|
|||||||
# define Q_COMPILER_RAW_STRINGS
|
# define Q_COMPILER_RAW_STRINGS
|
||||||
# define Q_COMPILER_CLASS_ENUM
|
# define Q_COMPILER_CLASS_ENUM
|
||||||
# endif
|
# endif
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
# if Q_CC_GNU >= 406
|
||||||
/* Pre-4.6 compilers implement a non-final snapshot of N2346, hence default and delete
|
/* Pre-4.6 compilers implement a non-final snapshot of N2346, hence default and delete
|
||||||
* functions are supported only if they are public. Starting from 4.6, GCC handles
|
* functions are supported only if they are public. Starting from 4.6, GCC handles
|
||||||
* final version - the access modifier is not relevant. */
|
* final version - the access modifier is not relevant. */
|
||||||
@ -757,7 +776,7 @@
|
|||||||
# define Q_COMPILER_UNRESTRICTED_UNIONS
|
# define Q_COMPILER_UNRESTRICTED_UNIONS
|
||||||
# define Q_COMPILER_RANGE_FOR
|
# define Q_COMPILER_RANGE_FOR
|
||||||
# endif
|
# endif
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407
|
# if Q_CC_GNU >= 407
|
||||||
/* GCC 4.4 implemented <atomic> and std::atomic using its old intrinsics.
|
/* GCC 4.4 implemented <atomic> and std::atomic using its old intrinsics.
|
||||||
* However, the implementation is incomplete for most platforms until GCC 4.7:
|
* However, the implementation is incomplete for most platforms until GCC 4.7:
|
||||||
* instead, std::atomic would use an external lock. Since we need an std::atomic
|
* instead, std::atomic would use an external lock. Since we need an std::atomic
|
||||||
@ -773,20 +792,20 @@
|
|||||||
# define Q_COMPILER_TEMPLATE_ALIAS
|
# define Q_COMPILER_TEMPLATE_ALIAS
|
||||||
# define Q_COMPILER_UDL
|
# define Q_COMPILER_UDL
|
||||||
# endif
|
# endif
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408
|
# if Q_CC_GNU >= 408
|
||||||
# define Q_COMPILER_ATTRIBUTES
|
# define Q_COMPILER_ATTRIBUTES
|
||||||
# define Q_COMPILER_ALIGNAS
|
# define Q_COMPILER_ALIGNAS
|
||||||
# define Q_COMPILER_ALIGNOF
|
# define Q_COMPILER_ALIGNOF
|
||||||
# define Q_COMPILER_INHERITING_CONSTRUCTORS
|
# define Q_COMPILER_INHERITING_CONSTRUCTORS
|
||||||
# define Q_COMPILER_THREAD_LOCAL
|
# define Q_COMPILER_THREAD_LOCAL
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) > 408 || __GNUC_PATCHLEVEL__ >= 1
|
# if Q_CC_GNU > 408 || __GNUC_PATCHLEVEL__ >= 1
|
||||||
# define Q_COMPILER_REF_QUALIFIERS
|
# define Q_COMPILER_REF_QUALIFIERS
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
/* C++11 features are complete as of GCC 4.8.1 */
|
/* C++11 features are complete as of GCC 4.8.1 */
|
||||||
# endif
|
# endif
|
||||||
# if __cplusplus > 201103L
|
# if __cplusplus > 201103L
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409
|
# if Q_CC_GNU >= 409
|
||||||
/* C++1y features in GCC 4.9 - deprecated, do not update this list */
|
/* C++1y features in GCC 4.9 - deprecated, do not update this list */
|
||||||
//# define Q_COMPILER_BINARY_LITERALS // already supported since GCC 4.3 as an extension
|
//# define Q_COMPILER_BINARY_LITERALS // already supported since GCC 4.3 as an extension
|
||||||
# define Q_COMPILER_LAMBDA_CAPTURES
|
# define Q_COMPILER_LAMBDA_CAPTURES
|
||||||
|
@ -877,7 +877,7 @@ public:
|
|||||||
// (http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#382).
|
// (http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#382).
|
||||||
// GCC 4.3 and 4.4 have support for decltype, but are affected by DR 382.
|
// GCC 4.3 and 4.4 have support for decltype, but are affected by DR 382.
|
||||||
# if defined(Q_COMPILER_DECLTYPE) && \
|
# if defined(Q_COMPILER_DECLTYPE) && \
|
||||||
(defined(Q_CC_CLANG) || defined(Q_CC_INTEL) || !defined(Q_CC_GNU) || (__GNUC__ * 100 + __GNUC_MINOR__) >= 405)
|
(defined(Q_CC_CLANG) || defined(Q_CC_INTEL) || !defined(Q_CC_GNU) || Q_CC_GNU >= 405)
|
||||||
# define QT_FOREACH_DECLTYPE(x) typename QtPrivate::remove_reference<decltype(x)>::type
|
# define QT_FOREACH_DECLTYPE(x) typename QtPrivate::remove_reference<decltype(x)>::type
|
||||||
# else
|
# else
|
||||||
# define QT_FOREACH_DECLTYPE(x) __typeof__((x))
|
# define QT_FOREACH_DECLTYPE(x) __typeof__((x))
|
||||||
|
@ -84,14 +84,7 @@ class QLibraryInfoPrivate
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QSettings *findConfiguration();
|
static QSettings *findConfiguration();
|
||||||
#ifndef QT_BOOTSTRAPPED
|
#ifdef QT_BOOTSTRAPPED
|
||||||
static void cleanup()
|
|
||||||
{
|
|
||||||
QLibrarySettings *ls = qt_library_settings();
|
|
||||||
if (ls)
|
|
||||||
ls->settings.reset(0);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static bool haveGroup(QLibraryInfo::PathGroup group)
|
static bool haveGroup(QLibraryInfo::PathGroup group)
|
||||||
{
|
{
|
||||||
QLibrarySettings *ls = qt_library_settings();
|
QLibrarySettings *ls = qt_library_settings();
|
||||||
@ -114,7 +107,6 @@ QLibrarySettings::QLibrarySettings()
|
|||||||
: settings(QLibraryInfoPrivate::findConfiguration())
|
: settings(QLibraryInfoPrivate::findConfiguration())
|
||||||
{
|
{
|
||||||
#ifndef QT_BOOTSTRAPPED
|
#ifndef QT_BOOTSTRAPPED
|
||||||
qAddPostRoutine(QLibraryInfoPrivate::cleanup);
|
|
||||||
bool haveEffectivePaths;
|
bool haveEffectivePaths;
|
||||||
bool havePaths;
|
bool havePaths;
|
||||||
#endif
|
#endif
|
||||||
|
@ -87,9 +87,9 @@
|
|||||||
ARM is bi-endian, detect using __ARMEL__ or __ARMEB__, falling back to
|
ARM is bi-endian, detect using __ARMEL__ or __ARMEB__, falling back to
|
||||||
auto-detection implemented below.
|
auto-detection implemented below.
|
||||||
*/
|
*/
|
||||||
#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) || defined(__arm64__)
|
#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) || defined(__aarch64__)
|
||||||
# define Q_PROCESSOR_ARM
|
# define Q_PROCESSOR_ARM
|
||||||
# if defined(__arm64__)
|
# if defined(__aarch64__)
|
||||||
# define Q_PROCESSOR_ARM_64
|
# define Q_PROCESSOR_ARM_64
|
||||||
# else
|
# else
|
||||||
# define Q_PROCESSOR_ARM_32
|
# define Q_PROCESSOR_ARM_32
|
||||||
|
@ -311,7 +311,7 @@ QJNIObjectPrivate::QJNIObjectPrivate(const char *className, const char *sig, ...
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QJNIObjectPrivate::QJNIObjectPrivate(const char *className, const char *sig, va_list args)
|
QJNIObjectPrivate::QJNIObjectPrivate(const char *className, const char *sig, const QVaListPrivate &args)
|
||||||
: d(new QJNIObjectData())
|
: d(new QJNIObjectData())
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
@ -369,7 +369,7 @@ QJNIObjectPrivate::QJNIObjectPrivate(jclass clazz, const char *sig, ...)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QJNIObjectPrivate::QJNIObjectPrivate(jclass clazz, const char *sig, va_list args)
|
QJNIObjectPrivate::QJNIObjectPrivate(jclass clazz, const char *sig, const QVaListPrivate &args)
|
||||||
: d(new QJNIObjectData())
|
: d(new QJNIObjectData())
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
@ -402,7 +402,7 @@ QJNIObjectPrivate::QJNIObjectPrivate(jobject obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void QJNIObjectPrivate::callMethod<void>(const char *methodName, const char *sig, va_list args) const
|
void QJNIObjectPrivate::callMethodV<void>(const char *methodName, const char *sig, va_list args) const
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
|
jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
|
||||||
@ -416,12 +416,12 @@ void QJNIObjectPrivate::callMethod<void>(const char *methodName, const char *sig
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
callMethod<void>(methodName, sig, args);
|
callMethodV<void>(methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jboolean QJNIObjectPrivate::callMethod<jboolean>(const char *methodName, const char *sig, va_list args) const
|
jboolean QJNIObjectPrivate::callMethodV<jboolean>(const char *methodName, const char *sig, va_list args) const
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jboolean res = 0;
|
jboolean res = 0;
|
||||||
@ -437,13 +437,13 @@ jboolean QJNIObjectPrivate::callMethod<jboolean>(const char *methodName, const c
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jboolean res = callMethod<jboolean>(methodName, sig, args);
|
jboolean res = callMethodV<jboolean>(methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jbyte QJNIObjectPrivate::callMethod<jbyte>(const char *methodName, const char *sig, va_list args) const
|
jbyte QJNIObjectPrivate::callMethodV<jbyte>(const char *methodName, const char *sig, va_list args) const
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jbyte res = 0;
|
jbyte res = 0;
|
||||||
@ -459,13 +459,13 @@ jbyte QJNIObjectPrivate::callMethod<jbyte>(const char *methodName, const char *s
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jbyte res = callMethod<jbyte>(methodName, sig, args);
|
jbyte res = callMethodV<jbyte>(methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jchar QJNIObjectPrivate::callMethod<jchar>(const char *methodName, const char *sig, va_list args) const
|
jchar QJNIObjectPrivate::callMethodV<jchar>(const char *methodName, const char *sig, va_list args) const
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jchar res = 0;
|
jchar res = 0;
|
||||||
@ -481,13 +481,13 @@ jchar QJNIObjectPrivate::callMethod<jchar>(const char *methodName, const char *s
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jchar res = callMethod<jchar>(methodName, sig, args);
|
jchar res = callMethodV<jchar>(methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jshort QJNIObjectPrivate::callMethod<jshort>(const char *methodName, const char *sig, va_list args) const
|
jshort QJNIObjectPrivate::callMethodV<jshort>(const char *methodName, const char *sig, va_list args) const
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jshort res = 0;
|
jshort res = 0;
|
||||||
@ -503,13 +503,13 @@ jshort QJNIObjectPrivate::callMethod<jshort>(const char *methodName, const char
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jshort res = callMethod<jshort>(methodName, sig, args);
|
jshort res = callMethodV<jshort>(methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jint QJNIObjectPrivate::callMethod<jint>(const char *methodName, const char *sig, va_list args) const
|
jint QJNIObjectPrivate::callMethodV<jint>(const char *methodName, const char *sig, va_list args) const
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jint res = 0;
|
jint res = 0;
|
||||||
@ -525,13 +525,13 @@ jint QJNIObjectPrivate::callMethod<jint>(const char *methodName, const char *sig
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jint res = callMethod<jint>(methodName, sig, args);
|
jint res = callMethodV<jint>(methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jlong QJNIObjectPrivate::callMethod<jlong>(const char *methodName, const char *sig, va_list args) const
|
jlong QJNIObjectPrivate::callMethodV<jlong>(const char *methodName, const char *sig, va_list args) const
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jlong res = 0;
|
jlong res = 0;
|
||||||
@ -547,13 +547,13 @@ jlong QJNIObjectPrivate::callMethod<jlong>(const char *methodName, const char *s
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jlong res = callMethod<jlong>(methodName, sig, args);
|
jlong res = callMethodV<jlong>(methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jfloat QJNIObjectPrivate::callMethod<jfloat>(const char *methodName, const char *sig, va_list args) const
|
jfloat QJNIObjectPrivate::callMethodV<jfloat>(const char *methodName, const char *sig, va_list args) const
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jfloat res = 0.f;
|
jfloat res = 0.f;
|
||||||
@ -569,13 +569,13 @@ jfloat QJNIObjectPrivate::callMethod<jfloat>(const char *methodName, const char
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jfloat res = callMethod<jfloat>(methodName, sig, args);
|
jfloat res = callMethodV<jfloat>(methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jdouble QJNIObjectPrivate::callMethod<jdouble>(const char *methodName, const char *sig, va_list args) const
|
jdouble QJNIObjectPrivate::callMethodV<jdouble>(const char *methodName, const char *sig, va_list args) const
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jdouble res = 0.;
|
jdouble res = 0.;
|
||||||
@ -591,7 +591,7 @@ jdouble QJNIObjectPrivate::callMethod<jdouble>(const char *methodName, const cha
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jdouble res = callMethod<jdouble>(methodName, sig, args);
|
jdouble res = callMethodV<jdouble>(methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -651,10 +651,10 @@ jdouble QJNIObjectPrivate::callMethod<jdouble>(const char *methodName) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void QJNIObjectPrivate::callStaticMethod<void>(const char *className,
|
void QJNIObjectPrivate::callStaticMethodV<void>(const char *className,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jclass clazz = loadClass(className, env);
|
jclass clazz = loadClass(className, env);
|
||||||
@ -674,15 +674,15 @@ void QJNIObjectPrivate::callStaticMethod<void>(const char *className,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
callStaticMethod<void>(className, methodName, sig, args);
|
callStaticMethodV<void>(className, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void QJNIObjectPrivate::callStaticMethod<void>(jclass clazz,
|
void QJNIObjectPrivate::callStaticMethodV<void>(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
|
jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
|
||||||
@ -699,15 +699,15 @@ void QJNIObjectPrivate::callStaticMethod<void>(jclass clazz,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
callStaticMethod<void>(clazz, methodName, sig, args);
|
callStaticMethodV<void>(clazz, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jboolean QJNIObjectPrivate::callStaticMethod<jboolean>(const char *className,
|
jboolean QJNIObjectPrivate::callStaticMethodV<jboolean>(const char *className,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jboolean res = 0;
|
jboolean res = 0;
|
||||||
@ -730,16 +730,16 @@ jboolean QJNIObjectPrivate::callStaticMethod<jboolean>(const char *className,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jboolean res = callStaticMethod<jboolean>(className, methodName, sig, args);
|
jboolean res = callStaticMethodV<jboolean>(className, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jboolean QJNIObjectPrivate::callStaticMethod<jboolean>(jclass clazz,
|
jboolean QJNIObjectPrivate::callStaticMethodV<jboolean>(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jboolean res = 0;
|
jboolean res = 0;
|
||||||
@ -759,16 +759,16 @@ jboolean QJNIObjectPrivate::callStaticMethod<jboolean>(jclass clazz,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jboolean res = callStaticMethod<jboolean>(clazz, methodName, sig, args);
|
jboolean res = callStaticMethodV<jboolean>(clazz, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jbyte QJNIObjectPrivate::callStaticMethod<jbyte>(const char *className,
|
jbyte QJNIObjectPrivate::callStaticMethodV<jbyte>(const char *className,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jbyte res = 0;
|
jbyte res = 0;
|
||||||
@ -791,16 +791,16 @@ jbyte QJNIObjectPrivate::callStaticMethod<jbyte>(const char *className,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jbyte res = callStaticMethod<jbyte>(className, methodName, sig, args);
|
jbyte res = callStaticMethodV<jbyte>(className, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jbyte QJNIObjectPrivate::callStaticMethod<jbyte>(jclass clazz,
|
jbyte QJNIObjectPrivate::callStaticMethodV<jbyte>(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jbyte res = 0;
|
jbyte res = 0;
|
||||||
@ -820,16 +820,16 @@ jbyte QJNIObjectPrivate::callStaticMethod<jbyte>(jclass clazz,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jbyte res = callStaticMethod<jbyte>(clazz, methodName, sig, args);
|
jbyte res = callStaticMethodV<jbyte>(clazz, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jchar QJNIObjectPrivate::callStaticMethod<jchar>(const char *className,
|
jchar QJNIObjectPrivate::callStaticMethodV<jchar>(const char *className,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jchar res = 0;
|
jchar res = 0;
|
||||||
@ -852,16 +852,16 @@ jchar QJNIObjectPrivate::callStaticMethod<jchar>(const char *className,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jchar res = callStaticMethod<jchar>(className, methodName, sig, args);
|
jchar res = callStaticMethodV<jchar>(className, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jchar QJNIObjectPrivate::callStaticMethod<jchar>(jclass clazz,
|
jchar QJNIObjectPrivate::callStaticMethodV<jchar>(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jchar res = 0;
|
jchar res = 0;
|
||||||
@ -881,16 +881,16 @@ jchar QJNIObjectPrivate::callStaticMethod<jchar>(jclass clazz,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jchar res = callStaticMethod<jchar>(clazz, methodName, sig, args);
|
jchar res = callStaticMethodV<jchar>(clazz, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jshort QJNIObjectPrivate::callStaticMethod<jshort>(const char *className,
|
jshort QJNIObjectPrivate::callStaticMethodV<jshort>(const char *className,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jshort res = 0;
|
jshort res = 0;
|
||||||
@ -913,16 +913,16 @@ jshort QJNIObjectPrivate::callStaticMethod<jshort>(const char *className,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jshort res = callStaticMethod<jshort>(className, methodName, sig, args);
|
jshort res = callStaticMethodV<jshort>(className, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jshort QJNIObjectPrivate::callStaticMethod<jshort>(jclass clazz,
|
jshort QJNIObjectPrivate::callStaticMethodV<jshort>(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jshort res = 0;
|
jshort res = 0;
|
||||||
@ -942,16 +942,16 @@ jshort QJNIObjectPrivate::callStaticMethod<jshort>(jclass clazz,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jshort res = callStaticMethod<jshort>(clazz, methodName, sig, args);
|
jshort res = callStaticMethodV<jshort>(clazz, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jint QJNIObjectPrivate::callStaticMethod<jint>(const char *className,
|
jint QJNIObjectPrivate::callStaticMethodV<jint>(const char *className,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jint res = 0;
|
jint res = 0;
|
||||||
@ -974,16 +974,16 @@ jint QJNIObjectPrivate::callStaticMethod<jint>(const char *className,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jint res = callStaticMethod<jint>(className, methodName, sig, args);
|
jint res = callStaticMethodV<jint>(className, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jint QJNIObjectPrivate::callStaticMethod<jint>(jclass clazz,
|
jint QJNIObjectPrivate::callStaticMethodV<jint>(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jint res = 0;
|
jint res = 0;
|
||||||
@ -1003,16 +1003,16 @@ jint QJNIObjectPrivate::callStaticMethod<jint>(jclass clazz,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jint res = callStaticMethod<jint>(clazz, methodName, sig, args);
|
jint res = callStaticMethodV<jint>(clazz, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jlong QJNIObjectPrivate::callStaticMethod<jlong>(const char *className,
|
jlong QJNIObjectPrivate::callStaticMethodV<jlong>(const char *className,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jlong res = 0;
|
jlong res = 0;
|
||||||
@ -1035,16 +1035,16 @@ jlong QJNIObjectPrivate::callStaticMethod<jlong>(const char *className,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jlong res = callStaticMethod<jlong>(className, methodName, sig, args);
|
jlong res = callStaticMethodV<jlong>(className, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jlong QJNIObjectPrivate::callStaticMethod<jlong>(jclass clazz,
|
jlong QJNIObjectPrivate::callStaticMethodV<jlong>(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jlong res = 0;
|
jlong res = 0;
|
||||||
@ -1064,16 +1064,16 @@ jlong QJNIObjectPrivate::callStaticMethod<jlong>(jclass clazz,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jlong res = callStaticMethod<jlong>(clazz, methodName, sig, args);
|
jlong res = callStaticMethodV<jlong>(clazz, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jfloat QJNIObjectPrivate::callStaticMethod<jfloat>(const char *className,
|
jfloat QJNIObjectPrivate::callStaticMethodV<jfloat>(const char *className,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jfloat res = 0.f;
|
jfloat res = 0.f;
|
||||||
@ -1096,16 +1096,16 @@ jfloat QJNIObjectPrivate::callStaticMethod<jfloat>(const char *className,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jfloat res = callStaticMethod<jfloat>(className, methodName, sig, args);
|
jfloat res = callStaticMethodV<jfloat>(className, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jfloat QJNIObjectPrivate::callStaticMethod<jfloat>(jclass clazz,
|
jfloat QJNIObjectPrivate::callStaticMethodV<jfloat>(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jfloat res = 0.f;
|
jfloat res = 0.f;
|
||||||
@ -1125,16 +1125,16 @@ jfloat QJNIObjectPrivate::callStaticMethod<jfloat>(jclass clazz,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jfloat res = callStaticMethod<jfloat>(clazz, methodName, sig, args);
|
jfloat res = callStaticMethodV<jfloat>(clazz, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jdouble QJNIObjectPrivate::callStaticMethod<jdouble>(const char *className,
|
jdouble QJNIObjectPrivate::callStaticMethodV<jdouble>(const char *className,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jdouble res = 0.;
|
jdouble res = 0.;
|
||||||
@ -1157,16 +1157,16 @@ jdouble QJNIObjectPrivate::callStaticMethod<jdouble>(const char *className,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jdouble res = callStaticMethod<jdouble>(className, methodName, sig, args);
|
jdouble res = callStaticMethodV<jdouble>(className, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
jdouble QJNIObjectPrivate::callStaticMethod<jdouble>(jclass clazz,
|
jdouble QJNIObjectPrivate::callStaticMethodV<jdouble>(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jdouble res = 0.;
|
jdouble res = 0.;
|
||||||
@ -1186,7 +1186,7 @@ jdouble QJNIObjectPrivate::callStaticMethod<jdouble>(jclass clazz,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
jdouble res = callStaticMethod<jdouble>(clazz, methodName, sig, args);
|
jdouble res = callStaticMethodV<jdouble>(clazz, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -1299,9 +1299,9 @@ jdouble QJNIObjectPrivate::callStaticMethod<jdouble>(jclass clazz, const char *m
|
|||||||
return callStaticMethod<jdouble>(clazz, methodName, "()D");
|
return callStaticMethod<jdouble>(clazz, methodName, "()D");
|
||||||
}
|
}
|
||||||
|
|
||||||
QJNIObjectPrivate QJNIObjectPrivate::callObjectMethod(const char *methodName,
|
QJNIObjectPrivate QJNIObjectPrivate::callObjectMethodV(const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args) const
|
va_list args) const
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jobject res = 0;
|
jobject res = 0;
|
||||||
@ -1323,7 +1323,7 @@ QJNIObjectPrivate QJNIObjectPrivate::callObjectMethod(const char *methodName,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
QJNIObjectPrivate res = callObjectMethod(methodName, sig, args);
|
QJNIObjectPrivate res = callObjectMethodV(methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -1376,10 +1376,10 @@ QJNIObjectPrivate QJNIObjectPrivate::callObjectMethod<jdoubleArray>(const char *
|
|||||||
return callObjectMethod(methodName, "()[D");
|
return callObjectMethod(methodName, "()[D");
|
||||||
}
|
}
|
||||||
|
|
||||||
QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethod(const char *className,
|
QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethodV(const char *className,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jobject res = 0;
|
jobject res = 0;
|
||||||
@ -1405,15 +1405,15 @@ QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethod(const char *classNam
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
QJNIObjectPrivate res = callStaticObjectMethod(className, methodName, sig, args);
|
QJNIObjectPrivate res = callStaticObjectMethodV(className, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethod(jclass clazz,
|
QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethodV(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
QJNIEnvironmentPrivate env;
|
QJNIEnvironmentPrivate env;
|
||||||
jobject res = 0;
|
jobject res = 0;
|
||||||
@ -1436,7 +1436,7 @@ QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethod(jclass clazz,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, sig);
|
va_start(args, sig);
|
||||||
QJNIObjectPrivate res = callStaticObjectMethod(clazz, methodName, sig, args);
|
QJNIObjectPrivate res = callStaticObjectMethodV(clazz, methodName, sig, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -186,31 +186,37 @@ public:
|
|||||||
private:
|
private:
|
||||||
friend class QAndroidJniObject;
|
friend class QAndroidJniObject;
|
||||||
|
|
||||||
QJNIObjectPrivate(const char *className, const char *sig, va_list args);
|
struct QVaListPrivate { operator va_list &() const { return m_args; } va_list &m_args; };
|
||||||
QJNIObjectPrivate(jclass clazz, const char *sig, va_list args);
|
|
||||||
|
QJNIObjectPrivate(const char *className, const char *sig, const QVaListPrivate &args);
|
||||||
|
QJNIObjectPrivate(jclass clazz, const char *sig, const QVaListPrivate &args);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T callMethod(const char *methodName,
|
T callMethodV(const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args) const;
|
va_list args) const;
|
||||||
QJNIObjectPrivate callObjectMethod(const char *methodName,
|
QJNIObjectPrivate callObjectMethodV(const char *methodName,
|
||||||
const char *sig,
|
const char *sig,
|
||||||
va_list args) const;
|
va_list args) const;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static T callStaticMethod(const char *className,
|
static T callStaticMethodV(const char *className,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig, va_list args);
|
const char *sig,
|
||||||
|
va_list args);
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static T callStaticMethod(jclass clazz,
|
static T callStaticMethodV(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig, va_list args);
|
const char *sig,
|
||||||
static QJNIObjectPrivate callStaticObjectMethod(const char *className,
|
va_list args);
|
||||||
const char *methodName,
|
static QJNIObjectPrivate callStaticObjectMethodV(const char *className,
|
||||||
const char *sig, va_list args);
|
const char *methodName,
|
||||||
|
const char *sig,
|
||||||
|
va_list args);
|
||||||
|
|
||||||
static QJNIObjectPrivate callStaticObjectMethod(jclass clazz,
|
static QJNIObjectPrivate callStaticObjectMethodV(jclass clazz,
|
||||||
const char *methodName,
|
const char *methodName,
|
||||||
const char *sig, va_list args);
|
const char *sig,
|
||||||
|
va_list args);
|
||||||
|
|
||||||
bool isSameObject(jobject obj) const;
|
bool isSameObject(jobject obj) const;
|
||||||
bool isSameObject(const QJNIObjectPrivate &other) const;
|
bool isSameObject(const QJNIObjectPrivate &other) const;
|
||||||
|
@ -426,9 +426,8 @@ QTranslator::~QTranslator()
|
|||||||
directory. Returns \c true if the translation is successfully loaded;
|
directory. Returns \c true if the translation is successfully loaded;
|
||||||
otherwise returns \c false.
|
otherwise returns \c false.
|
||||||
|
|
||||||
If \a directory is not specified, the directory of the
|
If \a directory is not specified, the current directory is used
|
||||||
application's executable is used (i.e., as
|
(i.e., as \l{QDir::}{currentPath()}).
|
||||||
\l{QCoreApplication::}{applicationDirPath()}).
|
|
||||||
|
|
||||||
The previous contents of this translator object are discarded.
|
The previous contents of this translator object are discarded.
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ Q_DECLARE_TYPEINFO(QStaticPlugin, Q_PRIMITIVE_TYPE);
|
|||||||
|
|
||||||
void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin);
|
void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin);
|
||||||
|
|
||||||
#if defined (Q_OF_ELF) && (defined (Q_CC_GNU) || defined(Q_CC_CLANG))
|
#if (defined(Q_OF_ELF) || defined(Q_OS_WIN)) && (defined (Q_CC_GNU) || defined(Q_CC_CLANG))
|
||||||
# define QT_PLUGIN_METADATA_SECTION \
|
# define QT_PLUGIN_METADATA_SECTION \
|
||||||
__attribute__ ((section (".qtmetadata"))) __attribute__((used))
|
__attribute__ ((section (".qtmetadata"))) __attribute__((used))
|
||||||
#elif defined(Q_OS_MAC)
|
#elif defined(Q_OS_MAC)
|
||||||
|
@ -84,13 +84,9 @@ QT_END_NAMESPACE
|
|||||||
// New atomics
|
// New atomics
|
||||||
|
|
||||||
#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
|
#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
|
||||||
# if defined(Q_CC_CLANG) && ((((__clang_major__ * 100) + __clang_minor__) < 303) \
|
# if defined(Q_CC_CLANG) && Q_CC_CLANG < 303
|
||||||
|| defined(__apple_build_version__) \
|
/*
|
||||||
)
|
Do not define QT_BASIC_ATOMIC_HAS_CONSTRUCTORS for Clang before version 3.3.
|
||||||
/* Do not define QT_BASIC_ATOMIC_HAS_CONSTRUCTORS for "stock" clang before version 3.3.
|
|
||||||
Apple's version has different (higher!) version numbers, so disable it for all of them for now.
|
|
||||||
(The only way to distinguish between them seems to be a check for __apple_build_version__ .)
|
|
||||||
|
|
||||||
For details about the bug: see http://llvm.org/bugs/show_bug.cgi?id=12670
|
For details about the bug: see http://llvm.org/bugs/show_bug.cgi?id=12670
|
||||||
*/
|
*/
|
||||||
# else
|
# else
|
||||||
|
@ -35,8 +35,12 @@
|
|||||||
#define _POSIX_C_SOURCE 200809L
|
#define _POSIX_C_SOURCE 200809L
|
||||||
|
|
||||||
#include "qelapsedtimer.h"
|
#include "qelapsedtimer.h"
|
||||||
#ifdef Q_OS_VXWORKS
|
#if defined(Q_OS_VXWORKS)
|
||||||
#include "qfunctions_vxworks.h"
|
#include "qfunctions_vxworks.h"
|
||||||
|
#elif defined(Q_OS_QNX)
|
||||||
|
#include <sys/neutrino.h>
|
||||||
|
#include <sys/syspage.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -84,7 +88,18 @@ QT_BEGIN_NAMESPACE
|
|||||||
* see http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html
|
* see http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CLOCK_REALTIME
|
#if defined(Q_OS_QNX)
|
||||||
|
static inline void qt_clock_gettime(clockid_t clock, struct timespec *ts)
|
||||||
|
{
|
||||||
|
// The standard POSIX clock calls only have 1ms accuracy on QNX. To get
|
||||||
|
// higher accuracy, this platform-specific function must be used instead
|
||||||
|
quint64 cycles_per_sec = SYSPAGE_ENTRY(qtime)->cycles_per_sec;
|
||||||
|
quint64 cycles = ClockCycles();
|
||||||
|
ts->tv_sec = cycles / cycles_per_sec;
|
||||||
|
quint64 mod = cycles % cycles_per_sec;
|
||||||
|
ts->tv_nsec = mod * Q_INT64_C(1000000000) / cycles_per_sec;
|
||||||
|
}
|
||||||
|
#elif !defined(CLOCK_REALTIME)
|
||||||
# define CLOCK_REALTIME 0
|
# define CLOCK_REALTIME 0
|
||||||
static inline void qt_clock_gettime(int, struct timespec *ts)
|
static inline void qt_clock_gettime(int, struct timespec *ts)
|
||||||
{
|
{
|
||||||
|
@ -519,7 +519,7 @@ QBasicAtomicInt qt_cpu_features = Q_BASIC_ATOMIC_INITIALIZER(0);
|
|||||||
void qDetectCpuFeatures()
|
void qDetectCpuFeatures()
|
||||||
{
|
{
|
||||||
#if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
|
#if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) < 403
|
# if Q_CC_GNU < 403
|
||||||
// GCC 4.2 (at least the one that comes with Apple's XCode, on Mac) is
|
// GCC 4.2 (at least the one that comes with Apple's XCode, on Mac) is
|
||||||
// known to be broken beyond repair in dealing with the inline assembly
|
// known to be broken beyond repair in dealing with the inline assembly
|
||||||
// above. It will generate bad code that could corrupt important registers
|
// above. It will generate bad code that could corrupt important registers
|
||||||
|
@ -218,8 +218,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// other x86 intrinsics
|
// other x86 intrinsics
|
||||||
#if defined(Q_PROCESSOR_X86) && ((defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 404)) \
|
#if defined(Q_PROCESSOR_X86) && ((defined(Q_CC_GNU) && (Q_CC_GNU >= 404)) \
|
||||||
|| (defined(Q_CC_CLANG) && (__clang_major__ * 100 + __clang_minor__ >= 208)) \
|
|| (defined(Q_CC_CLANG) && (Q_CC_CLANG >= 208)) \
|
||||||
|| defined(Q_CC_INTEL))
|
|| defined(Q_CC_INTEL))
|
||||||
# define QT_COMPILER_SUPPORTS_X86INTRIN
|
# define QT_COMPILER_SUPPORTS_X86INTRIN
|
||||||
# ifdef Q_CC_INTEL
|
# ifdef Q_CC_INTEL
|
||||||
@ -332,7 +332,7 @@ static __forceinline unsigned long _bit_scan_forward(uint val)
|
|||||||
_BitScanForward(&result, val);
|
_BitScanForward(&result, val);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
# elif (defined(Q_CC_CLANG) || (defined(Q_CC_GNU) && __GNUC__ * 100 + __GNUC_MINOR__ < 405)) \
|
# elif (defined(Q_CC_CLANG) || (defined(Q_CC_GNU) && Q_CC_GNU < 405)) \
|
||||||
&& !defined(Q_CC_INTEL)
|
&& !defined(Q_CC_INTEL)
|
||||||
// Clang is missing the intrinsic for _bit_scan_reverse
|
// Clang is missing the intrinsic for _bit_scan_reverse
|
||||||
// GCC only added it in version 4.5
|
// GCC only added it in version 4.5
|
||||||
|
@ -6336,8 +6336,7 @@ ushort QString::toUShort(bool *ok, int base) const
|
|||||||
|
|
||||||
\snippet qstring/main.cpp 66
|
\snippet qstring/main.cpp 66
|
||||||
|
|
||||||
Various string formats for floating point numbers can be converted
|
\warning The QString content may only contain valid numerical characters which includes the plus/minus sign, the characters g and e used in scientific notation, and the decimal point. Including the unit or additional characters leads to a conversion error.
|
||||||
to double values:
|
|
||||||
|
|
||||||
\snippet qstring/main.cpp 67
|
\snippet qstring/main.cpp 67
|
||||||
|
|
||||||
@ -6346,7 +6345,7 @@ ushort QString::toUShort(bool *ok, int base) const
|
|||||||
|
|
||||||
\snippet qstring/main.cpp 68
|
\snippet qstring/main.cpp 68
|
||||||
|
|
||||||
For historic reasons, this function does not handle
|
For historical reasons, this function does not handle
|
||||||
thousands group separators. If you need to convert such numbers,
|
thousands group separators. If you need to convert such numbers,
|
||||||
use QLocale::toDouble().
|
use QLocale::toDouble().
|
||||||
|
|
||||||
|
@ -1122,6 +1122,10 @@ Qt::WindowState QWindow::windowState() const
|
|||||||
This is a hint to the window manager that this window is a dialog or pop-up
|
This is a hint to the window manager that this window is a dialog or pop-up
|
||||||
on behalf of the given window.
|
on behalf of the given window.
|
||||||
|
|
||||||
|
In order to cause the window to be centered above its transient parent by
|
||||||
|
default, depending on the window manager, it may also be necessary to call
|
||||||
|
setFlags() with a suitable \l Qt::WindowType (such as \c Qt::Dialog).
|
||||||
|
|
||||||
\sa transientParent(), parent()
|
\sa transientParent(), parent()
|
||||||
*/
|
*/
|
||||||
void QWindow::setTransientParent(QWindow *parent)
|
void QWindow::setTransientParent(QWindow *parent)
|
||||||
|
@ -82,10 +82,12 @@ QOpenGLTextureGlyphCache::~QOpenGLTextureGlyphCache()
|
|||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(QT_OPENGL_ES_2)
|
||||||
static inline bool isCoreProfile()
|
static inline bool isCoreProfile()
|
||||||
{
|
{
|
||||||
return QOpenGLContext::currentContext()->format().profile() == QSurfaceFormat::CoreProfile;
|
return QOpenGLContext::currentContext()->format().profile() == QSurfaceFormat::CoreProfile;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void QOpenGLTextureGlyphCache::createTextureData(int width, int height)
|
void QOpenGLTextureGlyphCache::createTextureData(int width, int height)
|
||||||
{
|
{
|
||||||
|
@ -44,31 +44,49 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
static QString resolve2xFile(const QString &fileName, qreal targetDevicePixelRatio)
|
static QString resolveFileName(QString fileName, QUrl *url, qreal targetDevicePixelRatio)
|
||||||
{
|
{
|
||||||
|
// We might use the fileName for loading if url loading fails
|
||||||
|
// try to make sure it is a valid file path.
|
||||||
|
// Also, QFile{Info}::exists works only on filepaths (not urls)
|
||||||
|
|
||||||
|
if (url->isValid()) {
|
||||||
|
if (url->scheme() == QLatin1Literal("qrc")) {
|
||||||
|
fileName = fileName.right(fileName.length() - 3);
|
||||||
|
}
|
||||||
|
else if (url->scheme() == QLatin1Literal("file")) {
|
||||||
|
fileName = url->toLocalFile();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (targetDevicePixelRatio <= 1.0)
|
if (targetDevicePixelRatio <= 1.0)
|
||||||
return fileName;
|
return fileName;
|
||||||
|
|
||||||
int dotIndex = fileName.lastIndexOf(QLatin1Char('.'));
|
// try to find a 2x version
|
||||||
|
|
||||||
|
const int dotIndex = fileName.lastIndexOf(QLatin1Char('.'));
|
||||||
if (dotIndex != -1) {
|
if (dotIndex != -1) {
|
||||||
QString at2xfileName = fileName;
|
QString at2xfileName = fileName;
|
||||||
at2xfileName.insert(dotIndex, QStringLiteral("@2x"));
|
at2xfileName.insert(dotIndex, QStringLiteral("@2x"));
|
||||||
if (QFile::exists(at2xfileName))
|
if (QFile::exists(at2xfileName)) {
|
||||||
return at2xfileName;
|
fileName = at2xfileName;
|
||||||
|
*url = QUrl(fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QPixmap getPixmap(QTextDocument *doc, const QTextImageFormat &format)
|
|
||||||
|
static QPixmap getPixmap(QTextDocument *doc, const QTextImageFormat &format, const qreal devicePixelRatio = 1.0)
|
||||||
{
|
{
|
||||||
QPixmap pm;
|
QPixmap pm;
|
||||||
|
|
||||||
QString name = format.name();
|
QString name = format.name();
|
||||||
if (name.startsWith(QLatin1String(":/"))) // auto-detect resources
|
if (name.startsWith(QLatin1String(":/"))) // auto-detect resources and convert them to url
|
||||||
name.prepend(QLatin1String("qrc"));
|
name.prepend(QLatin1String("qrc"));
|
||||||
QPaintDevice *pdev = doc->documentLayout()->paintDevice();
|
|
||||||
name = resolve2xFile(name, pdev ? pdev->devicePixelRatio() : qApp->devicePixelRatio());
|
|
||||||
QUrl url = QUrl(name);
|
QUrl url = QUrl(name);
|
||||||
|
name = resolveFileName(name, &url, devicePixelRatio);
|
||||||
const QVariant data = doc->resource(QTextDocument::ImageResource, url);
|
const QVariant data = doc->resource(QTextDocument::ImageResource, url);
|
||||||
if (data.type() == QVariant::Pixmap || data.type() == QVariant::Image) {
|
if (data.type() == QVariant::Pixmap || data.type() == QVariant::Image) {
|
||||||
pm = qvariant_cast<QPixmap>(data);
|
pm = qvariant_cast<QPixmap>(data);
|
||||||
@ -77,19 +95,18 @@ static QPixmap getPixmap(QTextDocument *doc, const QTextImageFormat &format)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pm.isNull()) {
|
if (pm.isNull()) {
|
||||||
QString context;
|
|
||||||
#if 0
|
#if 0
|
||||||
|
QString context;
|
||||||
// ### Qt5
|
// ### Qt5
|
||||||
QTextBrowser *browser = qobject_cast<QTextBrowser *>(doc->parent());
|
QTextBrowser *browser = qobject_cast<QTextBrowser *>(doc->parent());
|
||||||
if (browser)
|
if (browser)
|
||||||
context = browser->source().toString();
|
context = browser->source().toString();
|
||||||
#endif
|
#endif
|
||||||
|
// try direct loading
|
||||||
QImage img;
|
QImage img;
|
||||||
if (img.isNull()) { // try direct loading
|
if (name.isEmpty() || !img.load(name))
|
||||||
name = format.name(); // remove qrc:/ prefix again
|
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png"));
|
||||||
if (name.isEmpty() || !img.load(name))
|
|
||||||
return QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png"));
|
|
||||||
}
|
|
||||||
pm = QPixmap::fromImage(img);
|
pm = QPixmap::fromImage(img);
|
||||||
doc->addResource(QTextDocument::ImageResource, url, pm);
|
doc->addResource(QTextDocument::ImageResource, url, pm);
|
||||||
}
|
}
|
||||||
@ -142,16 +159,15 @@ static QSize getPixmapSize(QTextDocument *doc, const QTextImageFormat &format)
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QImage getImage(QTextDocument *doc, const QTextImageFormat &format)
|
static QImage getImage(QTextDocument *doc, const QTextImageFormat &format, const qreal devicePixelRatio = 1.0)
|
||||||
{
|
{
|
||||||
QImage image;
|
QImage image;
|
||||||
|
|
||||||
QString name = format.name();
|
QString name = format.name();
|
||||||
if (name.startsWith(QLatin1String(":/"))) // auto-detect resources
|
if (name.startsWith(QLatin1String(":/"))) // auto-detect resources
|
||||||
name.prepend(QLatin1String("qrc"));
|
name.prepend(QLatin1String("qrc"));
|
||||||
QPaintDevice *pdev = doc->documentLayout()->paintDevice();
|
|
||||||
name = resolve2xFile(name, pdev ? pdev->devicePixelRatio() : qApp->devicePixelRatio());
|
|
||||||
QUrl url = QUrl(name);
|
QUrl url = QUrl(name);
|
||||||
|
name = resolveFileName(name, &url, devicePixelRatio);
|
||||||
const QVariant data = doc->resource(QTextDocument::ImageResource, url);
|
const QVariant data = doc->resource(QTextDocument::ImageResource, url);
|
||||||
if (data.type() == QVariant::Image) {
|
if (data.type() == QVariant::Image) {
|
||||||
image = qvariant_cast<QImage>(data);
|
image = qvariant_cast<QImage>(data);
|
||||||
@ -160,19 +176,18 @@ static QImage getImage(QTextDocument *doc, const QTextImageFormat &format)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (image.isNull()) {
|
if (image.isNull()) {
|
||||||
QString context;
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
QString context;
|
||||||
// ### Qt5
|
// ### Qt5
|
||||||
QTextBrowser *browser = qobject_cast<QTextBrowser *>(doc->parent());
|
QTextBrowser *browser = qobject_cast<QTextBrowser *>(doc->parent());
|
||||||
if (browser)
|
if (browser)
|
||||||
context = browser->source().toString();
|
context = browser->source().toString();
|
||||||
#endif
|
#endif
|
||||||
if (image.isNull()) { // try direct loading
|
// try direct loading
|
||||||
name = format.name(); // remove qrc:/ prefix again
|
|
||||||
if (name.isEmpty() || !image.load(name))
|
if (name.isEmpty() || !image.load(name))
|
||||||
return QImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png"));
|
return QImage(QLatin1String(":/qt-project.org/styles/commonstyle/images/file-16.png"));
|
||||||
}
|
|
||||||
doc->addResource(QTextDocument::ImageResource, url, image);
|
doc->addResource(QTextDocument::ImageResource, url, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,10 +256,10 @@ void QTextImageHandler::drawObject(QPainter *p, const QRectF &rect, QTextDocumen
|
|||||||
const QTextImageFormat imageFormat = format.toImageFormat();
|
const QTextImageFormat imageFormat = format.toImageFormat();
|
||||||
|
|
||||||
if (QCoreApplication::instance()->thread() != QThread::currentThread()) {
|
if (QCoreApplication::instance()->thread() != QThread::currentThread()) {
|
||||||
const QImage image = getImage(doc, imageFormat);
|
const QImage image = getImage(doc, imageFormat, p->device()->devicePixelRatio());
|
||||||
p->drawImage(rect, image, image.rect());
|
p->drawImage(rect, image, image.rect());
|
||||||
} else {
|
} else {
|
||||||
const QPixmap pixmap = getPixmap(doc, imageFormat);
|
const QPixmap pixmap = getPixmap(doc, imageFormat, p->device()->devicePixelRatio());
|
||||||
p->drawPixmap(rect, pixmap, pixmap.rect());
|
p->drawPixmap(rect, pixmap, pixmap.rect());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1135,7 +1135,12 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
|
|||||||
if (!d->networkSessionStrongRef && (d->initializeSession || !d->networkConfiguration.identifier().isEmpty())) {
|
if (!d->networkSessionStrongRef && (d->initializeSession || !d->networkConfiguration.identifier().isEmpty())) {
|
||||||
QNetworkConfigurationManager manager;
|
QNetworkConfigurationManager manager;
|
||||||
if (!d->networkConfiguration.identifier().isEmpty()) {
|
if (!d->networkConfiguration.identifier().isEmpty()) {
|
||||||
d->createSession(d->networkConfiguration);
|
if ((d->networkConfiguration.state() & QNetworkConfiguration::Defined)
|
||||||
|
&& d->networkConfiguration != manager.defaultConfiguration())
|
||||||
|
d->createSession(manager.defaultConfiguration());
|
||||||
|
else
|
||||||
|
d->createSession(d->networkConfiguration);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired)
|
if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired)
|
||||||
d->createSession(manager.defaultConfiguration());
|
d->createSession(manager.defaultConfiguration());
|
||||||
@ -1590,6 +1595,11 @@ void QNetworkAccessManagerPrivate::_q_onlineStateChanged(bool isOnline)
|
|||||||
if (customNetworkConfiguration) {
|
if (customNetworkConfiguration) {
|
||||||
online = (networkConfiguration.state() & QNetworkConfiguration::Active);
|
online = (networkConfiguration.state() & QNetworkConfiguration::Active);
|
||||||
} else {
|
} else {
|
||||||
|
if (isOnline && online != isOnline) {
|
||||||
|
networkSessionStrongRef.clear();
|
||||||
|
networkSessionWeakRef.clear();
|
||||||
|
}
|
||||||
|
|
||||||
online = isOnline;
|
online = isOnline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1908,18 +1908,14 @@ qint64 QSslSocket::readData(char *data, qint64 maxlen)
|
|||||||
|
|
||||||
if (d->mode == UnencryptedMode && !d->autoStartHandshake) {
|
if (d->mode == UnencryptedMode && !d->autoStartHandshake) {
|
||||||
readBytes = d->plainSocket->read(data, maxlen);
|
readBytes = d->plainSocket->read(data, maxlen);
|
||||||
} else {
|
|
||||||
int bytesToRead = qMin<int>(maxlen, d->buffer.size());
|
|
||||||
readBytes = d->buffer.read(data, bytesToRead);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef QSSLSOCKET_DEBUG
|
#ifdef QSSLSOCKET_DEBUG
|
||||||
qDebug() << "QSslSocket::readData(" << (void *)data << ',' << maxlen << ") ==" << readBytes;
|
qDebug() << "QSslSocket::readData(" << (void *)data << ',' << maxlen << ") =="
|
||||||
|
<< readBytes;
|
||||||
#endif
|
#endif
|
||||||
|
} else {
|
||||||
// possibly trigger another transmit() to decrypt more data from the socket
|
// possibly trigger another transmit() to decrypt more data from the socket
|
||||||
if (d->buffer.isEmpty() && d->plainSocket->bytesAvailable()) {
|
if (d->plainSocket->bytesAvailable())
|
||||||
QMetaObject::invokeMethod(this, "_q_flushReadBuffer", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(this, "_q_flushReadBuffer", Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
return readBytes;
|
return readBytes;
|
||||||
|
@ -8,14 +8,14 @@ QT = core network-private dbus
|
|||||||
CONFIG += link_pkgconfig
|
CONFIG += link_pkgconfig
|
||||||
|
|
||||||
HEADERS += qconnmanservice_linux_p.h \
|
HEADERS += qconnmanservice_linux_p.h \
|
||||||
qofonoservice_linux_p.h \
|
../linux_common/qofonoservice_linux_p.h \
|
||||||
qconnmanengine.h \
|
qconnmanengine.h \
|
||||||
../qnetworksession_impl.h \
|
../qnetworksession_impl.h \
|
||||||
../qbearerengine_impl.h
|
../qbearerengine_impl.h
|
||||||
|
|
||||||
SOURCES += main.cpp \
|
SOURCES += main.cpp \
|
||||||
qconnmanservice_linux.cpp \
|
qconnmanservice_linux.cpp \
|
||||||
qofonoservice_linux.cpp \
|
../linux_common/qofonoservice_linux.cpp \
|
||||||
qconnmanengine.cpp \
|
qconnmanengine.cpp \
|
||||||
../qnetworksession_impl.cpp
|
../qnetworksession_impl.cpp
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
#include "../qbearerengine_impl.h"
|
#include "../qbearerengine_impl.h"
|
||||||
|
|
||||||
#include "qconnmanservice_linux_p.h"
|
#include "qconnmanservice_linux_p.h"
|
||||||
#include "qofonoservice_linux_p.h"
|
#include "../linux_common/qofonoservice_linux_p.h"
|
||||||
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
@ -95,14 +95,12 @@ QStringList QOfonoManagerInterface::getModems()
|
|||||||
{
|
{
|
||||||
if (modemList.isEmpty()) {
|
if (modemList.isEmpty()) {
|
||||||
QList<QVariant> argumentList;
|
QList<QVariant> argumentList;
|
||||||
QDBusPendingReply<PathPropertiesList> reply = asyncCallWithArgumentList(QLatin1String("GetModems"), argumentList);
|
QDBusPendingReply<PathPropertiesList> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetModems"), argumentList);
|
||||||
reply.waitForFinished();
|
reply.waitForFinished();
|
||||||
if (!reply.isError()) {
|
if (!reply.isError()) {
|
||||||
foreach (ObjectPathProperties modem, reply.value()) {
|
foreach (ObjectPathProperties modem, reply.value()) {
|
||||||
modemList << modem.path.path();
|
modemList << modem.path.path();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
qDebug() << reply.error().message();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +112,8 @@ QString QOfonoManagerInterface::currentModem()
|
|||||||
QStringList modems = getModems();
|
QStringList modems = getModems();
|
||||||
foreach (const QString &modem, modems) {
|
foreach (const QString &modem, modems) {
|
||||||
QOfonoModemInterface device(modem);
|
QOfonoModemInterface device(modem);
|
||||||
if (device.isPowered() && device.isOnline())
|
if (device.isPowered() && device.isOnline()
|
||||||
|
&& device.interfaces().contains(QStringLiteral("org.ofono.NetworkRegistration")))
|
||||||
return modem;
|
return modem;
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
@ -171,11 +170,17 @@ bool QOfonoModemInterface::isOnline()
|
|||||||
return qdbus_cast<bool>(var);
|
return qdbus_cast<bool>(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList QOfonoModemInterface::interfaces()
|
||||||
|
{
|
||||||
|
const QVariant var = getProperty(QStringLiteral("Interfaces"));
|
||||||
|
return var.toStringList();
|
||||||
|
}
|
||||||
|
|
||||||
QVariantMap QOfonoModemInterface::getProperties()
|
QVariantMap QOfonoModemInterface::getProperties()
|
||||||
{
|
{
|
||||||
if (propertiesMap.isEmpty()) {
|
if (propertiesMap.isEmpty()) {
|
||||||
QList<QVariant> argumentList;
|
QList<QVariant> argumentList;
|
||||||
QDBusPendingReply<QVariantMap> reply = asyncCallWithArgumentList(QLatin1String("GetProperties"), argumentList);
|
QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
|
||||||
if (!reply.isError()) {
|
if (!reply.isError()) {
|
||||||
propertiesMap = reply.value();
|
propertiesMap = reply.value();
|
||||||
}
|
}
|
||||||
@ -187,7 +192,8 @@ QVariant QOfonoModemInterface::getProperty(const QString &property)
|
|||||||
{
|
{
|
||||||
QVariant var;
|
QVariant var;
|
||||||
QVariantMap map = getProperties();
|
QVariantMap map = getProperties();
|
||||||
var = map.value(property);
|
if (map.contains(property))
|
||||||
|
var = map.value(property);
|
||||||
return var;
|
return var;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +220,8 @@ QVariant QOfonoNetworkRegistrationInterface::getProperty(const QString &property
|
|||||||
{
|
{
|
||||||
QVariant var;
|
QVariant var;
|
||||||
QVariantMap map = getProperties();
|
QVariantMap map = getProperties();
|
||||||
var = map.value(property);
|
if (map.contains(property))
|
||||||
|
var = map.value(property);
|
||||||
return var;
|
return var;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,12 +229,10 @@ QVariantMap QOfonoNetworkRegistrationInterface::getProperties()
|
|||||||
{
|
{
|
||||||
if (propertiesMap.isEmpty()) {
|
if (propertiesMap.isEmpty()) {
|
||||||
QList<QVariant> argumentList;
|
QList<QVariant> argumentList;
|
||||||
QDBusPendingReply<QVariantMap> reply = asyncCallWithArgumentList(QLatin1String("GetProperties"), argumentList);
|
QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
|
||||||
reply.waitForFinished();
|
reply.waitForFinished();
|
||||||
if (!reply.isError()) {
|
if (!reply.isError()) {
|
||||||
propertiesMap = reply.value();
|
propertiesMap = reply.value();
|
||||||
} else {
|
|
||||||
qDebug() << reply.error().message();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return propertiesMap;
|
return propertiesMap;
|
||||||
@ -270,11 +275,18 @@ bool QOfonoDataConnectionManagerInterface::roamingAllowed()
|
|||||||
return qdbus_cast<bool>(var);
|
return qdbus_cast<bool>(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QOfonoDataConnectionManagerInterface::bearer()
|
||||||
|
{
|
||||||
|
QVariant var = getProperty(QStringLiteral("Bearer"));
|
||||||
|
return qdbus_cast<QString>(var);
|
||||||
|
}
|
||||||
|
|
||||||
QVariant QOfonoDataConnectionManagerInterface::getProperty(const QString &property)
|
QVariant QOfonoDataConnectionManagerInterface::getProperty(const QString &property)
|
||||||
{
|
{
|
||||||
QVariant var;
|
QVariant var;
|
||||||
QVariantMap map = getProperties();
|
QVariantMap map = getProperties();
|
||||||
var = map.value(property);
|
if (map.contains(property))
|
||||||
|
var = map.value(property);
|
||||||
return var;
|
return var;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,7 +294,7 @@ QVariantMap QOfonoDataConnectionManagerInterface::getProperties()
|
|||||||
{
|
{
|
||||||
if (propertiesMap.isEmpty()) {
|
if (propertiesMap.isEmpty()) {
|
||||||
QList<QVariant> argumentList;
|
QList<QVariant> argumentList;
|
||||||
QDBusPendingReply<QVariantMap> reply = asyncCallWithArgumentList(QLatin1String("GetProperties"), argumentList);
|
QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
|
||||||
if (!reply.isError()) {
|
if (!reply.isError()) {
|
||||||
propertiesMap = reply.value();
|
propertiesMap = reply.value();
|
||||||
}
|
}
|
||||||
@ -297,6 +309,68 @@ void QOfonoDataConnectionManagerInterface::propertyChanged(const QString &name,
|
|||||||
Q_EMIT roamingAllowedChanged(value.variant().toBool());
|
Q_EMIT roamingAllowedChanged(value.variant().toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QOfonoConnectionContextInterface::QOfonoConnectionContextInterface(const QString &dbusPathName, QObject *parent)
|
||||||
|
: QDBusAbstractInterface(QLatin1String(OFONO_SERVICE),
|
||||||
|
dbusPathName,
|
||||||
|
OFONO_CONNECTION_CONTEXT_INTERFACE,
|
||||||
|
QDBusConnection::systemBus(), parent)
|
||||||
|
{
|
||||||
|
QDBusConnection::systemBus().connect(QLatin1String(OFONO_SERVICE),
|
||||||
|
path(),
|
||||||
|
QLatin1String(OFONO_MODEM_INTERFACE),
|
||||||
|
QLatin1String("PropertyChanged"),
|
||||||
|
this,SLOT(propertyChanged(QString,QDBusVariant)));
|
||||||
|
}
|
||||||
|
|
||||||
|
QOfonoConnectionContextInterface::~QOfonoConnectionContextInterface()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariantMap QOfonoConnectionContextInterface::getProperties()
|
||||||
|
{
|
||||||
|
if (propertiesMap.isEmpty()) {
|
||||||
|
QList<QVariant> argumentList;
|
||||||
|
QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
|
||||||
|
if (!reply.isError()) {
|
||||||
|
propertiesMap = reply.value();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return propertiesMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QOfonoConnectionContextInterface::propertyChanged(const QString &name, const QDBusVariant &value)
|
||||||
|
{
|
||||||
|
propertiesMap[name] = value.variant();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant QOfonoConnectionContextInterface::getProperty(const QString &property)
|
||||||
|
{
|
||||||
|
QVariant var;
|
||||||
|
QVariantMap map = getProperties();
|
||||||
|
if (map.contains(property))
|
||||||
|
var = map.value(property);
|
||||||
|
return var;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QOfonoConnectionContextInterface::active()
|
||||||
|
{
|
||||||
|
QVariant var = getProperty(QStringLiteral("Active"));
|
||||||
|
return qdbus_cast<bool>(var);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QOfonoConnectionContextInterface::accessPointName()
|
||||||
|
{
|
||||||
|
QVariant var = getProperty(QStringLiteral("AccessPointName"));
|
||||||
|
return qdbus_cast<QString>(var);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QOfonoConnectionContextInterface::name()
|
||||||
|
{
|
||||||
|
QVariant var = getProperty(QStringLiteral("Name"));
|
||||||
|
return qdbus_cast<QString>(var);
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_DBUS
|
#endif // QT_NO_DBUS
|
@ -67,6 +67,7 @@
|
|||||||
#define OFONO_MODEM_INTERFACE "org.ofono.Modem"
|
#define OFONO_MODEM_INTERFACE "org.ofono.Modem"
|
||||||
#define OFONO_NETWORK_REGISTRATION_INTERFACE "org.ofono.NetworkRegistration"
|
#define OFONO_NETWORK_REGISTRATION_INTERFACE "org.ofono.NetworkRegistration"
|
||||||
#define OFONO_DATA_CONNECTION_MANAGER_INTERFACE "org.ofono.ConnectionManager"
|
#define OFONO_DATA_CONNECTION_MANAGER_INTERFACE "org.ofono.ConnectionManager"
|
||||||
|
#define OFONO_CONNECTION_CONTEXT_INTERFACE "org.ofono.ConnectionContext"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -114,6 +115,7 @@ public:
|
|||||||
|
|
||||||
bool isPowered();
|
bool isPowered();
|
||||||
bool isOnline();
|
bool isOnline();
|
||||||
|
QStringList interfaces();
|
||||||
private:
|
private:
|
||||||
QVariantMap getProperties();
|
QVariantMap getProperties();
|
||||||
QVariantMap propertiesMap;
|
QVariantMap propertiesMap;
|
||||||
@ -152,17 +154,39 @@ public:
|
|||||||
|
|
||||||
QStringList contexts();
|
QStringList contexts();
|
||||||
bool roamingAllowed();
|
bool roamingAllowed();
|
||||||
|
QVariant getProperty(const QString &);
|
||||||
|
QString bearer();
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void roamingAllowedChanged(bool);
|
void roamingAllowedChanged(bool);
|
||||||
private:
|
private:
|
||||||
QVariantMap getProperties();
|
QVariantMap getProperties();
|
||||||
QVariantMap propertiesMap;
|
QVariantMap propertiesMap;
|
||||||
QVariant getProperty(const QString &);
|
|
||||||
QStringList contextList;
|
QStringList contextList;
|
||||||
private slots:
|
private slots:
|
||||||
void propertyChanged(const QString &, const QDBusVariant &value);
|
void propertyChanged(const QString &, const QDBusVariant &value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class QOfonoConnectionContextInterface : public QDBusAbstractInterface
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit QOfonoConnectionContextInterface(const QString &dbusPathName, QObject *parent = 0);
|
||||||
|
~QOfonoConnectionContextInterface();
|
||||||
|
|
||||||
|
QVariant getProperty(const QString &);
|
||||||
|
bool active();
|
||||||
|
QString accessPointName();
|
||||||
|
QString name();
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
private:
|
||||||
|
QVariantMap getProperties();
|
||||||
|
QVariantMap propertiesMap;
|
||||||
|
private slots:
|
||||||
|
void propertyChanged(const QString &, const QDBusVariant &value);
|
||||||
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
@ -6,16 +6,16 @@ load(qt_plugin)
|
|||||||
|
|
||||||
QT = core network-private dbus
|
QT = core network-private dbus
|
||||||
|
|
||||||
HEADERS += qnmdbushelper.h \
|
HEADERS += qnetworkmanagerservice.h \
|
||||||
qnetworkmanagerservice.h \
|
|
||||||
qnetworkmanagerengine.h \
|
qnetworkmanagerengine.h \
|
||||||
|
../linux_common/qofonoservice_linux_p.h \
|
||||||
../qnetworksession_impl.h \
|
../qnetworksession_impl.h \
|
||||||
../qbearerengine_impl.h
|
../qbearerengine_impl.h
|
||||||
|
|
||||||
SOURCES += main.cpp \
|
SOURCES += main.cpp \
|
||||||
qnmdbushelper.cpp \
|
|
||||||
qnetworkmanagerservice.cpp \
|
qnetworkmanagerservice.cpp \
|
||||||
qnetworkmanagerengine.cpp \
|
qnetworkmanagerengine.cpp \
|
||||||
|
../linux_common/qofonoservice_linux.cpp \
|
||||||
../qnetworksession_impl.cpp
|
../qnetworksession_impl.cpp
|
||||||
|
|
||||||
OTHER_FILES += networkmanager.json
|
OTHER_FILES += networkmanager.json
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
#include <QDBusInterface>
|
#include <QDBusInterface>
|
||||||
#include <QDBusMessage>
|
#include <QDBusMessage>
|
||||||
#include <QDBusReply>
|
#include <QDBusReply>
|
||||||
|
#include "../linux_common/qofonoservice_linux_p.h"
|
||||||
|
|
||||||
#ifndef QT_NO_BEARERMANAGEMENT
|
#ifndef QT_NO_BEARERMANAGEMENT
|
||||||
#ifndef QT_NO_DBUS
|
#ifndef QT_NO_DBUS
|
||||||
@ -57,45 +58,80 @@ QNetworkManagerEngine::QNetworkManagerEngine(QObject *parent)
|
|||||||
: QBearerEngineImpl(parent),
|
: QBearerEngineImpl(parent),
|
||||||
managerInterface(new QNetworkManagerInterface(this)),
|
managerInterface(new QNetworkManagerInterface(this)),
|
||||||
systemSettings(new QNetworkManagerSettings(NM_DBUS_SERVICE, this)),
|
systemSettings(new QNetworkManagerSettings(NM_DBUS_SERVICE, this)),
|
||||||
userSettings(new QNetworkManagerSettings(NM_DBUS_SERVICE, this))
|
ofonoManager(new QOfonoManagerInterface(this))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!managerInterface->isValid())
|
if (!managerInterface->isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
managerInterface->setConnections();
|
qDBusRegisterMetaType<QNmSettingsMap>();
|
||||||
|
|
||||||
connect(managerInterface, SIGNAL(deviceAdded(QDBusObjectPath)),
|
connect(managerInterface, SIGNAL(deviceAdded(QDBusObjectPath)),
|
||||||
this, SLOT(deviceAdded(QDBusObjectPath)));
|
this, SLOT(deviceAdded(QDBusObjectPath)));
|
||||||
connect(managerInterface, SIGNAL(deviceRemoved(QDBusObjectPath)),
|
connect(managerInterface, SIGNAL(deviceRemoved(QDBusObjectPath)),
|
||||||
this, SLOT(deviceRemoved(QDBusObjectPath)));
|
this, SLOT(deviceRemoved(QDBusObjectPath)));
|
||||||
connect(managerInterface, SIGNAL(activationFinished(QDBusPendingCallWatcher*)),
|
connect(managerInterface, SIGNAL(activationFinished(QDBusPendingCallWatcher*)),
|
||||||
this, SLOT(activationFinished(QDBusPendingCallWatcher*)));
|
this, SLOT(activationFinished(QDBusPendingCallWatcher*)));
|
||||||
connect(managerInterface, SIGNAL(propertiesChanged(QString,QMap<QString,QVariant>)),
|
connect(managerInterface, SIGNAL(propertiesChanged(QMap<QString,QVariant>)),
|
||||||
this, SLOT(interfacePropertiesChanged(QString,QMap<QString,QVariant>)));
|
this, SLOT(interfacePropertiesChanged(QMap<QString,QVariant>)));
|
||||||
|
managerInterface->setConnections();
|
||||||
|
|
||||||
qDBusRegisterMetaType<QNmSettingsMap>();
|
|
||||||
|
|
||||||
systemSettings->setConnections();
|
|
||||||
connect(systemSettings, SIGNAL(newConnection(QDBusObjectPath)),
|
connect(systemSettings, SIGNAL(newConnection(QDBusObjectPath)),
|
||||||
this, SLOT(newConnection(QDBusObjectPath)));
|
this, SLOT(newConnection(QDBusObjectPath)));
|
||||||
|
systemSettings->setConnections();
|
||||||
userSettings->setConnections();
|
|
||||||
connect(userSettings, SIGNAL(newConnection(QDBusObjectPath)),
|
|
||||||
this, SLOT(newConnection(QDBusObjectPath)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QNetworkManagerEngine::~QNetworkManagerEngine()
|
QNetworkManagerEngine::~QNetworkManagerEngine()
|
||||||
{
|
{
|
||||||
qDeleteAll(connections);
|
qDeleteAll(connections);
|
||||||
|
connections.clear();
|
||||||
qDeleteAll(accessPoints);
|
qDeleteAll(accessPoints);
|
||||||
|
accessPoints.clear();
|
||||||
qDeleteAll(wirelessDevices);
|
qDeleteAll(wirelessDevices);
|
||||||
qDeleteAll(activeConnections);
|
wirelessDevices.clear();
|
||||||
|
qDeleteAll(activeConnectionsList);
|
||||||
|
activeConnectionsList.clear();
|
||||||
|
qDeleteAll(interfaceDevices);
|
||||||
|
interfaceDevices.clear();
|
||||||
|
|
||||||
|
connectionInterfaces.clear();
|
||||||
|
|
||||||
|
qDeleteAll(ofonoContextManagers);
|
||||||
|
ofonoContextManagers.clear();
|
||||||
|
|
||||||
|
qDeleteAll(wiredDevices);
|
||||||
|
wiredDevices.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QNetworkManagerEngine::initialize()
|
void QNetworkManagerEngine::initialize()
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
|
|
||||||
// Get current list of access points.
|
if (ofonoManager->isValid()) {
|
||||||
|
Q_FOREACH (const QString &modem, ofonoManager->getModems()) {
|
||||||
|
QOfonoDataConnectionManagerInterface *ofonoContextManager
|
||||||
|
= new QOfonoDataConnectionManagerInterface(modem,this);
|
||||||
|
ofonoContextManagers.insert(modem, ofonoContextManager);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Get active connections.
|
||||||
|
foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) {
|
||||||
|
|
||||||
|
QNetworkManagerConnectionActive *activeConnection =
|
||||||
|
new QNetworkManagerConnectionActive(acPath.path(),this);
|
||||||
|
activeConnectionsList.insert(acPath.path(), activeConnection);
|
||||||
|
connect(activeConnection, SIGNAL(propertiesChanged(QMap<QString,QVariant>)),
|
||||||
|
this, SLOT(activeConnectionPropertiesChanged(QMap<QString,QVariant>)));
|
||||||
|
activeConnection->setConnections();
|
||||||
|
|
||||||
|
QStringList devices = activeConnection->devices();
|
||||||
|
if (!devices.isEmpty()) {
|
||||||
|
QNetworkManagerInterfaceDevice device(devices.at(0),this);
|
||||||
|
connectionInterfaces.insert(activeConnection->connection().path(),device.networkInterface());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get current list of access points.
|
||||||
foreach (const QDBusObjectPath &devicePath, managerInterface->getDevices()) {
|
foreach (const QDBusObjectPath &devicePath, managerInterface->getDevices()) {
|
||||||
locker.unlock();
|
locker.unlock();
|
||||||
deviceAdded(devicePath); //add all accesspoints
|
deviceAdded(devicePath); //add all accesspoints
|
||||||
@ -103,7 +139,6 @@ void QNetworkManagerEngine::initialize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get connections.
|
// Get connections.
|
||||||
|
|
||||||
foreach (const QDBusObjectPath &settingsPath, systemSettings->listConnections()) {
|
foreach (const QDBusObjectPath &settingsPath, systemSettings->listConnections()) {
|
||||||
locker.unlock();
|
locker.unlock();
|
||||||
if (!hasIdentifier(settingsPath.path()))
|
if (!hasIdentifier(settingsPath.path()))
|
||||||
@ -111,57 +146,19 @@ void QNetworkManagerEngine::initialize()
|
|||||||
locker.relock();
|
locker.relock();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (const QDBusObjectPath &settingsPath, userSettings->listConnections()) {
|
|
||||||
locker.unlock();
|
|
||||||
if (!hasIdentifier(settingsPath.path()))
|
|
||||||
newConnection(settingsPath, userSettings);
|
|
||||||
locker.relock();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get active connections.
|
|
||||||
foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) {
|
|
||||||
QNetworkManagerConnectionActive *activeConnection =
|
|
||||||
new QNetworkManagerConnectionActive(acPath.path(),this);
|
|
||||||
activeConnections.insert(acPath.path(), activeConnection);
|
|
||||||
|
|
||||||
activeConnection->setConnections();
|
|
||||||
connect(activeConnection, SIGNAL(propertiesChanged(QString,QMap<QString,QVariant>)),
|
|
||||||
this, SLOT(activeConnectionPropertiesChanged(QString,QMap<QString,QVariant>)));
|
|
||||||
}
|
|
||||||
Q_EMIT updateCompleted();
|
Q_EMIT updateCompleted();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QNetworkManagerEngine::networkManagerAvailable() const
|
bool QNetworkManagerEngine::networkManagerAvailable() const
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
|
||||||
|
|
||||||
return managerInterface->isValid();
|
return managerInterface->isValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QNetworkManagerEngine::getInterfaceFromId(const QString &id)
|
QString QNetworkManagerEngine::getInterfaceFromId(const QString &settingsPath)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
return connectionInterfaces.value(settingsPath);
|
||||||
|
|
||||||
foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) {
|
|
||||||
QNetworkManagerConnectionActive activeConnection(acPath.path());
|
|
||||||
|
|
||||||
const QString identifier = activeConnection.connection().path();
|
|
||||||
|
|
||||||
if (id == identifier) {
|
|
||||||
QList<QDBusObjectPath> devices = activeConnection.devices();
|
|
||||||
|
|
||||||
if (devices.isEmpty())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
QNetworkManagerInterfaceDevice device(devices.at(0).path());
|
|
||||||
return device.networkInterface();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return QString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool QNetworkManagerEngine::hasIdentifier(const QString &id)
|
bool QNetworkManagerEngine::hasIdentifier(const QString &id)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
@ -177,35 +174,34 @@ void QNetworkManagerEngine::connectToId(const QString &id)
|
|||||||
if (!connection)
|
if (!connection)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QNmSettingsMap map = connection->getSettings();
|
NMDeviceType connectionType = connection->getType();
|
||||||
const QString connectionType = map.value("connection").value("type").toString();
|
|
||||||
|
|
||||||
QString dbusDevicePath;
|
QString dbusDevicePath;
|
||||||
foreach (const QDBusObjectPath &devicePath, managerInterface->getDevices()) {
|
const QString settingsPath = connection->connectionInterface()->path();
|
||||||
QNetworkManagerInterfaceDevice device(devicePath.path());
|
QString specificPath = configuredAccessPoints.key(settingsPath);
|
||||||
if (device.deviceType() == DEVICE_TYPE_ETHERNET &&
|
|
||||||
connectionType == QLatin1String("802-3-ethernet")) {
|
QHashIterator<QString, QNetworkManagerInterfaceDevice*> i(interfaceDevices);
|
||||||
dbusDevicePath = devicePath.path();
|
while (i.hasNext()) {
|
||||||
|
i.next();
|
||||||
|
if (i.value()->deviceType() == DEVICE_TYPE_ETHERNET &&
|
||||||
|
connectionType == DEVICE_TYPE_ETHERNET) {
|
||||||
|
dbusDevicePath = i.key();
|
||||||
break;
|
break;
|
||||||
} else if (device.deviceType() == DEVICE_TYPE_WIFI &&
|
} else if (i.value()->deviceType() == DEVICE_TYPE_WIFI &&
|
||||||
connectionType == QLatin1String("802-11-wireless")) {
|
connectionType == DEVICE_TYPE_WIFI) {
|
||||||
dbusDevicePath = devicePath.path();
|
dbusDevicePath = i.key();
|
||||||
break;
|
break;
|
||||||
} else if (device.deviceType() == DEVICE_TYPE_MODEM &&
|
} else if (i.value()->deviceType() == DEVICE_TYPE_MODEM &&
|
||||||
connectionType == QLatin1String("gsm")) {
|
connectionType == DEVICE_TYPE_MODEM) {
|
||||||
dbusDevicePath = devicePath.path();
|
dbusDevicePath = i.key();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString service = connection->connectionInterface()->service();
|
|
||||||
const QString settingsPath = connection->connectionInterface()->path();
|
|
||||||
QString specificPath = configuredAccessPoints.key(settingsPath);
|
|
||||||
|
|
||||||
if (specificPath.isEmpty())
|
if (specificPath.isEmpty())
|
||||||
specificPath = "/";
|
specificPath = "/";
|
||||||
|
|
||||||
managerInterface->activateConnection(service, QDBusObjectPath(settingsPath),
|
managerInterface->activateConnection(QDBusObjectPath(settingsPath),
|
||||||
QDBusObjectPath(dbusDevicePath), QDBusObjectPath(specificPath));
|
QDBusObjectPath(dbusDevicePath), QDBusObjectPath(specificPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,13 +217,11 @@ void QNetworkManagerEngine::disconnectFromId(const QString &id)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) {
|
QHashIterator<QString, QNetworkManagerConnectionActive*> i(activeConnectionsList);
|
||||||
QNetworkManagerConnectionActive activeConnection(acPath.path());
|
while (i.hasNext()) {
|
||||||
|
i.next();
|
||||||
const QString identifier = activeConnection.connection().path();
|
if (id == i.value()->connection().path() && accessPointConfigurations.contains(id)) {
|
||||||
|
managerInterface->deactivateConnection(QDBusObjectPath(i.key()));
|
||||||
if (id == identifier && accessPointConfigurations.contains(id)) {
|
|
||||||
managerInterface->deactivateConnection(acPath);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -250,12 +244,9 @@ void QNetworkManagerEngine::scanFinished()
|
|||||||
QMetaObject::invokeMethod(this, "updateCompleted", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(this, "updateCompleted", Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QNetworkManagerEngine::interfacePropertiesChanged(const QString &path,
|
void QNetworkManagerEngine::interfacePropertiesChanged(const QMap<QString, QVariant> &properties)
|
||||||
const QMap<QString, QVariant> &properties)
|
|
||||||
{
|
{
|
||||||
Q_UNUSED(path)
|
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
|
|
||||||
QMapIterator<QString, QVariant> i(properties);
|
QMapIterator<QString, QVariant> i(properties);
|
||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
i.next();
|
i.next();
|
||||||
@ -267,22 +258,20 @@ void QNetworkManagerEngine::interfacePropertiesChanged(const QString &path,
|
|||||||
qdbus_cast<QList<QDBusObjectPath> >(i.value().value<QDBusArgument>());
|
qdbus_cast<QList<QDBusObjectPath> >(i.value().value<QDBusArgument>());
|
||||||
|
|
||||||
QStringList identifiers = accessPointConfigurations.keys();
|
QStringList identifiers = accessPointConfigurations.keys();
|
||||||
foreach (const QString &id, identifiers)
|
QStringList priorActiveConnections = activeConnectionsList.keys();
|
||||||
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
|
|
||||||
|
|
||||||
QStringList priorActiveConnections = this->activeConnections.keys();
|
|
||||||
|
|
||||||
foreach (const QDBusObjectPath &acPath, activeConnections) {
|
foreach (const QDBusObjectPath &acPath, activeConnections) {
|
||||||
priorActiveConnections.removeOne(acPath.path());
|
priorActiveConnections.removeOne(acPath.path());
|
||||||
QNetworkManagerConnectionActive *activeConnection =
|
QNetworkManagerConnectionActive *activeConnection =
|
||||||
this->activeConnections.value(acPath.path());
|
activeConnectionsList.value(acPath.path());
|
||||||
|
|
||||||
if (!activeConnection) {
|
if (!activeConnection) {
|
||||||
activeConnection = new QNetworkManagerConnectionActive(acPath.path(),this);
|
activeConnection = new QNetworkManagerConnectionActive(acPath.path(),this);
|
||||||
this->activeConnections.insert(acPath.path(), activeConnection);
|
activeConnectionsList.insert(acPath.path(), activeConnection);
|
||||||
|
|
||||||
|
connect(activeConnection, SIGNAL(propertiesChanged(QMap<QString,QVariant>)),
|
||||||
|
this, SLOT(activeConnectionPropertiesChanged(QMap<QString,QVariant>)));
|
||||||
activeConnection->setConnections();
|
activeConnection->setConnections();
|
||||||
connect(activeConnection, SIGNAL(propertiesChanged(QString,QMap<QString,QVariant>)),
|
|
||||||
this, SLOT(activeConnectionPropertiesChanged(QString,QMap<QString,QVariant>)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString id = activeConnection->connection().path();
|
const QString id = activeConnection->connection().path();
|
||||||
@ -295,6 +284,11 @@ void QNetworkManagerEngine::interfacePropertiesChanged(const QString &path,
|
|||||||
if (activeConnection->state() == NM_ACTIVE_CONNECTION_STATE_ACTIVATED &&
|
if (activeConnection->state() == NM_ACTIVE_CONNECTION_STATE_ACTIVATED &&
|
||||||
ptr->state != QNetworkConfiguration::Active) {
|
ptr->state != QNetworkConfiguration::Active) {
|
||||||
ptr->state = QNetworkConfiguration::Active;
|
ptr->state = QNetworkConfiguration::Active;
|
||||||
|
|
||||||
|
if (activeConnectionsList.value(id) && activeConnectionsList.value(id)->defaultRoute()
|
||||||
|
&& managerInterface->state() < QNetworkManagerInterface::NM_STATE_CONNECTED_GLOBAL) {
|
||||||
|
ptr->purpose = QNetworkConfiguration::PrivatePurpose;
|
||||||
|
}
|
||||||
ptr->mutex.unlock();
|
ptr->mutex.unlock();
|
||||||
|
|
||||||
locker.unlock();
|
locker.unlock();
|
||||||
@ -307,7 +301,7 @@ void QNetworkManagerEngine::interfacePropertiesChanged(const QString &path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (!priorActiveConnections.isEmpty())
|
while (!priorActiveConnections.isEmpty())
|
||||||
delete this->activeConnections.take(priorActiveConnections.takeFirst());
|
delete activeConnectionsList.take(priorActiveConnections.takeFirst());
|
||||||
|
|
||||||
while (!identifiers.isEmpty()) {
|
while (!identifiers.isEmpty()) {
|
||||||
QNetworkConfigurationPrivatePointer ptr =
|
QNetworkConfigurationPrivatePointer ptr =
|
||||||
@ -330,14 +324,13 @@ void QNetworkManagerEngine::interfacePropertiesChanged(const QString &path,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QNetworkManagerEngine::activeConnectionPropertiesChanged(const QString &path,
|
void QNetworkManagerEngine::activeConnectionPropertiesChanged(const QMap<QString, QVariant> &properties)
|
||||||
const QMap<QString, QVariant> &properties)
|
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
|
|
||||||
Q_UNUSED(properties)
|
Q_UNUSED(properties)
|
||||||
|
|
||||||
QNetworkManagerConnectionActive *activeConnection = activeConnections.value(path);
|
QNetworkManagerConnectionActive *activeConnection = qobject_cast<QNetworkManagerConnectionActive *>(sender());
|
||||||
|
|
||||||
if (!activeConnection)
|
if (!activeConnection)
|
||||||
return;
|
return;
|
||||||
@ -347,8 +340,13 @@ void QNetworkManagerEngine::activeConnectionPropertiesChanged(const QString &pat
|
|||||||
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
|
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
ptr->mutex.lock();
|
ptr->mutex.lock();
|
||||||
if (activeConnection->state() == NM_ACTIVE_CONNECTION_STATE_ACTIVATED &&
|
if (properties.value("State").toUInt() == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
|
||||||
ptr->state != QNetworkConfiguration::Active) {
|
QStringList devices = activeConnection->devices();
|
||||||
|
if (!devices.isEmpty()) {
|
||||||
|
QNetworkManagerInterfaceDevice device(devices.at(0),this);
|
||||||
|
connectionInterfaces.insert(id,device.networkInterface());
|
||||||
|
}
|
||||||
|
|
||||||
ptr->state |= QNetworkConfiguration::Active;
|
ptr->state |= QNetworkConfiguration::Active;
|
||||||
ptr->mutex.unlock();
|
ptr->mutex.unlock();
|
||||||
|
|
||||||
@ -356,22 +354,17 @@ void QNetworkManagerEngine::activeConnectionPropertiesChanged(const QString &pat
|
|||||||
emit configurationChanged(ptr);
|
emit configurationChanged(ptr);
|
||||||
locker.relock();
|
locker.relock();
|
||||||
} else {
|
} else {
|
||||||
|
connectionInterfaces.remove(id);
|
||||||
ptr->mutex.unlock();
|
ptr->mutex.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QNetworkManagerEngine::devicePropertiesChanged(const QString &/*path*/,quint32 /*state*/)
|
void QNetworkManagerEngine::deviceConnectionsChanged(const QStringList &connectionsList)
|
||||||
{
|
|
||||||
// Q_UNUSED(path);
|
|
||||||
// Q_UNUSED(state)
|
|
||||||
}
|
|
||||||
|
|
||||||
void QNetworkManagerEngine::deviceConnectionsChanged(const QStringList &activeConnectionsList)
|
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
for (int i = 0; i < connections.count(); ++i) {
|
for (int i = 0; i < connections.count(); ++i) {
|
||||||
if (activeConnectionsList.contains(connections.at(i)->connectionInterface()->path()))
|
if (connectionsList.contains(connections.at(i)->connectionInterface()->path()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const QString settingsPath = connections.at(i)->connectionInterface()->path();
|
const QString settingsPath = connections.at(i)->connectionInterface()->path();
|
||||||
@ -392,33 +385,36 @@ void QNetworkManagerEngine::deviceConnectionsChanged(const QStringList &activeCo
|
|||||||
|
|
||||||
void QNetworkManagerEngine::deviceAdded(const QDBusObjectPath &path)
|
void QNetworkManagerEngine::deviceAdded(const QDBusObjectPath &path)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
|
||||||
QNetworkManagerInterfaceDevice *iDevice;
|
QNetworkManagerInterfaceDevice *iDevice;
|
||||||
iDevice = new QNetworkManagerInterfaceDevice(path.path(),this);
|
iDevice = new QNetworkManagerInterfaceDevice(path.path(),this);
|
||||||
connect(iDevice,SIGNAL(connectionsChanged(QStringList)),
|
connect(iDevice,SIGNAL(connectionsChanged(QStringList)),
|
||||||
this,SLOT(deviceConnectionsChanged(QStringList)));
|
this,SLOT(deviceConnectionsChanged(QStringList)));
|
||||||
|
|
||||||
connect(iDevice,SIGNAL(stateChanged(QString,quint32)),
|
|
||||||
this,SLOT(devicePropertiesChanged(QString,quint32)));
|
|
||||||
iDevice->setConnections();
|
iDevice->setConnections();
|
||||||
interfaceDevices.insert(path.path(),iDevice);
|
interfaceDevices.insert(path.path(),iDevice);
|
||||||
|
|
||||||
if (iDevice->deviceType() == DEVICE_TYPE_WIFI) {
|
if (iDevice->deviceType() == DEVICE_TYPE_WIFI) {
|
||||||
QNetworkManagerInterfaceDeviceWireless *wirelessDevice =
|
QNetworkManagerInterfaceDeviceWireless *wirelessDevice =
|
||||||
new QNetworkManagerInterfaceDeviceWireless(iDevice->connectionInterface()->path(),this);
|
new QNetworkManagerInterfaceDeviceWireless(iDevice->connectionInterface()->path(),this);
|
||||||
|
|
||||||
wirelessDevice->setConnections();
|
|
||||||
connect(wirelessDevice, SIGNAL(accessPointAdded(QString)),
|
connect(wirelessDevice, SIGNAL(accessPointAdded(QString)),
|
||||||
this, SLOT(newAccessPoint(QString)));
|
this, SLOT(newAccessPoint(QString)));
|
||||||
connect(wirelessDevice, SIGNAL(accessPointRemoved(QString)),
|
connect(wirelessDevice, SIGNAL(accessPointRemoved(QString)),
|
||||||
this, SLOT(removeAccessPoint(QString)));
|
this, SLOT(removeAccessPoint(QString)));
|
||||||
connect(wirelessDevice,SIGNAL(scanDone()),this,SLOT(scanFinished()));
|
connect(wirelessDevice,SIGNAL(scanDone()),this,SLOT(scanFinished()));
|
||||||
|
wirelessDevice->setConnections();
|
||||||
|
|
||||||
foreach (const QDBusObjectPath &apPath, wirelessDevice->getAccessPoints())
|
foreach (const QDBusObjectPath &apPath, wirelessDevice->getAccessPoints())
|
||||||
newAccessPoint(apPath.path());
|
newAccessPoint(apPath.path());
|
||||||
|
|
||||||
wirelessDevices.insert(path.path(), wirelessDevice);
|
wirelessDevices.insert(path.path(), wirelessDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (iDevice->deviceType() == DEVICE_TYPE_ETHERNET) {
|
||||||
|
QNetworkManagerInterfaceDeviceWired *wiredDevice =
|
||||||
|
new QNetworkManagerInterfaceDeviceWired(iDevice->connectionInterface()->path(),this);
|
||||||
|
connect(wiredDevice,SIGNAL(carrierChanged(bool)),this,SLOT(wiredCarrierChanged(bool)));
|
||||||
|
wiredDevices.insert(iDevice->connectionInterface()->path(), wiredDevice);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QNetworkManagerEngine::deviceRemoved(const QDBusObjectPath &path)
|
void QNetworkManagerEngine::deviceRemoved(const QDBusObjectPath &path)
|
||||||
@ -435,6 +431,41 @@ void QNetworkManagerEngine::deviceRemoved(const QDBusObjectPath &path)
|
|||||||
delete wirelessDevices.take(path.path());
|
delete wirelessDevices.take(path.path());
|
||||||
locker.relock();
|
locker.relock();
|
||||||
}
|
}
|
||||||
|
if (wiredDevices.contains(path.path())) {
|
||||||
|
locker.unlock();
|
||||||
|
delete wiredDevices.take(path.path());
|
||||||
|
locker.relock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QNetworkManagerEngine::wiredCarrierChanged(bool carrier)
|
||||||
|
{
|
||||||
|
QNetworkManagerInterfaceDeviceWired *deviceWired = qobject_cast<QNetworkManagerInterfaceDeviceWired *>(sender());
|
||||||
|
if (!deviceWired)
|
||||||
|
return;
|
||||||
|
QMutexLocker locker(&mutex);
|
||||||
|
foreach (const QDBusObjectPath &settingsPath, systemSettings->listConnections()) {
|
||||||
|
for (int i = 0; i < connections.count(); ++i) {
|
||||||
|
QNetworkManagerSettingsConnection *connection = connections.at(i);
|
||||||
|
if (connection->getType() == DEVICE_TYPE_ETHERNET
|
||||||
|
&& settingsPath.path() == connection->connectionInterface()->path()) {
|
||||||
|
QNetworkConfigurationPrivatePointer ptr =
|
||||||
|
accessPointConfigurations.value(settingsPath.path());
|
||||||
|
|
||||||
|
if (ptr) {
|
||||||
|
ptr->mutex.lock();
|
||||||
|
if (carrier)
|
||||||
|
ptr->state |= QNetworkConfiguration::Discovered;
|
||||||
|
else
|
||||||
|
ptr->state = QNetworkConfiguration::Defined;
|
||||||
|
ptr->mutex.unlock();
|
||||||
|
locker.unlock();
|
||||||
|
emit configurationChanged(ptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QNetworkManagerEngine::newConnection(const QDBusObjectPath &path,
|
void QNetworkManagerEngine::newConnection(const QDBusObjectPath &path,
|
||||||
@ -444,57 +475,72 @@ void QNetworkManagerEngine::newConnection(const QDBusObjectPath &path,
|
|||||||
if (!settings)
|
if (!settings)
|
||||||
settings = qobject_cast<QNetworkManagerSettings *>(sender());
|
settings = qobject_cast<QNetworkManagerSettings *>(sender());
|
||||||
|
|
||||||
if (!settings)
|
if (!settings) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
settings->deleteLater();
|
|
||||||
QNetworkManagerSettingsConnection *connection =
|
QNetworkManagerSettingsConnection *connection =
|
||||||
new QNetworkManagerSettingsConnection(settings->connectionInterface()->service(),
|
new QNetworkManagerSettingsConnection(settings->connectionInterface()->service(),
|
||||||
path.path(),this);
|
path.path(),this);
|
||||||
QString apPath;
|
const QString settingsPath = connection->connectionInterface()->path();
|
||||||
for (int i = 0; i < accessPoints.count(); ++i) {
|
if (accessPointConfigurations.contains(settingsPath)) {
|
||||||
if (connection->getSsid() == accessPoints.at(i)->ssid()) {
|
return;
|
||||||
// remove the corresponding accesspoint from configurations
|
|
||||||
apPath = accessPoints.at(i)->connectionInterface()->path();
|
|
||||||
|
|
||||||
QNetworkConfigurationPrivatePointer ptr
|
|
||||||
= accessPointConfigurations.take(apPath);
|
|
||||||
if (ptr) {
|
|
||||||
locker.unlock();
|
|
||||||
emit configurationRemoved(ptr);
|
|
||||||
locker.relock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
connections.append(connection);
|
connections.append(connection);
|
||||||
|
|
||||||
connect(connection,SIGNAL(removed(QString)),this,SLOT(removeConnection(QString)));
|
connect(connection,SIGNAL(removed(QString)),this,SLOT(removeConnection(QString)));
|
||||||
connect(connection,SIGNAL(updated()),this,SLOT(updateConnection()));
|
connect(connection,SIGNAL(updated()),this,SLOT(updateConnection()));
|
||||||
connection->setConnections();
|
connection->setConnections();
|
||||||
|
|
||||||
const QString settingsPath = connection->connectionInterface()->path();
|
NMDeviceType deviceType = connection->getType();
|
||||||
|
|
||||||
if (connection->getType() == DEVICE_TYPE_WIFI
|
if (deviceType == DEVICE_TYPE_WIFI) {
|
||||||
&& !configuredAccessPoints.contains(settingsPath))
|
QString apPath;
|
||||||
configuredAccessPoints.insert(apPath,settingsPath);
|
for (int i = 0; i < accessPoints.count(); ++i) {
|
||||||
|
if (connection->getSsid() == accessPoints.at(i)->ssid()) {
|
||||||
|
// remove the corresponding accesspoint from configurations
|
||||||
|
apPath = accessPoints.at(i)->connectionInterface()->path();
|
||||||
|
QNetworkConfigurationPrivatePointer ptr
|
||||||
|
= accessPointConfigurations.take(apPath);
|
||||||
|
if (ptr) {
|
||||||
|
locker.unlock();
|
||||||
|
emit configurationRemoved(ptr);
|
||||||
|
locker.relock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!configuredAccessPoints.contains(settingsPath))
|
||||||
|
configuredAccessPoints.insert(apPath,settingsPath);
|
||||||
|
}
|
||||||
|
|
||||||
QNetworkConfigurationPrivate *cpPriv =
|
QNetworkConfigurationPrivate *cpPriv =
|
||||||
parseConnection(settingsPath, connection->getSettings());
|
parseConnection(settingsPath, connection->getSettings());
|
||||||
|
|
||||||
// Check if connection is active.
|
// Check if connection is active.
|
||||||
foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) {
|
QHashIterator<QString, QNetworkManagerConnectionActive*> i(activeConnectionsList);
|
||||||
QNetworkManagerConnectionActive activeConnection(acPath.path());
|
while (i.hasNext()) {
|
||||||
|
i.next();
|
||||||
if (activeConnection.defaultRoute() &&
|
if (i.value()->connection().path() == settingsPath) {
|
||||||
activeConnection.connection().path() == settingsPath &&
|
|
||||||
activeConnection.state() == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
|
|
||||||
cpPriv->state |= QNetworkConfiguration::Active;
|
cpPriv->state |= QNetworkConfiguration::Active;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (deviceType == DEVICE_TYPE_ETHERNET) {
|
||||||
|
QHashIterator<QString, QNetworkManagerInterfaceDevice*> i(interfaceDevices);
|
||||||
|
while (i.hasNext()) {
|
||||||
|
i.next();
|
||||||
|
if (i.value()->deviceType() == deviceType) {
|
||||||
|
QNetworkManagerInterfaceDeviceWired *wiredDevice
|
||||||
|
= wiredDevices.value(i.value()->connectionInterface()->path());
|
||||||
|
if (wiredDevice->carrier()) {
|
||||||
|
cpPriv->state |= QNetworkConfiguration::Discovered;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
QNetworkConfigurationPrivatePointer ptr(cpPriv);
|
QNetworkConfigurationPrivatePointer ptr(cpPriv);
|
||||||
accessPointConfigurations.insert(ptr->id, ptr);
|
accessPointConfigurations.insert(ptr->id, ptr);
|
||||||
|
|
||||||
locker.unlock();
|
locker.unlock();
|
||||||
emit configurationAdded(ptr);
|
emit configurationAdded(ptr);
|
||||||
}
|
}
|
||||||
@ -505,6 +551,7 @@ void QNetworkManagerEngine::removeConnection(const QString &path)
|
|||||||
|
|
||||||
QNetworkManagerSettingsConnection *connection =
|
QNetworkManagerSettingsConnection *connection =
|
||||||
qobject_cast<QNetworkManagerSettingsConnection *>(sender());
|
qobject_cast<QNetworkManagerSettingsConnection *>(sender());
|
||||||
|
|
||||||
if (!connection)
|
if (!connection)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -525,6 +572,7 @@ void QNetworkManagerEngine::removeConnection(const QString &path)
|
|||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
i.next();
|
i.next();
|
||||||
if (i.value() == path) {
|
if (i.value() == path) {
|
||||||
|
configuredAccessPoints.remove(i.key());
|
||||||
newAccessPoint(i.key());
|
newAccessPoint(i.key());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -538,8 +586,6 @@ void QNetworkManagerEngine::updateConnection()
|
|||||||
qobject_cast<QNetworkManagerSettingsConnection *>(sender());
|
qobject_cast<QNetworkManagerSettingsConnection *>(sender());
|
||||||
if (!connection)
|
if (!connection)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
connection->deleteLater();
|
|
||||||
const QString settingsPath = connection->connectionInterface()->path();
|
const QString settingsPath = connection->connectionInterface()->path();
|
||||||
|
|
||||||
QNetworkConfigurationPrivate *cpPriv = parseConnection(settingsPath, connection->getSettings());
|
QNetworkConfigurationPrivate *cpPriv = parseConnection(settingsPath, connection->getSettings());
|
||||||
@ -575,10 +621,9 @@ void QNetworkManagerEngine::updateConnection()
|
|||||||
void QNetworkManagerEngine::activationFinished(QDBusPendingCallWatcher *watcher)
|
void QNetworkManagerEngine::activationFinished(QDBusPendingCallWatcher *watcher)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
|
QDBusPendingReply<QDBusObjectPath> reply(*watcher);
|
||||||
watcher->deleteLater();
|
watcher->deleteLater();
|
||||||
|
|
||||||
QDBusPendingReply<QDBusObjectPath> reply(*watcher);
|
|
||||||
if (!reply.isError()) {
|
if (!reply.isError()) {
|
||||||
QDBusObjectPath result = reply.value();
|
QDBusObjectPath result = reply.value();
|
||||||
|
|
||||||
@ -620,15 +665,14 @@ void QNetworkManagerEngine::newAccessPoint(const QString &path)
|
|||||||
if (okToAdd) {
|
if (okToAdd) {
|
||||||
accessPoints.append(accessPoint);
|
accessPoints.append(accessPoint);
|
||||||
accessPoint->setConnections();
|
accessPoint->setConnections();
|
||||||
connect(accessPoint, SIGNAL(propertiesChanged(QMap<QString,QVariant>)),
|
|
||||||
this, SLOT(updateAccessPoint(QMap<QString,QVariant>)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if configuration exists for connection.
|
// Check if configuration exists for connection.
|
||||||
if (!accessPoint->ssid().isEmpty()) {
|
if (!accessPoint->ssid().isEmpty()) {
|
||||||
|
|
||||||
for (int i = 0; i < connections.count(); ++i) {
|
for (int i = 0; i < connections.count(); ++i) {
|
||||||
QNetworkManagerSettingsConnection *connection = connections.at(i);
|
QNetworkManagerSettingsConnection *connection = connections.at(i);
|
||||||
const QString settingsPath = connection->connectionInterface()->path();
|
const QString settingsPath = connection->connectionInterface()->path();
|
||||||
|
|
||||||
if (accessPoint->ssid() == connection->getSsid()) {
|
if (accessPoint->ssid() == connection->getSsid()) {
|
||||||
if (!configuredAccessPoints.contains(path)) {
|
if (!configuredAccessPoints.contains(path)) {
|
||||||
configuredAccessPoints.insert(path,settingsPath);
|
configuredAccessPoints.insert(path,settingsPath);
|
||||||
@ -655,11 +699,7 @@ void QNetworkManagerEngine::newAccessPoint(const QString &path)
|
|||||||
ptr->isValid = true;
|
ptr->isValid = true;
|
||||||
ptr->id = path;
|
ptr->id = path;
|
||||||
ptr->type = QNetworkConfiguration::InternetAccessPoint;
|
ptr->type = QNetworkConfiguration::InternetAccessPoint;
|
||||||
if (accessPoint->flags() == NM_802_11_AP_FLAGS_PRIVACY) {
|
ptr->purpose = QNetworkConfiguration::PublicPurpose;
|
||||||
ptr->purpose = QNetworkConfiguration::PrivatePurpose;
|
|
||||||
} else {
|
|
||||||
ptr->purpose = QNetworkConfiguration::PublicPurpose;
|
|
||||||
}
|
|
||||||
ptr->state = QNetworkConfiguration::Undefined;
|
ptr->state = QNetworkConfiguration::Undefined;
|
||||||
ptr->bearerType = QNetworkConfiguration::BearerWLAN;
|
ptr->bearerType = QNetworkConfiguration::BearerWLAN;
|
||||||
|
|
||||||
@ -674,13 +714,13 @@ void QNetworkManagerEngine::removeAccessPoint(const QString &path)
|
|||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
for (int i = 0; i < accessPoints.count(); ++i) {
|
for (int i = 0; i < accessPoints.count(); ++i) {
|
||||||
QNetworkManagerInterfaceAccessPoint *accessPoint = accessPoints.at(i);
|
QNetworkManagerInterfaceAccessPoint *accessPoint = accessPoints.at(i);
|
||||||
|
|
||||||
if (accessPoint->connectionInterface()->path() == path) {
|
if (accessPoint->connectionInterface()->path() == path) {
|
||||||
accessPoints.removeOne(accessPoint);
|
accessPoints.removeOne(accessPoint);
|
||||||
|
|
||||||
if (configuredAccessPoints.contains(accessPoint->connectionInterface()->path())) {
|
if (configuredAccessPoints.contains(accessPoint->connectionInterface()->path())) {
|
||||||
// find connection and change state to Defined
|
// find connection and change state to Defined
|
||||||
configuredAccessPoints.remove(accessPoint->connectionInterface()->path());
|
configuredAccessPoints.remove(accessPoint->connectionInterface()->path());
|
||||||
|
|
||||||
for (int i = 0; i < connections.count(); ++i) {
|
for (int i = 0; i < connections.count(); ++i) {
|
||||||
QNetworkManagerSettingsConnection *connection = connections.at(i);
|
QNetworkManagerSettingsConnection *connection = connections.at(i);
|
||||||
|
|
||||||
@ -705,8 +745,6 @@ void QNetworkManagerEngine::removeAccessPoint(const QString &path)
|
|||||||
accessPointConfigurations.take(path);
|
accessPointConfigurations.take(path);
|
||||||
|
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
locker.unlock();
|
|
||||||
|
|
||||||
locker.unlock();
|
locker.unlock();
|
||||||
emit configurationRemoved(ptr);
|
emit configurationRemoved(ptr);
|
||||||
locker.relock();
|
locker.relock();
|
||||||
@ -718,42 +756,9 @@ void QNetworkManagerEngine::removeAccessPoint(const QString &path)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QNetworkManagerEngine::updateAccessPoint(const QMap<QString, QVariant> &map)
|
|
||||||
{
|
|
||||||
QMutexLocker locker(&mutex);
|
|
||||||
|
|
||||||
Q_UNUSED(map)
|
|
||||||
|
|
||||||
QNetworkManagerInterfaceAccessPoint *accessPoint =
|
|
||||||
qobject_cast<QNetworkManagerInterfaceAccessPoint *>(sender());
|
|
||||||
if (!accessPoint)
|
|
||||||
return;
|
|
||||||
accessPoint->deleteLater();
|
|
||||||
for (int i = 0; i < connections.count(); ++i) {
|
|
||||||
QNetworkManagerSettingsConnection *connection = connections.at(i);
|
|
||||||
|
|
||||||
if (accessPoint->ssid() == connection->getSsid()) {
|
|
||||||
const QString settingsPath = connection->connectionInterface()->path();
|
|
||||||
const QString connectionId = settingsPath;
|
|
||||||
|
|
||||||
QNetworkConfigurationPrivatePointer ptr =
|
|
||||||
accessPointConfigurations.value(connectionId);
|
|
||||||
ptr->mutex.lock();
|
|
||||||
QNetworkConfiguration::StateFlags flag = QNetworkConfiguration::Defined;
|
|
||||||
ptr->state = (flag | QNetworkConfiguration::Discovered);
|
|
||||||
ptr->mutex.unlock();
|
|
||||||
|
|
||||||
locker.unlock();
|
|
||||||
emit configurationChanged(ptr);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QString &settingsPath,
|
QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QString &settingsPath,
|
||||||
const QNmSettingsMap &map)
|
const QNmSettingsMap &map)
|
||||||
{
|
{
|
||||||
// Q_UNUSED(service);
|
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
QNetworkConfigurationPrivate *cpPriv = new QNetworkConfigurationPrivate;
|
QNetworkConfigurationPrivate *cpPriv = new QNetworkConfigurationPrivate;
|
||||||
cpPriv->name = map.value("connection").value("id").toString();
|
cpPriv->name = map.value("connection").value("id").toString();
|
||||||
@ -765,18 +770,16 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
|
|||||||
cpPriv->purpose = QNetworkConfiguration::PublicPurpose;
|
cpPriv->purpose = QNetworkConfiguration::PublicPurpose;
|
||||||
|
|
||||||
cpPriv->state = QNetworkConfiguration::Defined;
|
cpPriv->state = QNetworkConfiguration::Defined;
|
||||||
|
|
||||||
const QString connectionType = map.value("connection").value("type").toString();
|
const QString connectionType = map.value("connection").value("type").toString();
|
||||||
|
|
||||||
if (connectionType == QLatin1String("802-3-ethernet")) {
|
if (connectionType == QLatin1String("802-3-ethernet")) {
|
||||||
cpPriv->bearerType = QNetworkConfiguration::BearerEthernet;
|
cpPriv->bearerType = QNetworkConfiguration::BearerEthernet;
|
||||||
cpPriv->purpose = QNetworkConfiguration::PublicPurpose;
|
|
||||||
|
|
||||||
foreach (const QDBusObjectPath &devicePath, managerInterface->getDevices()) {
|
foreach (const QDBusObjectPath &devicePath, managerInterface->getDevices()) {
|
||||||
QNetworkManagerInterfaceDevice device(devicePath.path());
|
QNetworkManagerInterfaceDevice device(devicePath.path(),this);
|
||||||
if (device.deviceType() == DEVICE_TYPE_ETHERNET) {
|
if (device.deviceType() == DEVICE_TYPE_ETHERNET) {
|
||||||
QNetworkManagerInterfaceDeviceWired wiredDevice(device.connectionInterface()->path());
|
QNetworkManagerInterfaceDeviceWired *wiredDevice = wiredDevices.value(device.connectionInterface()->path());
|
||||||
if (wiredDevice.carrier()) {
|
if (wiredDevice->carrier()) {
|
||||||
cpPriv->state |= QNetworkConfiguration::Discovered;
|
cpPriv->state |= QNetworkConfiguration::Discovered;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -786,12 +789,6 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
|
|||||||
cpPriv->bearerType = QNetworkConfiguration::BearerWLAN;
|
cpPriv->bearerType = QNetworkConfiguration::BearerWLAN;
|
||||||
|
|
||||||
const QString connectionSsid = map.value("802-11-wireless").value("ssid").toString();
|
const QString connectionSsid = map.value("802-11-wireless").value("ssid").toString();
|
||||||
const QString connectionSecurity = map.value("802-11-wireless").value("security").toString();
|
|
||||||
if (!connectionSecurity.isEmpty()) {
|
|
||||||
cpPriv->purpose = QNetworkConfiguration::PrivatePurpose;
|
|
||||||
} else {
|
|
||||||
cpPriv->purpose = QNetworkConfiguration::PublicPurpose;
|
|
||||||
}
|
|
||||||
for (int i = 0; i < accessPoints.count(); ++i) {
|
for (int i = 0; i < accessPoints.count(); ++i) {
|
||||||
if (connectionSsid == accessPoints.at(i)->ssid()
|
if (connectionSsid == accessPoints.at(i)->ssid()
|
||||||
&& map.value("802-11-wireless").value("seen-bssids").toStringList().contains(accessPoints.at(i)->hwAddress())) {
|
&& map.value("802-11-wireless").value("seen-bssids").toStringList().contains(accessPoints.at(i)->hwAddress())) {
|
||||||
@ -814,30 +811,13 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
|
|||||||
}
|
}
|
||||||
} else if (connectionType == QLatin1String("gsm")) {
|
} else if (connectionType == QLatin1String("gsm")) {
|
||||||
|
|
||||||
foreach (const QDBusObjectPath &devicePath, managerInterface->getDevices()) {
|
const QString contextPath = map.value("connection").value("id").toString();
|
||||||
QNetworkManagerInterfaceDevice device(devicePath.path());
|
cpPriv->name = contextName(contextPath);
|
||||||
|
cpPriv->bearerType = currentBearerType(contextPath);
|
||||||
|
|
||||||
if (device.deviceType() == DEVICE_TYPE_MODEM) {
|
if (map.value("connection").contains("timestamp")) {
|
||||||
QNetworkManagerInterfaceDeviceModem deviceModem(device.connectionInterface()->path(),this);
|
cpPriv->state |= QNetworkConfiguration::Discovered;
|
||||||
switch (deviceModem.currentCapabilities()) {
|
|
||||||
case 2:
|
|
||||||
cpPriv->bearerType = QNetworkConfiguration::Bearer2G;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
cpPriv->bearerType = QNetworkConfiguration::Bearer3G;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
cpPriv->bearerType = QNetworkConfiguration::Bearer4G;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
cpPriv->bearerType = QNetworkConfiguration::BearerUnknown;
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cpPriv->purpose = QNetworkConfiguration::PrivatePurpose;
|
|
||||||
cpPriv->state |= QNetworkConfiguration::Discovered;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cpPriv;
|
return cpPriv;
|
||||||
@ -857,7 +837,6 @@ QNetworkManagerSettingsConnection *QNetworkManagerEngine::connectionFromId(const
|
|||||||
QNetworkSession::State QNetworkManagerEngine::sessionStateForId(const QString &id)
|
QNetworkSession::State QNetworkManagerEngine::sessionStateForId(const QString &id)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex);
|
QMutexLocker locker(&mutex);
|
||||||
|
|
||||||
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
|
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
|
||||||
|
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
@ -866,8 +845,8 @@ QNetworkSession::State QNetworkManagerEngine::sessionStateForId(const QString &i
|
|||||||
if (!ptr->isValid)
|
if (!ptr->isValid)
|
||||||
return QNetworkSession::Invalid;
|
return QNetworkSession::Invalid;
|
||||||
|
|
||||||
foreach (const QString &acPath, activeConnections.keys()) {
|
foreach (const QString &acPath, activeConnectionsList.keys()) {
|
||||||
QNetworkManagerConnectionActive *activeConnection = activeConnections.value(acPath);
|
QNetworkManagerConnectionActive *activeConnection = activeConnectionsList.value(acPath);
|
||||||
|
|
||||||
const QString identifier = activeConnection->connection().path();
|
const QString identifier = activeConnection->connection().path();
|
||||||
|
|
||||||
@ -899,7 +878,7 @@ quint64 QNetworkManagerEngine::bytesWritten(const QString &id)
|
|||||||
|
|
||||||
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
|
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
|
||||||
if (ptr && (ptr->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
|
if (ptr && (ptr->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
|
||||||
const QString networkInterface = getInterfaceFromId(id);
|
const QString networkInterface = connectionInterfaces.value(id);
|
||||||
if (!networkInterface.isEmpty()) {
|
if (!networkInterface.isEmpty()) {
|
||||||
const QString devFile = QLatin1String("/sys/class/net/") +
|
const QString devFile = QLatin1String("/sys/class/net/") +
|
||||||
networkInterface +
|
networkInterface +
|
||||||
@ -927,7 +906,7 @@ quint64 QNetworkManagerEngine::bytesReceived(const QString &id)
|
|||||||
|
|
||||||
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
|
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
|
||||||
if (ptr && (ptr->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
|
if (ptr && (ptr->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
|
||||||
const QString networkInterface = getInterfaceFromId(id);
|
const QString networkInterface = connectionInterfaces.value(id);
|
||||||
if (!networkInterface.isEmpty()) {
|
if (!networkInterface.isEmpty()) {
|
||||||
const QString devFile = QLatin1String("/sys/class/net/") +
|
const QString devFile = QLatin1String("/sys/class/net/") +
|
||||||
networkInterface +
|
networkInterface +
|
||||||
@ -974,9 +953,67 @@ QNetworkSessionPrivate *QNetworkManagerEngine::createSessionBackend()
|
|||||||
|
|
||||||
QNetworkConfigurationPrivatePointer QNetworkManagerEngine::defaultConfiguration()
|
QNetworkConfigurationPrivatePointer QNetworkManagerEngine::defaultConfiguration()
|
||||||
{
|
{
|
||||||
|
QHashIterator<QString, QNetworkManagerConnectionActive*> i(activeConnectionsList);
|
||||||
|
while (i.hasNext()) {
|
||||||
|
i.next();
|
||||||
|
QNetworkManagerConnectionActive *activeConnection = i.value();
|
||||||
|
if ((activeConnection->defaultRoute() || activeConnection->default6Route())) {
|
||||||
|
return accessPointConfigurations.value(activeConnection->connection().path());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return QNetworkConfigurationPrivatePointer();
|
return QNetworkConfigurationPrivatePointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QNetworkConfiguration::BearerType QNetworkManagerEngine::currentBearerType(const QString &id)
|
||||||
|
{
|
||||||
|
if (ofonoManager->isValid()) {
|
||||||
|
QString contextPart = id.section('/', -1);
|
||||||
|
|
||||||
|
QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
|
||||||
|
while (i.hasNext()) {
|
||||||
|
i.next();
|
||||||
|
QString contextPath = i.key() +"/"+contextPart;
|
||||||
|
if (i.value()->contexts().contains(contextPath)) {
|
||||||
|
|
||||||
|
QString bearer = i.value()->bearer();
|
||||||
|
if (bearer == QStringLiteral("gsm")) {
|
||||||
|
return QNetworkConfiguration::Bearer2G;
|
||||||
|
} else if (bearer == QStringLiteral("edge")) {
|
||||||
|
return QNetworkConfiguration::Bearer2G;
|
||||||
|
} else if (bearer == QStringLiteral("umts")) {
|
||||||
|
return QNetworkConfiguration::BearerWCDMA;
|
||||||
|
} else if (bearer == QStringLiteral("hspa")
|
||||||
|
|| bearer == QStringLiteral("hsdpa")
|
||||||
|
|| bearer == QStringLiteral("hsupa")) {
|
||||||
|
return QNetworkConfiguration::BearerHSPA;
|
||||||
|
} else if (bearer == QStringLiteral("lte")) {
|
||||||
|
return QNetworkConfiguration::BearerLTE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QNetworkConfiguration::BearerUnknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QNetworkManagerEngine::contextName(const QString &path)
|
||||||
|
{
|
||||||
|
if (ofonoManager->isValid()) {
|
||||||
|
QString contextPart = path.section('/', -1);
|
||||||
|
QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
|
||||||
|
while (i.hasNext()) {
|
||||||
|
i.next();
|
||||||
|
Q_FOREACH (const QString &oContext, i.value()->contexts()) {
|
||||||
|
if (oContext.contains(contextPart)) {
|
||||||
|
QOfonoConnectionContextInterface contextInterface(oContext,this);
|
||||||
|
return contextInterface.name();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_DBUS
|
#endif // QT_NO_DBUS
|
||||||
|
@ -49,6 +49,8 @@
|
|||||||
|
|
||||||
#include "qnetworkmanagerservice.h"
|
#include "qnetworkmanagerservice.h"
|
||||||
|
|
||||||
|
#include "../linux_common/qofonoservice_linux_p.h"
|
||||||
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
@ -89,11 +91,8 @@ public:
|
|||||||
QNetworkConfigurationPrivatePointer defaultConfiguration();
|
QNetworkConfigurationPrivatePointer defaultConfiguration();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void interfacePropertiesChanged(const QString &path,
|
void interfacePropertiesChanged(const QMap<QString, QVariant> &properties);
|
||||||
const QMap<QString, QVariant> &properties);
|
void activeConnectionPropertiesChanged(const QMap<QString, QVariant> &properties);
|
||||||
void activeConnectionPropertiesChanged(const QString &path,
|
|
||||||
const QMap<QString, QVariant> &properties);
|
|
||||||
void devicePropertiesChanged(const QString &path, quint32);
|
|
||||||
|
|
||||||
void deviceAdded(const QDBusObjectPath &path);
|
void deviceAdded(const QDBusObjectPath &path);
|
||||||
void deviceRemoved(const QDBusObjectPath &path);
|
void deviceRemoved(const QDBusObjectPath &path);
|
||||||
@ -106,9 +105,10 @@ private Q_SLOTS:
|
|||||||
|
|
||||||
void newAccessPoint(const QString &path);
|
void newAccessPoint(const QString &path);
|
||||||
void removeAccessPoint(const QString &path);
|
void removeAccessPoint(const QString &path);
|
||||||
void updateAccessPoint(const QMap<QString, QVariant> &map);
|
|
||||||
void scanFinished();
|
void scanFinished();
|
||||||
|
|
||||||
|
void wiredCarrierChanged(bool);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QNetworkConfigurationPrivate *parseConnection(const QString &settingsPath,
|
QNetworkConfigurationPrivate *parseConnection(const QString &settingsPath,
|
||||||
const QNmSettingsMap &map);
|
const QNmSettingsMap &map);
|
||||||
@ -116,14 +116,22 @@ private:
|
|||||||
|
|
||||||
QNetworkManagerInterface *managerInterface;
|
QNetworkManagerInterface *managerInterface;
|
||||||
QNetworkManagerSettings *systemSettings;
|
QNetworkManagerSettings *systemSettings;
|
||||||
QNetworkManagerSettings *userSettings;
|
QHash<QString, QNetworkManagerInterfaceDeviceWired *> wiredDevices;
|
||||||
QHash<QString, QNetworkManagerInterfaceDeviceWireless *> wirelessDevices;
|
QHash<QString, QNetworkManagerInterfaceDeviceWireless *> wirelessDevices;
|
||||||
QHash<QString, QNetworkManagerConnectionActive *> activeConnections;
|
|
||||||
|
QHash<QString, QNetworkManagerConnectionActive *> activeConnectionsList;
|
||||||
QList<QNetworkManagerSettingsConnection *> connections;
|
QList<QNetworkManagerSettingsConnection *> connections;
|
||||||
QList<QNetworkManagerInterfaceAccessPoint *> accessPoints;
|
QList<QNetworkManagerInterfaceAccessPoint *> accessPoints;
|
||||||
QHash<QString, QNetworkManagerInterfaceDevice *> interfaceDevices;
|
QHash<QString, QNetworkManagerInterfaceDevice *> interfaceDevices;
|
||||||
|
|
||||||
QMap<QString,QString> configuredAccessPoints; //ap, settings path
|
QMap<QString,QString> configuredAccessPoints; //ap, settings path
|
||||||
|
QHash<QString,QString> connectionInterfaces; // ac, interface
|
||||||
|
|
||||||
|
QOfonoManagerInterface *ofonoManager;
|
||||||
|
QHash <QString, QOfonoDataConnectionManagerInterface *> ofonoContextManagers;
|
||||||
|
QNetworkConfiguration::BearerType currentBearerType(const QString &id);
|
||||||
|
QString contextName(const QString &path);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -56,7 +56,6 @@
|
|||||||
#include <QtDBus/QDBusObjectPath>
|
#include <QtDBus/QDBusObjectPath>
|
||||||
#include <QtDBus/QDBusContext>
|
#include <QtDBus/QDBusContext>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include "qnmdbushelper.h"
|
|
||||||
|
|
||||||
#ifndef QT_NO_DBUS
|
#ifndef QT_NO_DBUS
|
||||||
|
|
||||||
@ -89,7 +88,7 @@ typedef enum
|
|||||||
NM_ACTIVE_CONNECTION_STATE_UNKNOWN = 0,
|
NM_ACTIVE_CONNECTION_STATE_UNKNOWN = 0,
|
||||||
NM_ACTIVE_CONNECTION_STATE_ACTIVATING,
|
NM_ACTIVE_CONNECTION_STATE_ACTIVATING,
|
||||||
NM_ACTIVE_CONNECTION_STATE_ACTIVATED,
|
NM_ACTIVE_CONNECTION_STATE_ACTIVATED,
|
||||||
NM_ACTIVE_CONNECTION_STATE_DEACTIVATED
|
NM_ACTIVE_CONNECTION_STATE_DEACTIVATED = 4
|
||||||
} NMActiveConnectionState;
|
} NMActiveConnectionState;
|
||||||
|
|
||||||
#define NM_DBUS_SERVICE "org.freedesktop.NetworkManager"
|
#define NM_DBUS_SERVICE "org.freedesktop.NetworkManager"
|
||||||
@ -135,12 +134,23 @@ class QNetworkManagerInterface : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
NM_STATE_UNKNOWN = 0,
|
||||||
|
NM_STATE_ASLEEP = 10,
|
||||||
|
NM_STATE_DISCONNECTED = 20,
|
||||||
|
NM_STATE_DISCONNECTING = 30,
|
||||||
|
NM_STATE_CONNECTING = 40,
|
||||||
|
NM_STATE_CONNECTED_LOCAL = 50,
|
||||||
|
NM_STATE_CONNECTED_SITE = 60,
|
||||||
|
NM_STATE_CONNECTED_GLOBAL = 70
|
||||||
|
} NMState;
|
||||||
|
|
||||||
QNetworkManagerInterface(QObject *parent = 0);
|
QNetworkManagerInterface(QObject *parent = 0);
|
||||||
~QNetworkManagerInterface();
|
~QNetworkManagerInterface();
|
||||||
|
|
||||||
QList <QDBusObjectPath> getDevices() const;
|
QList <QDBusObjectPath> getDevices();
|
||||||
void activateConnection(const QString &serviceName, QDBusObjectPath connection, QDBusObjectPath device, QDBusObjectPath specificObject);
|
void activateConnection(QDBusObjectPath connection,QDBusObjectPath device, QDBusObjectPath specificObject);
|
||||||
void deactivateConnection(QDBusObjectPath connectionPath) const;
|
void deactivateConnection(QDBusObjectPath connectionPath) const;
|
||||||
|
|
||||||
QDBusObjectPath path() const;
|
QDBusObjectPath path() const;
|
||||||
@ -149,21 +159,28 @@ public:
|
|||||||
bool wirelessEnabled() const;
|
bool wirelessEnabled() const;
|
||||||
bool wirelessHardwareEnabled() const;
|
bool wirelessHardwareEnabled() const;
|
||||||
QList <QDBusObjectPath> activeConnections() const;
|
QList <QDBusObjectPath> activeConnections() const;
|
||||||
quint32 state();
|
NMState state();
|
||||||
|
QString version() const;
|
||||||
bool setConnections();
|
bool setConnections();
|
||||||
bool isValid();
|
bool isValid();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void deviceAdded(QDBusObjectPath);
|
void deviceAdded(QDBusObjectPath);
|
||||||
void deviceRemoved(QDBusObjectPath);
|
void deviceRemoved(QDBusObjectPath);
|
||||||
void propertiesChanged( const QString &, QMap<QString,QVariant>);
|
void propertiesChanged(QMap<QString,QVariant>);
|
||||||
void stateChanged(const QString&, quint32);
|
void stateChanged(quint32);
|
||||||
void activationFinished(QDBusPendingCallWatcher*);
|
void activationFinished(QDBusPendingCallWatcher*);
|
||||||
|
void propertiesReady();
|
||||||
|
void devicesListReady();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void propertiesSwap(QMap<QString,QVariant>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QNetworkManagerInterfacePrivate *d;
|
QNetworkManagerInterfacePrivate *d;
|
||||||
QNmDBusHelper *nmDBusHelper;
|
QVariantMap propertyMap;
|
||||||
|
QList<QDBusObjectPath> devicesPathList;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QNetworkManagerInterfaceAccessPointPrivate;
|
class QNetworkManagerInterfaceAccessPointPrivate;
|
||||||
@ -228,11 +245,14 @@ public:
|
|||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void propertiesChanged(QMap <QString,QVariant>);
|
void propertiesChanged(QMap <QString,QVariant>);
|
||||||
void propertiesChanged( const QString &, QMap<QString,QVariant>);
|
void propertiesReady();
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void propertiesSwap(QMap<QString,QVariant>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QNetworkManagerInterfaceAccessPointPrivate *d;
|
QNetworkManagerInterfaceAccessPointPrivate *d;
|
||||||
QNmDBusHelper *nmDBusHelper;
|
QVariantMap propertyMap;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QNetworkManagerInterfaceDevicePrivate;
|
class QNetworkManagerInterfaceDevicePrivate;
|
||||||
@ -258,11 +278,14 @@ public:
|
|||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void stateChanged(const QString &, quint32);
|
void stateChanged(const QString &, quint32);
|
||||||
void propertiesChanged(const QString &, QMap<QString,QVariant>);
|
void propertiesChanged(QMap<QString,QVariant>);
|
||||||
void connectionsChanged(QStringList);
|
void connectionsChanged(QStringList);
|
||||||
|
void propertiesReady();
|
||||||
|
private Q_SLOTS:
|
||||||
|
void propertiesSwap(QMap<QString,QVariant>);
|
||||||
private:
|
private:
|
||||||
QNetworkManagerInterfaceDevicePrivate *d;
|
QNetworkManagerInterfaceDevicePrivate *d;
|
||||||
QNmDBusHelper *nmDBusHelper;
|
QVariantMap propertyMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QNetworkManagerInterfaceDeviceWiredPrivate;
|
class QNetworkManagerInterfaceDeviceWiredPrivate;
|
||||||
@ -282,12 +305,19 @@ public:
|
|||||||
bool carrier() const;
|
bool carrier() const;
|
||||||
bool setConnections();
|
bool setConnections();
|
||||||
bool isValid();
|
bool isValid();
|
||||||
|
QStringList availableConnections();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void propertiesChanged( const QString &, QMap<QString,QVariant>);
|
void propertiesChanged(QMap<QString,QVariant>);
|
||||||
|
void propertiesReady();
|
||||||
|
void carrierChanged(bool);
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void propertiesSwap(QMap<QString,QVariant>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QNetworkManagerInterfaceDeviceWiredPrivate *d;
|
QNetworkManagerInterfaceDeviceWiredPrivate *d;
|
||||||
QNmDBusHelper *nmDBusHelper;
|
QVariantMap propertyMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QNetworkManagerInterfaceDeviceWirelessPrivate;
|
class QNetworkManagerInterfaceDeviceWirelessPrivate;
|
||||||
@ -325,15 +355,24 @@ public:
|
|||||||
|
|
||||||
void requestScan();
|
void requestScan();
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void propertiesChanged( const QString &, QMap<QString,QVariant>);
|
void propertiesChanged(QMap<QString,QVariant>);
|
||||||
void accessPointAdded(const QString &);
|
void accessPointAdded(const QString &);
|
||||||
void accessPointRemoved(const QString &);
|
void accessPointRemoved(const QString &);
|
||||||
void scanDone();
|
void scanDone();
|
||||||
|
void propertiesReady();
|
||||||
|
void accessPointsReady();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void scanIsDone();
|
void scanIsDone();
|
||||||
|
void propertiesSwap(QMap<QString,QVariant>);
|
||||||
|
|
||||||
|
void slotAccessPointAdded(QDBusObjectPath);
|
||||||
|
void slotAccessPointRemoved(QDBusObjectPath);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QNetworkManagerInterfaceDeviceWirelessPrivate *d;
|
QNetworkManagerInterfaceDeviceWirelessPrivate *d;
|
||||||
QNmDBusHelper *nmDBusHelper;
|
QVariantMap propertyMap;
|
||||||
|
QList <QDBusObjectPath> accessPointsList;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QNetworkManagerInterfaceDeviceModemPrivate;
|
class QNetworkManagerInterfaceDeviceModemPrivate;
|
||||||
@ -350,6 +389,7 @@ public:
|
|||||||
Gsm_Umts = 0x4,
|
Gsm_Umts = 0x4,
|
||||||
Lte = 0x08
|
Lte = 0x08
|
||||||
};
|
};
|
||||||
|
Q_DECLARE_FLAGS(ModemCapabilities, ModemCapability)
|
||||||
|
|
||||||
explicit QNetworkManagerInterfaceDeviceModem(const QString &ifaceDevicePath,
|
explicit QNetworkManagerInterfaceDeviceModem(const QString &ifaceDevicePath,
|
||||||
QObject *parent = 0);
|
QObject *parent = 0);
|
||||||
@ -361,16 +401,22 @@ public:
|
|||||||
bool setConnections();
|
bool setConnections();
|
||||||
bool isValid();
|
bool isValid();
|
||||||
|
|
||||||
quint32 modemCapabilities() const;
|
ModemCapabilities modemCapabilities() const;
|
||||||
quint32 currentCapabilities() const;
|
ModemCapabilities currentCapabilities() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void propertiesChanged( const QString &, QMap<QString,QVariant>);
|
void propertiesChanged(QMap<QString,QVariant>);
|
||||||
|
void propertiesReady();
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void propertiesSwap(QMap<QString,QVariant>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QNetworkManagerInterfaceDeviceModemPrivate *d;
|
QNetworkManagerInterfaceDeviceModemPrivate *d;
|
||||||
QNmDBusHelper *nmDBusHelper;
|
QVariantMap propertyMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_OPERATORS_FOR_FLAGS(QNetworkManagerInterfaceDeviceModem::ModemCapabilities)
|
||||||
|
|
||||||
class QNetworkManagerSettingsPrivate;
|
class QNetworkManagerSettingsPrivate;
|
||||||
class QNetworkManagerSettings : public QObject
|
class QNetworkManagerSettings : public QObject
|
||||||
@ -390,8 +436,10 @@ public:
|
|||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void newConnection(QDBusObjectPath);
|
void newConnection(QDBusObjectPath);
|
||||||
|
void connectionsListReady();
|
||||||
private:
|
private:
|
||||||
QNetworkManagerSettingsPrivate *d;
|
QNetworkManagerSettingsPrivate *d;
|
||||||
|
QList <QDBusObjectPath> connectionsList;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QNetworkManagerSettingsConnectionPrivate;
|
class QNetworkManagerSettingsConnectionPrivate;
|
||||||
@ -418,12 +466,14 @@ public:
|
|||||||
bool isValid();
|
bool isValid();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
|
||||||
void updated();
|
void updated();
|
||||||
void removed(const QString &path);
|
void removed(const QString &path);
|
||||||
|
void settingsReady();
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void slotSettingsRemoved();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QNmDBusHelper *nmDBusHelper;
|
|
||||||
QNetworkManagerSettingsConnectionPrivate *d;
|
QNetworkManagerSettingsConnectionPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -444,22 +494,26 @@ public:
|
|||||||
~ QNetworkManagerConnectionActive();
|
~ QNetworkManagerConnectionActive();
|
||||||
|
|
||||||
QDBusInterface *connectionInterface() const;
|
QDBusInterface *connectionInterface() const;
|
||||||
QString serviceName() const;
|
|
||||||
QDBusObjectPath connection() const;
|
QDBusObjectPath connection() const;
|
||||||
QDBusObjectPath specificObject() const;
|
QDBusObjectPath specificObject() const;
|
||||||
QList<QDBusObjectPath> devices() const;
|
QStringList devices() const;
|
||||||
quint32 state() const;
|
quint32 state() const;
|
||||||
bool defaultRoute() const;
|
bool defaultRoute() const;
|
||||||
|
bool default6Route() const;
|
||||||
bool setConnections();
|
bool setConnections();
|
||||||
bool isValid();
|
bool isValid();
|
||||||
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void propertiesChanged(QList<QDBusObjectPath>);
|
void propertiesChanged(QMap<QString,QVariant>);
|
||||||
void propertiesChanged( const QString &, QMap<QString,QVariant>);
|
void propertiesReady();
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void propertiesSwap(QMap<QString,QVariant>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QNetworkManagerConnectionActivePrivate *d;
|
QNetworkManagerConnectionActivePrivate *d;
|
||||||
QNmDBusHelper *nmDBusHelper;
|
QVariantMap propertyMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QNetworkManagerIp4ConfigPrivate;
|
class QNetworkManagerIp4ConfigPrivate;
|
||||||
|
@ -1,140 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:LGPL21$
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
** following information to ensure the GNU Lesser General Public License
|
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
// this class is for helping qdbus get stuff
|
|
||||||
|
|
||||||
#include "qnmdbushelper.h"
|
|
||||||
|
|
||||||
#include "qnetworkmanagerservice.h"
|
|
||||||
|
|
||||||
#include <QDBusError>
|
|
||||||
#include <QDBusInterface>
|
|
||||||
#include <QDBusMessage>
|
|
||||||
#include <QDBusReply>
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
#ifndef QT_NO_DBUS
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
QNmDBusHelper::QNmDBusHelper(QObject * parent)
|
|
||||||
: QObject(parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QNmDBusHelper::~QNmDBusHelper()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void QNmDBusHelper::deviceStateChanged(quint32 state)
|
|
||||||
{
|
|
||||||
QDBusMessage msg = this->message();
|
|
||||||
if (state == NM_DEVICE_STATE_ACTIVATED
|
|
||||||
|| state == NM_DEVICE_STATE_DISCONNECTED
|
|
||||||
|| state == NM_DEVICE_STATE_UNAVAILABLE
|
|
||||||
|| state == NM_DEVICE_STATE_FAILED) {
|
|
||||||
emit pathForStateChanged(msg.path(), state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QNmDBusHelper::slotAccessPointAdded(QDBusObjectPath path)
|
|
||||||
{
|
|
||||||
if (path.path().length() > 2)
|
|
||||||
emit pathForAccessPointAdded(path.path());
|
|
||||||
}
|
|
||||||
|
|
||||||
void QNmDBusHelper::slotAccessPointRemoved(QDBusObjectPath path)
|
|
||||||
{
|
|
||||||
if (path.path().length() > 2)
|
|
||||||
emit pathForAccessPointRemoved(path.path());
|
|
||||||
}
|
|
||||||
|
|
||||||
void QNmDBusHelper::slotPropertiesChanged(QMap<QString,QVariant> map)
|
|
||||||
{
|
|
||||||
QDBusMessage msg = this->message();
|
|
||||||
QMapIterator<QString, QVariant> i(map);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
if (i.key() == QStringLiteral("State")) {
|
|
||||||
quint32 state = i.value().toUInt();
|
|
||||||
if (state == NM_DEVICE_STATE_ACTIVATED
|
|
||||||
|| state == NM_DEVICE_STATE_DISCONNECTED
|
|
||||||
|| state == NM_DEVICE_STATE_UNAVAILABLE
|
|
||||||
|| state == NM_DEVICE_STATE_FAILED) {
|
|
||||||
emit pathForPropertiesChanged(msg.path(), map);
|
|
||||||
}
|
|
||||||
} else if (i.key() == QStringLiteral("ActiveAccessPoint")) {
|
|
||||||
emit pathForPropertiesChanged(msg.path(), map);
|
|
||||||
} else if (i.key() == QStringLiteral("ActiveConnections")) {
|
|
||||||
emit pathForPropertiesChanged(msg.path(), map);
|
|
||||||
} else if (i.key() == QStringLiteral("AvailableConnections")) {
|
|
||||||
const QDBusArgument &dbusArgs = i.value().value<QDBusArgument>();
|
|
||||||
QDBusObjectPath path;
|
|
||||||
QStringList paths;
|
|
||||||
dbusArgs.beginArray();
|
|
||||||
while (!dbusArgs.atEnd()) {
|
|
||||||
dbusArgs >> path;
|
|
||||||
paths << path.path();
|
|
||||||
}
|
|
||||||
dbusArgs.endArray();
|
|
||||||
emit pathForConnectionsChanged(paths);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QNmDBusHelper::slotSettingsRemoved()
|
|
||||||
{
|
|
||||||
QDBusMessage msg = this->message();
|
|
||||||
emit pathForSettingsRemoved(msg.path());
|
|
||||||
}
|
|
||||||
|
|
||||||
void QNmDBusHelper::activeConnectionPropertiesChanged(QMap<QString,QVariant> map)
|
|
||||||
{
|
|
||||||
QDBusMessage msg = this->message();
|
|
||||||
QMapIterator<QString, QVariant> i(map);
|
|
||||||
while (i.hasNext()) {
|
|
||||||
i.next();
|
|
||||||
if (i.key() == QStringLiteral("State")) {
|
|
||||||
quint32 state = i.value().toUInt();
|
|
||||||
if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED
|
|
||||||
|| state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED) {
|
|
||||||
emit pathForPropertiesChanged(msg.path(), map);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // QT_NO_DBUS
|
|
@ -1,73 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/legal
|
|
||||||
**
|
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:LGPL21$
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and Digia. For licensing terms and
|
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
|
||||||
** use the contact form at http://qt.digia.com/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
** following information to ensure the GNU Lesser General Public License
|
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, Digia gives you certain additional
|
|
||||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef QNMDBUSHELPERPRIVATE_H
|
|
||||||
#define QNMDBUSHELPERPRIVATE_H
|
|
||||||
|
|
||||||
#include <QDBusObjectPath>
|
|
||||||
#include <QDBusContext>
|
|
||||||
#include <QMap>
|
|
||||||
|
|
||||||
#ifndef QT_NO_DBUS
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
class QNmDBusHelper: public QObject, protected QDBusContext
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
QNmDBusHelper(QObject *parent = 0);
|
|
||||||
~QNmDBusHelper();
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void deviceStateChanged(quint32);
|
|
||||||
void slotAccessPointAdded(QDBusObjectPath);
|
|
||||||
void slotAccessPointRemoved(QDBusObjectPath);
|
|
||||||
void slotPropertiesChanged(QMap<QString,QVariant>);
|
|
||||||
void slotSettingsRemoved();
|
|
||||||
void activeConnectionPropertiesChanged(QMap<QString,QVariant>);
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
|
||||||
void pathForStateChanged(const QString &, quint32);
|
|
||||||
void pathForAccessPointAdded(const QString &);
|
|
||||||
void pathForAccessPointRemoved(const QString &);
|
|
||||||
void pathForPropertiesChanged(const QString &, QMap<QString,QVariant>);
|
|
||||||
void pathForSettingsRemoved(const QString &);
|
|
||||||
void pathForConnectionsChanged(const QStringList &pathsList);
|
|
||||||
};
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // QT_NO_DBUS
|
|
||||||
|
|
||||||
#endif// QNMDBUSHELPERPRIVATE_H
|
|
@ -366,7 +366,8 @@ void QNetworkSessionPrivateImpl::networkConfigurationsChanged()
|
|||||||
else
|
else
|
||||||
updateStateFromActiveConfig();
|
updateStateFromActiveConfig();
|
||||||
|
|
||||||
startTime = engine->startTime(activeConfig.identifier());
|
if (engine)
|
||||||
|
startTime = engine->startTime(activeConfig.identifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QNetworkSessionPrivateImpl::configurationChanged(QNetworkConfigurationPrivatePointer config)
|
void QNetworkSessionPrivateImpl::configurationChanged(QNetworkConfigurationPrivatePointer config)
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qibustypes.h"
|
#include "qibustypes.h"
|
||||||
#include <qtextformat.h>
|
|
||||||
#include <QtDBus>
|
#include <QtDBus>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
|
||||||
@ -134,7 +133,7 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusAttribute &a
|
|||||||
return argument;
|
return argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextFormat QIBusAttribute::format() const
|
QTextCharFormat QIBusAttribute::format() const
|
||||||
{
|
{
|
||||||
QTextCharFormat fmt;
|
QTextCharFormat fmt;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -225,11 +224,32 @@ const QDBusArgument &operator>>(const QDBusArgument &arg, QIBusAttributeList &at
|
|||||||
|
|
||||||
QList<QInputMethodEvent::Attribute> QIBusAttributeList::imAttributes() const
|
QList<QInputMethodEvent::Attribute> QIBusAttributeList::imAttributes() const
|
||||||
{
|
{
|
||||||
QList<QInputMethodEvent::Attribute> imAttrs;
|
QHash<QPair<int, int>, QTextCharFormat> rangeAttrs;
|
||||||
|
|
||||||
|
// Merge text fomats for identical ranges into a single QTextFormat.
|
||||||
for (int i = 0; i < attributes.size(); ++i) {
|
for (int i = 0; i < attributes.size(); ++i) {
|
||||||
const QIBusAttribute &attr = attributes.at(i);
|
const QIBusAttribute &attr = attributes.at(i);
|
||||||
imAttrs += QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, attr.start, attr.end - attr.start, attr.format());
|
const QTextCharFormat &format = attr.format();
|
||||||
|
|
||||||
|
if (format.isValid()) {
|
||||||
|
const QPair<int, int> range(attr.start, attr.end);
|
||||||
|
rangeAttrs[range].merge(format);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Assemble list in original attribute order.
|
||||||
|
QList<QInputMethodEvent::Attribute> imAttrs;
|
||||||
|
|
||||||
|
for (int i = 0; i < attributes.size(); ++i) {
|
||||||
|
const QIBusAttribute &attr = attributes.at(i);
|
||||||
|
const QTextFormat &format = attr.format();
|
||||||
|
|
||||||
|
imAttrs += QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat,
|
||||||
|
attr.start,
|
||||||
|
attr.end - attr.start,
|
||||||
|
format.isValid() ? rangeAttrs[QPair<int, int>(attr.start, attr.end)] : format);
|
||||||
|
}
|
||||||
|
|
||||||
return imAttrs;
|
return imAttrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <qvector.h>
|
#include <qvector.h>
|
||||||
#include <qevent.h>
|
#include <qevent.h>
|
||||||
#include <QDBusArgument>
|
#include <QDBusArgument>
|
||||||
|
#include <QTextCharFormat>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ public:
|
|||||||
QIBusAttribute();
|
QIBusAttribute();
|
||||||
~QIBusAttribute();
|
~QIBusAttribute();
|
||||||
|
|
||||||
QTextFormat format() const;
|
QTextCharFormat format() const;
|
||||||
|
|
||||||
Type type;
|
Type type;
|
||||||
quint32 value;
|
quint32 value;
|
||||||
|
@ -268,6 +268,7 @@ public: // for QNSView
|
|||||||
|
|
||||||
bool m_inConstructor;
|
bool m_inConstructor;
|
||||||
bool m_inSetVisible;
|
bool m_inSetVisible;
|
||||||
|
bool m_inSetGeometry;
|
||||||
#ifndef QT_NO_OPENGL
|
#ifndef QT_NO_OPENGL
|
||||||
QCocoaGLContext *m_glContext;
|
QCocoaGLContext *m_glContext;
|
||||||
#endif
|
#endif
|
||||||
|
@ -381,6 +381,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
|
|||||||
, m_windowUnderMouse(false)
|
, m_windowUnderMouse(false)
|
||||||
, m_inConstructor(true)
|
, m_inConstructor(true)
|
||||||
, m_inSetVisible(false)
|
, m_inSetVisible(false)
|
||||||
|
, m_inSetGeometry(false)
|
||||||
#ifndef QT_NO_OPENGL
|
#ifndef QT_NO_OPENGL
|
||||||
, m_glContext(0)
|
, m_glContext(0)
|
||||||
#endif
|
#endif
|
||||||
@ -470,6 +471,8 @@ QSurfaceFormat QCocoaWindow::format() const
|
|||||||
|
|
||||||
void QCocoaWindow::setGeometry(const QRect &rectIn)
|
void QCocoaWindow::setGeometry(const QRect &rectIn)
|
||||||
{
|
{
|
||||||
|
QBoolBlocker inSetGeometry(m_inSetGeometry, true);
|
||||||
|
|
||||||
QRect rect = rectIn;
|
QRect rect = rectIn;
|
||||||
// This means it is a call from QWindow::setFramePosition() and
|
// This means it is a call from QWindow::setFramePosition() and
|
||||||
// the coordinates include the frame (size is still the contents rectangle).
|
// the coordinates include the frame (size is still the contents rectangle).
|
||||||
@ -1754,6 +1757,11 @@ void QCocoaWindow::updateExposedGeometry()
|
|||||||
if (!m_geometryUpdateExposeAllowed)
|
if (!m_geometryUpdateExposeAllowed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Do not send incorrect exposes in case the window is not even visible yet.
|
||||||
|
// We might get here as a result of a resize() from QWidget's show(), for instance.
|
||||||
|
if (!window()->isVisible())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!isWindowExposable())
|
if (!isWindowExposable())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -361,12 +361,11 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
|
|||||||
// Send a geometry change event to Qt, if it's ready to handle events
|
// Send a geometry change event to Qt, if it's ready to handle events
|
||||||
if (!m_platformWindow->m_inConstructor) {
|
if (!m_platformWindow->m_inConstructor) {
|
||||||
QWindowSystemInterface::handleGeometryChange(m_window, geometry);
|
QWindowSystemInterface::handleGeometryChange(m_window, geometry);
|
||||||
// Do not send incorrect exposes in case the window is not even visible yet.
|
m_platformWindow->updateExposedGeometry();
|
||||||
// We might get here as a result of a resize() from QWidget's show(), for instance.
|
// Guard against processing window system events during QWindow::setGeometry
|
||||||
if (m_platformWindow->window()->isVisible()) {
|
// calles, which Qt and Qt applications do not excpect.
|
||||||
m_platformWindow->updateExposedGeometry();
|
if (!m_platformWindow->m_inSetGeometry)
|
||||||
QWindowSystemInterface::flushWindowSystemEvents();
|
QWindowSystemInterface::flushWindowSystemEvents();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -603,7 +602,8 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
|
|||||||
{
|
{
|
||||||
if (m_window->flags() & Qt::WindowTransparentForInput)
|
if (m_window->flags() & Qt::WindowTransparentForInput)
|
||||||
return NO;
|
return NO;
|
||||||
QWindowSystemInterface::handleWindowActivated([self topLevelWindow]);
|
if (!m_platformWindow->windowIsPopupType())
|
||||||
|
QWindowSystemInterface::handleWindowActivated([self topLevelWindow]);
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -662,6 +662,19 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
|
|||||||
m_frameStrutButtons = Qt::NoButton;
|
m_frameStrutButtons = Qt::NoButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSPoint) screenMousePoint:(NSEvent *)theEvent
|
||||||
|
{
|
||||||
|
NSPoint screenPoint;
|
||||||
|
if (theEvent) {
|
||||||
|
NSPoint windowPoint = [theEvent locationInWindow];
|
||||||
|
NSRect screenRect = [[theEvent window] convertRectToScreen:NSMakeRect(windowPoint.x, windowPoint.y, 1, 1)];
|
||||||
|
screenPoint = screenRect.origin;
|
||||||
|
} else {
|
||||||
|
screenPoint = [NSEvent mouseLocation];
|
||||||
|
}
|
||||||
|
return screenPoint;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)handleMouseEvent:(NSEvent *)theEvent
|
- (void)handleMouseEvent:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
[self handleTabletEvent: theEvent];
|
[self handleTabletEvent: theEvent];
|
||||||
@ -676,23 +689,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
|
|||||||
m_platformWindow->m_forwardWindow = 0;
|
m_platformWindow->m_forwardWindow = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSPoint globalPos = [NSEvent mouseLocation];
|
[targetView convertFromScreen:[self screenMousePoint:theEvent] toWindowPoint:&qtWindowPoint andScreenPoint:&qtScreenPoint];
|
||||||
|
|
||||||
if ([self.window parentWindow]
|
|
||||||
&& (theEvent.type == NSLeftMouseDragged || theEvent.type == NSLeftMouseUp)) {
|
|
||||||
// QToolBar can be implemented as a child window on top of its main window
|
|
||||||
// (with a borderless NSWindow). If an option "unified toolbar" set on the main window,
|
|
||||||
// it's possible to drag such a window using this toolbar.
|
|
||||||
// While handling mouse drag events, QToolBar moves the window (QWidget::move).
|
|
||||||
// In such a combination [NSEvent mouseLocation] is very different from the
|
|
||||||
// real event location and as a result a window will move chaotically.
|
|
||||||
NSPoint winPoint = [theEvent locationInWindow];
|
|
||||||
NSRect tmpRect = NSMakeRect(winPoint.x, winPoint.y, 1., 1.);
|
|
||||||
tmpRect = [[theEvent window] convertRectToScreen:tmpRect];
|
|
||||||
globalPos = tmpRect.origin;
|
|
||||||
}
|
|
||||||
|
|
||||||
[targetView convertFromScreen:globalPos toWindowPoint:&qtWindowPoint andScreenPoint:&qtScreenPoint];
|
|
||||||
ulong timestamp = [theEvent timestamp] * 1000;
|
ulong timestamp = [theEvent timestamp] * 1000;
|
||||||
|
|
||||||
QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
|
QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
|
||||||
@ -865,7 +862,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
|
|||||||
|
|
||||||
QPointF windowPoint;
|
QPointF windowPoint;
|
||||||
QPointF screenPoint;
|
QPointF screenPoint;
|
||||||
[self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
[self convertFromScreen:[self screenMousePoint:theEvent] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
||||||
QWindow *childWindow = m_platformWindow->childWindowAt(windowPoint.toPoint());
|
QWindow *childWindow = m_platformWindow->childWindowAt(windowPoint.toPoint());
|
||||||
|
|
||||||
// Top-level windows generate enter-leave events for sub-windows.
|
// Top-level windows generate enter-leave events for sub-windows.
|
||||||
|
@ -63,11 +63,13 @@ QByteArray QEglFSHooks::fbDeviceName() const
|
|||||||
int QEglFSHooks::framebufferIndex() const
|
int QEglFSHooks::framebufferIndex() const
|
||||||
{
|
{
|
||||||
int fbIndex = 0;
|
int fbIndex = 0;
|
||||||
|
#ifndef QT_NO_REGULAREXPRESSION
|
||||||
QRegularExpression fbIndexRx(QLatin1String("fb(\\d+)"));
|
QRegularExpression fbIndexRx(QLatin1String("fb(\\d+)"));
|
||||||
QRegularExpressionMatch match = fbIndexRx.match(fbDeviceName());
|
QRegularExpressionMatch match = fbIndexRx.match(fbDeviceName());
|
||||||
if (match.hasMatch())
|
if (match.hasMatch())
|
||||||
fbIndex = match.captured(1).toInt();
|
fbIndex = match.captured(1).toInt();
|
||||||
|
|
||||||
|
#endif
|
||||||
return fbIndex;
|
return fbIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,11 +317,16 @@ static bool rootLevelRunLoopIntegration()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(Q_PROCESSOR_X86)
|
#if defined(Q_PROCESSOR_X86)
|
||||||
# define SET_STACK_POINTER "mov %0, %%esp"
|
|
||||||
# define FUNCTION_CALL_ALIGNMENT 16
|
# define FUNCTION_CALL_ALIGNMENT 16
|
||||||
|
# if defined(Q_PROCESSOR_X86_32)
|
||||||
|
# define SET_STACK_POINTER "mov %0, %%esp"
|
||||||
|
# elif defined(Q_PROCESSOR_X86_64)
|
||||||
|
# define SET_STACK_POINTER "movq %0, %%rsp"
|
||||||
|
# endif
|
||||||
#elif defined(Q_PROCESSOR_ARM)
|
#elif defined(Q_PROCESSOR_ARM)
|
||||||
# define SET_STACK_POINTER "mov sp, %0"
|
# // Valid for both 32 and 64-bit ARM
|
||||||
# define FUNCTION_CALL_ALIGNMENT 4
|
# define FUNCTION_CALL_ALIGNMENT 4
|
||||||
|
# define SET_STACK_POINTER "mov sp, %0"
|
||||||
#else
|
#else
|
||||||
# error "Unknown processor family"
|
# error "Unknown processor family"
|
||||||
#endif
|
#endif
|
||||||
|
@ -62,7 +62,7 @@ QPointF fromCGPoint(const CGPoint &point);
|
|||||||
|
|
||||||
Qt::ScreenOrientation toQtScreenOrientation(UIDeviceOrientation uiDeviceOrientation);
|
Qt::ScreenOrientation toQtScreenOrientation(UIDeviceOrientation uiDeviceOrientation);
|
||||||
UIDeviceOrientation fromQtScreenOrientation(Qt::ScreenOrientation qtOrientation);
|
UIDeviceOrientation fromQtScreenOrientation(Qt::ScreenOrientation qtOrientation);
|
||||||
QRect fromPortraitToPrimary(const QRect &rect, QPlatformScreen *screen);
|
|
||||||
int infoPlistValue(NSString* key, int defaultValue);
|
int infoPlistValue(NSString* key, int defaultValue);
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -127,15 +127,6 @@ UIDeviceOrientation fromQtScreenOrientation(Qt::ScreenOrientation qtOrientation)
|
|||||||
return uiOrientation;
|
return uiOrientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect fromPortraitToPrimary(const QRect &rect, QPlatformScreen *screen)
|
|
||||||
{
|
|
||||||
// UIScreen is always in portrait. Use this function to convert CGRects
|
|
||||||
// aligned with UIScreen into whatever is the current orientation of QScreen.
|
|
||||||
QRect geometry = screen->geometry();
|
|
||||||
return geometry.width() < geometry.height() ? rect
|
|
||||||
: QRect(rect.y(), geometry.height() - rect.width() - rect.x(), rect.height(), rect.width());
|
|
||||||
}
|
|
||||||
|
|
||||||
int infoPlistValue(NSString* key, int defaultValue)
|
int infoPlistValue(NSString* key, int defaultValue)
|
||||||
{
|
{
|
||||||
static NSBundle *bundle = [NSBundle mainBundle];
|
static NSBundle *bundle = [NSBundle mainBundle];
|
||||||
|
@ -51,9 +51,10 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
struct ImeState
|
struct ImeState
|
||||||
{
|
{
|
||||||
ImeState() : currentState(0) {}
|
ImeState() : currentState(0), focusObject(0) {}
|
||||||
Qt::InputMethodQueries update(Qt::InputMethodQueries properties);
|
Qt::InputMethodQueries update(Qt::InputMethodQueries properties);
|
||||||
QInputMethodQueryEvent currentState;
|
QInputMethodQueryEvent currentState;
|
||||||
|
QObject *focusObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QIOSInputContext : public QPlatformInputContext
|
class QIOSInputContext : public QPlatformInputContext
|
||||||
@ -82,6 +83,7 @@ public:
|
|||||||
void commit();
|
void commit();
|
||||||
|
|
||||||
const ImeState &imeState() { return m_imeState; };
|
const ImeState &imeState() { return m_imeState; };
|
||||||
|
bool inputMethodAccepted() const;
|
||||||
|
|
||||||
bool isReloadingInputViewsFromUpdate() const { return m_isReloadingInputViewsFromUpdate; }
|
bool isReloadingInputViewsFromUpdate() const { return m_isReloadingInputViewsFromUpdate; }
|
||||||
|
|
||||||
|
@ -46,25 +46,28 @@
|
|||||||
#include "qiosglobal.h"
|
#include "qiosglobal.h"
|
||||||
#include "qiosintegration.h"
|
#include "qiosintegration.h"
|
||||||
#include "qiostextresponder.h"
|
#include "qiostextresponder.h"
|
||||||
|
#include "qiosviewcontroller.h"
|
||||||
#include "qioswindow.h"
|
#include "qioswindow.h"
|
||||||
#include "quiview.h"
|
#include "quiview.h"
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QtGui/private/qwindow_p.h>
|
#include <QtGui/private/qwindow_p.h>
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
static QUIView *focusView()
|
static QUIView *focusView()
|
||||||
{
|
{
|
||||||
return qApp->focusWindow() ?
|
return qApp->focusWindow() ?
|
||||||
reinterpret_cast<QUIView *>(qApp->focusWindow()->winId()) : 0;
|
reinterpret_cast<QUIView *>(qApp->focusWindow()->winId()) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface QIOSKeyboardListener : UIGestureRecognizer {
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@interface QIOSKeyboardListener : UIGestureRecognizer <UIGestureRecognizerDelegate> {
|
||||||
@public
|
@public
|
||||||
QIOSInputContext *m_context;
|
QIOSInputContext *m_context;
|
||||||
BOOL m_keyboardVisible;
|
BOOL m_keyboardVisible;
|
||||||
BOOL m_keyboardVisibleAndDocked;
|
BOOL m_keyboardVisibleAndDocked;
|
||||||
BOOL m_touchPressWhileKeyboardVisible;
|
|
||||||
BOOL m_keyboardHiddenByGesture;
|
|
||||||
QRectF m_keyboardRect;
|
QRectF m_keyboardRect;
|
||||||
CGRect m_keyboardEndRect;
|
CGRect m_keyboardEndRect;
|
||||||
NSTimeInterval m_duration;
|
NSTimeInterval m_duration;
|
||||||
@ -77,13 +80,11 @@ static QUIView *focusView()
|
|||||||
|
|
||||||
- (id)initWithQIOSInputContext:(QIOSInputContext *)context
|
- (id)initWithQIOSInputContext:(QIOSInputContext *)context
|
||||||
{
|
{
|
||||||
self = [super initWithTarget:self action:@selector(gestureTriggered)];
|
self = [super initWithTarget:self action:@selector(gestureStateChanged:)];
|
||||||
if (self) {
|
if (self) {
|
||||||
m_context = context;
|
m_context = context;
|
||||||
m_keyboardVisible = NO;
|
m_keyboardVisible = NO;
|
||||||
m_keyboardVisibleAndDocked = NO;
|
m_keyboardVisibleAndDocked = NO;
|
||||||
m_touchPressWhileKeyboardVisible = NO;
|
|
||||||
m_keyboardHiddenByGesture = NO;
|
|
||||||
m_duration = 0;
|
m_duration = 0;
|
||||||
m_curve = UIViewAnimationCurveEaseOut;
|
m_curve = UIViewAnimationCurveEaseOut;
|
||||||
m_viewController = 0;
|
m_viewController = 0;
|
||||||
@ -99,10 +100,9 @@ static QUIView *focusView()
|
|||||||
Q_ASSERT(m_viewController);
|
Q_ASSERT(m_viewController);
|
||||||
|
|
||||||
// Attach 'hide keyboard' gesture to the window, but keep it disabled when the
|
// Attach 'hide keyboard' gesture to the window, but keep it disabled when the
|
||||||
// keyboard is not visible. Note that we never trigger the gesture the way it is intended
|
// keyboard is not visible.
|
||||||
// since we don't want to cancel touch events and interrupt flicking etc. Instead we use
|
|
||||||
// the gesture framework more as an event filter and hide the keyboard silently.
|
|
||||||
self.enabled = NO;
|
self.enabled = NO;
|
||||||
|
self.cancelsTouchesInView = NO;
|
||||||
self.delaysTouchesEnded = NO;
|
self.delaysTouchesEnded = NO;
|
||||||
[m_viewController.view.window addGestureRecognizer:self];
|
[m_viewController.view.window addGestureRecognizer:self];
|
||||||
}
|
}
|
||||||
@ -156,11 +156,19 @@ static QUIView *focusView()
|
|||||||
// Note that UIKeyboardWillShowNotification is only sendt when the keyboard is docked.
|
// Note that UIKeyboardWillShowNotification is only sendt when the keyboard is docked.
|
||||||
m_keyboardVisibleAndDocked = YES;
|
m_keyboardVisibleAndDocked = YES;
|
||||||
m_keyboardEndRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
m_keyboardEndRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
||||||
self.enabled = YES;
|
|
||||||
if (!m_duration) {
|
if (!m_duration) {
|
||||||
m_duration = [[notification.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
|
m_duration = [[notification.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
|
||||||
m_curve = UIViewAnimationCurve([[notification.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue]);
|
m_curve = UIViewAnimationCurve([[notification.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UIResponder *firstResponder = [UIResponder currentFirstResponder];
|
||||||
|
if (![firstResponder isKindOfClass:[QIOSTextInputResponder class]])
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Enable hide-keyboard gesture
|
||||||
|
self.enabled = YES;
|
||||||
|
|
||||||
m_context->scrollToCursor();
|
m_context->scrollToCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +177,7 @@ static QUIView *focusView()
|
|||||||
// Note that UIKeyboardWillHideNotification is also sendt when the keyboard is undocked.
|
// Note that UIKeyboardWillHideNotification is also sendt when the keyboard is undocked.
|
||||||
m_keyboardVisibleAndDocked = NO;
|
m_keyboardVisibleAndDocked = NO;
|
||||||
m_keyboardEndRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
m_keyboardEndRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
||||||
if (!m_keyboardHiddenByGesture) {
|
if (self.state != UIGestureRecognizerStateBegan) {
|
||||||
// Only disable the gesture if the hiding of the keyboard was not caused by it.
|
// Only disable the gesture if the hiding of the keyboard was not caused by it.
|
||||||
// Otherwise we need to await the final touchEnd callback for doing some clean-up.
|
// Otherwise we need to await the final touchEnd callback for doing some clean-up.
|
||||||
self.enabled = NO;
|
self.enabled = NO;
|
||||||
@ -202,54 +210,81 @@ static QUIView *focusView()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
|
// -------------------------------------------------------------------------
|
||||||
{
|
|
||||||
CGPoint p = [[touches anyObject] locationInView:m_viewController.view.window];
|
|
||||||
if (CGRectContainsPoint(m_keyboardEndRect, p)) {
|
|
||||||
m_keyboardHiddenByGesture = YES;
|
|
||||||
|
|
||||||
UIResponder *firstResponder = [UIResponder currentFirstResponder];
|
|
||||||
Q_ASSERT([firstResponder isKindOfClass:[QIOSTextInputResponder class]]);
|
|
||||||
[firstResponder resignFirstResponder];
|
|
||||||
}
|
|
||||||
|
|
||||||
[super touchesMoved:touches withEvent:event];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
|
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_keyboardVisibleAndDocked);
|
|
||||||
m_touchPressWhileKeyboardVisible = YES;
|
|
||||||
[super touchesBegan:touches withEvent:event];
|
[super touchesBegan:touches withEvent:event];
|
||||||
|
|
||||||
|
Q_ASSERT(m_keyboardVisibleAndDocked);
|
||||||
|
|
||||||
|
if ([touches count] != 1)
|
||||||
|
self.state = UIGestureRecognizerStateFailed;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
|
||||||
|
{
|
||||||
|
[super touchesMoved:touches withEvent:event];
|
||||||
|
|
||||||
|
if (self.state != UIGestureRecognizerStatePossible)
|
||||||
|
return;
|
||||||
|
|
||||||
|
CGPoint touchPoint = [[touches anyObject] locationInView:m_viewController.view.window];
|
||||||
|
if (CGRectContainsPoint(m_keyboardEndRect, touchPoint))
|
||||||
|
self.state = UIGestureRecognizerStateBegan;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
|
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
|
||||||
{
|
{
|
||||||
m_touchPressWhileKeyboardVisible = NO;
|
|
||||||
[self performSelectorOnMainThread:@selector(touchesEndedPostDelivery) withObject:nil waitUntilDone:NO];
|
|
||||||
[super touchesEnded:touches withEvent:event];
|
[super touchesEnded:touches withEvent:event];
|
||||||
|
|
||||||
|
[self touchesEndedOrCancelled];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
|
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
|
||||||
{
|
{
|
||||||
m_touchPressWhileKeyboardVisible = NO;
|
|
||||||
[self performSelectorOnMainThread:@selector(touchesEndedPostDelivery) withObject:nil waitUntilDone:NO];
|
|
||||||
[super touchesCancelled:touches withEvent:event];
|
[super touchesCancelled:touches withEvent:event];
|
||||||
|
|
||||||
|
[self touchesEndedOrCancelled];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)touchesEndedPostDelivery
|
- (void)touchesEndedOrCancelled
|
||||||
{
|
{
|
||||||
// Do some clean-up _after_ touchEnd has been delivered to QUIView
|
// Defer final state change until next runloop iteration, so that Qt
|
||||||
m_keyboardHiddenByGesture = NO;
|
// has a chance to process the final touch events first, before we eg.
|
||||||
|
// scroll the view.
|
||||||
|
dispatch_async(dispatch_get_main_queue (), ^{
|
||||||
|
// iOS will transition from began to changed by itself
|
||||||
|
Q_ASSERT(self.state != UIGestureRecognizerStateBegan);
|
||||||
|
|
||||||
|
if (self.state == UIGestureRecognizerStateChanged)
|
||||||
|
self.state = UIGestureRecognizerStateEnded;
|
||||||
|
else
|
||||||
|
self.state = UIGestureRecognizerStateFailed;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)gestureStateChanged:(id)sender
|
||||||
|
{
|
||||||
|
Q_UNUSED(sender);
|
||||||
|
|
||||||
|
if (self.state == UIGestureRecognizerStateBegan) {
|
||||||
|
qImDebug() << "hide keyboard gesture was triggered";
|
||||||
|
UIResponder *firstResponder = [UIResponder currentFirstResponder];
|
||||||
|
Q_ASSERT([firstResponder isKindOfClass:[QIOSTextInputResponder class]]);
|
||||||
|
[firstResponder resignFirstResponder];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)reset
|
||||||
|
{
|
||||||
|
[super reset];
|
||||||
|
|
||||||
if (!m_keyboardVisibleAndDocked) {
|
if (!m_keyboardVisibleAndDocked) {
|
||||||
|
qImDebug() << "keyboard was hidden, disabling hide-keyboard gesture";
|
||||||
self.enabled = NO;
|
self.enabled = NO;
|
||||||
if (qApp->focusObject()) {
|
|
||||||
// UI Controls are told to gain focus on touch release. So when the 'hide keyboard' gesture
|
|
||||||
// finishes, the final touch end can trigger a control to gain focus. This is in conflict with
|
|
||||||
// the gesture, so we clear focus once more as a work-around.
|
|
||||||
static_cast<QWindowPrivate *>(QObjectPrivate::get(qApp->focusWindow()))->clearFocusObject();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
qImDebug() << "gesture completed without triggering, scrolling view to cursor";
|
||||||
m_context->scrollToCursor();
|
m_context->scrollToCursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -265,8 +300,11 @@ Qt::InputMethodQueries ImeState::update(Qt::InputMethodQueries properties)
|
|||||||
|
|
||||||
QInputMethodQueryEvent newState(properties);
|
QInputMethodQueryEvent newState(properties);
|
||||||
|
|
||||||
if (qApp && qApp->focusObject())
|
// Update the focus object that the new state is based on
|
||||||
QCoreApplication::sendEvent(qApp->focusObject(), &newState);
|
focusObject = qApp ? qApp->focusObject() : 0;
|
||||||
|
|
||||||
|
if (focusObject)
|
||||||
|
QCoreApplication::sendEvent(focusObject, &newState);
|
||||||
|
|
||||||
Qt::InputMethodQueries updatedProperties;
|
Qt::InputMethodQueries updatedProperties;
|
||||||
for (uint i = 0; i < (sizeof(Qt::ImQueryAll) * CHAR_BIT); ++i) {
|
for (uint i = 0; i < (sizeof(Qt::ImQueryAll) * CHAR_BIT); ++i) {
|
||||||
@ -313,11 +351,23 @@ QRectF QIOSInputContext::keyboardRect() const
|
|||||||
void QIOSInputContext::showInputPanel()
|
void QIOSInputContext::showInputPanel()
|
||||||
{
|
{
|
||||||
// No-op, keyboard controlled fully by platform based on focus
|
// No-op, keyboard controlled fully by platform based on focus
|
||||||
|
qImDebug() << "can't show virtual keyboard without a focus object, ignoring";
|
||||||
}
|
}
|
||||||
|
|
||||||
void QIOSInputContext::hideInputPanel()
|
void QIOSInputContext::hideInputPanel()
|
||||||
{
|
{
|
||||||
// No-op, keyboard controlled fully by platform based on focus
|
if (![m_textResponder isFirstResponder]) {
|
||||||
|
qImDebug() << "QIOSTextInputResponder is not first responder, ignoring";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (qGuiApp->focusObject() != m_imeState.focusObject) {
|
||||||
|
qImDebug() << "current focus object does not match IM state, likely hiding from focusOut event, so ignoring";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
qImDebug() << "hiding VKB as requested by QInputMethod::hide()";
|
||||||
|
[m_textResponder resignFirstResponder];
|
||||||
}
|
}
|
||||||
|
|
||||||
void QIOSInputContext::clearCurrentFocusObject()
|
void QIOSInputContext::clearCurrentFocusObject()
|
||||||
@ -353,10 +403,10 @@ void QIOSInputContext::scrollToCursor()
|
|||||||
if (!isQtApplication())
|
if (!isQtApplication())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_keyboardListener->m_touchPressWhileKeyboardVisible) {
|
if (m_keyboardListener.state == UIGestureRecognizerStatePossible && m_keyboardListener.numberOfTouches == 1) {
|
||||||
// Don't scroll to the cursor if the user is touching the screen. This
|
// Don't scroll to the cursor if the user is touching the screen and possibly
|
||||||
// interferes with selection and the 'hide keyboard' gesture. Instead
|
// trying to trigger the hide-keyboard gesture.
|
||||||
// we update scrolling upon touchEnd.
|
qImDebug() << "preventing scrolling to cursor as we're still waiting for a possible gesture";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -426,6 +476,18 @@ void QIOSInputContext::setFocusObject(QObject *focusObject)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(focusObject);
|
Q_UNUSED(focusObject);
|
||||||
|
|
||||||
|
qImDebug() << "new focus object =" << focusObject;
|
||||||
|
|
||||||
|
if (m_keyboardListener.state == UIGestureRecognizerStateChanged) {
|
||||||
|
// A new focus object may be set as part of delivering touch events to
|
||||||
|
// application during the hide-keyboard gesture, but we don't want that
|
||||||
|
// to result in a new object getting focus and bringing the keyboard up
|
||||||
|
// again.
|
||||||
|
qImDebug() << "clearing focus object" << focusObject << "as hide-keyboard gesture is active";
|
||||||
|
clearCurrentFocusObject();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
if (m_keyboardListener->m_keyboardVisibleAndDocked)
|
if (m_keyboardListener->m_keyboardVisibleAndDocked)
|
||||||
@ -436,6 +498,8 @@ void QIOSInputContext::focusWindowChanged(QWindow *focusWindow)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(focusWindow);
|
Q_UNUSED(focusWindow);
|
||||||
|
|
||||||
|
qImDebug() << "new focus window =" << focusWindow;
|
||||||
|
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
[m_keyboardListener handleKeyboardRectChanged];
|
[m_keyboardListener handleKeyboardRectChanged];
|
||||||
@ -486,6 +550,26 @@ void QIOSInputContext::update(Qt::InputMethodQueries updatedProperties)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QIOSInputContext::inputMethodAccepted() const
|
||||||
|
{
|
||||||
|
// The IM enablement state is based on the last call to update()
|
||||||
|
bool lastKnownImEnablementState = m_imeState.currentState.value(Qt::ImEnabled).toBool();
|
||||||
|
|
||||||
|
#if !defined(QT_NO_DEBUG)
|
||||||
|
// QPlatformInputContext keeps a cached value of the current IM enablement state that is
|
||||||
|
// updated by QGuiApplication when the current focus object changes, or by QInputMethod's
|
||||||
|
// update() function. If the focus object changes, but the change is not propagated as
|
||||||
|
// a signal to QGuiApplication due to bugs in the widget/graphicsview/qml stack, we'll
|
||||||
|
// end up with a stale value for QPlatformInputContext::inputMethodAccepted(). To be on
|
||||||
|
// the safe side we always use our own cached value to decide if IM is enabled, and try
|
||||||
|
// to detect the case where the two values are out of sync.
|
||||||
|
if (lastKnownImEnablementState != QPlatformInputContext::inputMethodAccepted())
|
||||||
|
qWarning("QPlatformInputContext::inputMethodAccepted() does not match actual focus object IM enablement!");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return lastKnownImEnablementState;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Called by the input item to reset the input method state.
|
Called by the input item to reset the input method state.
|
||||||
*/
|
*/
|
||||||
|
@ -1224,16 +1224,21 @@ void QWindowsNativeFileDialogBase::setNameFilters(const QStringList &filters)
|
|||||||
QScopedArrayPointer<WCHAR> buffer(new WCHAR[totalStringLength + 2 * size]);
|
QScopedArrayPointer<WCHAR> buffer(new WCHAR[totalStringLength + 2 * size]);
|
||||||
QScopedArrayPointer<COMDLG_FILTERSPEC> comFilterSpec(new COMDLG_FILTERSPEC[size]);
|
QScopedArrayPointer<COMDLG_FILTERSPEC> comFilterSpec(new COMDLG_FILTERSPEC[size]);
|
||||||
|
|
||||||
const QString matchesAll = QStringLiteral(" (*)");
|
|
||||||
WCHAR *ptr = buffer.data();
|
WCHAR *ptr = buffer.data();
|
||||||
// Split filter specification as 'Texts (*.txt[;] *.doc)'
|
// Split filter specification as 'Texts (*.txt[;] *.doc)'
|
||||||
// into description and filters specification as '*.txt;*.doc'
|
// into description and filters specification as '*.txt;*.doc'
|
||||||
|
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
// Display glitch (CLSID only): 'All files (*)' shows up as 'All files (*) (*)'
|
// Display glitch (CLSID only): Any filter not filtering on suffix (such as
|
||||||
|
// '*', 'a.*') will be duplicated in combo: 'All files (*) (*)',
|
||||||
|
// 'AAA files (a.*) (a.*)'
|
||||||
QString description = specs[i].description;
|
QString description = specs[i].description;
|
||||||
if (!m_hideFiltersDetails && description.endsWith(matchesAll))
|
const QString &filter = specs[i].filter;
|
||||||
description.truncate(description.size() - matchesAll.size());
|
if (!m_hideFiltersDetails && !filter.startsWith(QLatin1String("*."))) {
|
||||||
|
const int pos = description.lastIndexOf(QLatin1Char('('));
|
||||||
|
if (pos > 0)
|
||||||
|
description.truncate(pos);
|
||||||
|
}
|
||||||
// Add to buffer.
|
// Add to buffer.
|
||||||
comFilterSpec[i].pszName = ptr;
|
comFilterSpec[i].pszName = ptr;
|
||||||
ptr += description.toWCharArray(ptr);
|
ptr += description.toWCharArray(ptr);
|
||||||
|
@ -470,9 +470,10 @@ void QPpdPrintDevice::loadPrinter()
|
|||||||
m_cupsDest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, m_cupsName, m_cupsInstance);
|
m_cupsDest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, m_cupsName, m_cupsInstance);
|
||||||
if (m_cupsDest) {
|
if (m_cupsDest) {
|
||||||
const char *ppdFile = cupsGetPPD(m_cupsName);
|
const char *ppdFile = cupsGetPPD(m_cupsName);
|
||||||
if (ppdFile)
|
if (ppdFile) {
|
||||||
m_ppd = ppdOpenFile(ppdFile);
|
m_ppd = ppdOpenFile(ppdFile);
|
||||||
unlink(ppdFile);
|
unlink(ppdFile);
|
||||||
|
}
|
||||||
if (m_ppd) {
|
if (m_ppd) {
|
||||||
ppdMarkDefaults(m_ppd);
|
ppdMarkDefaults(m_ppd);
|
||||||
} else {
|
} else {
|
||||||
|
@ -493,7 +493,7 @@ void Generator::generateCode()
|
|||||||
for (int i = 0; i < extraList.count(); ++i) {
|
for (int i = 0; i < extraList.count(); ++i) {
|
||||||
fprintf(out, " &%s::staticMetaObject,\n", extraList.at(i).constData());
|
fprintf(out, " &%s::staticMetaObject,\n", extraList.at(i).constData());
|
||||||
}
|
}
|
||||||
fprintf(out, " 0\n};\n\n");
|
fprintf(out, " Q_NULLPTR\n};\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -505,24 +505,24 @@ void Generator::generateCode()
|
|||||||
fprintf(out, "const QMetaObject %s::staticMetaObject = {\n", cdef->qualified.constData());
|
fprintf(out, "const QMetaObject %s::staticMetaObject = {\n", cdef->qualified.constData());
|
||||||
|
|
||||||
if (isQObject)
|
if (isQObject)
|
||||||
fprintf(out, " { 0, ");
|
fprintf(out, " { Q_NULLPTR, ");
|
||||||
else if (cdef->superclassList.size())
|
else if (cdef->superclassList.size())
|
||||||
fprintf(out, " { &%s::staticMetaObject, ", purestSuperClass.constData());
|
fprintf(out, " { &%s::staticMetaObject, ", purestSuperClass.constData());
|
||||||
else
|
else
|
||||||
fprintf(out, " { 0, ");
|
fprintf(out, " { Q_NULLPTR, ");
|
||||||
fprintf(out, "qt_meta_stringdata_%s.data,\n"
|
fprintf(out, "qt_meta_stringdata_%s.data,\n"
|
||||||
" qt_meta_data_%s, ", qualifiedClassNameIdentifier.constData(),
|
" qt_meta_data_%s, ", qualifiedClassNameIdentifier.constData(),
|
||||||
qualifiedClassNameIdentifier.constData());
|
qualifiedClassNameIdentifier.constData());
|
||||||
if (cdef->hasQObject && !isQt)
|
if (cdef->hasQObject && !isQt)
|
||||||
fprintf(out, " qt_static_metacall, ");
|
fprintf(out, " qt_static_metacall, ");
|
||||||
else
|
else
|
||||||
fprintf(out, " 0, ");
|
fprintf(out, " Q_NULLPTR, ");
|
||||||
|
|
||||||
if (extraList.isEmpty())
|
if (extraList.isEmpty())
|
||||||
fprintf(out, "0, ");
|
fprintf(out, "Q_NULLPTR, ");
|
||||||
else
|
else
|
||||||
fprintf(out, "qt_meta_extradata_%s, ", qualifiedClassNameIdentifier.constData());
|
fprintf(out, "qt_meta_extradata_%s, ", qualifiedClassNameIdentifier.constData());
|
||||||
fprintf(out, "0}\n};\n\n");
|
fprintf(out, "Q_NULLPTR}\n};\n\n");
|
||||||
|
|
||||||
if(isQt)
|
if(isQt)
|
||||||
return;
|
return;
|
||||||
@ -537,7 +537,7 @@ void Generator::generateCode()
|
|||||||
// Generate smart cast function
|
// Generate smart cast function
|
||||||
//
|
//
|
||||||
fprintf(out, "\nvoid *%s::qt_metacast(const char *_clname)\n{\n", cdef->qualified.constData());
|
fprintf(out, "\nvoid *%s::qt_metacast(const char *_clname)\n{\n", cdef->qualified.constData());
|
||||||
fprintf(out, " if (!_clname) return 0;\n");
|
fprintf(out, " if (!_clname) return Q_NULLPTR;\n");
|
||||||
fprintf(out, " if (!strcmp(_clname, qt_meta_stringdata_%s.stringdata))\n"
|
fprintf(out, " if (!strcmp(_clname, qt_meta_stringdata_%s.stringdata))\n"
|
||||||
" return static_cast<void*>(const_cast< %s*>(this));\n",
|
" return static_cast<void*>(const_cast< %s*>(this));\n",
|
||||||
qualifiedClassNameIdentifier.constData(), cdef->classname.constData());
|
qualifiedClassNameIdentifier.constData(), cdef->classname.constData());
|
||||||
@ -562,7 +562,7 @@ void Generator::generateCode()
|
|||||||
QByteArray superClass = purestSuperClass;
|
QByteArray superClass = purestSuperClass;
|
||||||
fprintf(out, " return %s::qt_metacast(_clname);\n", superClass.constData());
|
fprintf(out, " return %s::qt_metacast(_clname);\n", superClass.constData());
|
||||||
} else {
|
} else {
|
||||||
fprintf(out, " return 0;\n");
|
fprintf(out, " return Q_NULLPTR;\n");
|
||||||
}
|
}
|
||||||
fprintf(out, "}\n");
|
fprintf(out, "}\n");
|
||||||
|
|
||||||
@ -1416,7 +1416,7 @@ void Generator::generateSignal(FunctionDef *def,int index)
|
|||||||
fprintf(out, "QPrivateSignal");
|
fprintf(out, "QPrivateSignal");
|
||||||
|
|
||||||
fprintf(out, ")%s\n{\n"
|
fprintf(out, ")%s\n{\n"
|
||||||
" QMetaObject::activate(%s, &staticMetaObject, %d, 0);\n"
|
" QMetaObject::activate(%s, &staticMetaObject, %d, Q_NULLPTR);\n"
|
||||||
"}\n", constQualifier, thisPtr.constData(), index);
|
"}\n", constQualifier, thisPtr.constData(), index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1446,7 +1446,7 @@ void Generator::generateSignal(FunctionDef *def,int index)
|
|||||||
|
|
||||||
fprintf(out, " void *_a[] = { ");
|
fprintf(out, " void *_a[] = { ");
|
||||||
if (def->normalizedType == "void") {
|
if (def->normalizedType == "void") {
|
||||||
fprintf(out, "0");
|
fprintf(out, "Q_NULLPTR");
|
||||||
} else {
|
} else {
|
||||||
if (def->returnTypeIsVolatile)
|
if (def->returnTypeIsVolatile)
|
||||||
fprintf(out, "const_cast<void*>(reinterpret_cast<const volatile void*>(&_t0))");
|
fprintf(out, "const_cast<void*>(reinterpret_cast<const volatile void*>(&_t0))");
|
||||||
|
@ -243,6 +243,8 @@ static QString generateInterfaceXml(const ClassDef *mo)
|
|||||||
foreach (const FunctionDef &mm, mo->signalList) {
|
foreach (const FunctionDef &mm, mo->signalList) {
|
||||||
if (mm.wasCloned)
|
if (mm.wasCloned)
|
||||||
continue;
|
continue;
|
||||||
|
if (!mm.isScriptable && !(flags & QDBusConnection::ExportNonScriptableSignals))
|
||||||
|
continue;
|
||||||
|
|
||||||
retval += addFunction(mm, true);
|
retval += addFunction(mm, true);
|
||||||
}
|
}
|
||||||
@ -250,10 +252,14 @@ static QString generateInterfaceXml(const ClassDef *mo)
|
|||||||
|
|
||||||
if (flags & (QDBusConnection::ExportScriptableSlots | QDBusConnection::ExportNonScriptableSlots)) {
|
if (flags & (QDBusConnection::ExportScriptableSlots | QDBusConnection::ExportNonScriptableSlots)) {
|
||||||
foreach (const FunctionDef &slot, mo->slotList) {
|
foreach (const FunctionDef &slot, mo->slotList) {
|
||||||
|
if (!slot.isScriptable && !(flags & QDBusConnection::ExportNonScriptableSlots))
|
||||||
|
continue;
|
||||||
if (slot.access == FunctionDef::Public)
|
if (slot.access == FunctionDef::Public)
|
||||||
retval += addFunction(slot);
|
retval += addFunction(slot);
|
||||||
}
|
}
|
||||||
foreach (const FunctionDef &method, mo->methodList) {
|
foreach (const FunctionDef &method, mo->methodList) {
|
||||||
|
if (!method.isScriptable && !(flags & QDBusConnection::ExportNonScriptableSlots))
|
||||||
|
continue;
|
||||||
if (method.access == FunctionDef::Public)
|
if (method.access == FunctionDef::Public)
|
||||||
retval += addFunction(method);
|
retval += addFunction(method);
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.5 KiB |
@ -4301,8 +4301,6 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
|
|||||||
return;
|
return;
|
||||||
QString fileName = manifest +"-manifest.xml";
|
QString fileName = manifest +"-manifest.xml";
|
||||||
QFile file(outputDir() + QLatin1Char('/') + fileName);
|
QFile file(outputDir() + QLatin1Char('/') + fileName);
|
||||||
if (!file.open(QFile::WriteOnly | QFile::Text))
|
|
||||||
return ;
|
|
||||||
bool demos = false;
|
bool demos = false;
|
||||||
if (manifest == "demos")
|
if (manifest == "demos")
|
||||||
demos = true;
|
demos = true;
|
||||||
@ -4323,7 +4321,7 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
|
|||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
if (!proceed)
|
if (!proceed || !file.open(QFile::WriteOnly | QFile::Text))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QXmlStreamWriter writer(&file);
|
QXmlStreamWriter writer(&file);
|
||||||
|
@ -1,21 +1,31 @@
|
|||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
-- Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
-- Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
-- Contact: http://www.qt-project.org/legal
|
-- Contact: http://www.qt-project.org/legal
|
||||||
--
|
--
|
||||||
-- This file is part of the QtQml module of the Qt Toolkit.
|
-- This file is part of the QtQml module of the Qt Toolkit.
|
||||||
--
|
--
|
||||||
-- $QT_BEGIN_LICENSE:LGPL-ONLY$
|
-- $QT_BEGIN_LICENSE:LGPL21$
|
||||||
-- GNU Lesser General Public License Usage
|
-- Commercial License Usage
|
||||||
-- This file may be used under the terms of the GNU Lesser
|
-- Licensees holding valid commercial Qt licenses may use this file in
|
||||||
-- General Public License version 2.1 as published by the Free Software
|
-- accordance with the commercial license agreement provided with the
|
||||||
-- Foundation and appearing in the file LICENSE.LGPL included in the
|
-- Software or, alternatively, in accordance with the terms contained in
|
||||||
-- packaging of this file. Please review the following information to
|
-- a written agreement between you and Digia. For licensing terms and
|
||||||
-- ensure the GNU Lesser General Public License version 2.1 requirements
|
-- conditions see http://qt.digia.com/licensing. For further information
|
||||||
-- will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
-- use the contact form at http://qt.digia.com/contact-us.
|
||||||
--
|
--
|
||||||
-- If you have questions regarding the use of this file, please contact
|
-- GNU Lesser General Public License Usage
|
||||||
-- us via http://www.qt-project.org/.
|
-- Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
-- General Public License version 2.1 or version 3 as published by the Free
|
||||||
|
-- Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||||
|
-- LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||||
|
-- following information to ensure the GNU Lesser General Public License
|
||||||
|
-- requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||||
|
-- http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
--
|
||||||
|
-- In addition, as a special exception, Digia gives you certain additional
|
||||||
|
-- rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
-- version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
--
|
--
|
||||||
-- $QT_END_LICENSE$
|
-- $QT_END_LICENSE$
|
||||||
--
|
--
|
||||||
@ -89,41 +99,33 @@
|
|||||||
|
|
||||||
/./****************************************************************************
|
/./****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the QtQml module of the Qt Toolkit.
|
** This file is part of the QtQml module of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
** $QT_BEGIN_LICENSE:LGPL21$
|
||||||
** Commercial License Usage
|
** Commercial License Usage
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
** accordance with the commercial license agreement provided with the
|
** accordance with the commercial license agreement provided with the
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
** a written agreement between you and Digia. For licensing terms and
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
** conditions see http://qt.digia.com/licensing. For further information
|
||||||
** use the contact form at http://qt.digia.com/contact-us.
|
** use the contact form at http://qt.digia.com/contact-us.
|
||||||
**
|
**
|
||||||
** GNU Lesser General Public License Usage
|
** GNU Lesser General Public License Usage
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
** General Public License version 2.1 as published by the Free Software
|
** General Public License version 2.1 or version 3 as published by the Free
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||||
** packaging of this file. Please review the following information to
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
** following information to ensure the GNU Lesser General Public License
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
**
|
**
|
||||||
** In addition, as a special exception, Digia gives you certain additional
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
**
|
**
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3.0 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU General Public License version 3.0 requirements will be
|
|
||||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
** $QT_END_LICENSE$
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -142,41 +144,33 @@
|
|||||||
|
|
||||||
/:/****************************************************************************
|
/:/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
** Contact: http://www.qt-project.org/legal
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the QtQml module of the Qt Toolkit.
|
** This file is part of the QtQml module of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
** $QT_BEGIN_LICENSE:LGPL21$
|
||||||
** Commercial License Usage
|
** Commercial License Usage
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
** accordance with the commercial license agreement provided with the
|
** accordance with the commercial license agreement provided with the
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
** a written agreement between you and Digia. For licensing terms and
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
** conditions see http://qt.digia.com/licensing. For further information
|
** conditions see http://qt.digia.com/licensing. For further information
|
||||||
** use the contact form at http://qt.digia.com/contact-us.
|
** use the contact form at http://qt.digia.com/contact-us.
|
||||||
**
|
**
|
||||||
** GNU Lesser General Public License Usage
|
** GNU Lesser General Public License Usage
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
** General Public License version 2.1 as published by the Free Software
|
** General Public License version 2.1 or version 3 as published by the Free
|
||||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||||
** packaging of this file. Please review the following information to
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
** following information to ensure the GNU Lesser General Public License
|
||||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
**
|
**
|
||||||
** In addition, as a special exception, Digia gives you certain additional
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
**
|
**
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3.0 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU General Public License version 3.0 requirements will be
|
|
||||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
** $QT_END_LICENSE$
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -1090,6 +1084,31 @@ case $rule_number: {
|
|||||||
} break;
|
} break;
|
||||||
./
|
./
|
||||||
|
|
||||||
|
UiObjectMember: T_READONLY T_PROPERTY UiPropertyType JsIdentifier T_COLON UiQualifiedId UiObjectInitializer ;
|
||||||
|
/.
|
||||||
|
case $rule_number: {
|
||||||
|
AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4));
|
||||||
|
node->isReadonlyMember = true;
|
||||||
|
node->readonlyToken = loc(1);
|
||||||
|
node->propertyToken = loc(2);
|
||||||
|
node->typeToken = loc(3);
|
||||||
|
node->identifierToken = loc(4);
|
||||||
|
node->semicolonToken = loc(5); // insert a fake ';' before ':'
|
||||||
|
|
||||||
|
AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(4));
|
||||||
|
propertyName->identifierToken = loc(4);
|
||||||
|
propertyName->next = 0;
|
||||||
|
|
||||||
|
AST::UiObjectBinding *binding = new (pool) AST::UiObjectBinding(
|
||||||
|
propertyName, sym(6).UiQualifiedId, sym(7).UiObjectInitializer);
|
||||||
|
binding->colonToken = loc(5);
|
||||||
|
|
||||||
|
node->binding = binding;
|
||||||
|
|
||||||
|
sym(1).Node = node;
|
||||||
|
} break;
|
||||||
|
./
|
||||||
|
|
||||||
UiObjectMember: FunctionDeclaration ;
|
UiObjectMember: FunctionDeclaration ;
|
||||||
/.
|
/.
|
||||||
case $rule_number: {
|
case $rule_number: {
|
||||||
|
@ -161,15 +161,15 @@ public:
|
|||||||
T_XOR = 79,
|
T_XOR = 79,
|
||||||
T_XOR_EQ = 80,
|
T_XOR_EQ = 80,
|
||||||
|
|
||||||
ACCEPT_STATE = 663,
|
ACCEPT_STATE = 665,
|
||||||
RULE_COUNT = 357,
|
RULE_COUNT = 358,
|
||||||
STATE_COUNT = 664,
|
STATE_COUNT = 666,
|
||||||
TERMINAL_COUNT = 106,
|
TERMINAL_COUNT = 106,
|
||||||
NON_TERMINAL_COUNT = 111,
|
NON_TERMINAL_COUNT = 111,
|
||||||
|
|
||||||
GOTO_INDEX_OFFSET = 664,
|
GOTO_INDEX_OFFSET = 666,
|
||||||
GOTO_INFO_OFFSET = 3104,
|
GOTO_INFO_OFFSET = 3018,
|
||||||
GOTO_CHECK_OFFSET = 3104
|
GOTO_CHECK_OFFSET = 3018
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *const spell [];
|
static const char *const spell [];
|
||||||
|
@ -240,9 +240,9 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define J_SCRIPT_REGEXPLITERAL_RULE1 87
|
#define J_SCRIPT_REGEXPLITERAL_RULE1 88
|
||||||
|
|
||||||
#define J_SCRIPT_REGEXPLITERAL_RULE2 88
|
#define J_SCRIPT_REGEXPLITERAL_RULE2 89
|
||||||
|
|
||||||
QT_QML_END_NAMESPACE
|
QT_QML_END_NAMESPACE
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 892 B |
@ -893,6 +893,8 @@ bool RCCResourceLibrary::writeDataBlobs()
|
|||||||
if (m_format == C_Code)
|
if (m_format == C_Code)
|
||||||
writeString("\n};\n\n");
|
writeString("\n};\n\n");
|
||||||
else if (m_format == Pass1) {
|
else if (m_format == Pass1) {
|
||||||
|
if (offset < 8)
|
||||||
|
offset = 8;
|
||||||
writeString("\nstatic const unsigned char qt_resource_data[");
|
writeString("\nstatic const unsigned char qt_resource_data[");
|
||||||
writeByteArray(QByteArray::number(offset));
|
writeByteArray(QByteArray::number(offset));
|
||||||
writeString("] = { 'Q', 'R', 'C', '_', 'D', 'A', 'T', 'A' };\n\n");
|
writeString("] = { 'Q', 'R', 'C', '_', 'D', 'A', 'T', 'A' };\n\n");
|
||||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.6 KiB |
@ -2571,6 +2571,14 @@ void QWizard::setWizardStyle(WizardStyle style)
|
|||||||
d->disableUpdates();
|
d->disableUpdates();
|
||||||
d->wizStyle = style;
|
d->wizStyle = style;
|
||||||
d->updateButtonTexts();
|
d->updateButtonTexts();
|
||||||
|
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
|
||||||
|
if (aeroStyleChange) {
|
||||||
|
//Send a resizeevent since the antiflicker widget probably needs a new size
|
||||||
|
//because of the backbutton in the window title
|
||||||
|
QResizeEvent ev(geometry().size(), geometry().size());
|
||||||
|
QApplication::sendEvent(this, &ev);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
d->updateLayout();
|
d->updateLayout();
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
d->enableUpdates();
|
d->enableUpdates();
|
||||||
|
@ -1968,8 +1968,10 @@ QGraphicsItem::CacheMode QGraphicsItem::cacheMode() const
|
|||||||
Caching can speed up rendering if your item spends a significant time
|
Caching can speed up rendering if your item spends a significant time
|
||||||
redrawing itself. In some cases the cache can also slow down rendering, in
|
redrawing itself. In some cases the cache can also slow down rendering, in
|
||||||
particular when the item spends less time redrawing than QGraphicsItem
|
particular when the item spends less time redrawing than QGraphicsItem
|
||||||
spends redrawing from the cache. When enabled, the item's paint() function
|
spends redrawing from the cache.
|
||||||
will be called only once for each call to update(); for any subsequent
|
|
||||||
|
When caching is enabled, an item's paint() function will generally draw into an
|
||||||
|
offscreen pixmap cache; for any subsequent
|
||||||
repaint requests, the Graphics View framework will redraw from the
|
repaint requests, the Graphics View framework will redraw from the
|
||||||
cache. This approach works particularly well with QGLWidget, which stores
|
cache. This approach works particularly well with QGLWidget, which stores
|
||||||
all the cache as OpenGL textures.
|
all the cache as OpenGL textures.
|
||||||
@ -1980,6 +1982,12 @@ QGraphicsItem::CacheMode QGraphicsItem::cacheMode() const
|
|||||||
You can read more about the different cache modes in the CacheMode
|
You can read more about the different cache modes in the CacheMode
|
||||||
documentation.
|
documentation.
|
||||||
|
|
||||||
|
\note Enabling caching does not imply that the item's paint() function will be
|
||||||
|
called only in response to an explicit update() call. For instance, under
|
||||||
|
memory pressure, Qt may decide to drop some of the cache information;
|
||||||
|
in such cases an item's paint() function will be called even if there
|
||||||
|
was no update() call (that is, exactly as if there were no caching enabled).
|
||||||
|
|
||||||
\sa CacheMode, QPixmapCache::setCacheLimit()
|
\sa CacheMode, QPixmapCache::setCacheLimit()
|
||||||
*/
|
*/
|
||||||
void QGraphicsItem::setCacheMode(CacheMode mode, const QSize &logicalCacheSize)
|
void QGraphicsItem::setCacheMode(CacheMode mode, const QSize &logicalCacheSize)
|
||||||
@ -5337,6 +5345,16 @@ void QGraphicsItem::setBoundingRegionGranularity(qreal granularity)
|
|||||||
|
|
||||||
All painting is done in local coordinates.
|
All painting is done in local coordinates.
|
||||||
|
|
||||||
|
\note It is mandatory that an item will always redraw itself in the exact
|
||||||
|
same way, unless update() was called; otherwise visual artifacts may
|
||||||
|
occur. In other words, two subsequent calls to paint() must always produce
|
||||||
|
the same output, unless update() was called between them.
|
||||||
|
|
||||||
|
\note Enabling caching for an item does not guarantee that paint()
|
||||||
|
will be invoked only once by the Graphics View framework,
|
||||||
|
even without any explicit call to update(). See the documentation of
|
||||||
|
setCacheMode() for more details.
|
||||||
|
|
||||||
\sa setCacheMode(), QPen::width(), {Item Coordinates}, ItemUsesExtendedStyleOption
|
\sa setCacheMode(), QPen::width(), {Item Coordinates}, ItemUsesExtendedStyleOption
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -7155,10 +7155,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate a move event for QWidgets without window handles. QWidgets with native
|
if (isMove) {
|
||||||
// window handles already receive a move event from
|
|
||||||
// QGuiApplicationPrivate::processGeometryChangeEvent.
|
|
||||||
if (isMove && (!q->windowHandle() || q->testAttribute(Qt::WA_DontShowOnScreen))) {
|
|
||||||
QMoveEvent e(q->pos(), oldPos);
|
QMoveEvent e(q->pos(), oldPos);
|
||||||
QApplication::sendEvent(q, &e);
|
QApplication::sendEvent(q, &e);
|
||||||
}
|
}
|
||||||
|
@ -543,14 +543,36 @@ void QWidgetWindow::handleKeyEvent(QKeyEvent *event)
|
|||||||
QGuiApplication::sendSpontaneousEvent(receiver, event);
|
QGuiApplication::sendSpontaneousEvent(receiver, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWidgetWindow::updateGeometry()
|
bool QWidgetWindow::updateSize()
|
||||||
{
|
{
|
||||||
|
bool changed = false;
|
||||||
if (m_widget->testAttribute(Qt::WA_OutsideWSRange))
|
if (m_widget->testAttribute(Qt::WA_OutsideWSRange))
|
||||||
return;
|
return changed;
|
||||||
|
if (m_widget->data->crect.size() != geometry().size()) {
|
||||||
|
changed = true;
|
||||||
|
m_widget->data->crect.setSize(geometry().size());
|
||||||
|
}
|
||||||
|
|
||||||
|
updateMargins();
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QWidgetWindow::updatePos()
|
||||||
|
{
|
||||||
|
bool changed = false;
|
||||||
|
if (m_widget->testAttribute(Qt::WA_OutsideWSRange))
|
||||||
|
return changed;
|
||||||
|
if (m_widget->data->crect.topLeft() != geometry().topLeft()) {
|
||||||
|
changed = true;
|
||||||
|
m_widget->data->crect.moveTopLeft(geometry().topLeft());
|
||||||
|
}
|
||||||
|
updateMargins();
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QWidgetWindow::updateMargins()
|
||||||
|
{
|
||||||
const QMargins margins = frameMargins();
|
const QMargins margins = frameMargins();
|
||||||
|
|
||||||
m_widget->data->crect = geometry();
|
|
||||||
QTLWExtra *te = m_widget->d_func()->topData();
|
QTLWExtra *te = m_widget->d_func()->topData();
|
||||||
te->posIncludesFrame= false;
|
te->posIncludesFrame= false;
|
||||||
te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
|
te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
|
||||||
@ -609,24 +631,25 @@ void QWidgetWindow::updateNormalGeometry()
|
|||||||
|
|
||||||
void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
|
void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
|
||||||
{
|
{
|
||||||
updateGeometry();
|
if (updatePos())
|
||||||
QGuiApplication::sendSpontaneousEvent(m_widget, event);
|
QGuiApplication::sendSpontaneousEvent(m_widget, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
|
void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
|
||||||
{
|
{
|
||||||
QSize oldSize = m_widget->data->crect.size();
|
QSize oldSize = m_widget->data->crect.size();
|
||||||
|
|
||||||
updateGeometry();
|
if (updateSize()) {
|
||||||
QGuiApplication::sendSpontaneousEvent(m_widget, event);
|
QGuiApplication::sendSpontaneousEvent(m_widget, event);
|
||||||
|
|
||||||
if (m_widget->d_func()->paintOnScreen()) {
|
if (m_widget->d_func()->paintOnScreen()) {
|
||||||
QRegion updateRegion(geometry());
|
QRegion updateRegion(geometry());
|
||||||
if (m_widget->testAttribute(Qt::WA_StaticContents))
|
if (m_widget->testAttribute(Qt::WA_StaticContents))
|
||||||
updateRegion -= QRect(0, 0, oldSize.width(), oldSize.height());
|
updateRegion -= QRect(0, 0, oldSize.width(), oldSize.height());
|
||||||
m_widget->d_func()->syncBackingStore(updateRegion);
|
m_widget->d_func()->syncBackingStore(updateRegion);
|
||||||
} else {
|
} else {
|
||||||
m_widget->d_func()->syncBackingStore();
|
m_widget->d_func()->syncBackingStore();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,9 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void repaintWindow();
|
void repaintWindow();
|
||||||
void updateGeometry();
|
bool updateSize();
|
||||||
|
bool updatePos();
|
||||||
|
void updateMargins();
|
||||||
void updateNormalGeometry();
|
void updateNormalGeometry();
|
||||||
|
|
||||||
enum FocusWidgets {
|
enum FocusWidgets {
|
||||||
|
@ -1114,7 +1114,7 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget
|
|||||||
(opt->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled,
|
(opt->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled,
|
||||||
(opt->state & QStyle::State_Selected) ? QIcon::On : QIcon::Off );
|
(opt->state & QStyle::State_Selected) ? QIcon::On : QIcon::Off );
|
||||||
// High-dpi icons do not need adjustmet; make sure tabIconSize is not larger than iconSize
|
// High-dpi icons do not need adjustmet; make sure tabIconSize is not larger than iconSize
|
||||||
tabIconSize = QSize(qMin(tabIconSize.width(), iconSize.width()), qMin(tabIconSize.height(), iconSize.width()));
|
tabIconSize = QSize(qMin(tabIconSize.width(), iconSize.width()), qMin(tabIconSize.height(), iconSize.height()));
|
||||||
|
|
||||||
*iconRect = QRect(tr.left(), tr.center().y() - tabIconSize.height() / 2,
|
*iconRect = QRect(tr.left(), tr.center().y() - tabIconSize.height() / 2,
|
||||||
tabIconSize.width(), tabIconSize .height());
|
tabIconSize.width(), tabIconSize .height());
|
||||||
|
@ -1473,7 +1473,11 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif // QT_NO_ITEMVIEWS
|
#endif // QT_NO_ITEMVIEWS
|
||||||
|
#ifndef QT_NO_COMBOBOX
|
||||||
|
case CE_ComboBoxLabel:
|
||||||
|
QCommonStyle::drawControl(element, option, painter, widget);
|
||||||
|
break;
|
||||||
|
#endif // QT_NO_COMBOBOX
|
||||||
default:
|
default:
|
||||||
QWindowsXPStyle::drawControl(element, option, painter, widget);
|
QWindowsXPStyle::drawControl(element, option, painter, widget);
|
||||||
break;
|
break;
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
#ifndef QT_NO_DOCKWIDGET
|
#ifdef QT_NO_DOCKWIDGET
|
||||||
extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);
|
extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3055,8 +3055,10 @@ void QMenu::actionEvent(QActionEvent *e)
|
|||||||
delete menuItem;
|
delete menuItem;
|
||||||
} else if (e->type() == QEvent::ActionChanged) {
|
} else if (e->type() == QEvent::ActionChanged) {
|
||||||
QPlatformMenuItem *menuItem = d->platformMenu->menuItemForTag(reinterpret_cast<quintptr>(e->action()));
|
QPlatformMenuItem *menuItem = d->platformMenu->menuItemForTag(reinterpret_cast<quintptr>(e->action()));
|
||||||
copyActionToPlatformItem(e->action(), menuItem);
|
if (menuItem) {
|
||||||
d->platformMenu->syncMenuItem(menuItem);
|
copyActionToPlatformItem(e->action(), menuItem);
|
||||||
|
d->platformMenu->syncMenuItem(menuItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
d->platformMenu->syncSeparatorsCollapsible(d->collapsibleSeparators);
|
d->platformMenu->syncSeparatorsCollapsible(d->collapsibleSeparators);
|
||||||
|
@ -1564,7 +1564,7 @@ public slots:
|
|||||||
|
|
||||||
void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); }
|
void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); }
|
||||||
|
|
||||||
#if defined(Q_MOC_RUN) || (defined(Q_COMPILER_AUTO_TYPE) && !(defined(Q_CC_CLANG) && (__clang_major__ * 100) + __clang_minor__) < 304)
|
#if defined(Q_MOC_RUN) || (defined(Q_COMPILER_AUTO_TYPE) && !(defined(Q_CC_CLANG) && Q_CC_CLANG < 304))
|
||||||
// There is no Q_COMPILER_>> but if compiler support auto, it should also support >>
|
// There is no Q_COMPILER_>> but if compiler support auto, it should also support >>
|
||||||
void performSomething(QVector<QList<QString>> e = QVector<QList<QString>>(8 < 1),
|
void performSomething(QVector<QList<QString>> e = QVector<QList<QString>>(8 < 1),
|
||||||
QHash<int, QVector<QString>> h = QHash<int, QVector<QString>>())
|
QHash<int, QVector<QString>> h = QHash<int, QVector<QString>>())
|
||||||
|
@ -95,6 +95,8 @@ private slots:
|
|||||||
void tst_updateWinId_QTBUG40681();
|
void tst_updateWinId_QTBUG40681();
|
||||||
void tst_recreateWindow_QTBUG40817();
|
void tst_recreateWindow_QTBUG40817();
|
||||||
|
|
||||||
|
void tst_resize_count();
|
||||||
|
void tst_move_count();
|
||||||
};
|
};
|
||||||
|
|
||||||
void tst_QWidget_window::initTestCase()
|
void tst_QWidget_window::initTestCase()
|
||||||
@ -660,6 +662,105 @@ void tst_QWidget_window::tst_recreateWindow_QTBUG40817()
|
|||||||
tab.setCurrentIndex(1);
|
tab.setCurrentIndex(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ResizeWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
ResizeWidget(QWidget *parent = 0)
|
||||||
|
: QWidget(parent)
|
||||||
|
, resizeCount(0)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
int resizeCount;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE
|
||||||
|
{
|
||||||
|
resizeCount++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void tst_QWidget_window::tst_resize_count()
|
||||||
|
{
|
||||||
|
{
|
||||||
|
ResizeWidget resize;
|
||||||
|
resize.show();
|
||||||
|
QVERIFY(QTest::qWaitForWindowExposed(&resize));
|
||||||
|
QCOMPARE(resize.resizeCount, 1);
|
||||||
|
resize.resizeCount = 0;
|
||||||
|
QSize size = resize.size();
|
||||||
|
size.rwidth() += 10;
|
||||||
|
resize.resize(size);
|
||||||
|
QGuiApplication::sync();
|
||||||
|
QTRY_COMPARE(resize.resizeCount, 1);
|
||||||
|
|
||||||
|
resize.resizeCount = 0;
|
||||||
|
|
||||||
|
ResizeWidget child(&resize);
|
||||||
|
child.resize(200,200);
|
||||||
|
child.winId();
|
||||||
|
child.show();
|
||||||
|
QVERIFY(QTest::qWaitForWindowExposed(&child));
|
||||||
|
QGuiApplication::sync();
|
||||||
|
QTRY_COMPARE(child.resizeCount, 1);
|
||||||
|
child.resizeCount = 0;
|
||||||
|
size = child.size();
|
||||||
|
size.rwidth() += 10;
|
||||||
|
child.resize(size);
|
||||||
|
QGuiApplication::sync();
|
||||||
|
QCOMPARE(resize.resizeCount, 0);
|
||||||
|
QCOMPARE(child.resizeCount, 1);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
ResizeWidget parent;
|
||||||
|
ResizeWidget child(&parent);
|
||||||
|
child.resize(200,200);
|
||||||
|
child.winId();
|
||||||
|
parent.show();
|
||||||
|
QVERIFY(QTest::qWaitForWindowExposed(&parent));
|
||||||
|
parent.resizeCount = 0;
|
||||||
|
QGuiApplication::sync();
|
||||||
|
QTRY_COMPARE(child.resizeCount, 1);
|
||||||
|
child.resizeCount = 0;
|
||||||
|
QSize size = child.size();
|
||||||
|
size.rwidth() += 10;
|
||||||
|
child.resize(size);
|
||||||
|
QGuiApplication::sync();
|
||||||
|
QCOMPARE(parent.resizeCount, 0);
|
||||||
|
QCOMPARE(child.resizeCount, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class MoveWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
MoveWidget(QWidget *parent = 0)
|
||||||
|
: QWidget(parent)
|
||||||
|
, moveCount(0)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
void moveEvent(QMoveEvent *) Q_DECL_OVERRIDE
|
||||||
|
{
|
||||||
|
moveCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
int moveCount;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tst_QWidget_window::tst_move_count()
|
||||||
|
{
|
||||||
|
MoveWidget move;
|
||||||
|
move.move(500,500);
|
||||||
|
move.show();
|
||||||
|
QVERIFY(QTest::qWaitForWindowExposed(&move));
|
||||||
|
QTRY_VERIFY(move.moveCount >= 1);
|
||||||
|
move.moveCount = 0;
|
||||||
|
|
||||||
|
move.move(220,250);
|
||||||
|
QTRY_VERIFY(move.moveCount >= 1);
|
||||||
|
}
|
||||||
|
|
||||||
QTEST_MAIN(tst_QWidget_window)
|
QTEST_MAIN(tst_QWidget_window)
|
||||||
#include "tst_qwidget_window.moc"
|
#include "tst_qwidget_window.moc"
|
||||||
|