Skip to content

GetCategory const-correctness cleanup in DownloadListCtrl / CPartFile

Summary

The stale DownloadListCtrl.cpp comment was pointing at the wrong fix point. The real issue was CPartFile::GetCategory(): DownloadListCtrl had to use const_cast<CPartFile*> only because GetCategory() was not const.

main now makes CPartFile::GetCategory() const and removes the workaround sites in DownloadListCtrl.cpp.

Landed Behavior

  • CPartFile::GetCategory() is now declared and defined const.
  • DownloadListCtrl.cpp no longer uses const_cast<CPartFile*> for category display/sort.
  • The stale TODO comment is removed.
  • Existing lazy category clamping behavior is preserved.

Files

  • srchybrid/PartFile.h
  • srchybrid/PartFile.cpp
  • srchybrid/DownloadListCtrl.cpp