summaryrefslogtreecommitdiff
path: root/src/plugins/beautifier
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused QObject parent arguments on options pageshjk2019-09-114-10/+5
| | | | | | | | In the new plugin setup scheme they are data members of the plugin pimpl and never use the parent. Change-Id: I28fe150393e8159064dcfbd113ce0320af50fd58 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Remove usages of deprecated APIsSona Kurazyan2019-09-031-1/+1
| | | | | | | | | | | | Replaced: QPalette::ColorRole::Background -> QPalette::ColorRole::Window QPalette::ColorRole::Foreground -> QPalette::ColorRole::WindowText Qt::ItemDataRole::TextColorRole -> Qt::ItemDataRole::ForegroundRole QFontMetrics::width() -> QFontMetrics::horizontalAdvance() Task-number: QTBUG-76491 Change-Id: I1302e6b569e725daa6f7be1428ffe055657fc644 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Add CommandLine convenience constructorshjk2019-07-231-1/+1
| | | | | | | | | | | | | ... taking a QString for the executable. This weakens the very explicit QString -> FileName conversion via the named constructors for the special case of constructing a CommandLine. I think that's worthwhile here, as it reduces the noise on the caller site under circumstance where the nature of the thing is obvious. Change-Id: I27b4a73639728893d053b2e7ba65cb745f0ffe83 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Project: Delay acting on fileListChanged signalTobias Hunger2019-06-201-2/+8
| | | | | | | | This gives the UI a bit more opportunity to render after the project was parsed. Change-Id: Ie316f1c69cb0ebb856943a094b81b55f1aa2317a Reviewed-by: hjk <hjk@qt.io>
* Project: Avoid copying the entire files(...) listTobias Hunger2019-06-193-10/+10
| | | | | | | | Avoid copying the entire list of files known to a project just to filter out a couple of files from it. Change-Id: I58b2e323f9678058ba482353eb777a55189fe05d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use Utils::FilePath in SynchronousProcesshjk2019-06-1110-16/+15
| | | | | | | Adapt callers and surrounding code. Change-Id: Ie6c1883a44169cf9d790d06b660f46d24dc24c89 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* connect() to ambiguous signals/slots: Replace static_cast with QOverloadAlessandro Portale2019-05-281-2/+1
| | | | | Change-Id: I473d7a2a16509cee944a2a21b022a3f6f02cfd8d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-286-16/+16
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Qt Creator CMake portCristian Adam2019-05-171-0/+27
| | | | | | | | | | | | | | Based on Tobias Hunger's work from a few months ago. The CMake configuration needs libclang and Qt paths specified as CMAKE_PREFIX_PATH. Auto tests are run with "ctest". At the moment the pass rate is 87%. Change-Id: Iba98e39bf22077d52706dce6c85986be67a6eab0 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangFormat: Add the interaction with BeautifierIvan Donchevskii2019-04-293-11/+10
| | | | | | | | Do not allow ClangFormat plugin to format on file save when the Beautifier has the same checkbox selected. Change-Id: I655d77a888cc444ccb02c4e72f11a93b3ab9bbd5 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Beautifier: Reduce indirectionshjk2019-04-088-97/+51
| | | | | | | | | | | The two-phase initialization of the tools is not needed, as the second phase is called directly after construction. Also, the settings objects' lifetime is identical to the tools, no need to handle that dynamically. Change-Id: Iedfe8a95d68f9a667ef60ad9a107d0bae142b2cc Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Replace static_casts by QOverload where possiblehjk2019-02-262-2/+2
| | | | | | | | | Mainly to get rid of the QProcess::finished deprecation warning. Also adjust coding style in the surrounding connects when needed. Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Beautifier: ModernizeAlessandro Portale2018-11-149-11/+9
| | | | | | | | | modernize-use-auto modernize-use-override modernize-use-equals-default Change-Id: I33158ef1c708fb44e0efa1c9b1b0e2f63758a6d7 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Beautifier: Move formatting tools to TextEditorIvan Donchevskii2018-08-3013-520/+31
| | | | | | | | | | | | Formatting is moved from Beautifier plugin to formattexteditor.h/.cpp. Diff and Differ classes are extracted from DiffEditor to Utils to prevent extra TextEditor dependencies. This change will make possible to use formatCurrentFile and similar functions not only from Beautifier code. Change-Id: Ic5ca668afe88f4e9376d49e6bd3594807172b0dd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Beautifier: Long live uncrustifyLorenz Haas2018-07-041-0/+2
| | | | | | | By accident uncrustify's option page got kicked during a refactoring. This amends 9a7e7f7d4. Change-Id: I27aba7bcf689b20763446fd445f4855050669865 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Beautifier: Use override consistentlyTobias Hunger2018-05-071-1/+1
| | | | | | | clang-tidy fixes from modernize-use-override check. Change-Id: I3909c20b7d4f6411f7d959f8524f2269cf8433c4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update Options dialog iconsAlessandro Portale2018-04-246-3/+4
| | | | | | | | | A new set of scalable and themable icons with unified look as provided by Diana. Task-number: QTCREATORBUG-20325 Change-Id: I68498b034e9e43fbb61511a38d9c7fc0003ab076 Reviewed-by: hjk <hjk@qt.io>
* Clean up options page category display name and icon set upEike Ziller2018-04-235-10/+2
| | | | | | | | | | | | | | In cases where plugins extend an existing settings category of a plugin that they depend on anyhow, they do not need to specify the translated display name and icon for that category. Some options pages were already not setting the icon, but still the translated name, which makes even less sense. Clean up this mess, only setting display name and icon if that is necessary. Change-Id: I8bc9d0c51b11d48f1d847337838704d663e70b45 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Don't translate default windowTitle again and againRobert Loehning2018-03-065-5/+5
| | | | | Change-Id: I4b4ff16e02c517bcd5a7c5ae73f62dd2a5bcc7cc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Beautifier: Re-organize internal interfacehjk2018-02-099-134/+100
| | | | | | | | | - pimpl BeautifierPlugin - apply "static" pattern - remove use of global object pool Change-Id: I7a4ab2493d5b29787aca258d1bc46ab00a697176 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Project: Make Project::files return a FileNameListTobias Hunger2017-12-083-10/+9
| | | | | Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge remote-tracking branch 'origin/4.5'Eike Ziller2017-10-131-1/+4
|\ | | | | | | Change-Id: I0a4a1b6787afc817acf2b7a1c3fd2b881c35f57a
| * Beautifier: Fix text selection for the UncrustifyViktor Kireev2017-10-131-1/+4
| | | | | | | | | | | | | | | | | | Extension of the selection of the text to full lines does not work correctly if the selection is performed from the top to the bottom. Change-Id: I13a1bf9d6e92ebbbfd4f8190fb626dd3aca74686 Reviewed-by: David Schulz <david.schulz@qt.io>
* | Replace manual signal blocking/unblocking with QSignalBlockerTobias Hunger2017-10-041-2/+1
|/ | | | | | Change-Id: Ibb59fab4e37d045e506c5a8172b6f5cbb955b028 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* TextEditor: move convenience from texteditor to utilsIvan Donchevskii2017-09-221-2/+2
| | | | | | | Allows to use this header without texteditor dependency. Change-Id: I706f42799c3ea42473a716fa9ef9f3cfbef6fdd4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Beautifier: ClangFormat: Format current syntactic entity for no selectionNikolai Kosjar2017-09-219-48/+34
| | | | | | | | | | | | | | | | In case there was no selection, the action "Format Selected Text" could format the whole file (option) as a fallback. However, there is also the use case of formatting the syntactic entity under the cursor. Introducing another separate action for this feels wrong, so remove the fallback instead since there is already an action handling this. Change-Id: Ia73f6074433e706bb4c2d375ad5b84dd59bc93a3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de>
* Beautifier: ClangFormat: Add action "Disable Formatting for Selected Text"Nikolai Kosjar2017-09-215-0/+55
| | | | | | | | Change-Id: I0786dfdc0679bbdf1cf1157067bd7f572ac7d108 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de>
* Fix more copyright years in pluginsEike Ziller2017-08-291-1/+1
| | | | | | Change-Id: I44845b3cc6f393e76a2f3ff5f166c6170c4eff56 Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Beautifier: Add accelerators to menu itemsOrgad Shaneh2017-07-134-6/+6
| | | | | | | Change-Id: Ie94b09ed640df457235be6b8a145d953c4eca03e Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Beautifier: Show version in command tooltipsOrgad Shaneh2017-07-103-0/+3
| | | | | Change-Id: I897ac7ed45ff50a7dfd7c1c7c5abd8ad417f84af Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Beautifier: Minor cleanupOrgad Shaneh2017-07-103-14/+7
| | | | | | | | * Use initializer list and Utils::transform * Remove unneeded override Change-Id: I36ff9b9900fa6169ed1529bbbbdba13075353332 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge remote-tracking branch 'origin/4.3'Eike Ziller2017-04-194-11/+13
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/genericprojectmanager/genericproject.cpp src/plugins/genericprojectmanager/genericproject.h src/plugins/genericprojectmanager/genericprojectnodes.cpp src/plugins/genericprojectmanager/genericprojectnodes.h Change-Id: Ie0c870f68c8d200a75489b75860987655b2f6175
| * Beautifier: Fix leak of GeneralSettingsNikolai Kosjar2017-04-184-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x4f06b0 in operator new(unsigned long) (/home/nik/dev/creator/ ut/4.2_asan/bin/qtcreator+0x4f06b0) #1 0x7f4ac0e5d068 in Beautifier::Internal::BeautifierPlugin::initialize(QStringList const&, QString*) /home/nik/dev/creator/ut/4.2_asan/src/plugins/beautifier/ beautifierplugin.cpp:214:25 #2 0x7f4ada1bb769 in ExtensionSystem::Internal::PluginSpecPrivate::initializePlugin() /home/ nik/dev/creator/ut/4.2_asan/src/libs/extensionsystem/pluginspec.cpp: 1001:10 #3 0x7f4ada1694b1 in ExtensionSystem::Internal::PluginManagerPrivate::loadPlugin(ExtensionSystem::PluginSpec*, ExtensionSystem::PluginSpec::State) /home/nik/dev/creator/ut/4.2_asan/ src/libs/extensionsystem/pluginmanager.cpp:1404:9 #4 0x7f4ada15b2b6 in ExtensionSystem::Internal::PluginManagerPrivate::loadPlugins() /home/ nik/dev/creator/ut/4.2_asan/src/libs/extensionsystem/pluginmanager.cpp: 1239:9 #5 0x7f4ada15ac6f in ExtensionSystem::PluginManager::loadPlugins() / home/nik/dev/creator/ut/4.2_asan/src/libs/extensionsystem/ pluginmanager.cpp:362:12 #6 0x50a97c in main /home/nik/dev/creator/ut/4.2_asan/src/app/ main.cpp:517:5 #7 0x7f4ad65b282f in __libc_start_main /build/glibc-Qz8a69/ glibc-2.23/csu/../csu/libc-start.c:291 Change-Id: Iff1fd908d9a59b98e895599b1d73ca16536eee11 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Merge remote-tracking branch 'origin/4.3'Eike Ziller2017-03-302-10/+0
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/cmakeprojectmanager/servermodereader.cpp Change-Id: I58e7b33d32c41cb48a24a5638ddb256212dd6107
| * Beautifier: Fix tab order of Uncrustify's option pageLorenz Haas2017-03-281-9/+0
| | | | | | | | | | | | | | | | | | Instead of defining a faulty tab order just let Qt do the job. The focus jumped from "Use customized style" to "Format entire file..." instead of to the combo box. Change-Id: I33567d7cb6b8275a2b9a939c937a02d00f2f1bbc Reviewed-by: David Schulz <david.schulz@qt.io>
| * 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>