{
"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": {
-<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))
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)
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 "")
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()
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
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.
.
#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
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) == ']') {
} else {
deepinType = DSysInfo::UnknownDeepin;
}
-
- if (!deepinTypeMap.isEmpty() && productTypeString.isEmpty()) {
- productTypeString = "deepin";
- productType = DSysInfo::Deepin;
- }
}
static QString unquote(const QByteArray &value)
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;
}
#ifdef Q_OS_LINUX
- if (!readOsRelease(this))
- readLsbRelease(this);
+ readOsRelease(this);
+ readLsbRelease(this);
if (productTypeString.isEmpty()) {
productType = DSysInfo::UnknownType;
{
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();
return siGlobal->deepinTypeMap.value(locale.name(), siGlobal->deepinTypeMap.value(QString()));
}
+QString DSysInfo::deepinVersion()
+{
+ siGlobal->ensureDeepinInfo();
+
+ return siGlobal->deepinVersion;
+}
+
QString DSysInfo::deepinEdition()
{
siGlobal->ensureDeepinInfo();
#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
}
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)
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")
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
}
}
+/*!
+ \~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();
return d->url;
}
+/*!
+ * \~chinese \brief 开始文件变动监视
+ * \~english \brief Let file watcher start watching file changes.
+ *
+ * \sa stopWatcher(), restartWatcher()
+ */
bool DBaseFileWatcher::startWatcher()
{
Q_D(DBaseFileWatcher);
return false;
}
+/*!
+ * \~chinese \brief 停止文件变动监视
+ * \~english \brief Stop watching file changes.
+ *
+ * \sa startWatcher(), restartWatcher()
+ */
bool DBaseFileWatcher::stopWatcher()
{
Q_D(DBaseFileWatcher);
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)
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)
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)
{
}
+/*!
+ \~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))
}
+/*!
+ * \~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);
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);
else if (command == QLatin1String("pid"))
chunk = QString::number(QCoreApplication::applicationPid());
- // Appplication name
+ // Application name
else if (command == QLatin1String("appname"))
chunk = QCoreApplication::applicationName();
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");
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();
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()));
} 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))