-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-23495] iOS: Add Ti.Filesystem.File "parent" property (parity) #9285
Merged
Merged
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
744bb6f
[TIMOB-23495] Rework TiFilesystemFile, add parent
hansemannn d93978a
[TIMOB-23495] Add unit tests
hansemannn ffaf8d9
Restore with master
hansemannn b94401c
[TIMOB-23495] Deprecate getParent() for parity
hansemannn ca54975
[TIMOB-23495] Migrate unit-tests from latest mocha
hansemannn 621f0d2
[TIMOB-23495] Fix unit-test
hansemannn 026f27c
Merge branch 'master' into TIMOB-23495
hansemannn b5129c6
Merge branch 'master' into TIMOB-23495
mukherjee2 28a9355
Update ti.filesystem.file.test.js
hansemannn 3214b78
Merge branch 'master' into TIMOB-23495
vijaysingh-axway fca4213
Update ti.filesystem.file.test.js
hansemannn File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -406,11 +406,17 @@ - (id)extension:(id)args | |
return [path pathExtension]; | ||
} | ||
|
||
- (id)getParent:(id)args | ||
- (NSString *)getParent:(id)args | ||
{ | ||
DEPRECATED_REPLACED(@"Filesystem.File.getParent()", @"7.0.0", @"Filesystem.File.parent"); | ||
return [path stringByDeletingLastPathComponent]; | ||
} | ||
|
||
- (TiFilesystemFileProxy *)parent | ||
{ | ||
return [[[TiFilesystemFileProxy alloc] initWithFile:[path stringByDeletingLastPathComponent]] autorelease]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sgtcoolguy Sorry to bug you on this, but to confirm:
|
||
} | ||
|
||
- (id)name | ||
{ | ||
return [path lastPathComponent]; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we actually need to deprecate this and not just remove it? Can we have a parent property that holds a Ti.Filesystem.File return value, but also have a getParent() method that returns the path of the parent as a String?
This is a breaking change, so we need to deprecate for one major version first... I assume there are apps out there relying on this getter existing and returning a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only removed it because the getter is generated automatically by using
- (NSString *)parent
. But I assume we could match Android's behavior here wherebygetParent
returns a file andparent
a string. @infosia how does Windows behave here? Although I don't like that the getter of a property returns something different (oddly, I'd rather match the most-useful behavior). Maybe deprecate the difference on Android?