New upstream version 2.0.9.10
authorBoyuan Yang <byang@debian.org>
Sat, 8 Dec 2018 17:23:18 +0000 (12:23 -0500)
committerBoyuan Yang <byang@debian.org>
Sat, 8 Dec 2018 17:23:18 +0000 (12:23 -0500)
CHANGELOG.md
src/dsysinfo.cpp
src/util/drecentmanager.cpp

index 7755499a1dca88d2f35114b6b4daa1b933baea9b..8a73321257b5c6d4c46c1d26e123c90a75a9a787 100644 (file)
@@ -1,3 +1,14 @@
+<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)
 
index 32ae9c40abc3e786f127c1846a6cde662308fd4b..9429114156026459f86f8f78dd977a0c19d7f3b8 100644 (file)
@@ -32,7 +32,7 @@
 #ifdef Q_OS_LINUX
 #include <sys/sysinfo.h>
 #include <sys/utsname.h>
-#include <sys/unistd.h>
+#include <unistd.h>
 #endif
 
 DCORE_BEGIN_NAMESPACE
index 5d6a0ee928ae63d24d5c45eaf6d38e77215f16ed..aeb760e20f0c83ba20eab06849c03c3075996839 100644 (file)
@@ -82,8 +82,7 @@ bool DRecentManager::addItem(const QString &uri, DRecentData &data)
     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()) {
@@ -99,7 +98,7 @@ bool DRecentManager::addItem(const QString &uri, DRecentData &data)
     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;
@@ -142,7 +141,7 @@ bool DRecentManager::addItem(const QString &uri, DRecentData &data)
     // 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);
@@ -227,7 +226,8 @@ void DRecentManager::removeItems(const QStringList &list)
     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;