summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-10-31 06:58:45 +0000
committerritsuka <[email protected]>2014-10-31 06:58:45 +0000
commit0a865e3d000f1d16fbb4c8564c444753f63e639a (patch)
tree52fa817852a32682f15d569d1ece945f0ff1b48d
parent507b213cd091dc713c30ea4792096a3ea5074256 (diff)
MacGui: fixed a warning in HBOutputRedirect and removed an unused ivar.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6488 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--macosx/HBOutputPanelController.m3
-rw-r--r--macosx/HBOutputRedirect.h14
-rw-r--r--macosx/HBOutputRedirect.m5
3 files changed, 15 insertions, 7 deletions
diff --git a/macosx/HBOutputPanelController.m b/macosx/HBOutputPanelController.m
index c59d70ac1..47133d05e 100644
--- a/macosx/HBOutputPanelController.m
+++ b/macosx/HBOutputPanelController.m
@@ -22,6 +22,9 @@
// lets use this higher value for now for better gui debugging
#define TextStorageLowerSizeLimit 120000
+@interface HBOutputPanelController () <HBOutputRedirectListening>
+@end
+
@implementation HBOutputPanelController
/**
diff --git a/macosx/HBOutputRedirect.h b/macosx/HBOutputRedirect.h
index 562f09409..116463e60 100644
--- a/macosx/HBOutputRedirect.h
+++ b/macosx/HBOutputRedirect.h
@@ -7,6 +7,14 @@
#import <Cocoa/Cocoa.h>
+
+@protocol HBOutputRedirectListening <NSObject>
+
+- (void)stdoutRedirect:(NSString *)text;
+- (void)stderrRedirect:(NSString *)text;
+
+@end
+
/**
* This class is used to redirect @c stdout and @c stderr outputs. It is never
* created directly; @c stdoutRedirect and @c stderrRedirect class methods
@@ -31,15 +39,13 @@
/// Pointer to old write function for the stream.
int (*oldWriteFunc)(void *, const char *, int);
-
- NSLock *lock;
}
+ (id)stdoutRedirect;
+ (id)stderrRedirect;
-- (void)addListener:(id)aListener;
-- (void)removeListener:(id)aListener;
+- (void)addListener:(id <HBOutputRedirectListening>)aListener;
+- (void)removeListener:(id <HBOutputRedirectListening>)aListener;
@end
diff --git a/macosx/HBOutputRedirect.m b/macosx/HBOutputRedirect.m
index f1ff10e58..7239fe3cd 100644
--- a/macosx/HBOutputRedirect.m
+++ b/macosx/HBOutputRedirect.m
@@ -77,7 +77,7 @@ int stderrwrite(void *inFD, const char *buffer, int size)
* Adds specified object as listener for this output. Method @c stdoutRedirect:
* or @c stderrRedirect: of the listener is called to redirect the output.
*/
-- (void)addListener:(id)aListener
+- (void)addListener:(id <HBOutputRedirectListening>)aListener
{
NSAssert2([aListener respondsToSelector:forwardingSelector], @"Object %@ doesn't respond to selector \"%@\"", aListener, NSStringFromSelector(forwardingSelector));
@@ -94,7 +94,7 @@ int stderrwrite(void *inFD, const char *buffer, int size)
/**
* Stops forwarding for this output to the specified listener object.
*/
-- (void)removeListener:(id)aListener
+- (void)removeListener:(id <HBOutputRedirectListening>)aListener
{
if ([listeners containsObject:aListener])
{
@@ -138,7 +138,6 @@ int stderrwrite(void *inFD, const char *buffer, int size)
forwardingSelector = aSelector;
stream = aStream;
oldWriteFunc = NULL;
- lock = [[NSLock alloc] init];
}
return self;
}