mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
Whoops! Revert new changes committed in r13469
This commit is contained in:
@@ -2914,8 +2914,6 @@ setLocation( void * vdata )
|
||||
if( !tr_is_same_file( location, tor->currentDir ) )
|
||||
{
|
||||
tr_file_index_t i;
|
||||
tr_ptrArray copiedxattrs = TR_PTR_ARRAY_INIT;
|
||||
const void * const vstrcmp = strcmp;
|
||||
|
||||
/* bad idea to move files while they're being verified... */
|
||||
tr_verifyRemove( tor );
|
||||
@@ -2937,7 +2935,6 @@ setLocation( void * vdata )
|
||||
|
||||
if( do_move && !tr_is_same_file( oldpath, newpath ) )
|
||||
{
|
||||
char * cursub;
|
||||
bool renamed = false;
|
||||
errno = 0;
|
||||
tr_torinf( tor, "moving \"%s\" to \"%s\"", oldpath, newpath );
|
||||
@@ -2947,24 +2944,6 @@ setLocation( void * vdata )
|
||||
tr_torerr( tor, "error moving \"%s\" to \"%s\": %s",
|
||||
oldpath, newpath, tr_strerror( errno ) );
|
||||
}
|
||||
|
||||
/* copy extended attributes */
|
||||
cursub = tr_dirname( sub );
|
||||
while( strcmp( cursub, "." ) != 0 ) {
|
||||
char * tmp;
|
||||
if ( tr_ptrArrayFindSorted( &copiedxattrs, cursub, vstrcmp ) == NULL ) {
|
||||
char * olddir = tr_buildPath( oldbase, cursub, NULL );
|
||||
char * newdir = tr_buildPath( location, cursub, NULL );
|
||||
tr_copyXattr( olddir, newdir );
|
||||
tr_free( olddir );
|
||||
tr_free( newdir );
|
||||
tr_ptrArrayInsertSorted( &copiedxattrs, tr_strdup( cursub ), vstrcmp );
|
||||
}
|
||||
tmp = tr_dirname( cursub );
|
||||
tr_free( cursub );
|
||||
cursub = tmp;
|
||||
}
|
||||
tr_free(cursub);
|
||||
}
|
||||
|
||||
tr_free( newpath );
|
||||
@@ -2988,7 +2967,6 @@ setLocation( void * vdata )
|
||||
/* set the new location and reverify */
|
||||
tr_torrentSetDownloadDir( tor, location );
|
||||
}
|
||||
tr_ptrArrayDestruct( &copiedxattrs, tr_free );
|
||||
}
|
||||
|
||||
if( !err && do_move )
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#define HAVE_ICONV_OPEN
|
||||
#define HAVE_MKDTEMP
|
||||
#define HAVE_VALLOC
|
||||
#define HAVE_XATTRS_MACOS
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
@@ -41,9 +40,6 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_XATTRS_MACOS
|
||||
#include <sys/xattr.h> /* listxattr(), getxattr(), setxattr() */
|
||||
#endif
|
||||
#include <unistd.h> /* stat(), getcwd(), getpagesize(), unlink() */
|
||||
|
||||
#include <event2/buffer.h>
|
||||
@@ -1514,75 +1510,6 @@ tr_strratio( char * buf, size_t buflen, double ratio, const char * infinity )
|
||||
return buf;
|
||||
}
|
||||
|
||||
int
|
||||
tr_copyXattr( const char* srcpath, const char* dstpath )
|
||||
{
|
||||
int ret = 0;
|
||||
#ifdef HAVE_XATTRS_MACOS
|
||||
char * listbuf = NULL, * valuebuf = NULL;
|
||||
ssize_t listlen = 0, valuelen = 0;
|
||||
char* name;
|
||||
|
||||
listlen = listxattr( srcpath, NULL, 0, 0 );
|
||||
|
||||
if( listlen <= 0 ) {
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
listbuf = tr_malloc( listlen );
|
||||
if( listbuf == NULL ) {
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
listlen = listxattr( srcpath, listbuf, listlen, 0 );
|
||||
if( listlen <= 0) {
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
for( name = listbuf; name < listbuf + listlen; name = strchr( name, '\0' ) + 1) {
|
||||
ssize_t len = getxattr( srcpath, name, NULL, 0, 0, 0);
|
||||
if( len < 0 ) {
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if( len > valuelen ) {
|
||||
valuelen = len;
|
||||
valuebuf = reallocf( valuebuf, valuelen );
|
||||
if (valuebuf == NULL) {
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
len = getxattr( srcpath, name, valuebuf, valuelen, 0, 0 );
|
||||
if ( len < 0) {
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = setxattr( dstpath, name, valuebuf, len, 0, 0 );
|
||||
if( ret != 0 ) {
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
tr_free( valuebuf );
|
||||
tr_free( listbuf );
|
||||
|
||||
if( ret != 0 )
|
||||
tr_err( "Couldn't copy xattrs from \"%s\" to \"%s\": %s",
|
||||
srcpath, dstpath, tr_strerror( errno ) );
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
@@ -1651,7 +1578,6 @@ tr_moveFile( const char * oldpath, const char * newpath, bool * renamed )
|
||||
if( bytesLeft != 0 )
|
||||
return -1;
|
||||
|
||||
tr_copyXattr( oldpath, newpath );
|
||||
unlink( oldpath );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -481,12 +481,6 @@ char* tr_strratio( char * buf, size_t buflen, double ratio, const char * infinit
|
||||
struct tm * tr_localtime_r( const time_t *_clock, struct tm *_result );
|
||||
|
||||
|
||||
/**
|
||||
* @brief copy extended attributes of a file or a folder
|
||||
* @return 0 on success; otherwise, return -1 and set errno
|
||||
*/
|
||||
int tr_copyXattr( const char* srcpath, const char* dstpath ) TR_GNUC_NONNULL(1,2);
|
||||
|
||||
/**
|
||||
* @brief move a file
|
||||
* @return 0 on success; otherwise, return -1 and set errno
|
||||
|
||||
Binary file not shown.
@@ -112,7 +112,7 @@
|
||||
*
|
||||
* @param inDelegate The delegate for the GrowlApplicationBridge. It must conform to the GrowlApplicationBridgeDelegate protocol.
|
||||
*/
|
||||
+ (void) setGrowlDelegate:(id<GrowlApplicationBridgeDelegate>)inDelegate;
|
||||
+ (void) setGrowlDelegate:(NSObject<GrowlApplicationBridgeDelegate> *)inDelegate;
|
||||
|
||||
/*!
|
||||
* @method growlDelegate
|
||||
@@ -120,7 +120,7 @@
|
||||
* @discussion See setGrowlDelegate: for details.
|
||||
* @result The Growl delegate.
|
||||
*/
|
||||
+ (id<GrowlApplicationBridgeDelegate>) growlDelegate;
|
||||
+ (NSObject<GrowlApplicationBridgeDelegate> *) growlDelegate;
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@@ -260,7 +260,6 @@
|
||||
* Growl when next it is ready; <code>NO</code> if not.
|
||||
*/
|
||||
+ (void) setWillRegisterWhenGrowlIsReady:(BOOL)flag;
|
||||
|
||||
/*! @method willRegisterWhenGrowlIsReady
|
||||
* @abstract Reports whether GrowlApplicationBridge will register with Growl
|
||||
* when Growl next launches.
|
||||
@@ -362,7 +361,6 @@
|
||||
* copy of <code>regDict</code>.
|
||||
*/
|
||||
+ (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
|
||||
|
||||
/*! @method registrationDictionaryByFillingInDictionary:restrictToKeys:
|
||||
* @abstract Tries to fill in missing keys in a registration dictionary.
|
||||
* @discussion This method examines the passed-in dictionary for missing keys,
|
||||
@@ -402,32 +400,6 @@
|
||||
+ (NSDictionary *) notificationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
|
||||
|
||||
+ (NSDictionary *) frameworkInfoDictionary;
|
||||
|
||||
#pragma mark -
|
||||
|
||||
/*!
|
||||
*@method growlURLSchemeAvailable
|
||||
*@abstract Lets the app know whether growl:// is registered on the system, used for certain methods below this
|
||||
*@return Returns whether growl:// is registered on the system
|
||||
*@discussion Methods such as openGrowlPreferences rely on the growl:// URL scheme to function
|
||||
* Further, this method can provide a check on whether Growl is installed,
|
||||
* however, the framework will not be relying on this method for choosing when/how to notify,
|
||||
* and it is not recommended that the app rely on it for other than whether to use growl:// methods
|
||||
*@since Growl.framework 1.4
|
||||
*/
|
||||
+ (BOOL) isGrowlURLSchemeAvailable;
|
||||
|
||||
/*!
|
||||
* @method openGrowlPreferences:
|
||||
* @abstract Open Growl preferences, optionally to this app's settings, growl:// method
|
||||
* @param showApp Whether to show the application's settings, otherwise just opens to the last position
|
||||
* @return Return's whether opening the URL was succesfull or not.
|
||||
* @discussion Will launch if Growl is installed, but not running, and open the preferences window
|
||||
* Uses growl:// URL scheme
|
||||
* @since Growl.framework 1.4
|
||||
*/
|
||||
+ (BOOL) openGrowlPreferences:(BOOL)showApp;
|
||||
|
||||
@end
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -436,15 +408,27 @@
|
||||
/*!
|
||||
* @protocol GrowlApplicationBridgeDelegate
|
||||
* @abstract Required protocol for the Growl delegate.
|
||||
* @discussion The methods in this protocol are optional and are called
|
||||
* @discussion The methods in this protocol are required and are called
|
||||
* automatically as needed by GrowlApplicationBridge. See
|
||||
* <code>+[GrowlApplicationBridge setGrowlDelegate:]</code>.
|
||||
* See also <code>GrowlApplicationBridgeDelegate_InformalProtocol</code>.
|
||||
*/
|
||||
|
||||
@protocol GrowlApplicationBridgeDelegate <NSObject>
|
||||
@protocol GrowlApplicationBridgeDelegate
|
||||
|
||||
@optional
|
||||
// -registrationDictionaryForGrowl has moved to the informal protocol as of 0.7.
|
||||
|
||||
@end
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
#pragma mark -
|
||||
|
||||
/*!
|
||||
* @category NSObject(GrowlApplicationBridgeDelegate_InformalProtocol)
|
||||
* @abstract Methods which may be optionally implemented by the GrowlDelegate.
|
||||
* @discussion The methods in this informal protocol will only be called if implemented by the delegate.
|
||||
*/
|
||||
@interface NSObject (GrowlApplicationBridgeDelegate_InformalProtocol)
|
||||
|
||||
/*!
|
||||
* @method registrationDictionaryForGrowl
|
||||
|
||||
@@ -99,14 +99,6 @@
|
||||
* This key is optional.
|
||||
*/
|
||||
#define GROWL_NOTIFICATIONS_DESCRIPTIONS XSTR("NotificationDescriptions")
|
||||
/*! @defined GROWL_NOTIFICATIONS_ICONS
|
||||
* @abstract A dictionary of icons for each notification
|
||||
* @discussion This is an NSDictionary whose keys are GROWL_NOTIFICATION_NAME strings and whose objects are
|
||||
* icons for each notification, for GNTP spec
|
||||
*
|
||||
* This key is optional.
|
||||
*/
|
||||
#define GROWL_NOTIFICATIONS_ICONS XSTR("NotificationIcons")
|
||||
|
||||
/*! @defined GROWL_TICKET_VERSION
|
||||
* @abstract The version of your registration ticket.
|
||||
@@ -220,19 +212,6 @@
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_PROGRESS XSTR("NotificationProgress")
|
||||
|
||||
/*! @defined GROWL_NOTIFICATION_ALREADY_SHOWN
|
||||
* @abstract If this key is set, it should contain a bool value wrapped
|
||||
* in a NSNumber which describes whether the notification has
|
||||
* already been displayed, for instance by built in Notification
|
||||
* Center support. This value can be used to allow display
|
||||
* plugins to skip a notification, while still allowing Growl
|
||||
* actions to run on them.
|
||||
*
|
||||
* Optional. Not supported by all display plugins.
|
||||
*/
|
||||
#define GROWL_NOTIFICATION_ALREADY_SHOWN XSTR("AlreadyShown")
|
||||
|
||||
|
||||
// Notifications
|
||||
#pragma mark Notifications
|
||||
|
||||
@@ -337,28 +316,6 @@
|
||||
*/
|
||||
#define GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX XSTR("GrowlTimedOut!")
|
||||
|
||||
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON
|
||||
* @abstract The distributed notification sent when the Notification Center support is toggled on in Growl 2.0
|
||||
* @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent
|
||||
* to inform all running apps that they should now speak to Notification Center directly.
|
||||
*/
|
||||
#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON XSTR("GrowlNotificationCenterOn!")
|
||||
|
||||
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF
|
||||
* @abstract The distributed notification sent when the Notification Center support is toggled off in Growl 2.0
|
||||
* @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent
|
||||
* to inform all running apps that they should no longer speak to Notification Center directly.
|
||||
*/
|
||||
#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF XSTR("GrowlNotificationCenterOff!")
|
||||
|
||||
/*! @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY
|
||||
* @abstract The distributed notification sent by an application to query Growl 2.0's notification center support.
|
||||
* @discussion When an app starts up, it will send this query to get Growl 2.0 to spit out whether notification
|
||||
* center support is on or off.
|
||||
*/
|
||||
#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY XSTR("GrowlNotificationCenterYN?")
|
||||
|
||||
|
||||
/*! @group Other symbols */
|
||||
/* Symbols which don't fit into any of the other categories. */
|
||||
|
||||
@@ -381,6 +338,4 @@
|
||||
|
||||
#define GROWL_POSITION_PREFERENCE_KEY @"GrowlSelectedPosition"
|
||||
|
||||
#define GROWL_PLUGIN_CONFIG_ID XSTR("GrowlPluginConfigurationID")
|
||||
|
||||
#endif //ndef _GROWLDEFINES_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>12A269</string>
|
||||
<string>11C74</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
@@ -15,25 +15,25 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0</string>
|
||||
<string>1.3.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>GRRR</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.0</string>
|
||||
<string>1.3.1</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>4F250</string>
|
||||
<string>4D199</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>GM</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>12A264</string>
|
||||
<string>11C63</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>macosx10.8</string>
|
||||
<string>macosx10.7</string>
|
||||
<key>DTXcode</key>
|
||||
<string>0440</string>
|
||||
<string>0420</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>4F250</string>
|
||||
<string>4D199</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>GrowlApplicationBridge</string>
|
||||
</dict>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<dict>
|
||||
<key>Resources/Info.plist</key>
|
||||
<data>
|
||||
lnx8exuPwE/bsUq32R5DXDQholc=
|
||||
SwzGt9RQsuVafBBrfBalB75dCwU=
|
||||
</data>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
|
||||
Reference in New Issue
Block a user