From b58fe0f4d3c63bb181786737d0722049d6dabd62 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jan 2009 16:55:09 +0100 Subject: [PATCH 01/47] Fixes: debugger: work on hash dumper for string-ish keys --- share/qtcreator/gdbmacros/gdbmacros.cpp | 70 ++++++++++++++++--------- src/plugins/debugger/gdbengine.cpp | 16 ++++-- tests/manual/gdbdebugger/simple/app.cpp | 27 +++++++--- 3 files changed, 76 insertions(+), 37 deletions(-) diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp index 5576b36c6f2..d39fd8ddb49 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.cpp +++ b/share/qtcreator/gdbmacros/gdbmacros.cpp @@ -216,7 +216,7 @@ QT_END_NAMESPACE // comma-separated integer list static char qDumpInBuffer[10000]; static char qDumpOutBuffer[100000]; -static char qDumpSize[20]; +//static char qDumpSize[20]; namespace { @@ -314,6 +314,15 @@ static bool isShortKey(const char *type) return isSimpleType(type) || isEqual(type, NS"QString"); } +static bool isStringType(const char *type) +{ + return isEqual(type, NS"QString") + || isEqual(type, NS"QByteArray") + || isEqual(type, "std::string") + || isEqual(type, "std::wstring") + || isEqual(type, "wstring"); +} + static bool isMovableType(const char *type) { if (isPointerType(type)) @@ -555,7 +564,7 @@ void QDumper::addCommaIfNeeded() put(','); } -void QDumper::putBase64Encoded(const char *buf, int n, char delim) +void QDumper::putBase64Encoded(const char *buf, int n) { const char alphabet[] = "ABCDEFGH" "IJKLMNOP" "QRSTUVWX" "YZabcdef" "ghijklmn" "opqrstuv" "wxyz0123" "456789+/"; @@ -740,6 +749,7 @@ static void qDumpInnerValueHelper(QDumper &d, const char *type, const void *addr return; case 'B': if (isEqual(type, "QByteArray")) { + d.addCommaIfNeeded(); d << field << "encoded=\"1\","; P(d, field, *(QByteArray*)addr); } @@ -769,6 +779,7 @@ static void qDumpInnerValueHelper(QDumper &d, const char *type, const void *addr return; case 'S': if (isEqual(type, "QString")) { + d.addCommaIfNeeded(); d << field << "encoded=\"1\","; P(d, field, *(QString*)addr); } @@ -1086,13 +1097,17 @@ static void qDumpQHash(QDumper &d) if (d.dumpChildren) { if (n > 1000) n = 1000; - bool simpleKey = isShortKey(keyType); - bool simpleValue = isShortKey(valueType); + bool isSimpleKey = isSimpleType(keyType); + bool isStringKey = isStringType(keyType); + bool isSimpleValue = isSimpleType(valueType); bool opt = isOptimizedIntKey(keyType); int keyOffset = hashOffset(opt, true, keySize, valueSize); int valueOffset = hashOffset(opt, false, keySize, valueSize); - P(d, "extra", "simplekey: " << simpleKey << " simpleValue: " << simpleValue + P(d, "extra", "isSimpleKey: " << isSimpleKey + << " isStringKey: " << isStringKey + << " isSimpleValue: " << isSimpleValue + << " valueType: '" << valueType << "'" << " keySize: " << keyOffset << " valueOffset: " << valueOffset << " opt: " << opt); @@ -1103,18 +1118,17 @@ static void qDumpQHash(QDumper &d) d << ",children=["; while (node != end) { d.beginHash(); - if (simpleKey) { - P(d, "name", i); - qDumpInnerValueHelper(d, keyType, addOffset(node, keyOffset), "key"); - if (simpleValue) - qDumpInnerValueHelper(d, valueType, addOffset(node, valueOffset)); + P(d, "name", i); + qDumpInnerValueHelper(d, keyType, addOffset(node, keyOffset), "key"); + qDumpInnerValueHelper(d, valueType, addOffset(node, valueOffset)); + if (isSimpleKey && isSimpleValue) { P(d, "type", valueType); P(d, "addr", addOffset(node, valueOffset)); } else { - P(d, "name", i); - //P(d, "exp", "*(char*)" << node); - P(d, "exp", "*('"NS"QHashNode<" << keyType << "," << valueType << " >'*)" << node); - P(d, "type", "'"NS"QHashNode<" << keyType << "," << valueType << " >'"); + P(d, "exp", "*('"NS"QHashNode<" << keyType << "," + << valueType << " >'*)" << node); + P(d, "type", "'"NS"QHashNode<" << keyType << "," + << valueType << " >'"); } d.endHash(); ++i; @@ -1262,8 +1276,8 @@ static void qDumpQLinkedList(QDumper &d) P(d, "numchild", n); P(d, "childtype", d.innertype); if (d.dumpChildren) { - unsigned innerSize = d.extraInt[0]; - bool innerTypeIsPointer = isPointerType(d.innertype); + //unsigned innerSize = d.extraInt[0]; + //bool innerTypeIsPointer = isPointerType(d.innertype); QByteArray strippedInnerType = stripPointerType(d.innertype); const char *stripped = isPointerType(d.innertype) ? strippedInnerType.data() : 0; @@ -1397,13 +1411,13 @@ static void qDumpQMap(QDumper &d) unsigned mapnodesize = d.extraInt[2]; unsigned valueOff = d.extraInt[3]; - bool simpleKey = isShortKey(keyType); - bool simpleValue = isShortKey(valueType); + bool isSimpleKey = isShortKey(keyType); + bool isSimpleValue = isShortKey(valueType); // both negative: int keyOffset = 2 * sizeof(void*) - int(mapnodesize); int valueOffset = 2 * sizeof(void*) - int(mapnodesize) + valueOff; - P(d, "extra", "simplekey: " << simpleKey << " simpleValue: " << simpleValue + P(d, "extra", "simplekey: " << isSimpleKey << " isSimpleValue: " << isSimpleValue << " keyOffset: " << keyOffset << " valueOffset: " << valueOffset << " mapnodesize: " << mapnodesize); d << ",children=["; @@ -1415,10 +1429,10 @@ static void qDumpQMap(QDumper &d) while (node != end) { d.beginHash(); P(d, "name", i); - if (simpleKey) { + if (isSimpleKey) { P(d, "type", valueType); qDumpInnerValueHelper(d, keyType, addOffset(node, keyOffset), "key"); - if (simpleValue) + if (isSimpleValue) qDumpInnerValueHelper(d, valueType, addOffset(node, valueOffset)); P(d, "type", valueType); @@ -2199,26 +2213,30 @@ static void qDumpStdMap(QDumper &d) P(d, "pairtype", pairType); if (d.dumpChildren) { - bool simpleKey = isSimpleType(keyType); - bool simpleValue = isShortKey(valueType); + bool isSimpleKey = isSimpleType(keyType); + bool isStringKey = isStringType(keyType); + bool isSimpleValue = isShortKey(valueType); int valueOffset = d.extraInt[2]; d << ",children=["; it = map.begin(); for (int i = 0; i < 1000 && it != map.end(); ++i, ++it) { const void *node = it.operator->(); - if (simpleKey) { + if (isSimpleKey) { d.beginHash(); P(d, "type", valueType); - qDumpInnerValueHelper(d, keyType, node, "name"); + P(d, "name", i); + qDumpInnerValueHelper(d, keyType, node, "key"); P(d, "nameisindex", "1"); - if (simpleValue) + if (isSimpleValue) qDumpInnerValueHelper(d, valueType, addOffset(node, valueOffset)); P(d, "addr", addOffset(node, valueOffset)); d.endHash(); } else { d.beginHash(); P(d, "name", i); + if (isStringKey) + qDumpInnerValueHelper(d, keyType, node, "key"); P(d, "addr", it.operator->()); P(d, "type", pairType); d.endHash(); diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index 1924de93038..aab7dc1025e 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -2833,9 +2833,12 @@ static bool extractTemplate(const QString &type, QString *tmplate, QString *inne // 'tmplate' and "Inner1@Inner2@..." etc in 'inner'. Result indicates // whether parsing was successful int level = 0; + bool skipSpace = false; for (int i = 0; i != type.size(); ++i) { QChar c = type[i]; - if (c == '<') { + if (c == ' ' && skipSpace) { + skipSpace = false; + } else if (c == '<') { *(level == 0 ? tmplate : inner) += c; ++level; } else if (c == '>') { @@ -2843,6 +2846,7 @@ static bool extractTemplate(const QString &type, QString *tmplate, QString *inne *(level == 0 ? tmplate : inner) += c; } else if (c == ',') { *inner += (level == 1) ? '@' : ','; + skipSpace = true; } else { *(level == 0 ? tmplate : inner) += c; } @@ -3555,9 +3559,15 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record, data1.name = '[' + data1.name + ']'; QString key = item.findChild("key").data(); if (!key.isEmpty()) { - if (item.findChild("keyencoded").data()[0] == '1') + if (item.findChild("keyencoded").data()[0] == '1') { key = '"' + QByteArray::fromBase64(key.toUtf8()) + '"'; - data1.name += " (" + key + ")"; + if (key.size() > 13) { + key = key.left(12); + key += "..."; + } + } + //data1.name += " (" + key + ")"; + data1.name = key; } setWatchDataType(data1, item.findChild("type")); setWatchDataExpression(data1, item.findChild("exp")); diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index 98fa2111dc9..76eadf2d9fd 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -159,16 +159,27 @@ void testQHash() #if 1 - QHash hgg1; + QHash hgg1; hgg1["22.0"] = 22.0; - hgg1["23.0"] = 22.0; - hgg1["24.0"] = 22.0; - hgg1["25.0"] = 22.0; - hgg1["26.0"] = 22.0; - hgg1["27.0"] = 27.0; - hgg1["28.0"] = 28.0; - hgg1["29.0"] = 29.0; + hgg1["123.0"] = 22.0; + hgg1["111111ss111128.0"] = 28.0; + hgg1["11124.0"] = 22.0; + hgg1["1111125.0"] = 22.0; + hgg1["11111126.0"] = 22.0; + hgg1["111111127.0"] = 27.0; + hgg1["111111111128.0"] = 28.0; + hgg1["111111111111111111129.0"] = 29.0; + QHash hgx1; + hgx1["22.0"] = 22.0; + hgx1["123.0"] = 22.0; + hgx1["111111ss111128.0"] = 28.0; + hgx1["11124.0"] = 22.0; + hgx1["1111125.0"] = 22.0; + hgx1["11111126.0"] = 22.0; + hgx1["111111127.0"] = 27.0; + hgx1["111111111128.0"] = 28.0; + hgx1["111111111111111111129.0"] = 29.0; #endif #if 1 From 500f2e5d8484bd7233f7a70c51a0d54ff8d574ee Mon Sep 17 00:00:00 2001 From: Olli Werwolff Date: Wed, 28 Jan 2009 17:01:01 +0100 Subject: [PATCH 02/47] Fixes: Fixed duplicate check when adding files using the resource editor Task: 238308 RevBy: eike AutoTest: - Details: Instead of the text and prefix of the file to add, pointers were compared. Thus the function always returned false and duplicates were not recognized. Replaced struct FileList with a class FileList, which is inherited from QList and added the function containsList which checks the needed values. --- src/shared/qrceditor/resourcefile.cpp | 17 +++++++++++++++-- src/shared/qrceditor/resourcefile_p.h | 7 ++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/shared/qrceditor/resourcefile.cpp b/src/shared/qrceditor/resourcefile.cpp index b88444c6e16..bfab4b0315f 100644 --- a/src/shared/qrceditor/resourcefile.cpp +++ b/src/shared/qrceditor/resourcefile.cpp @@ -54,6 +54,19 @@ TRANSLATOR qdesigner_internal::ResourceModel namespace qdesigner_internal { + +/****************************************************************************** +** FileList +*/ + +bool FileList::containsFile(File *file) +{ + foreach(File *tmpFile, *this) + if (tmpFile->name == file->name && tmpFile->prefix() == file->prefix()) + return true; + return false; +} + /****************************************************************************** ** ResourceFile */ @@ -375,7 +388,7 @@ bool ResourceFile::contains(const QString &prefix, const QString &file) const Prefix * const p = m_prefix_list.at(pref_idx); Q_ASSERT(p); File equalFile(p, absolutePath(file)); - return p->file_list.contains(&equalFile); + return p->file_list.containsFile(&equalFile); } bool ResourceFile::contains(int pref_idx, const QString &file) const @@ -383,7 +396,7 @@ bool ResourceFile::contains(int pref_idx, const QString &file) const Q_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count()); Prefix * const p = m_prefix_list.at(pref_idx); File equalFile(p, absolutePath(file)); - return p->file_list.contains(&equalFile); + return p->file_list.containsFile(&equalFile); } /*static*/ QString ResourceFile::fixPrefix(const QString &prefix) diff --git a/src/shared/qrceditor/resourcefile_p.h b/src/shared/qrceditor/resourcefile_p.h index 61b6c594b64..3ee346cb0e6 100644 --- a/src/shared/qrceditor/resourcefile_p.h +++ b/src/shared/qrceditor/resourcefile_p.h @@ -90,7 +90,12 @@ struct File : public Node { QString name; QString alias; }; -typedef QList FileList; + +class FileList : public QList +{ +public: + bool containsFile(File *file); +}; /*! \class Prefix From 943efa766c70ff98ce3ed89c924aa3fc5780beb1 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jan 2009 17:34:23 +0100 Subject: [PATCH 03/47] Fixes: debugger: work on hash and map dumper with simple keys or values --- share/qtcreator/gdbmacros/gdbmacros.cpp | 80 +++++++++++-------------- src/plugins/debugger/gdbengine.cpp | 2 +- 2 files changed, 37 insertions(+), 45 deletions(-) diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp index d39fd8ddb49..eca4db27ec3 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.cpp +++ b/share/qtcreator/gdbmacros/gdbmacros.cpp @@ -309,11 +309,7 @@ static bool isSimpleType(const char *type) return false; } -static bool isShortKey(const char *type) -{ - return isSimpleType(type) || isEqual(type, NS"QString"); -} - +#if 0 static bool isStringType(const char *type) { return isEqual(type, NS"QString") @@ -322,6 +318,7 @@ static bool isStringType(const char *type) || isEqual(type, "std::wstring") || isEqual(type, "wstring"); } +#endif static bool isMovableType(const char *type) { @@ -1098,16 +1095,14 @@ static void qDumpQHash(QDumper &d) if (n > 1000) n = 1000; bool isSimpleKey = isSimpleType(keyType); - bool isStringKey = isStringType(keyType); bool isSimpleValue = isSimpleType(valueType); bool opt = isOptimizedIntKey(keyType); int keyOffset = hashOffset(opt, true, keySize, valueSize); int valueOffset = hashOffset(opt, false, keySize, valueSize); P(d, "extra", "isSimpleKey: " << isSimpleKey - << " isStringKey: " << isStringKey << " isSimpleValue: " << isSimpleValue - << " valueType: '" << valueType << "'" + << " valueType: '" << isSimpleValue << " keySize: " << keyOffset << " valueOffset: " << valueOffset << " opt: " << opt); @@ -1145,15 +1140,18 @@ static void qDumpQHashNode(QDumper &d) const char *keyType = d.templateParameters[0]; const char *valueType = d.templateParameters[1]; - P(d, "value", ""); + unsigned keySize = d.extraInt[0]; + unsigned valueSize = d.extraInt[1]; + bool opt = isOptimizedIntKey(keyType); + int keyOffset = hashOffset(opt, true, keySize, valueSize); + int valueOffset = hashOffset(opt, false, keySize, valueSize); + if (isSimpleType(valueType)) + qDumpInnerValueHelper(d, valueType, addOffset(h, valueOffset)); + else + P(d, "value", ""); + P(d, "numchild", 2); if (d.dumpChildren) { - unsigned keySize = d.extraInt[0]; - unsigned valueSize = d.extraInt[1]; - bool opt = isOptimizedIntKey(keyType); - int keyOffset = hashOffset(opt, true, keySize, valueSize); - int valueOffset = hashOffset(opt, false, keySize, valueSize); - // there is a hash specialization in cast the key are integers or shorts d << ",children=["; d.beginHash(); @@ -1411,8 +1409,8 @@ static void qDumpQMap(QDumper &d) unsigned mapnodesize = d.extraInt[2]; unsigned valueOff = d.extraInt[3]; - bool isSimpleKey = isShortKey(keyType); - bool isSimpleValue = isShortKey(valueType); + bool isSimpleKey = isSimpleType(keyType); + bool isSimpleValue = isSimpleType(valueType); // both negative: int keyOffset = 2 * sizeof(void*) - int(mapnodesize); int valueOffset = 2 * sizeof(void*) - int(mapnodesize) + valueOff; @@ -1429,12 +1427,9 @@ static void qDumpQMap(QDumper &d) while (node != end) { d.beginHash(); P(d, "name", i); - if (isSimpleKey) { - P(d, "type", valueType); - qDumpInnerValueHelper(d, keyType, addOffset(node, keyOffset), "key"); - if (isSimpleValue) - qDumpInnerValueHelper(d, valueType, addOffset(node, valueOffset)); - + qDumpInnerValueHelper(d, keyType, addOffset(node, keyOffset), "key"); + qDumpInnerValueHelper(d, valueType, addOffset(node, valueOffset)); + if (isSimpleKey && isSimpleValue) { P(d, "type", valueType); P(d, "addr", addOffset(node, valueOffset)); } else { @@ -2208,39 +2203,36 @@ static void qDumpStdMap(QDumper &d) // (#4, "std::allocator >") // as it is there, and, equally importantly, in an order that // gdb accepts when fed with it. - char *pairType = (char *)(d.templateParameters[3]) + 16; + char *pairType = (char *)(d.templateParameters[3]) + 15; pairType[strlen(pairType) - 2] = 0; P(d, "pairtype", pairType); if (d.dumpChildren) { bool isSimpleKey = isSimpleType(keyType); - bool isStringKey = isStringType(keyType); - bool isSimpleValue = isShortKey(valueType); + bool isSimpleValue = isSimpleType(valueType); int valueOffset = d.extraInt[2]; + P(d, "extra", "isSimpleKey: " << isSimpleKey + << " isSimpleValue: " << isSimpleValue + << " valueType: '" << valueType + << " valueOffset: " << valueOffset); + d << ",children=["; it = map.begin(); for (int i = 0; i < 1000 && it != map.end(); ++i, ++it) { - const void *node = it.operator->(); - if (isSimpleKey) { - d.beginHash(); - P(d, "type", valueType); + d.beginHash(); + const void *node = it.operator->(); P(d, "name", i); qDumpInnerValueHelper(d, keyType, node, "key"); - P(d, "nameisindex", "1"); - if (isSimpleValue) - qDumpInnerValueHelper(d, valueType, addOffset(node, valueOffset)); - P(d, "addr", addOffset(node, valueOffset)); - d.endHash(); - } else { - d.beginHash(); - P(d, "name", i); - if (isStringKey) - qDumpInnerValueHelper(d, keyType, node, "key"); - P(d, "addr", it.operator->()); - P(d, "type", pairType); - d.endHash(); - } + qDumpInnerValueHelper(d, valueType, addOffset(node, valueOffset)); + if (isSimpleKey && isSimpleValue) { + P(d, "type", valueType); + P(d, "addr", addOffset(node, valueOffset)); + } else { + P(d, "addr", node); + P(d, "type", pairType); + } + d.endHash(); } if (it != map.end()) d.putEllipsis(); diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index aab7dc1025e..fa2d2bacbe4 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -2854,7 +2854,7 @@ static bool extractTemplate(const QString &type, QString *tmplate, QString *inne *tmplate = tmplate->trimmed(); *tmplate = tmplate->remove("<>"); *inner = inner->trimmed(); - //qDebug() << "EXTRACT TEMPLATE: " << *tmplate << *inner; + //qDebug() << "EXTRACT TEMPLATE: " << *tmplate << *inner << " FROM " << type; return !inner->isEmpty(); } From 0f5de365b9a05efb85d89b82a115c1a20c99a852 Mon Sep 17 00:00:00 2001 From: con Date: Wed, 28 Jan 2009 17:38:41 +0100 Subject: [PATCH 04/47] Fixes: - Some layouting issues --- src/libs/utils/pathchooser.cpp | 2 +- src/shared/qrceditor/qrceditor.cpp | 4 +--- src/tools/qtcreatorwidgets/qtcreatorwidgets.pro | 10 ++++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 0f83cf1c4cb..2555399a422 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -110,7 +110,7 @@ PathChooser::PathChooser(QWidget *parent) : connect(m_d->m_lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); connect(m_d->m_lineEdit, SIGNAL(validChanged()), this, SIGNAL(validChanged())); - m_d->m_lineEdit->setMinimumWidth(260); + m_d->m_lineEdit->setMinimumWidth(200); hLayout->addWidget(m_d->m_lineEdit); hLayout->setSizeConstraint(QLayout::SetMinimumSize); diff --git a/src/shared/qrceditor/qrceditor.cpp b/src/shared/qrceditor/qrceditor.cpp index a353d738394..bd25a42d742 100644 --- a/src/shared/qrceditor/qrceditor.cpp +++ b/src/shared/qrceditor/qrceditor.cpp @@ -39,7 +39,7 @@ #include #include -namespace SharedTools { +using namespace SharedTools; QrcEditor::QrcEditor(QWidget *parent) : QWidget(parent), @@ -405,5 +405,3 @@ void QrcEditor::onRedo() updateCurrent(); updateHistoryControls(); } - -} // namespace SharedTools diff --git a/src/tools/qtcreatorwidgets/qtcreatorwidgets.pro b/src/tools/qtcreatorwidgets/qtcreatorwidgets.pro index 6923e09837d..ce209c86d77 100644 --- a/src/tools/qtcreatorwidgets/qtcreatorwidgets.pro +++ b/src/tools/qtcreatorwidgets/qtcreatorwidgets.pro @@ -9,7 +9,7 @@ SOURCES = customwidgets.cpp # Link against the qtcreator utils lib -unix { +linux-* { # form abs path to qtcreator lib dir GH_LIB=$$dirname(PWD) GH_LIB=$$dirname(GH_LIB) @@ -19,7 +19,13 @@ unix { } INCLUDEPATH += ../../../src/libs -LIBS += -L../../../lib -lUtils +macx { + LIBS += -L../../../bin/QtCreator.app/Contents/PlugIns + CONFIG(debug, debug|release):LIBS += -lUtils_debug + else:LIBS += -lUtils +} else { + LIBS += -L../../../lib -lUtils +} DESTDIR= $$[QT_INSTALL_PLUGINS]/designer From 0b4dfc9cd2c1b0eee58185a65173b068e9435b0c Mon Sep 17 00:00:00 2001 From: con Date: Wed, 28 Jan 2009 17:53:10 +0100 Subject: [PATCH 05/47] Fixes: - Resource editors not restored from session Details: - Mismatch of kinds in editor and editor factory. --- src/plugins/resourceeditor/resourceeditorconstants.h | 1 - src/plugins/resourceeditor/resourceeditorw.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/resourceeditor/resourceeditorconstants.h b/src/plugins/resourceeditor/resourceeditorconstants.h index 007d537c36e..645461a4ddd 100644 --- a/src/plugins/resourceeditor/resourceeditorconstants.h +++ b/src/plugins/resourceeditor/resourceeditorconstants.h @@ -38,7 +38,6 @@ namespace ResourceEditor { namespace Constants { const char * const C_RESOURCEEDITOR = "Resource Editor"; -const char * const C_RESOURCEWINDOW = "Resourcewindow"; const char * const C_RESOURCE_MIMETYPE = "application/vnd.nokia.xml.qt.resource"; } // namespace Constants diff --git a/src/plugins/resourceeditor/resourceeditorw.cpp b/src/plugins/resourceeditor/resourceeditorw.cpp index c8e0bbf5107..833c6547c92 100644 --- a/src/plugins/resourceeditor/resourceeditorw.cpp +++ b/src/plugins/resourceeditor/resourceeditorw.cpp @@ -161,7 +161,7 @@ bool ResourceEditorFile::save(const QString &name /*= QString()*/) } const char *ResourceEditorW::kind() const { - return ResourceEditor::Constants::C_RESOURCEWINDOW; + return ResourceEditor::Constants::C_RESOURCEEDITOR; } QString ResourceEditorFile::fileName() const From d2682828fc08bc706d7da0f0310527a037d0e718 Mon Sep 17 00:00:00 2001 From: dt Date: Wed, 28 Jan 2009 18:14:01 +0100 Subject: [PATCH 06/47] Fixes: On session restore, start less indexers. Details: This should improve performance a bit. Instead of starting on indexer per .pro file, schedule and compress updates of ui files. And don't update if we have a full project code model update scheduled anyway. Which helps the startup case. --- src/plugins/qt4projectmanager/qt4nodes.cpp | 2 +- src/plugins/qt4projectmanager/qt4project.cpp | 25 ++++++++++++++++++++ src/plugins/qt4projectmanager/qt4project.h | 6 +++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index f9990c522fb..5d05003e8ce 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -845,7 +845,7 @@ void Qt4ProFileNode::updateUiFiles() } addFileNodes(toAdd, this); } - modelManager->updateSourceFiles(toUpdate); + m_project->addUiFilesToCodeModel(toUpdate); } ProFileReader *Qt4PriFileNode::createProFileReader() const diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index a8fdc907cd0..9885221c0c4 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -255,6 +255,10 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) : m_updateCodeModelTimer.setSingleShot(true); m_updateCodeModelTimer.setInterval(20); connect(&m_updateCodeModelTimer, SIGNAL(timeout()), this, SLOT(updateCodeModel())); + + m_addUiFilesTimer.setSingleShot(true); + m_addUiFilesTimer.setInterval(20); + connect(&m_addUiFilesTimer, SIGNAL(timeout()), this, SLOT(addUiFiles())); } Qt4Project::~Qt4Project() @@ -370,6 +374,27 @@ namespace { }; } +void Qt4Project::addUiFilesToCodeModel(const QStringList &files) +{ + // if we already have a full updateCodeModel() scheduled + // then we don't need to this seperately + // since that one will add also all the ui files + if (m_updateCodeModelTimer.isActive()) + return; + m_addUiFilesTimer.start(); + m_uiFilesToAdd << files; +} + +void Qt4Project::addUiFiles() +{ + if (m_updateCodeModelTimer.isActive()) + return; + CppTools::CppModelManagerInterface *modelManager = + ExtensionSystem::PluginManager::instance()->getObject(); + modelManager->updateSourceFiles(m_uiFilesToAdd); + m_uiFilesToAdd.clear(); +} + void Qt4Project::scheduleUpdateCodeModel() { m_updateCodeModelTimer.start(); diff --git a/src/plugins/qt4projectmanager/qt4project.h b/src/plugins/qt4projectmanager/qt4project.h index 24b7e45d6e8..0c4a5fb57dc 100644 --- a/src/plugins/qt4projectmanager/qt4project.h +++ b/src/plugins/qt4projectmanager/qt4project.h @@ -182,6 +182,9 @@ public: void notifyChanged(const QString &name); + // called by qt4ProjectNode to add ui_*.h files to the codemodel + void addUiFilesToCodeModel(const QStringList &files); + public slots: void update(); void proFileParseError(const QString &errorMessage); @@ -200,6 +203,7 @@ private slots: const Qt4ProjectManager::Internal::Qt4ProjectType oldType, const Qt4ProjectManager::Internal::Qt4ProjectType newType); void proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *node); + void addUiFiles(); protected: virtual void restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &settingsReader); @@ -232,6 +236,8 @@ private: Internal::Qt4ProjectFiles *m_projectFiles; QTimer m_updateCodeModelTimer; + QTimer m_addUiFilesTimer; + QStringList m_uiFilesToAdd; Internal::GCCPreprocessor m_preproc; friend class Qt4ProjectFile; From 53ab86dcebcda017cc5f242297efac4ac8a27f49 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jan 2009 18:35:05 +0100 Subject: [PATCH 07/47] Fixes: fakevim: explicitly make 'l' an 'exclusive' motion --- share/qtcreator/gdbmacros/gdbmacros.cpp | 2 ++ src/plugins/fakevim/fakevimhandler.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp index eca4db27ec3..1da444113ea 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.cpp +++ b/share/qtcreator/gdbmacros/gdbmacros.cpp @@ -2228,9 +2228,11 @@ static void qDumpStdMap(QDumper &d) if (isSimpleKey && isSimpleValue) { P(d, "type", valueType); P(d, "addr", addOffset(node, valueOffset)); + P(d, "numchild", 0); } else { P(d, "addr", node); P(d, "type", pairType); + P(d, "numchild", 2); } d.endHash(); } diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index e23ba991fb0..5a30eac3265 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -986,6 +986,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, finishMovement(); m_desiredColumn = savedColumn; } else if (key == 'l' || key == Key_Right) { + m_moveType = MoveExclusive; moveRight(qMin(count(), rightDist())); finishMovement(); } else if (key == 'L') { @@ -1099,6 +1100,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveToNextWord(true); finishMovement("W"); } else if (key == 'x') { // = "dl" + m_moveType = MoveExclusive; if (atEndOfLine()) moveLeft(); recordBeginGroup(); From 3e1032783be7ba544218730633c998db1be7ed48 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jan 2009 18:42:43 +0100 Subject: [PATCH 08/47] Fixes: fakevim: 'cw' was off by one again --- src/plugins/fakevim/fakevimhandler.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 5a30eac3265..e0b41c6418c 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -483,16 +483,18 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) m_marks['>'] = m_tc.position(); if (m_submode == ChangeSubMode) { + if (m_moveType == MoveInclusive) + moveRight(); // correction if (!dotCommand.isEmpty()) m_dotCommand = "c" + dotCommand; QString text = recordRemoveSelectedText(); - qDebug() << "CHANGING TO INSERT MODE" << text; + //qDebug() << "CHANGING TO INSERT MODE" << text; m_registers[m_register] = text; m_mode = InsertMode; m_submode = NoSubMode; } else if (m_submode == DeleteSubMode) { if (m_moveType == MoveInclusive) - moveRight(); // correct + moveRight(); // correction if (!dotCommand.isEmpty()) m_dotCommand = "d" + dotCommand; m_registers[m_register] = recordRemoveSelectedText(); @@ -1090,11 +1092,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } else if (key == 'w') { // Special case: "cw" and "cW" work the same as "ce" and "cE" if the // cursor is on a non-blank. - if (m_submode == ChangeSubMode) + if (m_submode == ChangeSubMode) { moveToWordBoundary(false, true); - else + m_moveType = MoveInclusive; + } else { moveToNextWord(false); - m_moveType = MoveExclusive; + m_moveType = MoveExclusive; + } finishMovement("w"); } else if (key == 'W') { moveToNextWord(true); From 019325343326de341b3078dad9538271c1afbea4 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jan 2009 18:48:22 +0100 Subject: [PATCH 09/47] Fixes: fakevim: fix cW --- src/plugins/fakevim/fakevimhandler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index e0b41c6418c..553d1e19ec0 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1101,7 +1101,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } finishMovement("w"); } else if (key == 'W') { - moveToNextWord(true); + if (m_submode == ChangeSubMode) { + moveToWordBoundary(true, true); + m_moveType = MoveInclusive; + } else { + moveToNextWord(true); + m_moveType = MoveExclusive; + } finishMovement("W"); } else if (key == 'x') { // = "dl" m_moveType = MoveExclusive; From 3f08a9d22f6ca06d927c4a1bb8180ee98594439e Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jan 2009 19:01:10 +0100 Subject: [PATCH 10/47] Fixes: fakevim: 'dd' and 'cc' are linewise motions --- src/plugins/fakevim/fakevimhandler.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 553d1e19ec0..46bda9ecb92 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -671,16 +671,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveToStartOfLine(); setAnchor(); moveDown(count()); - moveLeft(); - m_registers[m_register] = recordRemoveSelectedText(); - m_submode = NoSubMode; - m_mode = InsertMode; + m_moveType = MoveLineWise; finishMovement("c"); } else if (m_submode == DeleteSubMode && key == 'd') { moveToStartOfLine(); setAnchor(); moveDown(count()); - m_registers[m_register] = recordRemoveSelectedText(); + m_moveType = MoveLineWise; finishMovement("d"); } else if (m_submode == YankSubMode && key == 'y') { moveToStartOfLine(); From 27c771343ecdf73564cb7f21ea1d4d102c4f4f6a Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 28 Jan 2009 19:22:54 +0100 Subject: [PATCH 11/47] Fixes: fakevim: rough Ctrl-O/Ctrl-I implementation --- src/plugins/fakevim/fakevimhandler.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 46bda9ecb92..5b6dd910513 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -348,6 +348,10 @@ public: QPointer m_extraData; int m_cursorWidth; + + void recordJump(); + QList m_jumpListUndo; + QList m_jumpListRedo; }; FakeVimHandler::Private::Private(FakeVimHandler *parent, QWidget *widget) @@ -797,6 +801,7 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_lastSearchForward = (key == '*'); updateMiniBuffer(); search(needle, m_lastSearchForward); + recordJump(); } else if (key == '\'') { m_subsubmode = TickSubSubMode; } else if (key == '|') { @@ -946,6 +951,11 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveToStartOfLine(); else moveToFirstNonBlankOnLine(); + } else if (key == control('i')) { + if (!m_jumpListRedo.isEmpty()) { + m_jumpListUndo.append(position()); + m_tc.setPosition(m_jumpListRedo.takeLast()); + } } else if (key == 'j' || key == Key_Down) { int savedColumn = m_desiredColumn; if (m_submode == NoSubMode || m_submode == ZSubMode @@ -1001,8 +1011,10 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, finishMovement(); } else if (key == 'n') { search(lastSearchString(), m_lastSearchForward); + recordJump(); } else if (key == 'N') { search(lastSearchString(), !m_lastSearchForward); + recordJump(); } else if (key == 'o' || key == 'O') { recordBeginGroup(); recordMove(); @@ -1018,6 +1030,11 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, recordInsertText(QString(indentDist(), ' ')); else recordInsertText(QString(numSpaces, ' ')); + } else if (key == control('o')) { + if (!m_jumpListUndo.isEmpty()) { + m_jumpListRedo.append(position()); + m_tc.setPosition(m_jumpListUndo.takeLast()); + } } else if (key == 'p' || key == 'P') { recordBeginGroup(); QString text = m_registers[m_register]; @@ -1298,6 +1315,7 @@ bool FakeVimHandler::Private::handleMiniBufferModes(int key, int unmodified, m_searchHistory.append(m_commandBuffer); m_lastSearchForward = (m_mode == SearchForwardMode); search(lastSearchString(), m_lastSearchForward); + recordJump(); } enterCommandMode(); updateMiniBuffer(); @@ -2106,6 +2124,13 @@ void FakeVimHandler::Private::quit() } +void FakeVimHandler::Private::recordJump() +{ + m_jumpListUndo.append(position()); + m_jumpListRedo.clear(); + //qDebug() << m_jumpListUndo; +} + /////////////////////////////////////////////////////////////////////// // // FakeVimHandler From 95a46450293bfc513de15fb8a590cab7631ae46d Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 28 Jan 2009 23:46:43 +0100 Subject: [PATCH 12/47] Fixes: Improved lookup of function definitions. --- src/plugins/cppeditor/cppeditor.cpp | 131 ++++++++++++++++++---------- 1 file changed, 86 insertions(+), 45 deletions(-) diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index b370faea1bb..ab38af3772b 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -100,6 +101,44 @@ public: } }; +class FindFunctionDefinitions: protected SymbolVisitor +{ + Name *_declarationName; + QList *_functions; + +public: + FindFunctionDefinitions() + : _declarationName(0), + _functions(0) + { } + + void operator()(Name *declarationName, Scope *globals, + QList *functions) + { + _declarationName = declarationName; + _functions = functions; + + for (unsigned i = 0; i < globals->symbolCount(); ++i) { + accept(globals->symbolAt(i)); + } + } + +protected: + using SymbolVisitor::visit; + + virtual bool visit(Function *function) + { + Name *name = function->name(); + if (QualifiedNameId *q = name->asQualifiedNameId()) + name = q->unqualifiedNameId(); + + if (_declarationName->isEqualTo(name)) + _functions->append(function); + + return false; + } +}; + } // end of anonymous namespace QualifiedNameId *qualifiedNameIdForSymbol(Symbol *s, const LookupContext &context) @@ -550,58 +589,60 @@ void CPPEditor::jumpToDefinition() } } -Symbol *CPPEditor::findDefinition(Symbol *lastSymbol) +Symbol *CPPEditor::findDefinition(Symbol *symbol) { - // Currently only functions are supported - if (!lastSymbol->type()->isFunction()) - return 0; + if (symbol->isFunction()) + return 0; // symbol is a function definition. - QVector qualifiedName; - Scope *scope = lastSymbol->scope(); - for (; scope; scope = scope->enclosingScope()) { - if (scope->isClassScope() || scope->isNamespaceScope()) { - if (scope->owner() && scope->owner()->name()) { - Name *scopeOwnerName = scope->owner()->name(); - if (QualifiedNameId *q = scopeOwnerName->asQualifiedNameId()) { - for (unsigned i = 0; i < q->nameCount(); ++i) { - qualifiedName.prepend(q->nameAt(i)); - } - } else { - qualifiedName.prepend(scopeOwnerName); - } - } + Function *funTy = symbol->type()->asFunction(); + if (! funTy) + return 0; // symbol does not have function type. + + Name *name = symbol->name(); + if (! name) + return 0; // skip anonymous functions! + + if (QualifiedNameId *q = name->asQualifiedNameId()) + name = q->unqualifiedNameId(); + + // map from file names to function definitions. + QMap > functionDefinitions; + + // find function definitions. + FindFunctionDefinitions findFunctionDefinitions; + + // save the current snapshot + const Snapshot snapshot = m_modelManager->snapshot(); + + foreach (Document::Ptr doc, snapshot) { + if (Scope *globals = doc->globalSymbols()) { + QList *localFunctionDefinitions = + &functionDefinitions[doc->fileName()]; + + findFunctionDefinitions(name, globals, + localFunctionDefinitions); } } - qualifiedName.append(lastSymbol->name()); + // a dummy document. + Document::Ptr expressionDocument = Document::create(""); - Control control; - QualifiedNameId *q = control.qualifiedNameId(&qualifiedName[0], qualifiedName.size()); - LookupContext context(&control); + QMapIterator > it(functionDefinitions); + while (it.hasNext()) { + it.next(); - const Snapshot documents = m_modelManager->snapshot(); - foreach (Document::Ptr doc, documents) { - QList visibleScopes; - visibleScopes.append(doc->globalSymbols()); - visibleScopes = context.expand(visibleScopes); - //qDebug() << "** doc:" << doc->fileName() << "visible scopes:" << visibleScopes.count(); - foreach (Scope *visibleScope, visibleScopes) { - Symbol *symbol = 0; - if (NameId *nameId = q->unqualifiedNameId()->asNameId()) - symbol = visibleScope->lookat(nameId->identifier()); - else if (DestructorNameId *dtorId = q->unqualifiedNameId()->asDestructorNameId()) - symbol = visibleScope->lookat(dtorId->identifier()); - else if (TemplateNameId *templNameId = q->unqualifiedNameId()->asTemplateNameId()) - symbol = visibleScope->lookat(templNameId->identifier()); - else if (OperatorNameId *opId = q->unqualifiedNameId()->asOperatorNameId()) - symbol = visibleScope->lookat(opId->kind()); - // ### cast operators - for (; symbol; symbol = symbol->next()) { - if (! symbol->isFunction()) - continue; - else if (! isCompatible(symbol->asFunction(), lastSymbol, q)) - continue; - return symbol; + // get the instance of the document. + Document::Ptr thisDocument = snapshot.value(it.key()); + + foreach (Function *f, it.value()) { + // create a lookup context + const LookupContext context(f, expressionDocument, + thisDocument, snapshot); + + // search the matching definition for the function declaration `symbol'. + foreach (Symbol *s, context.resolve(f->name())) { + if (s == symbol) + return f; } } } From 40d18d1424d773be4d472286e4bdfd2d6492e39a Mon Sep 17 00:00:00 2001 From: Olli Werwolff Date: Thu, 29 Jan 2009 10:00:44 +0100 Subject: [PATCH 13/47] Fixes: Fixed duplicate check when adding files using resource editor Task: 238308 RevBy: - AutoTest: - Details: Only files in unique list are added to the resource file (before file_list was used -> duplicates) --- src/shared/qrceditor/resourcefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qrceditor/resourcefile.cpp b/src/shared/qrceditor/resourcefile.cpp index bfab4b0315f..19a5f25e991 100644 --- a/src/shared/qrceditor/resourcefile.cpp +++ b/src/shared/qrceditor/resourcefile.cpp @@ -821,7 +821,7 @@ void ResourceModel::addFiles(int prefixIndex, const QStringList &fileNames, int const int cnt = m_resource_file.fileCount(prefix_idx); beginInsertRows(prefix_model_idx, cnt, cnt + unique_list.count() - 1); // ### FIXME - foreach (QString file, file_list) + foreach (QString file, unique_list) m_resource_file.addFile(prefix_idx, file); const QFileInfo fi(file_list.last()); From 42b7107e179b4fb20401da84aae15bb5a2285b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Thu, 29 Jan 2009 10:14:56 +0100 Subject: [PATCH 14/47] Fixed undo/redo and tooltip in the resource editor The undo/redo was broken due to connections between can{Undo,Redo}Changed() and updateCurrent(). This also caused the weird cursor behaviour. The resource tooltip had the string "Qt::ToolTipRole" prepended to it due to a leftover debug line. --- src/shared/qrceditor/qrceditor.cpp | 9 --------- src/shared/qrceditor/resourcefile.cpp | 23 +++++++++++------------ src/shared/qrceditor/resourcefile_p.h | 4 ++-- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/shared/qrceditor/qrceditor.cpp b/src/shared/qrceditor/qrceditor.cpp index bd25a42d742..a25a4ecce7c 100644 --- a/src/shared/qrceditor/qrceditor.cpp +++ b/src/shared/qrceditor/qrceditor.cpp @@ -96,8 +96,6 @@ QrcEditor::QrcEditor(QWidget *parent) connect(&m_history, SIGNAL(canRedoChanged(bool)), this, SLOT(updateHistoryControls())); connect(&m_history, SIGNAL(canUndoChanged(bool)), this, SLOT(updateHistoryControls())); - connect(&m_history, SIGNAL(canRedoChanged(bool)), this, SLOT(updateCurrent())); - connect(&m_history, SIGNAL(canUndoChanged(bool)), this, SLOT(updateCurrent())); updateHistoryControls(); updateCurrent(); } @@ -151,28 +149,21 @@ void QrcEditor::updateCurrent() const bool isValid = m_treeview->currentIndex().isValid(); const bool isPrefix = m_treeview->isPrefix(m_treeview->currentIndex()) && isValid; const bool isFile = !isPrefix && isValid; - int cursorPosition; m_ui.aliasLabel->setEnabled(isFile); m_ui.aliasText->setEnabled(isFile); m_currentAlias = m_treeview->currentAlias(); - cursorPosition = m_ui.aliasText->cursorPosition(); m_ui.aliasText->setText(m_currentAlias); - m_ui.aliasText->setCursorPosition(cursorPosition); m_ui.prefixLabel->setEnabled(isPrefix); m_ui.prefixText->setEnabled(isPrefix); m_currentPrefix = m_treeview->currentPrefix(); - cursorPosition = m_ui.prefixText->cursorPosition(); m_ui.prefixText->setText(m_currentPrefix); - m_ui.prefixText->setCursorPosition(cursorPosition); m_ui.languageLabel->setEnabled(isPrefix); m_ui.languageText->setEnabled(isPrefix); m_currentLanguage = m_treeview->currentLanguage(); - cursorPosition = m_ui.languageText->cursorPosition(); m_ui.languageText->setText(m_currentLanguage); - m_ui.languageText->setCursorPosition(cursorPosition); m_ui.addButton->setEnabled(true); m_addFileAction->setEnabled(isValid); diff --git a/src/shared/qrceditor/resourcefile.cpp b/src/shared/qrceditor/resourcefile.cpp index 19a5f25e991..55141ba0364 100644 --- a/src/shared/qrceditor/resourcefile.cpp +++ b/src/shared/qrceditor/resourcefile.cpp @@ -61,7 +61,7 @@ namespace qdesigner_internal { bool FileList::containsFile(File *file) { - foreach(File *tmpFile, *this) + foreach (const File *tmpFile, *this) if (tmpFile->name == file->name && tmpFile->prefix() == file->prefix()) return true; return false; @@ -168,7 +168,7 @@ bool ResourceFile::save() foreach (const QString &name, name_list) { FileList file_list; QString lang; - foreach (Prefix *pref, m_prefix_list) { + foreach (const Prefix *pref, m_prefix_list) { if (pref->name == name){ file_list += pref->file_list; lang = pref->lang; @@ -599,7 +599,7 @@ bool ResourceModel::iconFileExtension(const QString &path) } } - foreach (QString ext, ext_list) { + foreach (const QString &ext, ext_list) { if (path.endsWith(ext, Qt::CaseInsensitive)) return true; } @@ -669,10 +669,9 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const QString stringRes = conv_file.replace(QDir::separator(), QLatin1Char('/')); const QString &alias_file = file->alias; if (!alias_file.isEmpty()) - appendParenthesized(alias_file, stringRes); + appendParenthesized(alias_file, stringRes); result = stringRes; - result = "Qt::ToolTipRole " + stringRes; } break; @@ -690,14 +689,14 @@ void ResourceModel::getItem(const QModelIndex &index, QString &prefix, QString & if (!index.isValid()) return; - void * const internalPointer = index.internalPointer(); - Node * const node = reinterpret_cast(internalPointer); - Prefix * const p = node->prefix(); + const void *internalPointer = index.internalPointer(); + const Node *node = reinterpret_cast(internalPointer); + const Prefix *p = node->prefix(); Q_ASSERT(p); - bool const isFileNode = (p != node); + const bool isFileNode = (p != node); if (isFileNode) { - File *const f = node->file(); + const File *f = node->file(); Q_ASSERT(f); if (!f->alias.isEmpty()) file = f->alias; @@ -810,7 +809,7 @@ void ResourceModel::addFiles(int prefixIndex, const QStringList &fileNames, int const int prefix_idx = prefixIndex; QStringList unique_list; - foreach (QString file, file_list) { + foreach (const QString &file, file_list) { if (!m_resource_file.contains(prefix_idx, file) && !unique_list.contains(file)) unique_list.append(file); } @@ -821,7 +820,7 @@ void ResourceModel::addFiles(int prefixIndex, const QStringList &fileNames, int const int cnt = m_resource_file.fileCount(prefix_idx); beginInsertRows(prefix_model_idx, cnt, cnt + unique_list.count() - 1); // ### FIXME - foreach (QString file, unique_list) + foreach (const QString &file, unique_list) m_resource_file.addFile(prefix_idx, file); const QFileInfo fi(file_list.last()); diff --git a/src/shared/qrceditor/resourcefile_p.h b/src/shared/qrceditor/resourcefile_p.h index 3ee346cb0e6..00d999c90c6 100644 --- a/src/shared/qrceditor/resourcefile_p.h +++ b/src/shared/qrceditor/resourcefile_p.h @@ -69,8 +69,8 @@ protected: Q_ASSERT(m_prefix); } public: - File *file() { return m_file; } - Prefix *prefix() { return m_prefix; } + File *file() const { return m_file; } + Prefix *prefix() const { return m_prefix; } private: File *m_file; Prefix *m_prefix; From 566b312cd213a31f63f8a7cb0b5da5fe63d7d7cd Mon Sep 17 00:00:00 2001 From: Olli Werwolff Date: Thu, 29 Jan 2009 11:52:13 +0100 Subject: [PATCH 15/47] Fixes: "Add anyway" button must not be shown, when a resource file shall be added and it is not located in the (sub-)directory of the qrc-file Task: - RevBy: thorbjorn AutoTest: - Details: - --- src/shared/qrceditor/qrceditor.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/shared/qrceditor/qrceditor.cpp b/src/shared/qrceditor/qrceditor.cpp index bd25a42d742..b1430a08abc 100644 --- a/src/shared/qrceditor/qrceditor.cpp +++ b/src/shared/qrceditor/qrceditor.cpp @@ -225,7 +225,6 @@ void QrcEditor::resolveLocationIssues(QStringList &files) QMessageBox message(this); message.setWindowTitle(tr("Invalid file")); message.setIcon(QMessageBox::Warning); - QPushButton * const continueButton = message.addButton(tr("Add anyway"), QMessageBox::AcceptRole); QPushButton * const copyButton = message.addButton(tr("Copy"), QMessageBox::ActionRole); QPushButton * const skipButton = message.addButton(tr("Don't add"), QMessageBox::DestructiveRole); QPushButton * const abortButton = message.addButton(tr("Abort"), QMessageBox::RejectRole); @@ -234,9 +233,7 @@ void QrcEditor::resolveLocationIssues(QStringList &files) message.setText(tr("The file %1 is not in a subdirectory of the resource file. Continuing will result in an invalid resource file.") .arg(QDir::toNativeSeparators(file))); message.exec(); - if (message.clickedButton() == continueButton) { - continue; - } else if (message.clickedButton() == skipButton) { + if (message.clickedButton() == skipButton) { files.removeAt(i); count--; i--; // Compensate i++ From 34a141005728fb10dd51f87173f3005f9e3c469a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 26 Jan 2009 10:18:17 +0100 Subject: [PATCH 16/47] better tooltip --- src/plugins/debugger/gdboptionpage.ui | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/plugins/debugger/gdboptionpage.ui b/src/plugins/debugger/gdboptionpage.ui index dcd57443350..c0434461a91 100644 --- a/src/plugins/debugger/gdboptionpage.ui +++ b/src/plugins/debugger/gdboptionpage.ui @@ -107,9 +107,8 @@ - fter checking this option 'Step Into' combines in certain situations several steps, leading to 'less noisy' debugging. So will, e.g., the atomic -reference counting code be skipped, and a single 'Step Into' for a signal emission will end up directly in the slot connected to it. - + When this option is checked, 'Step Into' compresses several steps into one in certain situations, leading to 'less noisy' debugging. So will, e.g., the atomic + reference counting code be skipped, and a single 'Step Into' for a signal emission will end up directly in the slot connected to it. Skip known frames when stepping @@ -173,8 +172,6 @@ reference counting code be skipped, and a single 'Step Into' for a signal emissi 1 - - - + From fa4352137e2d8ac800d24bcc529279081e215190 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 28 Jan 2009 19:29:43 +0100 Subject: [PATCH 17/47] fix comment. --- src/plugins/projectexplorer/abstractprocessstep.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index 3aac602291c..43e8f49015f 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -51,9 +51,9 @@ namespace ProjectExplorer { It should be used as a base class if your buildstep just needs to run a process. Usage: - Use setCommand(), setArguments(), setWorkingDirectory() to specify the process you want to run. - (You need to do that before calling AbstractProcess::init()) - Inside YourBuildStep::init() call AbstractProcessStep::init() + Use setCommand(), setArguments(), setWorkingDirectory() to specify the process you want to run + (you need to do that before calling AbstractProcessStep::init()). + Inside YourBuildStep::init() call AbstractProcessStep::init(). Inside YourBuildStep::run() call AbstractProcessStep::run(), which automatically starts the proces and by default adds the output on stdOut and stdErr to the OutputWindow. If you need to process the process output override stdOut() and/or stdErr. From 72e083b425e6978c8593a727447a006588de1048 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 15 Jan 2009 19:44:59 +0100 Subject: [PATCH 18/47] fix xterm call incl. shell escaping --- .../projectexplorer/consoleprocess_unix.cpp | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/consoleprocess_unix.cpp b/src/plugins/projectexplorer/consoleprocess_unix.cpp index 7b432c0af03..122ae7e4bdf 100644 --- a/src/plugins/projectexplorer/consoleprocess_unix.cpp +++ b/src/plugins/projectexplorer/consoleprocess_unix.cpp @@ -46,29 +46,36 @@ ConsoleProcess::~ConsoleProcess() { } +static QString shellEscape(const QString &in) +{ + QString out = in; + out.replace('\'', "'\''"); + out.prepend('\''); + out.append('\''); + return out; +} + bool ConsoleProcess::start(const QString &program, const QStringList &args) { if (m_process->state() != QProcess::NotRunning) return false; QString shellArgs; shellArgs += QLatin1String("cd "); - shellArgs += workingDirectory(); + shellArgs += shellEscape(workingDirectory()); shellArgs += QLatin1Char(';'); - shellArgs += program; + shellArgs += shellEscape(program); foreach (const QString &arg, args) { shellArgs += QLatin1Char(' '); - shellArgs += QLatin1Char('\''); - shellArgs += arg; - shellArgs += QLatin1Char('\''); + shellArgs += shellEscape(arg); } - shellArgs += QLatin1String("; echo; echo \"Press enter to close this window\"; read"); + shellArgs += QLatin1String("; echo; echo \"Press enter to close this window\"; read DUMMY"); m_process->setEnvironment(environment()); connect(m_process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(processFinished(int, QProcess::ExitStatus))); - m_process->start(QLatin1String("xterm"), QStringList() << QLatin1String("-e") << shellArgs); + m_process->start(QLatin1String("xterm"), QStringList() << QLatin1String("-e") << "/bin/sh" << "-c" << shellArgs); if (!m_process->waitForStarted()) return false; emit processStarted(); From 2a2e3b14171bf5c0507b16b1f90142f48815ef6d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 28 Jan 2009 14:49:38 +0100 Subject: [PATCH 19/47] Revert "debugger: add configuariton to start the debugged process in a separate" This reverts commit 44add9f0bd4a104cf8f2697fe9f95a7f6f410494. This option is meant to be in "Run Settings" per run configuration. --- src/plugins/debugger/debuggermanager.cpp | 1 - src/plugins/debugger/debuggermanager.h | 1 - src/plugins/debugger/debuggerplugin.cpp | 4 ---- src/plugins/debugger/gdboptionpage.ui | 10 ---------- 4 files changed, 16 deletions(-) diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index 8180c7cfd10..423321fc7ba 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -94,7 +94,6 @@ DebuggerSettings::DebuggerSettings() m_skipKnownFrames = false; m_debugDumpers = false; m_useToolTips = false; - m_useTerminal = false; m_useCustomDumpers = true; } diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index e16941a79f5..1c12a731643 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -198,7 +198,6 @@ public: bool m_debugDumpers; bool m_useFastStart; bool m_useToolTips; - bool m_useTerminal; QString m_scriptFile; }; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 2874911c56a..82c48f37fb4 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -282,7 +282,6 @@ QWidget *GdbOptionPage::createPage(QWidget *parent) m_ui.checkBoxUseCustomDumpers->setChecked(m_settings.m_useCustomDumpers); m_ui.checkBoxFastStart->setChecked(m_settings.m_useFastStart); m_ui.checkBoxUseToolTips->setChecked(m_settings.m_useToolTips); - m_ui.checkBoxUseTerminal->setChecked(m_settings.m_useTerminal); #ifndef QT_DEBUG #if 0 @@ -325,7 +324,6 @@ void GdbOptionPage::apply() m_settings.m_useCustomDumpers = m_ui.checkBoxUseCustomDumpers->isChecked(); m_settings.m_useFastStart = m_ui.checkBoxFastStart->isChecked(); m_settings.m_useToolTips = m_ui.checkBoxUseToolTips->isChecked(); - m_settings.m_useTerminal = m_ui.checkBoxUseTerminal->isChecked(); *m_plugin->m_manager->settings() = m_settings; m_plugin->writeSettings(); @@ -892,7 +890,6 @@ void DebuggerPlugin::writeSettings() const s->setValue("UseFastStart", m->m_useFastStart); s->setValue("UseToolTips", m->m_useToolTips); - s->setValue("UseTerminal", m->m_useTerminal); s->setValue("UseCustomDumpers", m->m_useCustomDumpers); s->setValue("SkipKnowFrames", m->m_skipKnownFrames); s->setValue("DebugDumpers", m->m_debugDumpers); @@ -926,7 +923,6 @@ void DebuggerPlugin::readSettings() m->m_useCustomDumpers = s->value("UseCustomDumpers", true).toBool(); m->m_useFastStart = s->value("UseFastStart", false).toBool(); m->m_useToolTips = s->value("UseToolTips", false).toBool(); - m->m_useTerminal = s->value("UseTerminal", false).toBool(); s->endGroup(); m_manager->mainWindow()->restoreState(ba); diff --git a/src/plugins/debugger/gdboptionpage.ui b/src/plugins/debugger/gdboptionpage.ui index c0434461a91..ef485ccbf83 100644 --- a/src/plugins/debugger/gdboptionpage.ui +++ b/src/plugins/debugger/gdboptionpage.ui @@ -84,16 +84,6 @@ - - - - Start debugged process in a separte terminal. - - - Start in terminal - - - From 37aef098853c3f4aab3240fbd30769939242841e Mon Sep 17 00:00:00 2001 From: Patrick Star Date: Thu, 29 Jan 2009 13:14:32 +0100 Subject: [PATCH 20/47] Fixes: - compile on gcc3 Task: - none RevBy: - TrustMe --- src/plugins/help/centralwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/help/centralwidget.cpp b/src/plugins/help/centralwidget.cpp index a944efa29b3..888e1b26ec1 100644 --- a/src/plugins/help/centralwidget.cpp +++ b/src/plugins/help/centralwidget.cpp @@ -407,7 +407,7 @@ void CentralWidget::setSourceInNewTab(const QUrl &url) tabWidget->setCurrentIndex(tabWidget->addTab(viewer, quoteTabTitle(viewer->documentTitle()))); -#if defined(QT_NO_WEBIT) +#if defined(QT_NO_WEBKIT) QFont font = qApp->font(); if (helpEngine->customValue(QLatin1String("useBrowserFont")).toBool()) font = qVariantValue(helpEngine->customValue(QLatin1String("browserFont"))); From 4ff4bf7889b1a14cec987de3a8ed33707a21fe5f Mon Sep 17 00:00:00 2001 From: Olli Werwolff Date: Thu, 29 Jan 2009 13:31:33 +0100 Subject: [PATCH 21/47] Fixes: duplicate check when adding resources using the resource editor fixed Task: - RevBy: - AutoTest: - Details: If the user wants to add a resource which is not located in the directory/a subdirectory of the qrc-file, he is asked what should be done. If he chose to copy the file to another directory, the check, if this directory is valid ((sub-)directory of the qrc-file) was missing. Added it. --- src/shared/qrceditor/qrceditor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/shared/qrceditor/qrceditor.cpp b/src/shared/qrceditor/qrceditor.cpp index 5149576e61f..1cebaec19fb 100644 --- a/src/shared/qrceditor/qrceditor.cpp +++ b/src/shared/qrceditor/qrceditor.cpp @@ -234,6 +234,11 @@ void QrcEditor::resolveLocationIssues(QStringList &files) const QString copyName = QFileDialog::getSaveFileName(this, tr("Choose copy location"), suggestion.absoluteFilePath()); if (!copyName.isEmpty()) { + QString relPath = dir.relativeFilePath(copyName); + if (relPath.startsWith(dotdotSlash)) { // directory is still invalid + i--; // Compensate i++ and try again + continue; + } if (QFile::exists(copyName)) { if (!QFile::remove(copyName)) { QMessageBox::critical(this, tr("Overwrite failed"), From 276abf077d22d483a8ca2fd506cc5c437de7f286 Mon Sep 17 00:00:00 2001 From: con Date: Thu, 29 Jan 2009 12:20:40 +0100 Subject: [PATCH 22/47] Fixes: - Layout of git settings. Details: - No need for form layout anyhow (which looks broken atm). --- src/plugins/git/settingspage.ui | 52 ++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/src/plugins/git/settingspage.ui b/src/plugins/git/settingspage.ui index 151608d03b0..94c04493aab 100644 --- a/src/plugins/git/settingspage.ui +++ b/src/plugins/git/settingspage.ui @@ -6,7 +6,7 @@ 0 0 - 389 + 403 183 @@ -25,16 +25,16 @@ true - - - - - PATH: - - - - - + + + + + + + PATH: + + + @@ -47,19 +47,23 @@ - - - - <b>Note:</b> - - - - - - - Git needs to find Perl in the environment as well. - - + + + + + + <b>Note:</b> + + + + + + + Git needs to find Perl in the environment as well. + + + + From c5948891d409396b7573c900547f6bf82980725c Mon Sep 17 00:00:00 2001 From: con Date: Thu, 29 Jan 2009 13:33:55 +0100 Subject: [PATCH 23/47] Fixes: - Unify UI with path chooser Task: - 237690 --- src/plugins/projectexplorer/processstep.cpp | 39 +++---------- src/plugins/projectexplorer/processstep.h | 2 - src/plugins/projectexplorer/processstep.ui | 62 ++++++++++----------- 3 files changed, 38 insertions(+), 65 deletions(-) diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index e53e6a10992..50f4ed81adf 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -136,17 +136,14 @@ ProcessStepConfigWidget::ProcessStepConfigWidget(ProcessStep *step) : m_step(step) { m_ui.setupUi(this); - connect(m_ui.commandBrowseButton, SIGNAL(clicked(bool)), - this, SLOT(commandBrowseButtonClicked())); - connect(m_ui.workingDirBrowseButton, SIGNAL(clicked(bool)), - this, SLOT(workingDirBrowseButtonClicked())); + m_ui.command->setExpectedKind(Core::Utils::PathChooser::File); + connect(m_ui.command, SIGNAL(changed()), + this, SLOT(commandLineEditTextEdited())); + connect(m_ui.workingDirectory, SIGNAL(changed()), + this, SLOT(workingDirectoryLineEditTextEdited())); connect(m_ui.nameLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(nameLineEditTextEdited())); - connect(m_ui.commandLineEdit, SIGNAL(textEdited(const QString&)), - this, SLOT(commandLineEditTextEdited())); - connect(m_ui.workingDirectoryLineEdit, SIGNAL(textEdited(const QString&)), - this, SLOT(workingDirectoryLineEditTextEdited())); connect(m_ui.commandArgumentsLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(commandArgumentsLineEditTextEdited())); connect(m_ui.enabledGroupBox, SIGNAL(clicked(bool)), @@ -158,34 +155,16 @@ QString ProcessStepConfigWidget::displayName() const return m_step->name(); } -void ProcessStepConfigWidget::workingDirBrowseButtonClicked() -{ - QString workingDirectory = QFileDialog::getExistingDirectory(this, "Select the working directory", m_ui.workingDirectoryLineEdit->text()); - if (workingDirectory.isEmpty()) - return; - m_ui.workingDirectoryLineEdit->setText(workingDirectory); - workingDirectoryLineEditTextEdited(); -} - -void ProcessStepConfigWidget::commandBrowseButtonClicked() -{ - QString filename = QFileDialog::getOpenFileName(this, "Select the executable"); - if (filename.isEmpty()) - return; - m_ui.commandLineEdit->setText(filename); - commandLineEditTextEdited(); -} - void ProcessStepConfigWidget::init(const QString &buildConfiguration) { m_buildConfiguration = buildConfiguration; if (buildConfiguration != QString::null) { - m_ui.commandLineEdit->setText(m_step->command(buildConfiguration)); + m_ui.command->setPath(m_step->command(buildConfiguration)); QString workingDirectory = m_step->value(buildConfiguration, "workingDirectory").toString(); if (workingDirectory.isEmpty()) workingDirectory = "$BUILDDIR"; - m_ui.workingDirectoryLineEdit->setText(workingDirectory); + m_ui.workingDirectory->setPath(workingDirectory); m_ui.commandArgumentsLineEdit->setText(m_step->arguments(buildConfiguration).join(" ")); m_ui.enabledGroupBox->setChecked(m_step->enabled(buildConfiguration)); @@ -200,12 +179,12 @@ void ProcessStepConfigWidget::nameLineEditTextEdited() void ProcessStepConfigWidget::commandLineEditTextEdited() { - m_step->setCommand(m_buildConfiguration, m_ui.commandLineEdit->text()); + m_step->setCommand(m_buildConfiguration, m_ui.command->path()); } void ProcessStepConfigWidget::workingDirectoryLineEditTextEdited() { - QString wd = m_ui.workingDirectoryLineEdit->text(); + QString wd = m_ui.workingDirectory->path(); m_step->setValue(m_buildConfiguration, "workingDirectory", wd); } diff --git a/src/plugins/projectexplorer/processstep.h b/src/plugins/projectexplorer/processstep.h index 808aaa2a95b..aa8b2760df2 100644 --- a/src/plugins/projectexplorer/processstep.h +++ b/src/plugins/projectexplorer/processstep.h @@ -84,8 +84,6 @@ private slots: void workingDirectoryLineEditTextEdited(); void commandArgumentsLineEditTextEdited(); void enabledGroupBoxClicked(bool); - void workingDirBrowseButtonClicked(); - void commandBrowseButtonClicked(); private: QString m_buildConfiguration; ProcessStep *m_step; diff --git a/src/plugins/projectexplorer/processstep.ui b/src/plugins/projectexplorer/processstep.ui index 9875ef474cb..01255ab891a 100644 --- a/src/plugins/projectexplorer/processstep.ui +++ b/src/plugins/projectexplorer/processstep.ui @@ -6,8 +6,8 @@ 0 0 - 428 - 222 + 505 + 271 @@ -22,61 +22,50 @@ true - + + + QFormLayout::ExpandingFieldsGrow + + + + + Name: + + + + + + - Command + Command: - - - - - - ... - - + - Working Directory + Working Directory: - - - - - - ... - - + - command arguments + Command Arguments: - + - - - - Name - - - - - - @@ -95,6 +84,13 @@ + + + Core::Utils::PathChooser + QWidget +
utils/pathchooser.h
+
+
From b655c31ba8edac14e56058496975a44b4965c46e Mon Sep 17 00:00:00 2001 From: con Date: Thu, 29 Jan 2009 13:46:19 +0100 Subject: [PATCH 24/47] Fixes: - UI consistency Details: - Seems that we use colons in forms. --- src/plugins/qt4projectmanager/qt4buildconfigwidget.ui | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt4buildconfigwidget.ui b/src/plugins/qt4projectmanager/qt4buildconfigwidget.ui index 7ce0d1950d1..c29023a6ddf 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfigwidget.ui +++ b/src/plugins/qt4projectmanager/qt4buildconfigwidget.ui @@ -22,7 +22,7 @@ - Configuration Name + Configuration Name: @@ -45,7 +45,7 @@ - Qt Version + Qt Version: @@ -93,7 +93,7 @@ - Shadow Build + Shadow Build: @@ -113,7 +113,7 @@ - Build Directory + Build Directory: From 7a7d5dfd56c288a179b2564e8c177a8efce933b1 Mon Sep 17 00:00:00 2001 From: Olli Werwolff Date: Thu, 29 Jan 2009 15:13:07 +0100 Subject: [PATCH 25/47] Fixes: Show relative path for file nodes in resource editor Task: 238307 RevBy: thorbjorn AutoTest: - Details: - --- src/shared/qrceditor/resourcefile.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/shared/qrceditor/resourcefile.cpp b/src/shared/qrceditor/resourcefile.cpp index 55141ba0364..d6aa452cdcf 100644 --- a/src/shared/qrceditor/resourcefile.cpp +++ b/src/shared/qrceditor/resourcefile.cpp @@ -641,7 +641,8 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const } else { // File node Q_ASSERT(file); - stringRes = QFileInfo(file->name).fileName(); + QString conv_file = m_resource_file.relativePath(file->name); + stringRes = conv_file.replace(QDir::separator(), QLatin1Char('/')); const QString alias = file->alias; if (!alias.isEmpty()) appendParenthesized(alias, stringRes); @@ -661,20 +662,6 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const } } break; - case Qt::ToolTipRole: - if (isFileNode) { - // File node - Q_ASSERT(file); - QString conv_file = m_resource_file.relativePath(file->name); - QString stringRes = conv_file.replace(QDir::separator(), QLatin1Char('/')); - const QString &alias_file = file->alias; - if (!alias_file.isEmpty()) - appendParenthesized(alias_file, stringRes); - - result = stringRes; - } - break; - default: break; } From e4e26a9113464e8360a53e277c6347c87c9ddb2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Thu, 29 Jan 2009 15:19:34 +0100 Subject: [PATCH 26/47] Optimized qrc editor in case of large images Prevented it from re-generating an icon for the large image every time it needed to be drawn. --- src/shared/qrceditor/resourcefile.cpp | 21 +++++++++++---------- src/shared/qrceditor/resourcefile_p.h | 2 ++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/shared/qrceditor/resourcefile.cpp b/src/shared/qrceditor/resourcefile.cpp index d6aa452cdcf..ae003d31532 100644 --- a/src/shared/qrceditor/resourcefile.cpp +++ b/src/shared/qrceditor/resourcefile.cpp @@ -619,12 +619,12 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const if (!index.isValid()) return QVariant(); - void * const internalPointer = index.internalPointer(); - Node * const node = reinterpret_cast(internalPointer); - Prefix const * const prefix = node->prefix(); - File const * const file = node->file(); + const void *internalPointer = index.internalPointer(); + const Node *node = reinterpret_cast(internalPointer); + const Prefix *prefix = node->prefix(); + File *file = node->file(); Q_ASSERT(prefix); - bool const isFileNode = (prefix != node); + const bool isFileNode = (prefix != node); QVariant result; @@ -654,12 +654,13 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const if (isFileNode) { // File node Q_ASSERT(file); - const QString path = m_resource_file.absolutePath(file->name); - if (iconFileExtension(path)) { - const QIcon icon(path); - if (!icon.isNull()) - result = icon; + if (file->icon.isNull()) { + const QString path = m_resource_file.absolutePath(file->name); + if (iconFileExtension(path)) + file->icon = QIcon(path); } + if (!file->icon.isNull()) + result = file->icon; } break; default: diff --git a/src/shared/qrceditor/resourcefile_p.h b/src/shared/qrceditor/resourcefile_p.h index 00d999c90c6..4a7d510dc48 100644 --- a/src/shared/qrceditor/resourcefile_p.h +++ b/src/shared/qrceditor/resourcefile_p.h @@ -40,6 +40,7 @@ #include #include #include +#include #include "shared_global_p.h" @@ -89,6 +90,7 @@ struct File : public Node { bool operator != (const File &other) const { return name != other.name; } QString name; QString alias; + QIcon icon; }; class FileList : public QList From 549ad43a95eeae50cfa6de8c212ee1391a5f85a8 Mon Sep 17 00:00:00 2001 From: Patrick Star Date: Thu, 29 Jan 2009 15:34:12 +0100 Subject: [PATCH 27/47] Fixes: - nothing Task: - none RevBy: - Thorbjoern AutoTest: - compile Details: - remove font settings stuff, since we overwrite it in coreplugin --- src/plugins/help/centralwidget.cpp | 50 ------------------------------ src/plugins/help/centralwidget.h | 3 +- 2 files changed, 1 insertion(+), 52 deletions(-) diff --git a/src/plugins/help/centralwidget.cpp b/src/plugins/help/centralwidget.cpp index 888e1b26ec1..138bb437bd6 100644 --- a/src/plugins/help/centralwidget.cpp +++ b/src/plugins/help/centralwidget.cpp @@ -248,8 +248,6 @@ void CentralWidget::setLastShownPages() } setSource(url); } - - updateBrowserFont(); } bool CentralWidget::hasSelection() const @@ -407,24 +405,6 @@ void CentralWidget::setSourceInNewTab(const QUrl &url) tabWidget->setCurrentIndex(tabWidget->addTab(viewer, quoteTabTitle(viewer->documentTitle()))); -#if defined(QT_NO_WEBKIT) - QFont font = qApp->font(); - if (helpEngine->customValue(QLatin1String("useBrowserFont")).toBool()) - font = qVariantValue(helpEngine->customValue(QLatin1String("browserFont"))); - viewer->setFont(font); -#else - QWebView* view = qobject_cast (viewer); - if (view) { - QWebSettings* settings = QWebSettings::globalSettings(); - int fontSize = settings->fontSize(QWebSettings::DefaultFontSize); - QString fontFamily = settings->fontFamily(QWebSettings::StandardFont); - - settings = view->settings(); - settings->setFontSize(QWebSettings::DefaultFontSize, fontSize); - settings->setFontFamily(QWebSettings::StandardFont, fontFamily); - } -#endif - connectSignals(); } @@ -612,36 +592,6 @@ bool CentralWidget::eventFilter(QObject *object, QEvent *e) return QWidget::eventFilter(object, e); } -void CentralWidget::updateBrowserFont() -{ -#if defined(QT_NO_WEBKIT) - QFont font = qApp->font(); - if (helpEngine->customValue(QLatin1String("useBrowserFont")).toBool()) - font = qVariantValue(helpEngine->customValue(QLatin1String("browserFont"))); - - QWidget* widget = 0; - for (int i = 0; i < tabWidget->count(); ++i) { - widget = tabWidget->widget(i); - if (widget->font() != font) - widget->setFont(font); - } -#else - QWebSettings* settings = QWebSettings::globalSettings(); - int fontSize = settings->fontSize(QWebSettings::DefaultFontSize); - QString fontFamily = settings->fontFamily(QWebSettings::StandardFont); - - QWebView* widget = 0; - for (int i = 0; i < tabWidget->count(); ++i) { - widget = qobject_cast (tabWidget->widget(i)); - if (widget) { - settings = widget->settings(); - settings->setFontSize(QWebSettings::DefaultFontSize, fontSize); - settings->setFontFamily(QWebSettings::StandardFont, fontFamily); - } - } -#endif -} - bool CentralWidget::find(const QString &txt, QTextDocument::FindFlags findFlags, bool incremental) { diff --git a/src/plugins/help/centralwidget.h b/src/plugins/help/centralwidget.h index 5532f5ded83..f99b68d6432 100644 --- a/src/plugins/help/centralwidget.h +++ b/src/plugins/help/centralwidget.h @@ -85,7 +85,7 @@ public: void activateTab(bool onlyHelpViewer = false); bool find(const QString &txt, QTextDocument::FindFlags findFlags, bool incremental); void setLastShownPages(); - + static CentralWidget *instance(); public slots: @@ -98,7 +98,6 @@ public slots: void print(); void pageSetup(); void printPreview(); - void updateBrowserFont(); void setSource(const QUrl &url); void setSourceInNewTab(const QUrl &url); HelpViewer *newEmptyTab(); From b04ac61ef00b001a23dfed9ff7bbf6162291b1e4 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 29 Jan 2009 15:31:02 +0100 Subject: [PATCH 28/47] Fixes: Fix line edit focus on MacStyle Task: 242757 RevBy: twschulz Details: Mac style reimplements QStyle::event, hence we need to pass it on. --- src/plugins/coreplugin/manhattanstyle.cpp | 8 ++++++++ src/plugins/coreplugin/manhattanstyle.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 72b86d85d7c..c61dbbbe3e1 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -1054,3 +1054,11 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti break; } } + +// Mac style reimplements this to control the +// focus widget among other things +bool ManhattanStyle::event(QEvent *e) +{ + Q_ASSERT(d->style); + return d->style->event(e); +} diff --git a/src/plugins/coreplugin/manhattanstyle.h b/src/plugins/coreplugin/manhattanstyle.h index 1f61b931e9d..5dd832ffdf8 100644 --- a/src/plugins/coreplugin/manhattanstyle.h +++ b/src/plugins/coreplugin/manhattanstyle.h @@ -78,6 +78,9 @@ public: void unpolish(QWidget *widget); void unpolish(QApplication *app); +protected: + bool event(QEvent *e); + protected Q_SLOTS: QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const; int layoutSpacingImplementation(QSizePolicy::ControlType control1, From f781076c5a8caa5db7ecfaa02cd0a0e6ec0f0d75 Mon Sep 17 00:00:00 2001 From: con Date: Thu, 29 Jan 2009 15:48:54 +0100 Subject: [PATCH 29/47] Fixes: - Custom executable GUI cleanup Task: - 237690 --- .../customexecutablerunconfiguration.cpp | 72 +++++-------------- .../customexecutablerunconfiguration.h | 12 ++-- 2 files changed, 23 insertions(+), 61 deletions(-) diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 4012cee8e13..3bd74726014 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -54,46 +54,34 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE QFormLayout *layout = new QFormLayout(); layout->setMargin(0); - m_executableLineEdit = new QLineEdit; - QToolButton *exectuableToolButton = new QToolButton(); - exectuableToolButton->setText("..."); - QHBoxLayout *hl = new QHBoxLayout; - hl->addWidget(m_executableLineEdit); - hl->addWidget(exectuableToolButton); - layout->addRow("Executable", hl); + m_executableChooser = new Core::Utils::PathChooser(); + m_executableChooser->setExpectedKind(Core::Utils::PathChooser::File); + layout->addRow("Executable:", m_executableChooser); m_commandLineArgumentsLineEdit = new QLineEdit; - layout->addRow("Arguments", m_commandLineArgumentsLineEdit); + m_commandLineArgumentsLineEdit->setMinimumWidth(200); // this shouldn't be fixed here... + layout->addRow("Arguments:", m_commandLineArgumentsLineEdit); - m_workingDirectoryLineEdit = new QLineEdit(); - QToolButton *workingDirectoryToolButton = new QToolButton(); - workingDirectoryToolButton->setText("..."); - hl = new QHBoxLayout; - hl->addWidget(m_workingDirectoryLineEdit); - hl->addWidget(workingDirectoryToolButton); - layout->addRow("Working Directory", hl); + m_workingDirectory = new Core::Utils::PathChooser(); + layout->addRow("Working Directory:", m_workingDirectory); setLayout(layout); changed(); - connect(m_executableLineEdit, SIGNAL(textEdited(const QString&)), - this, SLOT(setExecutable(const QString&))); + connect(m_executableChooser, SIGNAL(changed()), + this, SLOT(setExecutable())); connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(const QString&)), this, SLOT(setCommandLineArguments(const QString&))); - connect(m_workingDirectoryLineEdit, SIGNAL(textEdited(const QString&)), - this, SLOT(setWorkingDirectory(const QString&))); - connect(exectuableToolButton, SIGNAL(clicked(bool)), - this, SLOT(executableToolButtonClicked())); - connect(workingDirectoryToolButton, SIGNAL(clicked(bool)), - this, SLOT(workingDirectoryToolButtonClicked())); + connect(m_workingDirectory, SIGNAL(changed()), + this, SLOT(setWorkingDirectory())); connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed())); } -void CustomExecutableConfigurationWidget::setExecutable(const QString &executable) +void CustomExecutableConfigurationWidget::setExecutable() { m_ignoreChange = true; - m_runConfiguration->setExecutable(executable); + m_runConfiguration->setExecutable(m_executableChooser->path()); m_ignoreChange = false; } void CustomExecutableConfigurationWidget::setCommandLineArguments(const QString &commandLineArguments) @@ -102,47 +90,21 @@ void CustomExecutableConfigurationWidget::setCommandLineArguments(const QString m_runConfiguration->setCommandLineArguments(commandLineArguments); m_ignoreChange = false; } -void CustomExecutableConfigurationWidget::setWorkingDirectory(const QString &workingDirectory) +void CustomExecutableConfigurationWidget::setWorkingDirectory() { m_ignoreChange = true; - m_runConfiguration->setWorkingDirectory(workingDirectory); + m_runConfiguration->setWorkingDirectory(m_workingDirectory->path()); m_ignoreChange = false; } -void CustomExecutableConfigurationWidget::executableToolButtonClicked() -{ - QString newValue; - QString executableFilter; -#ifdef Q_OS_WIN - executableFilter = "Executable (*.exe)"; -#endif - newValue = QFileDialog::getOpenFileName(this, "Executable", "", executableFilter); - if (!newValue.isEmpty()) { - m_executableLineEdit->setText(newValue); - setExecutable(newValue); - } -} - -void CustomExecutableConfigurationWidget::workingDirectoryToolButtonClicked() -{ - QString newValue; - QString executableFilter; - - newValue = QFileDialog::getExistingDirectory(this, "Directory", m_workingDirectoryLineEdit->text()); - if (newValue.isEmpty()) { - m_workingDirectoryLineEdit->setText(newValue); - setWorkingDirectory(newValue); - } -} - void CustomExecutableConfigurationWidget::changed() { // We triggered the change, don't update us if (m_ignoreChange) return; - m_executableLineEdit->setText(m_runConfiguration->baseExecutable()); + m_executableChooser->setPath(m_runConfiguration->baseExecutable()); m_commandLineArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(m_runConfiguration->commandLineArguments())); - m_workingDirectoryLineEdit->setText(m_runConfiguration->baseWorkingDirectory()); + m_workingDirectory->setPath(m_runConfiguration->baseWorkingDirectory()); } CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Project *pro) diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.h b/src/plugins/projectexplorer/customexecutablerunconfiguration.h index 52cbedd51c6..f2f05cb0b20 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.h +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.h @@ -36,6 +36,8 @@ #include "applicationrunconfiguration.h" +#include + #include QT_BEGIN_NAMESPACE @@ -108,18 +110,16 @@ public: CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc); private slots: void changed(); - void executableToolButtonClicked(); - void workingDirectoryToolButtonClicked(); - void setExecutable(const QString &executable); + void setExecutable(); void setCommandLineArguments(const QString &commandLineArguments); - void setWorkingDirectory(const QString &workingDirectory); + void setWorkingDirectory(); private: bool m_ignoreChange; CustomExecutableRunConfiguration *m_runConfiguration; - QLineEdit *m_executableLineEdit; + Core::Utils::PathChooser *m_executableChooser; QLineEdit *m_commandLineArgumentsLineEdit; - QLineEdit *m_workingDirectoryLineEdit; + Core::Utils::PathChooser *m_workingDirectory; }; } } From 3e908daeea398553f0bd48e36c0596b413764bca Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 29 Jan 2009 16:12:57 +0100 Subject: [PATCH 30/47] Fix filesystem icons on windows. We now use filesystem icons on all platforms so we might as well enable proper support on windows again. --- src/plugins/coreplugin/fileiconprovider.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/coreplugin/fileiconprovider.cpp b/src/plugins/coreplugin/fileiconprovider.cpp index 63947e8ed6c..50d29a747dc 100644 --- a/src/plugins/coreplugin/fileiconprovider.cpp +++ b/src/plugins/coreplugin/fileiconprovider.cpp @@ -74,7 +74,7 @@ QIcon FileIconProvider::icon(const QFileInfo &fileInfo) // Disabled since for now we'll make sure that all icons fit with our // own custom icons by returning an empty one if we don't know it. -#if 0 +#ifdef Q_OS_WIN // This is incorrect if the OS does not always return the same icon for the // same suffix (Mac OS X), but should speed up the retrieval a lot ... icon = m_systemIconProvider.icon(fileInfo); @@ -127,7 +127,7 @@ void FileIconProvider::registerIconOverlayForSuffix(const QIcon &icon, const QSt QIcon FileIconProvider::iconForSuffix(const QString &suffix) const { QIcon icon; - +#ifndef Q_OS_WIN // On windows we use the file system icons if (suffix.isEmpty()) return icon; @@ -138,7 +138,7 @@ QIcon FileIconProvider::iconForSuffix(const QString &suffix) const break; } } - +#endif return icon; } From 072e03a5cc9eb4ebd173f8e07f9b0736617f7866 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 29 Jan 2009 16:49:35 +0100 Subject: [PATCH 31/47] Fixes: Parsing of wide char literals. --- src/shared/cplusplus/Parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index 085c8cb54ef..572c9f6665b 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -2508,7 +2508,8 @@ bool Parser::parseBoolLiteral(ExpressionAST *&node) bool Parser::parseNumericLiteral(ExpressionAST *&node) { - if (LA() == T_INT_LITERAL || LA() == T_FLOAT_LITERAL || LA() == T_CHAR_LITERAL) { + if (LA() == T_INT_LITERAL || LA() == T_FLOAT_LITERAL || + LA() == T_CHAR_LITERAL || LA() == T_WIDE_CHAR_LITERAL) { NumericLiteralAST *ast = new (_pool) NumericLiteralAST; ast->token = consumeToken(); node = ast; From 608ec4979bac9f42e49134390debbcd6a515fc5c Mon Sep 17 00:00:00 2001 From: Olli Werwolff Date: Thu, 29 Jan 2009 16:50:34 +0100 Subject: [PATCH 32/47] Fixes: Resources in resource editor can be removed using the "delete" key Task: - RevBy: thorbjorn AutoTest: - Details: - --- src/shared/qrceditor/resourceview.cpp | 8 ++++++++ src/shared/qrceditor/resourceview.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/shared/qrceditor/resourceview.cpp b/src/shared/qrceditor/resourceview.cpp index ee9c507337f..cb010f0f4b9 100644 --- a/src/shared/qrceditor/resourceview.cpp +++ b/src/shared/qrceditor/resourceview.cpp @@ -382,6 +382,14 @@ void ResourceView::mouseReleaseEvent(QMouseEvent *e) QTreeView::mouseReleaseEvent(e); } +void ResourceView::keyPressEvent(QKeyEvent *e) +{ + if (e->key() == Qt::Key_Delete) + removeItem(); + else + QTreeView::keyPressEvent(e); +} + void ResourceView::popupMenu(const QModelIndex &index) { if (!m_releasePos.isNull()) { diff --git a/src/shared/qrceditor/resourceview.h b/src/shared/qrceditor/resourceview.h index ae11b2db93d..f50e6e6c43b 100644 --- a/src/shared/qrceditor/resourceview.h +++ b/src/shared/qrceditor/resourceview.h @@ -138,6 +138,7 @@ protected: void changeLang(const QModelIndex &index); void changeAlias(const QModelIndex &index); void mouseReleaseEvent(QMouseEvent *e); + void keyPressEvent(QKeyEvent *e); signals: void removeItem(); From bdc0d42e99fee8388dbad737ee673889842d663b Mon Sep 17 00:00:00 2001 From: goro Date: Thu, 29 Jan 2009 17:24:15 +0100 Subject: [PATCH 33/47] Make patcher not abort on errors --- src/tools/qtlibspatcher/qtlibspatchermain.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/tools/qtlibspatcher/qtlibspatchermain.cpp b/src/tools/qtlibspatcher/qtlibspatchermain.cpp index c3ff6a0387e..4fba6a025c1 100644 --- a/src/tools/qtlibspatcher/qtlibspatchermain.cpp +++ b/src/tools/qtlibspatcher/qtlibspatchermain.cpp @@ -85,13 +85,13 @@ bool patchBinaryWithQtPathes(const char *fileName, const char *baseQtPath) logFileName(fileName); for (int i = 0; i < (int)(sizeof(variables) / sizeof(variables[0])); i++) { - const char * const newStr = allocFileNameCopyAppend(variables[i].variable, baseQtPath, variables[i].subDirectory); + const char * const newStr = allocFileNameCopyAppend( + variables[i].variable, baseQtPath, variables[i].subDirectory); BinPatch binFile(fileName); const bool success = binFile.patch(variables[i].variable, newStr); delete[] newStr; if (!success) { result = false; - break; } } @@ -119,7 +119,6 @@ bool patchBinariesWithQtPathes(const char *baseQtPath) delete[] fileName; if (!success) { result = false; - break; } } @@ -602,9 +601,6 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath) delete[] fileName; delete[] oldSourcePath; delete[] newSourcePath; - - if (!result) - break; } return result; @@ -774,8 +770,8 @@ int main(int argc, char *args[]) break; patchTextFiles(baseQtPath); - const bool success = patchBinariesWithQtPathes(baseQtPath) - && patchDebugLibrariesWithQtPath(baseQtPath); + const bool successOne = patchBinariesWithQtPathes(baseQtPath); + const bool successTwo = patchDebugLibrariesWithQtPath(baseQtPath); delete[] baseQtPath; - return success ? 0 : 1; + return (successOne && successTwo) ? 0 : 1; } From beb0b18320ed7b1eadd8c30f5a768fa6fa93aa0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Thu, 29 Jan 2009 17:43:34 +0100 Subject: [PATCH 34/47] Add a border on top of the find toolbar It was missing. --- src/plugins/find/findtoolbar.cpp | 11 +++++++++++ src/plugins/find/findtoolbar.h | 2 ++ src/plugins/quickopen/quickopentoolwindow.cpp | 2 -- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp index a8d96531604..7d8072b7ac3 100644 --- a/src/plugins/find/findtoolbar.cpp +++ b/src/plugins/find/findtoolbar.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -224,6 +225,16 @@ FindToolBar::~FindToolBar() { } +void FindToolBar::paintEvent(QPaintEvent *event) +{ + QToolBar::paintEvent(event); + + QPainter p(this); + const QRect r = rect(); + p.setPen(StyleHelper::borderColor()); + p.drawLine(r.topLeft(), r.topRight()); +} + bool FindToolBar::eventFilter(QObject *obj, QEvent *event) { if ((obj == m_ui.findEdit || obj == m_findCompleter->popup()) diff --git a/src/plugins/find/findtoolbar.h b/src/plugins/find/findtoolbar.h index 030a57876a3..ce3dfdd7449 100644 --- a/src/plugins/find/findtoolbar.h +++ b/src/plugins/find/findtoolbar.h @@ -58,6 +58,8 @@ public: void invokeClearResults(); + void paintEvent(QPaintEvent *event); + private slots: void invokeFindNext(); void invokeFindPrevious(); diff --git a/src/plugins/quickopen/quickopentoolwindow.cpp b/src/plugins/quickopen/quickopentoolwindow.cpp index d769313b58a..dea220c837e 100644 --- a/src/plugins/quickopen/quickopentoolwindow.cpp +++ b/src/plugins/quickopen/quickopentoolwindow.cpp @@ -56,9 +56,7 @@ QT_END_NAMESPACE #include #include #include -#include #include -#include #include #include #include From da901f4a4fdcc2066475dfb1968408af5654d93c Mon Sep 17 00:00:00 2001 From: dt Date: Thu, 29 Jan 2009 18:42:06 +0100 Subject: [PATCH 35/47] Fixes: Set cumulative mode to false for figuring out the executable Task: 242513 Details: That should fix several parsing problems for .pro files with scopes. Enable it, see how many bug reports we get, for stuff we accidentaly parsed correctly. Shouldn't be many. So we parse the follwing now correctly: unix { TEMP=unix } win32 { TEMP=win32 } DESTDIR=$$TEMP --- src/plugins/qt4projectmanager/qt4runconfiguration.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp index 6503e9b3a98..310298737ca 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp @@ -247,6 +247,7 @@ QString Qt4RunConfiguration::proFilePath() const void Qt4RunConfiguration::updateCachedValues() { ProFileReader *reader = static_cast(project())->createProFileReader(); + reader->setCumulative(false); if (!reader->readProFile(m_proFilePath)) { delete reader; Core::ICore::instance()->messageManager()->printToOutputPane(QString("Could not parse %1. The Qt4 run configuration %2 can not be started.").arg(m_proFilePath).arg(name())); From c981202454a1383872a13414a1e107b20e4ae7c0 Mon Sep 17 00:00:00 2001 From: goro Date: Thu, 29 Jan 2009 19:26:13 +0100 Subject: [PATCH 36/47] Fix file location, always return 0 --- src/tools/qtlibspatcher/binpatch.cpp | 2 +- src/tools/qtlibspatcher/qtlibspatchermain.cpp | 128 +++++++++--------- 2 files changed, 66 insertions(+), 64 deletions(-) diff --git a/src/tools/qtlibspatcher/binpatch.cpp b/src/tools/qtlibspatcher/binpatch.cpp index e2fd4cc2f2e..7e1dcfbbdd8 100644 --- a/src/tools/qtlibspatcher/binpatch.cpp +++ b/src/tools/qtlibspatcher/binpatch.cpp @@ -181,7 +181,7 @@ bool BinPatch::patch(const char *oldstr, const char *newstr) if (!(input = fopen(fileName, "r+b"))) { - fprintf(stderr, "Cannot open file %s!\n", fileName); + fprintf(stderr, "Warning: Could not open file %s\n", fileName); return false; } diff --git a/src/tools/qtlibspatcher/qtlibspatchermain.cpp b/src/tools/qtlibspatcher/qtlibspatchermain.cpp index 4fba6a025c1..d5c976c9e19 100644 --- a/src/tools/qtlibspatcher/qtlibspatchermain.cpp +++ b/src/tools/qtlibspatcher/qtlibspatchermain.cpp @@ -631,67 +631,67 @@ const char * const textFileFileNames[] = { #ifndef Q_OS_WIN // *.la - "lib/libQtCore.la", - "lib/libQt3Support.la", - "lib/libQtCLucene.la", - "lib/libQtDBus.la", - "lib/libQtGui.la", - "lib/libQtHelp.la", - "lib/libQtNetwork.la", - "lib/libQtOpenGL.la", - "lib/libQtScript.la", - "lib/libQtSql.la", - "lib/libQtSvg.la", - "lib/libQtTest.la", - "lib/libQtWebKit.la", - "lib/libQtXml.la", - "lib/libQtXmlPatterns.la", + "/lib/libQtCore.la", + "/lib/libQt3Support.la", + "/lib/libQtCLucene.la", + "/lib/libQtDBus.la", + "/lib/libQtGui.la", + "/lib/libQtHelp.la", + "/lib/libQtNetwork.la", + "/lib/libQtOpenGL.la", + "/lib/libQtScript.la", + "/lib/libQtSql.la", + "/lib/libQtSvg.la", + "/lib/libQtTest.la", + "/lib/libQtWebKit.la", + "/lib/libQtXml.la", + "/lib/libQtXmlPatterns.la", // *.prl - "demos/shared/libdemo_shared.prl", - "lib/libQt3Support.prl", - "lib/libQtAssistantClient.prl", - "lib/libQtCLucene.prl", - "lib/libQtCore.prl", - "lib/libQtDBus.prl", - "lib/libQtDesignerComponents.prl", - "lib/libQtDesigner.prl", - "lib/libQtGui.prl", - "lib/libQtHelp.prl", - "lib/libQtNetwork.prl", - "lib/libQtOpenGL.prl", - "lib/libQtScript.prl", - "lib/libQtSql.prl", - "lib/libQtSvg.prl", - "lib/libQtTest.prl", - "lib/libQtUiTools.prl", - "lib/libQtWebKit.prl", - "lib/libQtXmlPatterns.prl", - "lib/libQtXml.prl", + "/demos/shared/libdemo_shared.prl", + "/lib/libQt3Support.prl", + "/lib/libQtAssistantClient.prl", + "/lib/libQtCLucene.prl", + "/lib/libQtCore.prl", + "/lib/libQtDBus.prl", + "/lib/libQtDesignerComponents.prl", + "/lib/libQtDesigner.prl", + "/lib/libQtGui.prl", + "/lib/libQtHelp.prl", + "/lib/libQtNetwork.prl", + "/lib/libQtOpenGL.prl", + "/lib/libQtScript.prl", + "/lib/libQtSql.prl", + "/lib/libQtSvg.prl", + "/lib/libQtTest.prl", + "/lib/libQtUiTools.prl", + "/lib/libQtWebKit.prl", + "/lib/libQtXmlPatterns.prl", + "/lib/libQtXml.prl", // *.pc - "lib/pkgconfig/Qt3Support.pc", - "lib/pkgconfig/QtAssistantClient.pc", - "lib/pkgconfig/QtCLucene.pc", - "lib/pkgconfig/QtCore.pc", - "lib/pkgconfig/QtDBus.pc", - "lib/pkgconfig/QtDesignerComponents.pc", - "lib/pkgconfig/QtDesigner.pc", - "lib/pkgconfig/QtGui.pc", - "lib/pkgconfig/QtHelp.pc", - "lib/pkgconfig/QtNetwork.pc", - "lib/pkgconfig/QtOpenGL.pc", - "lib/pkgconfig/QtScript.pc", - "lib/pkgconfig/QtSql.pc", - "lib/pkgconfig/QtSvg.pc", - "lib/pkgconfig/QtTest.pc", - "lib/pkgconfig/QtUiTools.pc", - "lib/pkgconfig/QtWebKit.pc", - "lib/pkgconfig/QtXmlPatterns.pc", - "lib/pkgconfig/QtXml.pc", + "/lib/pkgconfig/Qt3Support.pc", + "/lib/pkgconfig/QtAssistantClient.pc", + "/lib/pkgconfig/QtCLucene.pc", + "/lib/pkgconfig/QtCore.pc", + "/lib/pkgconfig/QtDBus.pc", + "/lib/pkgconfig/QtDesignerComponents.pc", + "/lib/pkgconfig/QtDesigner.pc", + "/lib/pkgconfig/QtGui.pc", + "/lib/pkgconfig/QtHelp.pc", + "/lib/pkgconfig/QtNetwork.pc", + "/lib/pkgconfig/QtOpenGL.pc", + "/lib/pkgconfig/QtScript.pc", + "/lib/pkgconfig/QtSql.pc", + "/lib/pkgconfig/QtSvg.pc", + "/lib/pkgconfig/QtTest.pc", + "/lib/pkgconfig/QtUiTools.pc", + "/lib/pkgconfig/QtWebKit.pc", + "/lib/pkgconfig/QtXmlPatterns.pc", + "/lib/pkgconfig/QtXml.pc", // misc - "mkspecs/qconfig.pri" + "/mkspecs/qconfig.pri" #endif }; @@ -699,11 +699,11 @@ void replaceInTextFile(const char * fileName, const char * oldText, const char * newText, const char * oldText2 = NULL, const char * newText2 = NULL) { - const QString errorMessage = QString("Could not patch file ") + fileName; + const QString errorMessage = QString("Warning: Could not patch file ") + fileName; QFile f(fileName); if (!f.open(QIODevice::ReadOnly)) { - std::cout << qPrintable(errorMessage) << std::endl; + std::cerr << qPrintable(errorMessage) << std::endl; return; } QTextStream in(&f); @@ -716,7 +716,7 @@ void replaceInTextFile(const char * fileName, } if (!f.open(QIODevice::WriteOnly)) { - std::cout << qPrintable(errorMessage) << std::endl; + std::cerr << qPrintable(errorMessage) << std::endl; return; } QTextStream out(&f); @@ -726,15 +726,17 @@ void replaceInTextFile(const char * fileName, void patchTextFiles(const char *newInstallBase) { + const char * const baseQtPath = newInstallBase; const char * const newSourceBase = newInstallBase; const int fileCount = sizeof(textFileFileNames) / sizeof(const char *); for (int i = 0; i < fileCount; i++) { - logFileName(textFileFileNames[i]); + char * const fileName = allocFileNameCopyAppend(baseQtPath, textFileFileNames[i]); + logFileName(fileName); logDiff(oldSourceBase, newSourceBase); #ifndef Q_OS_WIN logDiff(oldInstallBase, newInstallBase); #endif - replaceInTextFile(textFileFileNames[i], + replaceInTextFile(fileName, #ifndef Q_OS_WIN oldSourceBase, newSourceBase, #endif @@ -770,8 +772,8 @@ int main(int argc, char *args[]) break; patchTextFiles(baseQtPath); - const bool successOne = patchBinariesWithQtPathes(baseQtPath); - const bool successTwo = patchDebugLibrariesWithQtPath(baseQtPath); + patchBinariesWithQtPathes(baseQtPath); + patchDebugLibrariesWithQtPath(baseQtPath); delete[] baseQtPath; - return (successOne && successTwo) ? 0 : 1; + return 0; } From dbbb17fe70b5ae138e88ecb41bf458f6e9aee101 Mon Sep 17 00:00:00 2001 From: goro Date: Thu, 29 Jan 2009 19:31:25 +0100 Subject: [PATCH 37/47] Fix mem-leak introduced with previous commit --- src/tools/qtlibspatcher/qtlibspatchermain.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/qtlibspatcher/qtlibspatchermain.cpp b/src/tools/qtlibspatcher/qtlibspatchermain.cpp index d5c976c9e19..c186b8a895d 100644 --- a/src/tools/qtlibspatcher/qtlibspatchermain.cpp +++ b/src/tools/qtlibspatcher/qtlibspatchermain.cpp @@ -741,6 +741,7 @@ void patchTextFiles(const char *newInstallBase) oldSourceBase, newSourceBase, #endif oldInstallBase, newInstallBase); + delete[] fileName; } patchQMakeSpec(newInstallBase); From 7968a7d60b0dfa553cd814889cc6f8566dd39b69 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 30 Jan 2009 10:23:50 +0100 Subject: [PATCH 38/47] Fixes: Kill warnings --- src/plugins/debugger/watchwindow.cpp | 4 ++-- src/plugins/texteditor/behaviorsettingspage.ui | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index f357c451061..6550cf342fe 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -55,8 +55,8 @@ enum { INameRole = Qt::UserRole, VisualRole, ExpandedRole }; ///////////////////////////////////////////////////////////////////// WatchWindow::WatchWindow(Type type, QWidget *parent) - : QTreeView(parent), m_type(type) - , m_alwaysResizeColumnsToContents(true) + : QTreeView(parent) + , m_alwaysResizeColumnsToContents(true), m_type(type) { setWindowTitle(tr("Locals and Watchers")); setAlternatingRowColors(true); diff --git a/src/plugins/texteditor/behaviorsettingspage.ui b/src/plugins/texteditor/behaviorsettingspage.ui index a2fb68e5b20..e6414918c22 100644 --- a/src/plugins/texteditor/behaviorsettingspage.ui +++ b/src/plugins/texteditor/behaviorsettingspage.ui @@ -215,9 +215,9 @@ - + - + Qt::Horizontal From 6712fa0148b97beb9448c6686be2f45ace884d7c Mon Sep 17 00:00:00 2001 From: con Date: Fri, 30 Jan 2009 13:47:15 +0100 Subject: [PATCH 39/47] Fixes: - Unitialized variable. --- src/plugins/coreplugin/editormanager/editormanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index e4bedc5bd05..26d64fc240c 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1236,6 +1236,8 @@ void EditorManager::addCurrentPositionToNavigationHistory(bool compress) if ((previousLocation->editor && editor == previousLocation->editor) || (!fileName.isEmpty() && previousLocation->fileName == fileName)) { firstIndexToRemove = m_d->currentNavigationHistoryPosition; + } else { + firstIndexToRemove = m_d->currentNavigationHistoryPosition+1; } } else { firstIndexToRemove = m_d->currentNavigationHistoryPosition+1; From 97af4465a79bcf3315d1f3139d67beb0dd638326 Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 30 Jan 2009 14:31:04 +0100 Subject: [PATCH 40/47] Fixes: Memory leak in bookmarkmanger. --- src/plugins/bookmarks/bookmarkmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index fa8eaefa55c..7c0d137c300 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -291,7 +291,7 @@ void BookmarkView::gotoBookmark(const QModelIndex &index) //// BookmarkContext::BookmarkContext(BookmarkView *widget) - : m_bookmarkView(widget) + : Core::IContext(widget), m_bookmarkView(widget) { m_context << UniqueIDManager::instance()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT); } From f68c9a3ae41427e91a14951259f4df8a2f3f2b88 Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 30 Jan 2009 14:31:38 +0100 Subject: [PATCH 41/47] Fixes: Memory leak in shortcutsettings Task: - RevBy: - AutoTest: - Details: - --- src/plugins/coreplugin/dialogs/shortcutsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp index b245d5ced59..a60a2046e58 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp @@ -82,7 +82,7 @@ QWidget *ShortcutSettings::createPage(QWidget *parent) { m_keyNum = m_key[0] = m_key[1] = m_key[2] = m_key[3] = 0; - m_page = new Ui_ShortcutSettings(); + m_page = new Ui_ShortcutSettings(parent); QWidget *w = new QWidget(parent); m_page->setupUi(w); From affdf9c78b5592dab0958bedf69f9bab0e46033c Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 30 Jan 2009 14:32:05 +0100 Subject: [PATCH 42/47] Fixes: Memory leak in generalsettings Task: - RevBy: - AutoTest: - Details: - --- src/plugins/coreplugin/generalsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index b21b96fd5e4..14ba2d0bd73 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -64,7 +64,7 @@ QString GeneralSettings::trCategory() const QWidget *GeneralSettings::createPage(QWidget *parent) { - m_page = new Ui_GeneralSettings; + m_page = new Ui_GeneralSettings(parent); QWidget *w = new QWidget(parent); m_page->setupUi(w); From 4c41532666d4203a9b26710df09b2834274ac8d2 Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 30 Jan 2009 14:32:28 +0100 Subject: [PATCH 43/47] Fixes: Memory leak in taskwindow Task: - RevBy: - AutoTest: - Details: - --- src/plugins/projectexplorer/taskwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 9bc28fda44c..596864a4601 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -577,7 +577,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, } TaskWindowContext::TaskWindowContext(QWidget *widget) - : m_taskList(widget) + : Core::IContext(widget), m_taskList(widget) { Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); m_context << uidm->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE); From ec4b41d31f7231b55203cea38aa1014490519ccb Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 30 Jan 2009 14:59:50 +0100 Subject: [PATCH 44/47] Fixes: Hups, okay this should compile. --- src/plugins/coreplugin/dialogs/shortcutsettings.cpp | 4 +++- src/plugins/coreplugin/generalsettings.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp index a60a2046e58..6797a50888e 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp @@ -82,7 +82,7 @@ QWidget *ShortcutSettings::createPage(QWidget *parent) { m_keyNum = m_key[0] = m_key[1] = m_key[2] = m_key[3] = 0; - m_page = new Ui_ShortcutSettings(parent); + m_page = new Ui_ShortcutSettings(); QWidget *w = new QWidget(parent); m_page->setupUi(w); @@ -116,6 +116,8 @@ QWidget *ShortcutSettings::createPage(QWidget *parent) commandChanged(0); + delete m_page; + return w; } diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 14ba2d0bd73..b21db43fa35 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -64,7 +64,7 @@ QString GeneralSettings::trCategory() const QWidget *GeneralSettings::createPage(QWidget *parent) { - m_page = new Ui_GeneralSettings(parent); + m_page = new Ui_GeneralSettings(); QWidget *w = new QWidget(parent); m_page->setupUi(w); @@ -77,7 +77,7 @@ QWidget *GeneralSettings::createPage(QWidget *parent) this, SLOT(resetExternalEditor())); connect(m_page->helpExternalEditorButton, SIGNAL(clicked()), this, SLOT(showHelpForExternalEditor())); - + delete m_page; return w; } From 3ee7f3859e378e611f8af0bf2bafede47de6f55c Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 30 Jan 2009 15:06:48 +0100 Subject: [PATCH 45/47] Fixes: Tweak the minimum and maximum size of the runconfiguration cb --- src/plugins/projectexplorer/runsettingspropertiespage.ui | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.ui b/src/plugins/projectexplorer/runsettingspropertiespage.ui index 93070ce9da1..d96e20602bc 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.ui +++ b/src/plugins/projectexplorer/runsettingspropertiespage.ui @@ -34,11 +34,17 @@ + + + 500 + 16777215 + + QComboBox::AdjustToContents - 30 + 15 From 66e9410f3dff6c664853971387ccf1239df1dee1 Mon Sep 17 00:00:00 2001 From: con Date: Fri, 30 Jan 2009 17:09:09 +0100 Subject: [PATCH 46/47] Fixes: - Unwanted focus halos --- src/plugins/coreplugin/editormanager/openeditorsview.cpp | 1 + src/plugins/find/searchresultwindow.cpp | 1 + src/plugins/projectexplorer/foldernavigationwidget.cpp | 1 + src/plugins/projectexplorer/projecttreewidget.cpp | 1 + src/plugins/projectexplorer/taskwindow.cpp | 1 + 5 files changed, 5 insertions(+) diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp index a7119c74547..fe42bea10c7 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp @@ -70,6 +70,7 @@ OpenEditorsWidget::OpenEditorsWidget() m_ui.editorList->setTextElideMode(Qt::ElideMiddle); m_ui.editorList->installEventFilter(this); m_ui.editorList->setFrameStyle(QFrame::NoFrame); + m_ui.editorList->setAttribute(Qt::WA_MacShowFocusRect, false); EditorManager *em = EditorManager::instance(); foreach (IEditor *editor, em->openedEditors()) { registerEditor(editor); diff --git a/src/plugins/find/searchresultwindow.cpp b/src/plugins/find/searchresultwindow.cpp index a979e9b39c9..9bad41fd33e 100644 --- a/src/plugins/find/searchresultwindow.cpp +++ b/src/plugins/find/searchresultwindow.cpp @@ -56,6 +56,7 @@ SearchResultWindow::SearchResultWindow() m_searchResultTreeView = new SearchResultTreeView(m_widget); m_searchResultTreeView->setUniformRowHeights(true); m_searchResultTreeView->setFrameStyle(QFrame::NoFrame); + m_searchResultTreeView->setAttribute(Qt::WA_MacShowFocusRect, false); m_widget->addWidget(m_searchResultTreeView); m_noMatchesFoundDisplay = new QListWidget(m_widget); diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 29b0fbe1cd1..c5aae6cb20b 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -89,6 +89,7 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) m_filter->setSourceModel(m_dirModel); m_view->setModel(m_filter); m_view->setFrameStyle(QFrame::NoFrame); + m_view->setAttribute(Qt::WA_MacShowFocusRect, false); setFocusProxy(m_view); QVBoxLayout *layout = new QVBoxLayout(); diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 859cef01af1..3ad8b9209e9 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -75,6 +75,7 @@ public: setUniformRowHeights(true); setTextElideMode(Qt::ElideNone); // setExpandsOnDoubleClick(false); + setAttribute(Qt::WA_MacShowFocusRect, false); } protected: diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 596864a4601..f91a8002ec5 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -265,6 +265,7 @@ TaskWindow::TaskWindow() m_listview->setItemDelegate(tld); m_listview->setWindowIcon(QIcon(":/qt4projectmanager/images/window.png")); m_listview->setContextMenuPolicy(Qt::ActionsContextMenu); + m_listview->setAttribute(Qt::WA_MacShowFocusRect, false); m_taskWindowContext = new TaskWindowContext(m_listview); core->addContextObject(m_taskWindowContext); From 7d63307bdae5b739d982f3d23cdad8e8c43b37a2 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Mon, 2 Feb 2009 18:50:14 +0100 Subject: [PATCH 47/47] Fixes: Build on windows --- src/tools/qtlibspatcher/binpatch.cpp | 7 +++++++ src/tools/qtlibspatcher/qtlibspatchermain.cpp | 16 ++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/tools/qtlibspatcher/binpatch.cpp b/src/tools/qtlibspatcher/binpatch.cpp index 7e1dcfbbdd8..43e5fd84c8e 100644 --- a/src/tools/qtlibspatcher/binpatch.cpp +++ b/src/tools/qtlibspatcher/binpatch.cpp @@ -35,7 +35,14 @@ #include #include +#include + #include "binpatch.h" + +#ifdef Q_OS_WIN +# define strcasecmp _stricmp +# define strncasecmp _strnicmp +#endif // returns positive value if it finds a null termination inside the buffer long BinPatch::getBufferStringLength(char *data, char *end) diff --git a/src/tools/qtlibspatcher/qtlibspatchermain.cpp b/src/tools/qtlibspatcher/qtlibspatchermain.cpp index c186b8a895d..b66a35f294c 100644 --- a/src/tools/qtlibspatcher/qtlibspatchermain.cpp +++ b/src/tools/qtlibspatcher/qtlibspatchermain.cpp @@ -42,8 +42,10 @@ #include #ifdef Q_OS_WIN - const char * const oldInstallBase = "C:/qt-greenhouse/Trolltech/Code_less_create_more/" - "Trolltech/Code_less_create_more/Troll/4.4.3"; +# define QT_INSTALL_DIR "C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.4.3"; + + const char * const oldInstallBase = QT_INSTALL_DIR; + const char * const oldSourceBase = QT_INSTALL_DIR; #else const char * const oldSourceBase = "/home/berlin/dev/qt-4.4.3-temp/qt-x11-opensource-src-4.4.3"; const char * const oldInstallBase = "/home/berlin/dev/qt-4.4.3-shipping/qt"; @@ -627,9 +629,9 @@ void patchQMakeSpec(const char *path) out << all; } +#ifndef Q_OS_WIN const char * const textFileFileNames[] = { -#ifndef Q_OS_WIN // *.la "/lib/libQtCore.la", "/lib/libQt3Support.la", @@ -692,8 +694,8 @@ const char * const textFileFileNames[] = // misc "/mkspecs/qconfig.pri" -#endif }; +#endif void replaceInTextFile(const char * fileName, const char * oldText, const char * newText, @@ -726,6 +728,7 @@ void replaceInTextFile(const char * fileName, void patchTextFiles(const char *newInstallBase) { +#ifndef Q_OS_WIN const char * const baseQtPath = newInstallBase; const char * const newSourceBase = newInstallBase; const int fileCount = sizeof(textFileFileNames) / sizeof(const char *); @@ -733,16 +736,13 @@ void patchTextFiles(const char *newInstallBase) char * const fileName = allocFileNameCopyAppend(baseQtPath, textFileFileNames[i]); logFileName(fileName); logDiff(oldSourceBase, newSourceBase); -#ifndef Q_OS_WIN logDiff(oldInstallBase, newInstallBase); -#endif replaceInTextFile(fileName, -#ifndef Q_OS_WIN oldSourceBase, newSourceBase, -#endif oldInstallBase, newInstallBase); delete[] fileName; } +#endif patchQMakeSpec(newInstallBase); }