Commit cc6d76e3 authored by Michael Reeves's avatar Michael Reeves

Don't try to manually build url if parent is not set.

parent 85052379
......@@ -20,3 +20,4 @@
#include "Logging.h"
Q_LOGGING_CATEGORY(kdeMain, "org.kde.kdiff3")
Q_LOGGING_CATEGORY(kdiffFileAccess, "org.kde.kdiff3.fileAccess")
......@@ -22,4 +22,5 @@
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(kdeMain)
Q_DECLARE_LOGGING_CATEGORY(kdiffFileAccess)
#endif // !LOGGING_H
......@@ -10,6 +10,7 @@
#include "fileaccess.h"
#include "cvsignorelist.h"
#include "common.h"
#include "Logging.h"
#include "progress.h"
#include "Utils.h"
......@@ -282,9 +283,22 @@ void FileAccess::setFromUdsEntry(const KIO::UDSEntry& e, FileAccess *parent)
m_fileInfo.setCaching(true);
if(m_url.isEmpty())
{
m_url = parent->url().resolved(QUrl(filePath));
//Verify that the scheme doesn't change.
Q_ASSERT(m_url.scheme() == parent->url().scheme());
if(parent != nullptr)
{
m_url = parent->url().resolved(QUrl(filePath));
//Verify that the scheme doesn't change.
Q_ASSERT(m_url.scheme() == parent->url().scheme());
}
else
{
/*
Invalid entry we don't know the full url because KIO didn't tell us and there is no parent
node supplied.
This is a bug if it happens and should be logged . However it is a recoverable error.
*/
qCWarning(kdiffFileAccess) << i18n("Unable to determine full url. No parent specified.");
return;
}
}
m_name = m_fileInfo.fileName();
......
......@@ -157,6 +157,7 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
// First get all input data.
pp.setInformation(i18n("Loading A"));
qCInfo(kdeMain) << i18n("Loading A: %1", m_sd1.getFilename());
if(bUseCurrentEncoding)
errors = m_sd1.readAndPreprocess(m_sd1.getEncoding(), false);
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment