chore(cpn): upgrade to Ubuntu 22.04 and Qt 6.9.0 (#5986)
Co-authored-by: elecpower <elecpower@users.noreply.github.com> Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
This commit is contained in:
co-authored by
elecpower
raphaelcoeffic
parent
7264b28e62
commit
9e86a3ea84
@@ -26,6 +26,10 @@
|
||||
#include <QElapsedTimer>
|
||||
#include <QMutexLocker>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <QNtfsPermissionCheckGuard>
|
||||
#endif
|
||||
|
||||
#define SYNC_MAX_ERRORS 50 // give up after this many errors per destination
|
||||
|
||||
// a flood of log messages can make the UI unresponsive so we'll introduce a dynamic sleep period based on log frequency (values in [us])
|
||||
@@ -34,10 +38,6 @@
|
||||
#define PAUSE_MINTM 100UL
|
||||
#define PAUSE_MAXTM 75000UL
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(5, 5, 0))
|
||||
#define QtInfoMsg QtMsgType(4)
|
||||
#endif
|
||||
|
||||
#define PRINT_CREATE(str) emitProgressMessage((str), QtInfoMsg)
|
||||
#define PRINT_REPLACE(str) emitProgressMessage((str), QtWarningMsg)
|
||||
//#define PRINT_DELETE(str) emitProgressMessage((str), QtCriticalMsg) // unused
|
||||
@@ -46,13 +46,6 @@
|
||||
#define PRINT_INFO(str) emit progressMessage((str)) // this is always emitted regardless of logLevel option
|
||||
#define PRINT_SEP() PRINT_INFO(QString(70, '='))
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
|
||||
#define FILTER_RE_SYNTX QRegExp::Wildcard
|
||||
#else
|
||||
#define FILTER_RE_SYNTX QRegExp::WildcardUnix
|
||||
#endif
|
||||
|
||||
SyncProcess::SyncProcess(const SyncProcess::SyncOptions & options) :
|
||||
m_options(options),
|
||||
m_pauseTime(PAUSE_MINTM),
|
||||
@@ -60,6 +53,10 @@ SyncProcess::SyncProcess(const SyncProcess::SyncOptions & options) :
|
||||
{
|
||||
qRegisterMetaType<SyncProcess::SyncStatus>();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
QNtfsPermissionCheckGuard permissionGuard; // check is enabled
|
||||
#endif
|
||||
|
||||
if (m_options.compareType == OVERWR_ALWAYS && (m_options.direction == SYNC_A2B_B2A || m_options.direction == SYNC_B2A_A2B))
|
||||
m_options.compareType = OVERWR_IF_DIFF;
|
||||
|
||||
@@ -72,23 +69,18 @@ SyncProcess::SyncProcess(const SyncProcess::SyncOptions & options) :
|
||||
|
||||
if (!m_options.excludeFilter.isEmpty()) {
|
||||
for (const QString & f : m_options.excludeFilter.split(',', Qt::SkipEmptyParts))
|
||||
m_excludeFilters.append(QRegExp(f, ((m_dirFilters & QDir::CaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive), FILTER_RE_SYNTX));
|
||||
m_excludeFilters.append(QRegularExpression(QRegularExpression::wildcardToRegularExpression(f),
|
||||
((m_dirFilters & QDir::CaseSensitive) ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption)));
|
||||
}
|
||||
|
||||
if (m_options.flags & OPT_DRY_RUN)
|
||||
testRunStr = tr("[TEST RUN] ");
|
||||
|
||||
//qDebug() << m_options;
|
||||
#ifdef Q_OS_WIN
|
||||
qt_ntfs_permission_lookup++; // global enable NTFS permissions checking
|
||||
#endif
|
||||
}
|
||||
} // for Q_OS_WIN as the permissionGuard goes out of scope the check is disabled
|
||||
|
||||
SyncProcess::~SyncProcess()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
qt_ntfs_permission_lookup--; // global revert NTFS permissions checking
|
||||
#endif
|
||||
}
|
||||
|
||||
void SyncProcess::stop()
|
||||
@@ -193,8 +185,8 @@ SyncProcess::FileFilterResult SyncProcess::fileFilter(const QFileInfo & fileInfo
|
||||
return FILE_OVERSIZE;
|
||||
|
||||
if (!m_excludeFilters.isEmpty() && (!(m_dirFilters & QDir::AllDirs) || fileInfo.isFile())) {
|
||||
for (QVector<QRegExp>::const_iterator it = m_excludeFilters.constBegin(), end = m_excludeFilters.constEnd(); it != end; ++it) {
|
||||
if (QRegExp(*it).exactMatch(fileInfo.fileName()))
|
||||
for (QVector<QRegularExpression>::const_iterator it = m_excludeFilters.constBegin(), end = m_excludeFilters.constEnd(); it != end; ++it) {
|
||||
if (QRegularExpression(*it).match(fileInfo.fileName()).hasMatch())
|
||||
return FILE_EXCLUDE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user