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()
component.qtCreatorBinaryPath,
"@StartMenuDir@/Qt Creator.lnk",
"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();
if (component.userInterface("AssociateCommonFiletypesForm").AssociateCommonFiletypesCheckBox
......@@ -191,8 +198,9 @@ function isRoot()
Component.prototype.installationFinishedPageIsShown = function()
{
isroot = isRoot();
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 );
}
} catch(e) {
......@@ -203,7 +211,7 @@ Component.prototype.installationFinishedPageIsShown = function()
Component.prototype.installationFinished = function()
{
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;
if (isLaunchQtCreatorCheckBoxChecked)
installer.executeDetached(component.qtCreatorBinaryPath, new Array(), "@homeDir@");
......
#!/bin/bash
## Command line parameters
if [[ $# != 1 ]]; then
if [[ $# != 2 ]]; then
cat <<USAGE
usage:
$0 <version>
$0 <version> <edition>
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:
$0 2.2.0-beta
$0 2.2.0-beta opensource
USAGE
exit 1
fi
VERSION=$1
PREFIX=qt-creator-${VERSION}-src
EDITION=$2
PREFIX=qt-creator-${EDITION}-src-${VERSION}
cd `dirname $0`/..
RESULTDIR=`pwd`
TEMPSOURCES=`mktemp -d -t qtcCreatorSourcePackage.XXXXXX`
......
/* File generated by Qt Creator, version 2.7.0 */
/* File generated by Qt Creator */
import QmlProject 1.1
......
/* File generated by Qt Creator, version 2.7.0 */
/* File generated by Qt Creator */
import QmlProject 1.1
......
/* File generated by Qt Creator, version 2.7.0 */
/* File generated by Qt Creator */
import QmlProject 1.1
......
......@@ -38,10 +38,12 @@ Rectangle {
CustomizedGridView {
id: grid
anchors.rightMargin: 38
anchors.bottomMargin: 60
anchors.leftMargin: 38
anchors.topMargin: 82
anchors.fill: parent
anchors.left: parent.left
anchors.right: parent.right
height: scrollView.height - 82
y: scrollView.flickableItem.contentY + 82
contentY: scrollView.flickableItem.contentY
model: examplesModel
}
......
......@@ -117,7 +117,7 @@ Rectangle {
y: 170
color: colors.strongForegroundColor
text: qsTr("2D PAINTING EXAMPLE long description")
clip: true
elide: Text.ElideRight
anchors.right: parent.right
anchors.rightMargin: 16
anchors.left: parent.left
......@@ -330,7 +330,6 @@ Rectangle {
height: 32
anchors.left: tags.right
anchors.leftMargin: 6
clip: true
spacing: 2
......@@ -355,7 +354,7 @@ Rectangle {
onClicked: appendTag(modelData)
property bool hugeTag: (text.length > 12) && index > 1
property bool isExampleTag: text === "example"
visible: !hugeTag && !isExampleTag && index < 8
visible: !hugeTag && !isExampleTag && index < 8 && y < 32
}
}
}
......
......@@ -51,6 +51,7 @@ Column {
onClicked: {
customTab.currentIndex = index
checked = true
}
}
}
......
......@@ -137,12 +137,6 @@ public:
void setVariadic(bool isVariadic)
{ f._variadic = isVariadic; }
bool isPredefined() const
{ return f._predefined; }
void setPredefined(bool isPredefined)
{ f._predefined = isPredefined; }
QString toString() const;
QString toStringWithLineBreaks() const;
......@@ -157,7 +151,6 @@ private:
unsigned _hidden: 1;
unsigned _functionLike: 1;
unsigned _variadic: 1;
unsigned _predefined: 1;
};
QByteArray _name;
......
......@@ -36,9 +36,6 @@ QT_FORWARD_DECLARE_CLASS(QChar)
namespace CPlusPlus {
class BackwardsScanner;
class TokenCache;
class CPLUSPLUS_EXPORT MatchingText
{
public:
......
......@@ -917,21 +917,23 @@ bool Preprocessor::handleIdentifier(PPToken *tk)
&& macroNameRef[0] == '_'
&& macroNameRef[1] == '_') {
PPToken newTk;
QByteArray txt;
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);
} else if (macroNameRef == ppFile) {
QByteArray txt;
txt.append('"');
txt.append(m_env->currentFileUtf8);
txt.append('"');
newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false);
} else if (macroNameRef == ppDate) {
QByteArray txt;
txt.append('"');
txt.append(QDate::currentDate().toString().toUtf8());
txt.append('"');
newTk = generateToken(T_STRING_LITERAL, txt.constData(), txt.size(), tk->lineno, false);
} else if (macroNameRef == ppTime) {
QByteArray txt;
txt.append('"');
txt.append(QTime::currentTime().toString().toUtf8());
txt.append('"');
......@@ -939,14 +941,10 @@ bool Preprocessor::handleIdentifier(PPToken *tk)
}
if (newTk.hasSource()) {
Macro macro;
macro.setName(macroNameRef.toByteArray());
macro.setFileName(m_env->currentFile);
macro.setPredefined(true);
macro.setDefinition(txt, QVector<PPToken>() << newTk);
m_env->bind(macro);
if (m_client)
m_client->macroAdded(macro);
newTk.f.newline = tk->newline();
newTk.f.whitespace = tk->whitespace();
*tk = newTk;
return false;
}
}
......
......@@ -797,12 +797,10 @@ const Macro *CPPEditorWidget::findCanonicalMacro(const QTextCursor &cursor, Docu
if (const Macro *macro = doc->findMacroDefinitionAt(line)) {
QTextCursor macroCursor = cursor;
const QByteArray name = identifierUnderCursor(&macroCursor).toLatin1();
if (macro->name() == name && !macro->isPredefined())
if (macro->name() == name)
return macro;
} else if (const Document::MacroUse *use = doc->findMacroUseAt(cursor.position())) {
const Macro &macro = use->macro();
if (!macro.isPredefined())
return &macro;
return &use->macro();
}
return 0;
......
......@@ -592,12 +592,10 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
m_widget->showPreProcessorWidget();
} else if (fileName != CppModelManagerInterface::configurationFileName()) {
const Macro &macro = use->macro();
if (!macro.isPredefined()) {
link.targetFileName = macro.fileName();
link.targetLine = macro.line();
link.linkTextStart = use->begin();
link.linkTextEnd = use->end();
}
link.targetFileName = macro.fileName();
link.targetLine = macro.line();
link.linkTextStart = use->begin();
link.linkTextEnd = use->end();
}
return link;
}
......
......@@ -558,8 +558,6 @@ restart_search:
usages.clear();
foreach (const Document::MacroUse &use, doc->macroUses()) {
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 (source.isEmpty())
......
......@@ -58,9 +58,6 @@ QFuture<TextEditor::HighlightingResult> CppHighlightingSupportInternal::highligh
// Get macro definitions
foreach (const CPlusPlus::Macro& macro, doc->definedMacros()) {
if (macro.isPredefined())
continue; // No "real" definition location
int line, column;
editor()->convertPosition(macro.offset(), &line, &column);
++column; //Highlighting starts at (column-1) --> compensate here
......
......@@ -33,7 +33,9 @@
#include <QDateTime>
#include <QDebug>
#include <QHostAddress>
#if QT_VERSION >= 0x050200
#include <QTimeZone>
#endif
#include <ctype.h>
......@@ -504,6 +506,7 @@ static QTime timeFromData(int ms)
return ms == -1 ? QTime() : QTime(0, 0, 0, 0).addMSecs(ms);
}
#if QT_VERSION >= 0x050200
// Stolen and adapted from qdatetime.cpp
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);
*time = (status & NullTime) ? QTime() : QTime::fromMSecsSinceStartOfDay(ds);
}
#endif
QString decodeData(const QByteArray &ba, int encoding)
{
......@@ -678,6 +682,7 @@ QString decodeData(const QByteArray &ba, int encoding)
return QString::fromUtf8(decodedBa);
}
case DateTimeInternal: { // 29, DateTimeInternal: msecs, spec, offset, tz, status
#if QT_VERSION >= 0x050200
int p0 = ba.indexOf('/');
int p1 = ba.indexOf('/', p0 + 1);
int p2 = ba.indexOf('/', p1 + 1);
......@@ -708,6 +713,10 @@ QString decodeData(const QByteArray &ba, int encoding)
dateTime = QDateTime(date, time, spec);
}
return dateTime.toString();
#else
// "Very plain".
return QString::fromLatin1(ba);
#endif
}
}
qDebug() << "ENCODING ERROR: " << encoding;
......
......@@ -2219,6 +2219,17 @@ void FakeVimPlugin::test_vim_substitute()
COMMAND("'<,'>s/^/*", "abc" N "**def" N X "**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");
// 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()
......
......@@ -623,10 +623,22 @@ static bool substituteText(QString *text, QRegExp &pattern, const QString &repla
{
bool substituted = false;
int pos = 0;
int right = -1;
while (true) {
pos = pattern.indexIn(*text, pos, QRegExp::CaretAtZero);
if (pos == -1)
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;
QString matched = text->mid(pos, pattern.cap(0).size());
QString repl;
......@@ -652,7 +664,7 @@ static bool substituteText(QString *text, QRegExp &pattern, const QString &repla
}
}
text->replace(pos, matched.size(), repl);
pos += qMax(1, repl.size());
pos += (repl.isEmpty() && matched.isEmpty()) ? 1 : repl.size();
if (pos >= text->size() || !global)
break;
......
......@@ -113,7 +113,8 @@ void IosConfigurations::updateAutomaticKitList()
iter.next();
const Platform &p = iter.value();
if (p.compilerPath == toolchain->compilerCommand()
&& p.backendFlags == toolchain->platformCodeGenFlags()) {
&& p.backendFlags == toolchain->platformCodeGenFlags()
&& !platformToolchainMap.contains(p.name)) {
platformToolchainMap[p.name] = toolchain;
found = true;
}
......@@ -251,7 +252,7 @@ void IosConfigurations::updateAutomaticKitList()
qDebug() << "skipping existing kit with deviceKind " << deviceKind.toString();
continue;
}
if (!k->isAutoDetected()) // use also used set kits?
if (!k->isAutoDetected())
continue;
existingKits << k;
kitMatched << false;
......@@ -285,15 +286,20 @@ void IosConfigurations::updateAutomaticKitList()
QList<BaseQtVersion *> qtVersions = qtVersionsForArch.value(arch);
foreach (BaseQtVersion *qt, qtVersions) {
Kit *kitAtt = 0;
bool kitExists = false;
for (int i = 0; i < existingKits.size(); ++i) {
Kit *k = existingKits.at(i);
if (DeviceTypeKitInformation::deviceTypeId(k) == pDeviceType
&& ToolChainKitInformation::toolChain(k) == pToolchain
&& SysRootKitInformation::sysRoot(k) == p.sdkPath
&& 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;
kitAtt = k;
if (debugProbe)
qDebug() << "found existing kit " << k->displayName() << " for " << p.name
<< "," << qt->displayName();
......@@ -302,74 +308,65 @@ void IosConfigurations::updateAutomaticKitList()
break;
}
}
if (kitExists)
continue;
if (debugProbe)
qDebug() << "setting up new kit for " << p.name;
Kit *newKit = new Kit;
newKit->setAutoDetected(true);
QString baseDisplayName = tr("%1 %2").arg(p.name, qt->displayName());
QString displayName = baseDisplayName;
for (int iVers = 1; iVers < 100; ++iVers) {
bool unique = true;
foreach (const Kit *k, existingKits) {
if (k->displayName() == displayName) {
unique = false;
break;
if (kitExists) {
kitAtt->blockNotification();
} else {
if (debugProbe)
qDebug() << "setting up new kit for " << p.name;
kitAtt = new Kit;
kitAtt->setAutoDetected(true);
QString baseDisplayName = tr("%1 %2").arg(p.name, qt->displayName());
QString displayName = baseDisplayName;
for (int iVers = 1; iVers < 100; ++iVers) {
bool unique = true;
foreach (const Kit *k, existingKits) {
if (k->displayName() == displayName) {
unique = false;
break;
}
}
if (unique) break;
displayName = baseDisplayName + QLatin1String("-") + QString::number(iVers);
}
if (unique) break;
displayName = baseDisplayName + QLatin1String("-") + QString::number(iVers);
kitAtt->setDisplayName(displayName);
}
newKit->setDisplayName(displayName);
newKit->setIconPath(Utils::FileName::fromString(
kitAtt->setIconPath(Utils::FileName::fromString(
QLatin1String(Constants::IOS_SETTINGS_CATEGORY_ICON)));
DeviceTypeKitInformation::setDeviceTypeId(newKit, pDeviceType);
ToolChainKitInformation::setToolChain(newKit, pToolchain);
QtKitInformation::setQtVersion(newKit, qt);
//DeviceKitInformation::setDevice(newKit, device);
if (!debuggerId.isValid())
Debugger::DebuggerKitInformation::setDebugger(newKit,
DeviceTypeKitInformation::setDeviceTypeId(kitAtt, pDeviceType);
ToolChainKitInformation::setToolChain(kitAtt, pToolchain);
QtKitInformation::setQtVersion(kitAtt, qt);
if ((!Debugger::DebuggerKitInformation::debugger(kitAtt)
|| !Debugger::DebuggerKitInformation::debugger(kitAtt)->isValid()
|| Debugger::DebuggerKitInformation::debugger(kitAtt)->engineType() != Debugger::LldbEngineType)
&& debuggerId.isValid())
Debugger::DebuggerKitInformation::setDebugger(kitAtt,
debuggerId);
newKit->setMutable(DeviceKitInformation::id(), true);
newKit->setSticky(QtKitInformation::id(), true);
newKit->setSticky(ToolChainKitInformation::id(), true);
newKit->setSticky(DeviceTypeKitInformation::id(), true);
newKit->setSticky(SysRootKitInformation::id(), true);
kitAtt->setMutable(DeviceKitInformation::id(), true);
kitAtt->setSticky(QtKitInformation::id(), true);
kitAtt->setSticky(ToolChainKitInformation::id(), true);
kitAtt->setSticky(DeviceTypeKitInformation::id(), true);
kitAtt->setSticky(SysRootKitInformation::id(), true);
kitAtt->setSticky(Debugger::DebuggerKitInformation::id(), false);
SysRootKitInformation::setSysRoot(newKit, p.sdkPath);
SysRootKitInformation::setSysRoot(kitAtt, p.sdkPath);
// QmakeProjectManager::QmakeKitInformation::setMkspec(newKit,
// Utils::FileName::fromString(QLatin1String("macx-ios-clang")));
KitManager::registerKit(newKit);
existingKits << newKit;
if (kitExists) {
kitAtt->unblockNotification();
} else {
KitManager::registerKit(kitAtt);
existingKits << kitAtt;
}
}
}
}
for (int i = 0; i < kitMatched.size(); ++i) {
// deleting extra (old) kits
if (!kitMatched.at(i) && !existingKits.at(i)->isValid()) {
if (!kitMatched.at(i)) {
qDebug() << "deleting kit " << existingKits.at(i)->displayName();
KitManager::deregisterKit(existingKits.at(i));
}
// fix old kits
if (kitMatched.at(i)) {
Kit *kit = existingKits.at(i);
kit->blockNotification();
const Debugger::DebuggerItem *debugger = Debugger::DebuggerKitInformation::debugger(kit);
if ((!debugger || !debugger->isValid()) && debuggerId.isValid())
Debugger::DebuggerKitInformation::setDebugger(kit, debuggerId);
if (!kit->isMutable(DeviceKitInformation::id())) {
kit->setMutable(DeviceKitInformation::id(), true);
kit->setSticky(QtKitInformation::id(), true);
kit->setSticky(ToolChainKitInformation::id(), true);
kit->setSticky(DeviceTypeKitInformation::id(), true);
kit->setSticky(SysRootKitInformation::id(), true);
}
if (kit->isSticky(Debugger::DebuggerKitInformation::id()))
kit->setSticky(Debugger::DebuggerKitInformation::id(), false);
kit->unblockNotification();
}
}
}
......
......@@ -514,8 +514,6 @@ Rectangle {
x: 0
y: 0
function toggleEnabled() {enabled = !enabled}
function toggleVisible() {visible = !visible}
function updateZoomLevel() {
zoomSlider.externalUpdate = true;
zoomSlider.value = Math.pow((view.endTime - view.startTime) / qmlProfilerModelProxy.traceDuration(), 1 / zoomSlider.exponent) * zoomSlider.maximumValue;
......
......@@ -192,10 +192,22 @@ void QmlProfilerTraceView::reset()
connect(this, SIGNAL(jumpToNext()), rootObject, SLOT(nextEvent()));
connect(rootObject, SIGNAL(selectedEventChanged(int)), this, SIGNAL(selectedEventChanged(int)));
connect(rootObject, SIGNAL(changeToolTip(QString)), this, SLOT(updateToolTip(QString)));
connect(this, SIGNAL(enableToolbar(bool)), this, SLOT(setZoomSliderEnabled(bool)));
connect(this, SIGNAL(showZoomSlider(bool)), this, SLOT(setZoomSliderVisible(bool)));
}
QObject *zoomSlider = rootObject->findChild<QObject*>(QLatin1String("zoomSliderToolBar"));
connect(this, SIGNAL(enableToolbar(bool)), zoomSlider, SLOT(toggleEnabled()));
connect(this, SIGNAL(showZoomSlider(bool)), zoomSlider, SLOT(toggleVisible()));
void QmlProfilerTraceView::setZoomSliderEnabled(bool enabled)
{
QQuickItem *zoomSlider = d->m_mainView->rootObject()->findChild<QQuickItem*>(QLatin1String("zoomSliderToolBar"));
if (zoomSlider->isEnabled() != enabled)
zoomSlider->setEnabled(enabled);
}
void QmlProfilerTraceView::setZoomSliderVisible(bool visible)
{
QQuickItem *zoomSlider = d->m_mainView->rootObject()->findChild<QQuickItem*>(QLatin1String("zoomSliderToolBar"));
if (zoomSlider->isVisible() != visible)
zoomSlider->setVisible(visible);
}
QWidget *QmlProfilerTraceView::createToolbar()
......
......@@ -102,6 +102,8 @@ private slots:
void profilerStateChanged();
void clientRecordingChanged();
void serverRecordingChanged();
void setZoomSliderEnabled(bool enabled);
void setZoomSliderVisible(bool visible);
signals:
void gotoSourceLocation(const QString &fileUrl, int lineNumber, int columNumber);
......
Subproject commit acddeb82e5df0d8f947c3e02f5da64a351855023
Subproject commit 3b6b1b7fbc50bca101ad89a8acd80774bc668dde
......@@ -175,8 +175,6 @@ private slots:
void test_checksymbols_VirtualMethodUse();
void test_checksymbols_LabelUse();
void test_checksymbols_MacroUse();
void test_checksymbols_Macros__FILE__LINE__DATE__TIME__1();
void test_checksymbols_Macros__FILE__LINE__DATE__TIME__2();
void test_checksymbols_FunctionUse();
void test_checksymbols_PseudoKeywordUse();
void test_checksymbols_StaticUse();
......@@ -328,55 +326,6 @@ void tst_CheckSymbols::test_checksymbols_MacroUse()
TestData::check(source, expectedUses, macroUses);
}
void tst_CheckSymbols::test_checksymbols_Macros__FILE__LINE__DATE__TIME__1()
{
const QByteArray source =
"#define FILE_DATE_TIME __FILE__ \" / \" __DATE__ \" / \" __TIME__\n"
"#define LINE_NUMBER 0 + __LINE__\n"
"\n"
"void f()\n"
"{\n"
" class Printer;\n"
" Printer::printText(FILE_DATE_TIME); Printer::printInteger(LINE_NUMBER); Printer::nl();\n"
" return;\n"
"}\n";
const QList<Use> expectedUses = QList<Use>()
<< Use(4, 6, 1, CppHighlightingSupport::FunctionUse)
<< Use(6, 11, 7, CppHighlightingSupport::TypeUse)
<< Use(6, 11, 7, CppHighlightingSupport::TypeUse)
<< Use(7, 5, 7, CppHighlightingSupport::TypeUse)
<< Use(7, 41, 7, CppHighlightingSupport::TypeUse)
<< Use(7, 77, 7, CppHighlightingSupport::TypeUse)
;
TestData::check(source, expectedUses);
}
void tst_CheckSymbols::test_checksymbols_Macros__FILE__LINE__DATE__TIME__2()
{
const QByteArray source =
"void f()\n"
"{\n"
" class Printer;\n"
" Printer::printInteger(__LINE__); Printer::printText(__FILE__); Printer::nl();\n"