Commit 123937fb authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

Merge remote branch 'origin/2.0'

parents e343b333 3082395c
......@@ -1833,7 +1833,7 @@ def qdump__std__string(d, item):
rep = (data.cast(repType) - 1).dereference()
size = rep['_M_length']
alloc = rep['_M_capacity']
check(rep['_M_refcount'] >= 0)
check(rep['_M_refcount'] >= -1) # Can be -1 accoring to docs.
check(0 <= size and size <= alloc and alloc <= 100*1000*1000)
p = gdb.Value(data.cast(charType.pointer()))
s = ""
......
......@@ -125,8 +125,15 @@ QWidget {
height: fixedHeight
styleSheetFile: "anchorfill.css";
checkable: true
onReleased: fill();
onReleased: {
if (checked) {
anchorBackend.fill();
} else {
anchorBackend.resetLayout();
}
}
}
QPushButton {
......
......@@ -130,6 +130,7 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in
// which we handle immediately:
return index - 3;
} else {
#if 0 // see QTCREATORBUG-1501
// See if we are handling an Objective-C messaging expression in the form of:
// [receiver messageParam1:expression messageParam2
// or:
......@@ -154,6 +155,7 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in
if (tk[j].is(T_IDENTIFIER) && tk[j + 1].is(T_IDENTIFIER))
return i;
}
#endif
}
return index - 1;
} else if (tk[index - 1].is(T_RPAREN)) {
......
......@@ -87,7 +87,7 @@ QString TypePrettyPrinter::operator()(const FullySpecifiedType &ty)
bool previousNeedsParens = switchNeedsParens(false);
acceptType(ty);
switchNeedsParens(previousNeedsParens);
return switchText(previousName).trimmed();
return switchText(previousName);
}
QString TypePrettyPrinter::operator()(const FullySpecifiedType &type, const QString &name)
......@@ -317,8 +317,11 @@ void TypePrettyPrinter::visit(Function *type)
}
if (_overview->showReturnTypes()) {
_text.prepend(QLatin1Char(' '));
_text.prepend(_overview->prettyType(type->returnType()));
const QString returnType = _overview->prettyType(type->returnType());
if (!returnType.isEmpty()) {
_text.prepend(QLatin1Char(' '));
_text.prepend(returnType);
}
}
if (_overview->showFunctionSignatures()) {
......
......@@ -94,8 +94,9 @@ QColor StyleHelper::panelTextColor(bool lightColored)
return Qt::black;
}
QColor StyleHelper::m_baseColor(0x666666);
QColor StyleHelper::m_requestedBaseColor(0x666666);
// Invalid by default, setBaseColor needs to be called at least once
QColor StyleHelper::m_baseColor;
QColor StyleHelper::m_requestedBaseColor;
QColor StyleHelper::baseColor(bool lightColored)
{
......
......@@ -50,6 +50,8 @@ namespace Utils {
class QTCREATOR_UTILS_EXPORT StyleHelper
{
public:
static const unsigned int DEFAULT_BASE_COLOR = 0x666666;
// Height of the project explorer navigation bar
static int navigationWidgetHeight() { return 24; }
static qreal sidebarFontSize();
......
......@@ -237,7 +237,7 @@ void GeneralSettings::finish()
void GeneralSettings::resetInterfaceColor()
{
m_page->colorButton->setColor(0x666666);
m_page->colorButton->setColor(StyleHelper::DEFAULT_BASE_COLOR);
}
void GeneralSettings::resetExternalEditor()
......
......@@ -1130,7 +1130,9 @@ void MainWindow::readSettings()
// Get adapted base color.
m_overrideColor = Utils::StyleHelper::baseColor();
} else {
Utils::StyleHelper::setBaseColor(m_settings->value(QLatin1String(colorKey)).value<QColor>());
Utils::StyleHelper::setBaseColor(
m_settings->value(QLatin1String(colorKey),
QColor(Utils::StyleHelper::DEFAULT_BASE_COLOR)).value<QColor>());
}
const QVariant geom = m_settings->value(QLatin1String(geometryKey));
......
......@@ -1506,70 +1506,22 @@ void GdbEngine::handleInfoProc(const GdbResponse &response)
void GdbEngine::handleShowVersion(const GdbResponse &response)
{
//qDebug () << "VERSION 2:" << response.data.findChild("consolestreamoutput").data();
//qDebug () << "VERSION:" << response.toString();
debugMessage(_("VERSION: " + response.toString()));
debugMessage(_("PARSING VERSION: " + response.toString()));
if (response.resultClass == GdbResultDone) {
m_gdbVersion = 100;
m_gdbBuildVersion = -1;
m_isMacGdb = false;
GdbMi version = response.data.findChild("consolestreamoutput");
QString msg = QString::fromLocal8Bit(version.data());
bool foundIt = false;
QRegExp supported(_("GNU gdb(.*) (\\d+)\\.(\\d+)(\\.(\\d+))?(-(\\d+))?"));
if (supported.indexIn(msg) >= 0) {
extractGdbVersion(msg,
&m_gdbVersion, &m_gdbBuildVersion, &m_isMacGdb);
if (m_gdbVersion > 60500 && m_gdbVersion < 200000)
debugMessage(_("SUPPORTED GDB VERSION ") + msg);
m_gdbVersion = 10000 * supported.cap(2).toInt()
+ 100 * supported.cap(3).toInt()
+ 1 * supported.cap(5).toInt();
m_gdbBuildVersion = supported.cap(7).toInt();
m_isMacGdb = msg.contains(__("Apple version"));
foundIt = true;
}
// OpenSUSE managed to ship "GNU gdb (GDB) SUSE (6.8.91.20090930-2.4).
if (!foundIt && msg.startsWith(_("GNU gdb (GDB) SUSE "))) {
supported.setPattern(_("[^\\d]*(\\d+).(\\d+).(\\d+).*"));
if (supported.indexIn(msg) >= 0) {
debugMessage(_("SUSE PATCHED GDB VERSION ") + msg);
m_gdbVersion = 10000 * supported.cap(1).toInt()
+ 100 * supported.cap(2).toInt()
+ 1 * supported.cap(3).toInt();
m_gdbBuildVersion = -1;
m_isMacGdb = false;
foundIt = true;
} else {
debugMessage(_("UNPARSABLE SUSE PATCHED GDB VERSION ") + msg);
}
}
if (!foundIt) {
else
debugMessage(_("UNSUPPORTED GDB VERSION ") + msg);
#if 0
QStringList list = msg.split(_c('\n'));
while (list.size() > 2)
list.removeLast();
msg = tr("The debugger you are using identifies itself as:")
+ _("<p><p>") + list.join(_("<br>")) + _("<p><p>")
+ tr("This version is not officially supported by Qt Creator.\n"
"Debugging will most likely not work well.\n"
"Using gdb 7.1 or later is strongly recommended.");
#if 0
// ugly, but 'Show again' check box...
static QErrorMessage *err = new QErrorMessage(mainWindow());
err->setMinimumSize(400, 300);
err->showMessage(msg);
#else
//showMessageBox(QMessageBox::Information, tr("Warning"), msg);
#endif
#endif
}
debugMessage(_("USING GDB VERSION: %1, BUILD: %2%3").arg(m_gdbVersion)
.arg(m_gdbBuildVersion).arg(_(m_isMacGdb ? " (APPLE)" : "")));
//qDebug () << "VERSION 3:" << m_gdbVersion << m_gdbBuildVersion;
}
}
......
......@@ -32,6 +32,7 @@
#include <utils/qtcassert.h>
#include <QtCore/QByteArray>
#include <QtCore/QRegExp>
#include <QtCore/QTextStream>
#include <ctype.h>
......@@ -400,5 +401,50 @@ QByteArray GdbResponse::toString() const
return result;
}
//////////////////////////////////////////////////////////////////////////////////
//
// GdbResponse
//
//////////////////////////////////////////////////////////////////////////////////
void extractGdbVersion(const QString &msg,
int *gdbVersion, int *gdbBuildVersion, bool *isMacGdb)
{
const QChar dot(QLatin1Char('.'));
QString cleaned;
QString build;
bool inClean = true;
foreach (QChar c, msg) {
if (inClean && !cleaned.isEmpty() && c != dot && (c.isPunct() || c.isSpace()))
inClean = false;
if (inClean) {
if (c.isDigit())
cleaned.append(c);
else if (!cleaned.isEmpty() && !cleaned.endsWith(dot))
cleaned.append(dot);
} else {
if (c.isDigit())
build.append(c);
else if (!build.isEmpty() && !build.endsWith(dot))
build.append(dot);
}
}
*isMacGdb = msg.contains(QLatin1String("Apple version"));
*gdbVersion = 10000 * cleaned.section(dot, 0, 0).toInt()
+ 100 * cleaned.section(dot, 1, 1).toInt()
+ 1 * cleaned.section(dot, 2, 2).toInt();
if (cleaned.count(dot) >= 3)
*gdbBuildVersion = cleaned.section(dot, 3, 3).toInt();
else
*gdbBuildVersion = build.section(dot, 0, 0).toInt();
if (*isMacGdb)
*gdbBuildVersion = build.section(dot, 1, 1).toInt();
}
} // namespace Internal
} // namespace Debugger
......@@ -168,6 +168,9 @@ public:
QVariant cookie;
};
void extractGdbVersion(const QString &msg,
int *gdbVersion, int *gdbBuildVersion, bool *isMacGdb);
} // namespace Internal
} // namespace Debugger
......
......@@ -106,10 +106,16 @@ int SearchResultTreeItemDelegate::drawLineNumber(QPainter *painter, const QStyle
painter->fillRect(lineNumberAreaRect, QBrush(isSelected ?
option.palette.brush(cg, QPalette::Highlight) :
option.palette.color(cg, QPalette::Base).darker(111)));
painter->setPen(isSelected ?
option.palette.color(cg, QPalette::HighlightedText) : Qt::darkGray);
painter->drawText(lineNumberAreaRect.adjusted(0, 0, -lineNumberAreaHorizontalPadding, 0),
Qt::AlignRight | Qt::AlignVCenter, QString::number(lineNumber));
QStyleOptionViewItemV3 opt = option;
opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter;
opt.palette.setColor(cg, QPalette::Text, Qt::darkGray);
const QStyle *style = QApplication::style();
const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, 0) + 1;
const QRect rowRect = lineNumberAreaRect.adjusted(-textMargin, 0, textMargin-lineNumberAreaHorizontalPadding, 0);
QItemDelegate::drawDisplay(painter, opt, rowRect, QString::number(lineNumber));
return lineNumberAreaWidth;
}
......
......@@ -53,8 +53,6 @@
#include "propertyeditortransaction.h"
#include "originwidget.h"
#include <coreplugin/sidebar.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QDir>
#include <QtCore/QFileSystemWatcher>
......
......@@ -188,12 +188,12 @@ void PropertyEditorValue::setIsValid(bool valid)
m_isValid = valid;
}
ModelNode PropertyEditorValue::modelNode() const
QmlDesigner::ModelNode PropertyEditorValue::modelNode() const
{
return m_modelNode;
}
void PropertyEditorValue::setModelNode(const ModelNode &modelNode)
void PropertyEditorValue::setModelNode(const QmlDesigner::ModelNode &modelNode)
{
if (modelNode != m_modelNode) {
m_modelNode = modelNode;
......@@ -250,7 +250,7 @@ QString PropertyEditorNodeWrapper::type()
}
ModelNode PropertyEditorNodeWrapper::parentModelNode() const
QmlDesigner::ModelNode PropertyEditorNodeWrapper::parentModelNode() const
{
return m_editorValue->modelNode();
}
......
......@@ -39,9 +39,6 @@
class PropertyEditorValue;
typedef QmlDesigner::ModelNode ModelNode;
class PropertyEditorNodeWrapper : public QObject {
Q_OBJECT
......@@ -55,7 +52,7 @@ public:
bool exists();
QString type();
QDeclarativePropertyMap* properties();
ModelNode parentModelNode() const;
QmlDesigner::ModelNode parentModelNode() const;
QString propertyName() const;
public slots:
......@@ -112,8 +109,8 @@ public:
QString name() const;
void setName(const QString &name);
ModelNode modelNode() const;
void setModelNode(const ModelNode &modelNode);
QmlDesigner::ModelNode modelNode() const;
void setModelNode(const QmlDesigner::ModelNode &modelNode);
PropertyEditorNodeWrapper* complexNode();
......@@ -135,7 +132,7 @@ signals:
void isValidChanged();
private: //variables
ModelNode m_modelNode;
QmlDesigner::ModelNode m_modelNode;
QVariant m_value;
QString m_expression;
QString m_name;
......
......@@ -1335,7 +1335,7 @@ void QtVersion::updateToolChainAndMkspec() const
reader->setCumulative(false);
reader->setParsePreAndPostFiles(false);
reader->readProFile(m_mkspecFullPath + "/qmake.conf");
QString qmakeCXX = reader->value("QMAKE_CXX");
QString qmakeCXX = reader->values("QMAKE_CXX").join(" ");
QString makefileGenerator = reader->value("MAKEFILE_GENERATOR");
QString ce_sdk = reader->values("CE_SDK").join(QLatin1String(" "));
QString ce_arch = reader->value("CE_ARCH");
......
......@@ -40,7 +40,7 @@ static const char * const spaceAfterFunctionNameKey = "SpaceAfterFunctionName";
using namespace TextEditor;
CompletionSettings::CompletionSettings()
: m_caseSensitivity(FirstLetterCaseSensitive)
: m_caseSensitivity(CaseInsensitive)
, m_autoInsertBrackets(true)
, m_partiallyComplete(true)
, m_spaceAfterFunctionName(false)
......
......@@ -75,10 +75,10 @@ QStringList FindInFiles::files()
fileNameFilters(),
QDir::Files|QDir::Readable,
QDirIterator::Subdirectories);
while (it.hasNext()) {
it.next();
fileList << it.filePath();
}
while (it.hasNext())
fileList << it.next();
return fileList;
}
......
......@@ -47,7 +47,7 @@ static const Site supportSites[] = {
"<b>Forum Nokia</b><br /><font color='gray'>Mobile Application Support</font>"),
"http://www.forum.nokia.com/I_Want_To/Develop_Mobile_Applications/Technical_Support/"},
{ QT_TRANSLATE_NOOP("Welcome::Internal::CommunityWelcomePageWidget",
"<b>Qt LGPL Support</b><br /><font color='gray'>Buy professional Qt support</font>"),
"<b>Qt LGPL Support</b><br /><font color='gray'>Buy commercial Qt support</font>"),
"http://shop.qt.nokia.com/en/support.html"},
{ QT_TRANSLATE_NOOP("Welcome::Internal::CommunityWelcomePageWidget",
"<b>Qt Centre</b><br /><font color='gray'>Community based Qt support</font>"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment