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

Fixes bug #439 #517

Merged
merged 7 commits into from
Apr 2, 2021
Merged

Fixes bug #439 #517

merged 7 commits into from
Apr 2, 2021

Conversation

anubh4v
Copy link
Contributor

@anubh4v anubh4v commented Jan 29, 2021

Issue was with the do while loop in line 123 of fileformatdialog.cpp. Condition was true instead of false.

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

@welcome
Copy link

welcome bot commented Jan 29, 2021

Thanks for opening this pull request! Please check out our contributing guidelines and check for the automated tests.

@anubh4v
Copy link
Contributor Author

anubh4v commented Jan 30, 2021

@cryos please look into this.

@ghutchis
Copy link
Member

I'm not sure I understand. One commit changes a line - and the next commit changes it back?

@anubh4v
Copy link
Contributor Author

anubh4v commented Feb 16, 2021

@ghutchis first commit deletes "while(true)" and the second commit adds "while(false)".

@ghutchis
Copy link
Member

ghutchis commented Apr 1, 2021

Sorry for the delayed review. I think I'd be happier if QString fileName was moved out of the loop and the termination would be:

  } while (fileName.isEmpty());

It's functionally the same, but I think the code would be more readable.

@anubh4v
Copy link
Contributor Author

anubh4v commented Apr 2, 2021

If QString fileName is moved outside the loop then we won't be able to change the format when continue is encountered in the loop. Since you need to change the fileName extension to change the format.

@ghutchis
Copy link
Member

ghutchis commented Apr 2, 2021

I mean something like this:

  QString fileName;
  do { // jump point for continue statements on retry
    fileName = QFileDialog::getSaveFileName(parentWidget, caption, dir, realFilter);

    if (fileName.isEmpty()) // user cancel
      return result;
.. .
  } while (fileName.isEmpty());

@ghutchis
Copy link
Member

ghutchis commented Apr 2, 2021

Thanks - just waiting for Mac / Win builds to complete (which they should)

@ghutchis
Copy link
Member

ghutchis commented Apr 2, 2021

Sorry, one last minor thing before merge - can you sign off on your commits?
(This indicates that these changes are yours.)
https://github.com/OpenChemistry/avogadrolibs/pull/517/checks?check_run_id=2253882029

ghutchis and others added 7 commits April 2, 2021 21:02
Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
Signed-off-by: anubh4v <anubh4v@yandex.com>
Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
Signed-off-by: anubh4v <anubh4v@yandex.com>
Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
Signed-off-by: anubh4v <anubh4v@yandex.com>
Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
Signed-off-by: anubh4v <anubh4v@yandex.com>
Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
Signed-off-by: anubh4v <anubh4v@yandex.com>
The do while loop on line 123 was causing the issue.

Signed-off-by: anubh4v <anubh4v@yandex.com>
Signed-off-by: anubh4v <anubh4v@yandex.com>
@ghutchis ghutchis merged commit 68fb007 into OpenChemistry:master Apr 2, 2021
@welcome
Copy link

welcome bot commented Apr 2, 2021

Congrats on merging your first pull request! 🎉 Thanks for making Avogadro better for everyone!

@ghutchis
Copy link
Member

ghutchis commented Apr 2, 2021

Thanks for the fix and your patience on this one. I have more flexible time to contribute to Avogadro for the next few months, so future pull requests should get merged faster.

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.

2 participants