Skip to content

Commit 5ec072d

Browse files
authored
Merge branch 'master' into bugfix/pauseSync
2 parents 3b80874 + f1bfc1a commit 5ec072d

32 files changed

Lines changed: 1029 additions & 1309 deletions

resources.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
<file>src/gui/wizard/qml/AccountWizardWindow.qml</file>
6464
<file>src/gui/wizard/qml/AdvancedOptionsDialog.qml</file>
6565
<file>src/gui/wizard/qml/BasicAuthPage.qml</file>
66+
<file>src/gui/wizard/qml/BrowserAuthFooter.qml</file>
6667
<file>src/gui/wizard/qml/BrowserAuthPage.qml</file>
68+
<file>src/gui/wizard/qml/BrowserReAuthWindow.qml</file>
6769
<file>src/gui/wizard/qml/ClientCertificateDialog.qml</file>
6870
<file>src/gui/wizard/qml/OptionRow.qml</file>
6971
<file>src/gui/wizard/qml/ProxySettingsDialog.qml</file>

src/3rdparty/QProgressIndicator/QProgressIndicator.cpp

Lines changed: 0 additions & 116 deletions
This file was deleted.

src/3rdparty/QProgressIndicator/QProgressIndicator.h

Lines changed: 0 additions & 92 deletions
This file was deleted.

src/3rdparty/QProgressIndicator/README.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/common/filesystembase.cpp

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,14 @@ Utility::Handle lockFile(const QString &fileName, FileSystem::LockMode mode)
698698
DWORD attr = GetFileAttributesW(reinterpret_cast<const wchar_t *>(fName.utf16()));
699699
if (attr != INVALID_FILE_ATTRIBUTES) {
700700
// Try to open the file with as much access as possible..
701-
auto out = Utility::Handle{CreateFileW(reinterpret_cast<const wchar_t *>(fName.utf16()), accessMode, shareMode, nullptr, OPEN_EXISTING,
702-
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, nullptr)};
701+
const auto createFileResult = CreateFileW(reinterpret_cast<const wchar_t *>(fName.utf16()), accessMode, shareMode, nullptr, OPEN_EXISTING,
702+
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, nullptr);
703+
704+
if (createFileResult == INVALID_HANDLE_VALUE) {
705+
return {};
706+
}
707+
708+
auto out = Utility::Handle{createFileResult};
703709

704710
if (out) {
705711
if (attr & FILE_ATTRIBUTE_DIRECTORY) {
@@ -713,9 +719,6 @@ Utility::Handle lockFile(const QString &fileName, FileSystem::LockMode mode)
713719
LARGE_INTEGER end;
714720
end.QuadPart = -1;
715721
if (LockFile(out.handle(), start.LowPart, start.HighPart, end.LowPart, end.HighPart)) {
716-
// Lock acquired -> release it immediately
717-
// just closing a file handle does not immediately release the lock leading to system instability
718-
UnlockFile(out.handle(), start.LowPart, start.HighPart, end.LowPart, end.HighPart);
719722
return out;
720723
} else {
721724
return {};
@@ -733,11 +736,26 @@ bool FileSystem::isFileLocked(const QString &fileName, LockMode mode)
733736
{
734737
#ifdef Q_OS_WIN
735738
const auto handle = lockFile(fileName, mode);
736-
if (!handle) {
739+
if (handle) {
740+
// Lock acquired -> release it immediately
741+
// just closing a file handle does not immediately release the lock leading to system instability
742+
743+
LARGE_INTEGER start;
744+
start.QuadPart = 0;
745+
LARGE_INTEGER end;
746+
end.QuadPart = -1;
747+
if (!UnlockFile(handle, start.LowPart, start.HighPart, end.LowPart, end.HighPart)) {
748+
const auto error = GetLastError();
749+
qCWarning(lcFileSystem()) << "unlock file" << fileName << mode;
750+
qCWarning(lcFileSystem()) << Q_FUNC_INFO << Utility::formatWinError(error) << fileName;
751+
}
752+
} else {
737753
const auto error = GetLastError();
754+
738755
if (error == ERROR_SHARING_VIOLATION || error == ERROR_LOCK_VIOLATION) {
739756
return true;
740-
} else if (error != ERROR_FILE_NOT_FOUND && error != ERROR_PATH_NOT_FOUND) {
757+
} else {
758+
qCWarning(lcFileSystem()) << "lock file" << fileName << mode;
741759
qCWarning(lcFileSystem()) << Q_FUNC_INFO << Utility::formatWinError(error) << fileName;
742760
}
743761
}

src/gui/CMakeLists.txt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ set(client_UI_SRCS
5353
proxyauthdialog.ui
5454
mnemonicdialog.ui
5555
vfsdownloaderrordialog.ui
56-
wizard/flow2authwidget.ui
5756
)
5857

5958
qt_add_resources(client_UI_SRCS ../../resources.qrc ${CMAKE_SOURCE_DIR}/theme.qrc)
@@ -259,16 +258,12 @@ set(client_SRCS
259258
creds/flow2auth.cpp
260259
creds/webflowcredentials.h
261260
creds/webflowcredentials.cpp
262-
creds/webflowcredentialsdialog.h
263-
creds/webflowcredentialsdialog.cpp
264261
wizard/accountwizardcontroller.h
265262
wizard/accountwizardcontroller.cpp
266-
wizard/flow2authwidget.h
267-
wizard/flow2authwidget.cpp
268-
wizard/providersignuppage.h
269-
wizard/providersignuppage.cpp
270-
wizard/linklabel.h
271-
wizard/linklabel.cpp
263+
wizard/browserreauthcontroller.h
264+
wizard/browserreauthcontroller.cpp
265+
wizard/browserreauthwindow.h
266+
wizard/browserreauthwindow.cpp
272267
integration/fileactionsmodel.h
273268
integration/fileactionsmodel.cpp
274269
)
@@ -424,8 +419,6 @@ IF( APPLE )
424419
ENDIF()
425420

426421
set(3rdparty_SRC
427-
../3rdparty/QProgressIndicator/QProgressIndicator.h
428-
../3rdparty/QProgressIndicator/QProgressIndicator.cpp
429422
../3rdparty/kmessagewidget/kmessagewidget.h
430423
../3rdparty/kmessagewidget/kmessagewidget.cpp
431424
../3rdparty/kirigami/wheelhandler.h
@@ -625,7 +618,6 @@ set_target_properties(nextcloudCore
625618

626619
target_include_directories(nextcloudCore
627620
PUBLIC
628-
${CMAKE_SOURCE_DIR}/src/3rdparty/QProgressIndicator
629621
${CMAKE_SOURCE_DIR}/src/3rdparty/kirigami
630622
${CMAKE_SOURCE_DIR}/src/3rdparty/kmessagewidget
631623
${CMAKE_CURRENT_BINARY_DIR}

src/gui/WizardStyledWindow.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import Style
1111
ApplicationWindow {
1212
id: root
1313

14+
property bool minimizable: false
15+
1416
LayoutMirroring.enabled: Application.layoutDirection === Qt.RightToLeft
1517
LayoutMirroring.childrenInherit: true
1618

@@ -19,6 +21,7 @@ ApplicationWindow {
1921
| Qt.WindowTitleHint
2022
| Qt.WindowSystemMenuHint
2123
| Qt.WindowCloseButtonHint
24+
| (root.minimizable ? Qt.WindowMinimizeButtonHint : 0)
2225
color: Style.wizardWindowBackground
2326
palette.window: Style.wizardWindowBackground
2427
palette.base: Style.wizardFieldBackground

0 commit comments

Comments
 (0)