diff --git a/dist/changes-1.3.0 b/dist/changes-1.3.0 index 127b5618b46..578ce887b70 100644 --- a/dist/changes-1.3.0 +++ b/dist/changes-1.3.0 @@ -36,6 +36,7 @@ Editing * Handle block selection in fakevim * Added Copy full path to the editors combobox * Added left/right arrow buttons for "Go back/forward" in navigation history + * Added smart indentation for pasted text blocks Project support * Added support for adding and removing files from a generic Makefile-based @@ -63,19 +64,25 @@ Debugging * CDB: Added more types to the dumpers (QSharedPointer, QVector, common QMap/QSet types), dereference reference and pointer parameters * CDB: Simplified display of STL types in the locals window - * CDB: Fixed thread handling + * CDB: Fixed thread handling, display thread position * CDB: Added internal dumpers for string types for debuggee crashes + * CDB: Set symbol paths correctly * Improved QObject dumping, print out QRect/QSize, enumerations and flags * Made it possible to use the BinEditor plugin for displaying raw memory * Replace disassembler window by a real text editor enabling "mixed" output + * Improved dumper building on options page, run in background Designer * Added support for rearranging and floating form editor tools Version control plugins * Added CVS support + * Display diff/annotation with correct encoding * Added "sync" menu item to the Perforce plugin - + * Fixed locking of temporary submit message files on Windows + * Use a single, colored output pane for all version control systems + * Position annotation view of file at current line of editor + Wizards * Fixed GUI project and form class wizards to use the same settings. * Added version control checkout wizards diff --git a/doc/images/qtcreator-qt4-qtversions-win-mingw.png b/doc/images/qtcreator-qt4-qtversions-win-mingw.png new file mode 100644 index 00000000000..759b72eccce Binary files /dev/null and b/doc/images/qtcreator-qt4-qtversions-win-mingw.png differ diff --git a/doc/images/qtcreator-qt4-qtversions-win-msvc.png b/doc/images/qtcreator-qt4-qtversions-win-msvc.png new file mode 100644 index 00000000000..0b84fe1545f Binary files /dev/null and b/doc/images/qtcreator-qt4-qtversions-win-msvc.png differ diff --git a/doc/images/qtcreator-qt4-qtversions-win-symbian.png b/doc/images/qtcreator-qt4-qtversions-win-symbian.png new file mode 100644 index 00000000000..9c523818ba0 Binary files /dev/null and b/doc/images/qtcreator-qt4-qtversions-win-symbian.png differ diff --git a/doc/images/qtcreator-qt4-qtversions.png b/doc/images/qtcreator-qt4-qtversions.png new file mode 100644 index 00000000000..7cf97f9de60 Binary files /dev/null and b/doc/images/qtcreator-qt4-qtversions.png differ diff --git a/doc/images/qtcreator-texteditor-behavior.png b/doc/images/qtcreator-texteditor-behavior.png index 2b78e2ba5f0..8f7ef19c2f7 100644 Binary files a/doc/images/qtcreator-texteditor-behavior.png and b/doc/images/qtcreator-texteditor-behavior.png differ diff --git a/doc/images/qtcreator-texteditor-completion.png b/doc/images/qtcreator-texteditor-completion.png index 9c5aecfe26e..33cbda18598 100644 Binary files a/doc/images/qtcreator-texteditor-completion.png and b/doc/images/qtcreator-texteditor-completion.png differ diff --git a/doc/images/qtcreator-texteditor-display.png b/doc/images/qtcreator-texteditor-display.png index 86c8043f307..06558071e59 100644 Binary files a/doc/images/qtcreator-texteditor-display.png and b/doc/images/qtcreator-texteditor-display.png differ diff --git a/doc/images/qtcreator-texteditor-fonts.png b/doc/images/qtcreator-texteditor-fonts.png index 1a16fe6e228..0712fa1fb51 100644 Binary files a/doc/images/qtcreator-texteditor-fonts.png and b/doc/images/qtcreator-texteditor-fonts.png differ diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index d17f5131442..0a1b88d55af 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -171,7 +171,8 @@ to the \gui{Help} mode. To obtain context sensitive help, move your text cursor to a Qt class or function and press \key{F1}. The documentation will be displayed within a panel on the right, as shown in the screenshot - below. + below. If there is enough vertical space, it will be shown in the + fullscreen help mode. External Documentation provided by the user can be used to augment or replace the documentation shipped with Qt Creator and Qt. @@ -417,14 +418,58 @@ not need to manually configure your Qt version. Otherwise, you can add your Qt version in - \gui{Tools -> Options... -> Qt Versions}. If you are on the Windows - platform and use MinGW to compile Qt, you need to tell Qt Creator where - MinGW is installed. This is done by setting the \gui{MinGW Directory} - under \gui{Tools -> Options... -> Qt4 -> Qt Versions -> MinGw Directory}. - If your Qt version is compiled with Microsoft Visual C++'s compiler, Qt - Creator will automatically set the correct environment variables for - compilation. - + \gui{Tools -> Options... -> Qt Versions} on Windows and Linux or + in \gui{Qt Creator -> Preferences... -> Qt Versions} on Mac OS X. + + The detailed settings depend on your Operating system and on the targeted + tool chain + + \table + \row + \i \image qtcreator-qt4-qtversions.png + On Linux and Mac OS X, simply set the \gui{Path to QMake} + to the \c qmake binary of the Qt installation. If a Qt is + found in the \c PATH environment variable, it will show up. + + On both platforms, the platforms Gnu Compiler Collection (GCC) + is used to compile Qt. On Mac OS, the GCC compiler is part of XCode. + On Linux, the Intel Compiler (ICC) is supported as a drop-in replacement + for GCC. + + \row + \i \image qtcreator-qt4-qtversions-win-mingw.png + If you are on the Windows platform and used MinGW + to compile Qt, you need to additionally tell Qt Creator + where MinGW is installed. This is done by setting the + \gui{MinGW Directory}. + \row + \i \image qtcreator-qt4-qtversions-win-msvc.png + If your Qt version is compiled with Microsoft Visual C++'s + compiler, Qt Creator will automatically set the correct + environment variables for compilation. The \gui{MSVC} + dropdown box indicates the internal Version Number of the + installed Microsoft Visual C++ tool chains: + + \list + \o \bold{7.1}: Visual Studio 2003 + \o \bold{8.0}: Visual Studio 2005 + \o \bold{9.0}: Visual Studio 2008 + \endlist + + If you are using the \c{Windows SDK for Windows Server 2008} + instead of Visual Studio, it will identify as version 9.0. + \row + \i \image qtcreator-qt4-qtversions-win-symbian.png + If you are using Qt for Symbian and your S60 SDK is registered + with \c devices.exe, Qt Creator will detect the Qt version automatically. + If this does not work, point Creator to \c qmake.exe of Qt for Symbian. + You can add the path to the Metrowerks Compiler (\gui {MWC Directory}) + if you want to use to build for the emulator. This requires Carbide 2.0 + to be installed. the MWC directory should then point to the directory + of your Carbide installation. However, this not needed for compiling for + the device. + \endtable + \note By default projects are compiled with the \l{glossary-default-qt}{default Qt version}. You can override this in the \gui{Build Configuration}. @@ -700,6 +745,10 @@ \i \bold{Perforce} \i \l{http://www.perforce.com} \i Server version 2006.1 and later + \row + \i \bold{CVS} + \i \l{http://www.cvshome.org} + \i \endtable @@ -867,11 +916,11 @@ \image qtcreator-locator.png Suppose you would like to open your project's \c{main.cpp} file, click on - \gui Locator or use \key{Ctrl+K}, type in the file name and then press - \key Return. The file will be opened in the editor. You can also type - part of a file name and use the wildcard characters \c{*} and \c{?} to - match \e{any} number of \e{any} characters. A list of all files matching - your criteria will be displayed. + \gui Locator or use \key{Ctrl+K} (Mac OS X: \key{Cmd+K}), type in the file + name and then press \key Return. The file will be opened in the editor. + You can also type part of a file name and use the wildcard characters + \c{*} and \c{?} to match \e{any} number of \e{any} characters. A list + of all files matching your criteria will be displayed. \gui Locator not only allows you to navigate files on disk but also other "locations", which are organized with \bold{Filters}. Currently there are @@ -894,8 +943,8 @@ \e prefix. This prefix is usually a single character followed by \key{Space}. For example, to jump to the definition of the class \l{http://doc.trolltech.com/qdatastream.html}{QDataStream}, type: - \key{Ctrl+K} to activate \gui Locator. Then type colon (\key{:}) followed - by \key{Space} and the class name. + \key{Ctrl+K} (Mac OS X: \key{Cmd+K}) to activate \gui Locator. + Then type colon (\key{:}) followed by \key{Space} and the class name. Below is a full list of \l{http://doc.trolltech.com/qdatastream.html} @@ -972,6 +1021,8 @@ \note By default, if you press \key{Ctrl+K} and do not use a prefix to specify a filter, three filters will be enabled: \c{o}, \c{l}, and \c{a}. + + \note On Mac OS X, use \key{Cmd+K} instead of \key{Ctrl+K}. */ @@ -1588,7 +1639,8 @@ \bold{Show and Hide the Sidebar} You can show and hide the the sidebar in \gui Edit and \gui Debug mode by - clicking on the corresponding icon, or by pressing \key{Alt+0}. + clicking on the corresponding icon, or by pressing \key{Alt+0} (Mac OS X: + \key{Cmd+0}). \bold{Display Signals and Slots} @@ -1676,19 +1728,19 @@ \o F4 \row \o Toggle Side Bar - \o Alt + 0 + \o Alt + 0 / Cmd + 0 \row \o Toggle \gui{Build Issues} pane - \o Alt + 1 + \o Alt + 1 / Cmd + 1 \row \o Toggle \gui{Search Results} pane - \o Alt + 2 + \o Alt + 2 / Cmd + 2 \row \o Toggle \gui{Application Output} pane - \o Alt + 3 + \o Alt + 3 / Cmd + 3 \row \o Toggle \gui{Compile Output} pane - \o Alt + 4 + \o Alt + 4 / Cmd + 4 \endtable */ diff --git a/src/libs/cplusplus/FastPreprocessor.cpp b/src/libs/cplusplus/FastPreprocessor.cpp index 4a4c10d732b..b61f61cee76 100644 --- a/src/libs/cplusplus/FastPreprocessor.cpp +++ b/src/libs/cplusplus/FastPreprocessor.cpp @@ -34,55 +34,6 @@ using namespace CPlusPlus; -FastMacroResolver::FastMacroResolver(TranslationUnit *unit, const Snapshot &snapshot) - : _unit(unit), _snapshot(snapshot) -{ - const QString fileName = QString::fromUtf8(unit->fileName(), unit->fileNameLength()); - - QSet processed; - updateCache(fileName, &processed); -} - -bool FastMacroResolver::isMacro(TranslationUnit *unit, unsigned tokenIndex) const -{ - if (unit != _unit){ - qWarning() << Q_FUNC_INFO << "unexpected translation unit:" << unit->fileName(); - return false; - } - - const Token &tk = unit->tokenAt(tokenIndex); - if (tk.isNot(T_IDENTIFIER)) - return false; - - Identifier *id = tk.identifier; - const QByteArray macroName = QByteArray::fromRawData(id->chars(), id->size()); - return _cachedMacros.contains(macroName); -} - -void FastMacroResolver::updateCache(const QString &fileName, QSet *processed) -{ - if (processed->contains(fileName)) - return; - - processed->insert(fileName); - - if (Document::Ptr doc = _snapshot.value(fileName)) { - const QList definedMacros = doc->definedMacros(); - - for (int i = definedMacros.size() - 1; i != -1; --i) { - const Macro ¯o = definedMacros.at(i); - - if (macro.isHidden()) - _cachedMacros.remove(macro.name()); - else - _cachedMacros.insert(macro.name()); - } - - foreach (const Document::Include &incl, doc->includes()) - updateCache(incl.fileName(), processed); - } -} - FastPreprocessor::FastPreprocessor(const Snapshot &snapshot) : _snapshot(snapshot), _preproc(this, &_env) diff --git a/src/libs/cplusplus/FastPreprocessor.h b/src/libs/cplusplus/FastPreprocessor.h index 83d1bb257fd..ebbc8d17525 100644 --- a/src/libs/cplusplus/FastPreprocessor.h +++ b/src/libs/cplusplus/FastPreprocessor.h @@ -41,22 +41,6 @@ namespace CPlusPlus { -class CPLUSPLUS_EXPORT FastMacroResolver: public MacroResolver -{ -public: - FastMacroResolver(TranslationUnit *unit, const Snapshot &snapshot); - - virtual bool isMacro(TranslationUnit *unit, unsigned tokenIndex) const; - -private: - void updateCache(const QString &fileName, QSet *processed); - -private: - TranslationUnit *_unit; - Snapshot _snapshot; - QSet _cachedMacros; -}; - class CPLUSPLUS_EXPORT FastPreprocessor: public Client { Environment _env; diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 192d389fe23..0b2fd4bba26 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -30,6 +30,7 @@ #include "LookupContext.h" #include "ResolveExpression.h" #include "Overview.h" +#include "CppBindings.h" #include #include @@ -501,6 +502,97 @@ void LookupContext::expand(Scope *scope, } } +static void visibleClassBindings_helper(ClassBinding *classBinding, + QList *allClassBindings, + QSet *processed) +{ + if (! classBinding) + return; + + else if (processed->contains(classBinding)) + return; + + processed->insert(classBinding); + + foreach (ClassBinding *baseClassBinding, classBinding->baseClassBindings) + visibleClassBindings_helper(baseClassBinding, allClassBindings, processed); + + allClassBindings->append(classBinding); +} + +static QList visibleClassBindings(Symbol *symbol, NamespaceBinding *globalNamespace) +{ + QList classBindings; + + if (! symbol) + return classBindings; + + else if (Class *klass = symbol->asClass()) { + QSet processed; + + visibleClassBindings_helper(NamespaceBinding::find(klass, globalNamespace), + &classBindings, &processed); + } + + return classBindings; +} + +Symbol *LookupContext::canonicalSymbol(Symbol *symbol, + NamespaceBinding *globalNamespace) +{ + Symbol *canonicalSymbol = LookupContext::canonicalSymbol(symbol); + + if (Identifier *symbolId = canonicalSymbol->identifier()) { + if (symbolId && canonicalSymbol->type()->isFunctionType()) { + Class *enclosingClass = canonicalSymbol->scope()->owner()->asClass(); + const QList classBindings = visibleClassBindings(enclosingClass, globalNamespace); + + foreach (ClassBinding *baseClassBinding, classBindings) { + if (! baseClassBinding) + continue; + + foreach (Class *baseClass, baseClassBinding->symbols) { + if (! baseClass) + continue; + + for (Symbol *c = baseClass->members()->lookat(symbolId); c; c = c->next()) { + if (! symbolId->isEqualTo(c->identifier())) + continue; + else if (Function *f = c->type()->asFunctionType()) { + if (f->isVirtual()) + return LookupContext::canonicalSymbol(f); + } + } + } + } + } + } + + return canonicalSymbol; +} + +Symbol *LookupContext::canonicalSymbol(const QList &candidates, + NamespaceBinding *globalNamespaceBinding) +{ + if (candidates.isEmpty()) + return 0; + + return canonicalSymbol(candidates.first(), globalNamespaceBinding); +} + +Symbol *LookupContext::canonicalSymbol(const QList > &results, + NamespaceBinding *globalNamespaceBinding) +{ + QList candidates; + QPair result; + + foreach (result, results) + candidates.append(result.second); // ### not exacly. + + return canonicalSymbol(candidates, globalNamespaceBinding); +} + + Symbol *LookupContext::canonicalSymbol(Symbol *symbol) { Symbol *canonical = symbol; @@ -531,22 +623,3 @@ Symbol *LookupContext::canonicalSymbol(Symbol *symbol) return canonical; } - -Symbol *LookupContext::canonicalSymbol(const QList &candidates) -{ - if (candidates.isEmpty()) - return 0; - - return canonicalSymbol(candidates.first()); -} - -Symbol *LookupContext::canonicalSymbol(const QList > &results) -{ - QList candidates; - QPair result; - - foreach (result, results) - candidates.append(result.second); // ### not exacly. - - return canonicalSymbol(candidates); -} diff --git a/src/libs/cplusplus/LookupContext.h b/src/libs/cplusplus/LookupContext.h index bb5b0539268..5424da869ca 100644 --- a/src/libs/cplusplus/LookupContext.h +++ b/src/libs/cplusplus/LookupContext.h @@ -54,9 +54,14 @@ public: Document::Ptr document(const QString &fileName) const; Snapshot snapshot() const; - static Symbol *canonicalSymbol(Symbol *symbol); - static Symbol *canonicalSymbol(const QList &candidates); - static Symbol *canonicalSymbol(const QList > &candidates); // ### FIXME + static Symbol *canonicalSymbol(const QList &candidates, + NamespaceBinding *globalNamespaceBinding); + + static Symbol *canonicalSymbol(Symbol *symbol, + NamespaceBinding *globalNamespaceBinding); + + static Symbol *canonicalSymbol(const QList > &candidates, + NamespaceBinding *globalNamespaceBinding); QList resolve(Name *name) const { return resolve(name, visibleScopes()); } @@ -126,6 +131,8 @@ public: QList *expandedScopes) const; private: + static Symbol *canonicalSymbol(Symbol *symbol); + QList resolveQualifiedNameId(QualifiedNameId *q, const QList &visibleScopes, ResolveMode mode) const; diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index d048f6dee95..eeda79c9e1a 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include @@ -838,8 +839,6 @@ CPlusPlus::Symbol *CPPEditor::findCanonicalSymbol(const QTextCursor &cursor, const QString code = expressionUnderCursor(tc); // qDebug() << "code:" << code; - const QString fileName = const_cast(this)->file()->fileName(); - TypeOfExpression typeOfExpression; typeOfExpression.setSnapshot(snapshot); @@ -849,7 +848,8 @@ CPlusPlus::Symbol *CPPEditor::findCanonicalSymbol(const QTextCursor &cursor, lastVisibleSymbol, TypeOfExpression::Preprocess); - Symbol *canonicalSymbol = LookupContext::canonicalSymbol(results); + NamespaceBindingPtr glo = bind(doc, snapshot); + Symbol *canonicalSymbol = LookupContext::canonicalSymbol(results, glo.data()); return canonicalSymbol; } @@ -2090,11 +2090,7 @@ SemanticInfo SemanticHighlighter::semanticInfo(const Source &source) snapshot = source.snapshot; doc = source.snapshot.documentFromSource(preprocessedCode, source.fileName); - - FastMacroResolver fastMacroResolver(doc->translationUnit(), snapshot); - doc->control()->setMacroResolver(&fastMacroResolver); doc->check(); - doc->control()->setMacroResolver(0); } Control *control = doc->control(); diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp index bd65c32666c..3372fd336d1 100644 --- a/src/plugins/cppeditor/cppplugin.cpp +++ b/src/plugins/cppeditor/cppplugin.cpp @@ -214,6 +214,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess QAction *findUsagesAction = new QAction(tr("Find Usages"), this); cmd = am->registerAction(findUsagesAction, Constants::FIND_USAGES, context); + cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U"))); connect(findUsagesAction, SIGNAL(triggered()), this, SLOT(findUsages())); contextMenu->addAction(cmd); am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd); diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index 6d9b9f8d0e6..9fab3493683 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -81,6 +82,11 @@ public: _snapshot.insert(_doc); } + void setGlobalNamespaceBinding(NamespaceBindingPtr globalNamespaceBinding) + { + _globalNamespaceBinding = globalNamespaceBinding; + } + QList operator()(Symbol *symbol, Identifier *id, AST *ast) { _references.clear(); @@ -146,7 +152,8 @@ protected: bool checkCandidates(const QList &candidates) const { - if (Symbol *canonicalSymbol = LookupContext::canonicalSymbol(candidates)) { + if (Symbol *canonicalSymbol = LookupContext::canonicalSymbol(candidates, _globalNamespaceBinding.data())) { + #if 0 qDebug() << "*** canonical symbol:" << canonicalSymbol->fileName() << canonicalSymbol->line() << canonicalSymbol->column() @@ -419,6 +426,7 @@ private: QByteArray _source; Document::Ptr _exprDoc; Semantic _sem; + NamespaceBindingPtr _globalNamespaceBinding; QList _postfixExpressionStack; QList _qualifiedNameStack; QList _references; @@ -456,6 +464,7 @@ QList CppFindReferences::references(Symbol *symbol, Q_ASSERT(translationUnit != 0); Process process(doc, snapshot, /*future = */ 0); + process.setGlobalNamespaceBinding(bind(doc, snapshot)); references = process(symbol, id, translationUnit->ast()); return references; @@ -490,7 +499,7 @@ static void find_helper(QFutureInterface &future, files += snapshot.dependsOn(sourceFile); } - qDebug() << "done in:" << tm.elapsed() << "number of files to parse:" << files.size(); + //qDebug() << "done in:" << tm.elapsed() << "number of files to parse:" << files.size(); future.setProgressRange(0, files.size()); @@ -531,13 +540,7 @@ static void find_helper(QFutureInterface &future, if (Identifier *id = control->findIdentifier(symbolId->chars(), symbolId->size())) { QTime tm; tm.start(); - TranslationUnit *unit = doc->translationUnit(); - Control *control = doc->control(); - - FastMacroResolver fastMacroResolver(unit, snapshot); - control->setMacroResolver(&fastMacroResolver); doc->parse(); - control->setMacroResolver(0); //qDebug() << "***" << unit->fileName() << "parsed in:" << tm.elapsed(); @@ -548,6 +551,9 @@ static void find_helper(QFutureInterface &future, tm.start(); Process process(doc, snapshot, &future); + process.setGlobalNamespaceBinding(bind(doc, snapshot)); + + TranslationUnit *unit = doc->translationUnit(); process(symbol, id, unit->ast()); //qDebug() << "***" << unit->fileName() << "processed in:" << tm.elapsed(); diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 56e7b1d48f5..89df8fdda5c 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -752,7 +752,8 @@ QList CppModelManager::references(CPlusPlus::Symbol *symbol, CPlusPlus::Document::Ptr doc, const CPlusPlus::Snapshot &snapshot) { - return m_findReferences->references(LookupContext::canonicalSymbol(symbol), doc, snapshot); + NamespaceBindingPtr glo = bind(doc, snapshot); + return m_findReferences->references(LookupContext::canonicalSymbol(symbol, glo.data()), doc, snapshot); } void CppModelManager::findUsages(CPlusPlus::Symbol *symbol) diff --git a/src/plugins/debugger/breakwindow.cpp b/src/plugins/debugger/breakwindow.cpp index 46dc6faac71..b0edd855459 100644 --- a/src/plugins/debugger/breakwindow.cpp +++ b/src/plugins/debugger/breakwindow.cpp @@ -30,6 +30,7 @@ #include "breakwindow.h" #include "debuggeractions.h" +#include "debuggermanager.h" #include "ui_breakcondition.h" #include "ui_breakbyfunction.h" @@ -179,6 +180,7 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev) editConditionAction->setEnabled(si.size() > 0); QAction *synchronizeAction = new QAction(tr("Synchronize breakpoints"), &menu); + synchronizeAction->setEnabled(Debugger::DebuggerManager::instance()->debuggerActionsEnabled()); QModelIndex idx0 = (si.size() ? si.front() : QModelIndex()); QModelIndex idx2 = idx0.sibling(idx0.row(), 2); diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index a90d143f9dd..660340bb4c4 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -662,13 +662,15 @@ void DebuggerManager::setSimpleDockWidgetArrangement() } foreach (QDockWidget *dockWidget, dockWidgets) { - d->m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dockWidget); + if (dockWidget == d->m_outputDock) + d->m_mainWindow->addDockWidget(Qt::TopDockWidgetArea, dockWidget); + else + d->m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dockWidget); dockWidget->show(); } d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_breakDock); d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_modulesDock); - d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_outputDock); d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_registerDock); d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_threadsDock); d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_sourceFilesDock); @@ -1684,11 +1686,51 @@ void DebuggerManager::setState(DebuggerState state) d->m_actions.runToFunctionAction->setEnabled(stopped); d->m_actions.jumpToLineAction->setEnabled(stopped); d->m_actions.nextAction->setEnabled(stopped); + + const bool actionsEnabled = debuggerActionsEnabled(); + theDebuggerAction(RecheckDebuggingHelpers)->setEnabled(actionsEnabled); + theDebuggerAction(AutoDerefPointers)->setEnabled(actionsEnabled && d->m_engine->isGdbEngine()); + theDebuggerAction(ExpandStack)->setEnabled(actionsEnabled); + theDebuggerAction(ExecuteCommand)->setEnabled(d->m_state != DebuggerNotReady); + emit stateChanged(d->m_state); const bool notbusy = state == InferiorStopped || state == DebuggerNotReady || state == InferiorUnrunnable; setBusyCursor(!notbusy); + +} + +bool DebuggerManager::debuggerActionsEnabled() const +{ + if (!d->m_engine) + return false; + switch (state()) { + case InferiorPrepared: + case InferiorStarting: + case InferiorRunningRequested: + case InferiorRunning: + case InferiorUnrunnable: + case InferiorStopping: + case InferiorStopped: + return true; + case DebuggerNotReady: + case EngineStarting: + case AdapterStarting: + case AdapterStarted: + case AdapterStartFailed: + case InferiorPreparing: + case InferiorPreparationFailed: + case InferiorStartFailed: + case InferiorStopFailed: + case InferiorShuttingDown: + case InferiorShutDown: + case InferiorShutdownFailed: + case AdapterShuttingDown: + case AdapterShutdownFailed: + break; + } + return false; } QDebug operator<<(QDebug d, DebuggerState state) diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index 7579ebd7227..ee7f439ba98 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -175,6 +175,8 @@ public: void showMessageBox(int icon, const QString &title, const QString &text); + bool debuggerActionsEnabled() const; + static DebuggerManager *instance(); public slots: diff --git a/src/plugins/debugger/debuggeroutputwindow.cpp b/src/plugins/debugger/debuggeroutputwindow.cpp index a3ca21f25c4..c75fbd5a328 100644 --- a/src/plugins/debugger/debuggeroutputwindow.cpp +++ b/src/plugins/debugger/debuggeroutputwindow.cpp @@ -155,7 +155,6 @@ public: m_clearContentsAction = new QAction(this); m_clearContentsAction->setText(tr("Clear contents")); m_clearContentsAction->setEnabled(true); - m_clearContentsAction->setShortcut(Qt::ControlModifier + Qt::Key_R); connect(m_clearContentsAction, SIGNAL(triggered(bool)), parent, SLOT(clearContents())); diff --git a/src/plugins/debugger/gdb/plaingdbadapter.cpp b/src/plugins/debugger/gdb/plaingdbadapter.cpp index a65381920b6..a71039a3011 100644 --- a/src/plugins/debugger/gdb/plaingdbadapter.cpp +++ b/src/plugins/debugger/gdb/plaingdbadapter.cpp @@ -257,6 +257,11 @@ void PlainGdbAdapter::shutdown() m_engine->postCommand(_("kill"), CB(handleKill)); return; + case InferiorShuttingDown: + // FIXME: How can we end up here? + QTC_ASSERT(false, qDebug() << state()); + // Fall through. + case InferiorShutDown: setState(AdapterShuttingDown); m_engine->postCommand(_("-gdb-exit"), CB(handleExit)); diff --git a/src/plugins/debugger/moduleswindow.cpp b/src/plugins/debugger/moduleswindow.cpp index f5d48db0882..6d46dda03c5 100644 --- a/src/plugins/debugger/moduleswindow.cpp +++ b/src/plugins/debugger/moduleswindow.cpp @@ -105,11 +105,15 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev) if (index.isValid()) name = model()->data(index).toString(); + QMenu menu; + const bool enabled = Debugger::DebuggerManager::instance()->debuggerActionsEnabled(); QAction *act0 = new QAction(tr("Update module list"), &menu); - QAction *act3 = new QAction(tr("Show source files for module \"%1\"").arg(name), - &menu); + act0->setEnabled(enabled); + QAction *act3 = new QAction(tr("Show source files for module \"%1\"").arg(name), &menu); + act3->setEnabled(enabled); QAction *act4 = new QAction(tr("Load symbols for all modules"), &menu); + act4->setEnabled(enabled); QAction *act5 = 0; QAction *act6 = 0; QAction *act7 = 0; diff --git a/src/plugins/debugger/registerwindow.cpp b/src/plugins/debugger/registerwindow.cpp index 3bc52f29456..ddaedbd808c 100644 --- a/src/plugins/debugger/registerwindow.cpp +++ b/src/plugins/debugger/registerwindow.cpp @@ -177,6 +177,7 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev) } else { actShowMemory->setText(tr("Open memory editor at %1").arg(address)); } + actShowMemory->setEnabled(m_manager->debuggerActionsEnabled()); menu.addSeparator(); int base = model()->data(QModelIndex(), RegisterNumberBaseRole).toInt(); diff --git a/src/plugins/debugger/sourcefileswindow.cpp b/src/plugins/debugger/sourcefileswindow.cpp index 5a9f5b5151d..52341c62852 100644 --- a/src/plugins/debugger/sourcefileswindow.cpp +++ b/src/plugins/debugger/sourcefileswindow.cpp @@ -29,6 +29,7 @@ #include "sourcefileswindow.h" #include "debuggeractions.h" +#include "debuggermanager.h" #include #include @@ -199,6 +200,7 @@ void SourceFilesWindow::contextMenuEvent(QContextMenuEvent *ev) QMenu menu; QAction *act1 = new QAction(tr("Reload data"), &menu); + act1->setEnabled(Debugger::DebuggerManager::instance()->debuggerActionsEnabled()); //act1->setCheckable(true); QAction *act2 = 0; if (name.isEmpty()) { diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index a12367df9a4..2d9cbea92d7 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -240,6 +240,7 @@ bool StackHandler::isDebuggingDebuggingHelpers() const ThreadData::ThreadData(int threadId) : id(threadId), + address(0), line(-1) { } diff --git a/src/plugins/debugger/stackwindow.cpp b/src/plugins/debugger/stackwindow.cpp index d854a5edaf6..910f69ea35c 100644 --- a/src/plugins/debugger/stackwindow.cpp +++ b/src/plugins/debugger/stackwindow.cpp @@ -102,7 +102,7 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev) actShowMemory->setEnabled(false); } else { actShowMemory->setText(tr("Open memory editor at %1").arg(address)); - } + } QAction *actShowDisassembler = menu.addAction(QString()); if (address.isEmpty()) { @@ -113,8 +113,9 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev) } menu.addSeparator(); - +#if 0 // @TODO: not implemented menu.addAction(theDebuggerAction(UseToolTipsInStackView)); +#endif menu.addAction(theDebuggerAction(UseAddressInStackView)); QAction *actAdjust = menu.addAction(tr("Adjust column widths to contents")); diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index f40bb93085d..5cf8f4ff534 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -237,6 +237,10 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev) individualFormatMenu.addAction(act); individualFormatActions.append(act); } + if (alternativeFormats.isEmpty()) { + typeFormatMenu.setEnabled(false); + individualFormatMenu.setEnabled(false); + } } else { typeFormatMenu.setTitle(tr("Change format for type")); typeFormatMenu.setEnabled(false); @@ -245,16 +249,15 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev) } QMenu menu; - //QAction *actWatchExpressionInWindow - // = theDebuggerAction(WatchExpressionInWindow); - //menu.addAction(actWatchExpressionInWindow); QAction *actInsertNewWatchItem = menu.addAction(tr("Insert new watch item")); QAction *actSelectWidgetToWatch = menu.addAction(tr("Select widget to watch")); const QString address = model()->data(mi0, AddressRole).toString(); QAction *actWatchKnownMemory = 0; - QAction *actWatchUnknownMemory = new QAction(tr("Open memory editor..."), &menu);; + QAction *actWatchUnknownMemory = new QAction(tr("Open memory editor..."), &menu); + actWatchUnknownMemory->setEnabled(m_manager->debuggerActionsEnabled()); + if (!address.isEmpty()) actWatchKnownMemory = new QAction(tr("Open memory editor at %1").arg(address), &menu); menu.addSeparator(); @@ -270,6 +273,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev) menu.addAction(actWatchKnownMemory); menu.addAction(actWatchUnknownMemory); menu.addSeparator(); + menu.addAction(theDebuggerAction(RecheckDebuggingHelpers)); menu.addAction(theDebuggerAction(UseDebuggingHelpers)); @@ -277,8 +281,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev) menu.addAction(theDebuggerAction(UseToolTipsInLocalsView)); menu.addAction(theDebuggerAction(AutoDerefPointers)); - theDebuggerAction(AutoDerefPointers)-> - setEnabled(m_manager->currentEngine()->isGdbEngine()); + QAction *actAdjustColumnWidths = menu.addAction(tr("Adjust column widths to contents")); QAction *actAlwaysAdjustColumnWidth = diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 09dd1307532..33a6ac1be9d 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -240,6 +240,11 @@ QString quoteUnprintable(const QString &ba) return res; } +inline QString msgE20MarkNotSet(const QString &text) +{ + return FakeVimHandler::tr("E20: Mark '%1' not set").arg(text); +} + class FakeVimHandler::Private { public: @@ -905,14 +910,12 @@ void FakeVimHandler::Private::updateMiniBuffer() int linesInDoc = linesInDocument(); int l = cursorLineInDocument(); QString status; - QString pos = tr("%1,%2").arg(l + 1).arg(cursorColumnInDocument() + 1); - status += tr("%1").arg(pos, -10); + const QString pos = QString::fromLatin1("%1,%2").arg(l + 1).arg(cursorColumnInDocument() + 1); // FIXME: physical "-" logical if (linesInDoc != 0) { - status += tr("%1").arg(l * 100 / linesInDoc, 4); - status += "%"; + status = FakeVimHandler::tr("%1%2%").arg(pos, -10).arg(l * 100 / linesInDoc, 4); } else { - status += "All"; + status = FakeVimHandler::tr("%1All").arg(pos, -10); } emit q->statusDataChanged(status); } @@ -934,7 +937,7 @@ void FakeVimHandler::Private::showBlackMessage(const QString &msg) void FakeVimHandler::Private::notImplementedYet() { qDebug() << "Not implemented in FakeVim"; - showRedMessage(tr("Not implemented in FakeVim")); + showRedMessage(FakeVimHandler::tr("Not implemented in FakeVim")); updateMiniBuffer(); } @@ -1060,7 +1063,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveToFirstNonBlankOnLine(); finishMovement(); } else { - showRedMessage(tr("E20: Mark '%1' not set").arg(text)); + showRedMessage(msgE20MarkNotSet(text)); } m_subsubmode = NoSubSubMode; } else if (key >= '0' && key <= '9') { @@ -1802,7 +1805,7 @@ int FakeVimHandler::Private::readLineCode(QString &cmd) if (c == '\'' && !cmd.isEmpty()) { int mark = m_marks.value(cmd.at(0).unicode()); if (!mark) { - showRedMessage(tr("E20: Mark '%1' not set").arg(cmd.at(0))); + showRedMessage(msgE20MarkNotSet(cmd.at(0))); cmd = cmd.mid(1); return -1; } @@ -1821,7 +1824,7 @@ int FakeVimHandler::Private::readLineCode(QString &cmd) int pos = m_marks.value(cmd.at(0).unicode(), -1); //qDebug() << " MARK: " << cmd.at(0) << pos << lineForPosition(pos); if (pos == -1) { - showRedMessage(tr("E20: Mark '%1' not set").arg(cmd.at(0))); + showRedMessage(msgE20MarkNotSet(cmd.at(0))); cmd = cmd.mid(1); return -1; } @@ -1935,7 +1938,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) QFile file1(fileName); bool exists = file1.exists(); if (exists && !forced && !noArgs) { - showRedMessage(tr("File '%1' exists (add ! to override)").arg(fileName)); + showRedMessage(FakeVimHandler::tr("File '%1' exists (add ! to override)").arg(fileName)); } else if (file1.open(QIODevice::ReadWrite)) { file1.close(); QTextCursor tc = m_tc; @@ -1955,14 +1958,14 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) QTextStream ts(&file2); ts << contents; } else { - showRedMessage(tr("Cannot open file '%1' for writing").arg(fileName)); + showRedMessage(FakeVimHandler::tr("Cannot open file '%1' for writing").arg(fileName)); } } // check result by reading back QFile file3(fileName); file3.open(QIODevice::ReadOnly); QByteArray ba = file3.readAll(); - showBlackMessage(tr("\"%1\" %2 %3L, %4C written") + showBlackMessage(FakeVimHandler::tr("\"%1\" %2 %3L, %4C written") .arg(fileName).arg(exists ? " " : " [New] ") .arg(ba.count('\n')).arg(ba.size())); if (quitAll) @@ -1970,7 +1973,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) else if (quit) passUnknownExCommand(forced ? "q!" : "q"); } else { - showRedMessage(tr("Cannot open file '%1' for reading").arg(fileName)); + showRedMessage(FakeVimHandler::tr("Cannot open file '%1' for reading").arg(fileName)); } } else if (cmd.startsWith("r ")) { // :r m_currentFileName = cmd.mid(2); @@ -1979,7 +1982,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) QTextStream ts(&file); QString data = ts.readAll(); EDITOR(setPlainText(data)); - showBlackMessage(tr("\"%1\" %2L, %3C") + showBlackMessage(FakeVimHandler::tr("\"%1\" %2L, %3C") .arg(m_currentFileName).arg(data.count('\n')).arg(data.size())); } else if (cmd.startsWith(QLatin1Char('!'))) { selectRange(beginLine, endLine); @@ -1997,13 +2000,13 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) leaveVisualMode(); setPosition(firstPositionInLine(beginLine)); //qDebug() << "FILTER: " << command; - showBlackMessage(tr("%n lines filtered", 0, text.count('\n'))); + showBlackMessage(FakeVimHandler::tr("%n lines filtered", 0, text.count('\n'))); } else if (cmd.startsWith(QLatin1Char('>'))) { m_anchor = firstPositionInLine(beginLine); setPosition(firstPositionInLine(endLine)); shiftRegionRight(1); leaveVisualMode(); - showBlackMessage(tr("%n lines >ed %1 time", 0, (endLine - beginLine + 1)).arg(1)); + showBlackMessage(FakeVimHandler::tr("%n lines >ed %1 time", 0, (endLine - beginLine + 1)).arg(1)); } else if (cmd == "red" || cmd == "redo") { // :redo redo(); updateMiniBuffer(); @@ -2081,7 +2084,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) if (act) act->setValue(arg.mid(p + 1)); } else { - showRedMessage(tr("E512: Unknown option: ") + arg); + showRedMessage(FakeVimHandler::tr("E512: Unknown option: ") + arg); } updateMiniBuffer(); } else if (reHistory.indexIn(cmd) != -1) { // :history @@ -2152,14 +2155,14 @@ void FakeVimHandler::Private::search(const QString &needle0, bool forward) if (oldLine != cursorLineInDocument() - cursorLineOnScreen()) scrollToLineInDocument(cursorLineInDocument() - linesOnScreen() / 2); if (forward) - showRedMessage(tr("search hit BOTTOM, continuing at TOP")); + showRedMessage(FakeVimHandler::tr("search hit BOTTOM, continuing at TOP")); else - showRedMessage(tr("search hit TOP, continuing at BOTTOM")); + showRedMessage(FakeVimHandler::tr("search hit TOP, continuing at BOTTOM")); highlightMatches(needle); } else { highlightMatches(QString()); setCursorPosition(origPosition); - showRedMessage(tr("Pattern not found: ") + needle); + showRedMessage(FakeVimHandler::tr("Pattern not found: ") + needle); } } } @@ -2729,7 +2732,7 @@ void FakeVimHandler::Private::undo() //beginEditBlock(); int rev = m_tc.document()->revision(); if (current == rev) - showBlackMessage(tr("Already at oldest change")); + showBlackMessage(FakeVimHandler::tr("Already at oldest change")); else showBlackMessage(QString()); if (m_undoCursorPosition.contains(rev)) @@ -2744,7 +2747,7 @@ void FakeVimHandler::Private::redo() //beginEditBlock(); int rev = m_tc.document()->revision(); if (rev == current) - showBlackMessage(tr("Already at newest change")); + showBlackMessage(FakeVimHandler::tr("Already at newest change")); else showBlackMessage(QString()); if (m_undoCursorPosition.contains(rev)) diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index 306242598db..15d71a85538 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -59,6 +59,7 @@ public: QMap toMap() const; void setValuesFromMap(QMap map); + private: void setName(const QString &name); diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 94a9585b023..32d3fbdc4ff 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -104,6 +104,18 @@ void Project::moveCleanStepUp(int position) m_cleanSteps.insert(position - 1, bs); } +QString Project::makeUnique(const QString &preferedName, const QStringList &usedNames) +{ + if (!usedNames.contains(preferedName)) + return preferedName; + int i = 2; + QString tryName = preferedName + QString::number(i); + while (usedNames.contains(tryName)) + tryName = preferedName + QString::number(++i); + return tryName; +} + + void Project::addBuildConfiguration(BuildConfiguration *configuration) { QStringList buildConfigurationNames; @@ -112,12 +124,7 @@ void Project::addBuildConfiguration(BuildConfiguration *configuration) // Check that the internal name is not taken and use a different one otherwise QString configurationName = configuration->name(); - if (buildConfigurationNames.contains(configurationName)) { - int i = 2; - while (buildConfigurationNames.contains(configurationName + QString::number(i))) - ++i; - configurationName += QString::number(i); - } + configurationName = makeUnique(configurationName, buildConfigurationNames); configuration->setName(configurationName); // Check that we don't have a configuration with the same displayName @@ -125,12 +132,7 @@ void Project::addBuildConfiguration(BuildConfiguration *configuration) QStringList displayNames; foreach (const BuildConfiguration *bc, m_buildConfigurationValues) displayNames << bc->displayName(); - if (displayNames.contains(configurationDisplayName)) { - int i = 2; - while (displayNames.contains(configurationDisplayName + QString::number(i))) - ++i; - configurationDisplayName += QString::number(i); - } + configurationDisplayName = makeUnique(configurationDisplayName, displayNames); configuration->setDisplayName(configurationDisplayName); // add it @@ -511,19 +513,18 @@ EditorConfiguration *Project::editorConfiguration() const void Project::setDisplayNameFor(BuildConfiguration *configuration, const QString &displayName) { + if (configuration->displayName() == displayName) + return; + QString dn = displayName; QStringList displayNames; foreach (BuildConfiguration *bc, m_buildConfigurationValues) { if (bc != configuration) displayNames << bc->displayName(); } - if (displayNames.contains(displayName)) { - int i = 2; - while (displayNames.contains(displayName + QString::number(i))) - ++i; - configuration->setDisplayName(displayName + QString::number(i)); - } else { - configuration->setDisplayName(displayName); - } + dn = makeUnique(displayName, displayNames); + + configuration->setDisplayName(displayName); + emit buildConfigurationDisplayNameChanged(configuration->name()); } diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index dbdd542d702..0df80346bbf 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -183,6 +183,7 @@ protected: virtual bool restoreSettingsImpl(PersistentSettingsReader &reader); private: + static QString makeUnique(const QString &preferedName, const QStringList &usedNames); QList m_buildSteps; QList m_cleanSteps; QMap m_values; diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 326b9ec3961..125c6c21933 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -662,15 +662,26 @@ public: /// ProjectWindow::ProjectWindow(QWidget *parent) - : QWidget(parent), m_currentItemChanged(false) + : QWidget(parent) { - m_projectExplorer = ProjectExplorerPlugin::instance(); - m_session = m_projectExplorer->session(); + ProjectExplorer::SessionManager *session = ProjectExplorerPlugin::instance()->session(); m_panelsWidget = new PanelsWidget(this); m_activeConfigurationWidget = new ActiveConfigurationWidget(m_panelsWidget); + m_panelsWidget->addWidget(tr("Active Build and Run Configurations"), m_activeConfigurationWidget); + + m_spacerBetween = new QWidget(this); + QVBoxLayout *vbox = new QVBoxLayout(m_spacerBetween); + vbox->setMargin(0); + m_spacerBetween->setLayout(vbox); + vbox->addSpacerItem(new QSpacerItem(10, 15, QSizePolicy::Fixed, QSizePolicy::Fixed)); + vbox->addWidget(new OnePixelBlackLine(m_spacerBetween)); + vbox->addSpacerItem(new QSpacerItem(10, 15, QSizePolicy::Fixed, QSizePolicy::Fixed)); + + m_panelsWidget->addWidget(m_spacerBetween); + m_projectChooser = new QWidget(m_panelsWidget); QHBoxLayout *hbox = new QHBoxLayout(m_projectChooser); hbox->setMargin(0); @@ -687,18 +698,6 @@ ProjectWindow::ProjectWindow(QWidget *parent) label, SLOT(setProject(ProjectExplorer::Project*))); hbox->addWidget(changeProject); - m_panelsWidget->addWidget(tr("Active Build and Run Configurations"), m_activeConfigurationWidget); - - m_spacerBetween = new QWidget(this); - QVBoxLayout *vbox = new QVBoxLayout(m_spacerBetween); - vbox->setMargin(0); - m_spacerBetween->setLayout(vbox); - vbox->addSpacerItem(new QSpacerItem(10, 15, QSizePolicy::Fixed, QSizePolicy::Fixed)); - vbox->addWidget(new OnePixelBlackLine(m_spacerBetween)); - vbox->addSpacerItem(new QSpacerItem(10, 15, QSizePolicy::Fixed, QSizePolicy::Fixed)); - - m_panelsWidget->addWidget(m_spacerBetween); - m_panelsWidget->addWidget(m_projectChooser); QVBoxLayout *topLevelLayout = new QVBoxLayout(this); @@ -708,17 +707,52 @@ ProjectWindow::ProjectWindow(QWidget *parent) topLevelLayout->addWidget(m_panelsWidget); + m_noprojectLabel = new QLabel(this); + m_noprojectLabel->setText(tr("No project loaded.")); + { + QFont f = m_noprojectLabel->font(); + f.setPointSizeF(f.pointSizeF() * 1.4); + f.setBold(true); + m_noprojectLabel->setFont(f); + } + m_noprojectLabel->setMargin(10); + m_noprojectLabel->setAlignment(Qt::AlignTop); + topLevelLayout->addWidget(m_noprojectLabel); + + bool noProjects = session->projects().isEmpty(); + m_panelsWidget->setVisible(!noProjects); + m_noprojectLabel->setVisible(noProjects); + connect(changeProject, SIGNAL(projectChanged(ProjectExplorer::Project*)), this, SLOT(showProperties(ProjectExplorer::Project*))); - connect(m_session, SIGNAL(sessionLoaded()), this, SLOT(restoreStatus())); - connect(m_session, SIGNAL(aboutToSaveSession()), this, SLOT(saveStatus())); + connect(session, SIGNAL(sessionLoaded()), this, SLOT(restoreStatus())); + connect(session, SIGNAL(aboutToSaveSession()), this, SLOT(saveStatus())); + + connect(session, SIGNAL(projectAdded(ProjectExplorer::Project*)), + this, SLOT(projectAdded())); + connect(session, SIGNAL(projectRemoved(ProjectExplorer::Project*)), + this, SLOT(projectRemoved())); } ProjectWindow::~ProjectWindow() { } +void ProjectWindow::projectAdded() +{ + m_panelsWidget->setVisible(true); + m_noprojectLabel->setVisible(false); +} + +void ProjectWindow::projectRemoved() +{ + if (ProjectExplorerPlugin::instance()->session()->projects().isEmpty()) { + m_panelsWidget->setVisible(false); + m_noprojectLabel->setVisible(true); + } +} + void ProjectWindow::restoreStatus() { // TODO @@ -758,12 +792,3 @@ void ProjectWindow::showProperties(Project *project) } } } - -Project *ProjectWindow::findProject(const QString &path) const -{ - QList projects = m_session->projects(); - foreach (Project* project, projects) - if (QFileInfo(project->file()->fileName()).filePath() == path) - return project; - return 0; -} diff --git a/src/plugins/projectexplorer/projectwindow.h b/src/plugins/projectexplorer/projectwindow.h index a29da6b19df..2ad04af4cbf 100644 --- a/src/plugins/projectexplorer/projectwindow.h +++ b/src/plugins/projectexplorer/projectwindow.h @@ -180,19 +180,17 @@ private slots: void showProperties(ProjectExplorer::Project *project); void restoreStatus(); void saveStatus(); + void projectAdded(); + void projectRemoved(); private: void updateRunConfigurationsComboBox(); - SessionManager *m_session; - ProjectExplorerPlugin *m_projectExplorer; ActiveConfigurationWidget *m_activeConfigurationWidget; QWidget *m_spacerBetween; QWidget *m_projectChooser; + QLabel *m_noprojectLabel; PanelsWidget *m_panelsWidget; - - Project *findProject(const QString &path) const; - bool m_currentItemChanged; }; diff --git a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp index d0417fe0d51..dca4ab11936 100644 --- a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp +++ b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp @@ -215,6 +215,15 @@ QStringList GettingStartedWelcomePageWidget::tipsOfTheDay() #else tr("Alt", "Shortcut key"); #endif + + QString ctrlShortcut = +#ifdef Q_WS_MAC + tr("Cmd", "Shortcut key"); +#else + tr("Ctrl", "Shortcut key"); +#endif + + tips.append(tr("You can switch between Qt Creator's modes using Ctrl+number:
    " "
  • 1 - Welcome
  • 2 - Edit
  • 3 - Debug
  • 4 - Projects
  • 5 - Help
  • " "
  • 6 - Output
")); @@ -236,7 +245,7 @@ QStringList GettingStartedWelcomePageWidget::tipsOfTheDay() "
  • 1 - Build Issues
  • 2 - Search Results
  • 3 - Application Output
  • " "
  • 4 - Compile Output
").arg(altShortcut)); tips.append(tr("You can quickly search methods, classes, help and more using the " - "Locator bar (Ctrl+K).")); + "Locator bar (%1+K).").arg(ctrlShortcut)); tips.append(tr("You can add custom build steps in the " "build settings.")); tips.append(tr("Within a session, you can add " diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp index 81f11124154..0ea191434fe 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp @@ -156,6 +156,24 @@ QString S60DeviceRunConfiguration::basePackageFilePath() const return m_baseFileName; } +QString S60DeviceRunConfiguration::symbianPlatform() const +{ + const_cast(this)->updateTarget(); + return m_platform; +} + +QString S60DeviceRunConfiguration::symbianTarget() const +{ + const_cast(this)->updateTarget(); + return m_target; +} + +QString S60DeviceRunConfiguration::packageTemplateFileName() const +{ + const_cast(this)->updateTarget(); + return m_packageTemplateFileName; +} + S60DeviceRunConfiguration::SigningMode S60DeviceRunConfiguration::signingMode() const { return m_signingMode; @@ -194,48 +212,17 @@ QString S60DeviceRunConfiguration::packageFileName() const return rc; } -/* Grep the pkg file for \code -; Executable and default resource files -"/S60/devices/S60_3rd_FP2_SDK_v1.1/epoc32/release/gcce/udeb/foo.exe" - "!:\sys\bin\foo.exe" -\endcode */ - -static QString localExecutableFromPkgFile(const QString &pkgFileName, QString *errorMessage) -{ - QFile pkgFile(pkgFileName); - if (!pkgFile.open(QIODevice::ReadOnly|QIODevice::Text)) { - *errorMessage = S60DeviceRunConfiguration::tr("Cannot open %1: %2").arg(pkgFileName, pkgFile.errorString()); - return QString(); - } - // "/foo.exe" - "!:\device_bin\foo.exe" - const QRegExp exePattern = QRegExp(QLatin1String("^\"([^\"]+\\.exe)\" +-.*$")); - Q_ASSERT(exePattern.isValid()); - - foreach(const QString &line, QString::fromLocal8Bit(pkgFile.readAll()).split(QLatin1Char('\n'))) { - if (exePattern.exactMatch(line)) { - QString rc = exePattern.cap(1); -#ifdef Q_OS_WIN - // Sometimes, the drive letter is missing. Use that of the pkg file - if (rc.at(0) == QLatin1Char('/')) - rc.insert(0, pkgFileName.left(2)); -#endif - return rc; - } - } - *errorMessage = S60DeviceRunConfiguration::tr("Unable to find the executable in the package file %1.").arg(pkgFileName); - return QString(); -} - QString S60DeviceRunConfiguration::localExecutableFileName() const { - const QString pkg = packageFileName(); - if (!pkg.isEmpty()) { - QString errorMessage; - const QString rc = localExecutableFromPkgFile(pkg, &errorMessage); - if (rc.isEmpty()) - qWarning("%s\n", qPrintable(errorMessage)); - return rc; - } - return QString(); + Qt4Project *qt4project = qobject_cast(project()); + S60Devices::Device device = S60Manager::instance()->deviceForQtVersion( + qt4project->qtVersion(qt4project->activeBuildConfiguration())); + + QString localExecutable = device.epocRoot; + localExecutable += QString::fromLatin1("/epoc32/release/%1/%2/%3.exe") + .arg(symbianPlatform()).arg(symbianTarget()).arg(targetName()); + qDebug() << localExecutable; + return QDir::toNativeSeparators(localExecutable); } void S60DeviceRunConfiguration::updateTarget() @@ -300,16 +287,21 @@ void S60DeviceRunConfiguration::updateTarget() m_targetName = QFileInfo(m_proFilePath).baseName(); m_baseFileName = QDir::cleanPath(m_workingDir + QLatin1Char('/') + m_targetName); + m_packageTemplateFileName = QDir::cleanPath( + m_workingDir + QLatin1Char('/') + m_targetName + QLatin1String("_template.pkg")); - if (pro->toolChainType(pro->activeBuildConfiguration()) == ToolChain::GCCE) - m_baseFileName += "_gcce"; + ToolChain::ToolChainType toolchain = pro->toolChainType(pro->activeBuildConfiguration()); + if (toolchain == ToolChain::GCCE) + m_platform = QLatin1String("gcce"); + else if (toolchain == ToolChain::RVCT_ARMV5) + m_platform = QLatin1String("armv5"); else - m_baseFileName += "_armv5"; + m_platform = QLatin1String("armv6"); if (projectBuildConfiguration & QtVersion::DebugBuild) - m_baseFileName += "_udeb"; + m_target = QLatin1String("udeb"); else - m_baseFileName += "_urel"; - + m_target = QLatin1String("urel"); + m_baseFileName += QLatin1Char('_') + m_platform + QLatin1Char('_') + m_target; delete reader; m_cachedTargetInformationValid = true; emit targetInformationChanged(); @@ -323,8 +315,9 @@ void S60DeviceRunConfiguration::invalidateCachedTargetInformation() // ======== S60DeviceRunConfigurationWidget -S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(S60DeviceRunConfiguration *runConfiguration, - QWidget *parent) +S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget( + S60DeviceRunConfiguration *runConfiguration, + QWidget *parent) : QWidget(parent), m_runConfiguration(runConfiguration) { @@ -345,7 +338,8 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(S60DeviceRunCon m_serialPorts = new QComboBox; updateSerialDevices(); - connect(S60Manager::instance()->serialDeviceLister(), SIGNAL(updated()), this, SLOT(updateSerialDevices())); + connect(S60Manager::instance()->serialDeviceLister(), SIGNAL(updated()), + this, SLOT(updateSerialDevices())); connect(m_serialPorts, SIGNAL(activated(int)), this, SLOT(setSerialPort(int))); formLayout->addRow(tr("Device on Serial Port:"), m_serialPorts); @@ -540,6 +534,9 @@ S60DeviceRunControlBase::S60DeviceRunControlBase(const QSharedPointerserialDeviceLister()->friendlyNameForPort(m_serialPortName); m_targetName = s60runConfig->targetName(); m_baseFileName = s60runConfig->basePackageFilePath(); + m_symbianPlatform = s60runConfig->symbianPlatform(); + m_symbianTarget = s60runConfig->symbianTarget(); + m_packageTemplateFile = s60runConfig->packageTemplateFileName(); m_workingDirectory = QFileInfo(m_baseFileName).absolutePath(); m_qtDir = project->qtVersion(project->activeBuildConfiguration())->versionInfo().value("QT_INSTALL_DATA"); m_useCustomSignature = (s60runConfig->signingMode() == S60DeviceRunConfiguration::SignCustom); @@ -550,7 +547,8 @@ S60DeviceRunControlBase::S60DeviceRunControlBase(const QSharedPointerlocalExecutableFileName()); m_makesisTool = m_toolsDirectory + "/makesis.exe"; - m_packageFile = QFileInfo(s60runConfig->packageFileName()).fileName(); + m_packageFilePath = s60runConfig->packageFileName(); + m_packageFile = QFileInfo(m_packageFilePath).fileName(); } void S60DeviceRunControlBase::start() @@ -560,7 +558,8 @@ void S60DeviceRunControlBase::start() emit addToOutputWindow(this, tr("Creating %1.sisx ...").arg(QDir::toNativeSeparators(m_baseFileName))); emit addToOutputWindow(this, tr("Executable file: %1").arg(m_executableFileName)); - + if (!createPackageFileFromTemplate()) + return; m_makesis->setWorkingDirectory(m_workingDirectory); emit addToOutputWindow(this, tr("%1 %2").arg(QDir::toNativeSeparators(m_makesisTool), m_packageFile)); m_makesis->start(m_makesisTool, QStringList(m_packageFile), QIODevice::ReadOnly); @@ -593,6 +592,29 @@ void S60DeviceRunControlBase::readStandardOutput() emit addToOutputWindowInline(this, QString::fromLocal8Bit(data.constData(), data.length())); } +bool S60DeviceRunControlBase::createPackageFileFromTemplate() +{ + QFile packageTemplate(m_packageTemplateFile); + if (!packageTemplate.open(QIODevice::ReadOnly)) { + error(this, tr("Could not read template package file '%1'").arg(QDir::toNativeSeparators(m_packageTemplateFile))); + emit finished(); + return false; + } + QString contents = packageTemplate.readAll(); + packageTemplate.close(); + contents.replace(QLatin1String("$(PLATFORM)"), m_symbianPlatform); + contents.replace(QLatin1String("$(TARGET)"), m_symbianTarget); + QFile packageFile(m_packageFilePath); + if (!packageFile.open(QIODevice::WriteOnly)) { + error(this, tr("Could not write package file '%1'").arg(QDir::toNativeSeparators(m_packageFilePath))); + emit finished(); + return false; + } + packageFile.write(contents.toLocal8Bit()); + packageFile.close(); + return true; +} + void S60DeviceRunControlBase::makesisProcessFailed() { processFailed("makesis.exe", m_makesis->error()); @@ -605,13 +627,13 @@ void S60DeviceRunControlBase::makesisProcessFinished() emit finished(); return; } - QString signsisTool = m_toolsDirectory + "/signsis.exe"; - QString sisFile = QFileInfo(m_baseFileName + ".sis").fileName(); - QString sisxFile = QFileInfo(m_baseFileName + ".sisx").fileName(); + QString signsisTool = m_toolsDirectory + QLatin1String("/signsis.exe"); + QString sisFile = QFileInfo(m_baseFileName + QLatin1String(".sis")).fileName(); + QString sisxFile = QFileInfo(m_baseFileName + QLatin1String(".sisx")).fileName(); QString signature = (m_useCustomSignature ? m_customSignaturePath - : m_qtDir + "/selfsigned.cer"); + : m_qtDir + QLatin1String("/src/s60installs/selfsigned.cer")); QString key = (m_useCustomSignature ? m_customKeyPath - : m_qtDir + "/selfsigned.key"); + : m_qtDir + QLatin1String("/src/s60installs/selfsigned.key")); QStringList arguments; arguments << sisFile << sisxFile << QDir::toNativeSeparators(signature) diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h index 657789a5f69..5c117d11b14 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h @@ -74,6 +74,9 @@ public: void setSerialPortName(const QString &name); QString targetName() const; QString basePackageFilePath() const; + QString symbianPlatform() const; + QString symbianTarget() const; + QString packageTemplateFileName() const; SigningMode signingMode() const; void setSigningMode(SigningMode mode); QString customSignaturePath() const; @@ -97,7 +100,10 @@ private: QString m_proFilePath; QString m_targetName; + QString m_platform; + QString m_target; QString m_baseFileName; + QString m_packageTemplateFileName; bool m_cachedTargetInformationValid; QString m_serialPortName; SigningMode m_signingMode; @@ -180,10 +186,16 @@ private slots: void launcherFinished(); private: + bool createPackageFileFromTemplate(); + QString m_serialPortName; QString m_serialPortFriendlyName; QString m_targetName; QString m_baseFileName; + QString m_symbianPlatform; + QString m_symbianTarget; + QString m_packageTemplateFile; + QString m_packageFilePath; QString m_workingDirectory; QString m_toolsDirectory; QString m_executableFileName; diff --git a/src/plugins/qt4projectmanager/qtoptionspage.cpp b/src/plugins/qt4projectmanager/qtoptionspage.cpp index 60eef5de89f..70d83b6590d 100644 --- a/src/plugins/qt4projectmanager/qtoptionspage.cpp +++ b/src/plugins/qt4projectmanager/qtoptionspage.cpp @@ -300,6 +300,11 @@ void QtOptionsPageWidget::addQtDir() m_ui->defaultCombo->addItem(newVersion->name()); m_ui->nameEdit->setFocus(); m_ui->nameEdit->selectAll(); + + if (!m_versions.at(m_defaultVersion)->isValid()) { + m_defaultVersion = m_versions.count() - 1; + m_ui->defaultCombo->setCurrentIndex(m_versions.count() - 1); + } } void QtOptionsPageWidget::removeQtDir() diff --git a/src/plugins/qt4projectmanager/qtversionmanager.ui b/src/plugins/qt4projectmanager/qtversionmanager.ui index 9905b2fe091..81d7156c4bc 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.ui +++ b/src/plugins/qt4projectmanager/qtversionmanager.ui @@ -169,7 +169,7 @@ p, li { white-space: pre-wrap; } - Path to QMake: + QMake Location: diff --git a/src/plugins/qtscripteditor/parser/cmd.sed b/src/plugins/qtscripteditor/parser/cmd.sed deleted file mode 100644 index d9ffe43a9fd..00000000000 --- a/src/plugins/qtscripteditor/parser/cmd.sed +++ /dev/null @@ -1,16 +0,0 @@ -s/#include "qscriptcontext_p.h"//g -s/#include "qscriptcontext.h"//g -s/#include "qscriptengine.h"//g -s/#include "qscriptmember_p.h"//g -s/#include "qscriptobject_p.h"//g -s/#include "qscriptvalueimpl_p.h"//g - -s/#ifndef QT_NO_SCRIPT//g -s,#endif // QT_NO_SCRIPT,,g - -s/QScript/JavaScript/g -s/QSCRIPT/JAVASCRIPT/g -s/qscript/javascript/g -s/Q_SCRIPT/J_SCRIPT/g - -s/qsreal/qjsreal/g \ No newline at end of file diff --git a/src/plugins/qtscripteditor/parser/gen.sh b/src/plugins/qtscripteditor/parser/gen.sh deleted file mode 100644 index cc4054e06ad..00000000000 --- a/src/plugins/qtscripteditor/parser/gen.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -me=$(dirname $0) - -rm -f javascript.g -rm -f javascriptast.cpp -rm -f javascriptast_p.h -rm -f javascriptastfwd_p.h -rm -f javascriptastvisitor.cpp -rm -f javascriptastvisitor_p.h -rm -f javascriptlexer.cpp -rm -f javascriptlexer_p.h -rm -f javascriptmemorypool_p.h -rm -f javascriptnodepool_p.h - -rm -f javascriptgrammar_p.h -rm -f javascriptgrammar.cpp -rm -f javascriptparser_p.h -rm -f javascriptparser.cpp - -sed -f $me/cmd.sed $QTDIR/src/script/qscript.g > javascript.g - -sed -f $me/cmd.sed $QTDIR/src/script/qscriptast.cpp > javascriptast.cpp -sed -f $me/cmd.sed $QTDIR/src/script/qscriptast_p.h > javascriptast_p.h -sed -f $me/cmd.sed $QTDIR/src/script/qscriptastfwd_p.h > javascriptastfwd_p.h -sed -f $me/cmd.sed $QTDIR/src/script/qscriptastvisitor.cpp > javascriptastvisitor.cpp -sed -f $me/cmd.sed $QTDIR/src/script/qscriptastvisitor_p.h > javascriptastvisitor_p.h -sed -f $me/cmd.sed $QTDIR/src/script/qscriptlexer_p.h > javascriptlexer_p.h -sed -f $me/cmd.sed $QTDIR/src/script/qscriptlexer.cpp > javascriptlexer.cpp -sed -f $me/cmd.sed $QTDIR/src/script/qscriptmemorypool_p.h > javascriptmemorypool_p.h -sed -f $me/cmd.sed $QTDIR/src/script/qscriptnodepool_p.h > javascriptnodepool_p.h - -qlalr --troll --no-lines --no-debug $me/javascript.g - -chmod ugo-w javascript.g -chmod ugo-w javascriptast.cpp -chmod ugo-w javascriptast_p.h -chmod ugo-w javascriptastfwd_p.h -chmod ugo-w javascriptastvisitor.cpp -chmod ugo-w javascriptastvisitor_p.h -chmod ugo-w javascriptlexer_p.h -chmod ugo-w javascriptlexer.cpp -chmod ugo-w javascriptmemorypool_p.h -chmod ugo-w javascriptnodepool_p.h - -chmod ugo-w javascriptgrammar_p.h -chmod ugo-w javascriptgrammar.cpp -chmod ugo-w javascriptparser_p.h -chmod ugo-w javascriptparser.cpp diff --git a/src/plugins/qtscripteditor/parser/javascriptgrammar.cpp b/src/plugins/qtscripteditor/parser/javascriptgrammar.cpp index 1c46c75562f..aaa8cd092b5 100644 --- a/src/plugins/qtscripteditor/parser/javascriptgrammar.cpp +++ b/src/plugins/qtscripteditor/parser/javascriptgrammar.cpp @@ -1,4 +1,45 @@ // This file was generated by qlalr - DO NOT EDIT! +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "javascriptgrammar_p.h" const char *const JavaScriptGrammar::spell [] = { diff --git a/src/plugins/qtscripteditor/parser/javascriptgrammar_p.h b/src/plugins/qtscripteditor/parser/javascriptgrammar_p.h index 8e62d4abd06..3126ed08cf1 100644 --- a/src/plugins/qtscripteditor/parser/javascriptgrammar_p.h +++ b/src/plugins/qtscripteditor/parser/javascriptgrammar_p.h @@ -2,13 +2,41 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/plugins/qtscripteditor/parser/javascriptparser.cpp b/src/plugins/qtscripteditor/parser/javascriptparser.cpp index 66acc68e6b1..b63a9fbe93a 100644 --- a/src/plugins/qtscripteditor/parser/javascriptparser.cpp +++ b/src/plugins/qtscripteditor/parser/javascriptparser.cpp @@ -1122,7 +1122,7 @@ case 266: { token_buffer[1].dval = yylval = lexer->dval(); token_buffer[1].loc = yylloc = location(lexer); - if (t_action(errorState, yytoken)) { + if (token_buffer[0].token != -1 && t_action(errorState, yytoken)) { QString msg = QString::fromUtf8("Removed token"); if (const char *tokenSpell = spell[token_buffer[0].token]) { msg += QLatin1String(": `"); diff --git a/src/plugins/texteditor/displaysettings.cpp b/src/plugins/texteditor/displaysettings.cpp index 5399f04fb22..0906a9016fd 100644 --- a/src/plugins/texteditor/displaysettings.cpp +++ b/src/plugins/texteditor/displaysettings.cpp @@ -40,7 +40,7 @@ static const char * const showWrapColumnKey = "ShowWrapColumn"; static const char * const wrapColumnKey = "WrapColumn"; static const char * const visualizeWhitespaceKey = "VisualizeWhitespace"; static const char * const displayFoldingMarkersKey = "DisplayFoldingMarkers"; -static const char * const highlightCurrentLineKey = "HighlightCurrentLineKeyV2"; +static const char * const highlightCurrentLineKey = "HighlightCurrentLineKey"; static const char * const highlightBlocksKey = "HighlightBlocksKey"; static const char * const animateMatchingParenthesesKey= "AnimateMatchingParenthesesKey"; static const char * const mouseNavigationKey = "MouseNavigation"; @@ -56,7 +56,7 @@ DisplaySettings::DisplaySettings() : m_wrapColumn(80), m_visualizeWhitespace(false), m_displayFoldingMarkers(true), - m_highlightCurrentLine(false), + m_highlightCurrentLine(true), m_highlightBlocks(false), m_animateMatchingParentheses(true), m_mouseNavigation(true), diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index ee16c23ac6f..c998bf3d185 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -251,7 +251,6 @@ void TextEditorActionHandler::createActions() m_selectBlockDownAction= new QAction(tr("Select Block Down"), this); command = am->registerAction(m_selectBlockDownAction, Constants::SELECT_BLOCK_DOWN, m_contextId); - command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U"))); connect(m_selectBlockDownAction, SIGNAL(triggered()), this, SLOT(selectBlockDown())); advancedMenu->addAction(command, Core::Constants::G_EDIT_BLOCKS); diff --git a/src/shared/cplusplus/CPlusPlusForwardDeclarations.h b/src/shared/cplusplus/CPlusPlusForwardDeclarations.h index 2467d4c56b0..b060f11dfa5 100644 --- a/src/shared/cplusplus/CPlusPlusForwardDeclarations.h +++ b/src/shared/cplusplus/CPlusPlusForwardDeclarations.h @@ -83,7 +83,6 @@ class Semantic; class Control; class MemoryPool; class DiagnosticClient; -class MacroResolver; class Identifier; class Literal; diff --git a/src/shared/cplusplus/Control.cpp b/src/shared/cplusplus/Control.cpp index 6338d99fd22..30c5552bbe8 100644 --- a/src/shared/cplusplus/Control.cpp +++ b/src/shared/cplusplus/Control.cpp @@ -59,11 +59,6 @@ CPLUSPLUS_BEGIN_NAMESPACE -MacroResolver::MacroResolver() -{ } - -MacroResolver::~MacroResolver() -{ } template static void delete_map_entries(_Iterator first, _Iterator last) @@ -93,8 +88,7 @@ public: Data(Control *control) : control(control), translationUnit(0), - diagnosticClient(0), - macroResolver(0) + diagnosticClient(0) { } ~Data() @@ -539,7 +533,6 @@ public: Control *control; TranslationUnit *translationUnit; DiagnosticClient *diagnosticClient; - MacroResolver *macroResolver; LiteralTable identifiers; LiteralTable stringLiterals; LiteralTable numericLiterals; @@ -602,12 +595,6 @@ TranslationUnit *Control::switchTranslationUnit(TranslationUnit *unit) return previousTranslationUnit; } -MacroResolver *Control::macroResolver() const -{ return d->macroResolver; } - -void Control::setMacroResolver(MacroResolver *macroResolver) -{ d->macroResolver = macroResolver; } - DiagnosticClient *Control::diagnosticClient() const { return d->diagnosticClient; } diff --git a/src/shared/cplusplus/Control.h b/src/shared/cplusplus/Control.h index 060be182b68..9a41629feaa 100644 --- a/src/shared/cplusplus/Control.h +++ b/src/shared/cplusplus/Control.h @@ -55,18 +55,6 @@ CPLUSPLUS_BEGIN_HEADER CPLUSPLUS_BEGIN_NAMESPACE -class CPLUSPLUS_EXPORT MacroResolver -{ - MacroResolver(const MacroResolver &other); - void operator = (const MacroResolver &other); - -public: - MacroResolver(); - virtual ~MacroResolver(); - - virtual bool isMacro(TranslationUnit *unit, unsigned tokenIndex) const = 0; -}; - class CPLUSPLUS_EXPORT Control { public: @@ -76,9 +64,6 @@ public: TranslationUnit *translationUnit() const; TranslationUnit *switchTranslationUnit(TranslationUnit *unit); - MacroResolver *macroResolver() const; - void setMacroResolver(MacroResolver *macroResolver); - DiagnosticClient *diagnosticClient() const; void setDiagnosticClient(DiagnosticClient *diagnosticClient); diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index d335b5ebfff..958d740a587 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -244,14 +244,6 @@ void Parser::match(int kind, unsigned *token) } } -bool Parser::isMacro(unsigned tokenIndex) const -{ - if (MacroResolver *r = _control->macroResolver()) - return r->isMacro(_translationUnit, tokenIndex); - - return false; -} - bool Parser::parseClassOrNamespaceName(NameAST *&node) { if (LA() == T_IDENTIFIER) { @@ -2561,10 +2553,6 @@ bool Parser::parseBuiltinTypeSpecifier(SpecifierAST *&node) bool Parser::parseSimpleDeclaration(DeclarationAST *&node, bool acceptStructDeclarator) { - if (LA() == T_IDENTIFIER && isMacro(cursor())) { - // printf("***** found macro reference `%s'\n", tok().identifier->chars()); - } - unsigned qt_invokable_token = 0; if (acceptStructDeclarator && (LA() == T_Q_SIGNAL || LA() == T_Q_SLOT)) qt_invokable_token = consumeToken(); diff --git a/src/shared/cplusplus/Parser.h b/src/shared/cplusplus/Parser.h index 1bd6700f537..2f274e93ab5 100644 --- a/src/shared/cplusplus/Parser.h +++ b/src/shared/cplusplus/Parser.h @@ -286,8 +286,6 @@ private: inline void rewind(unsigned cursor) { _tokenIndex = cursor; } - bool isMacro(unsigned tokenIndex) const; - private: TranslationUnit *_translationUnit; Control *_control;