Commit ba08af44 authored by Cory Quammen's avatar Cory Quammen

Removed bool return value from LoadSettings()

The original intent was to indicate success or failure of loading
settings. However, it's not clear what success or failure means
because it is legitimate to not have a user- or site-settings file, so
indicating failure if one of these cannot be loaded is not really
accurate. Moreover, the return value wasn't used by the caller.

In addition, there was a bug in the previous implementation. If the
user settings weren't loaded, the site settings wouldn't be loaded
either. Now this method no longer returns any boolean value.

Change-Id: I039fc39aec3866e0d5b349fa43fc8f5c0d648d2a
parent b3ba47ce
......@@ -290,26 +290,25 @@ void vtkInitializationHelper::StandaloneFinalize()
}
//----------------------------------------------------------------------------
bool vtkInitializationHelper::LoadSettings()
void vtkInitializationHelper::LoadSettings()
{
if (vtkInitializationHelper::LoadSettingsFilesDuringInitialization == false)
{
return false;
return;
}
vtkSMSettings* settings = vtkSMSettings::GetInstance();
int myRank = vtkProcessModule::GetProcessModule()->GetPartitionId();
bool success = true;
if (myRank > 0) // don't read files on satellites.
{
settings->DistributeSettings();
return true;
return;
}
// Load user-level settings
std::string userSettingsFilePath = vtkInitializationHelper::GetUserSettingsFilePath();
success = success && settings->AddCollectionFromFile(userSettingsFilePath, VTK_DOUBLE_MAX);
settings->AddCollectionFromFile(userSettingsFilePath, VTK_DOUBLE_MAX);
// Load site-level settings
vtkPVOptions* options = vtkProcessModule::GetProcessModule()->GetOptions();
......@@ -359,13 +358,12 @@ bool vtkInitializationHelper::LoadSettings()
if (settingsFileFound)
{
success = success && settings->AddCollectionFromFile(siteSettingsFile, 1.0);
settings->AddCollectionFromFile(siteSettingsFile, 1.0);
}
settings->DistributeSettings();
vtkInitializationHelper::SaveUserSettingsFileDuringFinalization = true;
return success;
}
//----------------------------------------------------------------------------
......
......@@ -82,8 +82,8 @@ protected:
virtual ~vtkInitializationHelper() {};
// Description:
// Load settings
static bool LoadSettings();
// Load user and site settings
static void LoadSettings();
// Description:
// Get directory for user settings file. The last character is always the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment