Package com.trolltech.qt.core

Examples of com.trolltech.qt.core.QFile.open()


         
          r.setGuid(randint);
          conn.getNoteTable().noteResourceTable.saveNoteResource(r, true);
        QFile f = new QFile(Global.getFileManager().getResDirPath(newFile));
        QByteArray bin = new QByteArray(r.getData().getBody());
        f.open(QFile.OpenModeFlag.WriteOnly);
        f.write(bin);
        f.close();
        newSegment = newSegment.replace("guid=\""+guid, "guid=\""+randint);
        currentNote.getResources().add(r);
       
View Full Code Here


    errorMessage = "";
       
    lastError = 0;
    errorMessage = "";
    QFile xmlFile = new QFile(fileName);
    if (!xmlFile.open(QIODevice.OpenModeFlag.ReadOnly)) {
      lastError = 16;
      errorMessage = "Cannot open file.";
    }
     
    reader = new QXmlStreamReader(xmlFile)
View Full Code Here

  //********************************************************
  //* Import text files
  //********************************************************
  public boolean importTextFile() {
    QFile file = new QFile(fileName);
    if (!file.open(new QIODevice.OpenMode(QIODevice.OpenModeFlag.ReadOnly))) {
      // If we can't get to the file, it is probably locked.  We'll try again later.
      logger.log(logger.LOW, "Unable to save externally edited file - locked.  Saving for later.");
      return false;
    }
    QByteArray binData = file.readAll();
View Full Code Here

  //********************************************************
  //* Import an image
  //********************************************************
  public boolean importAttachment() {
    QFile file = new QFile(fileName);
    if (!file.open(new QIODevice.OpenMode(QIODevice.OpenModeFlag.ReadOnly))) {
      // If we can't get to the file, it is probably locked.  We'll try again later.
      logger.log(logger.LOW, "Unable to save externally edited file - locked.  Saving for later.");
      return false;
    }
    QByteArray binData = file.readAll();
View Full Code Here

  //**************************************************************
  //* Check the file attachment to be sure it isn't over 25 mb
  //**************************************************************
  private boolean checkFileAttachmentSize(String url) {
    QFile resourceFile = new QFile(fileName);
    resourceFile.open(new QIODevice.OpenMode(
        QIODevice.OpenModeFlag.ReadOnly));
    long size = resourceFile.size();
    resourceFile.close();
    size = size / 1024 / 1024;
    if (size < 50 && Global.isPremium())
View Full Code Here

  //* Build a new resource
  //********************************************************
  private Resource createResource(String mime, boolean attachment) {
    QFile resourceFile;
      resourceFile = new QFile(fileName);
      resourceFile.open(new QIODevice.OpenMode(QIODevice.OpenModeFlag.ReadOnly));
      byte[] fileData = resourceFile.readAll().toByteArray();
      resourceFile.close();
      if (fileData.length == 0)
        return null;
      MessageDigest md;
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.