Changeset 244 in flair-src for trunk/tools/FlairGCS/src/XmlWidget.cpp


Ignore:
Timestamp:
05/24/18 11:45:33 (6 years ago)
Author:
Sanahuja Guillaume
Message:

modifs segfault when closing connection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/FlairGCS/src/XmlWidget.cpp

    r68 r244  
    7373
    7474XmlWidget *XmlWidget::GetXmlWidget(QString name, QString type) {
    75   // printf("recherche %s
     75  // fprintf(stderr,"recherche %s
    7676  // %s\n",name.toLocal8Bit().constData(),type.toLocal8Bit().constData());
    7777
    7878  for (int i = 0; i < childs->count(); i++) {
    79     // printf("child name
     79    // fprintf(stderr,"child name
    8080    // %s\n",childs->at(i)->write_elem.attribute("name").toLocal8Bit().constData());
    81     // printf("child tag
     81    // fprintf(stderr,"child tag
    8282    // %s\n",childs->at(i)->write_elem.tagName().toLocal8Bit().constData());
    8383    if (childs->at(i)->write_elem.attribute("name") == name &&
     
    9696  QString name = to_parse.attribute("name");
    9797
    98   // printf("parse %s
     98  // fprintf(stderr,"parse %s
    9999  // %s\n",type.toLocal8Bit().constData(),name.toLocal8Bit().constData());
    100100  XmlWidget *match;
     
    102102
    103103  if (match == NULL) {
    104     // printf("not match\n");
     104    // fprintf(stderr,"not match\n");
    105105    XmlEvent(to_parse);
    106106  } else {
    107     // printf("match\n");
     107    // fprintf(stderr,"match\n");
    108108    // si on a une balise IsEnabled, on ne traite que ca
    109109    if (match->visible_widget != NULL) {
     
    120120    // si on a une balise delete, on ne traite que ca
    121121    if (to_parse.attribute("Delete") == "1") {
    122       // printf("delete flag\n");
     122      // fprintf(stderr,"delete flag\n");
    123123      if (match->isContainer == true && match->childs->count() != 0) {
    124         // printf("non vide
     124        // fprintf(stderr,"non vide
    125125        // %s\n",match->objectName().toLocal8Bit().constData());
    126126        return;
     
    134134        match->isExpandable == false) {
    135135      QString new_name;
    136       printf("possible doublon\n");
     136      fprintf(stderr,"possible doublon\n");
    137137      for (int i = 0; i < 65535; i++) {
    138138        new_name = QString("%1_%2").arg(name).arg(i);
     
    147147          break;
    148148      }
    149       printf("new_name %s\n", new_name.toLocal8Bit().constData());
     149      fprintf(stderr,"new_name %s\n", new_name.toLocal8Bit().constData());
    150150      to_parse.setAttribute("name", new_name);
    151151      to_parse.setAttribute("old_name", name);
     
    177177    QString type = elem.tagName();
    178178    QString name = elem.attribute("name");
    179     // printf("%s
     179    // fprintf(stderr,"%s
    180180    // %s\n",type.toLocal8Bit().constData(),name.toLocal8Bit().constData());
    181181    XmlWidget *match;
     
    183183
    184184    if (match != NULL) {
    185       // printf("match\n");
     185      // fprintf(stderr,"match\n");
    186186      match->LoadXml(elem);
    187187    }
     
    296296  QDomNamedNodeMap attributes=write_elem.attributes();
    297297  while(attributes.count()!=0) {
    298     //printf("%i %s\n",attributes.count(),attributes.item(0).toAttr().name().toLocal8Bit().constData());
     298    //fprintf(stderr,"%i %s\n",attributes.count(),attributes.item(0).toAttr().name().toLocal8Bit().constData());
    299299    write_elem.removeAttribute(attributes.item(0).toAttr().name());
    300300  }
Note: See TracChangeset for help on using the changeset viewer.