Author: rmottola
Date: Fri Nov 6 22:28:34 2015
New Revision: 39158
URL: http://svn.gna.org/viewcvs/gnustep?rev=39158&view=rev
Log:
Simplify parameters for direct call
Modified:
apps/gworkspace/trunk/ChangeLog
apps/gworkspace/trunk/GWorkspace/FileViewer/GWViewer.m
apps/gworkspace/trunk/GWorkspace/Thumbnailer/GWThumbnailer.h
apps/gworkspace/trunk/GWorkspace/Thumbnailer/GWThumbnailer.m
Modified: apps/gworkspace/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/apps/gworkspace/trunk/ChangeLog?rev=39158&r1=39157&r2=39158&view=diff
==============================================================================
--- apps/gworkspace/trunk/ChangeLog (original)
+++ apps/gworkspace/trunk/ChangeLog Fri Nov 6 22:28:34 2015
@@ -1,3 +1,10 @@
+2015-11-06 Riccardo Mottola <[email protected]>
+
+ * GWorkspace/FileViewer/GWViewer.m
+ * GWorkspace/Thumbnailer/GWThumbnailer.h
+ * GWorkspace/Thumbnailer/GWThumbnailer.m
+ Simplify parameters for direct call.
+
2015-11-06 Riccardo Mottola <[email protected]>
* GWorkspace/FileViewer/GWViewer.h
Modified: apps/gworkspace/trunk/GWorkspace/FileViewer/GWViewer.m
URL:
http://svn.gna.org/viewcvs/gnustep/apps/gworkspace/trunk/GWorkspace/FileViewer/GWViewer.m?rev=39158&r1=39157&r2=39158&view=diff
==============================================================================
--- apps/gworkspace/trunk/GWorkspace/FileViewer/GWViewer.m (original)
+++ apps/gworkspace/trunk/GWorkspace/FileViewer/GWViewer.m Fri Nov 6
22:28:34 2015
@@ -1568,13 +1568,9 @@
if (path)
{
Thumbnailer *t;
- NSPasteboard *pb;
t = [[Thumbnailer alloc] init];
- pb = [NSPasteboard generalPasteboard];
- [pb declareTypes: [NSArray arrayWithObjects:NSFilenamesPboardType,nil]
owner:self];
- [pb setPropertyList:[NSArray arrayWithObject:path]
forType:NSFilenamesPboardType];
- [t makeThumbnail:pb userData:nil error:NULL];
+ [t makeThumbnails:path];
[t release];
}
}
@@ -1588,13 +1584,9 @@
if (path)
{
Thumbnailer *t;
- NSPasteboard *pb;
t = [[Thumbnailer alloc] init];
- pb = [NSPasteboard generalPasteboard];
- [pb declareTypes: [NSArray arrayWithObjects:NSFilenamesPboardType,nil]
owner:self];
- [pb setPropertyList:[NSArray arrayWithObject:path]
forType:NSFilenamesPboardType];
- [t removeThumbnail:pb userData:nil error:NULL];
+ [t removeThumbnails:path];
[t release];
}
}
Modified: apps/gworkspace/trunk/GWorkspace/Thumbnailer/GWThumbnailer.h
URL:
http://svn.gna.org/viewcvs/gnustep/apps/gworkspace/trunk/GWorkspace/Thumbnailer/GWThumbnailer.h?rev=39158&r1=39157&r2=39158&view=diff
==============================================================================
--- apps/gworkspace/trunk/GWorkspace/Thumbnailer/GWThumbnailer.h
(original)
+++ apps/gworkspace/trunk/GWorkspace/Thumbnailer/GWThumbnailer.h Fri Nov
6 22:28:34 2015
@@ -1,8 +1,9 @@
/* GWThumbnailer.h
*
- * Copyright (C) 2003-2013 Free Software Foundation, Inc.
+ * Copyright (C) 2003-2015 Free Software Foundation, Inc.
*
* Author: Enrico Sersale <[email protected]>
+ * Riccardo Mottola <[email protected]>
* Date: August 2001
*
* This file is part of the GNUstep GWorkspace application
@@ -72,19 +73,15 @@
- (BOOL)removeThumbnailForPath:(NSString *)path;
-- (void)makeThumbnail:(NSPasteboard *)pb
- userData:(NSString *)ud
- error:(NSString **)err;
+- (void)makeThumbnails:(NSString*)path;
-- (void)removeThumbnail:(NSPasteboard *)pb
- userData:(NSString *)ud
- error:(NSString **)err;
+- (void)removeThumbnails:(NSString*)path;
- (void)thumbnailData:(NSPasteboard *)pb
userData:(NSString *)ud
error:(NSString **)err;
-- (NSArray *)bundlesWithExtension:(NSString *)extension
-
inDirectory:(NSString *)dirpath;
+- (NSArray *)bundlesWithExtension:(NSString *)extension
+inDirectory:(NSString *)dirpath;
@end
Modified: apps/gworkspace/trunk/GWorkspace/Thumbnailer/GWThumbnailer.m
URL:
http://svn.gna.org/viewcvs/gnustep/apps/gworkspace/trunk/GWorkspace/Thumbnailer/GWThumbnailer.m?rev=39158&r1=39157&r2=39158&view=diff
==============================================================================
--- apps/gworkspace/trunk/GWorkspace/Thumbnailer/GWThumbnailer.m
(original)
+++ apps/gworkspace/trunk/GWorkspace/Thumbnailer/GWThumbnailer.m Fri Nov
6 22:28:34 2015
@@ -1,8 +1,9 @@
/* GWThumbnailer.m
*
- * Copyright (C) 2003-2013 Free Software Foundation, Inc.
+ * Copyright (C) 2003-2015 Free Software Foundation, Inc.
*
* Author: Enrico Sersale <[email protected]>
+ * Riccardo Mottola <[email protected]>
* Date: August 2001
*
* This file is part of the GNUstep GWorkspace application
@@ -254,33 +255,15 @@
return [NSString stringWithFormat: @"%lx", thumbref];
}
-- (void)makeThumbnail:(NSPasteboard *)pb
- userData:(NSString *)ud
- error:(NSString **)err
-{
- NSArray *paths;
+- (void)makeThumbnails:(NSString *)path
+{
NSData *data;
NSMutableArray *added;
BOOL isdir;
NSUInteger i;
-
- if ([[pb types] indexOfObject: NSFilenamesPboardType] == NSNotFound)
- {
- *err = @"No file name supplied on pasteboard";
- return;
- }
-
- paths = [pb propertyListForType: NSFilenamesPboardType];
- if (paths == nil)
- {
- *err = @"invalid pasteboard";
- return;
- }
-
- added = [NSMutableArray array];
-
- if ([paths count] == 1) {
- NSString *path = [paths objectAtIndex: 0];
+
+
+ added = [NSMutableArray array];
if ([fm fileExistsAtPath: path isDirectory: &isdir]) {
if (isdir) {
@@ -301,37 +284,9 @@
}
}
}
- } else {
- id<TMBProtocol> tmb = [self thumbnailerForPath: path];
-
- if (tmb) {
- data = [tmb makeThumbnailForPath: path];
-
- if (data && [self registerThumbnailData: data
- forPath: path
- nameExtension: [tmb fileNameExtension]])
{
- [added addObject: path];
- }
- }
}
}
- } else {
- for (i = 0; i < [paths count]; i++) {
- NSString *path = [paths objectAtIndex: i];
- id<TMBProtocol> tmb = [self thumbnailerForPath: path];
-
- if (tmb) {
- data = [tmb makeThumbnailForPath: path];
-
- if (data && [self registerThumbnailData: data
- forPath: path
- nameExtension: [tmb fileNameExtension]]) {
- [added addObject: path];
- }
- }
- }
- }
if ([added count]) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@@ -353,27 +308,12 @@
}
}
-- (void)removeThumbnail:(NSPasteboard *)pb
- userData:(NSString *)ud
- error:(NSString **)err
-{
- NSArray *paths;
+- (void)removeThumbnails:(NSString *)path
+{
NSMutableArray *deleted;
BOOL isdir;
NSUInteger i;
- if ([[pb types] indexOfObject: NSFilenamesPboardType] == NSNotFound)
- {
- *err = @"No file name supplied on pasteboard";
- return;
- }
-
- paths = [pb propertyListForType: NSFilenamesPboardType];
- if (paths == nil)
- {
- *err = @"invalid pasteboard";
- return;
- }
if ((thumbsDict == nil) || ([thumbsDict count] == 0)) {
return;
@@ -381,8 +321,6 @@
deleted = [NSMutableArray array];
- if ([paths count] == 1) {
- NSString *path = [paths objectAtIndex: 0];
if ([fm fileExistsAtPath: path isDirectory: &isdir]) {
if (isdir) {
@@ -402,15 +340,6 @@
}
}
}
- } else {
- for (i = 0; i < [paths count]; i++) {
- NSString *path = [paths objectAtIndex: i];
-
- if ([self removeThumbnailForPath: path]) {
- [deleted addObject: path];
- }
- }
- }
if ([deleted count]) {
NSMutableDictionary *info = [NSMutableDictionary dictionary];
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs