Examples of QByteArray


Examples of com.trolltech.qt.core.QByteArray

    public static QByteArray restoreState(String name) {
      int view = Global.getListView();
      if (view == Global.View_List_Narrow)
        name = name +"Narrow";
    settings.beginGroup("SaveState");
    QByteArray state = (QByteArray)settings.value(name);
    settings.endGroup();
    return state;
    }
View Full Code Here

Examples of com.trolltech.qt.core.QByteArray

      int view = Global.getListView();
      if (view == Global.View_List_Narrow)
        settings.beginGroup("SaveGeometryNarrow");
      else
        settings.beginGroup("SaveGeometry");
    QByteArray state = (QByteArray)settings.value(name);
    settings.endGroup();
    return state;
    }
View Full Code Here

Examples of com.trolltech.qt.core.QByteArray

 
  private void writeDataNode(String name, Data data) {
    writer.writeStartElement(name);
    createTextNode("Size", new Integer(data.getSize()).toString());
    if (data.getBody() != null && data.getBody().length > 0)
      createBinaryNode("Body", new QByteArray(data.getBody()).toHex().toString());
    else
      createBinaryNode("Body", "");
    if (data.getBodyHash() != null && data.getBodyHash().length > 0)
      createTextNode("BodyHash", new QByteArray(data.getBodyHash()).toHex().toString());
    else
      createTextNode("BodyHash", "");
    writer.writeEndElement();   
  }
View Full Code Here

Examples of com.trolltech.qt.core.QByteArray

  private void writeRecognitionNode(String name, Data data) {
    writer.writeStartElement(name);
    createTextNode("Size", new Integer(data.getSize()).toString());
    if (data.getBody() != null && data.getBody().length > 0) {
      writer.writeStartElement("Body");
      writer.writeCDATA(new QByteArray(data.getBody()).toString());
//      writer.writeCDATA(new QByteArray(data.getBody()).toHex().toString());
      writer.writeEndElement();
    else
      createBinaryNode("Body", "");
   
    if (data.getBodyHash() != null && data.getBodyHash().length > 0)
      createTextNode("BodyHash", new QByteArray(data.getBodyHash()).toHex().toString());
    else
      createTextNode("BodyHash", "");
    writer.writeEndElement();   
  }
View Full Code Here

Examples of com.trolltech.qt.core.QByteArray

          if (p.isAscending())
            createTextNode("PublishingAscending", "true");
          else
            createTextNode("PublishingAscending", "false");
        }
        QByteArray b = conn.getNotebookTable().getIconAsByteArray(notebooks.get(i).getGuid());
        if (b != null)
          createBinaryNode("Icon", b.toHex().toString());
        if (notebooks.get(i).getStack() != null && !notebooks.get(i).getStack().trim().equals(""))
          createTextNode("Stack", notebooks.get(i).getStack());
        writer.writeEndElement()
      }
    }
View Full Code Here

Examples of com.trolltech.qt.core.QByteArray

    Resource r = conn.getNoteTable().noteResourceTable.getNoteResourceRecognition(guid);
    if (!indexImageRecognition ||
        r == null || r.getRecognition() == null ||
        r.getRecognition().getBody() == null ||
        r.getRecognition().getBody().length == 0)
      resourceBinary = new QByteArray(" ");
    else
      resourceBinary = new QByteArray(r.getRecognition().getBody());
   
    conn.commitTransaction();
    conn.beginTransaction();
    conn.getWordsTable().expungeFromWordIndex(r.getNoteGuid(), "RESOURCE");
    // This is due to an old bug & can be removed at some point in the future 11/23/2010
View Full Code Here

Examples of com.trolltech.qt.core.QByteArray

    while(!atEnd) {
      if (reader.isStartElement()) {
        try {
        byte[] b = textValue().getBytes();   // data binary
        if (b.length > 0) {
          QByteArray hexData = new QByteArray(b);
          String hexString = hexData.toString();
          data.setBody(DatatypeConverter.parseBase64Binary(hexString));
          MessageDigest md;
          try {
            md = MessageDigest.getInstance("MD5");
            md.update(data.getBody());
View Full Code Here

Examples of com.trolltech.qt.core.QByteArray

    tidy.setXmlTags(true);
    tidy.setXHTML(true);
   
    QTextCodec codec;
    codec = QTextCodec.codecForName("UTF-8");
        QByteArray unicode =  codec.fromUnicode(newContent);
       
//    byte html[] = newContent.getBytes();
//    ByteArrayInputStream is = new ByteArrayInputStream(html);
        logger.log(logger.HIGH, "Starting JTidy check");
        logger.log(logger.EXTREME, "Start of JTidy Input");
        logger.log(logger.EXTREME, newContent);
        logger.log(logger.EXTREME, "End Of JTidy Input");
    ByteArrayInputStream is = new ByteArrayInputStream(unicode.toByteArray());
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        tidy.setInputEncoding("UTF-8");
    tidy.parse(is, os);
    String tidyContent = os.toString();
    if (tidyListener.errorFound) {
View Full Code Here

Examples of com.trolltech.qt.core.QByteArray

      tidy.getStderr().close()// the listener will capture messages
      tidy.setXmlTags(true);
     
      QTextCodec codec;
      codec = QTextCodec.codecForName("UTF-8");
          QByteArray unicode =  codec.fromUnicode(currentNote.getContent());
         
          logger.log(logger.MEDIUM, "Starting JTidy check");
          logger.log(logger.MEDIUM, "Start of JTidy Input");
          logger.log(logger.MEDIUM, currentNote.getContent());
          logger.log(logger.MEDIUM, "End Of JTidy Input");
      ByteArrayInputStream is = new ByteArrayInputStream(unicode.toByteArray());
          ByteArrayOutputStream os = new ByteArrayOutputStream();
          tidy.setInputEncoding("UTF-8");
      tidy.parse(is, os);
      String tidyContent = os.toString();
      if (tidyListener.errorFound) {
View Full Code Here

Examples of com.trolltech.qt.core.QByteArray

   
    // Get the recognition XML that tells where to hilight on the image
    Resource recoResource = conn.getNoteTable().noteResourceTable.getNoteResourceRecognition(resGuid);
    if (recoResource.getRecognition().getBody() == null || recoResource.getRecognition().getBody().length == 0)
      return;
    QByteArray recoData = new QByteArray(recoResource.getRecognition().getBody());
    String xml = recoData.toString();
   
    // Get a painter for the image.  This is the background (the initial image).
      QPixmap pix = new QPixmap(f.fileName());
      QPixmap hilightedPix = new QPixmap(pix.size());
      QPainter p = new QPainter(hilightedPix);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.