Commit graph

54 commits

Author SHA1 Message Date
Dmitri Ovodok
f42943e90b fix #278722: do not delete spanner segments but reuse them 2018-11-26 01:59:02 +02:00
mirabilos
65cd276439
remove RCS IDs from (almost) all files
they do not make any sense, nor do they get updated, if the
source code is kept in git
2018-11-02 23:53:21 +01:00
Joachim Schmitz
1923dd668a fix compiler warnings and a build issue with MinGW 2018-10-31 15:12:11 +01:00
Dmitri Ovodok
d5a391f0a7 Undefine DELETE macro defined in Windows headers 2018-10-29 18:28:25 +02:00
anatoly-os
c86314d42e
Merge pull request #3545 from dmitrio95/bugfix/score_browser_single_click_crash
Fix a crash in ScoreBrowser on systems with single-click items activation turned on
2018-10-26 21:05:48 +02:00
alexandr
df114f189c Compile under MSVC: this commit caontais all changes to run MSVC build
1) fix some bugs which appear in runtime:  replace QString::tostdstring() to Foo.toUtf8().constData().

2) Enable start center online community. To use it you need download webengine in your QT lib. see instruction https://musescore.org/en/handbook/developers-handbook/compilation/compile-instructions-windows-visual-studio-2017-wip

3) update install steps. Add additional dlls for webEngine. Add copying dlls and musescore.exe to /msvc.install/bin folder. Run project will work with the "$(ProjectDir)\..\..\msvc.install\bin\MuseScore.exe" specified in Debugging field in mscore project

4) Moving AppVeyor from MinGW to MSVC. Exclude ALL MSVC project from INSTALL project. Exclude ALL from PACKAGE. Remove migw-cmake in script build, add .bat instead. Remove xcopy from 7z archive step

5) Fix warning : Warning C4703 potentially uninitialized local pointer variable '' used; Warning C4456 declaration of '' hides previous local declaration; Warning C4458 declaration of '' hides class member

6) Change path to 11 version wix toolset which created .msi installer package
2018-08-04 12:17:31 +02:00
Andres Fernandez de Prado
33dff96a20 This commit contains changes required for MuseScore to compile under MSVC with no warnings.
This commit contains changes required for MuseScore to compile under MSVC with no warnings.

MuseScore is being compiled with the /W4 setting (warning level 4), which is similar to -wall -wextra on clang. This generates lots of warnings on MSVC, mainly for non-standard constructs and for constructs which might be bugs or might lead to bugs.

Most warnings are in the following categories:
- Name hiding: a variable hides a variable with the same name on a larger scope (or a field, or a function parameter). This can easily lead to bugs, and it is a best practice to avoid hiding variable names (see recommendation ES.12 in the C++ Core Guidelines by Stroustrop & Sutter (http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-reuse : ES.12: Do not reuse names in nested scopes)
- Narrowing conversion: a numeric conversion results in loss of significant digits (for example, double -> float). The general recommendation is to use a cast to indicate this is designed behaviour.
- Unreachable code: in several instances, there is unreachable code. The unreachable code is commented out.
- (Potentially) uninitialized local variable. Just initialized the vars.
- foreach(,) -> for(:): this does not generate a warning per-se (only a few of these generate warnings due to name hiding), but changed in keeping with "MuseScore Coding Rules" (https://musescore.org/en/handbook/musescore-coding-rules#Loops), which tells explicitly "Use C++11's "for" instead of Qt's "foreach":" ... "If you happen to be fixing some code and see a "foreach", please change that loop into a "for"."

Most changes are in the categories indicated above. The next listing shows detailed changes for files which are *not* of the aforementioned types.

- all.h: Disable warning C4127 (conditional expression is constant - generated in Qt header file qvector.h)
- awl/aslider.h: unreachable code.
- awl/knob.cpp: name hiding
- awl/mslider.cpp: name hiding
- awl/slider.cpp: name hiding
- bww2mxml/parser.cpp: name hiding
- effects/compressor/compressor.cpp: narrowing conversion
- effects/zita1/zitagui.cpp: name hiding
- fluid/fluid.cpp: foreach replacement. Name hiding.
- fluid/mod.cpp: name hiding.
- fluid/sfont.cpp: foreach replacement. Name hiding. Initialize vars.
- fluid/voice.cpp: Name hiding.
- libmscore/accidental.cpp: Name hiding.
- libmscore/ambitus.cpp: Initialize vars.
- libmscore/barline.cpp: Name hiding. Unreachable code.
- libmscore/beam.cpp: Name hiding.
- libmscore/chordrest.cpp: Unreachable code.
- libmscore/scorefile.cpp: Name hiding.
- manual/genManual.cpp: Name hiding. foreach replacement.
- midi/midifile.cpp: Name hiding. Unreachable code.
- omr/importpdf.cpp: Name hiding. foreach replacement.
- omr/omr.cpp: Name hiding. foreach replacement.
- omr/omrpage.cpp: Name hiding. foreach replacement.
- omr/omrview.cpp: Name hiding. foreach replacement.
- synthesizer/event.cpp: Unreachable code.
- zerberus\channel.cpp: Narrowing conversion.
- zerberus\instrument.cpp: Name hiding.
- zerberus\sfz.cpp: Name hiding.
- zerberus\voice.h: Suppress warning C4201: "nonstandard extension used: nameless struct/union"
- zerberus\zerberus.cpp: Name hiding. Unreferenced parameter.
- zerberus\zerberusgui.cpp: Name hiding.
2018-08-03 09:15:42 +02:00
Andres Fernandez de Prado
3acc363498 Solved all compilation errors on MSVC
This commit contains changes required for MuseScore to compile under MSVC with no errors.

There are several general categories of problems that resulted in errors with the compilation. Main issues:
- Variable Length Arrays (VLA). This is a non-standard extension to C++, supported by clang toolchains, but not by MSVC. The initial workaround is to use std::vector<> instead of VLAs, eventually (if needed) with the original variable pointing to the beginning of the allocated array. More efficient alternatives are possible if profiling shows any code using VLAs to be timing-critical.
- Floating-point constants not suffixed with "f" are doubles by default; in some instances, this leads to narrowing conversion errors (in other instances, just warnings).
- MSVC does not support "or"/"and"/"not" in lieu of "||"/"&&"/"!". Changed unconditionally to use standard C++ symbols.
- MSVC does not support the "__builtin_unreachable()" compiler hint. A similar, albeit not exactly equal, alternative is "__assume(0)", which is MSVC-specific.
- MSVC does not support ranges in case statements. Replaced with list of cases instead of range (non-conditionally)

Detailed changes, with per-file comments:

- all.h: opt-in to deprecated features, include <io.h> and <process.h> instead of POSIX <unistd.h>, undefine "STRING_NONE" and "small", which Microsoft defines as macros, which result in compilation errors.
- effects/compressor/zita.cpp: eliminated narrowing conversion error by appending "f" to float constants.
- fluid/voice.cpp: appended "f" to float constants to eliminate narrowing conversion errors/warnings
- libmscore/beam.cpp: conditionally replaced VLA
- libmscore/edit.cpp: conditionally replaced VLA
- libmscore/element.cpp: appended "f" to float constant
- libmscore/fret.cpp: changed or -> ||
- libmscore/layout.cpp: conditionally replaced VLA
- libmscore/mscore.cpp: conditionally replaced "__builtin_unreachable()" with "__assume(0)" for MSVC
- libmscore/scorefile.coo: use correct char representation conversion for MSVC
- libmscore/stringdata.cpp: conditionally replaced VLA
- libmscore/system.cpp: conditionally replaced VLA
- libmscroe/text.cpp: replaced range in case statement.
- manual/genManual.cpp: use getopt() replacement.
- midi/midifile.cpp: conditionally replaced VLA. This does not use the default replacement.
- mscore/bb.cpp: replaced range in case statement.
- mscore/capella.cpp: conditionally replaced VLA. Changed and -> &&
- mscore/driver:cpp: preclude errors due to macro redefinitions.
- mscore/editstyle.cpp: conditionally replaced "__builtin_unreachable()" with "__assume(0)" for MSVC
- mscore/importgtp-gp6.cpp: conditionally replaced VLA.
- mscore/instrwidget.cpp: conditionally replaced VLA.
- mscore/jackaudio.cpp: conditionally replaced VLA. Preclude errors due to macro redefinitions.
- mscore/jackweakapi.cpp: Preclude errors due to macro redefinitions. Replacement for __atribute__((constructor)) through static object construction for MSVC. Force use of LoadLibraryA instead of LoadLibrary.
- mscore/mididriver.h: Changed not -> !
- mscore/musescore.cpp: Changed not -> !. Conditionally replaced VLA.
- mscore/resourceManager.cpp: conditionally replaced VLA.
- mscore/timeline.cpp: conditionally replaced VLA.
- omr/omrpage.cpp: conditionally replaced VLA.
- synthesizer/msynthesizer.cpp: replaced UNIX sleep(1) method with MSVC Sleep(1000) (equivalent, but in ms instead of seconds)
- synthesizer/msynthsizer.h: appended "f" to float constant
- thirdparty/poppler/config.h: set defines for MSVC to preclude the use of inexistent libraries.
- thirdparty/poppler/poppler/poppler-config.h: set defines for MSVC to preclude the use of inexistent libraries. Eliminated #defines for fmin and fmax which where causing problems.
- thirdparty/poppler/poppler/PSOutputDev.cc: added #include <algorithm> for  std::min() and std::max(). Note this is required per-C++ standard.
- thirdparty/portmidi/pm_win/pmwinmm.c: undefined UNICODE to use char-based library functions.
- thirdparty/qzip/qzip.cpp: changed or -> ||
- thirdparty/rtf2html/rtf_keyword.h: file format changed from Apple to UNIX, as MSVC does not supported the former.

(NOT error related, just improvement on previous commit; manual/getopt/README.md: added link to source article)
2018-08-03 09:15:42 +02:00
lasconic
d10e70415c added missing #include <QButtonGroup> required by qt >= 5.11 2018-06-05 22:32:39 +02:00
Dag Henning Liodden Sørbø
064156c267 Adds an advanced preferences tab to prefsdialog
Adds logic and GUI to handle preferences without adding a separate widget to
prefsdialog. Changes within the application because of a preferences change still
needs to be handled separately in other parts of the code.

When adding a preferences there is the option whether to have the preference in
the advanced list or not. If not a separate widget must be added to prefsdialog.

Note: Enums are currently not supported (as there are no enums in the advanced
list as of now, but can be easily added.
2018-05-30 15:21:05 +02:00
Dmitri Ovodok
b1a0c21c16 Fix a crash in ScoreBrowser on systems with single-click items activation turned on 2018-03-16 01:12:05 +03: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
Werner Schweer
45c2d9136a guitar pro import update; add power tab import 2017-11-16 10:59:35 +01:00
Christoph Wick
e3acf389dc Added defines to disable code on QT_NO_PRINTER and undefined QT_WEBENGINE_LIB 2017-03-21 11:31:47 +01:00
C. Wick
83b0b9fee8 Fixed missing includes and added missing declarations 2017-03-18 00:44:39 +01:00
C. Wick
7398b4c123 added saveAudio to QIODevice function. Previous saveAudio to file function makes use of this function 2017-03-14 19:50:52 +01:00
Werner Schweer
902a5f7add remove obsolete 'Album'; style updates 2017-01-31 12:22:05 +01:00
lasconic
c745526cfe fix compilation after 5433d71 2017-01-16 22:16:10 +01:00
ws
d38d2345bb implement #110796 Batch conversion from the command line; speedup vtest by using this 2016-05-14 13:12:06 +02:00
lasconic
4875862aa1 fix compilation on Windows, update to Qt 5.6 2016-04-13 20:55:57 +02:00
ws
3f1aa2ed1f misc. updates to layout 2016-04-13 12:05:46 +02:00
ws
2874c409ae specialize MasterScore() from Score() 2016-04-13 11:46:21 +02:00
ws
a96c0abf5b replace XmlStreamReader by QXmlStreamReader 2016-04-13 11:35:22 +02:00
ws
bbd802f8ae framework for partial relayout 2016-04-13 11:35:21 +02:00
ws
fc8fad97be fix compiling for qt5.5 2015-07-08 14:39:33 +02:00
ws
aa54f7ed13 update to the local help system 2015-02-09 10:24:09 +01:00
ws
84b67a5b4b local help, second part 2015-02-06 16:36:43 +01:00
ws
1603cf8ee6 implement qt help system, first part 2015-02-02 09:30:17 +01:00
ws
b16957bf17 replace QQuickView in effects with QQuickWidget 2014-12-17 14:17:21 +01:00
ws
cafc8a9b82 fix #25410 2014-04-15 16:20:01 +02:00
lasconic
8f3ed9b4b1 remove precompiled header for Mingw :( see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56926 2013-12-16 23:35:32 +01:00
lasconic
ab1424199e add QGestureEvent to precompiled header 2013-12-16 11:44:06 +01:00
lasconic
f60feb6d28 try to get DPI with new QScreen API 2013-10-07 14:32:42 +02:00
lasconic
060f5ae7a7 first try to use the system proxy for all network communication 2013-10-02 10:05:54 +02:00
ws
3630ec25e9 update build system 2013-09-05 16:38:04 +02:00
ws
f223bec8b1 fix #15011 2013-07-17 14:37:02 +02:00
ws
37fa32e28c fix scoreview plugin 2013-07-10 11:05:54 +02:00
ws
98ea91fae4 merge master 2013-07-08 14:44:28 +02:00
lasconic
963b81da4a revert xmlreader change 2013-06-26 10:04:41 +02:00
ws
90483f3d61 clone QStreamReader and patch to allow some special chars in xml 2013-06-25 17:26:14 +02:00
ws
f448d29ab4 move to qml2 2013-05-16 17:10:33 +02:00
lasconic
aedf11f459 remove include of QX11Info 2013-05-16 16:24:34 +02:00
lasconic
62f56f70be replace Q_WS_* by Q_OS_* for Qt5 compatibility 2013-05-16 16:12:22 +02:00
ws
744e68abe0 merge with master 2013-04-17 14:00:26 +02:00
ws
d714b5f451 port to qt5 2013-02-15 14:50:03 +01:00
Werner Schweer
f81cb5091c simplify all.h in preparation for qt5 2013-02-04 16:56:14 +01:00
ws
bf1cbe2aa0 use QXmlStreamReader for xml parsing 2013-01-11 18:10:18 +01:00
Leon Vinken
28b0eba599 fix #15006 2012-12-21 22:43:27 +01:00
Werner Schweer
2b7680db64 remove config.h from all.h 2012-07-16 15:36:30 +02:00
lasconic
d064af268f clean some old plugin framework leftovers 2012-07-12 18:47:03 +02:00