+<a name="2.0.9.10"></a>
+## 2.0.9.10 (2018-12-05)
+
+
+#### Bug Fixes
+
+* include unistd.h instead of sys/unistd.h ([39c50a13](https://github.com/linuxdeepin/dtkcore/commit/39c50a1398c34123e3806a3060a4c64e7f45ed68))
+* url encoding ([4a6b7b61](https://github.com/linuxdeepin/dtkcore/commit/4a6b7b61bb3ad9ab417eda69249b5e9aced0aa97))
+
+
+
<a name="2.0.9.9"></a>
## 2.0.9.9 (2018-11-19)
file.close();
// need to add file:// protocol.
- QUrl url(uri);
- url.setScheme("file");
+ QUrl url = QUrl::fromLocalFile(uri);
// get the MimeType name of the file.
if (data.mimeType.isEmpty()) {
for (int i = 0; i < nodeList.size(); ++i) {
const QString fileUrl = nodeList.at(i).toElement().attribute("href");
- if (fileUrl == url.toString()) {
+ if (fileUrl == url.toEncoded(QUrl::FullyDecoded)) {
bookmarkEle = nodeList.at(i).toElement();
isFound = true;
break;
// add new elements if they don't exist.
else {
QDomElement bookmarkEle, infoEle, metadataEle, mimeEle, appsEle, appChildEle;
- QString hrefStr = QString::fromLatin1(url.toEncoded(QUrl::FullyEncoded));
+ QString hrefStr = url.toEncoded(QUrl::FullyEncoded);
bookmarkEle = doc.createElement("bookmark");
bookmarkEle.setAttribute("href", hrefStr);
for (int i = 0; i < nodeList.count(); ) {
const QString fileUrl = nodeList.at(i).toElement().attribute("href");
- if (list.contains(QUrl::fromPercentEncoding(fileUrl.toUtf8()))) {
+ if (list.contains(QUrl::fromPercentEncoding(fileUrl.toLatin1())) ||
+ list.contains(QUrl(fileUrl).toEncoded(QUrl::FullyDecoded))) {
rootEle.removeChild(nodeList.at(i));
} else {
++i;