summaryrefslogtreecommitdiff
path: root/src/libs/utils/textfileformat.cpp
Commit message (Collapse)AuthorAgeFilesLines
* License updateEike Ziller2014-10-091-7/+8
| | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Utils: Remove unneeded namespace qualificationsOrgad Shaneh2014-07-161-8/+8
| | | | | | Change-Id: Iacab8410ab4d3b63f96e7541b450e3cc729ab662 Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Merge remote-tracking branch 'origin/3.0'Eike Ziller2014-01-081-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: share/qtcreator/debugger/dumper.cpp share/qtcreator/debugger/dumper_p.h share/qtcreator/debugger/test/main.cpp src/plugins/debugger/gdb/classicgdbengine.cpp src/plugins/debugger/gdb/pythongdbengine.cpp src/plugins/debugger/lldblib/guest/lldbengineguest.cpp src/plugins/debugger/lldblib/guest/lldbengineguest.h src/plugins/debugger/lldblib/guest/main.cpp src/plugins/debugger/lldblib/ipcengineguest.cpp src/plugins/debugger/lldblib/ipcengineguest.h src/plugins/debugger/lldblib/ipcenginehost.cpp src/plugins/debugger/lldblib/ipcenginehost.h src/plugins/debugger/lldblib/lldbenginehost.cpp src/plugins/debugger/lldblib/lldboptionspage.cpp src/plugins/qbsprojectmanager/qbsstep.cpp src/plugins/qbsprojectmanager/qbsstep.h src/plugins/qmlprofiler/canvas/qdeclarativecanvas.cpp src/plugins/qmlprofiler/canvas/qdeclarativecanvas_p.h src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp src/plugins/qmlprofiler/canvas/qdeclarativecontext2d_p.h src/plugins/qmlprofiler/canvas/qmlprofilercanvas.cpp src/plugins/qnx/blackberrycheckdevmodestep.cpp src/plugins/qtsupport/debugginghelper.cpp Change-Id: Ie9fd0a885fb6264a6a8a72daee071b75bcbd2e9d
| * Incremented year in copyright infoRobert Loehning2014-01-081-1/+1
| | | | | | | | | | | | Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | Assume UTF-8 in TextFileFormat::readFileUTF8 as fallbackNikolai Kosjar2014-01-061-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | If the contents is not detected as UTF-8/16/32 (TextFileFormat::detect) and decoding with the given defaultCodec fails, still assume UTF-8. This affects reading in files for code model indexing. Better read in the file with the wrong encoding than not reading it at all. Change-Id: Ibc10b7268ecbed4e7fd50336182f6e71c7d93f5b Reviewed-by: Pawel Faron <pawelfaron87@wp.pl> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Utils: Remove superseded readFileUTF8 overloadNikolai Kosjar2013-12-101-33/+0
|/ | | | | | | Superseded by the version added in commit c1225ea. Change-Id: I7cd8186b613b31e235d045f28e2b0f339784b59e Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* CppTools: Use editor manager's codec as fallbackNikolai Kosjar2013-11-181-0/+34
| | | | | | | | | | | | | | | | | ...for reading not already opened files. This partly reverts commit f7c68f6. In case TextFileFormat::detect() fails, the user configurable editor manager's codec is used instead of QTextCodec::codecForLocale(). Adds also a qWarning() to easier detect encoding errors. Task-number: QTCREATORBUG-10378 Change-Id: I0fa4e6b898ed090d85414ce2a001f11b115a42d3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Merge remote-tracking branch 'origin/2.8'Eike Ziller2013-09-271-7/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/extensionsystem/pluginmanager.cpp src/libs/extensionsystem/pluginspec.cpp src/plugins/coreplugin/basefilewizard.cpp src/plugins/coreplugin/coreplugin.pro src/plugins/coreplugin/coreplugin.qbs src/plugins/coreplugin/editormanager/ieditor.cpp src/plugins/coreplugin/externaltool.cpp src/plugins/coreplugin/icore.cpp src/plugins/cpptools/cppmodelmanager.cpp src/plugins/fakevim/fakevimhandler.cpp src/plugins/find/ifindfilter.cpp src/plugins/projectexplorer/buildstep.cpp src/plugins/projectexplorer/devicesupport/idevice.cpp src/plugins/projectexplorer/runconfiguration.cpp src/plugins/vcsbase/vcsbaseeditor.cpp tests/system/suite_debugger/tst_simple_analyze/test.py Change-Id: I11dc9e60bfc14bad4f8af747d041fc7678a07c17
| * Doc: edit utils docsLeena Miettinen2013-09-091-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use \a for all attributes in function descriptions to avoid QDoc errors. Do not use \param, because it is not a valid QDoc command. Do not use \returns as it does not exist. Do not use \brief for functions. It is not obligatory, so rather than add them for all functions, let's consistenly leave them out. Fix typos, grammar and style issues, and punctuation. Change-Id: Ib8f296f93976265bb93dbeab40c5b47156518122 Reviewed-by: hjk <hjk121@nokiamail.com>
* | C++: change working-copy to work on UTF-8 encoded QByteArrays.Erik Verbruggen2013-09-111-0/+33
|/ | | | | | | | | | | | These not only take less space than UTF-16 encoded QStrings, but due to the caching in the CppEditorSupport also take less time to build. This patch also fixes a number of possible encoding issues, where files and constant strings were (falsely) assumed to be UTF-8. Change-Id: Ib6f91c9a94ebed5b5dfbd4eb2998825c62c72784 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Doc: use standard wording in \brief commandsLeena Miettinen2013-06-201-1/+2
| | | | | | | | | QDoc does some magic with the \class and \namespaces and \brief commands, so the following wording must be used: "The xxx class yyy ..." Change-Id: Id231f30e8464898b776888d5423523de404aae34 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Make sure to call FileSaver::finalizeTobias Hunger2013-06-051-6/+4
| | | | | | | We may leak resources otherwise. Change-Id: Ic09f58bd47cbf283e22f17f2c3393ca03c5dfacf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Clean headers in Utils.Friedemann Kleint2013-03-191-3/+0
| | | | | | | | | | Forward-declare QGraphicsOpacityEffect in DetailsButton, QProcessEnvironment in Environment, QFileInfo in fileutils, QUrl in IWelcomePage, FancyLineEdit in PathChooser and remove unneeded headers. Change-Id: I7d5f273530dd2059bbdaf0899f0a3bc7e49e8482 Reviewed-by: hjk <hjk121@nokiamail.com>
* Doc: replace deprecated QDoc commandsLeena Miettinen2013-02-061-3/+3
| | | | | | | | | | The \i and \o commands were replaced with \li and \bold was replaced with \b in QDoc for Qt 5. The \input command was replaced with \include in the docs. Change-Id: I257d1bebb8ebc739ca20e0d29fcf0406ecb14534 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Merge remote-tracking branch 'origin/2.6'Oswald Buddenhagen2013-01-311-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in src/plugins/debugger/qtmessageloghandler.cpp src/plugins/debugger/qtmessagelogwindow.cpp src/plugins/madde/maemodeployconfigurationwidget.cpp src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp src/plugins/qmldesigner/designercore/include/widgetqueryview.h src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp src/plugins/qnx/bardescriptormagicmatcher.h src/plugins/qt4projectmanager/profilekeywords.cpp src/plugins/remotelinux/deployablefilesperprofile.cpp src/plugins/remotelinux/deployablefilesperprofile.h src/plugins/remotelinux/deploymentinfo.cpp src/plugins/remotelinux/deploymentsettingsassistant.cpp src/plugins/remotelinux/profilesupdatedialog.cpp tests/auto/icheckbuild/ichecklib.cpp tests/auto/icheckbuild/parsemanager.cpp tests/auto/icheckbuild/parsemanager.h Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
| * Incremented year in copyright infov2.6.2Robert Loehning2013-01-291-1/+1
| | | | | | | | | | Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | Remove braces for single lines of conditionsOrgad Shaneh2013-01-081-7/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | #!/usr/bin/env ruby Dir.glob('**/*.cpp') { |file| # skip ast (excluding paste, astpath, and canv'ast'imer) next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i s = File.read(file) next if s.include?('qlalr') orig = s.dup s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m| res = $& if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces res else res.gsub!('} else', 'else') res.gsub!(/\n +} *\n/m, "\n") res.gsub(/ *{$/, '') end } s.gsub!(/ *$/, '') File.open(file, 'wb').write(s) if s != orig } Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc Reviewed-by: hjk <qthjk@ovi.com>
* Adjust license headershjk2012-10-051-21/+20
| | | | | Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Contact -> qt-project.orgEike Ziller2012-07-191-3/+1
| | | | | Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* qtcassert: move actual printing to separate function and enforce stylehjk2012-04-171-2/+2
| | | | | | | This also allows simple setting of breakpoints on failed asserts. Change-Id: I6dd84cbfaf659d57e39f3447386cebc0221b2b84 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
* Removed module names from #include directives.Erik Verbruggen2012-02-151-4/+4
| | | | | | | | Getting the #include directives ready for Qt5. This includes the new-project wizards. Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* Long live the king!hjk2012-01-261-1/+1
| | | | | Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
* all: s/info@qt.nokia.com/qt-info@nokia.com/hjk2011-11-031-2/+2
| | | | | Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* Extract Core::TextFile from TextEditor::BaseTextDocument.Friedemann Kleint2011-08-261-0/+314
Use it in BaseTextEditor and Designer to preserve CRLF of the files. Task-number: QTCREATORBUG-5901 Change-Id: I7599ce78649a3b09f2e5118d02f8cbf3db27ed31 Reviewed-on: http://codereview.qt.nokia.com/3591 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>