diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 6425a66d7..b1bd616ca 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -781,7 +781,13 @@ bool TMainWindow::FileSave() return false; } +#ifdef Q_OS_WIN32 + qt_ntfs_permission_lookup++; // turn checking on +#endif /*Q_OS_WIN32*/ const bool isFileWritable = QFileInfo(curFile).isWritable(); +#ifdef Q_OS_WIN32 + qt_ntfs_permission_lookup--; // turn it off again +#endif /*Q_OS_WIN32*/ if (not isFileWritable) { QMessageBox messageBox(this); @@ -3277,7 +3283,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*/ isFileWritable = QFileInfo(curFile).isWritable(); +#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 99c3d1224..506ee380b 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -3221,7 +3221,13 @@ bool MainWindow::on_actionSave_triggered() return false; } +#ifdef Q_OS_WIN32 + qt_ntfs_permission_lookup++; // turn checking on +#endif /*Q_OS_WIN32*/ const bool isFileWritable = QFileInfo(qApp->GetPatternPath()).isWritable(); +#ifdef Q_OS_WIN32 + qt_ntfs_permission_lookup--; // turn it off again +#endif /*Q_OS_WIN32*/ if (not isFileWritable) { QMessageBox messageBox(this); @@ -6177,7 +6183,13 @@ void MainWindow::UpdateWindowTitle() bool isFileWritable = true; if (not qApp->GetPatternPath().isEmpty()) { +#ifdef Q_OS_WIN32 + qt_ntfs_permission_lookup++; // turn checking on +#endif /*Q_OS_WIN32*/ isFileWritable = QFileInfo(qApp->GetPatternPath()).isWritable(); +#ifdef Q_OS_WIN32 + qt_ntfs_permission_lookup--; // turn it off again +#endif /*Q_OS_WIN32*/ } if (not patternReadOnly && isFileWritable) diff --git a/src/app/valentina/watermarkwindow.cpp b/src/app/valentina/watermarkwindow.cpp index 3dbd3d058..f85de0f6f 100644 --- a/src/app/valentina/watermarkwindow.cpp +++ b/src/app/valentina/watermarkwindow.cpp @@ -360,7 +360,13 @@ bool WatermarkWindow::on_actionSave_triggered() return false; } +#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*/ if (not isFileWritable) { QMessageBox messageBox(this); @@ -490,7 +496,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*/ isFileWritable = QFileInfo(m_curFile).isWritable(); +#ifdef Q_OS_WIN32 + qt_ntfs_permission_lookup--; // turn it off again +#endif /*Q_OS_WIN32*/ } if (isFileWritable) diff --git a/src/libs/ifc/xml/vabstractconverter.cpp b/src/libs/ifc/xml/vabstractconverter.cpp index cd3d2c021..293b12bcb 100644 --- a/src/libs/ifc/xml/vabstractconverter.cpp +++ b/src/libs/ifc/xml/vabstractconverter.cpp @@ -166,7 +166,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*/ const bool isFileWritable = info.isWritable(); +#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));