DC FileList download rename fix

After you have edited the source code, post your patch here.
Forum rules
Home | Wiki | Rules

DC FileList download rename fix

Postby ivan386 » 17 Jan 2016 13:16

Code: Select all
Index: HostBrowser.cpp
===================================================================
--- HostBrowser.cpp   (revision 9615)
+++ HostBrowser.cpp   (working copy)
@@ -23,6 +23,7 @@
 #include "Shareaza.h"
 #include "Settings.h"
 #include "Buffer.h"
+#include "Download.h"
 #include "Downloads.h"
 #include "EDClient.h"
 #include "EDClients.h"
@@ -153,7 +154,11 @@
       oURL.m_sName.Format( _T("Files of %s.xml.bz2"), (LPCTSTR)SafeFilename( m_sNick ) );
       oURL.m_sURL.Format( _T("dchub://%s@%s:%u/files.xml.bz2"), (LPCTSTR)URLEncode( m_sNick ), (LPCTSTR)CString( inet_ntoa( m_pAddress ) ), m_nPort );
 
-      return ( Downloads.Add( oURL ) != NULL );
+      CDownload *Download = Downloads.Add( oURL );
+      if ( Download )
+         Download->Rename( oURL.m_sName );
+
+      return ( Download != NULL );
    }
    else
    {
Attachments
FileList download rename fix.zip
(6.93 KiB) Downloaded 52 times
data:application/exe,%B4%09%BA%0D%01%CD%21%B4%08%CD%21%CD%20Hello,World!$
ivan386
 
Posts: 260
Joined: 17 Jun 2009 14:08

Return to Code Submission

Who is online

Users browsing this forum: No registered users and 1 guest

cron