Skip to content

Commit

Permalink
1.9.1 (#128)
Browse files Browse the repository at this point in the history
- use Realm in replace of CoreData as database
- fix: unable to detect embedded index in some situations
- fix: unable to cancel erroneous download tasks
  • Loading branch information
automactic authored May 29, 2018
1 parent 00d1b55 commit c755738
Show file tree
Hide file tree
Showing 56 changed files with 3,336 additions and 2,897 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ AppStore/screenshots
Shared/Dependencies
*.zim

\.idea

# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
Expand Down
1,350 changes: 707 additions & 643 deletions Kiwix.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
<key>ArticlePreview.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>7</integer>
<integer>4</integer>
</dict>
<key>Bookmarks 2.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>12</integer>
<integer>6</integer>
</dict>
<key>Bookmarks.xcscheme</key>
<dict>
<key>isShown</key>
<true/>
<true />
<key>orderHint</key>
<integer>3</integer>
</dict>
Expand All @@ -42,107 +42,107 @@
<key>9706DA941E674F5D0005FE0F</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>9706DAA81E6750EB0005FE0F</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>9722121A1D3ECCFE00C0DCF2</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>973BCCE81CEB3FA400F10B44</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>973BCCFB1CEB3FA400F10B44</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>973BCD061CEB3FA500F10B44</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>975FDAD61F6082DA00A10E8C</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>9779C2FD1D4574280064CC8E</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>9779C3121D4575AD0064CC8E</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>978C9DBD1E4245B60078BFF7</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>979315801E5127930093D3BA</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>979315901E5127930093D3BA</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>9793159B1E5127940093D3BA</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>97A2AB871C1B80FF00052E74</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>97A2AB9E1C1B80FF00052E74</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>97A2ABA91C1B810000052E74</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>97A36C241F8C21210079B452</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>97C575F1202CB0E800E37502</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>97CF3EEA1D428F9600AE82FE</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>97E609EE1D103DED00EBCB9D</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
<key>97FC27D01E69CE10008B2348</key>
<dict>
<key>primary</key>
<true/>
<true />
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,90 +2,4 @@
<Bucket
type = "0"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "UIViewAlertForUnsatisfiableConstraints"
moduleName = "">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "UIViewAlertForUnsatisfiableConstraints"
moduleName = "UIKit"
usesParentBreakpointCondition = "Yes"
offsetFromSymbolStart = "0">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Shared/Procedure/LibraryRefreshProcedure.swift"
timestampString = "547074450.8264019"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "108"
endingLineNumber = "108"
landmarkName = "execute()"
landmarkType = "7">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Kiwix.(ProcessProcedure in _6965C0AAE2F8E23C2E8F87291CBA11F5).__ivar_destroyer"
moduleName = "Kiwix"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/chrisli/Developer/Kiwix/Shared/Procedure/LibraryRefreshProcedure.swift"
timestampString = "547242682.849393"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "0"
endingLineNumber = "0"
offsetFromSymbolStart = "4">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Kiwix.(ProcessProcedure in _6965C0AAE2F8E23C2E8F87291CBA11F5).__deallocating_deinit"
moduleName = "Kiwix"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/chrisli/Developer/Kiwix/Shared/Procedure/LibraryRefreshProcedure.swift"
timestampString = "547242682.851963"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "0"
endingLineNumber = "0"
offsetFromSymbolStart = "4">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "Kiwix.(ProcessProcedure in _6965C0AAE2F8E23C2E8F87291CBA11F5).init(disableAutomaticFinishing: Swift.Bool) -&gt; Kiwix.(ProcessProcedure in _6965C0AAE2F8E23C2E8F87291CBA11F5)"
moduleName = "Kiwix"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/chrisli/Developer/Kiwix/Shared/Procedure/LibraryRefreshProcedure.swift"
timestampString = "547242682.8541"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "109"
endingLineNumber = "109"
offsetFromSymbolStart = "16">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target 'iOS' do

pod 'SwiftyUserDefaults'
pod 'ProcedureKit/All', :path => 'submodules/ProcedureKit'
pod 'RealmSwift'
end

target 'macOS' do
Expand All @@ -14,7 +15,6 @@ target 'macOS' do

pod 'SwiftyUserDefaults'
pod 'ProcedureKit/All', :path => 'submodules/ProcedureKit'
pod 'Realm', :inhibit_warnings => true
pod 'RealmSwift'
end

Expand Down
17 changes: 8 additions & 9 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ PODS:
- ProcedureKit/Network (4.5.0):
- ProcedureKit/Standard
- ProcedureKit/Standard (4.5.0)
- Realm (3.3.2):
- Realm/Headers (= 3.3.2)
- Realm/Headers (3.3.2)
- RealmSwift (3.3.2):
- Realm (= 3.3.2)
- Realm (3.5.0):
- Realm/Headers (= 3.5.0)
- Realm/Headers (3.5.0)
- RealmSwift (3.5.0):
- Realm (= 3.5.0)
- SwiftyUserDefaults (3.0.1)

DEPENDENCIES:
- ProcedureKit/All (from `submodules/ProcedureKit`)
- Realm
- RealmSwift
- SwiftyUserDefaults

Expand All @@ -35,10 +34,10 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
ProcedureKit: e881776c3769cf189ff3ceff90aabef2a44be8b9
Realm: d927fbf66df5532cfafc08afb5f7e53ded37b894
RealmSwift: 4e903a494e05d866581d69ad6f7e7b879d446baf
Realm: 0378021c424e4e2bd6a0e63b27881e929d9b9ad1
RealmSwift: 3322562622fda2ad596985ead4d8d8be30cf838c
SwiftyUserDefaults: 3d273b1739b68ada3145dc754a70ec775bc5c8be

PODFILE CHECKSUM: 293eda37346c95dde58e84b510e3895e0d701093
PODFILE CHECKSUM: 9108d5cd0a7e2decd6f81e0c4683dd82d886e0ec

COCOAPODS: 1.5.0
1 change: 0 additions & 1 deletion Shared/Kiwix-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
//

#import "ZimMultiReader.h"
#import "ZimMetaData.h"
25 changes: 25 additions & 0 deletions Shared/Model/Bookmark.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// Bookmark.swift
// iOS
//
// Created by Chris Li on 4/27/18.
// Copyright © 2018 Chris Li. All rights reserved.
//

import RealmSwift

class Bookmark: Object{
@objc dynamic var path = ""
@objc dynamic var zimFile: ZimFile?

@objc dynamic var title = ""
@objc dynamic var snippet: String?
@objc dynamic var thumbImagePath: String?
@objc dynamic var date: Date?

var thumbImageData: Data? {
guard let thumbImagePath = thumbImagePath, let zimFile = zimFile,
let url = URL(bookID: zimFile.id, contentPath: thumbImagePath) else {return nil}
return try? Data(contentsOf: url)
}
}
22 changes: 22 additions & 0 deletions Shared/Model/RealmConfig.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// Database.swift
// iOS
//
// Created by Chris Li on 4/10/18.
// Copyright © 2018 Chris Li. All rights reserved.
//

import RealmSwift

extension Realm {
static func resetDatabase() {
guard let url = Realm.defaultConfig.fileURL else {return}
try? FileManager.default.removeItem(at: url)
}

static let defaultConfig: Realm.Configuration = {
var config = Realm.Configuration()
config.fileURL = try! FileManager.default.url(for: .libraryDirectory, in: .userDomainMask, appropriateFor: nil, create: false).appendingPathComponent("realm")
return config
}()
}
Loading

0 comments on commit c755738

Please sign in to comment.