[Libreoffice-commits] online.git: 4 commits - ios/Mobile

2019-06-03 Thread Libreoffice Gerrit user
 ios/Mobile/Info.plist.in |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 13e99e83c3affcb37cb3516df5211a6728e35d9a
Author: Tor Lillqvist 
AuthorDate: Mon Jun 3 10:13:11 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Jun 3 17:19:57 2019 +0300

Improve wording for NSCameraUsageDescription

Change-Id: If8fb70b2c87e6abc00cc706cb81c561e28edc254

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 27d1a13aa..103b720d9 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -572,7 +572,7 @@
 
 
 NSCameraUsageDescription
-$(PRODUCT_NAME) requires access to the camera in order for you to 
be able to take images to be inserted while editing a document.
+$(PRODUCT_NAME) requires access to the camera in order for you to 
be able to take photos to be inserted while editing a document.
NSPhotoLibraryUsageDescription
 $(PRODUCT_NAME) requires access to the photo library in order for 
you to be able to insert images into documents.
 
commit c2c7d098e5fa521751b87024e4535c3fba65f083
Author: Tor Lillqvist 
AuthorDate: Mon Jun 3 10:10:58 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Jun 3 17:19:52 2019 +0300

Typo

Change-Id: Ic5b149f7d3f51c0095ffa975d477df0ed0f183d7

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 5c29ef8f2..27d1a13aa 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -574,6 +574,6 @@
 NSCameraUsageDescription
 $(PRODUCT_NAME) requires access to the camera in order for you to 
be able to take images to be inserted while editing a document.
NSPhotoLibraryUsageDescription
-$(PRODUCT_NAME) requires access to the photo library in order for 
you to be able to insertt images into documents.
+$(PRODUCT_NAME) requires access to the photo library in order for 
you to be able to insert images into documents.
 
 
commit 75347f27e74d037ebc8e657a773e4e52adc8a6c2
Author: Tor Lillqvist 
AuthorDate: Mon Jun 3 10:01:25 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Jun 3 17:19:46 2019 +0300

Add NSPhotoLibraryUsageDescription, too

Change-Id: Ib46c36a18e84c2b88bed7aef3ec8235b32eb5332

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 93779cb76..5c29ef8f2 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -573,5 +573,7 @@
 
 NSCameraUsageDescription
 $(PRODUCT_NAME) requires access to the camera in order for you to 
be able to take images to be inserted while editing a document.
+   NSPhotoLibraryUsageDescription
+$(PRODUCT_NAME) requires access to the photo library in order for 
you to be able to insertt images into documents.
 
 
commit dc1f9a9955dd7e8d953f272a56a959c83d77dcc0
Author: Tor Lillqvist 
AuthorDate: Mon Jun 3 09:54:14 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Mon Jun 3 17:19:40 2019 +0300

Use a more specific NSCameraUsageDescription

Change-Id: Idc780a3b5dacf0bed5b8c49f758f3fc5696d7338

diff --git a/ios/Mobile/Info.plist.in b/ios/Mobile/Info.plist.in
index 34f675d18..93779cb76 100644
--- a/ios/Mobile/Info.plist.in
+++ b/ios/Mobile/Info.plist.in
@@ -572,6 +572,6 @@
 
 
 NSCameraUsageDescription
-$(PRODUCT_NAME) camera use
+$(PRODUCT_NAME) requires access to the camera in order for you to 
be able to take images to be inserted while editing a document.
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: 4 commits - ios/Mobile

2019-04-26 Thread Libreoffice Gerrit user
 ios/Mobile/AppDelegate.mm |  119 ++
 1 file changed, 78 insertions(+), 41 deletions(-)

New commits:
commit bf520d5fa5d0595ddc3d06402861a9ac3bf51f95
Author: Tor Lillqvist 
AuthorDate: Fri Apr 26 12:01:25 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Fri Apr 26 12:04:28 2019 +0300

Log the timestamp of the template file at its site and of its cached version

diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index d1ec58119..5cbc51da3 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -130,6 +130,10 @@ static void updateTemplates(NSData *data, NSURLResponse 
*response)
 
 NSDate *cachedTemplateDate = 
[[[NSFileManager defaultManager] attributesOfItemAtPath:[fileForTemplate path] 
error:nil] objectForKey:NSFileModificationDate];
 
+LOG_INF("Template at " << [[url 
absoluteString] UTF8String] << " timestamp: "
+<< [[templateDate 
descriptionWithLocale:nil] UTF8String] << ", cached template timestamp: "
+<< [[cachedTemplateDate 
descriptionWithLocale:nil] UTF8String]);
+
 if ([templateDate 
compare:cachedTemplateDate] == NSOrderedDescending) {
 downloadTemplate(url, 
fileForTemplate);
 }
commit db9208d36417490ea1a0a536c701233279a49e0d
Author: Tor Lillqvist 
AuthorDate: Fri Apr 26 11:44:28 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Fri Apr 26 12:04:20 2019 +0300

tdf#124918: Don't crash on invalid URLs in the template list file

diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index d01712931..d1ec58119 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -102,51 +102,55 @@ static void updateTemplates(NSData *data, NSURLResponse 
*response)
 NSString *line = [NSString stringWithUTF8String:buf.data()];
 
 NSURL *url = [NSURL URLWithString:line];
-NSString *baseName = [url lastPathComponent];
-
-NSString *hash = [[NSData dataWithBytes:buf.data() 
length:length] base64EncodedStringWithOptions:0];
-[urlHashes addObject:hash];
-
-NSString *directoryForTemplate = [downloadedTemplates 
stringByAppendingString:hash];
-
-NSURL *fileForTemplate = [NSURL 
fileURLWithPath:[directoryForTemplate stringByAppendingString:[@"/" 
stringByAppendingString:baseName]]];
-
-// If we have that template, check whether it is up-to-date
-BOOL isDirectory;
-if ([[NSFileManager defaultManager] 
fileExistsAtPath:directoryForTemplate isDirectory:] &&
-isDirectory) {
-NSMutableURLRequest *req = [[NSURLRequest 
requestWithURL:url] mutableCopy];
-[req setHTTPMethod:@"HEAD"];
-[[[NSURLSession sharedSession] dataTaskWithRequest:req
- 
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
-if (error == nil && [response 
isKindOfClass:[NSHTTPURLResponse class]] && [(NSHTTPURLResponse*)response 
statusCode] == 200) {
-NSString *lastModified = 
[[(NSHTTPURLResponse*)response allHeaderFields] objectForKey:@"Last-Modified"];
-NSDateFormatter *df = [[NSDateFormatter 
alloc] init];
-df.dateFormat = @"EEE, dd MMM  
HH:mm:ss z";
-NSDate *templateDate = [df 
dateFromString:lastModified];
-
-NSDate *cachedTemplateDate = 
[[[NSFileManager defaultManager] attributesOfItemAtPath:[fileForTemplate path] 
error:nil] objectForKey:NSFileModificationDate];
-
-if ([templateDate 
compare:cachedTemplateDate] == NSOrderedDescending) {
-downloadTemplate(url, fileForTemplate);
+if (url == nil)
+LOG_ERR("Invalid URL in template file: " << [line 
UTF8String]);
+else {
+NSString *baseName = [url lastPathComponent];
+
+NSString *hash = [[NSData dataWithBytes:buf.data() 
length:length] base64EncodedStringWithOptions:0];
+[urlHashes addObject:hash];
+
+NSString *directoryForTemplate = [downloadedTemplates 
stringByAppendingString:hash];
+
+NSURL *fileForTemplate = [NSURL 
fileURLWithPath:[directoryForTemplate stringByAppendingString:[@"/" 
stringByAppendingString:baseName]]];
+
+// If we have that template, check whether it is up-to-date
+BOOL