aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/beautifier
Commit message (Collapse)AuthorAgeFilesLines
* More QRegularExpression and include for Qt 6hjk2020-06-251-2/+2
| | | | | | Task-number: QTCREATORBUG-24098 Change-Id: Ia537e26efd3f37319c38d906e569b255768371f9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Beautifier: Fix freeze in extensionsInitializedhjk2020-06-221-4/+2
| | | | | | | Amends c9a7a3a2d30. Change-Id: Id14412a584c20e3e14b5c377857af43622ccf65d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Beautifier: Remove inner namespace levelhjk2020-06-1925-107/+44
| | | | | | | | | | | And inline non-shared object id. I regularly stumble over this speciality when doing mass refactorings in the code base and I believe the extra benefit this namespace level has does not outweigh it. Change-Id: I3694a656f1095dcb5509b212b9e1d25ae5c8b5ec Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* All: Use Utils::SkipEmptyPartshjk2020-06-172-1/+6
| | | | | | Task-number: QTCREATORBUG-24098 Change-Id: Iab45de9a9c17ddc39a0e343b1175d4f6cb94b098 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Beautifier: Remove dependency on CppEditor and DiffEditorAlexis Murzeau2020-06-057-9/+1
| | | | | | | | | | | | | | | Beautifier plugin depends on CppEditor and DiffEditor at the project level, but it does not require them to be built and used. There is also unused includes to "cppeditor/cppeditorconstants.h". So this commit remove the unused includes (which makes Beautifier not use any of CppEditor code) and the dependencies on CppEditor and DiffEditor. This allow the user to disable CppEditor plugin and use LSP instead with the basic TextEditor. Change-Id: If83f30e754746f1635934e5f952bf9254e83c42f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Replace FileChooser::path() by filePath().toString()hjk2020-04-093-5/+5
| | | | | | | | | | | Keep the old method for now to ease downstream porting. The change is kept mechanical, there's a lot of cleanup possible now on the user code side. Change-Id: I936baedd45b7ba057f1c789a1bec896886f48eff Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Utils: Rename PathChooser::{f,setF}ileName() to {f,setF}ilePath()hjk2020-04-093-5/+5
| | | | | | | | | | It's returning a FilePath, so it's a better fit. Keep the old versions as inline function now to ease downstream migration. Change-Id: I535887928018f42b92895c8b0c82527f0d55e5ca Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Fix lupdate issuesEike Ziller2020-03-181-1/+3
| | | | | Change-Id: I26f08ae82354c178f6d26f9138796328b50bfba8 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Make TextEditor setup more flexibleEike Ziller2020-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | So far it was only possible to combine TextEditorFactory, BaseTextEditor and TextEditorWidget directly. That TextEditorWidget is also directly a QPlainTextEdit made it impossible to "decorate" the text editor widget with something else without a lot of effort. Make it possible to create a text editor factory that returns an arbitrary widget, as long as it can be "cast" to a TextEditorWidget with either qobject_cast or Aggregation::query. That way the TextEditorWidget instance can be attached to the editor widget via Aggregation. Adapt other code that accesses TextEditorWidget from editors accordingly. Introduce a common method how to do that. Change-Id: I72b8721f3a8a8d8281c39af75253e9c80cbe1250 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: David Schulz <david.schulz@qt.io>
* Beautifier: Avoid QObject parent in options pagehjk2020-02-103-15/+16
| | | | | Change-Id: I7e1162802fb6d7d7dffe143dbcdf6d85dc18d56f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Beautifier: Avoid using QObject parent in settings pageshjk2020-01-2712-26/+19
| | | | | Change-Id: I66ecc5c6b4d79d27ac6bc6845eb56c4fdd7102a4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Core: Introduce a IOptionsPage::setCategoryIconPathhjk2020-01-161-2/+1
| | | | | | | Less noise on the user side. Change-Id: I34dea09e8a3c8639f5a7db89b22f8b825b946395 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Core: Provide empty implementation for IOptionPageWidget::finish()hjk2020-01-154-4/+0
| | | | | | | | Having it pure virtual only lead to a lot of unnecessary re-implementation. Change-Id: I37f71d1a160e21b93c7c73a6304b0eb6d5f0441d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Beautifier: Use new IOptionsPager convenience functionshjk2020-01-1011-400/+196
| | | | | Change-Id: I90510d9f7b77bf286fd342cdfea88964d12571b2 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Rename FilePathList to simply FilePathshjk2019-12-182-2/+2
| | | | | | | The exact storage type does not really matter here. Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* 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>