From 191cf7e25f36b3537fccd67b2651a0f058ae9164 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 17 Mar 2022 13:35:49 +0200 Subject: [PATCH] Suspend use of qt_ntfs_permission_lookup. QTBUG-101168 --- ChangeLog.txt | 1 + src/app/puzzle/vpmainwindow.cpp | 12 +++---- src/app/tape/tmainwindow.cpp | 12 +++---- src/app/valentina/mainwindow.cpp | 12 +++---- src/libs/ifc/ifcdef.h | 2 +- src/libs/ifc/xml/vabstractconverter.cpp | 12 +++---- src/libs/ifc/xml/vdomdocument.cpp | 12 +++---- src/libs/vlayout/dialogs/watermarkwindow.cpp | 36 ++++++++++---------- src/libs/vwidgets/vabstractmainwindow.cpp | 30 ++++++++-------- 9 files changed, 65 insertions(+), 64 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 0a2737930..1b8405e03 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -4,6 +4,7 @@ - Fix issue with tile font size. - [smart-pattern/valentina#171] System identifies two of the same curve. - [smart-pattern/valentina#170] Incorrect work with curves. +- Suspend use of qt_ntfs_permission_lookup. QTBUG-101168 # Valentina 0.7.50 February 14, 2022 - Fix regression. Minimal seam allowance width is less than the point accuracy values. diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp index 436fbea9f..fc2627055 100644 --- a/src/app/puzzle/vpmainwindow.cpp +++ b/src/app/puzzle/vpmainwindow.cpp @@ -1864,15 +1864,15 @@ auto VPMainWindow::IsLayoutReadOnly() const -> bool return false; } -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup++; // turn checking on -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup++; // turn checking on +//#endif /*Q_OS_WIN32*/ bool fileWritable = f.isWritable(); -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup--; // turn it off again -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup--; // turn it off again +//#endif /*Q_OS_WIN32*/ return not fileWritable; } diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 2d8288361..32c81ac6f 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -3383,13 +3383,13 @@ void TMainWindow::UpdateWindowTitle() bool isFileWritable = true; if (not curFile.isEmpty()) { -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup++; // turn checking on -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup++; // turn checking on +//#endif /*Q_OS_WIN32*/ isFileWritable = QFileInfo(curFile).isWritable(); -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup--; // turn it off again -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup--; // turn it off again +//#endif /*Q_OS_WIN32*/ showName = StrippedName(curFile); } else diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 89fcb029c..89fdff68a 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -6809,13 +6809,13 @@ void MainWindow::UpdateWindowTitle() bool isFileWritable = true; if (not VAbstractValApplication::VApp()->GetPatternPath().isEmpty()) { -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup++; // turn checking on -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup++; // turn checking on +//#endif /*Q_OS_WIN32*/ isFileWritable = QFileInfo(VAbstractValApplication::VApp()->GetPatternPath()).isWritable(); -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup--; // turn it off again -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup--; // turn it off again +//#endif /*Q_OS_WIN32*/ } if (not patternReadOnly && isFileWritable) diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 4f3ffdbfa..c6a55808a 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -31,7 +31,7 @@ #include #ifdef Q_OS_WIN - extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; +// extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; # include #endif /*Q_OS_WIN*/ diff --git a/src/libs/ifc/xml/vabstractconverter.cpp b/src/libs/ifc/xml/vabstractconverter.cpp index b6cea05e4..6b4ca89cc 100644 --- a/src/libs/ifc/xml/vabstractconverter.cpp +++ b/src/libs/ifc/xml/vabstractconverter.cpp @@ -162,13 +162,13 @@ void VAbstractConverter::ReserveFile() const .arg(info.absoluteDir().absolutePath(), info.baseName(), GetFormatVersionStr(), info.completeSuffix()); if (not SafeCopy(m_convertedFileName, reserveFileName, error)) { -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup++; // turn checking on -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup++; // turn checking on +//#endif /*Q_OS_WIN32*/ const bool isFileWritable = info.isWritable(); -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup--; // turn it off again -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup--; // turn it off again +//#endif /*Q_OS_WIN32*/ if (not IsReadOnly() && isFileWritable) { const QString errorMsg(tr("Error creating a reserv copy: %1.").arg(error)); diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index 6beeadf86..0757bd4ff 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -986,9 +986,9 @@ bool VDomDocument::SafeCopy(const QString &source, const QString &destination, Q { bool result = false; -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup++; // turn checking on -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup++; // turn checking on +//#endif /*Q_OS_WIN32*/ QTemporaryFile destFile(destination + QLatin1String(".XXXXXX")); destFile.setAutoRemove(false);// Will be renamed to be destination file @@ -1042,9 +1042,9 @@ bool VDomDocument::SafeCopy(const QString &source, const QString &destination, Q } } -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup--; // turn off check permission again -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup--; // turn off check permission again +//#endif /*Q_OS_WIN32*/ return result; } diff --git a/src/libs/vlayout/dialogs/watermarkwindow.cpp b/src/libs/vlayout/dialogs/watermarkwindow.cpp index fcd1525ac..62814f05b 100644 --- a/src/libs/vlayout/dialogs/watermarkwindow.cpp +++ b/src/libs/vlayout/dialogs/watermarkwindow.cpp @@ -387,13 +387,13 @@ bool WatermarkWindow::on_actionSave_triggered() return false; } -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup++; // turn checking on -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup++; // turn checking on +//#endif /*Q_OS_WIN32*/ const bool isFileWritable = QFileInfo(m_curFile).isWritable(); -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup--; // turn it off again -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup--; // turn it off again +//#endif /*Q_OS_WIN32*/ if (not isFileWritable) { QMessageBox messageBox(this); @@ -405,14 +405,14 @@ bool WatermarkWindow::on_actionSave_triggered() if (messageBox.exec() == QMessageBox::Yes) { -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup++; // turn checking on -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup++; // turn checking on +//#endif /*Q_OS_WIN32*/ bool changed = QFile::setPermissions(m_curFile, QFileInfo(m_curFile).permissions() | QFileDevice::WriteUser); -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup--; // turn it off again -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup--; // turn it off again +//#endif /*Q_OS_WIN32*/ if (not changed) { @@ -523,13 +523,13 @@ void WatermarkWindow::UpdateWindowTitle() bool isFileWritable = true; if (not m_curFile.isEmpty()) { -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup++; // turn checking on -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup++; // turn checking on +//#endif /*Q_OS_WIN32*/ isFileWritable = QFileInfo(m_curFile).isWritable(); -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup--; // turn it off again -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup--; // turn it off again +//#endif /*Q_OS_WIN32*/ } if (isFileWritable) diff --git a/src/libs/vwidgets/vabstractmainwindow.cpp b/src/libs/vwidgets/vabstractmainwindow.cpp index fc511c7f9..c4f9bfaf9 100644 --- a/src/libs/vwidgets/vabstractmainwindow.cpp +++ b/src/libs/vwidgets/vabstractmainwindow.cpp @@ -42,9 +42,9 @@ #include #include -#ifdef Q_OS_WIN -extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; -#endif /*Q_OS_WIN*/ +//#ifdef Q_OS_WIN +//extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; +//#endif /*Q_OS_WIN*/ #if defined(Q_OS_MAC) #include @@ -259,9 +259,9 @@ auto VAbstractMainWindow::CheckFilePermissions(const QString &path, QWidget *mes { QFileInfo info(path); -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup++; // turn checking on -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup++; // turn checking on +//#endif /*Q_OS_WIN32*/ if (not info.exists()) { @@ -271,9 +271,9 @@ auto VAbstractMainWindow::CheckFilePermissions(const QString &path, QWidget *mes // cppcheck-suppress unreadVariable const bool isFileWritable = info.isWritable(); -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup--; // turn it off again -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup--; // turn it off again +//#endif /*Q_OS_WIN32*/ if (not isFileWritable) { @@ -286,13 +286,13 @@ auto VAbstractMainWindow::CheckFilePermissions(const QString &path, QWidget *mes if (messageBox.exec() == QMessageBox::Yes) { -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup++; // turn checking on -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup++; // turn checking on +//#endif /*Q_OS_WIN32*/ bool changed = QFile::setPermissions(path, QFileInfo(path).permissions() | QFileDevice::WriteUser); -#ifdef Q_OS_WIN32 - qt_ntfs_permission_lookup--; // turn it off again -#endif /*Q_OS_WIN32*/ +//#ifdef Q_OS_WIN32 +// qt_ntfs_permission_lookup--; // turn it off again +//#endif /*Q_OS_WIN32*/ if (not changed) {