Commit Graph

221 Commits

Author SHA1 Message Date
Orgad Shaneh
29a93998df Remove braces for single lines of conditions
#!/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>
2013-01-08 10:48:18 +01:00
Orgad Shaneh
a44aa55502 Add whitespace after control keywords
find -name \*.cpp -o -name \*.h | \
  xargs sed -Ei 's/ (for|foreach|if|switch|while)\(/ \1 (/g'

Change-Id: I9efdff4bf0c8c01a52baaaeb75198483c77b0390
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-28 20:20:46 +01:00
Orgad Shaneh
7c4e2b6c60 Id: Add QByteArray constructor
Distinguish from const char * one.

QString ctor is yet to be removed

Change-Id: I2da231036c6417353b0566d39666d918ad141c6d
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-20 08:57:35 +01:00
Eike Ziller
6fd252b0a5 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.cpp
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.h
	src/plugins/debugger/qtmessageloghandler.cpp
	src/plugins/debugger/qtmessageloghandler.h
	src/plugins/debugger/qtmessagelogwindow.cpp
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/madde/maemodeployconfigurationwidget.h
	src/plugins/remotelinux/deployablefilesperprofile.cpp
	src/plugins/remotelinux/deployablefilesperprofile.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/deploymentinfo.h
	src/plugins/remotelinux/deploymentsettingsassistant.cpp
	src/plugins/remotelinux/profilesupdatedialog.cpp
	src/plugins/remotelinux/remotelinuxdeploymentdatamodel.h
	tests/auto/icheckbuild/ichecklib.cpp
	tests/auto/icheckbuild/ichecklib_global.h
	tests/auto/icheckbuild/parsemanager.cpp
	tests/auto/icheckbuild/parsemanager.h
	tests/manual/ssh/tunnel/tunnel.h

Change-Id: I04d7761df6bd936ad00e0547974284c967d39580
2012-10-05 21:20:50 +02:00
hjk
386ca7c8dd Adjust license headers
Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-05 17:12:56 +02:00
Eike Ziller
6faede0860 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	share/qtcreator/qml/qmlpuppet/commands/changenodesourcecommand.h
	share/qtcreator/qml/qmlpuppet/commands/tokencommand.h
	share/qtcreator/qml/qmlpuppet/container/reparentcontainer.h
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/componentnodeinstance.h
	share/qtcreator/qml/qmlpuppet/qmlpuppet/instances/nodeinstanceclientproxy.cpp
	src/plugins/git/gitsettings.cpp
	tests/manual/ssh/remoteprocess/remoteprocesstest.h

Change-Id: I00c294e6d911d272615e65fed58562399af97a4e
2012-09-27 20:38:57 +02:00
Tobias Hunger
9e9dd99310 Remove useless headers
Change-Id: Iee4a6f549f8a7c028f52a1e6113b33034ef621e2
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2012-09-26 15:44:41 +02:00
Christian Kandeler
3d9e492860 Do not use the fromAscii() and toAscii() functions.
They are deprecated in Qt 5. Use fromLatin1() and toLatin1() instead. In
Qt 5, these always do the same thing as their "Ascii" counterparts. The
same goes for Qt 4, provided QTextCodec::setCodecForCStrings has not
been set, which it hasn't.

Change-Id: I04edeb376762b6671eff8156094f0d5e2cb8e1ea
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2012-09-21 21:03:48 +02:00
Christian Kandeler
e669f05406 Utils: Introduce HostOsInfo class.
The class' member functions are intended to be used
instead of the Q_OS_* macros in all contexts where
the latter are not syntactically required.
This lowers the likelihood of changes made on one
platform breaking the build on another, e.g. due to
the code model missing symbols in #ifdef'ed out code
when refactoring.

Change-Id: I4a54788591b4c8f8d589b8368a6c683d4155c9fa
Reviewed-by: hjk <qthjk@ovi.com>
2012-08-27 17:00:03 +02:00
Orgad Shaneh
7ffc4349f8 VCS: Allow use of base name for executable
Actual path is found on startup and when setting is changed

Change-Id: If2cb0735953b9fb64df7425230c98efb384d9287
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-08-21 15:31:51 +02:00
Orgad Shaneh
99aa8007c1 Remove NULL tests for Core::ICore::settings()
It cannot really be NULL

Change-Id: I7231e00754464347dc5750249f751cda7f831930
Reviewed-by: hjk <qthjk@ovi.com>
2012-08-09 13:09:08 +02:00
Konstantin Tokarev
d18bf468ad Changed return type of :ICore::mainWindow() to QWidget*
Also removed all <QMainWindow> includes which are not needed
anymore.

Change-Id: I393c9a62a5c6df95d9f35d872e1473a4f13bcdc4
Reviewed-by: hjk <qthjk@ovi.com>
2012-07-19 15:15:53 +02:00
Eike Ziller
e0e8cf3ada Contact -> qt-project.org
Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 13:23:21 +02:00
Eike Ziller
cdd44befff Add ActionContainer::addSeparator(...)
Gets rid of a lot of code duplication.

Change-Id: I2ce38fb38a0b61cb821e0bdc7bcc9a7ccdf9da72
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-05 15:19:30 +02:00
Orgad Shaneh
671bfb9250 VCS: Always allow "Revert Chunk"
Remove revertDiffChunkEnabled property

Any diff view might relate to previous changes, so it makes sense
to always allow reverting them

Change-Id: I8da0fb2d8625ac98140d1bde0296a4478bc6a0b7
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-04 11:35:07 +02:00
Eike Ziller
3934347fe9 ActionManager API cleanup.
d-pointer instead of inheritance
static methods

Change-Id: I7b2f0c8b05ad3951e1ff26a7d4e08e195d2dd258
Reviewed-by: hjk <qthjk@ovi.com>
2012-05-25 10:08:24 +02:00
Eike Ziller
1781617f8e Get rid of lots of ifdef Q_OS_MAC for shortcuts.
Using a central enum now.

Change-Id: I20d88c9a3f8c62cf33e4b89a3442269f71918b06
Reviewed-by: hjk <qthjk@ovi.com>
2012-05-23 13:47:13 +02:00
Eike Ziller
48a23cc28b Mac: Avoid Alt+<character> shortcuts
Because these tend to add special characters into the editor instead of
triggering the shortcut. Use Ctrl (aka Qt's Meta) instead.

Change-Id: I5866772baf4550e6d048e4d7252b2899a6d28296
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-05-22 16:48:20 +02:00
Jonathan Liu
82a821fc9b SVN: Fix project status command when no document open
The SVN project status command is using currentFileTopLevel() for the
working directory when it should be using currentProjectTopLevel().
If no document is open, currentFileTopLevel() will return an empty
string which means the current working directory of Qt Creator is used.

Change-Id: I848b1adf7166836c5d15e88796af77f8700a43f2
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-05-15 12:36:29 +02:00
hjk
21bf0046c3 editormanager: simplify use of interface
Less code on the user side, same meaning.

Change-Id: I14e54a5d2ed8e024a51cce74eaf7c8419ad544be
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-05-11 13:51:14 +02:00
hjk
5b0bf61640 qtcassert: move actual printing to separate function and enforce style
This also allows simple setting of breakpoints on failed asserts.

Change-Id: I6dd84cbfaf659d57e39f3447386cebc0221b2b84
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-04-17 09:53:44 +02:00
Eike Ziller
d66acb51d0 Rename IFile->IDocument and FileManager->DocumentManager
And adapt the other API respectively.

Change-Id: I1e04e555409be09242db6890f9e013396f83aeed
Reviewed-by: Bill King <bill.king@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-20 13:32:49 +01:00
Erik Verbruggen
3fa55b7ab9 Removed module names from #include directives.
Getting the #include directives ready for Qt5. This includes the
new-project wizards.

Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-15 16:24:46 +01:00
Friedemann Kleint
e2ace515e2 Version control: Compile with QT_NO_CAST_FROM_ASCII.
Change-Id: I85c007045efdb207f397b42fbce7a554ac9c9819
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-01-31 11:26:52 +01:00
hjk
2931a499e6 Long live the king!
Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-26 19:55:36 +01:00
hjk
21c0cdee40 Core::Filemanager: make some methods static
This follows suit to the ICore changes.

Change-Id: Iba2de1b1e3f2574fd1459892eae702e6af1cc7dc
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-25 19:23:11 +01:00
hjk
4a21f0c3c8 Use new static ICore interface.
Change-Id: I9b690d9b150c8d162b15370f9f8986267c9128f1
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-24 18:48:47 +01:00
hjk
6681d3edee vcs: s/VCS/Vcs/
According to style guide.

Change-Id: I05c1d4f50ddbf2876ab7e0835f4abec95fd573b2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@nokia.com>
2012-01-09 10:55:41 +01:00
Eike Ziller
85cf2b661e Merge remote-tracking branch 'origin/2.4'
Conflicts:
	src/libs/qmljs/qmljsinterpreter.cpp
	src/libs/qmljs/qmljsinterpreter.h
	src/plugins/debugger/qml/scriptconsole.cpp
	src/plugins/git/gitplugin.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas_p.h

Change-Id: Iad59c8d87c72a21c79c047e374c0ab689998af39
2011-11-11 09:46:25 +01:00
hjk
82f5573626 more Id type fixes
Change-Id: I3720946ba5485696822976567d83b4d6cb1fb283

x

Change-Id: Iab58bc34bc56371405d132315573b484a533b77c
Reviewed-by: hjk <qthjk@ovi.com>
2011-11-10 15:57:09 +01:00
Harald Fernengel
f9623b5ad6 Small include header fixes
QtXmlStream classes live in QtCore, not QtXml. Also add a few headers
that are not implicitly included in Qt 5 any more. This greatly eases
transition to Qt 5 which not having any side effects on the Qt 4 build.

Change-Id: I1293ef4360015b885dcea8c4099e8e5b9e254c91
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2011-11-09 14:02:40 +01:00
Jonathan Liu
28668eea86 SVN: Fix Subversion 1.6 and earlier support after refactoring
After refactoring in fa2c24d92b,
Subversion 1.6 and earlier working copies are not detected properly
which results in the Subversion menu missing. This fixes the
detection by correcting a typo in the last return statement.

Change-Id: I64334a3f46e94b2b36e8a83b1833cf899fdb58c6
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2011-11-08 09:43:24 +01:00
hjk
31600758de all: s/info@qt.nokia.com/qt-info@nokia.com/
Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-11-03 10:33:19 +01:00
hjk
29279ab8c7 more style fixes of string literal access
Change-Id: I60b0c53681c6a0cc38231e805479deb614aa0096
Reviewed-by: hjk <qthjk@ovi.com>
2011-11-02 18:20:19 +01:00
Tobias Hunger
fa2c24d92b SVN: Refactor SVN detection code
Reviewed-by: Jonathan Liu <net147@gmail.com>
Change-Id: Ib78251b69a89ee503bb78ab122c6e37a6ec7aacb
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2011-10-19 16:12:23 +02:00
Jonathan Liu
67ac492ca0 SVN: Fix handling of svn:externals for Subversion 1.7
Change-Id: I3f869fd316d2f2a3a41c622321cebb79575c423f
Merge-request: 409
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2011-10-19 16:12:08 +02:00
Jonathan Liu
44a18e30a1 Add support for Subversion 1.7
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Change-Id: Ide2c13f0e69f9807995539b2634ecec216125d5c
Merge-request: 405
Task-number: QTCREATORBUG-6313
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-10-19 11:31:25 +02:00
hjk
5295e05310 minor style
Change-Id: Id21e8a3962550a1c66d761e718b48a8fcf4053e7
Reviewed-on: http://codereview.qt-project.org/5122
Reviewed-by: hjk <qthjk@ovi.com>
2011-09-19 11:24:14 +02:00
hjk
66ab323eb3 use Core::Id for IEditorFactory::id
Change-Id: Iefd67a0461d9016b8ba0f3371df7ec6d42e188c5
Reviewed-on: http://codereview.qt-project.org/4321
Reviewed-by: hjk <qthjk@ovi.com>
2011-09-08 17:40:53 +02:00
hjk
488330255d core: rename uniqueidmanager.{cpp,h} as the class UniqueIdManager is gone
Change-Id: Iffe04bc3bb0103cbac605f0734bbfd66eb7fd854
Reviewed-on: http://codereview.qt.nokia.com/4215
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
2011-09-05 18:04:55 +02:00
Kai Koehne
1757228278 New QTC_CHECK warning replacing QTC_ASSERT(x, /**/)
Warn if the condition fails, but otherwise don't change the execution
flow.

Change-Id: Id7b14c745109b66960add967b2a4ef8d31e1a546
Reviewed-on: http://codereview.qt.nokia.com/2389
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-07-29 12:19:11 +02:00
Tobias Hunger
7f33ef02e7 VCS: Do not hide virtual methods
Change-Id: I818eb8246f27b023e35155d50a8d08548660f709
Reviewed-on: http://codereview.qt.nokia.com/350
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2011-06-07 10:49:20 +02:00
cerf
9e5fc323ef vcsbase: remove facility tool buttons in EditorParameterWidget
Because diff options are VCS-specific, these methods were removed :
  VCSBaseEditorParameterWidget::addIgnoreWhiteSpaceButton()
  VCSBaseEditorParameterWidget::addIgnoreBlankLinesButton()
  Associated msg*Label() and msg*ToolTip()
This impacts cvs, hg, perforce, svn and bzr plugins

Change-Id: I8d213ed3915653b78bae9ba8b6cbbd65fa269ce2
Merge-request: 340
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Reviewed-on: http://codereview.qt.nokia.com/323
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
2011-06-03 16:02:08 +02:00
Tobias Hunger
aa2acec14c Fix/add copyright headers
Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
2011-05-06 15:17:05 +02:00
Orgad Shaneh
e237a84339 VCS: Added a shortcut for Diff Selected Files
Merge-request: 289
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2011-05-03 16:00:52 +02:00
Tobias Hunger
cceb0adbaa VCS: Use the configuration page in all the checkout wizards
Task-number: QTCREATORBUG-3752
2011-04-20 15:50:31 +02:00
Oswald Buddenhagen
45c9cf7a12 add/unify i/o error handling
lots of use of Utils::FileSaver and Utils::FileReader

Task-number: QTCREATORBUG-1619
2011-04-18 14:10:14 +02:00
Oswald Buddenhagen
469199e7a5 abort commit if commit message cannot be saved 2011-04-18 14:10:13 +02:00
Oswald Buddenhagen
e35fe2a770 file manager: introduce saveFile() and remove blockFileChange() & unblockFileChange()
this replaces the ever-repeating idiom block/save/unblock with a single
call.
2011-04-18 14:10:12 +02:00
Tobias Hunger
bcd8740a6e VCS: Notify project wizard about config changes
... and have the project wizard update the available VCS.

Task-number: QTCREATORBUG-4423
2011-04-15 17:45:34 +02:00