@@ -106,7 +106,6 @@ GOOrganController::GOOrganController(
106
106
m_b_customized(false ),
107
107
m_CurrentPitch(999999.0 ), // for enforcing updating the label first time
108
108
m_OrganModified(false ),
109
- m_ChurchName(),
110
109
m_ChurchAddress(),
111
110
m_OrganBuilder(),
112
111
m_OrganBuildDate(),
@@ -209,7 +208,6 @@ void GOOrganController::ReadOrganFile(GOConfigReader &cfg) {
209
208
/* load church info */
210
209
cfg.ReadString (
211
210
ODFSetting, WX_ORGAN, wxT (" HauptwerkOrganFileFormatVersion" ), false );
212
- m_ChurchName = cfg.ReadStringTrim (ODFSetting, WX_ORGAN, wxT (" ChurchName" ));
213
211
m_ChurchAddress = cfg.ReadString (ODFSetting, WX_ORGAN, wxT (" ChurchAddress" ));
214
212
m_OrganBuilder
215
213
= cfg.ReadString (ODFSetting, WX_ORGAN, wxT (" OrganBuilder" ), false );
@@ -325,12 +323,16 @@ void GOOrganController::ReadOrganFile(GOConfigReader &cfg) {
325
323
for (unsigned i = 0 ; i < m_panels.size (); i++)
326
324
m_panels[i]->Layout ();
327
325
328
- GetRootPipeConfigNode ().SetName (GetChurchName ());
326
+ const wxString &organName = GetOrganName ();
327
+
328
+ GetRootPipeConfigNode ().SetName (organName);
329
329
ReadCombinations (cfg);
330
330
m_setter->OnCombinationsLoaded (GetCombinationsDir (), wxEmptyString);
331
331
332
332
GOHash hash;
333
- hash.Update (m_ChurchName.utf8_str (), strlen (m_ChurchName.utf8_str ()));
333
+ const auto organNameUtf8 = organName.utf8_str ();
334
+
335
+ hash.Update (organNameUtf8, strlen (organNameUtf8));
334
336
GOHashType result = hash.getHash ();
335
337
m_SampleSetId1 = ((result.hash [0 ] & 0x7F ) << 24 )
336
338
| ((result.hash [1 ] & 0x7F ) << 16 ) | ((result.hash [2 ] & 0x7F ) << 8 )
@@ -340,8 +342,6 @@ void GOOrganController::ReadOrganFile(GOConfigReader &cfg) {
340
342
| (result.hash [7 ] & 0x7F );
341
343
}
342
344
343
- wxString GOOrganController::GetOrganHash () { return m_hash; }
344
-
345
345
wxString GOOrganController::GenerateSettingFileName () {
346
346
return m_config.OrganSettingsPath () + wxFileName::GetPathSeparator ()
347
347
+ GOStdFileName::composeSettingFileName (GetOrganHash (), m_config.Preset ());
@@ -643,7 +643,7 @@ wxString GOOrganController::ExportCombination(const wxString &fileName) {
643
643
YAML::Node infoNode = globalNode[INFO];
644
644
645
645
infoNode[CONTENT_TYPE] = WX_GRANDORGUE_COMBINATIONS;
646
- infoNode[ORGAN_NAME] = m_ChurchName ;
646
+ infoNode[ORGAN_NAME] = GetOrganName () ;
647
647
infoNode[GRANDORGUE_VERSION] = APP_VERSION;
648
648
infoNode[SAVED_TIME] = wxDateTime::Now ().Format ();
649
649
@@ -668,29 +668,29 @@ wxString GOOrganController::ExportCombination(const wxString &fileName) {
668
668
}
669
669
670
670
/* *
671
- * Check the churchName of the imported combination file. If it differs from the
672
- * current organ m_ChurchName then ask for the user
673
- * @param churchName the organ the combination file was saved of
671
+ * Check the organName of the imported combination file. If it differs from the
672
+ * current organ name then ask for the user
673
+ * @param organName the organ the combination file was saved of
674
674
* @return true if the churchNames are the same or the user agree with importing
675
675
* the combination file
676
676
*/
677
677
bool GOOrganController::IsToImportCombinationsFor (
678
- const wxString &fileName, const wxString &churchName ) const {
678
+ const wxString &fileName, const wxString &organName ) const {
679
679
bool isToImport = true ;
680
680
681
- if (churchName != m_ChurchName ) {
681
+ if (organName != GetOrganName () ) {
682
682
wxLogWarning (
683
683
_ (" This combination file '%s' was originally made for another organ "
684
684
" '%s'" ),
685
685
fileName,
686
- churchName );
686
+ organName );
687
687
isToImport = wxMessageBox (
688
688
wxString::Format (
689
689
_ (" This combination file '%s' was originally made for "
690
690
" another organ '%s'. Importing it can cause various "
691
691
" problems. Should it really be imported?" ),
692
692
fileName,
693
- churchName ),
693
+ organName ),
694
694
_ (" Import Combinations" ),
695
695
wxYES_NO,
696
696
NULL )
@@ -866,7 +866,7 @@ bool GOOrganController::Export(const wxString &cmb) {
866
866
867
867
m_b_customized = true ;
868
868
cfg.WriteString (WX_ORGAN, wxT (" ODFHash" ), m_ODFHash);
869
- cfg.WriteString (WX_ORGAN, wxT (" ChurchName" ), m_ChurchName );
869
+ cfg.WriteString (WX_ORGAN, wxT (" ChurchName" ), GetOrganName () );
870
870
cfg.WriteString (WX_ORGAN, wxT (" ChurchAddress" ), m_ChurchAddress);
871
871
cfg.WriteString (WX_ORGAN, wxT (" ODFPath" ), GetODFFilename ());
872
872
if (m_ArchiveID != wxEmptyString)
@@ -943,8 +943,6 @@ void GOOrganController::AddPanel(GOGUIPanel *panel) {
943
943
m_panels.push_back (panel);
944
944
}
945
945
946
- const wxString &GOOrganController::GetChurchName () { return m_ChurchName; }
947
-
948
946
const wxString &GOOrganController::GetChurchAddress () {
949
947
return m_ChurchAddress;
950
948
}
@@ -987,7 +985,7 @@ GOOrgan GOOrganController::GetOrganInfo() {
987
985
GetODFFilename (),
988
986
m_ArchiveID,
989
987
m_ArchivePath,
990
- GetChurchName (),
988
+ GetOrganName (),
991
989
GetOrganBuilder (),
992
990
GetRecordingDetails ());
993
991
}
@@ -999,7 +997,7 @@ const wxString GOOrganController::GetSettingFilename() {
999
997
const wxString GOOrganController::GetCacheFilename () { return m_CacheFilename; }
1000
998
1001
999
wxString GOOrganController::GetCombinationsDir () const {
1002
- return wxFileName (m_config.OrganCombinationsPath (), m_ChurchName )
1000
+ return wxFileName (m_config.OrganCombinationsPath (), GetOrganName () )
1003
1001
.GetFullPath ();
1004
1002
}
1005
1003
0 commit comments