Commit 349175aa authored by Felix Paul Kühne's avatar Felix Paul Kühne

* don't store the temp release note in the user's Caches-folder, but in /tmp....

* don't store the temp release note in the user's Caches-folder, but in /tmp. Renamed it to vlc_releasenote_%@.tmp, whereas %@ is a timestamp (%m-%d-%y--%I.%M.%S.%F)
* cleanup of the source
parent 53858e2d
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
IBOutlet id o_update_window; IBOutlet id o_update_window;
IBOutlet id o_bar_checking; IBOutlet id o_bar_checking;
NSString * o_hashOfOurBinary;
NSString * o_urlOfBinary; NSString * o_urlOfBinary;
update_t * p_u; update_t * p_u;
intf_thread_t * p_intf; intf_thread_t * p_intf;
......
...@@ -72,8 +72,6 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -72,8 +72,6 @@ static VLCUpdate *_o_sharedInstance = nil;
- (void)dealloc - (void)dealloc
{ {
if( o_hashOfOurBinary )
[o_hashOfOurBinary release];
if( o_urlOfBinary ) if( o_urlOfBinary )
[o_urlOfBinary release]; [o_urlOfBinary release];
...@@ -144,9 +142,9 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -144,9 +142,9 @@ static VLCUpdate *_o_sharedInstance = nil;
BOOL releaseChecked = NO; BOOL releaseChecked = NO;
int x = 0; int x = 0;
NSString * pathToReleaseNote; NSString * pathToReleaseNote;
pathToReleaseNote = [[NSString stringWithString: \ pathToReleaseNote = [NSString stringWithFormat: \
@"~/Library/Caches/vlc_releasenote_temp.txt"] \ @"/tmp/vlc_releasenote_%@.tmp", [[NSCalendarDate calendarDate] \
stringByExpandingTildeInPath]; descriptionWithCalendarFormat: @"%m-%d-%y--%I.%M.%S.%F"]];
if( p_uit ) if( p_uit )
{ {
...@@ -172,13 +170,13 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -172,13 +170,13 @@ static VLCUpdate *_o_sharedInstance = nil;
} }
else if( p_uit->file.i_type == UPDATE_FILE_TYPE_BINARY ) else if( p_uit->file.i_type == UPDATE_FILE_TYPE_BINARY )
{ {
msg_Dbg( p_intf, "binary found, version = %s" \ msg_Dbg( p_intf, "binary found, version = %s, " \
", hash=%s, size=%i MB", p_uit->release.psz_version, \ "url=%s, size=%i MB", p_uit->release.psz_version, \
p_uit->file.psz_md5, \ p_uit->file.psz_url, \
(int)((p_uit->file.l_size / 1024) / 1024) ); (int)((p_uit->file.l_size / 1024) / 1024) );
[o_fld_currentVersionAndSize setStringValue: \ [o_fld_currentVersionAndSize setStringValue: [NSString \
[NSString stringWithFormat: \ stringWithFormat: \
@"The current release is %s (%i MB to download).", \ _NS("The current release is %s (%i MB to download)."), \
p_uit->release.psz_version, ((p_uit->file.l_size \ p_uit->release.psz_version, ((p_uit->file.l_size \
/ 1024) / 1024)]]; / 1024) / 1024)]];
...@@ -186,15 +184,6 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -186,15 +184,6 @@ static VLCUpdate *_o_sharedInstance = nil;
[o_urlOfBinary release]; [o_urlOfBinary release];
o_urlOfBinary = [[NSString alloc] initWithUTF8String: \ o_urlOfBinary = [[NSString alloc] initWithUTF8String: \
p_uit->file.psz_url]; p_uit->file.psz_url];
/* save the hash of our file, if available */
if( p_uit->file.psz_md5 )
{
if( o_hashOfOurBinary )
[o_hashOfOurBinary release];
o_hashOfOurBinary = [[NSString alloc] \
initWithUTF8String: p_uit->file.psz_md5];
}
} }
if( p_uit->release.i_status == UPDATE_RELEASE_STATUS_NEWER && if( p_uit->release.i_status == UPDATE_RELEASE_STATUS_NEWER &&
!releaseChecked ) !releaseChecked )
...@@ -272,6 +261,11 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -272,6 +261,11 @@ static VLCUpdate *_o_sharedInstance = nil;
p_uit->release.i_status == UPDATE_RELEASE_STATUS_NEWER && p_uit->release.i_status == UPDATE_RELEASE_STATUS_NEWER &&
p_uit->file.i_type == UPDATE_FILE_TYPE_BINARY ) p_uit->file.i_type == UPDATE_FILE_TYPE_BINARY )
{ {
/* put the mirror information */
msg_Dbg( p_intf, "used mirror: %s, %s [%s]", \
p_uit->mirror.psz_name, p_uit->mirror.psz_location, \
p_uit->mirror.psz_type );
/* that's our binary */ /* that's our binary */
update_download( p_uit, (char *)[path UTF8String] ); update_download( p_uit, (char *)[path UTF8String] );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment