Skip to content

Commit

Permalink
Merge branch 'sveinbjornt:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
cooljeanius authored Sep 29, 2023
2 parents 224db45 + c532b5b commit 2ea9f15
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 51 deletions.
21 changes: 11 additions & 10 deletions Sloth.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1410;
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1500;
ORGANIZATIONNAME = "Sveinbjorn Thordarson";
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Sloth" */;
Expand Down Expand Up @@ -390,10 +391,9 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = NO;
DEPLOYMENT_POSTPROCESSING = YES;
DEVELOPMENT_TEAM = 5WX26Y89JP;
ENABLE_HARDENED_RUNTIME = NO;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/sparkle",
Expand All @@ -415,7 +415,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
STRIPFLAGS = "-x";
STRIP_INSTALLED_PRODUCT = NO;
WRAPPER_EXTENSION = app;
};
name = Debug;
Expand All @@ -428,10 +427,9 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = NO;
DEPLOYMENT_POSTPROCESSING = YES;
DEVELOPMENT_TEAM = 5WX26Y89JP;
ENABLE_HARDENED_RUNTIME = NO;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/sparkle",
Expand All @@ -452,7 +450,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
STRIPFLAGS = "-x";
STRIP_INSTALLED_PRODUCT = YES;
WRAPPER_EXTENSION = app;
};
name = Release;
Expand Down Expand Up @@ -484,7 +481,8 @@
DEAD_CODE_STRIPPING = YES;
DEPLOYMENT_POSTPROCESSING = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_TESTABILITY = NO;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_CW_ASM_SYNTAX = NO;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
Expand All @@ -503,10 +501,11 @@
INFOPLIST_FILE = resources/Info.plist;
INFOPLIST_OUTPUT_FORMAT = binary;
INFOPLIST_PREPROCESS = NO;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.11;
ONLY_ACTIVE_ARCH = YES;
PLIST_FILE_OUTPUT_FORMAT = binary;
SDKROOT = macosx;
STRIPFLAGS = "-x";
WARNING_CFLAGS = "-Wpartial-availability";
"WARNING_CFLAGS[arch=*]" = "-Wpartial-availability";
};
Expand Down Expand Up @@ -540,6 +539,7 @@
DEPLOYMENT_POSTPROCESSING = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = NO;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_CW_ASM_SYNTAX = NO;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
Expand All @@ -558,10 +558,11 @@
INFOPLIST_FILE = resources/Info.plist;
INFOPLIST_OUTPUT_FORMAT = binary;
INFOPLIST_PREPROCESS = NO;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.11;
ONLY_ACTIVE_ARCH = NO;
PLIST_FILE_OUTPUT_FORMAT = binary;
SDKROOT = macosx;
STRIPFLAGS = "-x";
WARNING_CFLAGS = "-Wpartial-availability";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
# TODO for Sloth 3.3

* Update antiquated screenshots in README
* Always (re)select "General" tab when Preferences are shown
* Show Path Control w. selected path at bottom of table view when item selected
DONE * Always (re)select "General" tab when Preferences are shown
2 changes: 1 addition & 1 deletion resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>309</string>
<string>320</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
59 changes: 36 additions & 23 deletions resources/MainMenu.xib

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions resources/Prefs.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -11,6 +11,7 @@
<outlet property="addFilterButton" destination="ET3-sC-3hU" id="ceQ-vB-DNe"/>
<outlet property="filtersTableView" destination="hIM-Sy-Pvd" id="i4D-Ue-QtR"/>
<outlet property="removeFilterButton" destination="RK3-7C-553" id="IpG-WS-xv8"/>
<outlet property="tabView" destination="XmJ-qI-dIi" id="oRg-gi-A0L"/>
<outlet property="window" destination="HPx-7j-YOW" id="JjG-fl-v60"/>
</connections>
</customObject>
Expand Down Expand Up @@ -116,7 +117,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" id="f5c-N0-0X2">
<rect key="frame" x="1" y="1" width="316" height="135"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" id="hIM-Sy-Pvd">
<rect key="frame" x="0.0" y="0.0" width="316" height="135"/>
Expand Down Expand Up @@ -221,7 +222,7 @@ DQ
<userDefaultsController representsSharedInstance="YES" id="Fml-Xt-HVp"/>
</objects>
<resources>
<image name="NSAddTemplate" width="14" height="13"/>
<image name="NSRemoveTemplate" width="14" height="4"/>
<image name="NSAddTemplate" width="18" height="17"/>
<image name="NSRemoveTemplate" width="18" height="5"/>
</resources>
</document>
2 changes: 1 addition & 1 deletion source/LsofTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ - (NSString *)run:(AuthorizationRef)authRef {
NSString *name = [f[@"name"] substringFromIndex:2];

// If we know which process owns the other end of the pipe/socket
// Needs to run with root privileges for succesful lookup of the
// Needs to run with root privileges for successful lookup of the
// endpoints of system process pipes/sockets such as syslogd.
if (devCharCodeMap[name]) {
NSArray *endPoints = devCharCodeMap[name];
Expand Down
6 changes: 6 additions & 0 deletions source/PrefsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ @interface PrefsController ()
{
NSMutableArray *filters;
}
@property (weak) IBOutlet NSTabView *tabView;
@property (weak) IBOutlet NSTableView *filtersTableView;
@property (weak) IBOutlet NSButton *removeFilterButton;
@property (weak) IBOutlet NSButton *addFilterButton;
Expand Down Expand Up @@ -70,6 +71,11 @@ - (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event f
return NO;
}

- (void)showWindow:(id)sender {
[super showWindow:sender];
[self.tabView selectFirstTabViewItem:self];
}

#pragma mark -

- (IBAction)restoreDefaults:(id)sender {
Expand Down
10 changes: 10 additions & 0 deletions source/SlothController.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ @interface SlothController ()

IBOutlet NSOutlineView *outlineView;

IBOutlet NSPathControl *pathControl;

AuthorizationRef authRef;
BOOL authenticated;
BOOL isRefreshing;
Expand Down Expand Up @@ -1005,6 +1007,14 @@ - (void)outlineViewSelectionDidChange:(NSNotification *)notification {
item[@"displayname"] = [[NSAttributedString alloc] initWithString:item[@"name"]
attributes:@{NSForegroundColorAttributeName: color}];
}
// Update path shown in path control
if (canReveal || hasBundlePath) {
NSString *path = item[@"path"] != nil ? item[@"path"] : item[@"name"];
[pathControl setURL:[NSURL fileURLWithPath:path]];
//[pathControl setURL:nil];
} else {
[pathControl setURL:nil];
}
} else {
[revealButton setEnabled:NO];
[killButton setEnabled:NO];
Expand Down
18 changes: 10 additions & 8 deletions source/Util/FSUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,24 @@
#import <sys/param.h>
#import <sys/mount.h>

#define MAX_FILESYSTEMS 1024
#define MAX_FILESYSTEMS 128

@implementation FSUtils

+ (NSDictionary *)mountedFileSystems {
struct statfs buf[MAX_FILESYSTEMS];

int fs_count = getfsstat(NULL, 0, MNT_NOWAIT);
if (fs_count == -1) {
fprintf(stderr, "Error: %d\n", errno);
return nil;
return @{};
}
if (fs_count > MAX_FILESYSTEMS) {
fprintf(stderr, "Too many filesystems, bailing");
return @{};
}

getfsstat(buf, fs_count * sizeof(statfs), MNT_NOWAIT);

struct statfs buf[fs_count];
getfsstat(buf, fs_count * sizeof(buf[0]), MNT_NOWAIT);

NSMutableDictionary *fsdict = [NSMutableDictionary dictionary];

Expand All @@ -64,9 +68,7 @@ + (NSDictionary *)mountedFileSystems {
};
}

DLog(@"File system info: %@", fsdict);

return [fsdict copy]; // Return immutable copy
return [fsdict copy];
}

@end
2 changes: 1 addition & 1 deletion sparkle/Sparkle.framework/Versions/A/Headers/SUUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/*!
The main API in Sparkle for controlling the update mechanism.
This class is used to configure the update paramters as well as manually
This class is used to configure the update parameters as well as manually
and automatically schedule and control checks for updates.
*/
SU_EXPORT @interface SUUpdater : NSObject
Expand Down

0 comments on commit 2ea9f15

Please sign in to comment.