aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPWindowControllerDelegate.m
diff options
context:
space:
mode:
authorAbhi Beckert <abhi@abhibeckert.com>2017-08-04 13:20:12 +1000
committerAbhi Beckert <abhi@abhibeckert.com>2017-08-04 13:20:12 +1000
commitebf7d8b7db4144d304bf2224db19d787d631eda0 (patch)
tree5b1481d8ded07101891b3acce80b385a204f1ef8 /Source/SPWindowControllerDelegate.m
parentff1db69283f69b8e9dc7fc373db242c37698c7c2 (diff)
parent1cbc8f7ca081a6538a2df484d89723cf441acb3c (diff)
downloadsequelpro-ebf7d8b7db4144d304bf2224db19d787d631eda0.tar.gz
sequelpro-ebf7d8b7db4144d304bf2224db19d787d631eda0.tar.bz2
sequelpro-ebf7d8b7db4144d304bf2224db19d787d631eda0.zip
Merge remote-tracking branch 'sequelpro/master'
Diffstat (limited to 'Source/SPWindowControllerDelegate.m')
-rw-r--r--Source/SPWindowControllerDelegate.m16
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/SPWindowControllerDelegate.m b/Source/SPWindowControllerDelegate.m
index 79b1e2f1..009dc0a4 100644
--- a/Source/SPWindowControllerDelegate.m
+++ b/Source/SPWindowControllerDelegate.m
@@ -56,15 +56,11 @@
*/
- (BOOL)windowShouldClose:(id)sender
{
- // Iterate through all tabs if more than one tab is opened only otherwise
- // [... parentTabShouldClose] will be called twice [see self closeTab:(id)sender]
- if ([[tabView tabViewItems] count] > 1) {
- for (NSTabViewItem *eachItem in [tabView tabViewItems])
- {
- SPDatabaseDocument *eachDocument = [eachItem identifier];
-
- if (![eachDocument parentTabShouldClose]) return NO;
- }
+ for (NSTabViewItem *eachItem in [tabView tabViewItems])
+ {
+ SPDatabaseDocument *eachDocument = [eachItem identifier];
+
+ if (![eachDocument parentTabShouldClose]) return NO;
}
// Remove global session data if the last window of a session will be closed
@@ -190,6 +186,8 @@
/**
* Called to determine whether a tab view item can be closed
+ *
+ * Note: This is ONLY called when using the "X" button on the tab itself.
*/
- (BOOL)tabView:(NSTabView *)aTabView shouldCloseTabViewItem:(NSTabViewItem *)tabViewItem
{