first step of a KPDF -> okular conversion: copy the data file for the document to be opened to the new place

svn path=/trunk/KDE/kdegraphics/okular/; revision=656648
remotes/origin/KDE/4.0
Pino Toscano 19 years ago
parent 2e024d6d96
commit 13d14942e6
  1. 1
      TODO
  2. 14
      core/document.cpp

@ -28,6 +28,7 @@ Bugs and wishes to close when moving okular to kdegraphics:
In progress [working on]:
-> core: forms support (mainly for pdf) (BR91809)
-> bookmarks: improved interface, with easy handling of the bookmarks of all the documents (BR99787,BR136113)
-> KPDF -> okular conversion of datafiles {document data(in progress), kwallet passwords(missing)}
-> inverse search (BR113191)
find with an usability expert the "best" way to activate such a link
provide a configuration widget to choose the editor and configure a custom one

@ -745,9 +745,19 @@ bool Document::openDocument( const QString & docFile, const KUrl& url, const KMi
d->m_url = url;
d->m_docFileName = docFile;
QString fn = docFile.contains('/') ? docFile.section('/', -1, -1) : docFile;
fn = "kpdf/" + QString::number(fileReadTest.size()) + '.' + fn + ".xml";
fn = QString::number(fileReadTest.size()) + '.' + fn + ".xml";
fileReadTest.close();
d->m_xmlFileName = KStandardDirs::locateLocal( "data", fn );
QString newokular = "okular/docdata/" + fn;
QString newokularfile = KStandardDirs::locateLocal( "data", newokular );
QString oldkpdf = "kpdf/" + fn;
QString oldkpdffile = KStandardDirs::locateLocal( "data", oldkpdf );
if ( QFile::exists( oldkpdffile ) && !QFile::exists( newokularfile ) )
{
// ### copy or move?
if ( !QFile::copy( oldkpdffile, newokularfile ) )
return false;
}
d->m_xmlFileName = newokularfile;
}
else
{

Loading…
Cancel
Save