[Top] / [eMule] / [cleanup] / [0.29c]

MetMedic
eMule cleanup
eMule Light
Libraries
Cleanup
0.29a
0.29b
0.29c
0.30a

cleanup.0
cleanup.1
cleanup.2
cleanup.3
cleanup.4
cleanup.5
cleanup.6
cleanup.7
cleanup.8
cleanup.9


Cleanup patch 4 - preferences split

[Patch date 2003-07-19 11:00]

I continued with my preferences split. CPreferences (and Preferences_Struct) just are too large and unwieldly classes (ermm.. and structure). Anything that big should be split to smaller pieces, then pieced together with some practice. I could've made CPreferences extend all the split classes, but I think composition is a better way.

While this split is by no means complete, even in it's current state parts of it are ready for merge and further development.

4a - Split of stats from Preferences.[h,cpp] to Preferences_Stats.[h,cpp].

Stats aren't even preferences at that. Rather, they should be completely split, and saved to a separate files (statistics.ini for the lack of imagination). This patch doesn't do that yet. I just tried to move all stats to separate class - CPreferencesStats. From this further modifications should be easier.

Affected files:
emule.vcproj
Preferences.cpp
Preferences.h
Preferences_Stats.cpp
Preferences_Stats.h
DownloadClient.cpp
PartFile.cpp
StatisticsDlg.cpp
StatisticsTree.cpp
UploadClient.cpp
UploadQueue.cpp
Downloads:
Changed files

4b - Split of list column positions and orders from Preferences.[h,cpp] to Preferences_Lists.[h,cpp].

List settings consist of quite many variables and a few functions. As these aren't set via the preferences dialog interface but by directly manipulating the listviews, and as they all are derived from CMuleListCtrl, they were a good candidate for separation.

Affected files:
emule.vcproj
Preferences.cpp
Preferences.h
Preferences_Lists.cpp
Preferences_Lists.h
emuleDlg.cpp
MuleListCtrl.cpp
MuleListCtrl.h
ClientListCtrl.cpp
DownloadListCtrl.cpp
QueueListCtrl.cpp
SearchListCtrl.cpp
ServerListCtrl.cpp
SharedFilesCtrl.cpp
UploadListCtrl.cpp
Downloads:
Changed files

4c - Split of IRC settings from Preferences.[h,cpp] to Preferences_IRC.[h,cpp].

IRC has fairly large number of settings that are specific to irc, not used outside it. Clearly it's thus one candidate for split.

Affected files:
emule.vcproj
Preferences.cpp
Preferences.h
Preferences_IRC.cpp
Preferences_IRC.h
emuleDlg.cpp
IrcMain.cpp
IrcSocket.cpp
IrcWnd.cpp
PpgIrc.cpp
Downloads:
Changed files

4d - Split of webserver settings from Preferences.[h,cpp] to Preferences_WS.[h,cpp].

Webserver has fairly large number of settings that are specific to it, not used outside it. Clearly it's thus one candidate for split.

Affected files:
emule.vcproj
Preferences.cpp
Preferences.h
Preferences_Webserver.cpp
Preferences_Webserver.h
emuleDlg.cpp
WebServer.cpp
WebSocket.cpp
ServerWnd.cpp
PpgWebServer.cpp
Downloads:
Changed files

4 - Code comments

Just comments.

4.1 - Bugfix to stats split

CPreferencesStats::LoadStats() is called from CPreferences constructor. Added LoadStats() method that takes configdir as parameter.

Downloads:
Full Source