Logo Search packages:      
Sourcecode: kdewebdev version File versions

void QuantaApp::restoreFromTempfile ( Document *  w  ) 

Restores the original document from the temporary backup

Definition at line 1450 of file quanta.cpp.

Referenced by slotChangePreviewStatus(), slotPreviewHasFocus(), slotShowPreviewWidget(), and ViewManager::slotViewActivated().

{
  if (!w) return;
  if (w->tempFileName().isEmpty())
    return;

  KURL origUrl = w->url();
  if (!w->isUntitled() && origUrl.isLocalFile())
  {
      fileWatcher->removeFile(origUrl.path());
      kdDebug(24000) << "removeFile[restoreFromTempfile]: " << origUrl.path() << endl;
  }
  KURL tempUrl;
  tempUrl.setPath(w->tempFileName());
//  kdDebug(24000) << "Restoring tempfile " << w->tempFileName() << " for " << w->url() << endl;
  QExtFileInfo::copy(tempUrl, origUrl, -1, true, false, this);
  KIO::UDSEntry entry;
  if (KIO::NetAccess::stat(origUrl, entry, this))
  {
    KFileItem item(entry, origUrl, true);
    int modifiedTime = item.time(KIO::UDS_MODIFICATION_TIME);
    Project::ref()->updateTimeStamp(origUrl, modifiedTime, false);
  }
  if (origUrl.isLocalFile())
  {
      kdDebug(24000) << "addFile[restoreFromTempfile]: " << origUrl.path() << endl;
      fileWatcher->addFile(origUrl.path());
  }
}


Generated by  Doxygen 1.6.0   Back to index