New upstream version 2.0.9.5
authorBoyuan Yang <byang@debian.org>
Sun, 4 Nov 2018 14:45:59 +0000 (09:45 -0500)
committerBoyuan Yang <byang@debian.org>
Sun, 4 Nov 2018 14:45:59 +0000 (09:45 -0500)
12 files changed:
.release.json
CHANGELOG.md
cmake/DtkCMake/DtkCMakeConfig.cmake
debian/control
src/dsysinfo.cpp
src/dsysinfo.h
src/dtk_qmake.prf
src/filesystem/dbasefilewatcher.cpp
src/filesystem/dfilewatcher.cpp
src/filesystem/dfilewatchermanager.cpp
src/log/AbstractStringAppender.cpp
tools/deepin-os-release/main.cpp

index 5e7da26d76140551a39a830ac80a0a0a25a77af9..ede11ac7e725f4107a3c76f494ea5f0c79287dd3 100644 (file)
@@ -1,7 +1,7 @@
 {
         "commit": {
                 "quilt": false,
-                "pkgver": "git describe --tags --long %(ref)s | awk '{split($0,v,\"-\"); print v[1]\"+r\"v[2]\"+\"v[3]}'",
+                "pkgver": "echo $(git tag | tail -n1)'+r'$(date '+%%y%%m%%d%%H%%M%%S')'+g'$(git rev-parse --short HEAD);",
                 "dist": "experimental"
         },
         "release": {
index 6047da75046c55b5e6411e21b3130e63129207b2..5fdaa58018ecdb3db73d049a6724eb615832bbc2 100644 (file)
@@ -1,14 +1,10 @@
-<a name="2.0.9.4"></a>
-## 2.0.9.4 (2018-09-06)
+<a name="2.0.9.5"></a>
+## 2.0.9.5 (2018-10-26)
 
 
-#### Bug Fixes
-
-*   can not build on Qt 5.6.1 ([752bf435](https://github.com/linuxdeepin/dtkcore/commit/752bf435a99330241b99d85a4020f2cddd4ff48e))
-
 #### Features
 
-*   add DSysInfo class ([16faf6c8](https://github.com/linuxdeepin/dtkcore/commit/16faf6c84d1a2ce520eecd42f369b78d24e03b9c))
+*   update version number for expermimental ([02b5d5c1](https://github.com/linuxdeepin/dtkcore/commit/02b5d5c1e01a05f57651b774b02cae31ef9a549f))
 
 
 
index eeabef4eda59ff8c68841c6e498c3bfe92c84da7..9700246e9a6fb3521824ae54e7db06aa490feba4 100644 (file)
@@ -28,6 +28,7 @@ macro(execDeepinOsRelease args output)
 endmacro()
 
 execDeepinOsRelease(--deepin-type DEEPIN_OS_TYPE)
+execDeepinOsRelease(--deepin-version DEEPIN_OS_VERSION)
 execDeepinOsRelease(--product-type CMAKE_PLATFORM_ID)
 execDeepinOsRelease(--product-version CMAKE_PLATFORM_VERSION)
 
@@ -44,14 +45,8 @@ else()
         set(OS_${CMAKE_PLATFORM_ID} TRUE)
     endif()
 
-    if("${CMAKE_PLATFORM_VERSION}" STREQUAL "")
-        message(WARNING "No value of the \"--product-version\"")
-    else()
-        formatString(CMAKE_PLATFORM_VERSION)
-        if(NOT "${CMAKE_PLATFORM_VERSION}" STREQUAL "")
-            add_definitions(-DQ_OS_VERSION=\"${CMAKE_PLATFORM_VERSION}\")
-        endif()
-    endif()
+    formatString(CMAKE_PLATFORM_VERSION)
+    add_definitions(-DQ_OS_VERSION=\"${CMAKE_PLATFORM_VERSION}\")
 endif()
 
 if("${DEEPIN_OS_TYPE}" STREQUAL "")
@@ -60,13 +55,16 @@ else()
     formatString(DEEPIN_OS_TYPE)
 
     message("Deepin OS Type: ${DEEPIN_OS_TYPE}")
+    message("Deepin OS Version: ${DEEPIN_OS_VERSION}")
 
     if(NOT "${DEEPIN_OS_TYPE}" STREQUAL "")
         addDefinitions(Q_OS_DEEPIN_${DEEPIN_OS_TYPE})
+        addDefinitions(DEEPIN_DDE)
         string(TOUPPER ${DEEPIN_OS_TYPE} DEEPIN_OS_TYPE)
         set(OS_DEEPIN_${DEEPIN_OS_TYPE} TRUE)
+        set(DEEPIN_DDE TRUE)
     endif()
 
-    add_definitions(-DQ_OS_DEEPIN)
-    set(OS_DEEPIN TRUE)
+    formatString(DEEPIN_OS_VERSION)
+    add_definitions(-DQ_OS_DEEPIN_VERSION=\"${DEEPIN_OS_VERSION}\")
 endif()
index 910fc9b067c41d5b32c2fbec0b3db1ba3485083a..da2b5559d958406da84144c548af4bf9f1342c69 100644 (file)
@@ -3,7 +3,8 @@ Section: libdevel
 Priority: optional
 Maintainer: Deepin Packages Builder <packages@deepin.com>
 Build-Depends: debhelper (>= 9), pkg-config,
- qttools5-dev-tools, qtbase5-private-dev, libgsettings-qt-dev
+ qttools5-dev-tools, qtbase5-private-dev,
+ libgsettings-qt-dev, deepin-desktop-base
 Standards-Version: 3.9.8
 
 Package: libdtkcore2
@@ -17,7 +18,8 @@ Description: Deepin Tool Kit Core library
 
 Package: libdtkcore-bin
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libdtkcore2( =${binary:Version})
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ libdtkcore2( =${binary:Version}), deepin-desktop-base
 Description: Deepin Tool Kit Core Utilities
  DtkCore is base devel library of Deepin Qt/C++ applications.
  .
index 0fa9045a14ccd688a550ff0ac1cfcb7b70a4ec45..658af353a3dc981b80625db44560644b3f8c64c0 100644 (file)
@@ -48,6 +48,7 @@ public:
 #ifdef Q_OS_LINUX
     DSysInfo::DeepinType deepinType = DSysInfo::DeepinType(-1);
     QMap<QString, QString> deepinTypeMap; //Type Name with Language
+    QString deepinVersion;
     QString deepinEdition;
     QString deepinCopyright;
 #endif
@@ -100,7 +101,9 @@ void DSysInfoPrivate::ensureDeepinInfo()
 
         const auto key_value = qMakePair(list.first().trimmed(), list.last().trimmed());
 
-        if (line.startsWith("Type")) {
+        if (key_value.first == "Version") {
+            deepinVersion = key_value.second;
+        } else if (line.startsWith("Type")) {
             if (key_value.first == "Type") {
                 deepinTypeMap[QString()] = QString::fromLatin1(key_value.second);
             } else if (key_value.first.at(4) == '[' && key_value.first.at(key_value.first.size() - 1) == ']') {
@@ -134,11 +137,6 @@ void DSysInfoPrivate::ensureDeepinInfo()
     } else {
         deepinType = DSysInfo::UnknownDeepin;
     }
-
-    if (!deepinTypeMap.isEmpty() && productTypeString.isEmpty()) {
-        productTypeString = "deepin";
-        productType = DSysInfo::Deepin;
-    }
 }
 
 static QString unquote(const QByteArray &value)
@@ -171,21 +169,21 @@ static bool readEtcFile(DSysInfoPrivate *info, const char *filename,
 
         const QByteArray line(buf, buf_length - 1);
 
-        if (line.startsWith(idKey)) {
+        if (info->productTypeString.isEmpty() && line.startsWith(idKey)) {
             const QByteArray value(line.constData() + idKey.size());
             info->productTypeString = unquote(value);
             ++valid_data_count;
             continue;
         }
 
-        if (line.startsWith(prettyNameKey)) {
+        if (info->prettyName.isEmpty() && line.startsWith(prettyNameKey)) {
             const QByteArray value(line.constData() + prettyNameKey.size());
             info->prettyName = unquote(value);
             ++valid_data_count;
             continue;
         }
 
-        if (line.startsWith(versionKey)) {
+        if (info->productVersion.isEmpty() && line.startsWith(versionKey)) {
             const QByteArray value(line.constData() + versionKey.size());
             info->productVersion = unquote(value);
             ++valid_data_count;
@@ -219,8 +217,8 @@ void DSysInfoPrivate::ensureReleaseInfo()
     }
 
 #ifdef Q_OS_LINUX
-    if (!readOsRelease(this))
-        readLsbRelease(this);
+    readOsRelease(this);
+    readLsbRelease(this);
 
     if (productTypeString.isEmpty()) {
         productType = DSysInfo::UnknownType;
@@ -355,12 +353,16 @@ bool DSysInfo::isDeepin()
 {
     siGlobal->ensureReleaseInfo();
 
-    if (siGlobal->productTypeString.isEmpty())
-        siGlobal->ensureDeepinInfo();
-
     return productType() == Deepin;
 }
 
+bool DSysInfo::isDDE()
+{
+    siGlobal->ensureDeepinInfo();
+
+    return siGlobal->deepinType != UnknownDeepin;
+}
+
 DSysInfo::DeepinType DSysInfo::deepinType()
 {
     siGlobal->ensureDeepinInfo();
@@ -375,6 +377,13 @@ QString DSysInfo::deepinTypeDisplayName(const QLocale &locale)
     return siGlobal->deepinTypeMap.value(locale.name(), siGlobal->deepinTypeMap.value(QString()));
 }
 
+QString DSysInfo::deepinVersion()
+{
+    siGlobal->ensureDeepinInfo();
+
+    return siGlobal->deepinVersion;
+}
+
 QString DSysInfo::deepinEdition()
 {
     siGlobal->ensureDeepinInfo();
index 744c298461173a64f0c3384f04274e745df34b05..42835027a7708844dc0a7ed77b4e9ae46b304a1f 100644 (file)
@@ -53,8 +53,10 @@ public:
 
 #ifdef Q_OS_LINUX
     static bool isDeepin();
+    static bool isDDE();
     static DeepinType deepinType();
     static QString deepinTypeDisplayName(const QLocale &locale = QLocale::system());
+    static QString deepinVersion();
     static QString deepinEdition();
     static QString deepinCopyright();
 #endif
index d438099afa45cdebf5e1a7e8f930795161e95932..a32db43d9d7ad6d2866ad738745d5b1179c67467 100644 (file)
@@ -34,6 +34,7 @@ defineReplace(formatString) {
 }
 
 DEEPIN_OS_TYPE = $$system($$DEEPIN_OS_RELEASE_TOOL --deepin-type)
+DEEPIN_OS_VERSION = $$system($$DEEPIN_OS_RELEASE_TOOL --deepin-version)
 DISTRIB_ID = $$system($$DEEPIN_OS_RELEASE_TOOL --product-type)
 DISTRIB_RELEASE = $$system($$DEEPIN_OS_RELEASE_TOOL --product-version)
 
@@ -45,14 +46,11 @@ else {
 
     QMAKE_PLATFORM += $$lower($$DISTRIB_ID)
 
-    !isEmpty(DISTRIB_ID): DEFINES *= Q_OS_$$upper($$DISTRIB_ID)
+    !isEmpty(DISTRIB_ID): DEFINES += Q_OS_$$upper($$DISTRIB_ID)
     CONFIG *= $$QMAKE_PLATFORM
 
-    isEmpty(DISTRIB_RELEASE): warning(No value of the "--product-version")
-    else {
-        DISTRIB_RELEASE = $$formatString($$DISTRIB_RELEASE)
-        !isEmpty(DISTRIB_RELEASE): DEFINES *= Q_OS_VERSION=\\\"$$DISTRIB_RELEASE\\\"
-    }
+    DISTRIB_RELEASE = $$formatString($$DISTRIB_RELEASE)
+    DEFINES += Q_OS_VERSION=\\\"$$DISTRIB_RELEASE\\\"
 }
 
 isEmpty(DEEPIN_OS_TYPE): warning(No value of the "--deepin-type" in the process "$$DEEPIN_OS_RELEASE_TOOL")
@@ -60,14 +58,15 @@ else {
     DEEPIN_OS_TYPE = $$formatString($$DEEPIN_OS_TYPE)
 
     message(Deepin OS Type: $$DEEPIN_OS_TYPE)
-
-    QMAKE_PLATFORM += deepin
+    message(Deepin OS Version: $$DEEPIN_OS_VERSION)
 
     !isEmpty(DEEPIN_OS_TYPE) {
-        QMAKE_PLATFORM += deepin_$$lower($$DEEPIN_OS_TYPE)
-        DEFINES *= Q_OS_DEEPIN_$$upper($$DEEPIN_OS_TYPE)
+        QMAKE_PLATFORM += deepin_$$lower($$DEEPIN_OS_TYPE) deepin_dde
+        DEFINES += Q_OS_DEEPIN_$$upper($$DEEPIN_OS_TYPE) DEEPIN_DDE
     }
 
+    DEEPIN_OS_VERSION = $$formatString($$DEEPIN_OS_VERSION)
+    DEFINES += Q_OS_DEEPIN_VERSION=\\\"$$DEEPIN_OS_VERSION\\\"
+
     CONFIG *= $$QMAKE_PLATFORM
-    DEFINES *= Q_OS_DEEPIN
 }
index 9de11720f766b11188be5783fd5b9df115431c3f..8c1ddfae51cddc04a4c0ee1e02169015b3500bc3 100644 (file)
@@ -30,6 +30,16 @@ DBaseFileWatcherPrivate::DBaseFileWatcherPrivate(DBaseFileWatcher *qq)
 
 }
 
+/*!
+    \~english \class DBaseFileWatcher
+    \~english \brief The DBaseFileWatcher class provides an interface for monitoring files and directories for modifications.
+*/
+
+/*!
+    \~chinese \class DBaseFileWatcher
+    \~chinese \brief DBaseFileWatcher 类提供了一系列接口可供监视文件和目录的变动。
+*/
+
 DBaseFileWatcher::~DBaseFileWatcher()
 {
     stopWatcher();
@@ -43,6 +53,12 @@ QUrl DBaseFileWatcher::fileUrl() const
     return d->url;
 }
 
+/*!
+ * \~chinese \brief 开始文件变动监视
+ * \~english \brief Let file watcher start watching file changes.
+ *
+ * \sa stopWatcher(), restartWatcher()
+ */
 bool DBaseFileWatcher::startWatcher()
 {
     Q_D(DBaseFileWatcher);
@@ -59,6 +75,12 @@ bool DBaseFileWatcher::startWatcher()
     return false;
 }
 
+/*!
+ * \~chinese \brief 停止文件变动监视
+ * \~english \brief Stop watching file changes.
+ *
+ * \sa startWatcher(), restartWatcher()
+ */
 bool DBaseFileWatcher::stopWatcher()
 {
     Q_D(DBaseFileWatcher);
@@ -75,18 +97,45 @@ bool DBaseFileWatcher::stopWatcher()
     return false;
 }
 
+/*!
+ * \~chinese \brief 重新开始文件变动监视
+ * \~english \brief Stop file watcher and then restart it to watching file changes.
+ *
+ * \sa startWatcher(), stopWatcher()
+ */
 bool DBaseFileWatcher::restartWatcher()
 {
     bool ok = stopWatcher();
     return ok && startWatcher();
 }
 
+/*!
+ * \~chinese \brief 设置是否对 \a subfileUrl 目录启用文件监视
+ * \~english \brief Set enable file watcher for \a subfileUrl or not
+ *
+ * \~chinese \param subfileUrl 设置所针对的 Url
+ * \~english \param subfileUrl The given url
+ *
+ * \~chinese \param enabled 是否启用文件变动监视
+ * \~english \param enabled Enable file change watching or not.
+ */
 void DBaseFileWatcher::setEnabledSubfileWatcher(const QUrl &subfileUrl, bool enabled)
 {
     Q_UNUSED(subfileUrl)
     Q_UNUSED(enabled)
 }
 
+/*!
+ * \~chinese \brief 发送一个信号表示目标目录 \a targetUrl 得到了一个 \a signal 信号,包含参数 \a arg1 。
+ * \~english \brief Emit a signal about \a targetUrl got a \a signal with \a arg1
+ *
+ * \~chinese 示例用法:
+ * \~english Example usage:
+ *
+ * \~ \code{.cpp}
+ * DBaseFileWatcher::ghostSignal(QUrl("bookmark:///"), &DBaseFileWatcher::fileDeleted, QUrl("bookmark:///bookmarkFile1"));
+ * \endcode
+ */
 bool DBaseFileWatcher::ghostSignal(const QUrl &targetUrl, DBaseFileWatcher::SignalType1 signal, const QUrl &arg1)
 {
     if (!signal)
@@ -104,6 +153,17 @@ bool DBaseFileWatcher::ghostSignal(const QUrl &targetUrl, DBaseFileWatcher::Sign
     return ok;
 }
 
+/*!
+ * \~chinese \brief 发送一个信号表示目标目录 \a targetUrl 得到了一个 \a signal 信号,包含参数 \a arg1 和 \arg2。
+ * \~english \brief Emit a signal about \a targetUrl got a \a signal with \a arg1 and \a arg2
+ *
+ * \~chinese 示例用法:
+ * \~english Example usage:
+ *
+ * \~ \code{.cpp}
+ * DBaseFileWatcher::ghostSignal(QUrl("bookmark:///"), &DBaseFileWatcher::fileMoved, QUrl("bookmark:///bookmarkFile1"), QUrl("bookmark:///NewNameFile1"));
+ * \endcode
+ */
 bool DBaseFileWatcher::ghostSignal(const QUrl &targetUrl, DBaseFileWatcher::SignalType2 signal, const QUrl &arg1, const QUrl &arg2)
 {
     if (!signal)
index 0becdd410b6f36ec57bbe87721b946093d4de4b5..118426e71a401b280772242a9c1a7494a5ebb59c 100644 (file)
@@ -215,6 +215,16 @@ QString DFileWatcherPrivate::formatPath(const QString &path)
     return p.isEmpty() ? path : p;
 }
 
+/*!
+    \~english \class DFileWatcher
+    \~english \brief The DFileWatcher class provides an implemention of DBaseFileWatcher for monitoring files and directories for modifications.
+*/
+
+/*!
+    \~chinese \class DFileWatcher
+    \~chinese \brief DFileWatcher 类提供了对 DBaseFileWatcher 接口的实现,可供监视文件和目录的变动。
+*/
+
 DFileWatcher::DFileWatcher(const QString &filePath, QObject *parent)
     : DBaseFileWatcher(*new DFileWatcherPrivate(this), QUrl::fromLocalFile(filePath), parent)
 {
index f6e0676291833fa32d0bf2b79da86d6e18104ed7..30bd822c0f1f972965235e2fbda792af4df0a3ff 100644 (file)
@@ -40,6 +40,16 @@ DFileWatcherManagerPrivate::DFileWatcherManagerPrivate(DFileWatcherManager *qq)
 
 }
 
+/*!
+    \~english \class DFileWatcherManager
+    \~english \brief The DFileWatcherManager class can help you manage file watchers and get signal when file got changed.
+*/
+
+/*!
+    \~chinese \class DFileWatcherManager
+    \~chinese \brief DFileWatcherManager 类可以帮助管理一系列 DFileWatcher 文件监视器,并在文件变动时发送信号通知。
+*/
+
 DFileWatcherManager::DFileWatcherManager(QObject *parent)
     : QObject(parent)
     , DObject(*new DFileWatcherManagerPrivate(this))
@@ -52,6 +62,13 @@ DFileWatcherManager::~DFileWatcherManager()
 
 }
 
+/*!
+ * \~chinese \brief 为路径 \a filePatch 创建 DFileWatcher 并将其添加到 DFileWatcherManager 中.
+ * \~english \brief Add file watcher for \a filePatch to the file watcher manager.
+ *
+ * \~chinese \return 被创建并添加到 DFileWatcherManager 的 DFileWatcher
+ * \~english \return The file watcher which got created and added into the file watcher manager.
+ */
 DFileWatcher *DFileWatcherManager::add(const QString &filePath)
 {
     Q_D(DFileWatcherManager);
@@ -89,6 +106,10 @@ DFileWatcher *DFileWatcherManager::add(const QString &filePath)
     return watcher;
 }
 
+/*!
+ * \~chinese \brief 从当前 DFileWatcherManager 中移除监视 \a filePath 的 DFileWatcher.
+ * \~english \brief Remove file watcher for \a filePatch from the file watcher manager.
+ */
 void DFileWatcherManager::remove(const QString &filePath)
 {
     Q_D(DFileWatcherManager);
index 42a5db957bd580e98e36b2bcb41b0d33ea2746ad..175730320165e428b4bf912c299291e0405c3b7b 100644 (file)
@@ -431,7 +431,7 @@ QString AbstractStringAppender::formattedString(const QDateTime& timeStamp, Logg
       else if (command == QLatin1String("pid"))
         chunk = QString::number(QCoreApplication::applicationPid());
 
-      // Appplication name
+      // Application name
       else if (command == QLatin1String("appname"))
         chunk = QCoreApplication::applicationName();
 
index cd79e7322b479eaad5aca90c1b5e8c3c827c1e21..387cf8d0af3172660b4c1001caa9b1c08b044494 100644 (file)
@@ -37,6 +37,7 @@ int main(int argc, char *argv[])
     QCommandLineParser parser;
     QCommandLineOption option_all("all");
     QCommandLineOption option_deepin_type("deepin-type");
+    QCommandLineOption option_deepin_version("deepin-version");
     QCommandLineOption option_deepin_edition("deepin-edition");
     QCommandLineOption option_deepin_copyright("deepin-copyright");
     QCommandLineOption option_product_type("product-type");
@@ -46,7 +47,7 @@ int main(int argc, char *argv[])
     QCommandLineOption optioin_memory_size("memory-size");
     QCommandLineOption optioin_disk_size("disk-size");
 
-    parser.addOptions({option_all, option_deepin_type, option_deepin_edition,
+    parser.addOptions({option_all, option_deepin_type, option_deepin_version, option_deepin_edition,
                        option_deepin_copyright, option_product_type, option_product_version,
                        option_computer_name, option_cpu_model, optioin_memory_size, optioin_disk_size});
     parser.addHelpOption();
@@ -59,9 +60,16 @@ int main(int argc, char *argv[])
         printf("Memory Size: %f GiB\n", DSysInfo::memoryTotalSize() / 1024.0 / 1024 / 1024);
         printf("Disk Size: %f GiB\n", DSysInfo::systemDiskSize() / 1024.0 / 1024 / 1024);
 
-        printf("Deepin Type: %s\n", qPrintable(DSysInfo::deepinTypeDisplayName(QLocale::c())));
-        printf("Deepin Edition: %s\n", qPrintable(DSysInfo::deepinEdition()));
-        printf("Deepin Copyright: %s\n", qPrintable(DSysInfo::deepinCopyright()));
+        if (DSysInfo::isDDE()) {
+            printf("Deepin Type: %s\n", qPrintable(DSysInfo::deepinTypeDisplayName()));
+            printf("Deepin Version: %s\n", qPrintable(DSysInfo::deepinVersion()));
+
+            if (!DSysInfo::deepinEdition().isEmpty())
+                printf("Deepin Edition: %s\n", qPrintable(DSysInfo::deepinEdition()));
+
+            if (!DSysInfo::deepinCopyright().isEmpty())
+                printf("Deepin Copyright: %s\n", qPrintable(DSysInfo::deepinCopyright()));
+        }
 
         printf("Operating System Name: %s\n", qPrintable(DSysInfo::operatingSystemName()));
         printf("Product Type: %s\n", qPrintable(DSysInfo::productTypeString()));
@@ -69,6 +77,8 @@ int main(int argc, char *argv[])
     } else {
         if (parser.isSet(option_deepin_type))
             printf("%s", qPrintable(DSysInfo::deepinTypeDisplayName(QLocale::c())));
+        else if (parser.isSet(option_deepin_version))
+            printf("%s", qPrintable(DSysInfo::deepinVersion()));
         else if (parser.isSet(option_deepin_edition))
             printf("%s", qPrintable(DSysInfo::deepinEdition()));
         else if (parser.isSet(option_deepin_copyright))