Index: src/ch/FeedbackReplaceDlg.cpp =================================================================== diff -u -rf01ed9a0279a52c96a7272273ef19e57f7670f4a -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/ch/FeedbackReplaceDlg.cpp (.../FeedbackReplaceDlg.cpp) (revision f01ed9a0279a52c96a7272273ef19e57f7670f4a) +++ src/ch/FeedbackReplaceDlg.cpp (.../FeedbackReplaceDlg.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -10,6 +10,7 @@ #include "../libchengine/TFileInfo.h" #include "StringHelpers.h" #include "../libchengine/FeedbackPredefinedRules.h" +#include "RuleEditDlg.h" using namespace chengine; using namespace string; @@ -52,6 +53,8 @@ DDX_Control(pDX, IDC_SKIP_BUTTON, m_btnSkip); DDX_Control(pDX, IDC_PAUSE_BUTTON, m_btnPause); DDX_Control(pDX, IDC_CANCEL_BUTTON, m_btnCancel); + + DDX_Control(pDX, IDC_CUSTOM_RULES_BUTTON, m_btnCustomRules); } BEGIN_MESSAGE_MAP(CFeedbackReplaceDlg, ictranslate::CLanguageDialog) @@ -61,6 +64,7 @@ ON_BN_CLICKED(IDC_SKIP_BUTTON, &CFeedbackReplaceDlg::OnBnClickedSkipButton) ON_BN_CLICKED(IDC_PAUSE_BUTTON, &CFeedbackReplaceDlg::OnBnClickedPauseButton) ON_BN_CLICKED(IDC_CANCEL_BUTTON, &CFeedbackReplaceDlg::OnBnClickedCancelButton) + ON_BN_CLICKED(IDC_CUSTOM_RULES_BUTTON, &CFeedbackReplaceDlg::OnBnCustomRulesButton) ON_WM_GETMINMAXINFO() END_MESSAGE_MAP() @@ -305,6 +309,15 @@ EndDialog(chengine::EFeedbackResult::eResult_Cancel); } +void CFeedbackReplaceDlg::OnBnCustomRulesButton() +{ + RuleEditDlg dlg(m_rules); + if(dlg.DoModal() == IDOK) + { + // todo: apply modified rules + } +} + void CFeedbackReplaceDlg::OnCancel() { UpdateData(TRUE); Index: src/ch/FeedbackReplaceDlg.h =================================================================== diff -u -rf01ed9a0279a52c96a7272273ef19e57f7670f4a -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/ch/FeedbackReplaceDlg.h (.../FeedbackReplaceDlg.h) (revision f01ed9a0279a52c96a7272273ef19e57f7670f4a) +++ src/ch/FeedbackReplaceDlg.h (.../FeedbackReplaceDlg.h) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -1,23 +1,22 @@ -/*************************************************************************** - * Copyright (C) 2001-2008 by Jozef Starosczyk * - * ixen@copyhandler.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License * - * (version 2) as published by the Free Software Foundation; * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef __FEEDBACKREPLACEDLG_H__ -#define __FEEDBACKREPLACEDLG_H__ +// ============================================================================ +// Copyright (C) 2001-2020 by Jozef Starosczyk +// ixen {at} copyhandler [dot] com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +#pragma once #include "../libchengine/FeedbackRules.h" @@ -52,6 +51,7 @@ afx_msg void OnBnClickedSkipButton(); afx_msg void OnBnClickedPauseButton(); afx_msg void OnBnClickedCancelButton(); + afx_msg void OnBnCustomRulesButton(); afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI); @@ -78,6 +78,7 @@ CMFCMenuButton m_btnSkip; CMFCButton m_btnPause; CMFCButton m_btnCancel; + CMFCButton m_btnCustomRules; CMenu m_menuMassReplace; CMenu m_menuMassRename; @@ -92,5 +93,3 @@ chengine::FeedbackRules& m_rules; string::TString m_strNewName; }; - -#endif Index: src/ch/RuleEditAlreadyExistsDlg.cpp =================================================================== diff -u -r1c585b955eb548cbedc7d36f1ea5af484206e7eb -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/ch/RuleEditAlreadyExistsDlg.cpp (.../RuleEditAlreadyExistsDlg.cpp) (revision 1c585b955eb548cbedc7d36f1ea5af484206e7eb) +++ src/ch/RuleEditAlreadyExistsDlg.cpp (.../RuleEditAlreadyExistsDlg.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -109,7 +109,8 @@ const wchar_t* pszData = GetResManager().LoadString(iIndex); m_ctlResponse.AddString(pszData); } - + m_ctlResponse.SetCurSel(IDS_FEEDBACK_RESPONSE_OVERWRITE - IDS_FEEDBACK_RESPONSE_UNKNOWN); + UpdateData(FALSE); EnableControls(); Index: src/ch/RuleEditDlg.cpp =================================================================== diff -u -rf51cacae8d8461c98bbb4a498407d6aec8f94410 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/ch/RuleEditDlg.cpp (.../RuleEditDlg.cpp) (revision f51cacae8d8461c98bbb4a498407d6aec8f94410) +++ src/ch/RuleEditDlg.cpp (.../RuleEditDlg.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -37,6 +37,7 @@ ictranslate::CLanguageDialog(IDD_RULE_EDIT_ALL_DIALOG), m_rules(rRules) { + m_rules.ResetModifications(); } void RuleEditDlg::DoDataExchange(CDataExchange* pDX) @@ -128,35 +129,35 @@ lvc.iSubItem = -1; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRMASK_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.15 * rc.Width()); + lvc.cx = static_cast(0.2 * rc.Width()); m_ctlAlreadyExistsRulesList.InsertColumn(1, &lvc); // exclude mask lvc.iSubItem = 0; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEMASK_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.15 * rc.Width()); + lvc.cx = static_cast(0.2 * rc.Width()); m_ctlAlreadyExistsRulesList.InsertColumn(2, &lvc); // size lvc.iSubItem = 1; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRSIZE_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.3 * rc.Width()); + lvc.cx = static_cast(0.2 * rc.Width()); m_ctlAlreadyExistsRulesList.InsertColumn(3, &lvc); // time lvc.iSubItem = 2; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRDATE_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.3 * rc.Width()); + lvc.cx = static_cast(0.2 * rc.Width()); m_ctlAlreadyExistsRulesList.InsertColumn(4, &lvc); // attributes lvc.iSubItem = 3; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRRESULT_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.1 * rc.Width()); + lvc.cx = static_cast(0.2 * rc.Width()); m_ctlAlreadyExistsRulesList.InsertColumn(5, &lvc); } @@ -174,35 +175,35 @@ lvc.iSubItem = -1; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRMASK_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.15 * rc.Width()); + lvc.cx = static_cast(0.2 * rc.Width()); m_ctlErrorRulesList.InsertColumn(1, &lvc); // exclude mask lvc.iSubItem = 0; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEMASK_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.15 * rc.Width()); + lvc.cx = static_cast(0.2 * rc.Width()); m_ctlErrorRulesList.InsertColumn(2, &lvc); // operation type lvc.iSubItem = 1; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDROPERATION_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.3 * rc.Width()); + lvc.cx = static_cast(0.2 * rc.Width()); m_ctlErrorRulesList.InsertColumn(3, &lvc); // system error lvc.iSubItem = 2; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRSYSTEMERROR_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.3 * rc.Width()); + lvc.cx = static_cast(0.2 * rc.Width()); m_ctlErrorRulesList.InsertColumn(4, &lvc); // result lvc.iSubItem = 3; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRRESULT_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.1 * rc.Width()); + lvc.cx = static_cast(0.2 * rc.Width()); m_ctlErrorRulesList.InsertColumn(5, &lvc); } @@ -220,21 +221,21 @@ lvc.iSubItem = -1; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRMASK_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.15 * rc.Width()); + lvc.cx = static_cast(0.4 * rc.Width()); m_ctlNotEnoughSpaceRulesList.InsertColumn(1, &lvc); // exclude mask lvc.iSubItem = 0; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEMASK_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.15 * rc.Width()); + lvc.cx = static_cast(0.4 * rc.Width()); m_ctlNotEnoughSpaceRulesList.InsertColumn(2, &lvc); // result lvc.iSubItem = 1; lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRRESULT_STRING); lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.1 * rc.Width()); + lvc.cx = static_cast(0.2 * rc.Width()); m_ctlNotEnoughSpaceRulesList.InsertColumn(5, &lvc); } @@ -319,7 +320,7 @@ lvi.iSubItem = 2; TString strSrcFile = GetResManager().LoadString(IDS_SOURCE_FILE_STRING); - TString strDstFile = GetResManager().LoadString(IDS_SOURCE_FILE_STRING); + TString strDstFile = GetResManager().LoadString(IDS_DESTINATION_FILE_STRING); if(rRule.GetUseSizeCompare()) { Index: src/ch/RuleEditErrorDlg.cpp =================================================================== diff -u -rf51cacae8d8461c98bbb4a498407d6aec8f94410 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/ch/RuleEditErrorDlg.cpp (.../RuleEditErrorDlg.cpp) (revision f51cacae8d8461c98bbb4a498407d6aec8f94410) +++ src/ch/RuleEditErrorDlg.cpp (.../RuleEditErrorDlg.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -110,7 +110,8 @@ const wchar_t* pszData = GetResManager().LoadString(iIndex); m_ctlResponse.AddString(pszData); } - + m_ctlResponse.SetCurSel(IDS_FEEDBACK_RESPONSE_SKIP - IDS_FEEDBACK_RESPONSE_UNKNOWN); + UpdateData(FALSE); EnableControls(); @@ -177,7 +178,7 @@ CString strErrorNo; m_ctlSystemError.GetWindowText(strErrorNo); - unsigned int uiErrorNo = boost::lexical_cast(strErrorNo); + unsigned int uiErrorNo = boost::lexical_cast((PCTSTR)strErrorNo); m_rule.SetSystemErrorNo(uiErrorNo); // date Index: src/ch/RuleEditNotEnoughSpaceDlg.cpp =================================================================== diff -u -rf51cacae8d8461c98bbb4a498407d6aec8f94410 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/ch/RuleEditNotEnoughSpaceDlg.cpp (.../RuleEditNotEnoughSpaceDlg.cpp) (revision f51cacae8d8461c98bbb4a498407d6aec8f94410) +++ src/ch/RuleEditNotEnoughSpaceDlg.cpp (.../RuleEditNotEnoughSpaceDlg.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -83,7 +83,8 @@ const wchar_t* pszData = GetResManager().LoadString(iIndex); m_ctlResponse.AddString(pszData); } - + m_ctlResponse.SetCurSel(IDS_FEEDBACK_RESPONSE_IGNORE - IDS_FEEDBACK_RESPONSE_UNKNOWN); + UpdateData(FALSE); EnableControls(); Index: src/ch/ch.rc =================================================================== diff -u -rf51cacae8d8461c98bbb4a498407d6aec8f94410 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/ch/ch.rc (.../ch.rc) (revision f51cacae8d8461c98bbb4a498407d6aec8f94410) +++ src/ch/ch.rc (.../ch.rc) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -412,8 +412,8 @@ EDITTEXT IDC_DST_FILESIZE_EDIT,96,147,251,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER EDITTEXT IDC_DST_MODIFIEDDATE_EDIT,96,159,251,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER LTEXT "File you are trying to copy already exists. What do you want to do?",IDC_INFO_STATIC,7,7,350,15 - ICON "",IDC_SRC_ICON_STATIC,19,39,14,13 - ICON "",IDC_DST_ICON_STATIC,19,111,14,13 + ICON "",IDC_SRC_ICON_STATIC,19,39,20,20 + ICON "",IDC_DST_ICON_STATIC,19,111,20,20 GROUPBOX "Source file",IDC_SRCFILE_STATIC,7,20,350,66 GROUPBOX "Destination file",IDC_DSTFILE_STATIC,7,92,350,85 LTEXT "Name:",IDC_SRC_NAME_STATIC,49,34,45,8 @@ -425,6 +425,7 @@ LTEXT "Location:",IDC_DST_LOCATION_STATIC,49,135,45,8 LTEXT "Size:",IDC_DST_SIZE_STATIC,49,147,45,8 LTEXT "Modified:",IDC_DST_TIME_STATIC,49,159,45,8 + CONTROL "C&ustom rules...",IDC_CUSTOM_RULES_BUTTON,"MfcButton",WS_TABSTOP,7,202,81,14 END IDD_RULE_EDIT_ALREADYEXISTS_DIALOG DIALOGEX 0, 0, 291, 219 @@ -740,7 +741,8 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 100, 0, 0 + 0, 100, 0, 0, + 0, 0, 0, 0 END IDD_CUSTOM_COPY_DIALOG AFX_DIALOG_LAYOUT @@ -1141,6 +1143,28 @@ 0x5f6e, 0x6d49, 0x6761, 0x4f65, 0x526e, 0x6769, 0x7468, 0x463e, 0x4c41, 0x4553, 0x2f3c, 0x464d, 0x4243, 0x7475, 0x6f74, 0x5f6e, 0x6d49, 0x6761, 0x4f65, 0x526e, 0x6769, 0x7468, "\076" + IDC_CUSTOM_RULES_BUTTON, 0x37c, 369, 0 +0x4d3c, 0x4346, 0x7542, 0x7474, 0x6e6f, 0x535f, 0x7974, 0x656c, 0x343e, +0x2f3c, 0x464d, 0x4243, 0x7475, 0x6f74, 0x5f6e, 0x7453, 0x6c79, 0x3e65, +0x4d3c, 0x4346, 0x7542, 0x7474, 0x6e6f, 0x415f, 0x7475, 0x736f, 0x7a69, +0x3e65, 0x4146, 0x534c, 0x3c45, 0x4d2f, 0x4346, 0x7542, 0x7474, 0x6e6f, +0x415f, 0x7475, 0x736f, 0x7a69, 0x3e65, 0x4d3c, 0x4346, 0x7542, 0x7474, +0x6e6f, 0x545f, 0x6f6f, 0x746c, 0x7069, 0x3c3e, 0x4d2f, 0x4346, 0x7542, +0x7474, 0x6e6f, 0x545f, 0x6f6f, 0x746c, 0x7069, 0x3c3e, 0x464d, 0x4243, +0x7475, 0x6f74, 0x5f6e, 0x7546, 0x6c6c, 0x6554, 0x7478, 0x6f54, 0x6c6f, +0x543e, 0x5552, 0x3c45, 0x4d2f, 0x4346, 0x7542, 0x7474, 0x6e6f, 0x465f, +0x6c75, 0x546c, 0x7865, 0x5474, 0x6f6f, 0x3e6c, 0x4d3c, 0x4346, 0x7542, +0x7474, 0x6e6f, 0x435f, 0x7275, 0x6f73, 0x5472, 0x7079, 0x3e65, 0x3131, +0x2f3c, 0x464d, 0x4243, 0x7475, 0x6f74, 0x5f6e, 0x7543, 0x7372, 0x726f, +0x7954, 0x6570, 0x3c3e, 0x464d, 0x4243, 0x7475, 0x6f74, 0x5f6e, 0x6d49, +0x6761, 0x5465, 0x7079, 0x3e65, 0x3c38, 0x4d2f, 0x4346, 0x7542, 0x7474, +0x6e6f, 0x495f, 0x616d, 0x6567, 0x7954, 0x6570, 0x3c3e, 0x464d, 0x4243, +0x7475, 0x6f74, 0x5f6e, 0x6d49, 0x6761, 0x4f65, 0x546e, 0x706f, 0x463e, +0x4c41, 0x4553, 0x2f3c, 0x464d, 0x4243, 0x7475, 0x6f74, 0x5f6e, 0x6d49, +0x6761, 0x4f65, 0x546e, 0x706f, 0x3c3e, 0x464d, 0x4243, 0x7475, 0x6f74, +0x5f6e, 0x6d49, 0x6761, 0x4f65, 0x526e, 0x6769, 0x7468, 0x463e, 0x4c41, +0x4553, 0x2f3c, 0x464d, 0x4243, 0x7475, 0x6f74, 0x5f6e, 0x6d49, 0x6761, +0x4f65, 0x526e, 0x6769, 0x7468, "\076" 0 END Index: src/ch/resource.h =================================================================== diff -u -r1c585b955eb548cbedc7d36f1ea5af484206e7eb -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/ch/resource.h (.../resource.h) (revision 1c585b955eb548cbedc7d36f1ea5af484206e7eb) +++ src/ch/resource.h (.../resource.h) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -91,6 +91,8 @@ #define IDC_TASK_ADVANCED_BUTTON 1017 #define IDC_PAUSE_BUTTON 1018 #define IDC_STANDARD_CHECK 1019 +#define IDC_PAUSE_BUTTON2 1019 +#define IDC_CUSTOM_RULES_BUTTON 1019 #define IDC_FORCEDIRECTORIES_CHECK 1020 #define IDC_RESUME_BUTTON 1021 #define IDC_CANCEL_BUTTON 1022 @@ -483,7 +485,6 @@ #define IDS_UPDATER_NEWVERSIONEXISTS 5048 #define IDS_UPDATER_RELEASENOTES 5049 #define IDS_FINALIZE_CH_ERROR 5050 - #define IDS_FEEDBACK_RESPONSE_UNKNOWN 5051 #define IDS_FEEDBACK_RESPONSE_OVERWRITE 5052 #define IDS_FEEDBACK_RESPONSE_RESUME 5053 @@ -493,7 +494,6 @@ #define IDS_FEEDBACK_RESPONSE_RETRY 5057 #define IDS_FEEDBACK_RESPONSE_IGNORE 5058 #define IDS_FEEDBACK_RESPONSE_RENAME 5059 - #define IDS_ONECOPY_STRING 6000 #define IDS_REGISTEROK_STRING 6001 #define IDS_REGISTERERR_STRING 6002 @@ -713,7 +713,6 @@ #define IDS_DESTINATION_FILE_STRING 15029 #define IDS_HDROPERATION_STRING 15030 #define IDS_HDRSYSTEMERROR_STRING 15031 - #define IDS_OPERATION_DELETEERROR 15032 #define IDS_OPERATION_SEEKERROR 15033 #define IDS_OPERATION_RESIZEERROR 15034 @@ -724,7 +723,6 @@ #define IDS_OPERATION_CREATEERROR 15039 #define IDS_OPERATION_CHECKFORFREESPACE 15040 #define IDS_OPERATION_RETRIEVEFILEINFO 15041 - #define IDS_NERPATH_STRING 16500 #define IDS_DATECREATED_STRING 18000 #define IDS_DATELASTWRITE_STRING 18001 Index: src/libchengine/FeedbackAlreadyExistsRule.cpp =================================================================== diff -u -r08717141ce5f6926116c298cbc9442094a45bb67 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/FeedbackAlreadyExistsRule.cpp (.../FeedbackAlreadyExistsRule.cpp) (revision 08717141ce5f6926116c298cbc9442094a45bb67) +++ src/libchengine/FeedbackAlreadyExistsRule.cpp (.../FeedbackAlreadyExistsRule.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -22,9 +22,8 @@ m_setModifications[FeedbackAlreadyExistsRuleEnum::eMod_Added] = true; } - FeedbackAlreadyExistsRule::FeedbackAlreadyExistsRule(const FeedbackAlreadyExistsRule& rSrc) : - serializer::SerializableObject(rSrc), + serializer::SerializableObject(rSrc), m_bUseMask(rSrc.m_bUseMask, m_setModifications), m_spaMask(rSrc.m_spaMask, m_setModifications), m_bUseExcludeMask(rSrc.m_bUseExcludeMask, m_setModifications), @@ -181,6 +180,8 @@ { TString strMask; + spRowReader->GetValue(_T("id"), m_oidObjectID); + spRowReader->GetValue(_T("use_mask"), m_bUseMask.Modify()); spRowReader->GetValue(_T("mask"), strMask); SetCombinedMask(strMask); Index: src/libchengine/FeedbackAlreadyExistsRule.h =================================================================== diff -u -r08717141ce5f6926116c298cbc9442094a45bb67 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/FeedbackAlreadyExistsRule.h (.../FeedbackAlreadyExistsRule.h) (revision 08717141ce5f6926116c298cbc9442094a45bb67) +++ src/libchengine/FeedbackAlreadyExistsRule.h (.../FeedbackAlreadyExistsRule.h) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -34,7 +34,7 @@ #pragma warning(push) #pragma warning(disable: 4251) - class LIBCHENGINE_API FeedbackAlreadyExistsRule : public serializer::SerializableObject + class LIBCHENGINE_API FeedbackAlreadyExistsRule : public serializer::SerializableObject { public: FeedbackAlreadyExistsRule(); Index: src/libchengine/FeedbackErrorRule.cpp =================================================================== diff -u -r08717141ce5f6926116c298cbc9442094a45bb67 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/FeedbackErrorRule.cpp (.../FeedbackErrorRule.cpp) (revision 08717141ce5f6926116c298cbc9442094a45bb67) +++ src/libchengine/FeedbackErrorRule.cpp (.../FeedbackErrorRule.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -26,7 +26,7 @@ FeedbackErrorRule::FeedbackErrorRule(const FeedbackErrorRule& rSrc) : - serializer::SerializableObject(rSrc), + serializer::SerializableObject(rSrc), m_bUseMask(rSrc.m_bUseMask, m_setModifications), m_spaMask(rSrc.m_spaMask, m_setModifications), m_bUseExcludeMask(rSrc.m_bUseExcludeMask, m_setModifications), @@ -184,6 +184,8 @@ { TString strMask; + spRowReader->GetValue(_T("id"), m_oidObjectID); + spRowReader->GetValue(_T("use_mask"), m_bUseMask.Modify()); spRowReader->GetValue(_T("mask"), strMask); SetCombinedMask(strMask); Index: src/libchengine/FeedbackErrorRule.h =================================================================== diff -u -r08717141ce5f6926116c298cbc9442094a45bb67 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/FeedbackErrorRule.h (.../FeedbackErrorRule.h) (revision 08717141ce5f6926116c298cbc9442094a45bb67) +++ src/libchengine/FeedbackErrorRule.h (.../FeedbackErrorRule.h) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -35,7 +35,7 @@ #pragma warning(push) #pragma warning(disable: 4251) - class LIBCHENGINE_API FeedbackErrorRule : public serializer::SerializableObject + class LIBCHENGINE_API FeedbackErrorRule : public serializer::SerializableObject { public: FeedbackErrorRule(); Index: src/libchengine/FeedbackNotEnoughSpaceRule.cpp =================================================================== diff -u -r08717141ce5f6926116c298cbc9442094a45bb67 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/FeedbackNotEnoughSpaceRule.cpp (.../FeedbackNotEnoughSpaceRule.cpp) (revision 08717141ce5f6926116c298cbc9442094a45bb67) +++ src/libchengine/FeedbackNotEnoughSpaceRule.cpp (.../FeedbackNotEnoughSpaceRule.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -22,7 +22,7 @@ FeedbackNotEnoughSpaceRule::FeedbackNotEnoughSpaceRule(const FeedbackNotEnoughSpaceRule& rSrc) : - serializer::SerializableObject(rSrc), + serializer::SerializableObject(rSrc), m_bUseMask(rSrc.m_bUseMask, m_setModifications), m_spaMask(rSrc.m_spaMask, m_setModifications), m_bUseExcludeMask(rSrc.m_bUseExcludeMask, m_setModifications), @@ -137,6 +137,8 @@ { TString strMask; + spRowReader->GetValue(_T("id"), m_oidObjectID); + spRowReader->GetValue(_T("use_mask"), m_bUseMask.Modify()); spRowReader->GetValue(_T("mask"), strMask); SetCombinedMask(strMask); Index: src/libchengine/FeedbackNotEnoughSpaceRule.h =================================================================== diff -u -r0d40e49310fc95e7ebe07f9be8aa2fe2de03a2e5 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/FeedbackNotEnoughSpaceRule.h (.../FeedbackNotEnoughSpaceRule.h) (revision 0d40e49310fc95e7ebe07f9be8aa2fe2de03a2e5) +++ src/libchengine/FeedbackNotEnoughSpaceRule.h (.../FeedbackNotEnoughSpaceRule.h) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -31,7 +31,7 @@ #pragma warning(push) #pragma warning(disable: 4251) - class LIBCHENGINE_API FeedbackNotEnoughSpaceRule : public serializer::SerializableObject + class LIBCHENGINE_API FeedbackNotEnoughSpaceRule : public serializer::SerializableObject { public: FeedbackNotEnoughSpaceRule(); Index: src/libchengine/FeedbackOperationEventRule.cpp =================================================================== diff -u -r08717141ce5f6926116c298cbc9442094a45bb67 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/FeedbackOperationEventRule.cpp (.../FeedbackOperationEventRule.cpp) (revision 08717141ce5f6926116c298cbc9442094a45bb67) +++ src/libchengine/FeedbackOperationEventRule.cpp (.../FeedbackOperationEventRule.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -19,7 +19,7 @@ } FeedbackOperationEventRule::FeedbackOperationEventRule(const FeedbackOperationEventRule& rSrc) : - serializer::SerializableObject(rSrc), + serializer::SerializableObject(rSrc), m_bUseOperationEvent(rSrc.m_bUseOperationEvent, m_setModifications), m_eOperationEvent(rSrc.m_eOperationEvent, m_setModifications), m_eResult(rSrc.m_eResult, m_setModifications) @@ -111,6 +111,8 @@ { TString strMask; + spRowReader->GetValue(_T("id"), m_oidObjectID); + spRowReader->GetValue(_T("use_operation_event"), m_bUseOperationEvent.Modify()); spRowReader->GetValue(_T("operation_event"), *(int*)&m_eOperationEvent.Modify()); Index: src/libchengine/FeedbackOperationEventRule.h =================================================================== diff -u -r08717141ce5f6926116c298cbc9442094a45bb67 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/FeedbackOperationEventRule.h (.../FeedbackOperationEventRule.h) (revision 08717141ce5f6926116c298cbc9442094a45bb67) +++ src/libchengine/FeedbackOperationEventRule.h (.../FeedbackOperationEventRule.h) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -30,7 +30,7 @@ #pragma warning(push) #pragma warning(disable: 4251) - class LIBCHENGINE_API FeedbackOperationEventRule : public serializer::SerializableObject + class LIBCHENGINE_API FeedbackOperationEventRule : public serializer::SerializableObject { public: FeedbackOperationEventRule(); Index: src/libchengine/TBasePathData.h =================================================================== diff -u -r85b07e753393f661f7d8f528e4238ebb6e9e1204 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/TBasePathData.h (.../TBasePathData.h) (revision 85b07e753393f661f7d8f528e4238ebb6e9e1204) +++ src/libchengine/TBasePathData.h (.../TBasePathData.h) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -76,6 +76,8 @@ static void InitColumns(serializer::IColumnsDefinition& rColumnDefs); void Load(const serializer::ISerializerRowReaderPtr& spRowReader); + void MarkAsAdded() { m_setModifications[eMod_Added] = true; } + private: #pragma warning(push) #pragma warning(disable: 4251) Index: src/libchengine/TBasePathDataContainer.cpp =================================================================== diff -u -rfa1b3554856407e4501db20d5093818e8d8c4068 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/TBasePathDataContainer.cpp (.../TBasePathDataContainer.cpp) (revision fa1b3554856407e4501db20d5093818e8d8c4068) +++ src/libchengine/TBasePathDataContainer.cpp (.../TBasePathDataContainer.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -83,6 +83,7 @@ spPathData->Load(spRowReader); + m_oidLastObjectID = std::max(m_oidLastObjectID, spPathData->GetObjectID()); m_vEntries.push_back(spPathData); } } @@ -91,6 +92,7 @@ { boost::unique_lock lock(m_lock); spEntry->SetObjectID(++m_oidLastObjectID); + spEntry->MarkAsAdded(); m_vEntries.push_back(spEntry); } Index: src/libchengine/TFileFilter.cpp =================================================================== diff -u -rf01ed9a0279a52c96a7272273ef19e57f7670f4a -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/TFileFilter.cpp (.../TFileFilter.cpp) (revision f01ed9a0279a52c96a7272273ef19e57f7670f4a) +++ src/libchengine/TFileFilter.cpp (.../TFileFilter.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -518,9 +518,9 @@ void TFileFilter::Store(const ISerializerContainerPtr& spContainer) const { - bool bAdded = m_setModifications[FileFilterEnum::eMod_Added]; if (m_setModifications.any()) { + bool bAdded = m_setModifications[FileFilterEnum::eMod_Added]; ISerializerRowData& rRow = spContainer->GetRow(m_oidObjectID, bAdded); if (bAdded || m_setModifications[FileFilterEnum::eMod_UseMask]) @@ -587,6 +587,7 @@ time_t tValue = 0; TString strMask; + spRowReader->GetValue(_T("id"), m_oidObjectID); spRowReader->GetValue(_T("use_mask"), m_bUseMask.Modify()); spRowReader->GetValue(_T("mask"), strMask); SetCombinedMask(strMask); Index: src/libchengine/TFileFilter.h =================================================================== diff -u -rf01ed9a0279a52c96a7272273ef19e57f7670f4a -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/TFileFilter.h (.../TFileFilter.h) (revision f01ed9a0279a52c96a7272273ef19e57f7670f4a) +++ src/libchengine/TFileFilter.h (.../TFileFilter.h) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -72,7 +72,7 @@ #pragma warning(push) #pragma warning(disable: 4251) - class LIBCHENGINE_API TFileFilter : public serializer::SerializableObject + class LIBCHENGINE_API TFileFilter : public serializer::SerializableObject { public: enum EDateType Index: src/libchengine/TFileInfo.h =================================================================== diff -u -rb9453afbc6264bc3f3c6a7f86fadab7744e0fb16 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/TFileInfo.h (.../TFileInfo.h) (revision b9453afbc6264bc3f3c6a7f86fadab7744e0fb16) +++ src/libchengine/TFileInfo.h (.../TFileInfo.h) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -106,6 +106,8 @@ static void InitColumns(serializer::IColumnsDefinition& rColumns); void Load(const serializer::ISerializerRowReaderPtr& spRowReader, const TBasePathDataContainerPtr& spSrcContainer); + void MarkAsAdded() { m_setModifications[eMod_Added] = true; } + private: enum EModifications { Index: src/libchengine/TFileInfoArray.cpp =================================================================== diff -u -r85b07e753393f661f7d8f528e4238ebb6e9e1204 -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libchengine/TFileInfoArray.cpp (.../TFileInfoArray.cpp) (revision 85b07e753393f661f7d8f528e4238ebb6e9e1204) +++ src/libchengine/TFileInfoArray.cpp (.../TFileInfoArray.cpp) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -47,6 +47,7 @@ { boost::unique_lock lock(m_lock); spFileInfo->SetObjectID(++m_oidLastObjectID); + spFileInfo->MarkAsAdded(); m_vFiles.push_back(spFileInfo); } Index: src/libserializer/SerializableContainer.h =================================================================== diff -u -rf01ed9a0279a52c96a7272273ef19e57f7670f4a -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libserializer/SerializableContainer.h (.../SerializableContainer.h) (revision f01ed9a0279a52c96a7272273ef19e57f7670f4a) +++ src/libserializer/SerializableContainer.h (.../SerializableContainer.h) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -59,6 +59,7 @@ m_setRemovedObjects.Clear(); m_vEntries.clear(); + m_oidLastObjectID = 0; InitColumns(spContainer); @@ -68,6 +69,7 @@ T tEntry; tEntry.Load(spRowReader); + m_oidLastObjectID = std::max(m_oidLastObjectID, tEntry.GetObjectID()); m_vEntries.push_back(tEntry); } @@ -87,6 +89,7 @@ { auto iterResult = m_vEntries.insert(m_vEntries.end(), rEntry); iterResult->SetObjectID(++m_oidLastObjectID); + iterResult->MarkAsAdded(); } bool SetAt(size_t stIndex, const T& rNewEntry) @@ -111,6 +114,7 @@ { auto iterResult = m_vEntries.insert(m_vEntries.begin() + stIndex, rNewEntry); iterResult->SetObjectID(++m_oidLastObjectID); + iterResult->MarkAsAdded(); return true; } Index: src/libserializer/SerializableObject.h =================================================================== diff -u -rf01ed9a0279a52c96a7272273ef19e57f7670f4a -rf8b6de9c28b2957db0b4e71efa11df8632e41261 --- src/libserializer/SerializableObject.h (.../SerializableObject.h) (revision f01ed9a0279a52c96a7272273ef19e57f7670f4a) +++ src/libserializer/SerializableObject.h (.../SerializableObject.h) (revision f8b6de9c28b2957db0b4e71efa11df8632e41261) @@ -7,74 +7,64 @@ namespace serializer { - template + template class SerializableObject { public: - SerializableObject(); - SerializableObject(const SerializableObject& rSrc); - virtual ~SerializableObject(); + SerializableObject() = default; - SerializableObject& operator=(const SerializableObject& rSrc); + SerializableObject(const SerializableObject& rSrc) : + m_oidObjectID(rSrc.m_oidObjectID), + m_setModifications(rSrc.m_setModifications) + { + } - // serialization interface - virtual void Store(const serializer::ISerializerContainerPtr& spContainer) const = 0; - virtual void Load(const serializer::ISerializerRowReaderPtr& spRowReader) = 0; + virtual ~SerializableObject() = default; - serializer::object_id_t GetObjectID() const; - void SetObjectID(serializer::object_id_t oidObjectID); + SerializableObject& operator=(const SerializableObject& rSrc) + { + if(this != &rSrc) + { + m_oidObjectID = rSrc.m_oidObjectID; + m_setModifications = rSrc.m_setModifications; + } - void ResetModifications(); - bool IsModified() const { return m_setModifications.any(); } + return *this; + } - protected: - serializer::object_id_t m_oidObjectID = 0; + serializer::object_id_t GetObjectID() const + { + return m_oidObjectID; + } - using Bitset = std::bitset; - mutable Bitset m_setModifications; - }; + void SetObjectID(serializer::object_id_t oidObjectID) + { + m_oidObjectID = oidObjectID; + } - template - serializer::SerializableObject::SerializableObject() - { - } + void MarkAsAdded() + { + m_setModifications[AddedBit] = true; + } - template - serializer::SerializableObject::SerializableObject(const SerializableObject& rSrc) : - m_oidObjectID(rSrc.m_oidObjectID), - m_setModifications(rSrc.m_setModifications) - { - } + void ResetModifications() + { + m_setModifications.reset(); + } - template - serializer::SerializableObject::~SerializableObject() - { - } + bool IsModified() const + { + return m_setModifications.any(); + } - template - SerializableObject& serializer::SerializableObject::operator=(const SerializableObject& rSrc) - { - m_oidObjectID = rSrc.m_oidObjectID; - m_setModifications = rSrc.m_setModifications; + // serialization interface + virtual void Store(const serializer::ISerializerContainerPtr& spContainer) const = 0; + virtual void Load(const serializer::ISerializerRowReaderPtr& spRowReader) = 0; - return *this; - } + protected: + serializer::object_id_t m_oidObjectID = 0; - template - void serializer::SerializableObject::ResetModifications() - { - m_setModifications.reset(); - } - - template - void serializer::SerializableObject::SetObjectID(serializer::object_id_t oidObjectID) - { - m_oidObjectID = oidObjectID; - } - - template - serializer::object_id_t serializer::SerializableObject::GetObjectID() const - { - return m_oidObjectID; - } + using Bitset = std::bitset; + mutable Bitset m_setModifications; + }; }