Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
emsquared committed Aug 9, 2012
1 parent 03ad8bd commit 355fccd
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 65 deletions.
2 changes: 1 addition & 1 deletion Classes/Headers/IRCClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ typedef enum IRCDisconnectType : NSInteger {

- (void)sendWhois:(NSString *)nick;
- (void)changeNick:(NSString *)newNick;
- (void)changeOp:(IRCChannel *)channel users:(NSArray *)users mode:(char)mode value:(BOOL)value;
- (void)kick:(IRCChannel *)channel target:(NSString *)nick;
- (void)sendCTCPQuery:(NSString *)target command:(NSString *)command text:(NSString *)text;
- (void)sendCTCPReply:(NSString *)target command:(NSString *)command text:(NSString *)text;
Expand Down Expand Up @@ -224,6 +223,7 @@ typedef enum IRCDisconnectType : NSInteger {

- (BOOL)outputRuleMatchedInMessage:(NSString *)raw inChannel:(IRCChannel *)chan withLineType:(TVCLogLineType)type;

- (void)changeOp:(IRCChannel *)channel users:(NSArray *)users mode:(char)mode value:(BOOL)value TEXTUAL_DEPRECATED;
- (BOOL)printBoth:(id)chan type:(TVCLogLineType)type nick:(NSString *)nick text:(NSString *)text identified:(BOOL)identified TEXTUAL_DEPRECATED;
- (BOOL)printBoth:(id)chan type:(TVCLogLineType)type nick:(NSString *)nick text:(NSString *)text identified:(BOOL)identified receivedAt:(NSDate *)receivedAt TEXTUAL_DEPRECATED;
- (BOOL)printChannel:(IRCChannel *)channel type:(TVCLogLineType)type nick:(NSString *)nick text:(NSString *)text identified:(BOOL)identified receivedAt:(NSDate *)receivedAt TEXTUAL_DEPRECATED;
Expand Down
48 changes: 4 additions & 44 deletions Classes/IRC/IRCClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -945,50 +945,6 @@ - (void)sendWhois:(NSString *)nick
[self send:IRCPrivateCommandIndex("whois"), nick, nick, nil];
}

- (void)changeOp:(IRCChannel *)channel users:(NSArray *)inputUsers mode:(char)mode value:(BOOL)value
{
if (self.isLoggedIn == NO ||
PointerIsEmpty(channel) ||
channel.isActive == NO ||
channel.isChannel == NO ||
channel.isOp == NO) return;

NSMutableArray *users = [NSMutableArray array];

for (IRCUser *user in inputUsers) {
IRCUser *m = [channel findMember:user.nick];

if (m) {
if (NSDissimilarObjects(value, [m hasMode:mode])) {
[users safeAddObject:m];
}
}
}

NSInteger max = self.isupport.modesCount;

while (users.count) {
NSArray *ary = [users subarrayWithRange:NSMakeRange(0, MIN(max, users.count))];

NSMutableString *s = [NSMutableString string];

[s appendFormat:@"%@ %@ %c", IRCPrivateCommandIndex("mode"), channel.name, ((value) ? '+' : '-')];

for (NSInteger i = (ary.count - 1); i >= 0; --i) {
[s appendFormat:@"%c", mode];
}

for (IRCUser *m in ary) {
[s appendString:NSStringWhitespacePlaceholder];
[s appendString:m.nick];
}

[self sendLine:s];

[users removeObjectsInRange:NSMakeRange(0, ary.count)];
}
}

- (void)kick:(IRCChannel *)channel target:(NSString *)nick
{
[self send:IRCPrivateCommandIndex("kick"), channel.name, nick, [TPCPreferences defaultKickMessage], nil];
Expand Down Expand Up @@ -5765,6 +5721,10 @@ + (void)load
#pragma mark -
#pragma mark Deprecated

- (void)changeOp:(IRCChannel *)channel users:(NSArray *)inputUsers mode:(char)mode value:(BOOL)value
{
return;
}

- (BOOL)printBoth:(id)chan type:(TVCLogLineType)type nick:(NSString *)nick text:(NSString *)text identified:(BOOL)identified
{
Expand Down
4 changes: 2 additions & 2 deletions Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<key>TXBundleBuildCodeName</key>
<string>Turtle Soup</string>
<key>TXBundleBuildNumber</key>
<string>12320</string>
<string>12323</string>
<key>TXBundleBuildReference</key>
<string>2.1.1-281-g70d4afb-appstore</string>
<string>2.1.1-287-g03ad8bd-appstore</string>
</dict>
</plist>
44 changes: 26 additions & 18 deletions Resources/Plugins/System Profiler/TPI_SP_SysInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -483,46 +483,54 @@ + (NSString *)applicationMemoryUsage
+ (NSString *)graphicsCardInfo
{
CFMutableDictionaryRef pciDevices = IOServiceMatching("IOPCIDevice");

io_iterator_t entry_iterator;
if(IOServiceGetMatchingServices(kIOMasterPortDefault,
pciDevices,
&entry_iterator) == kIOReturnSuccess)
{
NSMutableArray *gpuList = [[NSMutableArray alloc] init];

if (IOServiceGetMatchingServices(kIOMasterPortDefault, pciDevices, &entry_iterator) == kIOReturnSuccess) {
NSMutableArray *gpuList = [NSMutableArray new];

io_iterator_t serviceObject;

while ((serviceObject = IOIteratorNext(entry_iterator))) {
CFMutableDictionaryRef serviceDictionary;
if (IORegistryEntryCreateCFProperties(serviceObject,
&serviceDictionary,
kCFAllocatorDefault,
kNilOptions) != kIOReturnSuccess)
{

kern_return_t status = IORegistryEntryCreateCFProperties(serviceObject,
&serviceDictionary,
kCFAllocatorDefault,
kNilOptions);

if (NSDissimilarObjects(status, kIOReturnSuccess)) {
IOObjectRelease(serviceObject);

continue;
}

const void *model = CFDictionaryGetValue(serviceDictionary, @"model");
if (model != nil) {

if (PointerIsNotEmpty(model)) {
if (CFGetTypeID(model) == CFDataGetTypeID()) {
NSString *s = [[NSString alloc] initWithData:(__bridge NSData *)model
encoding:NSASCIIStringEncoding];
NSString *s = [NSString stringWithData:(__bridge NSData *)model encoding:NSASCIIStringEncoding];
[gpuList addObject:s];
}
}

CFRelease(serviceDictionary);
}
NSString *res = [[NSString alloc] init];
for(int i=0; i < [gpuList count]; i++)
{

NSString *res = nil;

for (NSInteger i = 0; i < [gpuList count]; i++) {
res = [res stringByAppendingString:[gpuList objectAtIndex:i]];
if(i + 1 < [gpuList count])
{
if (i + 1 < [gpuList count]) {
res = [res stringByAppendingString:@", "];
}
}

return res;
}

return nil;
}

Expand Down
2 changes: 2 additions & 0 deletions Resources/Shell/linecount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# -o -name '*.l' – Lex Source
# -o -name '*.pch' — Pre-compiled Header File
# -o -name '*.sh' — Include Ourselves (joke!)
# -o -name '*.mustache' — Mustache template files.
#
# AppleScript files (.scpt) are not included in our search
# because they are compiled so counting the number of lines
Expand All @@ -39,4 +40,5 @@ find ../../ \
-o -name '*.l' \
-o -name '*.pch' \
-o -name '*.sh' \
-o -name '*.mustache' \
\) -print0 | xargs -0 wc -l

0 comments on commit 355fccd

Please sign in to comment.