Commit graph

14 commits

Author SHA1 Message Date
ws
33d1cd7fb4 rename StyleIdx -> Sid and P_ID -> Pid 2018-03-27 15:36:00 +02:00
Dag Henning Liodden Sørbø
2b6cb8b432 Change to new preferences model
The old Preferences struct holding all preferences are removed in favor of a
new Preferences class which acts as a proxy for QSettings. The settings stored
in QSettings are accessed directly through access methods like getBool(key),
getInt(key), etc. and changed with setPreference(key, value).

Since we are using QSettings directly the preferences are stored automatically
without the need for a custom write() and read() method like before.

The preferences.cpp/.h and prefdialog.cpp/h are refactored to have fewer
responsibilities than before. The Preferences class are all about storing and
retrieving preferences - it should not contain any code to handle any other
aspect of MuseScore.

Testing:
The Preferences class can be used in tests. All preferences are initialized with
default values in mtest. If a test requires that a preference has a specific
value it can be changed using setPreference() for that single test. In the tests
the preferences are stored in memory only.

The Preference class is supposed to be used as a singleton. In preferences.h an
'extern Preferences preferences' is set and it is defined in preferences.cpp. All
files which includes preferences.h have access to the 'preferences' singleton
and should use this to get and set preferences.
2018-02-08 16:59:10 +01:00
Johan Temmerman
beda9d2ee6 fix #248316 Disable autocompletion of zoom percentage field 2018-01-02 23:09:59 +01:00
Werner Schweer
9a9dedf774 change PageFormat to simple style values 2017-01-23 21:53:51 +01:00
lasconic
f5d98bb0b5 experiment with Fusion Theme to replace Oxygen 2016-09-29 22:27:31 +02:00
Eric Fontaine
7aa8c7e6cd fix #96971 suppress benign make release warnings
This commit removes some -Wempty-body, -Wmaybe-uninitialized, -Wunused-variable, and -Wstrict-overflow compiler warnings that arise on my x86-64 and ARM arch linux machines when compiling release.
These compiler warnings don't seem to cause any bugs, but since they pollute the build output, they make it harder to spot potentially important warnings that might arise, so I'm making these small changes to keep the build output clean.
The "empty-body" warnings occur because the Q_ASSERT statements are removed for release compiles, causing the else blocks to be empty.  Surrounding the Q_ASSERT with brackets will let the compiler know we aren't unintentionally having an empty else body.
The "maybe-uninitialized" warnings are handled by assigning the variables to 0 either at initialization or in a switch default block.
The "unused-variable" warning is due to PeriodItem updatePeriods[] in preferences.cpp being defined but never used, so I've removed PeriodItem.  Also a recent commit has an unused "int staves", which I've removed.
The "strict-overflow" warning is due to compiler wanting to perform an optimization which would cause signed overflow during a comparison operation.  I've made the compiler happy by casting the barIndex'es into unsigned ints, so it doesn't have to worry.
2016-02-12 01:28:16 -05:00
lasconic
a2caf8c5cd fix #95356: Vertical orientation: 'Two page' zoom only displays one page 2016-01-29 16:06:49 +04:00
ws
b45c2fc89f fix mag combobox & initial scaling 2015-11-23 16:02:33 +01:00
ws
d76e51d276 fix some scaling regressions 2015-11-18 18:09:59 +01:00
ws
d8e4373435 make DPI=72 constant 2015-11-16 14:24:47 +01:00
ws
1f6e959af2 updates for local help and build system 2015-02-06 20:38:27 +01:00
Joachim Schmitz
23733a240c turn unnamed enum into enum class MagIdx 2014-07-15 14:14:47 +02:00
ws
9ebabcc2e5 add namespace Ms 2013-05-13 19:43:59 +02:00
Werner Schweer
412ca45401 Initial commit 2012-05-26 14:49:10 +02:00