src/hbutils/document/hbdocumentloader_p.cpp
branchGCC_SURGE
changeset 15 f378acbc9cfb
parent 7 923ff622b8b9
equal deleted inserted replaced
9:730c025d4b77 15:f378acbc9cfb
   136     }
   136     }
   137     qint64 sectionsMetaDataPos = dstDevice->pos();
   137     qint64 sectionsMetaDataPos = dstDevice->pos();
   138     QDataStream stream( dstDevice );
   138     QDataStream stream( dstDevice );
   139     stream << sectionsPositionList;
   139     stream << sectionsPositionList;
   140     stream << sectionsMetaDataPos;
   140     stream << sectionsMetaDataPos;
   141 
       
   142 
       
   143 #ifdef DEBUG_TIMES
   141 #ifdef DEBUG_TIMES
   144     debugPrintX("MYTRACE: DocML create binary, end: %d", debugTime.elapsed());
   142     debugPrintX("MYTRACE: DocML create binary, end: %d", debugTime.elapsed());
   145 #endif
   143 #endif
   146     return result;
   144     return result;
   147 }
   145 }
   153     Q_UNUSED(section);
   151     Q_UNUSED(section);
   154     return false;
   152     return false;
   155 #else
   153 #else
   156     bool result(true);
   154     bool result(true);
   157 
   155 
       
   156     const bool originalTextMode = device->isTextModeEnabled();
       
   157 
   158     if (binarysyntax->isBinary(device)) {
   158     if (binarysyntax->isBinary(device)) {
       
   159         device->setTextModeEnabled( false );    
   159         binarysyntax->setActions(actions);
   160         binarysyntax->setActions(actions);
   160 #ifdef DEBUG_TIMES
   161 #ifdef DEBUG_TIMES
   161         debugTime.restart();
   162         debugTime.restart();
   162         debugPrintX("MYTRACE: DocML load binary, start");
   163         debugPrintX("MYTRACE: DocML load binary, start");
   163 #endif
   164 #endif
   164         result = binarysyntax->load( device, section );
   165         result = binarysyntax->load( device, section );
   165 #ifdef DEBUG_TIMES
   166 #ifdef DEBUG_TIMES
   166         debugPrintX("MYTRACE: DocML load binary, end: %d", debugTime.elapsed());
   167         debugPrintX("MYTRACE: DocML load binary, end: %d", debugTime.elapsed());
   167 #endif
   168 #endif
   168     } else {
   169     } else {
       
   170         device->setTextModeEnabled( true );    
   169         syntax->setActions(actions);
   171         syntax->setActions(actions);
   170 #ifdef DEBUG_TIMES
   172 #ifdef DEBUG_TIMES
   171         debugTime.restart();
   173         debugTime.restart();
   172         debugPrintX("MYTRACE: DocML load plain text, start");
   174         debugPrintX("MYTRACE: DocML load plain text, start");
   173 #endif
   175 #endif
   174         result = syntax->load( device, section );
   176         result = syntax->load( device, section );
   175 #ifdef DEBUG_TIMES
   177 #ifdef DEBUG_TIMES
   176         debugPrintX("MYTRACE: DocML load plain text, end: %d", debugTime.elapsed());
   178         debugPrintX("MYTRACE: DocML load plain text, end: %d", debugTime.elapsed());
   177 #endif
   179 #endif
   178     }
   180     }
       
   181     device->setTextModeEnabled( originalTextMode );    
   179     return result;
   182     return result;
   180 #endif
   183 #endif
   181 }
   184 }
   182 
   185 
   183 QList<QObject *> HbDocumentLoaderPrivate::takeAll()
   186 QList<QObject *> HbDocumentLoaderPrivate::takeAll()