diff --git a/.gitmodules b/.gitmodules index c7ef3e1184..0644150a83 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,9 +25,6 @@ [submodule "deps/casablanca"] path = deps/casablanca url = https://github.com/Microsoft/cpprestsdk.git -[submodule "deps/AFNetworking"] - path = deps/AFNetworking - url = https://github.com/vslavik/AFNetworking.git [submodule "deps/mctrl"] path = deps/mctrl url = https://github.com/mity/mctrl.git diff --git a/Poedit.xcodeproj/project.pbxproj b/Poedit.xcodeproj/project.pbxproj index 6496e0322c..e44d393b7e 100644 --- a/Poedit.xcodeproj/project.pbxproj +++ b/Poedit.xcodeproj/project.pbxproj @@ -68,7 +68,6 @@ B22A5C86184E4B870034BEFD /* document-properties@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B22A5C7F184E4B870034BEFD /* document-properties@2x.png */; }; B22A5C87184E4B870034BEFD /* poedit-update@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B22A5C80184E4B870034BEFD /* poedit-update@2x.png */; }; B22C5F0A17DDC67400ECAFD1 /* language.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B22C5F0817DDC67400ECAFD1 /* language.cpp */; }; - B22E690F1A936294002C06C7 /* libAFNetworking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B22E690E1A936294002C06C7 /* libAFNetworking.a */; }; B22E69111A93699E002C06C7 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B22E69101A93699E002C06C7 /* SystemConfiguration.framework */; }; B230E2281A73F81400FB1E57 /* hidpi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B230E2261A73F81400FB1E57 /* hidpi.cpp */; }; B2377A202159179B0085E9C4 /* catalog_xliff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2377A1E2159179B0085E9C4 /* catalog_xliff.cpp */; }; @@ -337,7 +336,6 @@ B22C5F0817DDC67400ECAFD1 /* language.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = language.cpp; sourceTree = ""; }; B22C5F0917DDC67400ECAFD1 /* language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = language.h; sourceTree = ""; }; B22CC9CE1E7719E700709DEA /* cloud_sync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cloud_sync.h; sourceTree = ""; }; - B22E690E1A936294002C06C7 /* libAFNetworking.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libAFNetworking.a; sourceTree = BUILT_PRODUCTS_DIR; }; B22E69101A93699E002C06C7 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; B230E2261A73F81400FB1E57 /* hidpi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hidpi.cpp; sourceTree = ""; }; B230E2271A73F81400FB1E57 /* hidpi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hidpi.h; sourceTree = ""; }; @@ -628,7 +626,6 @@ B2D76A50181D028B0083C9D9 /* libboost_system.a in Frameworks */, B2D76A51181D028B0083C9D9 /* libboost_thread.a in Frameworks */, B2083D131A87D17D00150BBF /* libcld2.a in Frameworks */, - B22E690F1A936294002C06C7 /* libAFNetworking.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -862,7 +859,6 @@ isa = PBXGroup; children = ( B22E69101A93699E002C06C7 /* SystemConfiguration.framework */, - B22E690E1A936294002C06C7 /* libAFNetworking.a */, B2083D121A87D17D00150BBF /* libcld2.a */, B2284A54183BE68200E097C7 /* Security.framework */, B2D76A46181D028B0083C9D9 /* libboost_date_time.a */, @@ -1756,7 +1752,6 @@ deps/lucene, deps/lucene/LucenePlusPlus/include, deps/cld2, - deps/AFNetworking/AFNetworking, "$(DEPS_BUILD_DIR)/icu/include", ); LIBRARY_SEARCH_PATHS = "$(DEPS_BUILD_DIR)/icu/lib"; @@ -1828,7 +1823,6 @@ deps/lucene, deps/lucene/LucenePlusPlus/include, deps/cld2, - deps/AFNetworking/AFNetworking, "$(DEPS_BUILD_DIR)/icu/include", ); LIBRARY_SEARCH_PATHS = "$(DEPS_BUILD_DIR)/icu/lib"; diff --git a/Poedit2.xcworkspace/contents.xcworkspacedata b/Poedit2.xcworkspace/contents.xcworkspacedata index eba85bc59a..65b3f528fc 100644 --- a/Poedit2.xcworkspace/contents.xcworkspacedata +++ b/Poedit2.xcworkspace/contents.xcworkspacedata @@ -7,9 +7,6 @@ - - diff --git a/deps/AFNetworking b/deps/AFNetworking deleted file mode 160000 index 3be7994cd8..0000000000 --- a/deps/AFNetworking +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3be7994cd8fafda1ee5b5d07a92d5091cc423df0 diff --git a/deps/custom_build/AFNetworking.xcodeproj/project.pbxproj b/deps/custom_build/AFNetworking.xcodeproj/project.pbxproj deleted file mode 100644 index 917ad1e198..0000000000 --- a/deps/custom_build/AFNetworking.xcodeproj/project.pbxproj +++ /dev/null @@ -1,329 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - B22E68F91A935F87002C06C7 /* AFHTTPClient.h in Headers */ = {isa = PBXBuildFile; fileRef = B22E68E81A935F87002C06C7 /* AFHTTPClient.h */; }; - B22E68FA1A935F87002C06C7 /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = B22E68E91A935F87002C06C7 /* AFHTTPClient.m */; }; - B22E68FB1A935F87002C06C7 /* AFHTTPRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = B22E68EA1A935F87002C06C7 /* AFHTTPRequestOperation.h */; }; - B22E68FC1A935F87002C06C7 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = B22E68EB1A935F87002C06C7 /* AFHTTPRequestOperation.m */; }; - B22E68FD1A935F87002C06C7 /* AFImageRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = B22E68EC1A935F87002C06C7 /* AFImageRequestOperation.h */; }; - B22E68FE1A935F87002C06C7 /* AFImageRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = B22E68ED1A935F87002C06C7 /* AFImageRequestOperation.m */; }; - B22E68FF1A935F87002C06C7 /* AFJSONRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = B22E68EE1A935F87002C06C7 /* AFJSONRequestOperation.h */; }; - B22E69001A935F87002C06C7 /* AFJSONRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = B22E68EF1A935F87002C06C7 /* AFJSONRequestOperation.m */; }; - B22E69011A935F87002C06C7 /* AFNetworkActivityIndicatorManager.h in Headers */ = {isa = PBXBuildFile; fileRef = B22E68F01A935F87002C06C7 /* AFNetworkActivityIndicatorManager.h */; }; - B22E69021A935F87002C06C7 /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B22E68F11A935F87002C06C7 /* AFNetworkActivityIndicatorManager.m */; }; - B22E69031A935F87002C06C7 /* AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = B22E68F21A935F87002C06C7 /* AFNetworking.h */; }; - B22E69041A935F87002C06C7 /* AFPropertyListRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = B22E68F31A935F87002C06C7 /* AFPropertyListRequestOperation.h */; }; - B22E69051A935F87002C06C7 /* AFPropertyListRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = B22E68F41A935F87002C06C7 /* AFPropertyListRequestOperation.m */; }; - B22E69061A935F87002C06C7 /* AFURLConnectionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = B22E68F51A935F87002C06C7 /* AFURLConnectionOperation.h */; }; - B22E69071A935F87002C06C7 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = B22E68F61A935F87002C06C7 /* AFURLConnectionOperation.m */; settings = {COMPILER_FLAGS = "-Wno-nonnull"; }; }; - B22E69081A935F87002C06C7 /* AFXMLRequestOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = B22E68F71A935F87002C06C7 /* AFXMLRequestOperation.h */; }; - B22E69091A935F87002C06C7 /* AFXMLRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = B22E68F81A935F87002C06C7 /* AFXMLRequestOperation.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - B228A1581AD95D44006B0BBC /* third_party.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = third_party.xcconfig; sourceTree = ""; }; - B22E68E81A935F87002C06C7 /* AFHTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFHTTPClient.h; path = AFNetworking/AFHTTPClient.h; sourceTree = ""; }; - B22E68E91A935F87002C06C7 /* AFHTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFHTTPClient.m; path = AFNetworking/AFHTTPClient.m; sourceTree = ""; }; - B22E68EA1A935F87002C06C7 /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFHTTPRequestOperation.h; path = AFNetworking/AFHTTPRequestOperation.h; sourceTree = ""; }; - B22E68EB1A935F87002C06C7 /* AFHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFHTTPRequestOperation.m; path = AFNetworking/AFHTTPRequestOperation.m; sourceTree = ""; }; - B22E68EC1A935F87002C06C7 /* AFImageRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFImageRequestOperation.h; path = AFNetworking/AFImageRequestOperation.h; sourceTree = ""; }; - B22E68ED1A935F87002C06C7 /* AFImageRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFImageRequestOperation.m; path = AFNetworking/AFImageRequestOperation.m; sourceTree = ""; }; - B22E68EE1A935F87002C06C7 /* AFJSONRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFJSONRequestOperation.h; path = AFNetworking/AFJSONRequestOperation.h; sourceTree = ""; }; - B22E68EF1A935F87002C06C7 /* AFJSONRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFJSONRequestOperation.m; path = AFNetworking/AFJSONRequestOperation.m; sourceTree = ""; }; - B22E68F01A935F87002C06C7 /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFNetworkActivityIndicatorManager.h; path = AFNetworking/AFNetworkActivityIndicatorManager.h; sourceTree = ""; }; - B22E68F11A935F87002C06C7 /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFNetworkActivityIndicatorManager.m; path = AFNetworking/AFNetworkActivityIndicatorManager.m; sourceTree = ""; }; - B22E68F21A935F87002C06C7 /* AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFNetworking.h; path = AFNetworking/AFNetworking.h; sourceTree = ""; }; - B22E68F31A935F87002C06C7 /* AFPropertyListRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFPropertyListRequestOperation.h; path = AFNetworking/AFPropertyListRequestOperation.h; sourceTree = ""; }; - B22E68F41A935F87002C06C7 /* AFPropertyListRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFPropertyListRequestOperation.m; path = AFNetworking/AFPropertyListRequestOperation.m; sourceTree = ""; }; - B22E68F51A935F87002C06C7 /* AFURLConnectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFURLConnectionOperation.h; path = AFNetworking/AFURLConnectionOperation.h; sourceTree = ""; }; - B22E68F61A935F87002C06C7 /* AFURLConnectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFURLConnectionOperation.m; path = AFNetworking/AFURLConnectionOperation.m; sourceTree = ""; }; - B22E68F71A935F87002C06C7 /* AFXMLRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFXMLRequestOperation.h; path = AFNetworking/AFXMLRequestOperation.h; sourceTree = ""; }; - B22E68F81A935F87002C06C7 /* AFXMLRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFXMLRequestOperation.m; path = AFNetworking/AFXMLRequestOperation.m; sourceTree = ""; }; - B280E8571A935EEC009F4A98 /* libAFNetworking.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAFNetworking.a; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - B280E8541A935EEC009F4A98 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - B280E84E1A935EEC009F4A98 = { - isa = PBXGroup; - children = ( - B228A1581AD95D44006B0BBC /* third_party.xcconfig */, - B280E8591A935EED009F4A98 /* AFNetworking */, - B280E8581A935EEC009F4A98 /* Products */, - ); - sourceTree = ""; - }; - B280E8581A935EEC009F4A98 /* Products */ = { - isa = PBXGroup; - children = ( - B280E8571A935EEC009F4A98 /* libAFNetworking.a */, - ); - name = Products; - sourceTree = ""; - }; - B280E8591A935EED009F4A98 /* AFNetworking */ = { - isa = PBXGroup; - children = ( - B22E68E81A935F87002C06C7 /* AFHTTPClient.h */, - B22E68E91A935F87002C06C7 /* AFHTTPClient.m */, - B22E68EA1A935F87002C06C7 /* AFHTTPRequestOperation.h */, - B22E68EB1A935F87002C06C7 /* AFHTTPRequestOperation.m */, - B22E68EC1A935F87002C06C7 /* AFImageRequestOperation.h */, - B22E68ED1A935F87002C06C7 /* AFImageRequestOperation.m */, - B22E68EE1A935F87002C06C7 /* AFJSONRequestOperation.h */, - B22E68EF1A935F87002C06C7 /* AFJSONRequestOperation.m */, - B22E68F01A935F87002C06C7 /* AFNetworkActivityIndicatorManager.h */, - B22E68F11A935F87002C06C7 /* AFNetworkActivityIndicatorManager.m */, - B22E68F21A935F87002C06C7 /* AFNetworking.h */, - B22E68F31A935F87002C06C7 /* AFPropertyListRequestOperation.h */, - B22E68F41A935F87002C06C7 /* AFPropertyListRequestOperation.m */, - B22E68F51A935F87002C06C7 /* AFURLConnectionOperation.h */, - B22E68F61A935F87002C06C7 /* AFURLConnectionOperation.m */, - B22E68F71A935F87002C06C7 /* AFXMLRequestOperation.h */, - B22E68F81A935F87002C06C7 /* AFXMLRequestOperation.m */, - ); - name = AFNetworking; - path = ../AFNetworking; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - B280E8551A935EEC009F4A98 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - B22E68FD1A935F87002C06C7 /* AFImageRequestOperation.h in Headers */, - B22E68FF1A935F87002C06C7 /* AFJSONRequestOperation.h in Headers */, - B22E68F91A935F87002C06C7 /* AFHTTPClient.h in Headers */, - B22E69061A935F87002C06C7 /* AFURLConnectionOperation.h in Headers */, - B22E68FB1A935F87002C06C7 /* AFHTTPRequestOperation.h in Headers */, - B22E69011A935F87002C06C7 /* AFNetworkActivityIndicatorManager.h in Headers */, - B22E69041A935F87002C06C7 /* AFPropertyListRequestOperation.h in Headers */, - B22E69081A935F87002C06C7 /* AFXMLRequestOperation.h in Headers */, - B22E69031A935F87002C06C7 /* AFNetworking.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - B280E8561A935EEC009F4A98 /* AFNetworking */ = { - isa = PBXNativeTarget; - buildConfigurationList = B280E86B1A935EED009F4A98 /* Build configuration list for PBXNativeTarget "AFNetworking" */; - buildPhases = ( - B280E8531A935EEC009F4A98 /* Sources */, - B280E8541A935EEC009F4A98 /* Frameworks */, - B280E8551A935EEC009F4A98 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = AFNetworking; - productName = AFNetworking; - productReference = B280E8571A935EEC009F4A98 /* libAFNetworking.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - B280E84F1A935EEC009F4A98 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1130; - ORGANIZATIONNAME = "Vaclav Slavik"; - TargetAttributes = { - B280E8561A935EEC009F4A98 = { - CreatedOnToolsVersion = 6.1.1; - }; - }; - }; - buildConfigurationList = B280E8521A935EEC009F4A98 /* Build configuration list for PBXProject "AFNetworking" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = B280E84E1A935EEC009F4A98; - productRefGroup = B280E8581A935EEC009F4A98 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - B280E8561A935EEC009F4A98 /* AFNetworking */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - B280E8531A935EEC009F4A98 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B22E69071A935F87002C06C7 /* AFURLConnectionOperation.m in Sources */, - B22E68FE1A935F87002C06C7 /* AFImageRequestOperation.m in Sources */, - B22E68FC1A935F87002C06C7 /* AFHTTPRequestOperation.m in Sources */, - B22E69051A935F87002C06C7 /* AFPropertyListRequestOperation.m in Sources */, - B22E69091A935F87002C06C7 /* AFXMLRequestOperation.m in Sources */, - B22E69001A935F87002C06C7 /* AFJSONRequestOperation.m in Sources */, - B22E68FA1A935F87002C06C7 /* AFHTTPClient.m in Sources */, - B22E69021A935F87002C06C7 /* AFNetworkActivityIndicatorManager.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - B280E8691A935EED009F4A98 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B228A1581AD95D44006B0BBC /* third_party.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREFIX_HEADER = "AFNetworking-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - B280E86A1A935EED009F4A98 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B228A1581AD95D44006B0BBC /* third_party.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "AFNetworking-Prefix.pch"; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - }; - name = Release; - }; - B280E86C1A935EED009F4A98 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - EXECUTABLE_PREFIX = lib; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - B280E86D1A935EED009F4A98 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - EXECUTABLE_PREFIX = lib; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B280E8521A935EEC009F4A98 /* Build configuration list for PBXProject "AFNetworking" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B280E8691A935EED009F4A98 /* Debug */, - B280E86A1A935EED009F4A98 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - B280E86B1A935EED009F4A98 /* Build configuration list for PBXNativeTarget "AFNetworking" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B280E86C1A935EED009F4A98 /* Debug */, - B280E86D1A935EED009F4A98 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = B280E84F1A935EEC009F4A98 /* Project object */; -} diff --git a/docs/Acknowledgments.html b/docs/Acknowledgments.html index e82c21aa61..6a8788391c 100644 --- a/docs/Acknowledgments.html +++ b/docs/Acknowledgments.html @@ -291,29 +291,6 @@

C++ REST SDK

SOFTWARE. -

AFNetworking

-

- Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com/) -

- Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: -

- The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. -

- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -

mCtrl

mCtrl is covered with the GNU Lesser General Public License 2.1 or (at your option) any later version. diff --git a/src/http_client.h b/src/http_client.h index b4f0331b24..161b655637 100644 --- a/src/http_client.h +++ b/src/http_client.h @@ -129,9 +129,6 @@ class http_client static void set_ui_language(const std::string& lang); #endif - /// Return true if the server is reachable, i.e. client is online - bool is_reachable() const; - /// Sets Authorization header to be used in all requests void set_authorization(const std::string& auth); @@ -185,6 +182,22 @@ class http_client std::unique_ptr m_impl; }; +/// Monitor if networking is available +class http_reachability +{ +public: + /// Creates an instance of the monitor object. + http_reachability(const std::string& url); + ~http_reachability(); + + /// Return true if the host is reachable, i.e. client is online + bool is_reachable() const; + +private: + class impl; + std::unique_ptr m_impl; +}; + #endif // HAVE_HTTP_CLIENT #endif // Poedit_http_client_h diff --git a/src/http_client_casablanca.cpp b/src/http_client_casablanca.cpp index 6d6458c476..7ad58d3d37 100644 --- a/src/http_client_casablanca.cpp +++ b/src/http_client_casablanca.cpp @@ -139,41 +139,10 @@ class http_client::impl std::shared_ptr gzip_stage = std::make_shared(); m_native.add_handler(gzip_stage); - - #ifdef _WIN32 - m_networkListManager = nullptr; - CoCreateInstance(CLSID_NetworkListManager, NULL, CLSCTX_ALL, IID_INetworkListManager, (LPVOID *)&m_networkListManager); - #endif - } - - ~impl() - { - #ifdef _WIN32 - if (m_networkListManager) - m_networkListManager->Release(); - #endif } static string_t ui_language; - bool is_reachable() const - { - #ifdef _WIN32 - if (m_networkListManager) - { - NLM_CONNECTIVITY result; - HRESULT hr = m_networkListManager->GetConnectivity(&result); - if (SUCCEEDED(hr)) - return result & (NLM_CONNECTIVITY_IPV4_INTERNET|NLM_CONNECTIVITY_IPV6_INTERNET); - } - // manager fallback (IPv6 ignorant): - DWORD flags; - return ::InternetGetConnectedState(&flags, 0); - #else - return true; // TODO - #endif - } - void set_authorization(const std::string& auth) { m_auth = std::wstring(auth.begin(), auth.end()); @@ -305,8 +274,6 @@ class http_client::impl return std::to_wstring(info.dwMajorVersion) + L"." + std::to_wstring(info.dwMinorVersion); } - - INetworkListManager *m_networkListManager; #endif http_client& m_owner; @@ -333,11 +300,6 @@ void http_client::set_ui_language(const std::string& lang) impl::ui_language = to_string_t(lang); } -bool http_client::is_reachable() const -{ - return m_impl->is_reachable(); -} - void http_client::set_authorization(const std::string& auth) { m_impl->set_authorization(auth); @@ -357,3 +319,65 @@ dispatch::future<::json> http_client::post(const std::string& url, const http_bo { return m_impl->post(url, data); } + + +#ifdef _WIN32 + +class http_reachability::impl +{ +public: + impl() + { + m_networkListManager = nullptr; + CoCreateInstance(CLSID_NetworkListManager, NULL, CLSCTX_ALL, IID_INetworkListManager, (LPVOID *)&m_networkListManager); + } + + ~impl() + { + if (m_networkListManager) + m_networkListManager->Release(); + } + + bool is_reachable() const + { + if (m_networkListManager) + { + NLM_CONNECTIVITY result; + HRESULT hr = m_networkListManager->GetConnectivity(&result); + if (SUCCEEDED(hr)) + return result & (NLM_CONNECTIVITY_IPV4_INTERNET|NLM_CONNECTIVITY_IPV6_INTERNET); + } + // manager fallback (IPv6 ignorant): + DWORD flags; + return ::InternetGetConnectedState(&flags, 0); + } + +private: + INetworkListManager *m_networkListManager; +}; + +#else // !WIN32 + +class http_reachability::impl +{ +public: + impl() {} + bool is_reachable() const { return true; } // TODO +}; + +#endif + + +http_reachability::http_reachability(const std::string& /*url*/) + : m_impl(new impl) +{ +} + +http_reachability::~http_reachability() +{ +} + +bool http_reachability::is_reachable() const +{ + return m_impl->is_reachable(); +} diff --git a/src/http_client_macos.mm b/src/http_client_macos.mm index 38d5447b5d..c9a5a72bbe 100644 --- a/src/http_client_macos.mm +++ b/src/http_client_macos.mm @@ -28,9 +28,6 @@ #include "str_helpers.h" #include "version.h" -#import "AFHTTPClient.h" -#import "AFHTTPRequestOperation.h" - class http_exception : public std::runtime_error { @@ -42,18 +39,9 @@ class http_client::impl { public: - impl(http_client& owner, const std::string& url_prefix, int /*flags*/) : m_owner(owner) + impl(http_client& owner, const std::string& url_prefix, int /*flags*/) + : m_owner(owner), m_authHeader(nil) { - NSString *str = str::to_NS(url_prefix); - m_native = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:str]]; - - [m_native setDefaultHeader:@"Accept" value:@"application/json"]; - - // AFNetworking operations aren't CPU-bound, so shouldn't use the default queue - // size limits. This avoids request stalling at the cost of sending more requests - // to the server. - [m_native.operationQueue setMaxConcurrentOperationCount:NSIntegerMax]; - int majorVersion, minorVersion, patchVersion; NSOperatingSystemVersion macos = [[NSProcessInfo processInfo] operatingSystemVersion]; majorVersion = (int)macos.majorVersion; @@ -62,49 +50,48 @@ NSString *macos_str = (patchVersion == 0) ? [NSString stringWithFormat:@"%d.%d", majorVersion, minorVersion] : [NSString stringWithFormat:@"%d.%d.%d", majorVersion, minorVersion, patchVersion]; - [m_native setDefaultHeader:@"User-Agent" value:[NSString stringWithFormat:@"Poedit/%s (Mac OS X %@)", POEDIT_VERSION, macos_str]]; - } + NSString *user_agent = [NSString stringWithFormat:@"Poedit/%s (Mac OS X %@)", POEDIT_VERSION, macos_str]; - ~impl() - { - m_native = nil; + auto config = [NSURLSessionConfiguration defaultSessionConfiguration]; + config.HTTPAdditionalHeaders = @{ + @"User-Agent": user_agent, + @"Accept": @"application/json" + }; + + NSString *str = str::to_NS(url_prefix); + + m_baseURL = [NSURL URLWithString:str]; + m_session = [NSURLSession sessionWithConfiguration:config]; } - bool is_reachable() const + ~impl() { - return m_native.networkReachabilityStatus != AFNetworkReachabilityStatusNotReachable; + m_session = nil; } void set_authorization(const std::string& auth) { - if (!auth.empty()) - [m_native setDefaultHeader:@"Authorization" value:str::to_NS(auth)]; - else - [m_native clearAuthorizationHeader]; + m_authHeader = auth.empty() ? nil : str::to_NS(auth); } dispatch::future get(const std::string& url) { auto promise = std::make_shared>(); - [m_native getPath:str::to_NS(url) - parameters:nil - success:^(AFHTTPRequestOperation *op, NSData *responseData) - { - #pragma unused(op) + auto request = build_request(@"GET", url); + auto task = [m_session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { try { - promise->set_value(extract_json(responseData)); + if (handle_error(data, response, error, *promise)) + return; + promise->set_value(extract_json(data)); } catch (...) { dispatch::set_current_exception(promise); } - } - failure:^(AFHTTPRequestOperation *op, NSError *e) - { - handle_error(op, e, *promise); }]; + [task resume]; return promise->get_future(); } @@ -113,76 +100,82 @@ void set_authorization(const std::string& auth) { auto promise = std::make_shared>(); - NSString *outfile = str::to_NS(output_file); - NSURLRequest *request = [m_native requestWithMethod:@"GET" - path:str::to_NS(url) - parameters:nil]; - // Read the entire file into memory, then save to file. This is done instead of - // setting operation.outputStream to stream directly to the file because it that - // case the failure handler wouldn't receive JSON data with the error. - // - // This doesn't matter much, because files downloaded by Poedit are very small. - AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; - [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *op, NSData *data) - { - #pragma unused(op) - [data writeToFile:outfile atomically:YES]; - promise->set_value(); - } - failure:^(AFHTTPRequestOperation *op, NSError *e) - { - handle_error(op, e, *promise); - }]; + NSString *outputPath = str::to_NS(output_file); + auto request = build_request(@"GET", url); + auto task = [m_session downloadTaskWithRequest:request completionHandler:^(NSURL *location, NSURLResponse *response, NSError *error) { + try + { + if (handle_error(nil, response, error, *promise)) + return; - [m_native enqueueHTTPRequestOperation:operation]; + NSError *err = nil; + if (![[NSFileManager defaultManager] moveItemAtPath:[location path] toPath:outputPath error:&err]) + throw std::runtime_error(str::to_utf8([err localizedDescription])); + promise->set_value(); + } + catch (...) + { + dispatch::set_current_exception(promise); + } + }]; + [task resume]; return promise->get_future(); } - dispatch::future post(const std::string& url, const http_body_data& data) + dispatch::future post(const std::string& url, const http_body_data& body_data) { auto promise = std::make_shared>(); - NSMutableURLRequest *request = [m_native requestWithMethod:@"POST" - path:str::to_NS(url) - parameters:nil]; - - auto body = data.body(); - [request setValue:str::to_NS(data.content_type()) forHTTPHeaderField:@"Content-Type"]; + auto request = build_request(@"POST", url); + auto body = body_data.body(); + [request setValue:str::to_NS(body_data.content_type()) forHTTPHeaderField:@"Content-Type"]; [request setValue:[NSString stringWithFormat:@"%lu", body.size()] forHTTPHeaderField:@"Content-Length"]; [request setHTTPBody:[NSData dataWithBytes:body.data() length:body.size()]]; - AFHTTPRequestOperation *operation = [m_native HTTPRequestOperationWithRequest:request success:^(AFHTTPRequestOperation *op, NSData *responseData) - { - #pragma unused(op) + auto task = [m_session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { try { - promise->set_value(extract_json(responseData)); + if (handle_error(data, response, error, *promise)) + return; + promise->set_value(extract_json(data)); } catch (...) { dispatch::set_current_exception(promise); } - } - failure:^(AFHTTPRequestOperation *op, NSError *e) - { - handle_error(op, e, *promise); }]; - - [m_native enqueueHTTPRequestOperation:operation]; + [task resume]; return promise->get_future(); } private: + NSMutableURLRequest *build_request(NSString *method, const std::string& relative_url) + { + auto url = [NSURL URLWithString:str::to_NS(relative_url) relativeToURL:m_baseURL]; + auto request = [NSMutableURLRequest requestWithURL:url]; + request.HTTPMethod = method; + if (m_authHeader) + [request setValue:m_authHeader forHTTPHeaderField:@"Authorization"]; + return request; + } + template - void handle_error(AFHTTPRequestOperation *op, NSError *e, dispatch::promise& promise) + bool handle_error(NSData *data, NSURLResponse *response_, NSError *error, dispatch::promise& promise) { - int status_code = (int)op.response.statusCode; + NSHTTPURLResponse *response = (NSHTTPURLResponse*)response_; + int status_code = response ? (int)response.statusCode : 200; + + if (error == nil && status_code >= 200 && status_code < 300) + return false; // no error + std::string desc; - if (op.responseData && [op.response.MIMEType isEqualToString:@"application/json"]) + + // try to parse error description if present: + if (data && [response.MIMEType isEqualToString:@"application/json"]) { - NSData *reply = op.responseData; + NSData *reply = data; if (reply && reply.length > 0) { try @@ -192,12 +185,13 @@ void handle_error(AFHTTPRequestOperation *op, NSError *e, dispatch::promise& catch (...) {} // report original error if parsing broken } } + if (desc.empty()) { - desc = str::to_utf8([e localizedDescription]); - // Fixup some common cases to be more readable - if (status_code == 503 && desc == "Expected status code in (200-299), got 503") - desc = "Service Unavailable"; + if (error) + desc = str::to_utf8([error localizedDescription]); + else + desc = str::to_utf8([NSHTTPURLResponse localizedStringForStatusCode:status_code]); } try @@ -209,6 +203,8 @@ void handle_error(AFHTTPRequestOperation *op, NSError *e, dispatch::promise& { dispatch::set_current_exception(promise); } + + return true; } json extract_json(NSData *data) @@ -216,8 +212,12 @@ json extract_json(NSData *data) return json::parse(std::string((char*)data.bytes, data.length)); } +private: http_client& m_owner; - AFHTTPClient *m_native; + + NSURLSession *m_session; + NSURL *m_baseURL; + NSString *m_authHeader; }; @@ -230,11 +230,6 @@ json extract_json(NSData *data) { } -bool http_client::is_reachable() const -{ - return m_impl->is_reachable(); -} - void http_client::set_authorization(const std::string& auth) { m_impl->set_authorization(auth); @@ -254,3 +249,50 @@ json extract_json(NSData *data) { return m_impl->post(url, data); } + + +class http_reachability::impl +{ +public: + impl(const std::string& url) + { + NSString *host = [[NSURL URLWithString:str::to_NS(url)] host]; + m_nr = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, [host UTF8String]); + } + + ~impl() + { + if (m_nr) + { + SCNetworkReachabilityUnscheduleFromRunLoop(m_nr, CFRunLoopGetMain(), kCFRunLoopCommonModes); + CFRelease(m_nr); + } + } + + bool is_reachable() const + { + SCNetworkReachabilityFlags flags; + if (m_nr && SCNetworkReachabilityGetFlags(m_nr, &flags)) + return (flags & kSCNetworkReachabilityFlagsReachable) != 0; + + return true; // fallback assumption + } + +private: + SCNetworkReachabilityRef m_nr; +}; + + +http_reachability::http_reachability(const std::string& url) + : m_impl(new impl(url)) +{ +} + +http_reachability::~http_reachability() +{ +} + +bool http_reachability::is_reachable() const +{ + return m_impl->is_reachable(); +}