Index: src/libchcore/IColumnsDefinition.h =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/IColumnsDefinition.h (.../IColumnsDefinition.h) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/IColumnsDefinition.h (.../IColumnsDefinition.h) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -57,12 +57,8 @@ virtual TString GetColumnName(size_t stIndex) const = 0; virtual size_t GetCount() const = 0; virtual bool IsEmpty() const = 0; - -// virtual IColumnsDefinition& operator%(const TString& strColName) = 0; }; -//typedef boost::shared_ptr IColumnsDefinitionPtr; - END_CHCORE_NAMESPACE #endif Index: src/libchcore/ISerializerContainer.h =================================================================== diff -u -r081055369d6b332ef1651877756657973b1b2d9c -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/ISerializerContainer.h (.../ISerializerContainer.h) (revision 081055369d6b332ef1651877756657973b1b2d9c) +++ src/libchcore/ISerializerContainer.h (.../ISerializerContainer.h) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -38,8 +38,7 @@ virtual IColumnsDefinition& GetColumnsDefinition() = 0; // prepare data to be stored - virtual ISerializerRowDataPtr AddRow(size_t stRowID) = 0; - virtual ISerializerRowDataPtr GetRow(size_t stRowID) = 0; + virtual ISerializerRowDataPtr GetRow(size_t stRowID, bool bMarkAsAdded) = 0; virtual void DeleteRow(size_t stRowID) = 0; virtual void DeleteRows(const TRemovedObjects& setObjects) = 0; Index: src/libchcore/TBasePathData.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TBasePathData.cpp (.../TBasePathData.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TBasePathData.cpp (.../TBasePathData.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -97,10 +97,8 @@ ISerializerRowDataPtr spRow; bool bAdded = m_setModifications[eMod_Added]; - if(bAdded) - spRow = spContainer->AddRow(m_stObjectID); - else if(m_setModifications.any()) - spRow = spContainer->GetRow(m_stObjectID); + if(m_setModifications.any()) + spRow = spContainer->GetRow(m_stObjectID, bAdded); else return; Index: src/libchcore/TConfig.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -151,10 +151,8 @@ ISerializerRowDataPtr spRow; bool bAdded = rNode.m_setModifications[ConfigNode::eMod_Added]; - if(bAdded) - spRow = spContainer->AddRow(rNode.m_stObjectID); - else if(rNode.m_setModifications.any()) - spRow = spContainer->GetRow(rNode.m_stObjectID); + if(rNode.m_setModifications.any()) + spRow = spContainer->GetRow(rNode.m_stObjectID, bAdded); else continue; Index: src/libchcore/TFileFilter.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TFileFilter.cpp (.../TFileFilter.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TFileFilter.cpp (.../TFileFilter.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -573,10 +573,8 @@ ISerializerRowDataPtr spRow; bool bAdded = m_setModifications[eMod_Added]; - if(bAdded) - spRow = spContainer->AddRow(m_stObjectID); - else if(m_setModifications.any()) - spRow = spContainer->GetRow(m_stObjectID); + if(m_setModifications.any()) + spRow = spContainer->GetRow(m_stObjectID, bAdded); else return; Index: src/libchcore/TFileInfo.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TFileInfo.cpp (.../TFileInfo.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TFileInfo.cpp (.../TFileInfo.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -250,10 +250,8 @@ void TFileInfo::Store(const ISerializerContainerPtr& spContainer) const { ISerializerRowDataPtr spRow; - if(m_setModifications[eMod_Added]) - spRow = spContainer->AddRow(m_stObjectID); - else if(m_setModifications.any()) - spRow = spContainer->GetRow(m_stObjectID); + if(m_setModifications.any()) + spRow = spContainer->GetRow(m_stObjectID, m_setModifications[eMod_Added]); else return; Index: src/libchcore/TModPathContainer.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TModPathContainer.cpp (.../TModPathContainer.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TModPathContainer.cpp (.../TModPathContainer.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -292,10 +292,8 @@ const TModificationTracker& rItem = iterPath->second; ISerializerRowDataPtr spRow; - if(rItem.IsAdded()) - spRow = spContainer->AddRow(iterPath->first); - else if(rItem.IsModified()) - spRow = spContainer->GetRow(iterPath->first); + if(rItem.IsModified()) + spRow = spContainer->GetRow(iterPath->first, rItem.IsAdded()); else continue; Index: src/libchcore/TModificationTracker.h =================================================================== diff -u -r293e52b38d46653068006262172018a0f0d0a31c -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TModificationTracker.h (.../TModificationTracker.h) (revision 293e52b38d46653068006262172018a0f0d0a31c) +++ src/libchcore/TModificationTracker.h (.../TModificationTracker.h) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -84,7 +84,7 @@ bool IsModified() const { - return m_chModified != 0; + return m_chModified != 0; // must also include 'Added' status! } bool IsAdded() const Index: src/libchcore/TSQLiteColumnDefinition.h =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TSQLiteColumnDefinition.h (.../TSQLiteColumnDefinition.h) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TSQLiteColumnDefinition.h (.../TSQLiteColumnDefinition.h) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -40,8 +40,6 @@ virtual size_t GetCount() const; virtual bool IsEmpty() const; -// virtual IColumnsDefinition& operator%(const TString& strColName); - virtual TString GetCommaSeparatedColumns() const; private: @@ -52,8 +50,6 @@ #pragma warning(pop) }; -typedef boost::shared_ptr TSQLiteColumnDefinitionPtr; - END_CHCORE_NAMESPACE #endif Index: src/libchcore/TSQLiteSerializerContainer.cpp =================================================================== diff -u -r081055369d6b332ef1651877756657973b1b2d9c -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TSQLiteSerializerContainer.cpp (.../TSQLiteSerializerContainer.cpp) (revision 081055369d6b332ef1651877756657973b1b2d9c) +++ src/libchcore/TSQLiteSerializerContainer.cpp (.../TSQLiteSerializerContainer.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -48,19 +48,13 @@ { } -chcore::ISerializerRowDataPtr TSQLiteSerializerContainer::AddRow(size_t stRowID) +ISerializerRowDataPtr TSQLiteSerializerContainer::GetRow(size_t stRowID, bool bMarkAsAdded) { - RowMap::iterator iterInsert = m_mapRows.insert( - std::make_pair(stRowID, TSQLiteSerializerRowDataPtr(new TSQLiteSerializerRowData(stRowID, m_tColumns, true))) - ).first; - return (*iterInsert).second; -} - -ISerializerRowDataPtr TSQLiteSerializerContainer::GetRow(size_t stRowID) -{ RowMap::iterator iterFnd = m_mapRows.find(stRowID); if(iterFnd == m_mapRows.end()) - iterFnd = m_mapRows.insert(std::make_pair(stRowID, TSQLiteSerializerRowDataPtr(new TSQLiteSerializerRowData(stRowID, m_tColumns, false)))).first; + iterFnd = m_mapRows.insert(std::make_pair(stRowID, TSQLiteSerializerRowDataPtr(new TSQLiteSerializerRowData(stRowID, m_tColumns, bMarkAsAdded)))).first; + else if(bMarkAsAdded) + iterFnd->second->MarkAsAdded(); return (*iterFnd).second; } Index: src/libchcore/TSQLiteSerializerContainer.h =================================================================== diff -u -r081055369d6b332ef1651877756657973b1b2d9c -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TSQLiteSerializerContainer.h (.../TSQLiteSerializerContainer.h) (revision 081055369d6b332ef1651877756657973b1b2d9c) +++ src/libchcore/TSQLiteSerializerContainer.h (.../TSQLiteSerializerContainer.h) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -40,8 +40,7 @@ virtual IColumnsDefinition& GetColumnsDefinition(); - virtual ISerializerRowDataPtr AddRow(size_t stRowID); - virtual ISerializerRowDataPtr GetRow(size_t stRowID); + virtual ISerializerRowDataPtr GetRow(size_t stRowID, bool bMarkAsAdded); virtual void DeleteRow(size_t stRowID); virtual void DeleteRows(const TRemovedObjects& setObjects); Index: src/libchcore/TSQLiteSerializerRowData.cpp =================================================================== diff -u -r081055369d6b332ef1651877756657973b1b2d9c -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision 081055369d6b332ef1651877756657973b1b2d9c) +++ src/libchcore/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -284,4 +284,9 @@ return rowID; } +void TSQLiteSerializerRowData::MarkAsAdded() +{ + m_bAdded = true; +} + END_CHCORE_NAMESPACE Index: src/libchcore/TSQLiteSerializerRowData.h =================================================================== diff -u -r081055369d6b332ef1651877756657973b1b2d9c -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TSQLiteSerializerRowData.h (.../TSQLiteSerializerRowData.h) (revision 081055369d6b332ef1651877756657973b1b2d9c) +++ src/libchcore/TSQLiteSerializerRowData.h (.../TSQLiteSerializerRowData.h) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -71,6 +71,8 @@ void BindParamsAndExec(sqlite::TSQLiteStatement& tStatement); + void MarkAsAdded(); + private: size_t m_stRowID; bool m_bAdded; Index: src/libchcore/TSubTaskArray.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -183,13 +183,8 @@ ISerializerContainerPtr spContainer = spSerializer->GetContainer(_T("subtasks_info")); InitSubtasksInfoColumns(spContainer); - ISerializerRowDataPtr spRow; + ISerializerRowDataPtr spRow = spContainer->GetRow(0, bAdded); - if(bAdded) - spRow = spContainer->AddRow(0); - else - spRow = spContainer->GetRow(0); - *spRow % TRowData(_T("operation"), m_eOperationType.Get()); } @@ -215,7 +210,7 @@ { const std::pair& rCurrentSubTask = m_vSubTasks[stSubOperationIndex]; - spRow = spContainer->AddRow(stSubOperationIndex); + spRow = spContainer->GetRow(stSubOperationIndex, bAdded); *spRow % TRowData(_T("type"), rCurrentSubTask.first->GetSubOperationType()) % TRowData(_T("is_current"), false) @@ -229,14 +224,14 @@ // mark subtask at current index as "current"; don't do that if we just finished. if(boost::numeric_cast(lCurrentIndex) != m_vSubTasks.size()) { - spRow = spContainer->GetRow(lCurrentIndex); + spRow = spContainer->GetRow(lCurrentIndex, false); *spRow % TRowData(_T("is_current"), true); } // unmark the old "current" subtask if(m_lLastStoredIndex != -1) { - spRow = spContainer->GetRow(m_lLastStoredIndex); + spRow = spContainer->GetRow(m_lLastStoredIndex, false); *spRow % TRowData(_T("is_current"), false); } } Index: src/libchcore/TSubTaskCopyMove.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -1321,13 +1321,8 @@ ISerializerContainerPtr spContainer = spSerializer->GetContainer(_T("subtask_copymove")); InitColumns(spContainer); - ISerializerRowDataPtr spRow; + ISerializerRowDataPtr spRow = spContainer->GetRow(0, !m_tProgressInfo.WasSerialized()); - if(m_tProgressInfo.WasSerialized()) - spRow = spContainer->GetRow(0); - else - spRow = spContainer->AddRow(0); - m_tProgressInfo.Store(spRow); m_tSubTaskStats.Store(spRow); } Index: src/libchcore/TSubTaskDelete.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -255,13 +255,8 @@ ISerializerContainerPtr spContainer = spSerializer->GetContainer(_T("subtask_delete")); InitColumns(spContainer); - ISerializerRowDataPtr spRow; + ISerializerRowDataPtr spRow = spContainer->GetRow(0, !m_tProgressInfo.WasSerialized()); - if(m_tProgressInfo.WasSerialized()) - spRow = spContainer->GetRow(0); - else - spRow = spContainer->AddRow(0); - m_tProgressInfo.Store(spRow); m_tSubTaskStats.Store(spRow); } Index: src/libchcore/TSubTaskFastMove.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -315,13 +315,8 @@ InitColumns(spContainer); - ISerializerRowDataPtr spRow; + ISerializerRowDataPtr spRow = spContainer->GetRow(0, !m_tProgressInfo.WasSerialized()); - if(m_tProgressInfo.WasSerialized()) - spRow = spContainer->GetRow(0); - else - spRow = spContainer->AddRow(0); - m_tProgressInfo.Store(spRow); m_tSubTaskStats.Store(spRow); } Index: src/libchcore/TTaskBaseData.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TTaskBaseData.cpp (.../TTaskBaseData.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TTaskBaseData.cpp (.../TTaskBaseData.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -82,17 +82,12 @@ { InitColumns(spContainer); - ISerializerRowDataPtr spRow; - // base data if(m_setChanges.any()) { bool bAdded = m_setChanges[eMod_Added]; - if(bAdded) - spRow = spContainer->AddRow(0); - else - spRow = spContainer->GetRow(0); + ISerializerRowDataPtr spRow = spContainer->GetRow(0, bAdded); if(bAdded || m_setChanges[eMod_TaskName]) *spRow % TRowData(_T("name"), m_strTaskName); Index: src/libchcore/TTaskInfo.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TTaskInfo.cpp (.../TTaskInfo.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TTaskInfo.cpp (.../TTaskInfo.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -80,10 +80,7 @@ ISerializerRowDataPtr spRow; bool bAdded = m_setModifications[eMod_Added]; - if(bAdded) - spRow = spContainer->AddRow(m_stObjectID); - else - spRow = spContainer->GetRow(m_stObjectID); + spRow = spContainer->GetRow(m_stObjectID, bAdded); if(bAdded || m_setModifications[eMod_TaskPath]) *spRow % TRowData(_T("path"), m_pathSerializeLocation); Index: src/libchcore/TTaskLocalStats.cpp =================================================================== diff -u -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 --- src/libchcore/TTaskLocalStats.cpp (.../TTaskLocalStats.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TTaskLocalStats.cpp (.../TTaskLocalStats.cpp) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) @@ -158,10 +158,8 @@ ISerializerRowDataPtr spRow; bool bAdded = m_setModifications[eMod_Added]; - if(bAdded) - spRow = spContainer->AddRow(0); - else if(m_setModifications.any()) - spRow = spContainer->GetRow(0); + if(m_setModifications.any()) + spRow = spContainer->GetRow(0, bAdded); else return;