1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-11 17:38:38 +00:00

Merge remote-tracking branch 'origin/master' into notification-widget

This commit is contained in:
Toxblh 2019-11-28 21:48:48 +03:00
commit a6b52ebe95
2 changed files with 27 additions and 27 deletions

View File

@ -17,9 +17,9 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.24</string> <string>0.25</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>296</string> <string>297</string>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string> <string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>

View File

@ -88,9 +88,9 @@ class YandexWeatherBarItem: CustomButtonTouchBarItem, CLLocationManagerDelegate
func getWeatherUrl() -> String { func getWeatherUrl() -> String {
if location != nil { if location != nil {
return "https://yandex.ru/pogoda/?lat=\(location.coordinate.latitude)&lon=\(location.coordinate.longitude)" return "https://yandex.ru/pogoda/?lat=\(location.coordinate.latitude)&lon=\(location.coordinate.longitude)?lang=ru"
} else { } else {
return "https://yandex.ru/pogoda/" // Yandex will try to determine your location by default return "https://yandex.ru/pogoda/?lang=ru" // Yandex will try to determine your location by default
} }
} }
@ -131,9 +131,9 @@ extension String {
func matchingStrings(regex: String) -> [[String]] { func matchingStrings(regex: String) -> [[String]] {
guard let regex = try? NSRegularExpression(pattern: regex, options: []) else { return [] } guard let regex = try? NSRegularExpression(pattern: regex, options: []) else { return [] }
let nsString = self as NSString let nsString = self as NSString
let results = regex.matches(in: self, options: [], range: NSMakeRange(0, nsString.length)) let results = regex.matches(in: self, options: [], range: NSMakeRange(0, nsString.length))
return results.map { result in return results.map { result in
(0..<result.numberOfRanges).map { (0 ..< result.numberOfRanges).map {
result.range(at: $0).location != NSNotFound result.range(at: $0).location != NSNotFound
? nsString.substring(with: result.range(at: $0)) ? nsString.substring(with: result.range(at: $0))
: "" : ""