Skip to content

Commit 7290f57

Browse files
author
Christopher J. Brody
committed
rename PSPDFThreadSafeMutableDictionary
to CustomPSPDFThreadSafeMutableDictionary and completely remove PSPDFThreadSafeMutableDictionary.h (cordova-sqlite-storage 4.0.0-pre1)
1 parent 6c02011 commit 7290f57

File tree

6 files changed

+29
-48
lines changed

6 files changed

+29
-48
lines changed

CHANGES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Changes
22

3-
#### cordova-sqlite-storage 3.4.2-dev
3+
#### cordova-sqlite-storage 4.0.0-pre1
44

5-
TBD
5+
- rename PSPDFThreadSafeMutableDictionary to CustomPSPDFThreadSafeMutableDictionary and completely remove PSPDFThreadSafeMutableDictionary.h
66

77
#### cordova-sqlite-storage 3.4.1
88

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cordova-sqlite-storage",
3-
"version": "3.4.2-dev",
3+
"version": "4.0.0-pre1",
44
"description": "Native interface to SQLite for PhoneGap/Cordova - cordova-sqlite-storage plugin version",
55
"cordova": {
66
"id": "cordova-sqlite-storage",

plugin.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
id="cordova-sqlite-storage"
5-
version="3.4.2-dev">
5+
version="4.0.0-pre1">
66

77
<name>Cordova sqlite storage plugin - cordova-sqlite-storage plugin version</name>
88

@@ -51,8 +51,7 @@
5151
<header-file src="src/ios/SQLitePlugin.h" />
5252
<source-file src="src/ios/SQLitePlugin.m" />
5353

54-
<header-file src="src/ios/PSPDFThreadSafeMutableDictionary.h" />
55-
<source-file src="src/ios/PSPDFThreadSafeMutableDictionary.m"
54+
<source-file src="src/ios/CustomPSPDFThreadSafeMutableDictionary.m"
5655
compiler-flags="-w" />
5756

5857
<header-file src="node_modules/cordova-sqlite-storage-dependencies/sqlite3.h" />
@@ -72,8 +71,7 @@
7271
<header-file src="src/ios/SQLitePlugin.h" />
7372
<source-file src="src/ios/SQLitePlugin.m" />
7473

75-
<header-file src="src/ios/PSPDFThreadSafeMutableDictionary.h" />
76-
<source-file src="src/ios/PSPDFThreadSafeMutableDictionary.m"
74+
<source-file src="src/ios/CustomPSPDFThreadSafeMutableDictionary.m"
7775
compiler-flags="-w" />
7876

7977
<header-file src="node_modules/cordova-sqlite-storage-dependencies/sqlite3.h" />

src/ios/PSPDFThreadSafeMutableDictionary.m renamed to src/ios/CustomPSPDFThreadSafeMutableDictionary.m

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
//
2-
// PSPDFThreadSafeMutableDictionary.m
2+
// CustomPSPDFThreadSafeMutableDictionary.m
3+
//
4+
// renamed from PSPDFThreadSafeMutableDictionary.m
5+
//
6+
// Copyright (c) 2019-present Christopher J. Brody (aka Chris Brody)
37
//
48
// Copyright (c) 2013 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
59
//
@@ -23,29 +27,31 @@
2327

2428
#import <Foundation/Foundation.h>
2529

26-
/* ** ALREADY INCLUDED BY #import "PSPDFThreadSafeMutableDictionary.h"
2730
// Dictionary-Subclasss whose primitive operations are thread safe.
28-
@interface PSPDFThreadSafeMutableDictionary : NSMutableDictionary
31+
@interface CustomPSPDFThreadSafeMutableDictionary : NSMutableDictionary
2932
@end
30-
// */
3133

3234
// ----------------------------------------------------------------
3335

3436
//
35-
// PSPDFThreadSafeMutableDictionary.m
37+
// CustomPSPDFThreadSafeMutableDictionary.m
38+
//
39+
// renamed from PSPDFThreadSafeMutableDictionary.m
40+
//
3641
// PSPDFKit
3742
//
3843
// Copyright (c) 2013 PSPDFKit GmbH. All rights reserved.
3944
//
4045

41-
#import "PSPDFThreadSafeMutableDictionary.h"
46+
// #import "PSPDFThreadSafeMutableDictionary.h"
47+
4248
#import <libkern/OSAtomic.h>
4349

4450
#define LOCKED(...) OSSpinLockLock(&_lock); \
4551
__VA_ARGS__; \
4652
OSSpinLockUnlock(&_lock);
4753

48-
@implementation PSPDFThreadSafeMutableDictionary {
54+
@implementation CustomPSPDFThreadSafeMutableDictionary {
4955
OSSpinLock _lock;
5056
NSMutableDictionary *_dictionary; // Class Cluster!
5157
}
@@ -145,8 +151,8 @@ - (void)performLockedWithDictionary:(void (^)(NSDictionary *dictionary))block {
145151
- (BOOL)isEqual:(id)object {
146152
if (object == self) return YES;
147153

148-
if ([object isKindOfClass:PSPDFThreadSafeMutableDictionary.class]) {
149-
PSPDFThreadSafeMutableDictionary *other = object;
154+
if ([object isKindOfClass:CustomPSPDFThreadSafeMutableDictionary.class]) {
155+
CustomPSPDFThreadSafeMutableDictionary *other = object;
150156
__block BOOL isEqual = NO;
151157
[other performLockedWithDictionary:^(NSDictionary *dictionary) {
152158
[self performLockedWithDictionary:^(NSDictionary *otherDictionary) {

src/ios/PSPDFThreadSafeMutableDictionary.h

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/ios/SQLitePlugin.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
#import "sqlite3.h"
1212

13-
#import "PSPDFThreadSafeMutableDictionary.h"
14-
1513
// Defines Macro to only log lines when in DEBUG mode
1614
#ifdef DEBUG
1715
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
@@ -23,6 +21,13 @@
2321
# error "Missing objc_arc feature"
2422
#endif
2523

24+
// CustomPSPDFThreadSafeMutableDictionary interface copied from
25+
// CustomPSPDFThreadSafeMutableDictionary.m:
26+
//
27+
// Dictionary-Subclasss whose primitive operations are thread safe.
28+
@interface CustomPSPDFThreadSafeMutableDictionary : NSMutableDictionary
29+
@end
30+
2631
@implementation SQLitePlugin
2732

2833
@synthesize openDBs;
@@ -33,7 +38,7 @@ -(void)pluginInitialize
3338
DLog(@"Initializing SQLitePlugin");
3439

3540
{
36-
openDBs = [PSPDFThreadSafeMutableDictionary dictionaryWithCapacity:0];
41+
openDBs = [CustomPSPDFThreadSafeMutableDictionary dictionaryWithCapacity:0];
3742
appDBPaths = [NSMutableDictionary dictionaryWithCapacity:0];
3843

3944
NSString *docs = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex: 0];

0 commit comments

Comments
 (0)