@@ -24,7 +24,7 @@ use serialport::FlowControl;
2424
2525use crate :: constants:: {
2626 APPLICATION_NAME , APPLICATION_ORGANIZATION , APPLICATION_QUALIFIER , CONNECTION_HISTORY_FILENAME ,
27- DEFAULT_LOG_DIRECTORY , MAX_CONNECTION_HISTORY , MPS ,
27+ DEFAULT_IP_ADDRESS , DEFAULT_LOG_DIRECTORY , DEFAULT_PORT , MAX_CONNECTION_HISTORY , MPS ,
2828} ;
2929use crate :: errors:: CONVERT_TO_STR_FAILURE ;
3030use crate :: log_panel:: LogLevel ;
@@ -758,8 +758,13 @@ impl ConnectionHistory {
758758 if let Ok ( default_path) = LOG_DIRECTORY . path ( ) . into_os_string ( ) . into_string ( ) {
759759 folders. insert ( default_path) ;
760760 }
761+ let mut addresses = IndexSet :: new ( ) ;
762+ addresses. insert ( Address {
763+ host : DEFAULT_IP_ADDRESS . to_string ( ) ,
764+ port : DEFAULT_PORT ,
765+ } ) ;
761766 ConnectionHistory {
762- addresses : IndexSet :: new ( ) ,
767+ addresses,
763768 files : IndexSet :: new ( ) ,
764769 folders,
765770 serial_configs : IndexMap :: new ( ) ,
@@ -961,9 +966,9 @@ mod tests {
961966 backup_file ( bfilename. clone ( ) ) ;
962967
963968 let mut conn_history = ConnectionHistory :: new ( ) ;
964- let host1 = String :: from ( "host1" ) ;
969+ let host1 = String :: from ( DEFAULT_IP_ADDRESS ) ;
965970 let host2 = String :: from ( "host2" ) ;
966- let port = 100 ;
971+ let port = DEFAULT_PORT ;
967972
968973 conn_history. record_address ( host1. clone ( ) , port) ;
969974 let addresses = conn_history. addresses ( ) ;
0 commit comments