Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/gui.git] / src / RegistryDisplay / RegWidget.cxx
index 0425cc268980f0abede1b4d12a01dbca6393d64b..5dadc9d9df54adedefc6f99516873ad95bba6e6b 100755 (executable)
@@ -353,8 +353,10 @@ QString RegWidget::setlongText( const Registry::Infos &c_info)
   a.append( QString( " )<br> " ) + tr( "in directory" ) + QString( " " ));
   a.append( BOLD( c_info.cdir ) );
   
+  time_t aTime;
   a.append( QString( "<br>" ) + tr( "begins" ) + QString( " " ) );
-  char * t1 = (char * )duplicate(ctime(&c_info.tc_start));
+  aTime = time_t(c_info.tc_start);
+  char * t1 = (char * )duplicate(ctime(&aTime));
   t1 [strlen(t1) -1 ] = ' ';
   a.append( BOLD( t1 ) ); 
   delete [] t1;
@@ -362,7 +364,8 @@ QString RegWidget::setlongText( const Registry::Infos &c_info)
   
   if (c_info.tc_hello != 0 )
     {
-      char * t2 = (char * )duplicate(ctime(&c_info.tc_hello));
+      aTime = time_t(c_info.tc_hello);
+      char * t2 = (char * )duplicate(ctime(&aTime));
       t2 [strlen(t2) -1 ] = ' ';
       a.append( tr( "last signal" ) + QString(" : ") ); 
       a.append( BOLD( t2 ) ); 
@@ -371,7 +374,8 @@ QString RegWidget::setlongText( const Registry::Infos &c_info)
     }
   if ((c_info.tc_end - c_info.difftime) != 0)
     {
-      char * t3 = (char * )duplicate(ctime(&c_info.tc_end));
+      aTime = time_t(c_info.tc_end);
+      char * t3 = (char * )duplicate(ctime(&aTime));
       t3 [strlen(t3) -1 ] = ' ';
       a.append( tr( "ends" ) + QString( " " ) ); 
       a.append( BOLD( t3 ) ); 
@@ -459,6 +463,7 @@ void RegWidget::InfoHistory()
     _history->clear();
   try
     {
+      time_t aTime;
       _serverhistory = _VarComponents->history();
       for (CORBA::ULong i=0; i<_serverhistory->length(); i++)
        {       
@@ -466,9 +471,11 @@ void RegWidget::InfoHistory()
          ASSERT( c_info.name!=NULL);
          QString a;
          a.setNum(int(c_info.pid));
-         char * t1 = (char * )duplicate(ctime(&c_info.tc_start));
+         aTime = time_t(c_info.tc_start);
+         char * t1 = (char * )duplicate(ctime(&aTime));
          t1 [strlen(t1) -1 ] = ' ';
-         char * t2 = (char * )duplicate(ctime(&c_info.tc_end));
+         aTime = time_t(c_info.tc_end);
+         char * t2 = (char * )duplicate(ctime(&aTime));
          t2 [strlen(t2) -1 ] = ' ';
          QListViewItem * item = new QListViewItem(_history, QString(c_info.name),\
                                                   a, QString(c_info.pwname), QString(c_info.machine), \
@@ -499,6 +506,7 @@ void RegWidget::InfoReg()
   _clients->clear();
   try
     {
+      time_t aTime;
       _serverclients = _VarComponents->getall();
       for (CORBA::ULong i=0; i<_serverclients->length(); i++)
        {       
@@ -506,9 +514,11 @@ void RegWidget::InfoReg()
          ASSERT( c_info.name!=NULL);
          QString a;
          a.setNum(int(c_info.pid));
-         char * t1 = (char * )duplicate(ctime(&c_info.tc_start));
+         aTime = time_t(c_info.tc_start);
+         char * t1 = (char * )duplicate(ctime(&aTime));
          t1 [strlen(t1) -1 ] = ' ';
-         char * t2 = (char * )duplicate(ctime(&c_info.tc_hello));
+         aTime = time_t(c_info.tc_hello);
+         char * t2 = (char * )duplicate(ctime(&aTime));
          t2 [strlen(t2) -1 ] = ' ';
          QListViewItem * item = new QListViewItem(_clients, QString(c_info.name),\
                                                   a, QString(c_info.pwname), QString(c_info.machine), \
@@ -563,6 +573,9 @@ void RegWidget::slotSelectRefresh()
   END_OF("slotSelectRefresh");
 }
 
+/*!
+  SLOT: called when button OK is clicked in interval window
+*/
 void RegWidget::slotIntervalOk()
 {
   BEGIN_OF("slotIntervalOk");