Document::openRelativeFile: Double check the url changed when we asked to

If not, open did not succeed and the callers (for example open document
X in page A) would like to know so they don't have to do the "change to
part A" part.

BUGS: 429924
This commit is contained in:
Albert Astals Cid 2020-12-02 15:27:49 +01:00
parent 3c1b04da47
commit 4f2c2b2714

View file

@ -762,14 +762,14 @@ QUrl DocumentPrivate::giveAbsoluteUrl(const QString &fileName) const
bool DocumentPrivate::openRelativeFile(const QString &fileName)
{
QUrl url = giveAbsoluteUrl(fileName);
if (url.isEmpty())
const QUrl newUrl = giveAbsoluteUrl(fileName);
if (newUrl.isEmpty())
return false;
qCDebug(OkularCoreDebug).nospace() << "openRelativeFile: '" << url << "'";
qCDebug(OkularCoreDebug).nospace() << "openRelativeFile: '" << newUrl << "'";
emit m_parent->openUrl(url);
return true;
emit m_parent->openUrl(newUrl);
return m_url == newUrl;
}
Generator *DocumentPrivate::loadGeneratorLibrary(const KPluginMetaData &service)