diff --git a/dist/changes-1.3.1 b/dist/changes-1.3.1 index 210806f12e65a69951f6f41e04f6ea7e5e9e2489..ce72934d788779f04e84b11524b1499eda6085ed 100644 --- a/dist/changes-1.3.1 +++ b/dist/changes-1.3.1 @@ -36,6 +36,7 @@ Debugging * Ignore case of file name in breakpoint handling on Windows * Fixed problems with gdb timing out and debugging sessions unexpectedly finishing * Improved startup time of gdb sessions by not asking for all files known to gdb + * Mac: Fixed problems with locals and watchers not updating correctly on Snow Leopard Help * Don't switch to Help mode if help side bar is already visible diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 9b994868f8ce4506ea9ace7081bb3094003bceae..4468021ea1610c15222f3eb608e0cb9e9acf0f06 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -2961,7 +2961,7 @@ Sollen sie überschrieben werden?</translation> <message> <location line="+0"/> <source>Line</source> - <translation>Datei</translation> + <translation>Zeile</translation> </message> <message> <location line="+1"/> @@ -4637,7 +4637,7 @@ Es wird empfohlen, gdb 6.7 oder später zu benutzen.</translation> <message> <location line="+1"/> <source>Line</source> - <translation>Datei</translation> + <translation>Zeile</translation> </message> <message> <location line="+1"/> diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index d5b964b1b937a35d84048cccffa6704bbef4d607..5e85b641fd13fb558cde43868d9d8fd1b99c23c3 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -297,12 +297,11 @@ class BinEditorInterface : public Core::IEditor { Q_OBJECT public: - BinEditorInterface(BinEditor *parent) - : Core::IEditor(parent) + BinEditorInterface(BinEditor *editor) { Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); - m_editor = parent; - m_file = new BinEditorFile(parent); + m_editor = editor; + m_file = new BinEditorFile(m_editor); m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID); m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR); m_cursorPositionLabel = new Utils::LineColumnLabel; @@ -321,7 +320,9 @@ public: connect(m_editor, SIGNAL(cursorPositionChanged(int)), this, SLOT(updateCursorPosition(int))); } - ~BinEditorInterface() {} + ~BinEditorInterface() { + delete m_editor; + } QWidget *widget() { return m_editor; } diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 35208de8e676b569769770281efa1ff6928b5ff9..d732d6947f64a751ac59981e46fdf18ee88b97e1 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1076,48 +1076,40 @@ QString EditorManager::getOpenWithEditorId(const QString &fileName, static QString formatFileFilters(const Core::ICore *core, QString *selectedFilter) { QString rc; - // Compile list of filter strings. If we find a glob matching all files, - // put it last and set it as default selectedFilter. + + // Compile list of filter strings QStringList filters = core->mimeDatabase()->filterStrings(); filters.sort(); selectedFilter->clear(); if (filters.empty()) return rc; + const QString filterSeparator = QLatin1String(";;"); - bool hasAllFilter = false; - const int size = filters.size(); - for (int i = 0; i < size; i++) { - const QString &filterString = filters.at(i); - if (filterString.isEmpty()) { // binary editor - hasAllFilter = true; - } else { - if (!rc.isEmpty()) - rc += filterSeparator; - rc += filterString; - } - } - if (hasAllFilter) { - // prepend all files filter - // prepending instead of appending to work around a but in Qt/Mac - QString allFilesFilter = EditorManager::tr("All Files (*)"); + foreach (const QString &filterString, filters) { if (!rc.isEmpty()) - allFilesFilter += filterSeparator; - rc.prepend(allFilesFilter); - *selectedFilter = allFilesFilter; - } else { - *selectedFilter = filters.front(); + rc += filterSeparator; + rc += filterString; } + + // prepend all files filter + // prepending instead of appending to work around a bug in Qt/Mac + QString allFilesFilter = EditorManager::tr("All Files (*)"); + if (!rc.isEmpty()) + allFilesFilter += filterSeparator; + rc.prepend(allFilesFilter); + *selectedFilter = allFilesFilter; + return rc; } IEditor *EditorManager::openEditor(const QString &fileName, const QString &editorId, - EditorManager::OpenEditorFlags flags) + OpenEditorFlags flags) { return openEditor(0, fileName, editorId, flags); } IEditor *EditorManager::openEditor(Core::Internal::EditorView *view, const QString &fileName, - const QString &editorId, EditorManager::OpenEditorFlags flags) + const QString &editorId, OpenEditorFlags flags) { if (debugEditorManager) qDebug() << Q_FUNC_INFO << fileName << editorId; diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index 16b12d504473d0850906286a6b8d31f40a6d07f5..9c9bcb086c88bb790c66bd6abb3ccf94f3a19e99 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -32,6 +32,8 @@ #include "editormanager.h" #include "editorview.h" +#include <utils/qtcassert.h> + #include <QtGui/QHeaderView> Q_DECLARE_METATYPE(Core::Internal::EditorView*) @@ -192,11 +194,10 @@ void OpenEditorsWindow::setEditors(EditorView *mainView, EditorView *view, OpenE foreach (const EditLocation &hi, view->editorHistory()) { if (hi.file.isNull() || filesDone.contains(hi.file)) continue; + QString title = model->displayNameForFile(hi.file); + QTC_ASSERT(!title.isEmpty(), continue;) filesDone.insert(hi.file.data()); - QTreeWidgetItem *item = new QTreeWidgetItem(); - - QString title = model->displayNameForFile(hi.file); if (hi.file->isModified()) title += tr("*"); item->setIcon(0, hi.file->isReadOnly() ? lockedIcon : emptyIcon); diff --git a/src/plugins/coreplugin/mimedatabase.cpp b/src/plugins/coreplugin/mimedatabase.cpp index 29b708b99c74d9650e8c0fdbdc93341db8451964..646a0b4971a38c73bda6f0cc8718b6858e6e101b 100644 --- a/src/plugins/coreplugin/mimedatabase.cpp +++ b/src/plugins/coreplugin/mimedatabase.cpp @@ -1086,8 +1086,11 @@ QStringList MimeDatabasePrivate::filterStrings() const { QStringList rc; const TypeMimeTypeMap::const_iterator cend = m_typeMimeTypeMap.constEnd(); - for (TypeMimeTypeMap::const_iterator it = m_typeMimeTypeMap.constBegin(); it != cend; ++it) - rc += it.value().type.filterString(); + for (TypeMimeTypeMap::const_iterator it = m_typeMimeTypeMap.constBegin(); it != cend; ++it) { + const QString filterString = it.value().type.filterString(); + if (!filterString.isEmpty()) + rc += filterString; + } return rc; } diff --git a/src/plugins/debugger/cdb/cdbsymbolgroupcontext.cpp b/src/plugins/debugger/cdb/cdbsymbolgroupcontext.cpp index b45c631f469fb2925c0cb85f5680d8c1c511b99e..480c9a74438ab5d775549a176d0ab7dfdd5f1e86 100644 --- a/src/plugins/debugger/cdb/cdbsymbolgroupcontext.cpp +++ b/src/plugins/debugger/cdb/cdbsymbolgroupcontext.cpp @@ -750,9 +750,10 @@ static inline bool getUnsignedHexValue(CIDebugSymbolGroup *sg, int index, quint6 return getUnsignedHexValue(stringValue, value); } +enum { maxStringLength = 4096 }; + int CdbSymbolGroupContext::dumpQString(CIDebugDataSpaces *ds, WatchData *wd) { - const int maxLength = 40; QString errorMessage; unsigned long stringIndex; if (!lookupPrefix(wd->iname, &stringIndex)) @@ -774,9 +775,9 @@ int CdbSymbolGroupContext::dumpQString(CIDebugDataSpaces *ds, WatchData *wd) if (!getUnsignedHexValue(m_symbolGroup, arrayIndex, &array)) return 5; // Fetch - const bool truncated = size > maxLength; + const bool truncated = size > maxStringLength; if (truncated) - size = maxLength; + size = maxStringLength; const QChar doubleQuote = QLatin1Char('"'); QString value; if (size > 0) { @@ -808,7 +809,6 @@ int CdbSymbolGroupContext::dumpQString(CIDebugDataSpaces *ds, WatchData *wd) int CdbSymbolGroupContext::dumpStdString(WatchData *wd) { - const int maxLength = 40; QString errorMessage; unsigned long stringIndex; if (!lookupPrefix(wd->iname, &stringIndex)) @@ -835,8 +835,8 @@ int CdbSymbolGroupContext::dumpStdString(WatchData *wd) if (quotePos == -1) return 1; bufValue.remove(0, quotePos); - if (bufValue.size() > maxLength) { - bufValue.truncate(maxLength); + if (bufValue.size() > maxStringLength) { + bufValue.truncate(maxStringLength); bufValue += QLatin1String("...\""); } wd->setValue(bufValue); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 0801896281504780c4b9e383e2348b9f04d0f131..8adcb45bc97e5f15c3b5f9b94eb715d2f8adb6c4 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4664,7 +4664,7 @@ void GdbEngine::handleInferiorPrepared() qtBuildPath = "C:/iwmake/build_mingw_opensource"; postCommand("set substitute-path " + qtBuildPath + ' ' + qtInstallPath); #elif defined(Q_OS_UNIX) && !defined (Q_OS_MAC) - qtBuildPath = "/var/tmp/qt-x11-src-4.6.0"; + qtBuildPath = "/var/tmp/qt-x11-src-4.6.1"; postCommand("set substitute-path " + qtBuildPath + ' ' + qtInstallPath); #endif } diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index a33bfa3e1620c6ac87b3e4a8c6e419660dd97a56..982965f42d0c425a42ed3852603452d1072facf5 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -774,6 +774,18 @@ void WatchModel::emitDataChanged(int column, const QModelIndex &parentIndex) emitDataChanged(column, index(i, 0, parentIndex)); } +// Truncate value for item view, maintaining quotes +static inline QString truncateValue(QString v) +{ + enum { maxLength = 512 }; + if (v.size() < maxLength) + return v; + const bool isQuoted = v.endsWith(QLatin1Char('"')); // check for 'char* "Hallo"' + v.truncate(maxLength); + v += isQuoted ? QLatin1String("...\"") : QLatin1String("..."); + return v; +} + QVariant WatchModel::data(const QModelIndex &idx, int role) const { const WatchItem *item = watchItem(idx); @@ -791,7 +803,7 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const if (format == -1) format = m_handler->m_typeFormats.value(data.type, -1); //qDebug() << "FORMATTED: " << format << formattedValue(data, format); - return formattedValue(data, format); + return truncateValue(formattedValue(data, format)); } case 2: { if (!data.displayedType.isEmpty()) diff --git a/src/plugins/texteditor/colorscheme.cpp b/src/plugins/texteditor/colorscheme.cpp index 8feecd69f9e8f9cf9406180576d8f6d68db46f2f..51b6e67a8cd32866aa9936777ec70c4422b98f3e 100644 --- a/src/plugins/texteditor/colorscheme.cpp +++ b/src/plugins/texteditor/colorscheme.cpp @@ -145,8 +145,6 @@ bool ColorScheme::save(const QString &fileName) const if (!m_displayName.isEmpty()) w.writeAttribute(QLatin1String("name"), m_displayName); - Format textFormat = formatFor(QLatin1String(Constants::C_TEXT)); - QMapIterator<QString, Format> i(m_formats); while (i.hasNext()) { const Format &format = i.next().value(); diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp index e707af2670698625d938a1d48b91b41bd71115b7..46409d100a5e70773412ebd62035810feb288402 100644 --- a/src/plugins/texteditor/fontsettings.cpp +++ b/src/plugins/texteditor/fontsettings.cpp @@ -33,6 +33,8 @@ #include <utils/qtcassert.h> #include <coreplugin/icore.h> +#include <QtCore/QFile> +#include <QtCore/QFileInfo> #include <QtCore/QSettings> #include <QtCore/QCoreApplication> #include <QtGui/QTextCharFormat> @@ -121,8 +123,10 @@ bool FontSettings::fromSettings(const QString &category, if (s->contains(group + QLatin1String(schemeFileNameKey))) { // Load the selected color scheme - loadColorScheme(s->value(group + QLatin1String(schemeFileNameKey), defaultSchemeFileName()).toString(), - descriptions); + QString scheme = s->value(group + QLatin1String(schemeFileNameKey)).toString(); + if (scheme.isEmpty() || !QFile::exists(scheme)) + scheme = defaultSchemeFileName(QFileInfo(scheme).fileName()); + loadColorScheme(scheme, descriptions); } else { // Load color scheme from ini file foreach (const FormatDescription &desc, descriptions) { @@ -337,11 +341,21 @@ int FontSettings::defaultFontSize() return DEFAULT_FONT_SIZE; } -QString FontSettings::defaultSchemeFileName() +/** + * Returns the default scheme file name, or the path to a shipped scheme when + * one exists with the given \a fileName. + */ +QString FontSettings::defaultSchemeFileName(const QString &fileName) { - QString fileName = Core::ICore::instance()->resourcePath(); - fileName += QLatin1String("/styles/default.xml"); - return fileName; + QString defaultScheme = Core::ICore::instance()->resourcePath(); + defaultScheme += QLatin1String("/styles/"); + + if (!fileName.isEmpty() && QFile::exists(defaultScheme + fileName)) + defaultScheme += fileName; + else + defaultScheme += QLatin1String("default.xml"); + + return defaultScheme; } } // namespace TextEditor diff --git a/src/plugins/texteditor/fontsettings.h b/src/plugins/texteditor/fontsettings.h index 88f27883296b67c52c107542b58fc7cce978c405..a461a32760efbe2dbd7955c0a61cea8148fcfa94 100644 --- a/src/plugins/texteditor/fontsettings.h +++ b/src/plugins/texteditor/fontsettings.h @@ -103,7 +103,7 @@ public: static int defaultFontSize(); private: - static QString defaultSchemeFileName(); + static QString defaultSchemeFileName(const QString &fileName = QString()); QString m_family; QString m_schemeFileName; diff --git a/src/tools/qtcdebugger/main.cpp b/src/tools/qtcdebugger/main.cpp index 616fc82727db75e11830feac7212b43d890c428d..213b95e6d1e59d5b90aa9db15f24e2811977e6c8 100644 --- a/src/tools/qtcdebugger/main.cpp +++ b/src/tools/qtcdebugger/main.cpp @@ -487,11 +487,12 @@ static bool registerDebuggerKey(const WCHAR *key, // Save old key, which might be missing QString oldDebugger; registryReadStringKey(handle, debuggerRegistryValueNameC, &oldDebugger, errorMessage); - if (oldDebugger.contains(QLatin1String(applicationFileC), Qt::CaseInsensitive)) { + if (!oldDebugger.compare(call, Qt::CaseInsensitive)) { *errorMessage = QLatin1String("The program is already registered as post mortem debugger."); break; } - if (!registryWriteStringKey(handle, debuggerRegistryDefaultValueNameC, oldDebugger, errorMessage)) + if (!(oldDebugger.contains(QLatin1String(applicationFileC), Qt::CaseInsensitive) + || registryWriteStringKey(handle, debuggerRegistryDefaultValueNameC, oldDebugger, errorMessage))) break; if (debug) qDebug() << "registering self as " << call; @@ -516,7 +517,9 @@ bool install(QString *errorMessage) } // Unregister helper: Restore the original debugger key -static bool unregisterDebuggerKey(const WCHAR *key, QString *errorMessage) +static bool unregisterDebuggerKey(const WCHAR *key, + const QString &call, + QString *errorMessage) { HKEY handle = 0; bool success = false; @@ -525,8 +528,7 @@ static bool unregisterDebuggerKey(const WCHAR *key, QString *errorMessage) break; QString debugger; registryReadStringKey(handle, debuggerRegistryValueNameC, &debugger, errorMessage); - if (!(debugger.isEmpty() - || debugger.contains(QLatin1String(applicationFileC), Qt::CaseInsensitive))) { + if (!debugger.isEmpty() && debugger.compare(call, Qt::CaseInsensitive)) { *errorMessage = QLatin1String("The program is not registered as post mortem debugger."); break; } @@ -553,10 +555,10 @@ static bool unregisterDebuggerKey(const WCHAR *key, QString *errorMessage) bool uninstall(QString *errorMessage) { - if (!unregisterDebuggerKey(debuggerRegistryKeyC, errorMessage)) + if (!unregisterDebuggerKey(debuggerRegistryKeyC, debuggerCall(), errorMessage)) return false; #ifdef Q_OS_WIN64 - if (!unregisterDebuggerKey(debuggerWow32RegistryKeyC, errorMessage)) + if (!unregisterDebuggerKey(debuggerWow32RegistryKeyC, debuggerCall(QLatin1String("-wow")), errorMessage)) return false; #endif return true;