From: Boyuan Yang Date: Sun, 4 Nov 2018 14:45:59 +0000 (-0500) Subject: New upstream version 2.0.9.5 X-Git-Tag: archive/raspbian/5.7.12-2+rpi1^2~3^2~28 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cf04ab5b1fb4f831b3c007097c4e4f83836743fb;p=dtkcore.git New upstream version 2.0.9.5 --- diff --git a/.release.json b/.release.json index 5e7da26..ede11ac 100644 --- a/.release.json +++ b/.release.json @@ -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": { diff --git a/CHANGELOG.md b/CHANGELOG.md index 6047da7..5fdaa58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,10 @@ - -## 2.0.9.4 (2018-09-06) + +## 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)) diff --git a/cmake/DtkCMake/DtkCMakeConfig.cmake b/cmake/DtkCMake/DtkCMakeConfig.cmake index eeabef4..9700246 100644 --- a/cmake/DtkCMake/DtkCMakeConfig.cmake +++ b/cmake/DtkCMake/DtkCMakeConfig.cmake @@ -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() diff --git a/debian/control b/debian/control index 910fc9b..da2b555 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,8 @@ Section: libdevel Priority: optional Maintainer: Deepin Packages Builder 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. . diff --git a/src/dsysinfo.cpp b/src/dsysinfo.cpp index 0fa9045..658af35 100644 --- a/src/dsysinfo.cpp +++ b/src/dsysinfo.cpp @@ -48,6 +48,7 @@ public: #ifdef Q_OS_LINUX DSysInfo::DeepinType deepinType = DSysInfo::DeepinType(-1); QMap 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(); diff --git a/src/dsysinfo.h b/src/dsysinfo.h index 744c298..4283502 100644 --- a/src/dsysinfo.h +++ b/src/dsysinfo.h @@ -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 diff --git a/src/dtk_qmake.prf b/src/dtk_qmake.prf index d438099..a32db43 100644 --- a/src/dtk_qmake.prf +++ b/src/dtk_qmake.prf @@ -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 } diff --git a/src/filesystem/dbasefilewatcher.cpp b/src/filesystem/dbasefilewatcher.cpp index 9de1172..8c1ddfa 100644 --- a/src/filesystem/dbasefilewatcher.cpp +++ b/src/filesystem/dbasefilewatcher.cpp @@ -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) diff --git a/src/filesystem/dfilewatcher.cpp b/src/filesystem/dfilewatcher.cpp index 0becdd4..118426e 100644 --- a/src/filesystem/dfilewatcher.cpp +++ b/src/filesystem/dfilewatcher.cpp @@ -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) { diff --git a/src/filesystem/dfilewatchermanager.cpp b/src/filesystem/dfilewatchermanager.cpp index f6e0676..30bd822 100644 --- a/src/filesystem/dfilewatchermanager.cpp +++ b/src/filesystem/dfilewatchermanager.cpp @@ -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); diff --git a/src/log/AbstractStringAppender.cpp b/src/log/AbstractStringAppender.cpp index 42a5db9..1757303 100644 --- a/src/log/AbstractStringAppender.cpp +++ b/src/log/AbstractStringAppender.cpp @@ -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(); diff --git a/tools/deepin-os-release/main.cpp b/tools/deepin-os-release/main.cpp index cd79e73..387cf8d 100644 --- a/tools/deepin-os-release/main.cpp +++ b/tools/deepin-os-release/main.cpp @@ -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))