Official eMule-Board: Collection Double Extension - Official eMule-Board

Jump to content


Page 1 of 1

Collection Double Extension Modifing an already existing one

#1 User is offline   CiccioBastardo 

  • Doomsday Executor
  • PipPipPipPipPipPipPip
  • Group: Italian Moderators
  • Posts: 5540
  • Joined: 22-November 03

Posted 28 May 2006 - 09:39 AM

If you modify an already existing collection, eMule adds a new extension ".emulecollection" to the already existing one, producing a file with double ".emulecollection.emulecollection".
This is how I solved the small problem.

Quote

CCollection::CCollection(const CCollection* pCollection)
{
  // <CB Mod : Fix : Collection double extension>
  //  m_sCollectionName = pCollection->m_sCollectionName;

  CString collectionName = pCollection->m_sCollectionName;
  collectionName.Left(collectionName.ReverseFind('.')); // no extension should be handled correctly as well
  m_sCollectionName = collectionName;
 
// <CB Mod : Fix : Collection double extension>
  if (pCollection->m_pabyCollectionAuthorKey != NULL){
    m_nKeySize = pCollection->m_nKeySize;
    m_pabyCollectionAuthorKey = new BYTE[m_nKeySize];
    memcpy(m_pabyCollectionAuthorKey, pCollection->m_pabyCollectionAuthorKey, m_nKeySize);
    m_sCollectionAuthorName = pCollection->m_sCollectionAuthorName;
  }
  .....

The problem is not the client, it's the user
0

#2 User is offline   moloko+ 

  • ...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1209
  • Joined: 18-August 05

Posted 31 May 2006 - 11:22 PM

hi CiccioBastardo (this is a two for one offer),

yeah, i found this too.

another approach, is to remove the CleanupFilename when the dialog sets the edit text because, in the cleanup, the '.' is removed and the user gets " Emulecollection" which forces ".emulecollection" to be appended to the collection name again.

Quote

...
//BEGIN CleanupFilename cleans up too much
//m_CollectionNameEdit.SetWindowText(::CleanupFilename(m_pCollection->m_sCollectionName));
m_CollectionNameEdit.SetWindowText(m_pCollection->m_sCollectionName);
//END CleanupFilename cleans up too much
...


Also, the user formatted collection name is kept as-is.

(i hope i haven't left something else out - my bad tagging style :P )

cheers
0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users