Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ find_package(ICU REQUIRED COMPONENTS uc)
pkg_check_modules(uchardet REQUIRED uchardet)
# end text encoding

# 为不包含实际QObject类的头文件跳过AutoMOC处理
set_property(SOURCE ../include/base/dsingleton.h PROPERTY SKIP_AUTOMOC ON)
if("${DTK_VERSION_MAJOR}" STREQUAL "6")
set_property(SOURCE ../include/util/dthreadutils.h PROPERTY SKIP_AUTOMOC ON)
endif()

# start base
include(base/base.cmake)
# end base
Expand Down
10 changes: 5 additions & 5 deletions src/dconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ class Q_DECL_HIDDEN FileBackend : public DConfigBackend
if (owner->appId == NoAppId)
return true;

QScopedPointer<DConfigFile> file(new DConfigFile(NoAppId, owner->name, owner->subpath));
std::unique_ptr<DConfigFile> file(new DConfigFile(NoAppId, owner->name, owner->subpath));
const bool canFallbackToGeneric = !file->meta()->metaPath(prefix).isEmpty();
if (canFallbackToGeneric) {
QScopedPointer<DConfigCache> cache(file->createUserCache(getuid()));
std::unique_ptr<DConfigCache> cache(file->createUserCache(getuid()));
if (file->load(prefix) && cache->load(prefix)) {
genericConfigFile.reset(file.take());
genericConfigCache.reset(cache.take());
genericConfigFile.reset(file.release());
genericConfigCache.reset(cache.release());
}
}
return true;
Expand Down Expand Up @@ -370,7 +370,7 @@ class Q_DECL_HIDDEN DBusBackend : public DConfigBackend
complexType >> list;
QVariantList res;
res.reserve(list.size());
for (const auto &item : qAsConst(list)) {
for (const auto &item : std::as_const(list)) {
res << decodeQDBusArgument(item);
}
return res;
Expand Down
5 changes: 5 additions & 0 deletions src/util/drecentmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
#include <QFileInfo>
#include <QFile>
#include <QDir>
#include <QUrl>

Check warning on line 13 in src/util/drecentmanager.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QUrl> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
#include <QStringConverter>
#include <QTimeZone>
#endif

DCORE_BEGIN_NAMESPACE
Expand Down Expand Up @@ -67,7 +68,11 @@
QFile file(RECENT_PATH);
file.open(QIODevice::ReadWrite | QIODevice::Text);

#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
QString dateTime = QDateTime::currentDateTime().toTimeZone(QTimeZone::UTC).toString(Qt::ISODate);
#else
QString dateTime = QDateTime::currentDateTime().toTimeSpec(Qt::OffsetFromUTC).toString(Qt::ISODate);
#endif
QDomDocument doc;

if (!doc.setContent(&file)) {
Expand Down