File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,6 +118,12 @@ configure_file(${APP_RES_DIR}/environments.h.in environments.h @ONLY)
118118
119119add_definitions (-DUSE_POLKIT -DENABLE_INACTIVE_DISPLAY )
120120
121+ # Qt5环境不支持兼容模式(QThreadPool::start不支持lambda)
122+ if (NOT QT_DESIRED_VERSION MATCHES 6)
123+ add_definitions (-DDISABLE_COMPATIBLE )
124+ message (STATUS "Qt5 environment detected, disabling compatible mode" )
125+ endif ()
126+
121127# Find the library
122128find_package (PkgConfig REQUIRED )
123129
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ void CompatibleBackend::packageRemoved(const CompPkgInfo::Ptr &removePtr)
126126 qCDebug (appLog) << " Removing package from list:" << removePtr->name << removePtr->version ;
127127}
128128
129+ #ifndef DISABLE_COMPATIBLE
129130bool CompatibleBackend::supportAppCheck () const
130131{
131132 return true ;
@@ -222,6 +223,7 @@ bool CompatibleBackend::checkPackageSupportRootfs(const CompPkgInfo::Ptr &checkP
222223 qCDebug (appLog) << " Check package support rootfs finished, return true" ;
223224 return true ;
224225}
226+ #endif
225227
226228QList<RootfsInfo::Ptr> CompatibleBackend::parseRootfsFromRawOutputV1 (const QByteArray &output)
227229{
Original file line number Diff line number Diff line change @@ -57,8 +57,13 @@ class CompatibleBackend : public QObject
5757 void packageRemoved (const CompPkgInfo::Ptr &removePtr);
5858
5959 // use app check support rootfs with special package
60+ #ifdef DISABLE_COMPATIBLE
61+ [[nodiscard]] bool supportAppCheck () const { return false ; }
62+ [[nodiscard]] bool checkPackageSupportRootfs (const CompPkgInfo::Ptr &checkPtr) { Q_UNUSED (checkPtr); return false ; }
63+ #else
6064 [[nodiscard]] bool supportAppCheck () const ;
6165 [[nodiscard]] bool checkPackageSupportRootfs (const CompPkgInfo::Ptr &checkPtr);
66+ #endif
6267 Q_SIGNAL void packageSupportRootfsChanged (const CompPkgInfo::Ptr &checkPtr);
6368
6469private:
Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ configure_file(${APP_RES_DIR}/environments.h.in environments.h @ONLY)
7979
8080add_definitions (-DUSE_POLKIT -DENABLE_INACTIVE_DISPLAY )
8181
82+ # Qt5环境不支持兼容模式(QThreadPool::start不支持lambda)
83+ if (NOT QT_DESIRED_VERSION MATCHES 6)
84+ add_definitions (-DDISABLE_COMPATIBLE )
85+ message (STATUS "Qt5 environment detected, disabling compatible mode in tests" )
86+ endif ()
87+
8288# Find the library
8389find_package (PkgConfig REQUIRED )
8490
You can’t perform that action at this time.
0 commit comments