Skip to content

Commit ab64afb

Browse files
sync: from linuxdeepin/dtkcore
Synchronize source files from linuxdeepin/dtkcore. Source-pull-request: linuxdeepin/dtkcore#495
1 parent 2d93c38 commit ab64afb

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

.packit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
specfile_path: rpm/dtkcore.spec
55

66
# add or remove files that should be synced
7-
files_to_sync:
7+
synced_files:
88
- rpm/dtkcore.spec
99
- .packit.yaml
1010

src/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ find_package(ICU REQUIRED COMPONENTS uc)
2525
pkg_check_modules(uchardet REQUIRED uchardet)
2626
# end text encoding
2727

28+
# 为不包含实际QObject类的头文件跳过AutoMOC处理
29+
set_property(SOURCE ../include/base/dsingleton.h PROPERTY SKIP_AUTOMOC ON)
30+
if("${DTK_VERSION_MAJOR}" STREQUAL "6")
31+
set_property(SOURCE ../include/util/dthreadutils.h PROPERTY SKIP_AUTOMOC ON)
32+
endif()
33+
2834
# start base
2935
include(base/base.cmake)
3036
# end base

src/dconfig.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ class Q_DECL_HIDDEN FileBackend : public DConfigBackend
173173
if (owner->appId == NoAppId)
174174
return true;
175175

176-
QScopedPointer<DConfigFile> file(new DConfigFile(NoAppId, owner->name, owner->subpath));
176+
std::unique_ptr<DConfigFile> file(new DConfigFile(NoAppId, owner->name, owner->subpath));
177177
const bool canFallbackToGeneric = !file->meta()->metaPath(prefix).isEmpty();
178178
if (canFallbackToGeneric) {
179-
QScopedPointer<DConfigCache> cache(file->createUserCache(getuid()));
179+
std::unique_ptr<DConfigCache> cache(file->createUserCache(getuid()));
180180
if (file->load(prefix) && cache->load(prefix)) {
181-
genericConfigFile.reset(file.take());
182-
genericConfigCache.reset(cache.take());
181+
genericConfigFile.reset(file.release());
182+
genericConfigCache.reset(cache.release());
183183
}
184184
}
185185
return true;
@@ -370,7 +370,7 @@ class Q_DECL_HIDDEN DBusBackend : public DConfigBackend
370370
complexType >> list;
371371
QVariantList res;
372372
res.reserve(list.size());
373-
for (const auto &item : qAsConst(list)) {
373+
for (const auto &item : std::as_const(list)) {
374374
res << decodeQDBusArgument(item);
375375
}
376376
return res;

src/util/drecentmanager.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <QUrl>
1414
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
1515
#include <QStringConverter>
16+
#include <QTimeZone>
1617
#endif
1718

1819
DCORE_BEGIN_NAMESPACE
@@ -67,7 +68,11 @@ bool DRecentManager::addItem(const QString &uri, DRecentData &data)
6768
QFile file(RECENT_PATH);
6869
file.open(QIODevice::ReadWrite | QIODevice::Text);
6970

71+
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
72+
QString dateTime = QDateTime::currentDateTime().toTimeZone(QTimeZone::UTC).toString(Qt::ISODate);
73+
#else
7074
QString dateTime = QDateTime::currentDateTime().toTimeSpec(Qt::OffsetFromUTC).toString(Qt::ISODate);
75+
#endif
7176
QDomDocument doc;
7277

7378
if (!doc.setContent(&file)) {

0 commit comments

Comments
 (0)