forked from scribendi/cindex-mac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIRApp.m
46 lines (42 loc) · 1.51 KB
/
IRApp.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// IRApp.m
// Cindex
//
// Created by PL on 9/3/05.
// Copyright 2005 Indexing Research. All rights reserved.
//
#import "IRApp.h"
#import "IRIndexDocument.h"
#import "IRIndexDocumentController.h"
#import "IRIndexDocWController.h"
#import "SplashWindowController.h"
@implementation IRApp
#if 0
- (void)removeWindowsItem:(NSWindow *)aWindow {
if ([aWindow isVisible])
[super removeWindowsItem:aWindow];
}
#endif
- (void)terminate:(id)sender {
// do this cleanup here because [IRdc applicationShouldTerminate] is called *after*
// doc controller handles any dirty programs.
IRIndexDocument * doc = [(IRIndexDocumentController *)[self delegate] currentDocument];
NSArray * docarray = [(IRIndexDocumentController *)[self delegate] documents];
int index;
if ([[doc fileType] isEqualToString:CINIndexType]) // if have current index doc
[[NSUserDefaults standardUserDefaults] setObject:[[doc fileURL] path] forKey:CILastIndex]; // save it as last used
#if 0
while (doc = [dnum nextObject]) { // for all docs
[[[doc mainWindowController] window] performClose:self];
}
#else // need this because objects are removed from array
for (index = [docarray count]; --index >= 0;)
[[[[docarray objectAtIndex:index] mainWindowController] window] performClose:self];
#endif
[[NSPasteboard pasteboardWithName:NSDragPboard] clearContents]; // terminate calls Pboard to deliver any promised data
[super terminate:sender];
}
- (void)orderFrontStandardAboutPanel:(id)sender {
// [SplashWindowController showWithButton:YES];
}
@end