diff --git a/src/control/Control.cpp b/src/control/Control.cpp index 134786e5..d8467e67 100644 --- a/src/control/Control.cpp +++ b/src/control/Control.cpp @@ -2193,6 +2193,7 @@ bool Control::annotatePdf(Path filename, bool attachPdf, bool attachToDocument) getCursor()->setCursorBusy(true); + this->doc->setFilename(""); bool res = this->doc->readPdf(filename, true, attachToDocument); if (res) diff --git a/src/util/Path.cpp b/src/util/Path.cpp index dbfcfbd7..63a642b0 100644 --- a/src/util/Path.cpp +++ b/src/util/Path.cpp @@ -48,6 +48,30 @@ bool Path::operator ==(const Path& other) return this->path == other.path; } +/** + * Assign path + */ +void Path::operator =(const Path& other) +{ + this->path = other.path; +} + +/** + * Assign path + */ +void Path::operator =(const string& path) +{ + this->path = path; +} + +/** + * Assign path + */ +void Path::operator =(const char* path) +{ + this->path = path; +} + /** * @return true if this file has .xopp or .xoj extension */ diff --git a/src/util/Path.h b/src/util/Path.h index 782496d3..3d2a5d5b 100644 --- a/src/util/Path.h +++ b/src/util/Path.h @@ -41,6 +41,21 @@ public: */ bool operator ==(const Path& other); + /** + * Assign path + */ + void operator =(const Path& other); + + /** + * Assign path + */ + void operator =(const string& path); + + /** + * Assign path + */ + void operator =(const char* path); + /** * Check if the path ends with this extension *