Improve the last fix by using newer method.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36172 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2013-02-19 20:52:08 +00:00
parent 478148da52
commit 21464c08f1
2 changed files with 34 additions and 41 deletions

View file

@ -1,26 +1,31 @@
2013-02-19 Fred Kiefer <FredKiefer@gmx.de>
* Tools/make_services.m (main, CheckDirectory)
Improve the last fix by using newer method.
2013-02-19 Quentin Mathe <quentin.mathe@gmail.com>
* Source/NSTableView.m (-_drawDropIndicator,
* Source/NSTableView.m (-_drawDropIndicator,
-_setDropOperationAndRow:usingPositionInRow:atPoint:, -draggingUpdated:):
Cleaned code a bit more.
2013-02-19 Quentin Mathe <quentin.mathe@gmail.com>
* Source/NSTableView.m (-draggingUpdated:): Don't update the drop row and
operation if the drop target hasn't changed (this prevents to overwrite a
custom drop row and operation set by the user in
* Source/NSTableView.m (-draggingUpdated:): Don't update the drop row and
operation if the drop target hasn't changed (this prevents to overwrite a
custom drop row and operation set by the user in
-tableView:handleValidateDrop:proposedRow:proposedOperation:).
2013-02-19 Quentin Mathe <quentin.mathe@gmail.com>
* Source/NSTableView.m (-draggingUpdated:): Extracted drop indicator
* Source/NSTableView.m (-draggingUpdated:): Extracted drop indicator
drawing into a new method -_drawDropIndicator.
2013-02-19 Quentin Mathe <quentin.mathe@gmail.com>
* Source/NSTableView.m (-draggingUpdated:): Modularized the first part of
the method into several smaller methods -_dropRowFromQuarterPosition:,
-_setDropOperationAndRow:usingPositionInRow:atPoint: and
* Source/NSTableView.m (-draggingUpdated:): Modularized the first part of
the method into several smaller methods -_dropRowFromQuarterPosition:,
-_setDropOperationAndRow:usingPositionInRow:atPoint: and
_scrollRowAtPointToVisible:.
2013-02-18 Riccardo Mottola <rm@gnu.org>
@ -1761,16 +1766,16 @@
Improved the menu theming to support some common menu look variations.
Fixed bug #34792 too.
* Headers/Additions/GNUstepGUI/GSTheme.h
* Source/GSThemeDrawing.m
* Source/GSThemeDrawing.m
(-menuBackgroundColor, -menuItemBackgroundColor, -menuBorderColor
-menuBorderColorForEdge:isHorizontal:,
-drawsBorderForMenuItemCell:state:isHorizontal:,
-drawTitleForMenuItemCell:withFrame:inView:state:isHorizontal:,
-menuBorderColorForEdge:isHorizontal:,
-drawsBorderForMenuItemCell:state:isHorizontal:,
-drawTitleForMenuItemCell:withFrame:inView:state:isHorizontal:,
-menuSeparatorInset): Added.
(-menuBarBackgroundColor, -menuBarBorderColor): Added but not yet used.
(-menuSeparatorColor): Renamed -menuSeparatorItemColor.
* Source/NSMenuItemCell.m
(-backgroundColor:): Changed to get the background color from
* Source/NSMenuItemCell.m
(-backgroundColor:): Changed to get the background color from
-menuItemBackgroundColor.
(-themeControlState): Added.
(-drawTitleWithFrame:inView:): Moved drawing code to GSTheme.
@ -1826,7 +1831,7 @@
cell classes that need it.
* Source/NSButtonCell.m:
* Headers/AppKit/NSButtonCell.h: Implement -imageScaling and
-setImageScaling methods.
-setImageScaling methods.
* Source/GSThemeDrawing.m:
* Headers/Additions/GNUstepGUI/GSTheme.h: Remove the
-drawImage:inButtonCell:withFrame:position: API intended
@ -2622,7 +2627,7 @@
ivars with the non-fragile ABI.
2011-06-28 Eric Wasylishen <ewasylishen@gmail.com>
* Headers/Additions/GNUstepGUI/GSImageMagickImageRep.h:
* Source/GNUmakefile:
* Source/NSImageRep.m:
@ -17673,4 +17678,3 @@
the correct background/highlight colors and NSCompositeSourceOver for
image cells.
(-setHighlighted): Use controlHighlightColor instead of controlColor.

View file

@ -64,28 +64,23 @@ static Class aClass;
static Class dClass;
static Class sClass;
static BOOL CheckDirectory(NSString *path)
static BOOL CheckDirectory(NSString *path, NSError **error)
{
NSFileManager *mgr;
BOOL isDir;
mgr = [NSFileManager defaultManager];
if (([mgr fileExistsAtPath: path isDirectory: &isDir] && isDir) == 0)
if ([mgr fileExistsAtPath: path isDirectory: &isDir] && isDir)
{
NSString *parent;
parent = [path stringByDeletingLastPathComponent];
if ([parent length] < [path length]
&& CheckDirectory([parent stringByDeletingLastPathComponent]) == NO)
{
return NO;
}
if ([mgr createDirectoryAtPath: path attributes: nil] == NO)
{
return NO;
}
return YES;
}
else
{
return [mgr createDirectoryAtPath: path
withIntermediateDirectories: YES
attributes: nil
error: error];
}
return YES;
}
int
@ -104,6 +99,7 @@ main(int argc, char** argv, char **env_c)
NSDictionary *oldMap;
NSEnumerator *enumerator;
NSString *path;
NSError *error;
#ifdef GS_PASS_ARGUMENTS
[NSProcessInfo initializeWithArguments:argv count:argc environment:env_c];
@ -197,18 +193,11 @@ main(int argc, char** argv, char **env_c)
*/
usrRoot = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSUserDomainMask, YES) lastObject];
if (CheckDirectory(usrRoot) == NO)
{
if (verbose > 0)
NSLog(@"couldn't create %@", usrRoot);
[pool drain];
exit(EXIT_FAILURE);
}
usrRoot = [usrRoot stringByAppendingPathComponent: @"Services"];
if (CheckDirectory(usrRoot) == NO)
if (!CheckDirectory(usrRoot, &error))
{
if (verbose > 0)
NSLog(@"couldn't create %@", usrRoot);
NSLog(@"couldn't create %@ error: %@", usrRoot, error);
[pool drain];
exit(EXIT_FAILURE);
}