Skip to content

Commit 3cb9f03

Browse files
committed
删除注释代码
1.删除注释代码 2.注释版本分离信息
1 parent 2e40be9 commit 3cb9f03

File tree

3 files changed

+14
-89
lines changed

3 files changed

+14
-89
lines changed

mdserver/mdserver/AppDelegate.m

Lines changed: 8 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ -(void)AuthorizeCreate
141141
UInt32 count = (UInt32)[list count];
142142
AuthorizationItem authItem[count];
143143
AuthorizationRights authRights;
144-
AuthorizationFlags flags = kAuthorizationFlagDefaults |
144+
AuthorizationFlags flags = kAuthorizationFlagDefaults |
145145
kAuthorizationFlagInteractionAllowed |
146146
kAuthorizationFlagPreAuthorize |
147147
kAuthorizationFlagExtendRights;
@@ -169,97 +169,22 @@ -(void)AuthorizeCreate
169169

170170

171171

172-
172+
//虽然要被分离,但是我觉得最好用。
173173
-(void)AuthorizeExeCmd:(NSString *)file
174174
{
175-
//虽然要被分离,但是我觉得最好用。
176-
OSStatus status_exe = AuthorizationExecuteWithPrivileges(self->_authRef, (void *)[file cStringUsingEncoding:NSASCIIStringEncoding], kAuthorizationFlagDefaults, nil, nil);
175+
#pragma clang diagnostic push
176+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
177+
178+
char *args[] = {NULL};
179+
OSStatus status_exe = AuthorizationExecuteWithPrivileges(self->_authRef, (void *)[file cStringUsingEncoding:NSASCIIStringEncoding], kAuthorizationFlagDefaults, args, nil);
177180
if (status_exe != errAuthorizationSuccess)
178181
{
179182
NSLog(@"AuthorizationExecuteWithPrivileges failed!:%d", status_exe);
180183
return;
181184
}
185+
#pragma clang diagnostic pop
182186
}
183187

184-
//-(void)AuthorizeFile:(NSString *)file
185-
//{
186-
// NSString *testFile = file;
187-
// AuthorizationItem authItem = { kAuthorizationRightExecute, [testFile length], (void *)[testFile cStringUsingEncoding:NSASCIIStringEncoding], 0};
188-
// AuthorizationRights authRights = {1, &authItem};
189-
// AuthorizationFlags flags = kAuthorizationFlagDefaults |
190-
// kAuthorizationFlagInteractionAllowed |
191-
// kAuthorizationFlagPreAuthorize |
192-
// kAuthorizationFlagExtendRights;
193-
//
194-
// if (self->_authRef) {
195-
// NSLog(@"ok");
196-
// }else{
197-
// OSStatus status = AuthorizationCreate(&authRights, kAuthorizationEmptyEnvironment, flags, &self->_authRef);
198-
// if(status != errAuthorizationSuccess)
199-
// {
200-
// NSLog(@"AuthorizationCreate failed!");
201-
// return;
202-
// }else{
203-
// NSLog(@"AuthorizationCreate ok!");
204-
// }
205-
// }
206-
// OSStatus status_exe = AuthorizationExecuteWithPrivileges(self->_authRef, authItem.value, kAuthorizationFlagDefaults, nil, nil);
207-
// if (status_exe != errAuthorizationSuccess)
208-
// {
209-
// NSLog(@"AuthorizationExecuteWithPrivileges failed!");
210-
// return;
211-
// }else{
212-
// NSLog(@"运行成功");
213-
// }
214-
//}
215-
216-
//-(void)AuthorizeFile2:(NSString *)file
217-
//{
218-
//
219-
// BOOL result = NO;
220-
// NSError * error = nil;
221-
//
222-
// OSStatus status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &self->_authRef);
223-
//
224-
// NSLog(@"%d", status);
225-
// if (status != errAuthorizationSuccess) {
226-
// /* AuthorizationCreate really shouldn't fail. */
227-
// NSLog(@"获取权限失败!!");
228-
// assert(NO);
229-
// self->_authRef = NULL;
230-
// }
231-
//
232-
// AuthorizationItem authItem = { kSMRightModifySystemDaemons, 0, NULL, 0 };
233-
// AuthorizationRights authRights = { 1, &authItem };
234-
// AuthorizationFlags flags = kAuthorizationFlagDefaults |
235-
// kAuthorizationFlagInteractionAllowed |
236-
// kAuthorizationFlagPreAuthorize |
237-
// kAuthorizationFlagExtendRights;
238-
// OSStatus statusR = AuthorizationCopyRights(self->_authRef, &authRights, kAuthorizationEmptyEnvironment, flags, NULL);
239-
//
240-
// if (statusR != errAuthorizationSuccess) {
241-
// NSLog(@"获取权限失败!!!");
242-
// error = [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:nil];
243-
// } else {
244-
// NSLog(@"获取权限成功");
245-
// CFErrorRef cfError;
246-
//
247-
// /* This does all the work of verifying the helper tool against the application
248-
// * and vice-versa. Once verification has passed, the embedded launchd.plist
249-
// * is extracted and placed in /Library/LaunchDaemons and then loaded. The
250-
// * executable is placed in /Library/PrivilegedHelperTools.
251-
// */
252-
// result = (BOOL) SMJobBless(kSMDomainUserLaunchd, (CFStringRef)@"test", self->_authRef, &cfError);
253-
// if (!result){
254-
// error = CFBridgingRelease(cfError);
255-
// }
256-
//
257-
// if ( ! result) {
258-
// assert(error != nil);
259-
// NSLog(@"%@", error);
260-
// }
261-
// }
262-
//}
263188

264189
#pragma mark 获取进程
265190
-(void)getProcess

mdserver/mdserver/Base.lproj/MainMenu.xib

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11542"/>
4+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
55
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
66
</dependencies>
77
<objects>
@@ -214,7 +214,7 @@
214214
</connections>
215215
</menuItem>
216216
</items>
217-
<point key="canvasLocation" x="799" y="57"/>
217+
<point key="canvasLocation" x="771" y="56"/>
218218
</menu>
219219
<window title="mdserver" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
220220
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
@@ -390,7 +390,7 @@
390390
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
391391
</textFieldCell>
392392
</textField>
393-
<pathControl focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" id="lpR-Yx-xy5">
393+
<pathControl autoresizesSubviews="NO" focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" id="lpR-Yx-xy5">
394394
<rect key="frame" x="223" y="13" width="251" height="22"/>
395395
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
396396
<pathCell key="cell" selectable="YES" focusRingType="none" alignment="left" id="6Oe-9w-G0e">
@@ -521,7 +521,7 @@
521521
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
522522
<clipView key="contentView" copiesOnScroll="NO" id="0RZ-5f-Xjz">
523523
<rect key="frame" x="1" y="0.0" width="238" height="296"/>
524-
<autoresizingMask key="autoresizingMask"/>
524+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
525525
<subviews>
526526
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="20" rowSizeStyle="automatic" headerView="B9H-aO-DLa" viewBased="YES" id="tNs-DA-7w6">
527527
<rect key="frame" x="0.0" y="0.0" width="238" height="279"/>
@@ -765,7 +765,7 @@
765765
<rect key="frame" x="267" y="200" width="100" height="38"/>
766766
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
767767
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
768-
<size key="cellSize" width="100" height="18"/>
768+
<size key="cellSize" width="102" height="18"/>
769769
<size key="intercellSpacing" width="4" height="2"/>
770770
<buttonCell key="prototype" type="radio" title="Radio" imagePosition="left" alignment="left" inset="2" id="YzZ-it-ale">
771771
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>

0 commit comments

Comments
 (0)