EDS contacts: better check SYNCEVOLUTION_EDS_ACCESS_MODE in constructor
That way we can initialize m_accessMode immediately in the constructor, which keeps cppcheck happy and avoids uninitalized data in the instance between creation and open(), which is better than before.
This commit is contained in:
parent
e407d71410
commit
ba7e3543f0
|
@ -79,6 +79,10 @@ EvolutionContactSource::EvolutionContactSource(const SyncSourceParams ¶ms,
|
|||
m_contactsFromDB =
|
||||
m_contactQueries = 0;
|
||||
m_readAheadOrder = READ_NONE;
|
||||
const char *mode = getEnv("SYNCEVOLUTION_EDS_ACCESS_MODE", "");
|
||||
m_accessMode = boost::iequals(mode, "synchronous") ? SYNCHRONOUS :
|
||||
boost::iequals(mode, "batched") ? BATCHED :
|
||||
DEFAULT;
|
||||
#endif
|
||||
SyncSourceLogging::init(InitList<std::string>("N_FIRST") + "N_MIDDLE" + "N_LAST",
|
||||
" ",
|
||||
|
@ -191,10 +195,6 @@ void EvolutionContactSource::open()
|
|||
m_addressbook.reset(E_BOOK_CLIENT(openESource(E_SOURCE_EXTENSION_ADDRESS_BOOK,
|
||||
e_source_registry_ref_builtin_address_book,
|
||||
newEBookClient).get()));
|
||||
const char *mode = getEnv("SYNCEVOLUTION_EDS_ACCESS_MODE", "");
|
||||
m_accessMode = boost::iequals(mode, "synchronous") ? SYNCHRONOUS :
|
||||
boost::iequals(mode, "batched") ? BATCHED :
|
||||
DEFAULT;
|
||||
#else
|
||||
GErrorCXX gerror;
|
||||
bool created = false;
|
||||
|
|
Loading…
Reference in a new issue