spaces and tabs on the end of the lines

This commit is contained in:
noformnocontent 2013-02-11 01:34:40 +01:00
parent 108f8afcd9
commit 10ebf3a55f
23 changed files with 189 additions and 189 deletions

View file

@ -26,48 +26,48 @@
{
[timelineViewWindow setExcludedFromWindowsMenu:YES];
[mentionsViewWindow setExcludedFromWindowsMenu:YES];
[self initHotKeys];
[GrowlApplicationBridge setGrowlDelegate:self];
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self
selector:@selector(openNewMessageWindow:)
[nc addObserver:self
selector:@selector(openNewMessageWindow:)
name:@"openNewMessageWindow"
object:nil];
[nc addObserver:self
selector:@selector(sendTweet:)
[nc addObserver:self
selector:@selector(sendTweet:)
name:@"sendTweet"
object:nil];
[nc addObserver:self
selector:@selector(authentificationSucceded:)
[nc addObserver:self
selector:@selector(authentificationSucceded:)
name:@"authentificationSucceded"
object:nil];
[nc addObserver:self
selector:@selector(getTweetUpdates:)
[nc addObserver:self
selector:@selector(getTweetUpdates:)
name:@"getTweetUpdates"
object:nil];
NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager];
[appleEventManager setEventHandler:self
andSelector:@selector(handleGetURLEvent:withReplyEvent:)
forEventClass:kInternetEventClass
andEventID:kAEGetURL];
viewDelegate = [[ViewDelegate alloc] init];
accessToken = [[AccessToken alloc] init];
BOOL forceLogin = NO;
/*
if (![accessToken stringForKey:@"version-0.6.0-new-login"]) {
[self logout:self];
forceLogin = YES;
[accessToken setString:nil forKey:@"entity"];
[accessToken setString:nil forKey:@"entity"];
[accessToken setString:@"yes" forKey:@"version-0.6.0-new-login"];
}*/
if (forceLogin || ![accessToken stringForKey:@"user_access_token"] || ![accessToken secret]) {
[timelineViewWindow performClose:self];
[mentionsViewWindow performClose:self];
@ -89,7 +89,7 @@
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Webkit/"];
NSURL *url = [NSURL fileURLWithPath:path];
NSString *index_string = [NSString stringWithContentsOfFile:[NSString stringWithFormat:@"%@index.html", path] encoding:NSUTF8StringEncoding error:nil];
oauthView = [[WebView alloc] init];
viewDelegate.oauthView = oauthView;
[[oauthView mainFrame] loadHTMLString:index_string baseURL:url];
@ -107,11 +107,11 @@
if (viewDelegate.timelineView != timelineView)
{
[self initOauth];
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Webkit/"];
NSURL *url = [NSURL fileURLWithPath:path];
NSString *index_string = [NSString stringWithContentsOfFile:[NSString stringWithFormat:@"%@index.html", path] encoding:NSUTF8StringEncoding error:nil];
viewDelegate.timelineView = timelineView;
[[timelineView mainFrame] loadHTMLString:index_string baseURL:url];
[timelineView setFrameLoadDelegate:viewDelegate];
@ -121,7 +121,7 @@
//WebPreferences* prefs = [timelineView preferences];
//[prefs _setLocalStorageDatabasePath:localStoragePath];
//[prefs setLocalStorageEnabled:YES];
viewDelegate.mentionsView = mentionsView;
[[mentionsView mainFrame] loadHTMLString:index_string baseURL:url];
[mentionsView setFrameLoadDelegate:viewDelegate];
@ -131,7 +131,7 @@
//prefs = [mentionsView preferences];
//[prefs _setLocalStorageDatabasePath:localStoragePath];
//[prefs setLocalStorageEnabled:YES];
viewDelegate.conversationView = conversationView;
[[conversationView mainFrame] loadHTMLString:index_string baseURL:url];
[conversationView setFrameLoadDelegate:viewDelegate];
@ -141,7 +141,7 @@
//prefs = [conversationView preferences];
//[prefs _setLocalStorageDatabasePath:localStoragePath];
//[prefs setLocalStorageEnabled:YES];
viewDelegate.profileView = profileView;
[[profileView mainFrame] loadHTMLString:index_string baseURL:url];
[profileView setFrameLoadDelegate:viewDelegate];
@ -166,8 +166,8 @@
{
NSInteger newTweetKey = kVK_ANSI_M; // http://boredzo.org/blog/archives/2007-05-22/virtual-key-codes
NSInteger newTweetModifierKey = controlKey + cmdKey + optionKey; // cmdKey 256, shitfKey 512, optionKey 2048, controlKey 4096
NSInteger newTweetModifierKey = controlKey + cmdKey + optionKey; // cmdKey 256, shitfKey 512, optionKey 2048, controlKey 4096
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSInteger defaultsNewTweetKey = (NSInteger)[defaults integerForKey:@"newTweetKey"];
@ -179,7 +179,7 @@
{
[defaults setInteger:newTweetKey forKey:@"newTweetKey"];
}
NSInteger defaultsNewTweetModifierKey = (NSInteger)[defaults integerForKey:@"newTweetModifierKey"];
if ([defaults objectForKey:@"newTweetModifierKey"] != nil)
{
@ -189,9 +189,9 @@
{
[defaults setInteger:newTweetModifierKey forKey:@"newTweetModifierKey"];
}
[defaults synchronize];
NSUInteger cocoaModifiers = 0;
if (newTweetModifierKey & shiftKey) cocoaModifiers = cocoaModifiers | NSShiftKeyMask;
if (newTweetModifierKey & optionKey) cocoaModifiers = cocoaModifiers | NSAlternateKeyMask;
@ -200,22 +200,22 @@
[globalHotkeyMenuItem setKeyEquivalent:[Constants stringFromVirtualKeyCode:newTweetKey]];
[globalHotkeyMenuItem setKeyEquivalentModifierMask:cocoaModifiers];
/* CARBON from http://github.com/Xjs/drama-button/blob/carbon/Drama_ButtonAppDelegate.m */
EventTypeSpec eventType;
eventType.eventClass = kEventClassKeyboard;
eventType.eventKind = kEventHotKeyPressed;
InstallApplicationEventHandler(&handler, 1, &eventType, NULL, NULL);
EventHotKeyID g_HotKeyID;
g_HotKeyID.id = 1;
EventHotKeyRef g_HotKeyRef;
RegisterEventHotKey(newTweetKey, newTweetModifierKey, g_HotKeyID, GetApplicationEventTarget(), 0, &g_HotKeyRef);
/* end CARBON */
}
@ -285,13 +285,13 @@
- (IBAction)openNewMessageWindow:(id)sender
{
[NSApp activateIgnoringOtherApps:YES];
[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:nil];
[NSApp activateIgnoringOtherApps:YES];
[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:nil];
}
- (void)openNewMessageWindowInReplyTo:(NSString *)userName statusId:(NSString *)statusId withString:(NSString *)string isPrivate:(BOOL)isPrivate
{
[NSApp activateIgnoringOtherApps:YES];
[NSApp activateIgnoringOtherApps:YES];
NewMessageWindow *newMessage = (NewMessageWindow *)[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:nil];
[newMessage inReplyTo:userName statusId:statusId withString:string];
[newMessage setIsPrivate:isPrivate];
@ -300,9 +300,9 @@
- (void)openNewMessageWindowWithString:(NSString *)aString
{
[NSApp activateIgnoringOtherApps:YES];
NSRange range = [aString rangeOfString:@"oauthtoken"];
if (range.length > 0)
{
[oauthView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"bungloo_instance.requestAccessToken('%@')", aString]];
@ -310,7 +310,7 @@
else
{
NewMessageWindow *newTweet = (NewMessageWindow *)[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:nil];
[newTweet withString:aString];
[newTweet withString:aString];
}
}
@ -325,12 +325,12 @@
PostModel *post = (PostModel *)[sender object];
NSString *text = [[post.text stringByReplacingOccurrencesOfString:@"\\" withString:@"\\\\"] stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
text = [text stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"];
NSString *locationObject = @"null";
if (post.location) {
locationObject = [NSString stringWithFormat:@"[%f, %f]", post.location.coordinate.latitude, post.location.coordinate.longitude];
}
NSString *imageFilePath = @"null";
if (post.imageFilePath) {
NSError *error;
@ -340,12 +340,12 @@
[data release];
imageFilePath = [NSString stringWithFormat:@"\"data:%@;base64,%@\"", mimeType, base64];
}
NSString *isPrivate = @"false";
if (post.isPrivate) {
isPrivate = @"true";
}
NSString *func = [NSString stringWithFormat:@"bungloo_instance.sendNewMessage(\"%@\", \"%@\", \"%@\", %@, %@, %@)",
text,
post.inReplyTostatusId,
@ -361,7 +361,7 @@
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *pathToPlugin = [@"~/Library/Application Support/Bungloo/Plugin.js" stringByExpandingTildeInPath];
if([fileManager fileExistsAtPath:pathToPlugin])
{
return [NSString stringWithFormat:@"%@", [NSURL fileURLWithPath:pathToPlugin]];
@ -432,7 +432,7 @@
self.accessToken.userId = userId;
self.accessToken.screenName = screenName;
[timelineViewWindow makeKeyAndOrderFront:self];
[[NSNotificationCenter defaultCenter] postNotificationName:@"authentificationSucceded" object:nil];
}*/
@ -456,13 +456,13 @@
- (IBAction)logout:(id)sender
{
[oauthView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.logout();"];
[timelineViewWindow performClose:self];
[mentionsViewWindow performClose:self];
[conversationViewWindow performClose:self];
[profileViewWindow performClose:self];
[self.loginViewWindow makeKeyAndOrderFront:self];
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.logout();"];
[mentionsView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.logout();"];
}
@ -474,7 +474,7 @@
{
//[self unreadMentions:0];
[mentionsView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.setAllMentionsRead();"];
}
}
}
- (void)getTweetUpdates:(id)sender
@ -508,9 +508,9 @@
NSDictionary *userInfo = (NSDictionary *)clickContext;
NSString *postId = [userInfo objectForKey:@"postId"];
NSString *entity = [userInfo objectForKey:@"entity"];
[self showConversationForPostId:postId andEntity:entity];
NSString *js = [NSString stringWithFormat:@"bungloo_instance.mentionRead('%@', '%@');", postId, entity];
[mentionsView stringByEvaluatingJavaScriptFromString:js];
}

View file

@ -390,8 +390,8 @@
/*! @brief Tries to fill in missing keys in a notification dictionary.
* @param notifDict The dictionary to fill in.
* @return The dictionary with the keys filled in. This will be a separate instance from \a notifDict.
* @discussion This function examines the \a notifDict for missing keys, and
* tries to get them from the last known registration dictionary. As of 1.1,
* @discussion This function examines the \a notifDict for missing keys, and
* tries to get them from the last known registration dictionary. As of 1.1,
* the keys that it will look for are:
*
* \li <code>GROWL_APP_NAME</code>
@ -410,8 +410,8 @@
*@abstract Lets the app know whether growl:// is registered on the system, used for certain methods below this
*@return Returns whether growl:// is registered on the system
*@discussion Methods such as openGrowlPreferences rely on the growl:// URL scheme to function
* Further, this method can provide a check on whether Growl is installed,
* however, the framework will not be relying on this method for choosing when/how to notify,
* Further, this method can provide a check on whether Growl is installed,
* however, the framework will not be relying on this method for choosing when/how to notify,
* and it is not recommended that the app rely on it for other than whether to use growl:// methods
*@since Growl.framework 1.4
*/
@ -421,7 +421,7 @@
* @method openGrowlPreferences:
* @abstract Open Growl preferences, optionally to this app's settings, growl:// method
* @param showApp Whether to show the application's settings, otherwise just opens to the last position
* @return Return's whether opening the URL was succesfull or not.
* @return Return's whether opening the URL was succesfull or not.
* @discussion Will launch if Growl is installed, but not running, and open the preferences window
* Uses growl:// URL scheme
* @since Growl.framework 1.4

View file

@ -88,10 +88,10 @@
{
// Insert code here to read your document from the given data of the specified type. If the given outError != NULL, ensure that you set *outError when returning NO.
// You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead.
// You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead.
// For applications targeted for Panther or earlier systems, you should use the deprecated API -loadDataRepresentation:ofType. In this case you can also choose to override -readFromFile:ofType: or -loadFileWrapperRepresentation:ofType: instead.
if ( outError != NULL )
{
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL];
@ -102,25 +102,25 @@
- (void)inReplyTo:(NSString *)entity statusId:(NSString *)statusId withString:(NSString *)string
{
[textField setStringValue:string];
NSInteger location = [string rangeOfString:@" "].location;
NSInteger length = 0;
if (location != NSNotFound) {
length = [[textField stringValue] length] - location - 1;
}
NSRange range = {location + 1, length};
[[textField currentEditor] setSelectedRange:range];
[inReplyTostatusId release];
inReplyTostatusId = statusId;
[inReplyTostatusId retain];
[inReplyToEntity release];
inReplyToEntity = entity;
[inReplyToEntity retain];
[self controlTextDidChange:nil];
}
@ -130,7 +130,7 @@
NSRange range = {[[textField stringValue] length] , 0};
[[textField currentEditor] setSelectedRange:range];
NSLog(@"BB");
[self controlTextDidChange:nil];
}
@ -155,7 +155,7 @@
{
NSRect frame = [(NSButton *)sender frame];
NSPoint menuOrigin = [[(NSButton *)sender superview] convertPoint:NSMakePoint(frame.origin.x, frame.origin.y+frame.size.height) toView:nil];
NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDown
location:menuOrigin
modifierFlags:NSLeftMouseDownMask // 0x100
@ -165,7 +165,7 @@
eventNumber:0
clickCount:1
pressure:1];
[NSMenu popUpContextMenu:self.addMenu withEvent:event forView:self.addMenuButton];
}
@ -190,7 +190,7 @@
if(c < 0) {
[counter setTextColor:[NSColor redColor]];
} else {
[counter setTextColor:[NSColor controlTextColor]];
[counter setTextColor:[NSColor controlTextColor]];
}
}
@ -212,7 +212,7 @@
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error{
NSLog(@"CLLocationManager Error: %@", error);
NSMenuItem *menuItem = [self.addMenu itemAtIndex:0];
[menuItem setTitle:@"Current location not available"];
}
@ -252,17 +252,17 @@
- (BOOL)control:(NSControl *)control textView:(NSTextView *)fieldEditor doCommandBySelector:(SEL)commandSelector
{
BOOL retval = NO;
BOOL isEnter = [[NSApp currentEvent] keyCode] == 76;
if (commandSelector == @selector(insertNewline:) && !isEnter) {
NSText *text = [[textField window] fieldEditor:YES forObject:nil];
NSRange range = [text selectedRange];
NSString *stringBefore = [textField.stringValue substringToIndex:range.location];
NSString *stringAfter = [textField.stringValue substringFromIndex:range.location + range.length];
textField.stringValue = [NSString stringWithFormat:@"%@\n%@", stringBefore, stringAfter];
NSRange r = NSMakeRange(range.location + 1, 0);
@ -275,7 +275,7 @@
retval = YES;
[self sendPost:control];
}
return retval;
}
@ -288,17 +288,17 @@
if (!self.imageFilePath)
{
[menuItem setTitle:@"Remove photo"];
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
[openDlg setPrompt:@"Select"];
[openDlg setDelegate:self];
// Enable the selection of files in the dialog.
[openDlg setCanChooseFiles:YES];
// Enable the selection of directories in the dialog.
[openDlg setCanChooseDirectories:NO];
// Display the dialog. If the OK button was pressed,
// process the files.
if ( [openDlg runModalForDirectory:nil file:nil] == NSOKButton )
@ -306,7 +306,7 @@
// Get an array containing the full filenames of all
// files and directories selected.
NSArray* files = [openDlg filenames];
// Loop through all the files and process them.
for( int i = 0; i < [files count]; i++ )
{
@ -327,7 +327,7 @@
if ([ext isEqualToString:@""] || [ext isEqualToString:@"/"] || ext == nil || ext == NULL || [ext length] < 1) {
return YES;
}
NSEnumerator* tagEnumerator = [[NSArray arrayWithObjects:@"png", @"jpg", @"gif", @"jpeg", nil] objectEnumerator];
NSString* allowedExt;
while ((allowedExt = [tagEnumerator nextObject]))
@ -337,7 +337,7 @@
return YES;
}
}
return NO;
}

View file

@ -13,16 +13,16 @@
NSString *title;
NSDate *date;
NSString *itemDescription;
NSURL *releaseNotesURL;
NSString *DSASignature;
NSString *DSASignature;
NSString *minimumSystemVersion;
NSURL *fileURL;
NSString *versionString;
NSString *displayVersionString;
NSDictionary *propertiesDictionary;
}

View file

@ -16,7 +16,7 @@
@protocol SUVersionComparison
/*!
@method
@method
@abstract An abstract method to compare two version strings.
@discussion Should return NSOrderedAscending if b > a, NSOrderedDescending if b < a, and NSOrderedSame if they are equivalent.
*/

View file

@ -46,7 +46,7 @@
NSLocalizedString(@"OK", @""), // default button
NSLocalizedString(@"Cancel", @""), // alt button
nil);
return NSAlertDefaultReturn == result;
return NSAlertDefaultReturn == result;
return NO;
}

View file

@ -173,7 +173,7 @@
<p>Moved reply icon to left so it is easier to use when the scrollbar is shown</p>
<p>Login with the [Login] button now works</p>
<p>Fixed automatic updates so it will work next time again.</p>
<hr />
<h1>Tentia 0.2.0</h2>