Skip to content

Commit

Permalink
Merge pull request #7476 from hansemannn/TIMOB-20015
Browse files Browse the repository at this point in the history
[TIMOB-20015] Refactor deprecation macros + usages
  • Loading branch information
cheekiatng committed Nov 20, 2015
2 parents cd8b207 + b7866e5 commit 55f45d0
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 112 deletions.
2 changes: 1 addition & 1 deletion iphone/Classes/CalendarModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ -(NSNumber*) hasCalendarPermissions:(id)unused

-(void) requestEventsAuthorization:(id)args
{
DEPRECATED_REPLACED(@"Calendar.requestEventsAuthorization", @"5.1.0", @"Calendar.requestCalendarPermissions");
DEPRECATED_REPLACED(@"Calendar.requestEventsAuthorization()", @"5.1.0", @"Calendar.requestCalendarPermissions()");
[self requestCalendarPermissions:args];
}

Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/ContactsModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ -(NSNumber*)hasContactsPermissions:(id)unused

-(void)requestAuthorization:(id)args
{
DEPRECATED_REPLACED(@"Calendar.requestAuthorization", @"5.1.0", @"Calendar.requestContactsPermissions");
DEPRECATED_REPLACED(@"Calendar.requestAuthorization()", @"5.1.0", @"Calendar.requestContactsPermissions()");
[self requestContactsPermissions:args];
}

Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/GeolocationModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ -(NSNumber*)hasLocationPermissions:(id)args

-(void)requestAuthorization:(id)value
{
DEPRECATED_REPLACED(@"Geolocation.requestAuthorization", @"5.1.0", @"Geolocation.requestLocationPermissions");
DEPRECATED_REPLACED(@"Geolocation.requestAuthorization()", @"5.1.0", @"Geolocation.requestLocationPermissions()");
[self requestLocationPermissions:@[value, [NSNull null]]];
}

Expand Down
12 changes: 6 additions & 6 deletions iphone/Classes/MediaModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -225,27 +225,27 @@ -(NSString*)AUDIO_SESSION_PORT_CARAUDIO
//Constants for AudioSessions
-(NSNumber*)AUDIO_SESSION_MODE_AMBIENT
{
DEPRECATED_REPLACED(@"Media.AUDIO_SESSION_MODE_AMBIENT", @"3.4.2", @"Ti.Media.AUDIO_SESSION_CATEGORY_AMBIENT");
DEPRECATED_REPLACED(@"Media.AUDIO_SESSION_MODE_AMBIENT", @"3.4.2", @"Media.AUDIO_SESSION_CATEGORY_AMBIENT");
return [NSNumber numberWithUnsignedInt:kAudioSessionCategory_AmbientSound];
}
-(NSNumber*)AUDIO_SESSION_MODE_SOLO_AMBIENT
{
DEPRECATED_REPLACED(@"Media.AUDIO_SESSION_MODE_SOLO_AMBIENT", @"3.4.2", @"Ti.Media.AUDIO_SESSION_CATEGORY_SOLO_AMBIENT");
DEPRECATED_REPLACED(@"Media.AUDIO_SESSION_MODE_SOLO_AMBIENT", @"3.4.2", @"Media.AUDIO_SESSION_CATEGORY_SOLO_AMBIENT");
return [NSNumber numberWithUnsignedInt:kAudioSessionCategory_SoloAmbientSound];
}
-(NSNumber*)AUDIO_SESSION_MODE_PLAYBACK
{
DEPRECATED_REPLACED(@"Media.AUDIO_SESSION_MODE_PLAYBACK", @"3.4.2", @"Ti.Media.AUDIO_SESSION_CATEGORY_PLAYBACK");
DEPRECATED_REPLACED(@"Media.AUDIO_SESSION_MODE_PLAYBACK", @"3.4.2", @"Media.AUDIO_SESSION_CATEGORY_PLAYBACK");
return [NSNumber numberWithUnsignedInt:kAudioSessionCategory_MediaPlayback];
}
-(NSNumber*)AUDIO_SESSION_MODE_RECORD
{
DEPRECATED_REPLACED(@"Media.AUDIO_SESSION_MODE_RECORD", @"3.4.2", @"Ti.Media.AUDIO_SESSION_CATEGORY_RECORD");
DEPRECATED_REPLACED(@"Media.AUDIO_SESSION_MODE_RECORD", @"3.4.2", @"Media.AUDIO_SESSION_CATEGORY_RECORD");
return [NSNumber numberWithUnsignedInt:kAudioSessionCategory_RecordAudio];
}
-(NSNumber*)AUDIO_SESSION_MODE_PLAY_AND_RECORD
{
DEPRECATED_REPLACED(@"Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD", @"3.4.2", @"Ti.Media.AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD");
DEPRECATED_REPLACED(@"Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD", @"3.4.2", @"Media.AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD");
return [NSNumber numberWithUnsignedInt:kAudioSessionCategory_PlayAndRecord];
}

Expand Down Expand Up @@ -343,7 +343,7 @@ -(NSNumber*)MUSIC_MEDIA_TYPE_ALL
// Deprecated old-school video control modes, mapped to the new values
-(NSNumber*)VIDEO_CONTROL_VOLUME_ONLY
{
DEPRECATED_REPLACED(@"Media.VIDEO_CONTROL_VOLUME_ONLY", @"1.8.0", @"Ti.Media.VIDEO_CONTROL_EMBEDDED");
DEPRECATED_REPLACED(@"Media.VIDEO_CONTROL_VOLUME_ONLY", @"1.8.0", @"Media.VIDEO_CONTROL_EMBEDDED");
return [self VIDEO_CONTROL_EMBEDDED];
}
-(NSNumber*)VIDEO_CONTROL_HIDDEN
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiAppiOSUserActivityProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ -(NSNumber*)isValid

-(NSNumber*)supported
{
DEPRECATED_REPLACED(@"App.IOS.UserActivity.getSupported()" ,@"5.1.0",@"Titanium.App.IOS.UserActivity.isSupported()")
DEPRECATED_REPLACED(@"App.iOS.UserActivity.getSupported()" ,@"5.1.0",@"App.iOS.UserActivity.isSupported()")
return NUMBOOL(_supported);
}

Expand Down
6 changes: 3 additions & 3 deletions iphone/Classes/TiBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,13 @@ return map;\
}\

#define DEPRECATED_REMOVED(api,in,removed) \
DebugLog(@"[WARN] Ti%@.%@ DEPRECATED in %@: REMOVED in %@",@"tanium",api,in,removed);
DebugLog(@"[WARN] Ti.%@ DEPRECATED in %@: REMOVED in %@",api,in,removed);

#define DEPRECATED_REPLACED_REMOVED(api,in,removed,newapi) \
DebugLog(@"[WARN] Ti%@.%@ DEPRECATED in %@, in favor of %@: REMOVED in %@",@"tanium",api,in,newapi,removed);
DebugLog(@"[WARN] Ti.%@ DEPRECATED in %@, in favor of Ti.%@: REMOVED in %@",api,in,newapi,removed);

#define DEPRECATED_REPLACED(api,in,newapi) \
DebugLog(@"[WARN] Ti%@.%@ DEPRECATED in %@, in favor of %@.",@"tanium",api,in,newapi);
DebugLog(@"[WARN] Ti.%@ DEPRECATED in %@, in favor of Ti.%@",api,in,newapi);

#define NUMBOOL(x) \
[NSNumber numberWithBool:x]\
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiFilesystemBlobProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ -(id)writeable
{
// Note: Despite previous incarnations claiming writeable is the proper API,
// writable is the correct spelling.
DEPRECATED_REPLACED(@"Filesystem.FileProxy.writeable",@"1.8.1",@"Ti.Filesystem.FileProxy.writable");
DEPRECATED_REPLACED(@"Filesystem.FileProxy.writeable",@"1.8.1",@"Filesystem.FileProxy.writable");
return [self writable];
}

Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiFilesystemFileProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ -(id)writeable
{
// Note: Despite previous incarnations claiming writeable is the proper API,
// writable is the correct spelling.
DEPRECATED_REPLACED(@"Filesystem.FileProxy.writeable",@"1.8.1",@"Ti.Filesystem.FileProxy.writable");
DEPRECATED_REPLACED(@"Filesystem.FileProxy.writeable",@"1.8.1",@"Filesystem.FileProxy.writable");
return [self writable];
}

Expand Down
8 changes: 4 additions & 4 deletions iphone/Classes/TiMediaVideoPlayerProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -323,25 +323,25 @@ -(NSNumber*)allowsAirPlay
// < 3.2 functions for controls - deprecated
-(void)setMovieControlMode:(NSNumber *)value
{
DEPRECATED_REPLACED(@"Media.VideoPlayer.movieControlMode", @"1.8.0", @"Ti.Media.VideoPlayer.mediaControlStyle");
DEPRECATED_REPLACED(@"Media.VideoPlayer.movieControlMode", @"1.8.0", @"Media.VideoPlayer.mediaControlStyle");
[self setMediaControlStyle:value];
}

-(NSNumber*)movieControlMode
{
DEPRECATED_REPLACED(@"Media.VideoPlayer.movieControlMode", @"1.8.0", @"Ti.Media.VideoPlayer.mediaControlStyle");
DEPRECATED_REPLACED(@"Media.VideoPlayer.movieControlMode", @"1.8.0", @"Media.VideoPlayer.mediaControlStyle");
return [self mediaControlStyle];
}

-(void)setMovieControlStyle:(NSNumber *)value
{
DEPRECATED_REPLACED(@"Media.VideoPlayer.movieControlStyle", @"1.8.0", @"Ti.Media.VideoPlayer.mediaControlStyle");
DEPRECATED_REPLACED(@"Media.VideoPlayer.movieControlStyle", @"1.8.0", @"Media.VideoPlayer.mediaControlStyle");
[self setMediaControlStyle:value];
}

-(NSNumber*)movieControlStyle
{
DEPRECATED_REPLACED(@"Media.VideoPlayer.movieControlStyle", @"1.8.0", @"Ti.Media.VideoPlayer.mediaControlStyle");
DEPRECATED_REPLACED(@"Media.VideoPlayer.movieControlStyle", @"1.8.0", @"Media.VideoPlayer.mediaControlStyle");
return [self mediaControlStyle];
}

Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiUIScrollableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ -(void)setPagingControlHeight_:(id)args
-(void)setPageControlHeight_:(id)arg
{
// for 0.8 backwards compat, renamed all for consistency
DEPRECATED_REPLACED(@"ScrollableView.PageControlHeight()", @"2.1.0", @"Ti.ScrollableView.PagingControlHeight()");
DEPRECATED_REPLACED(@"UI.ScrollableView.pageControlHeight", @"2.1.0", @"UI.ScrollableView.pagingControlHeight");
[self setPagingControlHeight_:arg];
}

Expand Down

0 comments on commit 55f45d0

Please sign in to comment.