1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-04 02:28:03 +00:00

fix a crash on quit with the QuickLook window open

This commit is contained in:
Mitchell Livingston 2009-10-12 00:48:16 +00:00
parent 99c4d8cc09
commit a01688aed6
2 changed files with 12 additions and 14 deletions

View file

@ -98,6 +98,10 @@ typedef enum
IBOutlet NSTextField * fURLSheetTextField; IBOutlet NSTextField * fURLSheetTextField;
IBOutlet NSButton * fURLSheetOpenButton; IBOutlet NSButton * fURLSheetOpenButton;
#warning change to QLPreviewPanel
id fPreviewPanel;
BOOL fQuitting;
BOOL fUpdateInProgress; BOOL fUpdateInProgress;
BOOL fPauseOnLaunch; BOOL fPauseOnLaunch;
@ -110,9 +114,6 @@ typedef enum
NSMutableDictionary * fPendingTorrentDownloads; NSMutableDictionary * fPendingTorrentDownloads;
BOOL fSoundPlaying; BOOL fSoundPlaying;
#warning change to QLPreviewPanel
id fPreviewPanel;
} }
- (void) openFiles: (NSArray *) filenames addType: (addType) type forcePath: (NSString *) path; - (void) openFiles: (NSArray *) filenames addType: (addType) type forcePath: (NSString *) path;

View file

@ -332,6 +332,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
[PrefsController setHandle: fLib]; [PrefsController setHandle: fLib];
fPrefsController = [[PrefsController alloc] init]; fPrefsController = [[PrefsController alloc] init];
fQuitting = NO;
fSoundPlaying = NO; fSoundPlaying = NO;
tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, self); tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, self);
@ -665,6 +666,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
- (void) applicationWillTerminate: (NSNotification *) notification - (void) applicationWillTerminate: (NSNotification *) notification
{ {
fQuitting = YES;
//stop the Bonjour service //stop the Bonjour service
[[BonjourController defaultController] stop]; [[BonjourController defaultController] stop];
@ -703,17 +706,11 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
const BOOL quickLookOpen = [NSApp isOnSnowLeopardOrBetter] && [QLPreviewPanelSL sharedPreviewPanelExists] const BOOL quickLookOpen = [NSApp isOnSnowLeopardOrBetter] && [QLPreviewPanelSL sharedPreviewPanelExists]
&& [[QLPreviewPanelSL sharedPreviewPanel] isVisible]; && [[QLPreviewPanelSL sharedPreviewPanel] isVisible];
for (NSWindow * window in [NSApp windows])
{
if (!quickLookOpen || window != [QLPreviewPanelSL sharedPreviewPanel]) //hide quicklook window last to avoid animation
[window orderOut: nil];
}
if (quickLookOpen) if (quickLookOpen)
{ [[QLPreviewPanelSL sharedPreviewPanel] updateController];
[[QLPreviewPanelSL sharedPreviewPanel] reloadData];
[[QLPreviewPanelSL sharedPreviewPanel] orderOut: nil]; for (NSWindow * window in [NSApp windows])
} [window orderOut: nil];
[self showStatusBar: NO animate: NO]; [self showStatusBar: NO animate: NO];
[self showFilterBar: NO animate: NO]; [self showFilterBar: NO animate: NO];
@ -3128,7 +3125,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
#warning change from id to QLPreviewPanel #warning change from id to QLPreviewPanel
- (BOOL) acceptsPreviewPanelControl: (id) panel - (BOOL) acceptsPreviewPanelControl: (id) panel
{ {
return YES; return !fQuitting;
} }
- (void) beginPreviewPanelControl: (id) panel - (void) beginPreviewPanelControl: (id) panel