From e6d25913d84072434c0f8692af3a35ff168a37ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Wed, 24 Mar 2010 08:57:20 +0100 Subject: [PATCH] Post merge fix: Remove some of my left over code for the 10.6 QuickLook panel support. --- PBGitHistoryController.h | 3 +-- PBGitHistoryController.m | 14 ++++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index d8c6703..9055703 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -11,7 +11,6 @@ #import "PBGitTree.h" #import "PBViewController.h" #import "PBCollapsibleSplitView.h" -#import /* for the QLPreviewPanelDataSource et al. stuff */ @class PBQLOutlineView; @class PBGitSidebarController; @@ -19,7 +18,7 @@ @class PBRefController; @class QLPreviewPanel; -@interface PBGitHistoryController : PBViewController { +@interface PBGitHistoryController : PBViewController { IBOutlet PBRefController *refController; IBOutlet NSSearchField *searchField; IBOutlet NSArrayController* commitController; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index b84c4c5..133f508 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -7,6 +7,7 @@ // #import "PBGitHistoryController.h" +#import "CWQuickLook.h" #import "PBGitGrapher.h" #import "PBGitRevisionCell.h" #import "PBCommitList.h" @@ -340,12 +341,9 @@ - (void) updateQuicklookForce:(BOOL)force { - if ((!force && ![[QLPreviewPanel sharedPreviewPanel] isVisible] && ![[QLPreviewPanel sharedPreviewPanel] isOpen]) - || ![QLPreviewPanel sharedPreviewPanelExists]) - { - return; - } - + if (!force && ![[QLPreviewPanel sharedPreviewPanel] isOpen]) + return; + if ([[QLPreviewPanel sharedPreviewPanel] respondsToSelector:@selector(setDataSource:)]) { // Public QL API [previewPanel reloadData]; @@ -353,14 +351,14 @@ else { // Private QL API (10.5 only) NSArray *selectedFiles = [treeController selectedObjects]; - + NSMutableArray *fileNames = [NSMutableArray array]; for (PBGitTree *tree in selectedFiles) { NSString *filePath = [tree tmpFileNameForContents]; if (filePath) [fileNames addObject:[NSURL fileURLWithPath:filePath]]; } - + if ([fileNames count]) [[QLPreviewPanel sharedPreviewPanel] setURLs:fileNames currentIndex:0 preservingDisplayState:YES]; }