#!/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>
Distinguish from const char * one.
QString ctor is yet to be removed
Change-Id: I2da231036c6417353b0566d39666d918ad141c6d
Reviewed-by: hjk <qthjk@ovi.com>
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>
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>
Actual path is found on startup and when setting is changed
Change-Id: If2cb0735953b9fb64df7425230c98efb384d9287
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Also removed all <QMainWindow> includes which are not needed
anymore.
Change-Id: I393c9a62a5c6df95d9f35d872e1473a4f13bcdc4
Reviewed-by: hjk <qthjk@ovi.com>
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>
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>
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>
This also allows simple setting of breakpoints on failed asserts.
Change-Id: I6dd84cbfaf659d57e39f3447386cebc0221b2b84
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
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>
Getting the #include directives ready for Qt5. This includes the
new-project wizards.
Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
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>
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>
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>