]> git.cworth.org Git - vogl/blob - src/vogleditor/vogleditor_statetreesyncitem.cpp
Initial vogl checkin
[vogl] / src / vogleditor / vogleditor_statetreesyncitem.cpp
1 #include "vogleditor_statetreesyncitem.h"
2
3 #include "vogl_sync_object.h"
4
5 vogleditor_stateTreeSyncItem::vogleditor_stateTreeSyncItem(QString name, vogleditor_stateTreeItem* parent, const vogl_sync_state& state)
6     : vogleditor_stateTreeItem(name, "", parent),
7       m_pState(&state),
8       m_pDiffBaseState(NULL)
9 {
10     int value = 0;
11     if (state.get_params().get<int>(GL_SYNC_STATUS, 0, &value))
12     {
13        setValue(enum_to_string(value));
14     }
15 }
16
17 void vogleditor_stateTreeSyncItem::set_diff_base_state(const vogl_sync_state* pBaseState)
18 {
19     m_pDiffBaseState = pBaseState;
20 }
21
22 bool vogleditor_stateTreeSyncItem::hasChanged() const
23 {
24     if (m_pDiffBaseState == NULL)
25         return false;
26
27     return !(m_pState->compare_restorable_state(*m_pDiffBaseState));
28 }