Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use QFileInfo to check if path is absolute to avoid assert on windows #3068

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

mgallien
Copy link
Collaborator

@mgallien mgallien commented Apr 6, 2021

on windos absolute path does not have to start with / . Remove failing assert
when editing ignored files list.

Signed-off-by: Matthieu Gallien matthieu_gallien@yahoo.fr

@mgallien mgallien linked an issue Apr 6, 2021 that may be closed by this pull request
@mgallien mgallien force-pushed the bug/fixAssertEditIgnoredFiles branch from cdf4dde to 790c2a8 Compare April 6, 2021 15:06
@@ -385,8 +385,10 @@ void AccountSettings::slotEditCurrentLocalIgnoredFiles()

void AccountSettings::openIgnoredFilesDialog(const QString & absFolderPath)
{
Q_ASSERT(absFolderPath.startsWith('/'));
Q_ASSERT(absFolderPath.endsWith('/'));
#if !defined QT_NO_DEBUG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgallien As far as I remember, Q_ASSERT is empty in release build, so, this can be shortened to:
Q_ASSERT(QFileInfo(absFolderPath).isAbsolute())

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, much better now.

@mgallien mgallien force-pushed the bug/fixAssertEditIgnoredFiles branch from 790c2a8 to 4a63a8e Compare April 7, 2021 06:54
@er-vin
Copy link
Member

er-vin commented Apr 7, 2021

/rebase

on windos absolute path does not have to start with / . Remove failing assert
when editing ignored files list.

Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
@github-actions github-actions bot force-pushed the bug/fixAssertEditIgnoredFiles branch from 4a63a8e to d6752c9 Compare April 7, 2021 07:40
@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-3068-d6752c96b1f357f2f92fe14b2d4f97946b0f69b3-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@mgallien mgallien merged commit 4a7145f into master Apr 7, 2021
@mgallien mgallien deleted the bug/fixAssertEditIgnoredFiles branch April 7, 2021 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when opening Edit Ignored files list on Windows
4 participants