Skip to content

Commit

Permalink
refs #6618. Wrap with static bool.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Feb 26, 2013
1 parent 6ebf352 commit 6d019f1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Code/Mantid/MantidQt/API/src/InterfaceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,19 @@ InterfaceManager::InterfaceManager()
const std::string libpath = Mantid::Kernel::ConfigService::Instance().getString("mantidqt.plugins.directory");
if( !libpath.empty() )
{
int nloaded = Mantid::Kernel::LibraryManager::Instance().OpenAllLibraries(libpath);
if( nloaded == 0 )
// Lazy loading. Avoid loading libraries every time a new instance is created.
static bool isLoaded;
if(!isLoaded)
{
g_log.warning() << "Unable to load Qt plugin libraries.\n"
<< "Please check that the 'mantidqt.plugins.directory' variable in the .properties file points to "
<< "the correct location."
<< std::endl;
int nloaded = Mantid::Kernel::LibraryManager::Instance().OpenAllLibraries(libpath);
if( nloaded == 0 )
{
g_log.warning() << "Unable to load Qt plugin libraries.\n"
<< "Please check that the 'mantidqt.plugins.directory' variable in the .properties file points to "
<< "the correct location."
<< std::endl;
}
isLoaded = true;
}
}
}
Expand Down

0 comments on commit 6d019f1

Please sign in to comment.