From 75f2c01d968640e19ece7e9ca1bab54964683f4c Mon Sep 17 00:00:00 2001 From: dt Date: Wed, 3 Dec 2008 13:53:11 +0100 Subject: [PATCH 1/7] Fixes: Fixes saving of settings --- src/plugins/projectexplorer/projectexplorer.h | 1 - src/plugins/projectexplorer/session.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index 039def13052..6a7f4beb831 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -139,7 +139,6 @@ private slots: void cancelBuild(); void debugProject(); void editDependencies(); - bool saveAction(ProjectExplorer::Project *pro = 0); void loadAction(); void unloadProject(); void clearSession(); diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 61ca7df05a9..876b8294a37 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -939,6 +939,7 @@ void SessionManager::removeProjects(QList remove) // Delete projects foreach (Project *pro, remove) { + pro->saveSettings(); m_file->m_projects.removeOne(pro); if (pro == m_file->m_startupProject) From 2a76e5f85ea434a563f2400fb4348937021ab7be Mon Sep 17 00:00:00 2001 From: dt Date: Wed, 3 Dec 2008 13:58:40 +0100 Subject: [PATCH 2/7] Fixes: Merge the saveAction() function in the unload function. Details: Found while reading the code. It was only used in that function anyway, and this simplfies the code a little bit and removes some dubious left over. --- .../projectexplorer/projectexplorer.cpp | 33 ++++--------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index e04553763a3..c3a3fb3064d 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -685,28 +685,19 @@ void ProjectExplorerPlugin::loadAction() updateActions(); } -bool ProjectExplorerPlugin::saveAction(Project *pro) +void ProjectExplorerPlugin::unloadProject() { if (debug) - qDebug() << "ProjectExplorerPlugin::saveAction"; + qDebug() << "ProjectExplorerPlugin::unloadProject"; - if (!pro) - pro = m_currentProject; - Q_ASSERT(pro); - - Core::IFile *fi = pro->file(); - - if (!fi) // TODO Why saving the session here???? - fi = m_session->file(); + Core::IFile *fi = m_currentProject->file(); if (!fi || fi->fileName().isEmpty()) //nothing to save? - return false; + return; QList filesToSave; - filesToSave << fi; - if (pro) - filesToSave << pro->dependencies(); + filesToSave << pro->dependencies(); // check the number of modified files int readonlycount = 0; @@ -721,20 +712,10 @@ bool ProjectExplorerPlugin::saveAction(Project *pro) else success = m_core->fileManager()->saveModifiedFilesSilently(filesToSave).isEmpty(); - if (success) - addToRecentProjects(fi->fileName()); - updateActions(); - return success; -} - -void ProjectExplorerPlugin::unloadProject() -{ - if (debug) - qDebug() << "ProjectExplorerPlugin::unloadProject"; - - if (!saveAction(m_currentProject)) + if (!success) return; + addToRecentProjects(fi->fileName()); m_session->removeProject(m_currentProject); updateActions(); } From e02f818f84907034c68b7e77b534fd43534206a6 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 3 Dec 2008 14:28:33 +0100 Subject: [PATCH 3/7] Save the utf8 bytes in a QByteArray before invoking the parser. --- src/libs/cplusplus/TypeOfExpression.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/cplusplus/TypeOfExpression.cpp b/src/libs/cplusplus/TypeOfExpression.cpp index 2672bfb105f..7dd669365fc 100644 --- a/src/libs/cplusplus/TypeOfExpression.cpp +++ b/src/libs/cplusplus/TypeOfExpression.cpp @@ -91,7 +91,8 @@ Document::Ptr TypeOfExpression::documentForExpression(const QString &expression) { // create the expression's AST. Document::Ptr doc = Document::create(QLatin1String("")); - doc->setSource(expression.toUtf8()); + const QByteArray bytes = expression.toUtf8(); + doc->setSource(bytes); doc->parse(Document::ParseExpression); return doc; } From 3d926c71c74064a5c6bb5dc822382c3c8cc50a64 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 3 Dec 2008 14:29:19 +0100 Subject: [PATCH 4/7] Compile. --- .../editormanager/editormanager.cpp | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 0092513693b..1593847ef85 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -74,20 +74,6 @@ using namespace Core::Internal; enum { debugEditorManager=0 }; -QString EditorManager::defaultExternalEditor() const -{ -#ifdef Q_OS_MAC - return m_d->m_core->resourcePath() - +QLatin1String("/runInTerminal.command vi %f %l %c %W %H %x %y"); -#elif defined(Q_OS_UNIX) - return QLatin1String("xterm -geom %Wx%H+%x+%y -e vi %f +%l +\"normal %c|\""); -#elif defined (Q_OS_WIN) - return QLatin1String("notepad %f"); -#else - return QString(); -#endif -} - //===================EditorManager===================== EditorManagerPlaceHolder *EditorManagerPlaceHolder::m_current = 0; @@ -388,6 +374,20 @@ QSize EditorManager::minimumSizeHint() const return QSize(400, 300); } +QString EditorManager::defaultExternalEditor() const +{ +#ifdef Q_OS_MAC + return m_d->m_core->resourcePath() + +QLatin1String("/runInTerminal.command vi %f %l %c %W %H %x %y"); +#elif defined(Q_OS_UNIX) + return QLatin1String("xterm -geom %Wx%H+%x+%y -e vi %f +%l +\"normal %c|\""); +#elif defined (Q_OS_WIN) + return QLatin1String("notepad %f"); +#else + return QString(); +#endif +} + EditorSplitter *EditorManager::editorSplitter() const { return m_d->m_splitter; From 6477cec406ddf5a112ac9c5f68147e44bca3f71a Mon Sep 17 00:00:00 2001 From: dt Date: Wed, 3 Dec 2008 14:29:59 +0100 Subject: [PATCH 5/7] Fixes: Actually compile. --- src/plugins/projectexplorer/projectexplorer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index c3a3fb3064d..1a9c24b994d 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -697,7 +697,7 @@ void ProjectExplorerPlugin::unloadProject() QList filesToSave; filesToSave << fi; - filesToSave << pro->dependencies(); + filesToSave << m_currentProject->dependencies(); // check the number of modified files int readonlycount = 0; From 9394b4dfbcc05523800de6625bffc6123a9893ac Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 3 Dec 2008 14:47:02 +0100 Subject: [PATCH 6/7] Fixed the parsing of class-specifiers when nested in a function definition. --- shared/cplusplus/Parser.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/shared/cplusplus/Parser.cpp b/shared/cplusplus/Parser.cpp index 46618dd112b..13fbaa0160b 100644 --- a/shared/cplusplus/Parser.cpp +++ b/shared/cplusplus/Parser.cpp @@ -1191,6 +1191,11 @@ bool Parser::parseClassSpecifier(SpecifierAST *&node) NameAST *name = 0; parseName(name); + bool parsed = false; + + const bool previousInFunctionBody = _inFunctionBody; + _inFunctionBody = false; + if (LA() == T_COLON || LA() == T_LBRACE) { BaseSpecifierAST *base_clause = 0; if (LA() == T_COLON) { @@ -1233,9 +1238,12 @@ bool Parser::parseClassSpecifier(SpecifierAST *&node) } } node = ast; - return true; + parsed = true; } - return false; + + _inFunctionBody = previousInFunctionBody; + + return parsed; } bool Parser::parseAccessSpecifier(SpecifierAST *&node) From 4c358cc3ca1e5cbcd1e8152feb322e94207824a5 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 3 Dec 2008 14:54:19 +0100 Subject: [PATCH 7/7] Do not depend on gdb's async stream output having tokens. This is in anticipation of a change in the next gdb release which will drop the token. --- src/plugins/debugger/gdbengine.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index df0eaa9f0b2..e8f22f4944a 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -444,7 +444,7 @@ void GdbEngine::handleResponse() break; } - if (token == -1 && *from != '&' && *from != '~') { + if (token == -1 && *from != '&' && *from != '~' && *from != '*') { // FIXME: On Linux the application's std::out is merged in here. // High risk of falsely interpreting this as MI output. // We assume that we _always_ use tokens, so not finding a token @@ -493,8 +493,10 @@ void GdbEngine::handleResponse() m_inbuffer = QByteArray(from, to - from); if (asyncClass == "stopped") { handleAsyncOutput(record); + } else if (asyncClass == "running") { + // Archer has 'thread-id="all"' here } else { - qDebug() << "INGNORED ASYNC OUTPUT " << record.toString(); + qDebug() << "IGNORED ASYNC OUTPUT " << record.toString(); } break; } @@ -773,11 +775,6 @@ void GdbEngine::handleResultRecord(const GdbResultRecord &record) if (token == -1) return; - if (!m_cookieForToken.contains(token)) { - qDebug() << "NO SUCH TOKEN (ANYMORE): " << token; - return; - } - GdbCookie cmd = m_cookieForToken.take(token); // FIXME: this falsely rejects results from the custom dumper recognition @@ -788,12 +785,6 @@ void GdbEngine::handleResultRecord(const GdbResultRecord &record) return; } - // We get _two_ results for a '-exec-foo' command: First a - // 'running' notification, then a 'stopped' or similar. - // So put it back. - if (record.resultClass == GdbResultRunning) - m_cookieForToken[token] = cmd; - #if 0 qDebug() << "# handleOutput, " << "cmd type: " << cmd.type