Package com.trolltech.qt.core

Examples of com.trolltech.qt.core.QDir


   
    // Look at the files already there so we don't import them again if a new file is created
    if (importedFiles == null) {
      importedFiles = new ArrayList<String>();
      for (int j=0; j<records.size(); j++) {
        QDir dir = new QDir(records.get(j).folder);
        List<QFileInfo> list = dir.entryInfoList();
        for (int k=0; k<list.size(); k++) {
          if (list.get(k).isFile())
            importedFiles.add(list.get(k).absoluteFilePath());
        }
      }
View Full Code Here


    if (whichOS.contains("Windows"))
      dirName = dirName.replace('/','\\');
   
    FileImporter importer = new FileImporter(logger, conn);
   
    QDir dir = new QDir(dirName);
    List<QFileInfo> list = dir.entryInfoList();
    String notebook = conn.getWatchFolderTable().getNotebook(dirName);

    for (int i=0; i<list.size(); i++){
      logger.log(logger.LOW, "File found: " +list.get(i).fileName());
      boolean redundant = false;
      // Check if we've already imported this one or if it existed before
      for (int j=0; j<importedFiles.size(); j++) {
        logger.log(logger.LOW, "redundant file list: " +list.get(i).absoluteFilePath());
        if (importedFiles.get(j).equals(list.get(i).absoluteFilePath()))
          redundant = true;
      }
     
      logger.log(logger.LOW, "Checking if redundant: " +redundant);
      if (!redundant) {
        importer.setFileInfo(list.get(i));
        importer.setFileName(list.get(i).absoluteFilePath());
     
     
        logger.log(logger.LOW, "File importing is a file: " +list.get(i).isFile());
        logger.log(logger.LOW, "File importing is a valid: " +importer.isValidType());
        if (list.get(i).isFile() && importer.isValidType()) {
     
          if (!importer.importFile()) {
            // 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.  Saving for later.");
            importFilesKeep.add(list.get(i).absoluteFilePath());
          } else {

            Note newNote = importer.getNote();
            newNote.setNotebookGuid(notebook);
            newNote.setTitle(dir.at(i));
            NoteMetadata metadata = new NoteMetadata();
            metadata.setDirty(true);
            metadata.setGuid(newNote.getGuid());
            listManager.addNote(newNote, metadata);
            conn.getNoteTable().addNote(newNote, true);
View Full Code Here

    String whichOS = System.getProperty("os.name");
    if (whichOS.contains("Windows"))
      dirName = dirName.replace('/','\\');
   
    FileImporter importer = new FileImporter(logger, conn);
    QDir dir = new QDir(dirName);
    List<QFileInfo> list = dir.entryInfoList();
    String notebook = conn.getWatchFolderTable().getNotebook(dirName);
   
    for (int i=0; i<list.size(); i++){
      logger.log(logger.LOW, "File found: " +list.get(i).fileName());
      importer.setFileInfo(list.get(i));
      importer.setFileName(list.get(i).absoluteFilePath());
     
      logger.log(logger.LOW, "File importing is a file: " +list.get(i).isFile());
      logger.log(logger.LOW, "File importing is a valid: " +importer.isValidType());
      if (list.get(i).isFile() && importer.isValidType()) {
   
        if (!importer.importFile()) {
          // 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.  Saving for later.");
          importFilesKeep.add(list.get(i).absoluteFilePath());
        } else {
   
          Note newNote = importer.getNote();
          newNote.setNotebookGuid(notebook);
          newNote.setTitle(dir.at(i));
          NoteMetadata metadata = new NoteMetadata();
          metadata.setDirty(true);
          metadata.setGuid(newNote.getGuid());
          listManager.addNote(newNote, metadata);
          conn.getNoteTable().addNote(newNote, true);
          noteTableView.insertRow(newNote, metadata, true, -1);
          listManager.updateNoteContent(newNote.getGuid(), importer.getNoteContent());
          listManager.countNotebookResults(listManager.getNoteIndex());
          dir.remove(dir.at(i));
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.trolltech.qt.core.QDir

Copyright © 2018 www.massapicom. 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.