aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/beautifier
Commit message (Collapse)AuthorAgeFilesLines
...
| * Beautifier: Remove code that has no effectLorenz Haas2017-03-281-1/+0
| | | | | | | | | | | | | | | | | | The file name will be overwritten by restore(), called from UncrustifyOptionsPage::widget(), right after the initialization. Change-Id: Ieed634f351a7b3e79ed9327878534e69a8de7e95 Reviewed-by: Laurent Montel <laurent.montel@kdab.com> Reviewed-by: David Schulz <david.schulz@qt.io>
* | Beautifier: added support for fallback-style option for clang-formatPrzemyslaw Gorszkowski2017-03-295-64/+112
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-17813 Change-Id: I36adee4889d1b851171d34852eed29639c68b574 Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de> Reviewed-by: hjk <hjk@qt.io>
* | Beautifier: Allow to define specific config file for AStyleLorenz Haas2017-03-285-4/+62
|/ | | | | | Change-Id: I3ea1a0bfb0f39d99606204a5699b01128138259e Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* Merge remote-tracking branch 'origin/4.2' into 4.3Eike Ziller2017-03-092-3/+7
|\ | | | | | | | | | | | | | | Conflicts: doc/src/qtcreator.qdoc tests/system/suite_general/suite.conf Change-Id: Ia298b177d6920a1d853e342b62cf98f7c48a278a
| * Beautifier: Fix formatting with AStyle and make it more robustLorenz Haas2017-03-012-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | Only version 2.04 added an extra newline. Later versions are fixed, so the should not remove a newline. In addition if piping is enabled we stream "\n" line endings so tell AStyle this explicitly by passing -z2. This disables the automatic detection which can be faulty with short code fragments. Task-number: QTCREATORBUG-17546 Change-Id: Ib90526234bfbc4d3530fd9c3a15bdfb3af02bebd Reviewed-by: David Schulz <david.schulz@qt.io>
* | Utils: Wrap MimeDatabase into static functionshjk2017-03-033-8/+4
| | | | | | | | | | | | | | | | To avoid repeating the 'MimeDatabase mdb; mdb.something(); ' mantra all over the place. Change-Id: I4bfef62e73275a991455141671d6071162788e9d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Beautifier: Allow to define specific config fileMontel Laurent2017-03-015-6/+66
| | | | | | | | | | | | Change-Id: Ic6410d7eae27a008cbb46f506ca5907f80d6ea68 Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | Beautifier: Simplify small code fragmentLorenz Haas2017-02-251-12/+8
| | | | | | | | | | Change-Id: I906d7803ccc6856b09fc25fdea7c7c3d112f4e77 Reviewed-by: David Schulz <david.schulz@qt.io>
* | Beautifier: Get rid of QRegExpLorenz Haas2017-02-235-33/+31
| | | | | | | | | | Change-Id: If3f7e6d93ef1f0b6920f0958f1e2eb00c37462bf Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Replace a few occurrences of QStringList() << ...hjk2017-02-082-3/+3
| | | | | | | | | | | | | | ... by something shorter. Change-Id: I363b4e509adb07997517b2d233246a333aea4aea Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Utils: Introduce a TemporaryDirectory and TemporaryFile classTobias Hunger2017-01-201-1/+3
|/ | | | | | | | Both wrap the corresponding Qt class, but make sure all temporary files or directories are created inside a "master temporary directory". Change-Id: I55461be507c828c965224c02863ea5ed9bbf9498 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Beautifier: Move initialization to extensionsInitialized()Ulf Hermann2016-11-081-4/+4
| | | | | | | | Beautifier makes heavy use of mime types which shouldn't be accessed in initialize() as that doubles the overhead for parsing them. Change-Id: Ie731f1194f281e9574ef914d67537651658ea9e7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Core: Make IOptionsPage::categoryIcon a Utils::IconAlessandro Portale2016-09-204-4/+4
| | | | | | | This is necessary for themable + HighDPI icons in the options dialog. Change-Id: I8e3ff87a24591af40bb76b39cd970443d7678fae Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/4.1'Eike Ziller2016-09-131-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ExtendedFunctionButton.qml src/plugins/android/androidrunner.cpp src/plugins/debugger/debuggerruncontrol.cpp src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h tests/system/suite_WELP/tst_WELP03/test.py Change-Id: Ibac4d71d4f4dbe1e4f05052d2f8a2dcfd82edd4c
| * Beautifier: Accept C and Objective-C files by defaultLorenz Haas2016-09-081-1/+2
| | | | | | | | | | | | Task-number: QTCREATORBUG-16806 Change-Id: I2f553fc82e9f0a192caaf4594227da3bb643b118 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Add some missing includesOrgad Shaneh2016-08-041-0/+2
| | | | | | | | | | Change-Id: I4db93e3388cd9ca4cbee84f012eda8c222f45cf1 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | UI files: Fix tab order in lots of UI formsNazar Gerasymchuk2016-08-021-0/+7
|/ | | | | | | | | | For unknown reasons tab order in listed UI files was set incorrectly and behave unexpectedly. Now tab order behave naturally. Changes made for listed objects and touches only UI. Change-Id: I057b95eb21943ddb29b108682618382661db7be9 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Beautifier: Use book style capitalization for headingsLeena Miettinen2016-07-191-1/+1
| | | | | | | | Also for group box titles. Change-Id: Ia651d0c486e3aea9a305b4f6d55ff01b5c97cfc3 Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* SynchronousProcess: Store raw bytes from stdout/stderr of the processTobias Hunger2016-07-152-4/+4
| | | | | | | | | | | | | | | Only convert the raw output later in a stdOut() and stdErr() method of the SynchronousProcessResponse. This is necessary since we have processes that use different encodings for different sections of the file (I am looking at you, git). Also remove the signals for raw data on stdout/stderr, leaving only the signals returning buffered QString lines. This should be safe, even with UTF-16 output. Change-Id: Ida613fa86d1468cbd33bc6b3a1506a849c2d1c0a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Beautifier: Fix untranslated DISPLAY_NAMETakumi ASAKI2016-06-229-12/+20
| | | | | | Change-Id: Ifad91eaada5f7614767b6332a643723de79fc6b2 Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Fix code styleLorenz Haas2016-06-0710-19/+19
| | | | | Change-Id: I991f47d2f6844b153cd47ac856e5a76a7a962c94 Reviewed-by: hjk <hjk@theqtcompany.com>
* Beautifier: Make all tools MIME restrict-ableLorenz Haas2016-06-0119-36/+182
| | | | | | | | | | | | The newly introduced auto save option is restricted to user definable MIME types. The underlaying tool's restriction, however, is only if the current editor is a cpp editor. This patch makes the tools also MIME types restrict-able. In addition the auto save functionality is now only applicable if the file matches the auto save MIME types as well as the MIME types of the chosen tool. Change-Id: Ic430b4a07341647e6c8e95d2b802a17db1637a36 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Use SynchronousProcess::runBlockingTobias Hunger2016-05-263-4/+4
| | | | | | | | | | | | | Use SynchronousProcess::runBlocking in favor of SychronousProcess::run. This avoid nested event loops which can produce really strange crashes if not use carefully. This patch only converts those processes that have a timeout of less than 5 seconds or use the default timeout. Change-Id: I9de8899dcc946af7049ea357a91972996c0256a1 Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Beautifier: Fix qbs build.Christian Kandeler2016-05-171-3/+3
| | | | | | Change-Id: Iea7a1b68f038e69450790512ac7147c8a17585ad Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Add option to automatically format files on saveLorenz Haas2016-05-1519-21/+731
| | | | | Change-Id: I72fb3f4b728df7ef3e449c1202df9cbb0279dde4 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Merge remote-tracking branch 'origin/4.0'Eike Ziller2016-05-111-1/+1
|\ | | | | | | | | | | | | | | Conflicts: share/qtcreator/debugger/creatortypes.py src/plugins/beautifier/clangformat/clangformat.cpp Change-Id: I1ab281c190767ced8a6ac2c026a121ea229a36cf
| * Beautifier: Fix clang-format file style regressionAdam Strzelecki2016-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3310fbc8f2f00aacf4f3c3bb373f49b1549db8bd introduced regression replacing -assume-filename=%file with -assume-filename=%filename, that caused only file name part to be passed to clang-format, not whole path to the buffer. Effectively when formatting the buffer with style set to "File", clang-format was unable to determine related style file placement (eg. within the project tree) anymore. This reverts back to use %file, not %filename, making clang-format "File" style work again as expected. Change-Id: I5e7ae3d1186b1e7c33dc89a7d60aacc0f0671e51 Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Fix up QProcess::waitForFinished()Tobias Hunger2016-05-113-31/+32
| | | | | | | | | | | | | | | | waitForFinish returns false if the process is no longer running at the time of the call. Handle that throughout the codebase. Change-Id: Ia7194095454e82efbd4eb88f2d55926bdd09e094 Reviewed-by: hjk <hjk@theqtcompany.com>
* | Beautifier: tr()-FixesTakumi ASAKI2016-05-111-5/+5
| | | | | | | | | | | | | | Do not use QObject::tr(). Change-Id: Ib77f78ead649bcfee326fb9f8acde1df7784437b Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Beautifier: Modernize, code style, and clean upLorenz Haas2016-05-0231-449/+347
| | | | | | | | | | | | | | | | | | | | | | Use nullptr and range based for loops, unify initializer list code style, remove superfluous includes, make private slots private methods, get rid of QLatin1(Char|String), use initializer lists and some minor code style issues. Change-Id: I94ba10fc96bb628239364a8201bde98a66b2c4c1 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | Use "timeout" consistentlyRobert Loehning2016-04-201-2/+2
| | | | | | | | | | Change-Id: Ic4e2ba6269bd61eb2fa2bbef1e1c24c05f91e6a5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Merge remote-tracking branch 'origin/4.0'Eike Ziller2016-04-156-49/+70
|\| | | | | | | Change-Id: Ied609608f6b12aa923c67777bc5a273c4d8fbcbb
| * Beautifier: Fix clang-format's custom style handlingLorenz Haas2016-04-146-49/+70
| | | | | | | | | | | | | | | | | | Instead of dealing with clang-format's YAML format use proper command line parameters. Task-number: QTCREATORBUG-15604 Change-Id: Ie0b22aff105c8d208d30e2e945b0036b0b8606c1 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* | Beautifier: Use Uncrustify's new --assume optionLorenz Haas2016-04-143-3/+55
| | | | | | | | | | | | | | | | | | | | | | Instead of treating all files as C++ with version 0.62 we can use Uncrustify's new option --assume. It decides which language the file is. Thus using Uncrustify inside the Beautifier behaves like calling it on the command line. Task-number: QTCREATORBUG-15575 Change-Id: I8cd2250194b4acb81a9062f99c5ce5ea6083bd5a Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* | Merge remote-tracking branch 'origin/4.0'Oswald Buddenhagen2016-04-011-4/+2
|\| | | | | | | | | | | | | | | | | Conflicts: qtcreator.pri qtcreator.qbs src/plugins/debugger/debuggerruncontrol.cpp Change-Id: I81b43480a1369e3d7be60ae26e812dda6b962b0b
| * Beautifier: Fix hidden menu on LinuxLorenz Haas2016-03-311-4/+2
| | | | | | | | | | | | Task-number: QTCREATORBUG-15936 Change-Id: Id9387495a8c770167292fa526727f969b7408b2c Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* | Wholesale conversion to #pragma oncehjk2016-03-3020-84/+20
|/ | | | | | | Kudos to cgmb and https://github.com/cgmb/guardonce Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Merge remote-tracking branch 'origin/3.6' into 4.0Eike Ziller2016-03-031-2/+10
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/projectexplorer/applicationlauncher.cpp src/plugins/projectexplorer/applicationlauncher.h src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp src/plugins/qmlprofiler/qmlprofilertool.cpp src/plugins/qtsupport/uicodemodelsupport.cpp src/plugins/qtsupport/uicodemodelsupport.h Change-Id: I6f6ae77422d99f4f422b108ade6b64273df9dd57
| * Beautifier: Fix format for clang-format's command line style parameterLorenz Haas2016-02-241-2/+10
| | | | | | | | | | | | | | | | | | | | | | clang-format uses YAML for its configuration file. Thus the content has to be properly reformated when used in a single line as command line argument. Task-number: QTCREATORBUG-15604 Change-Id: I867caf7ccb1f2f396677e2d0cd5335e5255e03ea Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* | Beautifier: Refactor formatting APILorenz Haas2016-02-292-169/+183
| | | | | | | | | | | | | | | | | | Break former monolithic methods into modular ones and re-introduce synchronous formatting. Change-Id: Ic4d8cbe451f028c7a3677570242cff9a2e362384 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Marcel Mathis <marcel.mathis@komaxgroup.com>
* | Astyle: Fix concurrency issue with updating versionEike Ziller2016-02-172-17/+14
| | | | | | | | | | | | | | | | | | We may not access command() from a different thread, since it is not thread safe. We can also report the result just through the function return value. Change-Id: Ib20c062f6541400040868b65308d9b2d2bd382d8 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* | Astyle: Read the version also from stdoutEike Ziller2016-02-161-11/+18
| | | | | | | | | | | | | | Astyle writes it to different streams on different platforms Change-Id: I3775ec31a9c31574bade79cdd8abfd7d14076859 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* | Beautifier: Use Utils::runAsyncEike Ziller2016-02-152-4/+4
| | | | | | | | | | | | | | Gets rid of usage of global thread pool and ugly implementation. Change-Id: If7ca1f479bb837e61fa7f57535b7b099f09800f2 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* | Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-1936-633/+458
| | | | | | | | | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* | Beautifier: Add fallback for uncrustify's "Format Selected Text"Lorenz Haas2015-12-156-1/+33
|/ | | | | | | | | | | | | | If the current editor has no text selection and the new option ("formatEntireFileFallback") is selected, the entire file is formatted. With this change uncrustify's "Format Selected Text" behaves like ClangFormat which already has a "formatEntireFileFallback" option. Change-Id: I625efef9b81631ff0ae3ffe2fcb0152c778eb7a2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Jochen Becher <jochen_becher@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Add const wherever applicableLorenz Haas2015-06-238-14/+14
| | | | | Change-Id: Iba3e5793bfd0e4057074e2b04e6353ba09aa4a5f Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Consistently use qt5 connection styleLorenz Haas2015-06-226-11/+14
| | | | | Change-Id: Iea7a554dbb323b3a2b691d3e254c4e111897beb8 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Avoid raw loops wherever applicableLorenz Haas2015-06-225-22/+13
| | | | | Change-Id: I8b595ce0f7b3544466c6308457bf22826d1dafeb Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Add DISPLAY_NAME constant to ClangFormatLorenz Haas2015-06-152-1/+2
| | | | | | | | All ohter tools have this constant thus ClangFormat should have it too. Change-Id: I23b032e86291f2490d56ff937d70510bf2f41377 Reviewed-by: Jochen Becher <jochen_becher@gmx.de> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Support formatting specific lines of file with UncrustifyLorenz Haas2015-06-155-26/+86
| | | | | | | | | | It's now possible to format only a specific range of the current file. The used tool, however, needs to support the formatting of fragments like Uncrustify does with --frag. Change-Id: I486a350b6301e4a087619b1e225f2a5c553ff7df Reviewed-by: Jochen Becher <jochen_becher@gmx.de> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>