Logo Search packages:      
Sourcecode: kdenlive version File versions

bool ProjectFormatManager::backupDocument ( const KURL &  url,
KdenliveDoc document 
)

saves a copy of the document for crash recovery.

Definition at line 141 of file projectformatmanager.cpp.

References SaveProjectFilter::save().

{
    if (url.isEmpty())
      return false;
    bool result = false;
    KMimeType::Ptr format = KMimeType::findByURL(url);
    SaveProjectFilter *filter = m_saveFilters.first();

    if (filter) {
      KTempFile file;
      //file.setAutoDelete(true);

      if ((filter->save(*file.file(), document, false))) {
          file.close();
          if (!KIO::NetAccess::upload(file.name(), url, 0)) {
            //kdError() << "Could not upload file to correct location" << endl;
            KMessageBox::sorry(0, i18n("Could not save file %1.\nPlease check your permissions").arg(url.path()));
          }
          else result = true;
      } else {
          kdError() << "Save failed" << endl;
      }
    }
    return result;
}


Generated by  Doxygen 1.6.0   Back to index