Commit 18a73708 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Don't allow embedding a project in itself.

Related to #737
parent 9cac6b3b
......@@ -88,8 +88,14 @@ QString ClipCreator::createColorClip(const QString &color, int duration, const Q
QDomDocument ClipCreator::getXmlFromUrl(const QString &path)
QDomDocument xml;
QUrl fileUrl = QUrl::fromLocalFile(path);
if (fileUrl.matches(pCore->currentDoc()->url(), QUrl::RemoveScheme | QUrl::NormalizePathSegments)) {
// Cannot embed a project in itself
KMessageBox::sorry(QApplication::activeWindow(), i18n("You cannot add a project inside itself."), i18n("Cannot create clip"));
return xml;
QMimeDatabase db;
QMimeType type = db.mimeTypeForUrl(QUrl::fromLocalFile(path));
QMimeType type = db.mimeTypeForUrl(fileUrl);
QDomElement prod;
qDebug()<<"=== GOT DROPPPED MIME: "<<;
Supports Markdown
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