Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+10
-11
@@ -75,10 +75,9 @@ void checkHierarchy(const std::vector<AudioVideoManagement::AvMenuEntry> &entrie
|
||||
namespace AudioVideoManagement
|
||||
{
|
||||
|
||||
ObjectMenuStruct::ObjectMenuStruct(Interface::Dts *dts, DatabaseInterface *db)
|
||||
: m_dts(dts)
|
||||
, m_db(db)
|
||||
{
|
||||
ObjectMenuStruct::ObjectMenuStruct(Interface::Dts *dts, DatabaseInterface *db) : m_dts(dts)
|
||||
, m_db(db),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
Q_ASSERT(dts);
|
||||
Q_ASSERT(db);
|
||||
}
|
||||
@@ -127,10 +126,10 @@ Core::FunctionReplyObject ObjectMenuStruct::remove()
|
||||
{
|
||||
DBTransaction trans(m_db->database());
|
||||
|
||||
INFO_LOG() << "menuEntries.size(): " << m_data.menuEntries().size();
|
||||
INFO_LOG(m_logger) << "menuEntries.size(): " << m_data.menuEntries().size();
|
||||
for (const AudioVideoManagement::AvMenuEntry &me : m_data.menuEntries())
|
||||
{
|
||||
INFO_LOG() << "Remove entries with id/parentId: " << me.id();
|
||||
INFO_LOG(m_logger) << "Remove entries with id/parentId: " << me.id();
|
||||
// no recursion needed, only 2 levels allowed
|
||||
if (me.isGroup())
|
||||
if (!m_db->removeAvmMenuStructByParentId(me.id()))
|
||||
@@ -151,10 +150,10 @@ Core::FunctionReplyObject ObjectMenuStruct::remove()
|
||||
void ObjectMenuStruct::onPublishData()
|
||||
{
|
||||
|
||||
INFO_LOG() << "Publish MenuStruct-data to dds (" << m_data.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish MenuStruct-data to dds (" << m_data.id() << ") ...";
|
||||
|
||||
if (!m_dts->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing MenuStruct-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing MenuStruct-data to dds";
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +197,7 @@ Core::FunctionReplyObject ObjectMenuStruct::insertUpdateDb(const MenuStruct &dat
|
||||
if (ret.error())
|
||||
return ret;
|
||||
|
||||
DEBUG_LOG() << "old entries: " << m_data;
|
||||
DEBUG_LOG(m_logger) << "old entries: " << m_data;
|
||||
for (const AvMenuEntry &me : oldEntries)
|
||||
{
|
||||
// new entries - ignore
|
||||
@@ -208,14 +207,14 @@ Core::FunctionReplyObject ObjectMenuStruct::insertUpdateDb(const MenuStruct &dat
|
||||
auto found = std::find_if(newEntries.begin(), newEntries.end(), [&me] (const AvMenuEntry &newEntry) { return me.id() == newEntry.id(); });
|
||||
if (found == newEntries.end())
|
||||
{
|
||||
DEBUG_LOG() << "Menu Entry with id not found - was removed: " << me.id();
|
||||
DEBUG_LOG(m_logger) << "Menu Entry with id not found - was removed: " << me.id();
|
||||
m_db->removeAvmMenuStruct(me.id());
|
||||
}
|
||||
}
|
||||
|
||||
m_data.menuEntries(newEntries);
|
||||
HandlerMenuStruct::sortEntries(m_data);
|
||||
DEBUG_LOG() << "new entries: " << m_data;
|
||||
DEBUG_LOG(m_logger) << "new entries: " << m_data;
|
||||
|
||||
trans.commit();
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
|
||||
Reference in new issue
Block a user