Commit 920d524d authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/3.0'

parents 223ecc70 580c1c35
...@@ -157,7 +157,14 @@ Component.prototype.createOperations = function() ...@@ -157,7 +157,14 @@ Component.prototype.createOperations = function()
component.qtCreatorBinaryPath, component.qtCreatorBinaryPath,
"@StartMenuDir@/Qt Creator.lnk", "@StartMenuDir@/Qt Creator.lnk",
"workingDirectory=@homeDir@" ); "workingDirectory=@homeDir@" );
component.addElevatedOperation("Execute", "{0,3010,1638}", "@TargetDir@\\lib\\vcredist_msvc2010\\vcredist_x86.exe", "/norestart", "/q");
// only install c runtime if it is needed, no minor version check of the c runtime till we need it
if (installer.value("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\VC\\VCRedist\\x86\\Installed") != 1) {
// return value 3010 means it need a reboot, but in most cases it is not needed for run Qt application
// return value 5100 means there's a newer version of the runtime already installed
component.addElevatedOperation("Execute", "{0,1638,3010,5100}", "@TargetDir@\\lib\\vcredist_msvc2010\\vcredist_x86.exe", "/norestart", "/q");
}
registerWindowsFileTypeExtensions(); registerWindowsFileTypeExtensions();
if (component.userInterface("AssociateCommonFiletypesForm").AssociateCommonFiletypesCheckBox if (component.userInterface("AssociateCommonFiletypesForm").AssociateCommonFiletypesCheckBox
...@@ -191,8 +198,9 @@ function isRoot() ...@@ -191,8 +198,9 @@ function isRoot()
Component.prototype.installationFinishedPageIsShown = function() Component.prototype.installationFinishedPageIsShown = function()
{ {
isroot = isRoot();
try { try {
if (component.installed && installer.isInstaller() && installer.status == QInstaller.Success && !isRoot()) { if (component.installed && installer.isInstaller() && installer.status == QInstaller.Success && !isroot) {
installer.addWizardPageItem( component, "LaunchQtCreatorCheckBoxForm", QInstaller.InstallationFinished ); installer.addWizardPageItem( component, "LaunchQtCreatorCheckBoxForm", QInstaller.InstallationFinished );
} }
} catch(e) { } catch(e) {
...@@ -203,7 +211,7 @@ Component.prototype.installationFinishedPageIsShown = function() ...@@ -203,7 +211,7 @@ Component.prototype.installationFinishedPageIsShown = function()
Component.prototype.installationFinished = function() Component.prototype.installationFinished = function()
{ {
try { try {
if (component.installed && installer.isInstaller() && installer.status == QInstaller.Success && !isRoot()) { if (component.installed && installer.isInstaller() && installer.status == QInstaller.Success && !isroot) {
var isLaunchQtCreatorCheckBoxChecked = component.userInterface("LaunchQtCreatorCheckBoxForm").launchQtCreatorCheckBox.checked; var isLaunchQtCreatorCheckBoxChecked = component.userInterface("LaunchQtCreatorCheckBoxForm").launchQtCreatorCheckBox.checked;
if (isLaunchQtCreatorCheckBoxChecked) if (isLaunchQtCreatorCheckBoxChecked)
installer.executeDetached(component.qtCreatorBinaryPath, new Array(), "@homeDir@"); installer.executeDetached(component.qtCreatorBinaryPath, new Array(), "@homeDir@");
......
#!/bin/bash #!/bin/bash
## Command line parameters ## Command line parameters
if [[ $# != 1 ]]; then if [[ $# != 2 ]]; then
cat <<USAGE cat <<USAGE
usage: usage:
$0 <version> $0 <version> <edition>
Creates tar and zip source package from HEAD of the main repository and submodules. Creates tar and zip source package from HEAD of the main repository and submodules.
Files and directories are named after <version>. Files and directories are named after qt-creator-<edition>-src-<version>.
example: example:
$0 2.2.0-beta $0 2.2.0-beta opensource
USAGE USAGE
exit 1 exit 1
fi fi
VERSION=$1 VERSION=$1
PREFIX=qt-creator-${VERSION}-src EDITION=$2
PREFIX=qt-creator-${EDITION}-src-${VERSION}
cd `dirname $0`/.. cd `dirname $0`/..
RESULTDIR=`pwd` RESULTDIR=`pwd`
TEMPSOURCES=`mktemp -d -t qtcCreatorSourcePackage.XXXXXX` TEMPSOURCES=`mktemp -d -t qtcCreatorSourcePackage.XXXXXX`
......
/* File generated by Qt Creator, version 2.7.0 */ /* File generated by Qt Creator */
import QmlProject 1.1 import QmlProject 1.1
......
/* File generated by Qt Creator, version 2.7.0 */ /* File generated by Qt Creator */
import QmlProject 1.1 import QmlProject 1.1
......
/* File generated by Qt Creator, version 2.7.0 */ /* File generated by Qt Creator */
import QmlProject 1.1 import QmlProject 1.1
......
...@@ -38,10 +38,12 @@ Rectangle { ...@@ -38,10 +38,12 @@ Rectangle {
CustomizedGridView { CustomizedGridView {
id: grid id: grid
anchors.rightMargin: 38 anchors.rightMargin: 38
anchors.bottomMargin: 60
anchors.leftMargin: 38 anchors.leftMargin: 38
anchors.topMargin: 82 anchors.left: parent.left
anchors.fill: parent anchors.right: parent.right
height: scrollView.height - 82
y: scrollView.flickableItem.contentY + 82
contentY: scrollView.flickableItem.contentY
model: examplesModel model: examplesModel
} }
......
...@@ -117,7 +117,7 @@ Rectangle { ...@@ -117,7 +117,7 @@ Rectangle {
y: 170 y: 170
color: colors.strongForegroundColor color: colors.strongForegroundColor
text: qsTr("2D PAINTING EXAMPLE long description") text: qsTr("2D PAINTING EXAMPLE long description")
clip: true elide: Text.ElideRight
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 16 anchors.rightMargin: 16
anchors.left: parent.left anchors.left: parent.left
...@@ -330,7 +330,6 @@ Rectangle { ...@@ -330,7 +330,6 @@ Rectangle {
height: 32 height: 32
anchors.left: tags.right anchors.left: tags.right
anchors.leftMargin: 6 anchors.leftMargin: 6
clip: true
spacing: 2 spacing: 2
...@@ -355,7 +354,7 @@ Rectangle { ...@@ -355,7 +354,7 @@ Rectangle {
onClicked: appendTag(modelData) onClicked: appendTag(modelData)
property bool hugeTag: (text.length > 12) && index > 1 property bool hugeTag: (text.length > 12) && index > 1
property bool isExampleTag: text === "example" property bool isExampleTag: text === "example"
visible: !hugeTag && !isExampleTag && index < 8 visible: !hugeTag && !isExampleTag && index < 8 && y < 32
} }
} }
} }
......
...@@ -51,6 +51,7 @@ Column { ...@@ -51,6 +51,7 @@ Column {
onClicked: { onClicked: {
customTab.currentIndex = index customTab.currentIndex = index
checked = true
} }
} }
} }
......
...@@ -137,12 +137,6 @@ public: ...@@ -137,12 +137,6 @@ public:
void setVariadic(bool isVariadic) void setVariadic(bool isVariadic)
{ f._variadic = isVariadic; } { f._variadic = isVariadic; }
bool isPredefined() const
{ return f._predefined; }
void setPredefined(bool isPredefined)
{ f._predefined = isPredefined; }
QString toString() const; QString toString() const;
QString toStringWithLineBreaks() const; QString toStringWithLineBreaks() const;
...@@ -157,7 +151,6 @@ private: ...@@ -157,7 +151,6 @@ private:
unsigned _hidden: 1; unsigned _hidden: 1;
unsigned _functionLike: 1; unsigned _functionLike: 1;
unsigned _variadic: 1; unsigned _variadic: 1;
unsigned _predefined: 1;
}; };
QByteArray _name; QByteArray _name;
......
...@@ -36,9 +36,6 @@ QT_FORWARD_DECLARE_CLASS(QChar) ...@@ -36,9 +36,6 @@ QT_FORWARD_DECLARE_CLASS(QChar)
namespace CPlusPlus { namespace CPlusPlus {
class BackwardsScanner;
class TokenCache;
class CPLUSPLUS_EXPORT MatchingText class CPLUSPLUS_EXPORT MatchingText
{ {
public: public:
......
...@@ -917,21 +917,23 @@ bool Preprocessor::handleIdentifier(PPToken *tk) ...@@ -917,21 +917,23 @@ bool Preprocessor::handleIdentifier(PPToken *tk)
&& macroNameRef[0] == '_' && macroNameRef[0] == '_'
&& macroNameRef[1] == '_') { && macroNameRef[1] == '_') {
PPToken newTk; PPToken newTk;
QByteArray txt;
if (macroNameRef == ppLine) { if (macroNameRef == ppLine) {
txt = QByteArray::number(tk->lineno); QByteArray txt = QByteArray::number(tk->lineno);
newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false); newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false);
} else if (macroNameRef == ppFile) { } else if (macroNameRef == ppFile) {
QByteArray txt;
txt.append('"'); txt.append('"');
txt.append(m_env->currentFileUtf8); txt.append(m_env->currentFileUtf8);
txt.append('"'); txt.append('"');
newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false); newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false);
} else if (macroNameRef == ppDate) { } else if (macroNameRef == ppDate) {
QByteArray txt;
txt.append('"'); txt.append('"');
txt.append(QDate::currentDate().toString().toUtf8()); txt.append(QDate::currentDate().toString().toUtf8());
txt.append('"'); txt.append('"');
newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false); newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false);
} else if (macroNameRef == ppTime) { } else if (macroNameRef == ppTime) {
QByteArray txt;
txt.append('"'); txt.append('"');
txt.append(QTime::currentTime().toString().toUtf8()); txt.append(QTime::currentTime().toString().toUtf8());
txt.append('"'); txt.append('"');
...@@ -939,14 +941,10 @@ bool Preprocessor::handleIdentifier(PPToken *tk) ...@@ -939,14 +941,10 @@ bool Preprocessor::handleIdentifier(PPToken *tk)
} }
if (newTk.hasSource()) { if (newTk.hasSource()) {
Macro macro; newTk.f.newline = tk->newline();
macro.setName(macroNameRef.toByteArray()); newTk.f.whitespace = tk->whitespace();
macro.setFileName(m_env->currentFile); *tk = newTk;
macro.setPredefined(true); return false;
macro.setDefinition(txt, QVector<PPToken>() << newTk);
m_env->bind(macro);
if (m_client)
m_client->macroAdded(macro);
} }
} }
......
...@@ -797,12 +797,10 @@ const Macro *CPPEditorWidget::findCanonicalMacro(const QTextCursor &cursor, Docu ...@@ -797,12 +797,10 @@ const Macro *CPPEditorWidget::findCanonicalMacro(const QTextCursor &cursor, Docu
if (const Macro *macro = doc->findMacroDefinitionAt(line)) { if (const Macro *macro = doc->findMacroDefinitionAt(line)) {
QTextCursor macroCursor = cursor; QTextCursor macroCursor = cursor;
const QByteArray name = identifierUnderCursor(&macroCursor).toLatin1(); const QByteArray name = identifierUnderCursor(&macroCursor).toLatin1();
if (macro->name() == name && !macro->isPredefined()) if (macro->name() == name)
return macro; return macro;
} else if (const Document::MacroUse *use = doc->findMacroUseAt(cursor.position())) { } else if (const Document::MacroUse *use = doc->findMacroUseAt(cursor.position())) {
const Macro &macro = use->macro(); return &use->macro();
if (!macro.isPredefined())
return &macro;
} }
return 0; return 0;
......
...@@ -592,12 +592,10 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor & ...@@ -592,12 +592,10 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
m_widget->showPreProcessorWidget(); m_widget->showPreProcessorWidget();
} else if (fileName != CppModelManagerInterface::configurationFileName()) { } else if (fileName != CppModelManagerInterface::configurationFileName()) {
const Macro &macro = use->macro(); const Macro &macro = use->macro();
if (!macro.isPredefined()) { link.targetFileName = macro.fileName();
link.targetFileName = macro.fileName(); link.targetLine = macro.line();
link.targetLine = macro.line(); link.linkTextStart = use->begin();
link.linkTextStart = use->begin(); link.linkTextEnd = use->end();
link.linkTextEnd = use->end();
}
} }
return link; return link;
} }
......
...@@ -558,8 +558,6 @@ restart_search: ...@@ -558,8 +558,6 @@ restart_search:
usages.clear(); usages.clear();
foreach (const Document::MacroUse &use, doc->macroUses()) { foreach (const Document::MacroUse &use, doc->macroUses()) {
const Macro &useMacro = use.macro(); const Macro &useMacro = use.macro();
if (useMacro.isPredefined())
continue;
if (useMacro.fileName() == macro.fileName()) { // Check if this is a match, but possibly against an outdated document. if (useMacro.fileName() == macro.fileName()) { // Check if this is a match, but possibly against an outdated document.
if (source.isEmpty()) if (source.isEmpty())
......
...@@ -58,9 +58,6 @@ QFuture<TextEditor::HighlightingResult> CppHighlightingSupportInternal::highligh ...@@ -58,9 +58,6 @@ QFuture<TextEditor::HighlightingResult> CppHighlightingSupportInternal::highligh
// Get macro definitions // Get macro definitions
foreach (const CPlusPlus::Macro& macro, doc->definedMacros()) { foreach (const CPlusPlus::Macro& macro, doc->definedMacros()) {
if (macro.isPredefined())
continue; // No "real" definition location
int line, column; int line, column;
editor()->convertPosition(macro.offset(), &line, &column); editor()->convertPosition(macro.offset(), &line, &column);
++column; //Highlighting starts at (column-1) --> compensate here ++column; //Highlighting starts at (column-1) --> compensate here
......
...@@ -33,7 +33,9 @@ ...@@ -33,7 +33,9 @@
#include <QDateTime> #include <QDateTime>
#include <QDebug> #include <QDebug>
#include <QHostAddress> #include <QHostAddress>
#if QT_VERSION >= 0x050200
#include <QTimeZone> #include <QTimeZone>
#endif
#include <ctype.h> #include <ctype.h>
...@@ -504,6 +506,7 @@ static QTime timeFromData(int ms) ...@@ -504,6 +506,7 @@ static QTime timeFromData(int ms)
return ms == -1 ? QTime() : QTime(0, 0, 0, 0).addMSecs(ms); return ms == -1 ? QTime() : QTime(0, 0, 0, 0).addMSecs(ms);
} }
#if QT_VERSION >= 0x050200
// Stolen and adapted from qdatetime.cpp // Stolen and adapted from qdatetime.cpp
static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time) static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time)
{ {
...@@ -550,6 +553,7 @@ static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time) ...@@ -550,6 +553,7 @@ static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time)
*date = (status & NullDate) ? QDate() : QDate::fromJulianDay(jd); *date = (status & NullDate) ? QDate() : QDate::fromJulianDay(jd);
*time = (status & NullTime) ? QTime() : QTime::fromMSecsSinceStartOfDay(ds); *time = (status & NullTime) ? QTime() : QTime::fromMSecsSinceStartOfDay(ds);
} }
#endif
QString decodeData(const QByteArray &ba, int encoding) QString decodeData(const QByteArray &ba, int encoding)
{ {
...@@ -678,6 +682,7 @@ QString decodeData(const QByteArray &ba, int encoding) ...@@ -678,6 +682,7 @@ QString decodeData(const QByteArray &ba, int encoding)
return QString::fromUtf8(decodedBa); return QString::fromUtf8(decodedBa);
} }
case DateTimeInternal: { // 29, DateTimeInternal: msecs, spec, offset, tz, status case DateTimeInternal: { // 29, DateTimeInternal: msecs, spec, offset, tz, status
#if QT_VERSION >= 0x050200
int p0 = ba.indexOf('/'); int p0 = ba.indexOf('/');
int p1 = ba.indexOf('/', p0 + 1); int p1 = ba.indexOf('/', p0 + 1);
int p2 = ba.indexOf('/', p1 + 1); int p2 = ba.indexOf('/', p1 + 1);
...@@ -708,6 +713,10 @@ QString decodeData(const QByteArray &ba, int encoding) ...@@ -708,6 +713,10 @@ QString decodeData(const QByteArray &ba, int encoding)
dateTime = QDateTime(date, time, spec); dateTime = QDateTime(date, time, spec);
} }
return dateTime.toString(); return dateTime.toString();
#else
// "Very plain".
return QString::fromLatin1(ba);
#endif
} }
} }
qDebug() << "ENCODING ERROR: " << encoding; qDebug() << "ENCODING ERROR: " << encoding;
......
...@@ -2219,6 +2219,17 @@ void FakeVimPlugin::test_vim_substitute() ...@@ -2219,6 +2219,17 @@ void FakeVimPlugin::test_vim_substitute()
COMMAND("'<,'>s/^/*", "abc" N "**def" N X "**ghi" N "jkl"); COMMAND("'<,'>s/^/*", "abc" N "**def" N X "**ghi" N "jkl");
KEYS("u", "abc" N X "*def" N "*ghi" N "jkl"); KEYS("u", "abc" N X "*def" N "*ghi" N "jkl");
KEYS("gv:s/^/+<CR>", "abc" N "+*def" N X "+*ghi" N "jkl"); KEYS("gv:s/^/+<CR>", "abc" N "+*def" N X "+*ghi" N "jkl");
// replace empty string
data.setText("abc");
COMMAND("s//--/g", "--a--b--c");
// remove characters
data.setText("abc def");
COMMAND("s/[abde]//g", "c f");
COMMAND("undo | s/[bcef]//g", "a d");
COMMAND("undo | s/\\w//g", " ");
COMMAND("undo | s/f\\|$/-/g", "abc de-");
} }
void FakeVimPlugin::test_vim_ex_yank() void FakeVimPlugin::test_vim_ex_yank()
......
...@@ -623,10 +623,22 @@ static bool substituteText(QString *text, QRegExp &pattern, const QString &repla ...@@ -623,10 +623,22 @@ static bool substituteText(QString *text, QRegExp &pattern, const QString &repla
{ {
bool substituted = false; bool substituted = false;
int pos = 0; int pos = 0;
int right = -1;
while (true) { while (true) {
pos = pattern.indexIn(*text, pos, QRegExp::CaretAtZero); pos = pattern.indexIn(*text, pos, QRegExp::CaretAtZero);
if (pos == -1) if (pos == -1)
break; break;
// ensure that substitution is advancing towards end of line
if (right == text->size() - pos) {
++pos;
if (pos == text->size())
break;
continue;
}
right = text->size() - pos;
substituted = true; substituted = true;
QString matched = text->mid(pos, pattern.cap(0).size()); QString matched = text->mid(pos, pattern.cap(0).size());
QString repl; QString repl;
...@@ -652,7 +664,7 @@ static bool substituteText(QString *text, QRegExp &pattern, const QString &repla ...@@ -652,7 +664,7 @@ static bool substituteText(QString *text, QRegExp &pattern, const QString &repla
} }
} }
text->replace(pos, matched.size(), repl); text->replace(pos, matched.size(), repl);
pos += qMax(1, repl.size()); pos += (repl.isEmpty() && matched.isEmpty()) ? 1 : repl.size();
if (pos >= text->size() || !global) if (pos >= text->size() || !global)
break; break;
......
...@@ -113,7 +113,8 @@ void IosConfigurations::updateAutomaticKitList() ...@@ -113,7 +113,8 @@ void IosConfigurations::updateAutomaticKitList()
iter.next(); iter.next();
const Platform &p = iter.value(); const Platform &p = iter.value();
if (p.compilerPath == toolchain->compilerCommand() if (p.compilerPath == toolchain->compilerCommand()
&& p.backendFlags == toolchain->platformCodeGenFlags()) { && p.backendFlags == toolchain->platformCodeGenFlags()
&& !platformToolchainMap.contains(p.name)) {
platformToolchainMap[p.name] = toolchain; platformToolchainMap[p.name] = toolchain;
found = true; found = true;
} }
...@@ -251,7 +252,7 @@ void IosConfigurations::updateAutomaticKitList() ...@@ -251,7 +252,7 @@ void IosConfigurations::updateAutomaticKitList()
qDebug() << "skipping existing kit with deviceKind " << deviceKind.toString(); qDebug() << "skipping existing kit with deviceKind " << deviceKind.toString();
continue; continue;
} }
if (!k->isAutoDetected()) // use also used set kits? if (!k->isAutoDetected())
continue; continue;
existingKits << k; existingKits << k;
kitMatched << false; kitMatched << false;
...@@ -285,15 +286,20 @@ void IosConfigurations::updateAutomaticKitList() ...@@ -285,15 +286,20 @@ void IosConfigurations::updateAutomaticKitList()
QList<BaseQtVersion *> qtVersions = qtVersionsForArch.value(arch); QList<BaseQtVersion *> qtVersions = qtVersionsForArch.value(arch);
foreach (BaseQtVersion *qt, qtVersions) { foreach (BaseQtVersion *qt, qtVersions) {
Kit *kitAtt = 0;
bool kitExists = false; bool kitExists = false;
for (int i = 0; i < existingKits.size(); ++i) { for (int i = 0; i < existingKits.size(); ++i) {
Kit *k = existingKits.at(i); Kit *k = existingKits.at(i);
if (DeviceTypeKitInformation::deviceTypeId(k) == pDeviceType if (DeviceTypeKitInformation::deviceTypeId(k) == pDeviceType
&& ToolChainKitInformation::toolChain(k) == pToolchain && ToolChainKitInformation::toolChain(k) == pToolchain
&& SysRootKitInformation::sysRoot(k) == p.sdkPath
&& QtKitInformation::qtVersion(k) == qt) && QtKitInformation::qtVersion(k) == qt)
{ {
QTC_CHECK(!kitMatched.value(i, true));
// as we generate only two kits per qt (one for device and one for simulator)
// we do not compare the sdk (thus automatically upgrading it in place if a
// new Xcode is used). Change?
kitExists = true; kitExists = true;
kitAtt = k;
if (debugProbe) if (debugProbe)
qDebug() << "found existing kit " << k->displayName() << " for " << p.name qDebug() << "found existing kit " << k->displayName() << " for " << p.name
<< "," << qt->displayName(); << "," << qt->displayName();
...@@ -302,74 +308,65 @@ void IosConfigurations::updateAutomaticKitList() ...@@ -302,74 +308,65 @@ void IosConfigurations::updateAutomaticKitList()
break; break;
} }
} }
if (kitExists) if (kitExists) {
continue; kitAtt->blockNotification();
if (debugProbe) } else {
qDebug() << "setting up new kit for " << p.name; if (debugProbe)
Kit *newKit = new Kit; qDebug() << "setting up new kit for " << p.name;
newKit->setAutoDetected(true); kitAtt = new Kit;
QString baseDisplayName = tr("%1 %2").arg(p.name, qt->displayName()); kitAtt->setAutoDetected(true);
QString displayName = baseDisplayName; QString baseDisplayName = tr("%1 %2").arg(p.name, qt->displayName());
for (int iVers = 1; iVers < 100; ++iVers) { QString displayName = baseDisplayName;
bool unique = true; for (int iVers = 1; iVers < 100; ++iVers) {
foreach (const Kit *k, existingKits) { bool unique = true;
if (k->displayName() == displayName) { foreach (const Kit *k, existingKits) {
unique = false; if (k->displayName() == displayName) {
break; unique = false;
break;
}
} }
if (unique) break;
displayName = baseDisplayName + QLatin1String("-") + QString::number(iVers);