Remove dispatch_get_current_queue() iOS6 deprecation notices. #65

Closed
wants to merge 1 commit into
from
@@ -239,7 +239,7 @@ - (void)createAndStartDeleteTimer
- (NSUInteger)saveThreshold
{
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
{
return saveThreshold;
}
@@ -279,15 +279,15 @@ - (void)setSaveThreshold:(NSUInteger)threshold
}
};
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
block();
else
dispatch_async(loggerQueue, block);
}
- (NSTimeInterval)saveInterval
{
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
{
return saveInterval;
}
@@ -362,15 +362,15 @@ - (void)setSaveInterval:(NSTimeInterval)interval
}
};
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
block();
else
dispatch_async(loggerQueue, block);
}
- (NSTimeInterval)maxAge
{
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
{
return maxAge;
}
@@ -451,15 +451,15 @@ - (void)setMaxAge:(NSTimeInterval)interval
}
};
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
block();
else
dispatch_async(loggerQueue, block);
}
- (NSTimeInterval)deleteInterval
{
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
{
return deleteInterval;
}
@@ -533,15 +533,15 @@ - (void)setDeleteInterval:(NSTimeInterval)interval
}
};
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
block();
else
dispatch_async(loggerQueue, block);
}
- (BOOL)deleteOnEverySave
{
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
{
return deleteOnEverySave;
}
@@ -564,7 +564,7 @@ - (void)setDeleteOnEverySave:(BOOL)flag
deleteOnEverySave = flag;
};
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
block();
else
dispatch_async(loggerQueue, block);
@@ -581,7 +581,7 @@ - (void)savePendingLogEntries
[self performSaveAndSuspendSaveTimer];
}};
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
block();
else
dispatch_async(loggerQueue, block);
@@ -594,7 +594,7 @@ - (void)deleteOldLogEntries
[self performDelete];
}};
- if (dispatch_get_current_queue() == loggerQueue)
+ if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue)
block();
else
dispatch_async(loggerQueue, block);
View
@@ -528,7 +528,7 @@ - (unsigned long long)maximumFileSize
// Note: The internal implementation should access the maximumFileSize variable directly,
// but if we forget to do this, then this method should at least work properly.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
return maximumFileSize;
@@ -562,7 +562,7 @@ - (void)setMaximumFileSize:(unsigned long long)newMaximumFileSize
}};
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();
@@ -586,7 +586,7 @@ - (NSTimeInterval)rollingFrequency
// Note: The internal implementation should access the rollingFrequency variable directly,
// but if we forget to do this, then this method should at least work properly.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
return rollingFrequency;
@@ -620,7 +620,7 @@ - (void)setRollingFrequency:(NSTimeInterval)newRollingFrequency
}};
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();
@@ -700,7 +700,7 @@ - (void)rollLogFile
[self rollLogFileNow];
}};
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();
View
@@ -868,7 +868,7 @@ - (id)initWithLogMsg:(NSString *)msg
machThreadID = pthread_mach_thread_np(pthread_self());
- queueLabel = dd_str_copy(dispatch_queue_get_label(dispatch_get_current_queue()));
+ queueLabel = dd_str_copy(dispatch_queue_get_label(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)));
threadName = [[NSThread currentThread] name];
}
@@ -996,7 +996,7 @@ - (void)logMessage:(DDLogMessage *)logMessage
// So direct access to the formatter is only available if requested from the loggerQueue.
// In all other circumstances we need to go through the loggingQueue to get the proper value.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
return formatter;
@@ -1038,7 +1038,7 @@ - (void)setLogFormatter:(id <DDLogFormatter>)logFormatter
}
}};
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();
View
@@ -867,7 +867,7 @@ - (BOOL)colorsEnabled
// The design of this method is taken from the DDAbstractLogger implementation.
// For documentation please refer to the DDAbstractLogger implementation.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
return colorsEnabled;
@@ -903,7 +903,7 @@ - (void)setColorsEnabled:(BOOL)newColorsEnabled
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
// For documentation please refer to the DDAbstractLogger implementation.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();
@@ -956,7 +956,7 @@ - (void)setForegroundColor:(OSColor *)txtColor backgroundColor:(OSColor *)bgColo
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
// For documentation please refer to the DDAbstractLogger implementation.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();
@@ -992,7 +992,7 @@ - (void)setForegroundColor:(OSColor *)txtColor backgroundColor:(OSColor *)bgColo
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
// For documentation please refer to the DDAbstractLogger implementation.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();
@@ -1037,7 +1037,7 @@ - (void)clearColorsForFlag:(int)mask context:(int)context
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
// For documentation please refer to the DDAbstractLogger implementation.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();
@@ -1065,7 +1065,7 @@ - (void)clearColorsForTag:(id <NSCopying>)tag
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
// For documentation please refer to the DDAbstractLogger implementation.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();
@@ -1091,7 +1091,7 @@ - (void)clearColorsForAllFlags
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
// For documentation please refer to the DDAbstractLogger implementation.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();
@@ -1117,7 +1117,7 @@ - (void)clearColorsForAllTags
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
// For documentation please refer to the DDAbstractLogger implementation.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();
@@ -1144,7 +1144,7 @@ - (void)clearAllColors
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
// For documentation please refer to the DDAbstractLogger implementation.
- dispatch_queue_t currentQueue = dispatch_get_current_queue();
+ dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
if (currentQueue == loggerQueue)
{
block();