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

[utils.cpp] Avoid creating QSettings too early #65

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

llewelld
Copy link
Contributor

@llewelld llewelld commented Feb 21, 2024

If the QSettings are initialised statically they may fail to pick up the organization and application names set in main. The result is that the settings are written to and read from both
~/.config/Unknown\Organization.conf and
~/.config/sailfishos-applications/flowplayer.conf.

This can prevent the configured Music directories being read from successfully.

Fixes #64.

If the QSettings are initialised statically they may fail to pick up the
organization and application names set in main. The result is that the
settings are written to and read from both
"~/.config/Unknown\Organization.conf" and
"~/.config/sailfishos-applications/flowplayer.conf".

This can prevent the configured Music directories being read from
successfully.
@llewelld
Copy link
Contributor Author

This PR is primarily to demonstrate the problem and test a fix; I can appreciate you may prefer a better solution that doesn't create the QSettings object every time. According to the docs this is okay ("Constructing and destroying a QSettings object is very fast"), but perhaps isn't the most elegant approach.

@dcaliste
Copy link
Collaborator

Thanks for the patch. We can still move to a singleton object later if needed.

@Olf0 Olf0 requested a review from dcaliste February 21, 2024 22:21
@Olf0 Olf0 assigned llewelld and unassigned llewelld Feb 21, 2024
Copy link
Collaborator

@dcaliste dcaliste left a comment

Choose a reason for hiding this comment

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

Looks good to me. As mentioned ,we can address speed issue later ,if any. I approve but cannot check the box with Sailfish browser !

@Olf0 Olf0 merged commit eccc980 into sailfishos-applications:devel Feb 24, 2024
1 check passed
@Olf0
Copy link
Contributor

Olf0 commented Feb 27, 2024

Also fixes issue #63.

Olf0 added a commit that referenced this pull request Feb 27, 2024
Olf0 added a commit that referenced this pull request Feb 27, 2024
* [flowplayer.spec] Post-release version increase

* [flowplayer.changes] Add stub for v0.3.4

* [flowplayer.changes] Add closure of issue #63 by #65
Olf0 added a commit that referenced this pull request Mar 14, 2024
* Post-release version increase (#71)

* [flowplayer.spec] Post-release version increase

* [flowplayer.changes] Add stub for v0.3.4

* [flowplayer.changes] Add closure of issue #63 by #65

* Try and implement Opus (#67)

* Add Ruben de Smet (rubdos) as contributor (#73)

* [flowplayer.spec] Add Ruben de Smet (rubdos)

* [README.md] Add Ruben de Smet (rubdos)

* [AboutPage.qml] Add Ruben de Smet (rubdos)

* [LICENSE.txt] Add Ruben de Smet (rubdos)

* Add Mark Washeim (poetaster) to contributors (#81)

* [README.md] Add Mark Washeim (poetaster) to contributors

* [AboutPage.qml] Add Mark Washeim (poetaster) to contributors

* [LICENSE.txt] Add Mark Washeim (poetaster) to contributors

* [flowplayer.spec] Add poetaster to developers list

* [flowplayer.changes] Update for release of v0.3.4

* [Feature] Add local cover art when importing tracks (#75)

* [Feature] add initial addition for cover art if a jpg is found in the directory as tracks are added to the db. also, correct old Generic paths, and test with sailjail.

* PR: feedback integrated: 1. alternate logic for applying folder/cover image copy, basename check. 2. remove media indexing sailjail perms, 3. move cache dir creation from migrate to main

* [FlowPlayer.cpp] Improve style as suggested by @dcaliste

* [datareader.cpp] Improve style as suggested by @dcaliste

* [flowplayer.desktop] Omit SailJail sandboxing configuration for now

* [datareader.cpp] Improve style as suggested by @dcaliste

* Review: remove png processing

* Update datareader.cpp
  remove unused QImage and png matching.

* Fix:logic of the || on png

* [datareader.cpp] Indention, no `jpg` & `png` for now, iterator reuse
  Addresses comments dispersed over PR #75's lengthy discussion.

* [datareader.cpp] Rectify comment

* [datareader.cpp] Improve comments & break long code line in two

* [datareader.cpp] Break two more long lines in two

* [datareader.cpp] Remove superfluous backslashes "\"

* [datareader.cpp] Omit superfluous space character " "

* [datareader.cpp] Extend comment

* Don't recurse in subdirs when looking for covers.

* [datareader.cpp] Insert comment and align with current TS files

---------

Co-authored-by: olf <[email protected]>
Co-authored-by: Damien Caliste <[email protected]>

* Translate translations/flowplayer.ts in de (#82)

100% translated source file: 'translations/flowplayer.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>

* Translate translations/flowplayer.ts in sv (#83)

100% translated source file: 'translations/flowplayer.ts'
on 'sv'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Ruben De Smet <[email protected]>
Co-authored-by: Mark Washeim <[email protected]>
Co-authored-by: Damien Caliste <[email protected]>
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
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.

[Bug] Configured music directories are not scanned
3 participants