diff --git a/eeschema/class_library.h b/eeschema/class_library.h index 36bf8cf4ce..423d024f64 100644 --- a/eeschema/class_library.h +++ b/eeschema/class_library.h @@ -91,7 +91,6 @@ class CMP_LIBRARY { int type; ///< Library type indicator. wxFileName fileName; ///< Library file name. - // ZZZ why this a wxDateTime where others are time_t? wxDateTime timeStamp; ///< Library save time and date. int versionMajor; ///< Library major version number. int versionMinor; ///< Library minor version number. diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h index d5f7c2442a..2924d1bb4b 100644 --- a/pcbnew/class_module.h +++ b/pcbnew/class_module.h @@ -102,7 +102,7 @@ public: double m_Surface; // Bounding box area time_t m_Link; // Temporary logical link used in edition - long m_LastEdit_Time; + time_t m_LastEdit_Time; wxString m_Path; wxString m_Doc; // Module Description (info for users) @@ -223,8 +223,9 @@ public: m_ModuleStatus &= ~MODULE_is_PLACED; } - void SetLastEditTime( long aTime ) { m_LastEdit_Time = aTime; } - long GetLastEditTime() const { return m_LastEdit_Time; } + void SetLastEditTime( time_t aTime ) { m_LastEdit_Time = aTime; } + void SetLastEditTime( ) { m_LastEdit_Time = time( NULL ); } + time_t GetLastEditTime() const { return m_LastEdit_Time; } /** * Function Read_GPCB_Descr diff --git a/pcbnew/dialogs/dialog_edit_module_text.cpp b/pcbnew/dialogs/dialog_edit_module_text.cpp index b8024d1fcd..f4f18f991f 100644 --- a/pcbnew/dialogs/dialog_edit_module_text.cpp +++ b/pcbnew/dialogs/dialog_edit_module_text.cpp @@ -215,7 +215,7 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event ) m_parent->OnModify(); if( m_module ) - m_module->m_LastEdit_Time = time( NULL ); + m_module->SetLastEditTime(); EndModal(1); } diff --git a/pcbnew/dialogs/dialog_graphic_item_properties_for_Modedit.cpp b/pcbnew/dialogs/dialog_graphic_item_properties_for_Modedit.cpp index c524f4d461..f97a9ed2e9 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties_for_Modedit.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties_for_Modedit.cpp @@ -206,7 +206,7 @@ void DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::OnOkClick( wxCommandEvent& event ) } m_parent->SaveCopyInUndoList( m_module, UR_MODEDIT ); - m_module->m_LastEdit_Time = time( NULL ); + m_module->SetLastEditTime(); wxString msg; diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 4b363399f5..c88ddea5bc 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -748,7 +748,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event ) MODULE* module = m_CurrentPad->GetParent(); m_Parent->SaveCopyInUndoList( module, UR_CHANGED ); - module->m_LastEdit_Time = time( NULL ); + module->SetLastEditTime(); // redraw the area where the pad was, without pad (delete pad on screen) m_CurrentPad->SetFlags( DO_NOT_DRAW ); diff --git a/pcbnew/edgemod.cpp b/pcbnew/edgemod.cpp index 7757094c5b..e27a2b569e 100644 --- a/pcbnew/edgemod.cpp +++ b/pcbnew/edgemod.cpp @@ -184,7 +184,7 @@ void FOOTPRINT_EDIT_FRAME::Edit_Edge_Width( EDGE_MODULE* aEdge ) OnModify(); module->CalculateBoundingBox(); - module->m_LastEdit_Time = time( NULL ); + module->SetLastEditTime(); } @@ -232,7 +232,7 @@ void FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer( EDGE_MODULE* aEdge ) OnModify(); module->CalculateBoundingBox(); - module->m_LastEdit_Time = time( NULL ); + module->SetLastEditTime(); } @@ -274,7 +274,7 @@ void FOOTPRINT_EDIT_FRAME::Delete_Edge_Module( EDGE_MODULE* aEdge ) // Delete segment. aEdge->DeleteStructure(); - module->m_LastEdit_Time = time( NULL ); + module->SetLastEditTime(); module->CalculateBoundingBox(); OnModify(); } @@ -399,7 +399,7 @@ EDGE_MODULE* FOOTPRINT_EDIT_FRAME::Begin_Edge_Module( EDGE_MODULE* aEdge, aEdge->SetEnd0( aEdge->GetStart0() ); module->CalculateBoundingBox(); - module->m_LastEdit_Time = time( NULL ); + module->SetLastEditTime(); OnModify(); } } @@ -427,7 +427,7 @@ void FOOTPRINT_EDIT_FRAME::End_Edge_Module( EDGE_MODULE* aEdge ) } module->CalculateBoundingBox(); - module->m_LastEdit_Time = time( NULL ); + module->SetLastEditTime(); OnModify(); m_canvas->SetMouseCapture( NULL, NULL ); } diff --git a/pcbnew/edtxtmod.cpp b/pcbnew/edtxtmod.cpp index 836dd677f9..1522fd37ce 100644 --- a/pcbnew/edtxtmod.cpp +++ b/pcbnew/edtxtmod.cpp @@ -124,7 +124,7 @@ void PCB_BASE_FRAME::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ) Text->DisplayInfo( this ); if( module ) - module->m_LastEdit_Time = time( NULL ); + module->SetLastEditTime(); OnModify(); } @@ -147,7 +147,7 @@ void PCB_BASE_FRAME::DeleteTextModule( TEXTE_MODULE* Text ) m_canvas->RefreshDrawingRect( Text->GetBoundingBox() ); Text->DeleteStructure(); OnModify(); - Module->m_LastEdit_Time = time( NULL ); + Module->SetLastEditTime(); } } @@ -253,7 +253,7 @@ void PCB_BASE_FRAME::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC ) Text->SetPos0( textRelPos ); Text->ClearFlags(); Module->ClearFlags(); - Module->m_LastEdit_Time = time( NULL ); + Module->SetLastEditTime(); OnModify(); /* Redraw text. */ diff --git a/pcbnew/librairi.cpp b/pcbnew/librairi.cpp index 38e4f04358..8631d4708a 100644 --- a/pcbnew/librairi.cpp +++ b/pcbnew/librairi.cpp @@ -477,7 +477,7 @@ MODULE* PCB_BASE_FRAME::Create_1_Module( const wxString& aModuleName ) // Update parameters: position, timestamp ... newpos = GetScreen()->GetCrossHairPosition(); Module->SetPosition( newpos ); - Module->m_LastEdit_Time = time( NULL ); + Module->SetLastEditTime(); // Update its name in lib Module->m_LibRef = moduleName; diff --git a/pcbnew/move-drag_pads.cpp b/pcbnew/move-drag_pads.cpp index 0663bca443..fed12ab11e 100644 --- a/pcbnew/move-drag_pads.cpp +++ b/pcbnew/move-drag_pads.cpp @@ -187,7 +187,7 @@ void PCB_BASE_FRAME::Import_Pad_Settings( D_PAD* aPad, bool aDraw ) if( aDraw ) m_canvas->RefreshDrawingRect( aPad->GetBoundingBox() ); - aPad->GetParent()->m_LastEdit_Time = time( NULL ); + aPad->GetParent()->SetLastEditTime(); } @@ -199,7 +199,7 @@ void PCB_BASE_FRAME::AddPad( MODULE* aModule, bool draw ) wxString lastPadName = GetDesignSettings().m_Pad_Master.GetPadName(); m_Pcb->m_Status_Pcb = 0; - aModule->m_LastEdit_Time = time( NULL ); + aModule->SetLastEditTime(); D_PAD* pad = new D_PAD( aModule ); @@ -260,7 +260,7 @@ void PCB_BASE_FRAME::DeletePad( D_PAD* aPad, bool aQuery ) return; module = (MODULE*) aPad->GetParent(); - module->m_LastEdit_Time = time( NULL ); + module->SetLastEditTime(); if( aQuery ) { @@ -389,7 +389,7 @@ void PCB_BASE_FRAME::PlacePad( D_PAD* aPad, wxDC* DC ) aPad->Draw( m_canvas, DC, GR_OR ); module->CalculateBoundingBox(); - module->m_LastEdit_Time = time( NULL ); + module->SetLastEditTime(); EraseDragList(); @@ -407,7 +407,7 @@ void PCB_BASE_FRAME::RotatePad( D_PAD* aPad, wxDC* DC ) MODULE* module = aPad->GetParent(); - module->m_LastEdit_Time = time( NULL ); + module->SetLastEditTime(); OnModify();