diff --git a/TODO b/TODO index 598a0d05a..d5cd866a1 100644 --- a/TODO +++ b/TODO @@ -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 diff --git a/core/document.cpp b/core/document.cpp index 3a788167f..8dbebcd8b 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -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 {