Commit 7d154606 authored by Lorenzo Marcantonio's avatar Lorenzo Marcantonio

Substituted the few remaining uses of long instead of time_t

parent 61c3339d
...@@ -91,7 +91,6 @@ class CMP_LIBRARY ...@@ -91,7 +91,6 @@ class CMP_LIBRARY
{ {
int type; ///< Library type indicator. int type; ///< Library type indicator.
wxFileName fileName; ///< Library file name. wxFileName fileName; ///< Library file name.
// ZZZ why this a wxDateTime where others are time_t?
wxDateTime timeStamp; ///< Library save time and date. wxDateTime timeStamp; ///< Library save time and date.
int versionMajor; ///< Library major version number. int versionMajor; ///< Library major version number.
int versionMinor; ///< Library minor version number. int versionMinor; ///< Library minor version number.
......
...@@ -102,7 +102,7 @@ public: ...@@ -102,7 +102,7 @@ public:
double m_Surface; // Bounding box area double m_Surface; // Bounding box area
time_t m_Link; // Temporary logical link used in edition time_t m_Link; // Temporary logical link used in edition
long m_LastEdit_Time; time_t m_LastEdit_Time;
wxString m_Path; wxString m_Path;
wxString m_Doc; // Module Description (info for users) wxString m_Doc; // Module Description (info for users)
...@@ -223,8 +223,9 @@ public: ...@@ -223,8 +223,9 @@ public:
m_ModuleStatus &= ~MODULE_is_PLACED; m_ModuleStatus &= ~MODULE_is_PLACED;
} }
void SetLastEditTime( long aTime ) { m_LastEdit_Time = aTime; } void SetLastEditTime( time_t aTime ) { m_LastEdit_Time = aTime; }
long GetLastEditTime() const { return m_LastEdit_Time; } void SetLastEditTime( ) { m_LastEdit_Time = time( NULL ); }
time_t GetLastEditTime() const { return m_LastEdit_Time; }
/** /**
* Function Read_GPCB_Descr * Function Read_GPCB_Descr
......
...@@ -215,7 +215,7 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event ) ...@@ -215,7 +215,7 @@ void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
m_parent->OnModify(); m_parent->OnModify();
if( m_module ) if( m_module )
m_module->m_LastEdit_Time = time( NULL ); m_module->SetLastEditTime();
EndModal(1); EndModal(1);
} }
...@@ -206,7 +206,7 @@ void DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::OnOkClick( wxCommandEvent& event ) ...@@ -206,7 +206,7 @@ void DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::OnOkClick( wxCommandEvent& event )
} }
m_parent->SaveCopyInUndoList( m_module, UR_MODEDIT ); m_parent->SaveCopyInUndoList( m_module, UR_MODEDIT );
m_module->m_LastEdit_Time = time( NULL ); m_module->SetLastEditTime();
wxString msg; wxString msg;
......
...@@ -748,7 +748,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event ) ...@@ -748,7 +748,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
MODULE* module = m_CurrentPad->GetParent(); MODULE* module = m_CurrentPad->GetParent();
m_Parent->SaveCopyInUndoList( module, UR_CHANGED ); 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) // redraw the area where the pad was, without pad (delete pad on screen)
m_CurrentPad->SetFlags( DO_NOT_DRAW ); m_CurrentPad->SetFlags( DO_NOT_DRAW );
......
...@@ -184,7 +184,7 @@ void FOOTPRINT_EDIT_FRAME::Edit_Edge_Width( EDGE_MODULE* aEdge ) ...@@ -184,7 +184,7 @@ void FOOTPRINT_EDIT_FRAME::Edit_Edge_Width( EDGE_MODULE* aEdge )
OnModify(); OnModify();
module->CalculateBoundingBox(); module->CalculateBoundingBox();
module->m_LastEdit_Time = time( NULL ); module->SetLastEditTime();
} }
...@@ -232,7 +232,7 @@ void FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer( EDGE_MODULE* aEdge ) ...@@ -232,7 +232,7 @@ void FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer( EDGE_MODULE* aEdge )
OnModify(); OnModify();
module->CalculateBoundingBox(); module->CalculateBoundingBox();
module->m_LastEdit_Time = time( NULL ); module->SetLastEditTime();
} }
...@@ -274,7 +274,7 @@ void FOOTPRINT_EDIT_FRAME::Delete_Edge_Module( EDGE_MODULE* aEdge ) ...@@ -274,7 +274,7 @@ void FOOTPRINT_EDIT_FRAME::Delete_Edge_Module( EDGE_MODULE* aEdge )
// Delete segment. // Delete segment.
aEdge->DeleteStructure(); aEdge->DeleteStructure();
module->m_LastEdit_Time = time( NULL ); module->SetLastEditTime();
module->CalculateBoundingBox(); module->CalculateBoundingBox();
OnModify(); OnModify();
} }
...@@ -399,7 +399,7 @@ EDGE_MODULE* FOOTPRINT_EDIT_FRAME::Begin_Edge_Module( EDGE_MODULE* aEdge, ...@@ -399,7 +399,7 @@ EDGE_MODULE* FOOTPRINT_EDIT_FRAME::Begin_Edge_Module( EDGE_MODULE* aEdge,
aEdge->SetEnd0( aEdge->GetStart0() ); aEdge->SetEnd0( aEdge->GetStart0() );
module->CalculateBoundingBox(); module->CalculateBoundingBox();
module->m_LastEdit_Time = time( NULL ); module->SetLastEditTime();
OnModify(); OnModify();
} }
} }
...@@ -427,7 +427,7 @@ void FOOTPRINT_EDIT_FRAME::End_Edge_Module( EDGE_MODULE* aEdge ) ...@@ -427,7 +427,7 @@ void FOOTPRINT_EDIT_FRAME::End_Edge_Module( EDGE_MODULE* aEdge )
} }
module->CalculateBoundingBox(); module->CalculateBoundingBox();
module->m_LastEdit_Time = time( NULL ); module->SetLastEditTime();
OnModify(); OnModify();
m_canvas->SetMouseCapture( NULL, NULL ); m_canvas->SetMouseCapture( NULL, NULL );
} }
...@@ -124,7 +124,7 @@ void PCB_BASE_FRAME::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ) ...@@ -124,7 +124,7 @@ void PCB_BASE_FRAME::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC )
Text->DisplayInfo( this ); Text->DisplayInfo( this );
if( module ) if( module )
module->m_LastEdit_Time = time( NULL ); module->SetLastEditTime();
OnModify(); OnModify();
} }
...@@ -147,7 +147,7 @@ void PCB_BASE_FRAME::DeleteTextModule( TEXTE_MODULE* Text ) ...@@ -147,7 +147,7 @@ void PCB_BASE_FRAME::DeleteTextModule( TEXTE_MODULE* Text )
m_canvas->RefreshDrawingRect( Text->GetBoundingBox() ); m_canvas->RefreshDrawingRect( Text->GetBoundingBox() );
Text->DeleteStructure(); Text->DeleteStructure();
OnModify(); OnModify();
Module->m_LastEdit_Time = time( NULL ); Module->SetLastEditTime();
} }
} }
...@@ -253,7 +253,7 @@ void PCB_BASE_FRAME::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC ) ...@@ -253,7 +253,7 @@ void PCB_BASE_FRAME::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC )
Text->SetPos0( textRelPos ); Text->SetPos0( textRelPos );
Text->ClearFlags(); Text->ClearFlags();
Module->ClearFlags(); Module->ClearFlags();
Module->m_LastEdit_Time = time( NULL ); Module->SetLastEditTime();
OnModify(); OnModify();
/* Redraw text. */ /* Redraw text. */
......
...@@ -477,7 +477,7 @@ MODULE* PCB_BASE_FRAME::Create_1_Module( const wxString& aModuleName ) ...@@ -477,7 +477,7 @@ MODULE* PCB_BASE_FRAME::Create_1_Module( const wxString& aModuleName )
// Update parameters: position, timestamp ... // Update parameters: position, timestamp ...
newpos = GetScreen()->GetCrossHairPosition(); newpos = GetScreen()->GetCrossHairPosition();
Module->SetPosition( newpos ); Module->SetPosition( newpos );
Module->m_LastEdit_Time = time( NULL ); Module->SetLastEditTime();
// Update its name in lib // Update its name in lib
Module->m_LibRef = moduleName; Module->m_LibRef = moduleName;
......
...@@ -187,7 +187,7 @@ void PCB_BASE_FRAME::Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -187,7 +187,7 @@ void PCB_BASE_FRAME::Import_Pad_Settings( D_PAD* aPad, bool aDraw )
if( aDraw ) if( aDraw )
m_canvas->RefreshDrawingRect( aPad->GetBoundingBox() ); 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 ) ...@@ -199,7 +199,7 @@ void PCB_BASE_FRAME::AddPad( MODULE* aModule, bool draw )
wxString lastPadName = GetDesignSettings().m_Pad_Master.GetPadName(); wxString lastPadName = GetDesignSettings().m_Pad_Master.GetPadName();
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
aModule->m_LastEdit_Time = time( NULL ); aModule->SetLastEditTime();
D_PAD* pad = new D_PAD( aModule ); D_PAD* pad = new D_PAD( aModule );
...@@ -260,7 +260,7 @@ void PCB_BASE_FRAME::DeletePad( D_PAD* aPad, bool aQuery ) ...@@ -260,7 +260,7 @@ void PCB_BASE_FRAME::DeletePad( D_PAD* aPad, bool aQuery )
return; return;
module = (MODULE*) aPad->GetParent(); module = (MODULE*) aPad->GetParent();
module->m_LastEdit_Time = time( NULL ); module->SetLastEditTime();
if( aQuery ) if( aQuery )
{ {
...@@ -389,7 +389,7 @@ void PCB_BASE_FRAME::PlacePad( D_PAD* aPad, wxDC* DC ) ...@@ -389,7 +389,7 @@ void PCB_BASE_FRAME::PlacePad( D_PAD* aPad, wxDC* DC )
aPad->Draw( m_canvas, DC, GR_OR ); aPad->Draw( m_canvas, DC, GR_OR );
module->CalculateBoundingBox(); module->CalculateBoundingBox();
module->m_LastEdit_Time = time( NULL ); module->SetLastEditTime();
EraseDragList(); EraseDragList();
...@@ -407,7 +407,7 @@ void PCB_BASE_FRAME::RotatePad( D_PAD* aPad, wxDC* DC ) ...@@ -407,7 +407,7 @@ void PCB_BASE_FRAME::RotatePad( D_PAD* aPad, wxDC* DC )
MODULE* module = aPad->GetParent(); MODULE* module = aPad->GetParent();
module->m_LastEdit_Time = time( NULL ); module->SetLastEditTime();
OnModify(); OnModify();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment