diff options
Diffstat (limited to 'src')
117 files changed, 892 insertions, 579 deletions
diff --git a/src/app/Info.plist b/src/app/Info.plist index 36af61b2b5..8f80b242ba 100644 --- a/src/app/Info.plist +++ b/src/app/Info.plist @@ -219,8 +219,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <key>CFBundleIdentifier</key> <string>com.nokia.qtcreator</string> <key>CFBundleVersion</key> - <string>2.0.80</string> + <string>2.1.0</string> <key>CFBundleShortVersionString</key> - <string>2.0.80</string> + <string>2.1.0</string> </dict> </plist> diff --git a/src/plugins/bineditor/BinEditor.pluginspec b/src/plugins/bineditor/BinEditor.pluginspec index 46026e0ec2..cf8343269f 100644 --- a/src/plugins/bineditor/BinEditor.pluginspec +++ b/src/plugins/bineditor/BinEditor.pluginspec @@ -1,4 +1,4 @@ -<plugin name="BinEditor" version="2.0.80" compatVersion="2.0.80"> +<plugin name="BinEditor" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,7 +14,7 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Binary editor component.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> - <dependency name="TextEditor" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="TextEditor" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index cca1c9c1e4..e0c0065a63 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -193,10 +193,12 @@ public: virtual QString mimeType() const { return m_mimeType; } bool save(const QString &fileName = QString()) { - if (m_editor->save(m_fileName, fileName)) { - m_fileName = fileName; + const QString fileNameToUse + = fileName.isEmpty() ? m_fileName : fileName; + if (m_editor->save(m_fileName, fileNameToUse)) { + m_fileName = fileNameToUse; m_editor->editorInterface()-> - setDisplayName(QFileInfo(fileName).fileName()); + setDisplayName(QFileInfo(fileNameToUse).fileName()); emit changed(); return true; } else { @@ -210,13 +212,12 @@ public: && file.open(QIODevice::ReadOnly)) { m_fileName = fileName; qint64 maxRange = 64 * 1024 * 1024; - if (file.size() <= maxRange) { + if (file.size() <= maxRange) m_editor->setData(file.readAll()); - } else { + else m_editor->setLazyData(offset, maxRange); - m_editor->editorInterface()-> - setDisplayName(QFileInfo(fileName).fileName()); - } + m_editor->editorInterface()-> + setDisplayName(QFileInfo(fileName).fileName()); file.close(); return true; } diff --git a/src/plugins/bookmarks/Bookmarks.pluginspec b/src/plugins/bookmarks/Bookmarks.pluginspec index fa3c0942fa..e9c950e158 100644 --- a/src/plugins/bookmarks/Bookmarks.pluginspec +++ b/src/plugins/bookmarks/Bookmarks.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Bookmarks" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Bookmarks" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,8 +14,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Bookmarks in text editors.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="Core" version="2.0.80"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="Core" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec b/src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec index 6e1222c2d7..c91166d3b9 100644 --- a/src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec +++ b/src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec @@ -1,4 +1,4 @@ -<plugin name="CMakeProjectManager" version="2.0.80" compatVersion="2.0.80"> +<plugin name="CMakeProjectManager" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,9 +14,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>CMake support</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="CppTools" version="2.0.80"/> - <dependency name="CppEditor" version="2.0.80"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="CppTools" version="2.1.0"/> + <dependency name="CppEditor" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/coreplugin/Core.pluginspec b/src/plugins/coreplugin/Core.pluginspec index ae65cb2cee..29e67c523a 100644 --- a/src/plugins/coreplugin/Core.pluginspec +++ b/src/plugins/coreplugin/Core.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Core" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Core" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h index 9bce32adc1..99b7e50c37 100644 --- a/src/plugins/coreplugin/coreconstants.h +++ b/src/plugins/coreplugin/coreconstants.h @@ -36,8 +36,8 @@ namespace Core { namespace Constants { #define IDE_VERSION_MAJOR 2 -#define IDE_VERSION_MINOR 0 -#define IDE_VERSION_RELEASE 80 +#define IDE_VERSION_MINOR 1 +#define IDE_VERSION_RELEASE 0 #define STRINGIFY_INTERNAL(x) #x #define STRINGIFY(x) STRINGIFY_INTERNAL(x) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index a296741aa0..bd3e07c67a 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1628,7 +1628,10 @@ void EditorManager::showPopupOrSelectDocument() const if (QApplication::keyboardModifiers() == Qt::NoModifier) { windowPopup()->selectAndHide(); } else { - const QPoint p(mapToGlobal(QPoint(0, 0))); + // EditorManager is invisible when invoked from Design Mode. + const QPoint p = isVisible() ? + mapToGlobal(QPoint(0, 0)) : + m_d->m_core->mainWindow()->mapToGlobal(QPoint(0, 0)); windowPopup()->move((width()-m_d->m_windowPopup->width())/2 + p.x(), (height()-m_d->m_windowPopup->height())/2 + p.y()); windowPopup()->setVisible(true); diff --git a/src/plugins/cpaster/CodePaster.pluginspec b/src/plugins/cpaster/CodePaster.pluginspec index cff88e5ab6..2e3d4af1ba 100644 --- a/src/plugins/cpaster/CodePaster.pluginspec +++ b/src/plugins/cpaster/CodePaster.pluginspec @@ -1,4 +1,4 @@ -<plugin name="CodePaster" version="2.0.80" compatVersion="2.0.80"> +<plugin name="CodePaster" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -13,8 +13,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Codepaster plugin for pushing/fetching diff from server</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="Core" version="2.0.80"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="Core" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index 47cbf0091b..e3a17c01d9 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -351,6 +351,8 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription, // Keep the file and store in list of files to be removed. tempFile->setAutoRemove(false); const QString fileName = tempFile->fileName(); + // Discard to temporary file to make sure it is closed and no changes are triggered. + tempFile = TemporaryFilePtr(); m_fetchedSnippets.push_back(fileName); // Open editor with title. Core::IEditor* editor = EditorManager::instance()->openEditor(fileName); diff --git a/src/plugins/cppeditor/CppEditor.pluginspec b/src/plugins/cppeditor/CppEditor.pluginspec index ab6a8a4235..c777b2531e 100644 --- a/src/plugins/cppeditor/CppEditor.pluginspec +++ b/src/plugins/cppeditor/CppEditor.pluginspec @@ -1,4 +1,4 @@ -<plugin name="CppEditor" version="2.0.80" compatVersion="2.0.80"> +<plugin name="CppEditor" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,8 +14,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>C/C++ editor component.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="CppTools" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="CppTools" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 6d0a06bf61..e18887104b 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -605,7 +605,7 @@ CPPEditorEditable::CPPEditorEditable(CPPEditor *editor) CPPEditor::CPPEditor(QWidget *parent) : TextEditor::BaseTextEditor(parent) - , m_currentRenameSelection(-1) + , m_currentRenameSelection(NoCurrentRenameSelection) , m_inRename(false) , m_inRenameChanged(false) , m_firstRenameChange(false) @@ -712,7 +712,7 @@ void CPPEditor::createToolBar(CPPEditorEditable *editable) void CPPEditor::paste() { - if (m_currentRenameSelection == -1) { + if (m_currentRenameSelection == NoCurrentRenameSelection) { BaseTextEditor::paste(); return; } @@ -724,7 +724,7 @@ void CPPEditor::paste() void CPPEditor::cut() { - if (m_currentRenameSelection == -1) { + if (m_currentRenameSelection == NoCurrentRenameSelection) { BaseTextEditor::cut(); return; } @@ -772,10 +772,10 @@ void CPPEditor::finishRename() void CPPEditor::abortRename() { - if (m_currentRenameSelection < 0) + if (m_currentRenameSelection <= NoCurrentRenameSelection) return; m_renameSelections[m_currentRenameSelection].format = m_occurrencesFormat; - m_currentRenameSelection = -1; + m_currentRenameSelection = NoCurrentRenameSelection; m_currentRenameSelectionBegin = QTextCursor(); m_currentRenameSelectionEnd = QTextCursor(); setExtraSelections(CodeSemanticsSelection, m_renameSelections); @@ -986,7 +986,7 @@ void CPPEditor::onContentsChanged(int position, int charsRemoved, int charsAdded { Q_UNUSED(position) - if (m_currentRenameSelection == -1 || m_inRename) + if (m_currentRenameSelection == NoCurrentRenameSelection || m_inRename) return; if (position + charsAdded == m_currentRenameSelectionBegin.position()) { @@ -1125,7 +1125,7 @@ void CPPEditor::updateUses() void CPPEditor::updateUsesNow() { - if (m_currentRenameSelection != -1) + if (m_currentRenameSelection != NoCurrentRenameSelection) return; semanticRehighlight(); @@ -1735,7 +1735,7 @@ bool CPPEditor::event(QEvent *e) { switch (e->type()) { case QEvent::ShortcutOverride: - if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Escape && m_currentRenameSelection != -1) { + if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Escape && m_currentRenameSelection != NoCurrentRenameSelection) { e->accept(); return true; } @@ -1801,7 +1801,7 @@ void CPPEditor::contextMenuEvent(QContextMenuEvent *e) void CPPEditor::keyPressEvent(QKeyEvent *e) { - if (m_currentRenameSelection == -1) { + if (m_currentRenameSelection == NoCurrentRenameSelection) { TextEditor::BaseTextEditor::keyPressEvent(e); return; } @@ -2006,6 +2006,7 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo) QList<QTextEdit::ExtraSelection> unusedSelections; m_renameSelections.clear(); + m_currentRenameSelection = NoCurrentRenameSelection; SemanticInfo::LocalUseIterator it(semanticInfo.localUses); while (it.hasNext()) { diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h index fb5758c584..76adbf6cf8 100644 --- a/src/plugins/cppeditor/cppeditor.h +++ b/src/plugins/cppeditor/cppeditor.h @@ -292,6 +292,7 @@ private: QList<QTextEdit::ExtraSelection> m_renameSelections; int m_currentRenameSelection; + static const int NoCurrentRenameSelection = -1; bool m_inRename, m_inRenameChanged, m_firstRenameChange; QTextCursor m_currentRenameSelectionBegin; QTextCursor m_currentRenameSelectionEnd; diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp index 894e27a72e..4abc903ec1 100644 --- a/src/plugins/cppeditor/cpphoverhandler.cpp +++ b/src/plugins/cppeditor/cpphoverhandler.cpp @@ -61,6 +61,8 @@ #include <QtGui/QToolTip> #include <QtGui/QTextCursor> #include <QtGui/QTextBlock> +#include <QtGui/QApplication> +#include <QtGui/QDesktopWidget> using namespace CppEditor::Internal; using namespace CPlusPlus; @@ -105,7 +107,7 @@ void CppHoverHandler::showToolTip(TextEditor::ITextEditor *editor, const QPoint if (core->hasContext(dbgcontext)) return; - updateHelpIdAndTooltip(editor, pos); + updateHelpIdAndTooltip(editor, pos, QApplication::desktop()->screenNumber(point)); if (m_toolTip.isEmpty()) QToolTip::hideText(); @@ -238,7 +240,9 @@ static FullySpecifiedType resolve(const FullySpecifiedType &ty, return ty; } -void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, int pos) +void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, + int pos, + const int screen) { m_helpId.clear(); m_toolTip.clear(); @@ -395,16 +399,36 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in if (!formatTooltip.isEmpty()) m_toolTip = formatTooltip; + const int tipWidth = QFontMetrics(QToolTip::font()).width(m_toolTip); + bool preventWrapping = true; + + if (screen != -1) { +#ifdef Q_WS_MAC + int screenWidth = QApplication::desktop()->availableGeometry(screen).width(); +#else + int screenWidth = QApplication::desktop()->screenGeometry(screen).width(); +#endif + if (tipWidth > screenWidth * .8) + preventWrapping = false; + } + if (!m_helpId.isEmpty() && !helpLinks.isEmpty()) { if (showF1) { - // we need the original width without escape sequences - const int width = QFontMetrics(QToolTip::font()).width(m_toolTip); - m_toolTip = QString(QLatin1String("<table><tr><td valign=middle width=%2>%1</td>" - "<td><img src=\":/cppeditor/images/f1.png\"></td></tr></table>")) - .arg(Qt::escape(m_toolTip)).arg(width); + if (preventWrapping) { + m_toolTip = QString(QLatin1String("<table><tr><td valign=middle width=%2>%1</td>" + "<td><img src=\":/cppeditor/images/f1.png\"></td></tr></table>")) + .arg(Qt::escape(m_toolTip)).arg(tipWidth); + } else { + m_toolTip = QString(QLatin1String("<table><tr><td valign=middle>%1</td>" + "<td><img src=\":/cppeditor/images/f1.png\"></td></tr></table>")) + .arg(Qt::escape(m_toolTip)); + } } editor->setContextHelpId(m_helpId); - } else if (!m_toolTip.isEmpty() && Qt::mightBeRichText(m_toolTip)) { - m_toolTip = QString(QLatin1String("<nobr>%1</nobr>")).arg(Qt::escape(m_toolTip)); + } else if (!m_toolTip.isEmpty()) { + if (preventWrapping) + m_toolTip = QString(QLatin1String("<table><tr><td width=%2>%1</td></tr></table>")).arg(Qt::escape(m_toolTip)).arg(tipWidth); + else if (!Qt::mightBeRichText(m_toolTip)) + m_toolTip = QString(QLatin1String("<p>%1</p>")).arg(Qt::escape(m_toolTip)); } } diff --git a/src/plugins/cppeditor/cpphoverhandler.h b/src/plugins/cppeditor/cpphoverhandler.h index 311b829223..3e8fa960f1 100644 --- a/src/plugins/cppeditor/cpphoverhandler.h +++ b/src/plugins/cppeditor/cpphoverhandler.h @@ -66,7 +66,7 @@ private slots: void editorOpened(Core::IEditor *editor); private: - void updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, int pos); + void updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, int pos, const int screen = -1); CppTools::CppModelManagerInterface *m_modelManager; QString m_helpId; diff --git a/src/plugins/cpptools/CppTools.pluginspec b/src/plugins/cpptools/CppTools.pluginspec index d43d7b9a8c..e3dbb78bd1 100644 --- a/src/plugins/cpptools/CppTools.pluginspec +++ b/src/plugins/cpptools/CppTools.pluginspec @@ -1,4 +1,4 @@ -<plugin name="CppTools" version="2.0.80" compatVersion="2.0.80"> +<plugin name="CppTools" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,8 +14,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Tools for analyzing C/C++ code.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="Locator" version="2.0.80"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="Locator" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/cvs/CVS.pluginspec b/src/plugins/cvs/CVS.pluginspec index 5a72984811..7bf2753fb7 100644 --- a/src/plugins/cvs/CVS.pluginspec +++ b/src/plugins/cvs/CVS.pluginspec @@ -1,4 +1,4 @@ -<plugin name="CVS" version="2.0.80" compatVersion="2.0.80"> +<plugin name="CVS" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,9 +14,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>CVS integration.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="Core" version="2.0.80"/> - <dependency name="VCSBase" version="2.0.80"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="VCSBase" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/debugger/Debugger.pluginspec b/src/plugins/debugger/Debugger.pluginspec index 18f56e3a38..95813fd485 100644 --- a/src/plugins/debugger/Debugger.pluginspec +++ b/src/plugins/debugger/Debugger.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Debugger" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Debugger" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,10 +14,10 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Debugger integration.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="CppEditor" version="2.0.80"/><!-- Debugger plugin adds items to the editor's context menu --> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="Core" version="2.0.80"/> - <dependency name="Find" version="2.0.80"/> + <dependency name="CppEditor" version="2.1.0"/><!-- Debugger plugin adds items to the editor's context menu --> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="Find" version="2.1.0"/> </dependencyList> <argumentList> <argument name="-disable-cdb">Disable Cdb debugger engine</argument> diff --git a/src/plugins/debugger/cdb/cdbdebugengine.cpp b/src/plugins/debugger/cdb/cdbdebugengine.cpp index 30b8514a13..5051885346 100644 --- a/src/plugins/debugger/cdb/cdbdebugengine.cpp +++ b/src/plugins/debugger/cdb/cdbdebugengine.cpp @@ -391,6 +391,7 @@ void CdbDebugEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> dumperEnabled = false; } } + m_d->m_dumper->setFastSymbolResolution(m_d->m_options->fastLoadDebuggingHelpers); m_d->m_dumper->reset(dumperLibName, dumperEnabled); setState(InferiorStarting, Q_FUNC_INFO, __LINE__); diff --git a/src/plugins/debugger/cdb/cdbdumperhelper.cpp b/src/plugins/debugger/cdb/cdbdumperhelper.cpp index 624a776bec..46429bab5d 100644 --- a/src/plugins/debugger/cdb/cdbdumperhelper.cpp +++ b/src/plugins/debugger/cdb/cdbdumperhelper.cpp @@ -307,7 +307,8 @@ CdbDumperHelper::CdbDumperHelper(DebuggerManager *manager, m_outBufferSize(0), m_buffer(0), m_dumperCallThread(0), - m_goCommand(goCommand(m_dumperCallThread)) + m_goCommand(goCommand(m_dumperCallThread)), + m_fastSymbolResolution(true) { } @@ -435,19 +436,29 @@ static inline bool getSymbolAddress(CIDebugSymbols *sg, bool CdbDumperHelper::initResolveSymbols(QString *errorMessage) { - // Resolve the symbols we need (potentially namespaced). + // Resolve the symbols we need. // There is a 'qDumpInBuffer' in QtCore as well. if (loadDebug) qDebug() << Q_FUNC_INFO; - m_dumpObjectSymbol = QLatin1String("*qDumpObjectData440"); - QString inBufferSymbol = QLatin1String("*qDumpInBuffer"); - QString outBufferSymbol = QLatin1String("*qDumpOutBuffer"); + bool rc; const QString dumperModuleName = QLatin1String(dumperModuleNameC); - bool rc = resolveSymbol(m_coreEngine->interfaces().debugSymbols, &m_dumpObjectSymbol, errorMessage) == ResolveSymbolOk - && resolveSymbol(m_coreEngine->interfaces().debugSymbols, dumperModuleName, &inBufferSymbol, errorMessage) == ResolveSymbolOk - && resolveSymbol(m_coreEngine->interfaces().debugSymbols, dumperModuleName, &outBufferSymbol, errorMessage) == ResolveSymbolOk; - if (!rc) - return false; + QString inBufferSymbol, outBufferSymbol; + if (m_fastSymbolResolution) { + // Symbols in the debugging helpers are never namespaced. + m_dumpObjectSymbol = dumperModuleName + QLatin1String("!qDumpObjectData440"); + inBufferSymbol = dumperModuleName + QLatin1String("!qDumpInBuffer"); + outBufferSymbol = dumperModuleName + QLatin1String("!qDumpOutBuffer"); + } else { + // Classical approach of loading the dumper symbols. Takes some time though. + m_dumpObjectSymbol = QLatin1String("*qDumpObjectData440"); + inBufferSymbol = QLatin1String("*qDumpInBuffer"); + outBufferSymbol = QLatin1String("*qDumpOutBuffer"); + bool rc = resolveSymbol(m_coreEngine->interfaces().debugSymbols, &m_dumpObjectSymbol, errorMessage) == ResolveSymbolOk + && resolveSymbol(m_coreEngine->interfaces().debugSymbols, dumperModuleName, &inBufferSymbol, errorMessage) == ResolveSymbolOk + && resolveSymbol(m_coreEngine->interfaces().debugSymbols, dumperModuleName, &outBufferSymbol, errorMessage) == ResolveSymbolOk; + if (!rc) + return false; + } // Determine buffer addresses, sizes and alloc buffer rc = getSymbolAddress(m_coreEngine->interfaces().debugSymbols, inBufferSymbol, &m_inBufferAddress, &m_inBufferSize, errorMessage) && getSymbolAddress(m_coreEngine->interfaces().debugSymbols, outBufferSymbol, &m_outBufferAddress, &m_outBufferSize, errorMessage); diff --git a/src/plugins/debugger/cdb/cdbdumperhelper.h b/src/plugins/debugger/cdb/cdbdumperhelper.h index a7742685e8..04eca802bf 100644 --- a/src/plugins/debugger/cdb/cdbdumperhelper.h +++ b/src/plugins/debugger/cdb/cdbdumperhelper.h @@ -92,6 +92,8 @@ public: State state() const { return m_state; } bool isEnabled() const { return m_state != Disabled; } + void setFastSymbolResolution(bool b) { m_fastSymbolResolution = b; } + // Disable in case of a debuggee crash. void disable(); @@ -156,6 +158,7 @@ private: QtDumperHelper m_helper; unsigned long m_dumperCallThread; QString m_goCommand; + bool m_fastSymbolResolution; }; } // namespace Internal diff --git a/src/plugins/debugger/cdb/cdboptions.cpp b/src/plugins/debugger/cdb/cdboptions.cpp index fda335be03..5be73f90d7 100644 --- a/src/plugins/debugger/cdb/cdboptions.cpp +++ b/src/plugins/debugger/cdb/cdboptions.cpp @@ -40,13 +40,15 @@ static const char *pathKeyC = "Path"; static const char *symbolPathsKeyC = "SymbolPaths"; static const char *sourcePathsKeyC = "SourcePaths"; static const char *verboseSymbolLoadingKeyC = "VerboseSymbolLoading"; +static const char *fastLoadDebuggingHelpersKeyC = "FastLoadDebuggingHelpers"; namespace Debugger { namespace Internal { CdbOptions::CdbOptions() : enabled(false), - verboseSymbolLoading(false) + verboseSymbolLoading(false), + fastLoadDebuggingHelpers(true) { } @@ -54,6 +56,7 @@ void CdbOptions::clear() { enabled = false; verboseSymbolLoading = false; + fastLoadDebuggingHelpers = true; path.clear(); } @@ -74,6 +77,7 @@ void CdbOptions::fromSettings(const QSettings *s) symbolPaths = s->value(keyRoot + QLatin1String(symbolPathsKeyC), QStringList()).toStringList(); sourcePaths = s->value(keyRoot + QLatin1String(sourcePathsKeyC), QStringList()).toStringList(); verboseSymbolLoading = s->value(keyRoot + QLatin1String(verboseSymbolLoadingKeyC), false).toBool(); + fastLoadDebuggingHelpers = s->value(keyRoot + QLatin1String(fastLoadDebuggingHelpersKeyC), true).toBool(); } void CdbOptions::toSettings(QSettings *s) const @@ -84,6 +88,7 @@ void CdbOptions::toSettings(QSettings *s) const s->setValue(QLatin1String(symbolPathsKeyC), symbolPaths); s->setValue(QLatin1String(sourcePathsKeyC), sourcePaths); s->setValue(QLatin1String(verboseSymbolLoadingKeyC), verboseSymbolLoading); + s->setValue(QLatin1String(fastLoadDebuggingHelpersKeyC), fastLoadDebuggingHelpers); s->endGroup(); } @@ -96,6 +101,8 @@ unsigned CdbOptions::compare(const CdbOptions &rhs) const rc |= DebuggerPathsChanged; if (verboseSymbolLoading != rhs.verboseSymbolLoading) rc |= SymbolOptionsChanged; + if (fastLoadDebuggingHelpers != rhs.fastLoadDebuggingHelpers) + rc |= FastLoadDebuggingHelpersChanged; return rc; } diff --git a/src/plugins/debugger/cdb/cdboptions.h b/src/plugins/debugger/cdb/cdboptions.h index cb7bd07ef2..0428341dcc 100644 --- a/src/plugins/debugger/cdb/cdboptions.h +++ b/src/plugins/debugger/cdb/cdboptions.h @@ -51,7 +51,8 @@ public: // A set of flags for comparison function. enum ChangeFlags { InitializationOptionsChanged = 0x1, DebuggerPathsChanged = 0x2, - SymbolOptionsChanged = 0x4 }; + SymbolOptionsChanged = 0x4, + FastLoadDebuggingHelpersChanged = 0x8 }; unsigned compare(const CdbOptions &s) const; bool enabled; @@ -59,6 +60,7 @@ public: QStringList symbolPaths; QStringList sourcePaths; bool verboseSymbolLoading; + bool fastLoadDebuggingHelpers; }; inline bool operator==(const CdbOptions &s1, const CdbOptions &s2) diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp index 4804a242ae..efae5a75f6 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.cpp +++ b/src/plugins/debugger/cdb/cdboptionspage.cpp @@ -85,7 +85,7 @@ void CdbOptionsPageWidget::setOptions(CdbOptions &o) m_ui.symbolPathListEditor->setPathList(o.symbolPaths); m_ui.sourcePathListEditor->setPathList(o.sourcePaths); m_ui.verboseSymbolLoadingCheckBox->setChecked(o.verboseSymbolLoading); - + m_ui.fastLoadDebuggingHelpersCheckBox->setChecked(o.fastLoadDebuggingHelpers); } CdbOptions CdbOptionsPageWidget::options() const @@ -96,6 +96,7 @@ CdbOptions CdbOptionsPageWidget::options() const rc.symbolPaths = m_ui.symbolPathListEditor->pathList(); rc.sourcePaths = m_ui.sourcePathListEditor->pathList(); rc.verboseSymbolLoading = m_ui.verboseSymbolLoadingCheckBox->isChecked(); + rc.fastLoadDebuggingHelpers = m_ui.fastLoadDebuggingHelpersCheckBox->isChecked(); return rc; } @@ -132,7 +133,8 @@ QString CdbOptionsPageWidget::searchKeywords() const QString rc; QTextStream(&rc) << m_ui.pathLabel->text() << ' ' << m_ui.symbolPathLabel->text() << ' ' << m_ui.sourcePathLabel->text() - << ' ' << m_ui.verboseSymbolLoadingCheckBox->text(); + << ' ' << m_ui.verboseSymbolLoadingCheckBox->text() + << ' ' << m_ui.fastLoadDebuggingHelpersCheckBox->text(); rc.remove(QLatin1Char('&')); return rc; } diff --git a/src/plugins/debugger/cdb/cdboptionspagewidget.ui b/src/plugins/debugger/cdb/cdboptionspagewidget.ui index c84109e3a7..26bbd3b900 100644 --- a/src/plugins/debugger/cdb/cdboptionspagewidget.ui +++ b/src/plugins/debugger/cdb/cdboptionspagewidget.ui @@ -85,6 +85,9 @@ <string>Other Options</string> </property> <layout class="QFormLayout" name="formLayout_3"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::AllNonFixedFieldsGrow</enum> + </property> <item row="0" column="0" colspan="2"> <widget class="QCheckBox" name="verboseSymbolLoadingCheckBox"> <property name="text"> @@ -92,6 +95,13 @@ </property> </widget> </item> + <item row="1" column="0"> + <widget class="QCheckBox" name="fastLoadDebuggingHelpersCheckBox"> + <property name="text"> + <string>Fast loading of debugging helpers</string> + </property> + </widget> + </item> </layout> </widget> </item> diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index 6bfa9b973e..f7ccd6ad4b 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -1731,7 +1731,8 @@ static bool isAllowedTransition(int from, int to) case InferiorStarting: return to == InferiorRunningRequested || to == InferiorStopped - || to == InferiorStartFailed || to == InferiorUnrunnable; + || to == InferiorStartFailed || to == InferiorUnrunnable + || to == InferiorRunning; case InferiorStartFailed: return to == EngineShuttingDown; diff --git a/src/plugins/debugger/debuggeruiswitcher.cpp b/src/plugins/debugger/debuggeruiswitcher.cpp index a7db1101a7..2c9b2237e2 100644 --- a/src/plugins/debugger/debuggeruiswitcher.cpp +++ b/src/plugins/debugger/debuggeruiswitcher.cpp @@ -153,6 +153,11 @@ DebuggerUISwitcher::~DebuggerUISwitcher() delete d; } +QStringList DebuggerUISwitcher::supportedLanguages() const +{ + return d->m_languages; +} + void DebuggerUISwitcher::addMenuAction(Core::Command *command, const QString &langName, const QString &group) { diff --git a/src/plugins/debugger/debuggeruiswitcher.h b/src/plugins/debugger/debuggeruiswitcher.h index 52a4e1cb3a..522d5fd61a 100644 --- a/src/plugins/debugger/debuggeruiswitcher.h +++ b/src/plugins/debugger/debuggeruiswitcher.h @@ -77,6 +77,8 @@ public: void addMenuAction(Core::Command *command, const QString &langName, const QString &group = QString()); + QStringList supportedLanguages() const; + // Changes the active language UI to the one specified by langName. // Does nothing if automatic switching is toggled off from settings. void setActiveLanguage(const QString &langName); diff --git a/src/plugins/debugger/gdb/attachgdbadapter.cpp b/src/plugins/debugger/gdb/attachgdbadapter.cpp index 6ef72a1b29..821afb391f 100644 --- a/src/plugins/debugger/gdb/attachgdbadapter.cpp +++ b/src/plugins/debugger/gdb/attachgdbadapter.cpp @@ -78,7 +78,7 @@ void AttachGdbAdapter::startInferior() void AttachGdbAdapter::handleAttach(const GdbResponse &response) { QTC_ASSERT(state() == InferiorStarting, qDebug() << state()); - if (response.resultClass == GdbResultDone) { + if (response.resultClass == GdbResultDone || response.resultClass == GdbResultRunning) { setState(InferiorStopped); debugMessage(_("INFERIOR ATTACHED")); showStatusMessage(msgAttachedToStoppedInferior()); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 48cd51a46c..efc797dcbe 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -442,10 +442,15 @@ void GdbEngine::handleResponse(const QByteArray &buff) // 7.0.x, there was a *-created instead. int progress = m_progress->progressValue(); m_progress->setProgressValue(qMin(70, progress + 1)); + // 7.1.50 has thread-group-started,id="i1",pid="3529" QByteArray id = result.findChild("id").data(); - showStatusMessage(tr("Thread group %1 created.").arg(_(id)), 1000); + showStatusMessage(tr("Thread group %1 created").arg(_(id)), 1000); int pid = id.toInt(); - if (pid != inferiorPid()) + if (!pid) { + id = result.findChild("pid").data(); + pid = id.toInt(); + } + if (pid) handleInferiorPidChanged(pid); } else if (asyncClass == "thread-created") { //"{id="1",group-id="28902"}" @@ -4153,6 +4158,10 @@ void GdbEngine::startInferiorPhase2() { debugMessage(_("BREAKPOINTS SET, CONTINUING INFERIOR STARTUP")); m_gdbAdapter->startInferiorPhase2(); + if (m_progress) { + m_progress->setProgressValue(100); + m_progress->reportFinished(); + } } void GdbEngine::handleInferiorStartFailed(const QString &msg) diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 5913d0c30d..e8a4959ebc 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -39,6 +39,9 @@ #include <QtCore/QFileInfo> #include <QtCore/QDir> +#include <QtGui/QToolTip> +#include <QtGui/QFontMetrics> + namespace Debugger { namespace Internal { @@ -76,12 +79,14 @@ QString StackFrame::toString() const QString StackFrame::toToolTip() const { + const QString filePath = QDir::toNativeSeparators(file); QString res; QTextStream str(&res); str << "<html><body><table>" << "<tr><td>" << StackHandler::tr("Address:") << "</td><td>" << address << "</td></tr>" << "<tr><td>" << StackHandler::tr("Function:") << "</td><td>" << function << "</td></tr>" - << "<tr><td>" << StackHandler::tr("File:") << "</td><td>" << QDir::toNativeSeparators(file) << "</td></tr>" + << "<tr><td>" << StackHandler::tr("File:") << "</td><td width=" + << QFontMetrics(QToolTip::font()).width(filePath) << ">" << filePath << "</td></tr>" << "<tr><td>" << StackHandler::tr("Line:") << "</td><td>" << line << "</td></tr>" << "<tr><td>" << StackHandler::tr("From:") << "</td><td>" << from << "</td></tr>" << "<tr><td>" << StackHandler::tr("To:") << "</td><td>" << to << "</td></tr>" diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index b4cfd13f26..a4adf74e50 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -602,8 +602,21 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const break; } - case ExpressionRole: - return data.exp; + case ExpressionRole: { + if (!data.exp.isEmpty()) + return data.exp; + if (!data.addr.isEmpty() && !data.type.isEmpty()) { + bool ok; + const quint64 addr = data.addr.toULongLong(&ok, 16); + if (ok && addr) + return QString("*(%1*)%2").arg(data.type).arg(addr); + } + WatchItem *parent = item->parent; + if (parent && !parent->exp.isEmpty()) + return QString("(%1).%2") + .arg(QString::fromLatin1(parent->exp)).arg(data.name); + return QVariant(); + } case INameRole: return data.iname; diff --git a/src/plugins/designer/Designer.pluginspec b/src/plugins/designer/Designer.pluginspec index aa0244fe61..77cdea1708 100644 --- a/src/plugins/designer/Designer.pluginspec +++ b/src/plugins/designer/Designer.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Designer" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Designer" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,8 +14,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Qt Designer integration.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> <!-- For compiling with CPP support enabled --> - <dependency name="CppEditor" version="2.0.80"/> + <dependency name="CppEditor" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/designer/codemodelhelpers.cpp b/src/plugins/designer/codemodelhelpers.cpp index 8f5199015c..46ce1265ab 100644 --- a/src/plugins/designer/codemodelhelpers.cpp +++ b/src/plugins/designer/codemodelhelpers.cpp @@ -126,7 +126,7 @@ bool navigateToSlot(const QString &uiFileName, // Find the generated header. const QString generatedHeaderFile = generatedHeaderOf(uiFileName); if (generatedHeaderFile.isEmpty()) { - *errorMessage = QCoreApplication::translate("Designer", "The generated header of the form '%1' could be found.\nRebuilding the project might help.").arg(uiFileName); + *errorMessage = QCoreApplication::translate("Designer", "The generated header of the form '%1' could not be found.\nRebuilding the project might help.").arg(uiFileName); return false; } const CPlusPlus::Snapshot snapshot = CppTools::CppModelManagerInterface::instance()->snapshot(); diff --git a/src/plugins/fakevim/FakeVim.pluginspec b/src/plugins/fakevim/FakeVim.pluginspec index 30b87245c8..619009dc98 100644 --- a/src/plugins/fakevim/FakeVim.pluginspec +++ b/src/plugins/fakevim/FakeVim.pluginspec @@ -1,4 +1,4 @@ -<plugin name="FakeVim" version="2.0.80" compatVersion="2.0.80"> +<plugin name="FakeVim" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -13,9 +13,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>VI-style keyboard navigation.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="CppEditor" version="2.0.80"/><!-- Plugin adds items to the editor's context menu --> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="Core" version="2.0.80"/> + <dependency name="CppEditor" version="2.1.0"/><!-- Plugin adds items to the editor's context menu --> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="Core" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 9f8a0e3230..2b5137c2e6 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1867,6 +1867,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input) } } else if (input.is('`')) { m_subsubmode = BackTickSubSubMode; + if (m_submode != NoSubMode) + m_movetype = MoveLineWise; } else if (input.is('#') || input.is('*')) { // FIXME: That's not proper vim behaviour QTextCursor tc = m_tc; @@ -1888,6 +1890,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(const Input &input) //updateMiniBuffer(); } else if (input.is('\'')) { m_subsubmode = TickSubSubMode; + if (m_submode != NoSubMode) + m_movetype = MoveLineWise; } else if (input.is('|')) { moveToStartOfLine(); moveRight(qMin(count(), rightDist()) - 1); diff --git a/src/plugins/find/Find.pluginspec b/src/plugins/find/Find.pluginspec index bcf92e73fa..7ac09f506e 100644 --- a/src/plugins/find/Find.pluginspec +++ b/src/plugins/find/Find.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Find" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Find" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,6 +14,6 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Provides the find widget and the hooks for find implementations.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/genericprojectmanager/GenericProjectManager.pluginspec b/src/plugins/genericprojectmanager/GenericProjectManager.pluginspec index 3667a23b94..dc8c715eac 100644 --- a/src/plugins/genericprojectmanager/GenericProjectManager.pluginspec +++ b/src/plugins/genericprojectmanager/GenericProjectManager.pluginspec @@ -1,4 +1,4 @@ -<plugin name="GenericProjectManager" version="2.0.80" compatVersion="2.0.80"> +<plugin name="GenericProjectManager" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,9 +14,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Generic support</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="CppTools" version="2.0.80"/> - <dependency name="CppEditor" version="2.0.80"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="CppTools" version="2.1.0"/> + <dependency name="CppEditor" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/git/ScmGit.pluginspec b/src/plugins/git/ScmGit.pluginspec index 0d6b2f19a7..de2d6c6aee 100644 --- a/src/plugins/git/ScmGit.pluginspec +++ b/src/plugins/git/ScmGit.pluginspec @@ -1,4 +1,4 @@ -<plugin name="ScmGit" version="2.0.80" compatVersion="2.0.80"> +<plugin name="ScmGit" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,9 +14,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Git integration.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="Core" version="2.0.80"/> - <dependency name="VCSBase" version="2.0.80"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="VCSBase" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 335a85068c..9f9a646ea1 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -584,18 +584,22 @@ bool GitClient::synchronousInit(const QString &workingDirectory) bool GitClient::synchronousCheckoutFiles(const QString &workingDirectory, QStringList files /* = QStringList() */, QString revision /* = QString() */, - QString *errorMessage /* = 0 */) + QString *errorMessage /* = 0 */, + bool revertStaging /* = true */) { if (Git::Constants::debug) qDebug() << Q_FUNC_INFO << workingDirectory << files; - if (revision.isEmpty()) + if (revertStaging && revision.isEmpty()) revision = QLatin1String("HEAD"); if (files.isEmpty()) files = QStringList(QString(QLatin1Char('.'))); QByteArray outputText; QByteArray errorText; QStringList arguments; - arguments << QLatin1String("checkout") << revision << QLatin1String("--") << files; + arguments << QLatin1String("checkout"); + if (revertStaging) + arguments << revision; + arguments << QLatin1String("--") << files; const bool rc = synchronousGit(workingDirectory, arguments, &outputText, &errorText); if (!rc) { const QString fileArg = files.join(QLatin1String(", ")); @@ -1392,7 +1396,10 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory, * reverting a directory pending a sophisticated selection dialog in the * VCSBase plugin. */ -GitClient::RevertResult GitClient::revertI(QStringList files, bool *ptrToIsDirectory, QString *errorMessage) +GitClient::RevertResult GitClient::revertI(QStringList files, + bool *ptrToIsDirectory, + QString *errorMessage, + bool revertStaging) { if (Git::Constants::debug) qDebug() << Q_FUNC_INFO << files; @@ -1454,7 +1461,7 @@ GitClient::RevertResult GitClient::revertI(QStringList files, bool *ptrToIsDirec if (Git::Constants::debug) qDebug() << Q_FUNC_INFO << data.stagedFiles << data.unstagedFiles << allStagedFiles << allUnstagedFiles << stagedFiles << unstagedFiles; - if (stagedFiles.empty() && unstagedFiles.empty()) + if ((!revertStaging || stagedFiles.empty()) && unstagedFiles.empty()) return RevertUnchanged; // Ask to revert (to do: Handle lists with a selection dialog) @@ -1468,19 +1475,22 @@ GitClient::RevertResult GitClient::revertI(QStringList files, bool *ptrToIsDirec return RevertCanceled; // Unstage the staged files - if (!stagedFiles.empty() && !synchronousReset(repoDirectory, stagedFiles, errorMessage)) + if (revertStaging && !stagedFiles.empty() && !synchronousReset(repoDirectory, stagedFiles, errorMessage)) return RevertFailed; + QStringList filesToRevert = unstagedFiles; + if (revertStaging) + filesToRevert += stagedFiles; // Finally revert! - if (!synchronousCheckoutFiles(repoDirectory, stagedFiles + unstagedFiles, QString(), errorMessage)) + if (!synchronousCheckoutFiles(repoDirectory, filesToRevert, QString(), errorMessage, revertStaging)) return RevertFailed; return RevertOk; } -void GitClient::revert(const QStringList &files) +void GitClient::revert(const QStringList &files, bool revertStaging) { bool isDirectory; QString errorMessage; - switch (revertI(files, &isDirectory, &errorMessage)) { + switch (revertI(files, &isDirectory, &errorMessage, revertStaging)) { case RevertOk: m_plugin->gitVersionControl()->emitFilesChanged(files); break; diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 3d65928b6c..8c7670d021 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -106,7 +106,8 @@ public: bool synchronousInit(const QString &workingDirectory); bool synchronousCheckoutFiles(const QString &workingDirectory, QStringList files = QStringList(), - QString revision = QString(), QString *errorMessage = 0); + QString revision = QString(), QString *errorMessage = 0, + bool revertStaging = true); // Checkout branch bool synchronousCheckoutBranch(const QString &workingDirectory, const QString &branch, QString *errorMessage = 0); @@ -156,7 +157,7 @@ public: void subversionLog(const QString &workingDirectory); void stashPop(const QString &workingDirectory); - void revert(const QStringList &files); + void revert(const QStringList &files, bool revertStaging); void branchList(const QString &workingDirectory); void stashList(const QString &workingDirectory); bool synchronousStashList(const QString &workingDirectory, @@ -241,7 +242,10 @@ private: unsigned synchronousGitVersion(bool silent, QString *errorMessage = 0); enum RevertResult { RevertOk, RevertUnchanged, RevertCanceled, RevertFailed }; - RevertResult revertI(QStringList files, bool *isDirectory, QString *errorMessage); + RevertResult revertI(QStringList files, + bool *isDirectory, + QString *errorMessage, + bool revertStaging); void connectRepositoryChanged(const QString & repository, GitCommand *cmd); void pull(const QString &workingDirectory, bool rebase); diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index b54607b447..e5f17b0c5f 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -335,8 +335,14 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) parameterActionCommand.second->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B"))); parameterActionCommand + = createFileAction(actionManager, gitContainer, + tr("Undo Unstaged Changes"), tr("Undo Unstaged Changes for \"%1\""), + QLatin1String("Git.UndoUnstaged"), globalcontext, + true, SLOT(undoUnstagedFileChanges())); + + parameterActionCommand = createFileAction(actionManager, gitContainer, - tr("Undo Changes"), tr("Undo Changes for \"%1\""), + tr("Undo Uncommitted Changes"), tr("Undo Uncommitted Changes for \"%1\""), QLatin1String("Git.Undo"), globalcontext, true, SLOT(undoFileChanges())); parameterActionCommand.second->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U"))); @@ -560,12 +566,17 @@ void GitPlugin::logProject() m_gitClient->log(state.currentProjectTopLevel(), state.relativeCurrentProject()); } -void GitPlugin::undoFileChanges() +void GitPlugin::undoFileChanges(bool revertStaging) { const VCSBase::VCSBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) Core::FileChangeBlocker fcb(state.currentFile()); - m_gitClient->revert(QStringList(state.currentFile())); + m_gitClient->revert(QStringList(state.currentFile()), revertStaging); +} + +void GitPlugin::undoUnstagedFileChanges() +{ + undoFileChanges(false); } void GitPlugin::undoRepositoryChanges() diff --git a/src/plugins/git/gitplugin.h b/src/plugins/git/gitplugin.h index 676362cc69..16852d9cd9 100644 --- a/src/plugins/git/gitplugin.h +++ b/src/plugins/git/gitplugin.h @@ -108,7 +108,8 @@ private slots: void logFile(); void blameFile(); void logProject(); - void undoFileChanges(); + void undoFileChanges(bool revertStaging = true); + void undoUnstagedFileChanges(); void undoRepositoryChanges(); void stageFile(); void unstageFile(); diff --git a/src/plugins/helloworld/HelloWorld.pluginspec b/src/plugins/helloworld/HelloWorld.pluginspec index 7b435e7f68..0de6cd5d95 100644 --- a/src/plugins/helloworld/HelloWorld.pluginspec +++ b/src/plugins/helloworld/HelloWorld.pluginspec @@ -1,4 +1,4 @@ -<plugin name="HelloWorld" version="2.0.80" compatVersion="2.0.80"> +<plugin name="HelloWorld" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -13,6 +13,6 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Hello World sample plugin.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/help/Help.pluginspec b/src/plugins/help/Help.pluginspec index f2058be13a..519447820c 100644 --- a/src/plugins/help/Help.pluginspec +++ b/src/plugins/help/Help.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Help" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Help" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,8 +14,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Help system.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> - <dependency name="Find" version="2.0.80"/> - <dependency name="Locator" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="Find" version="2.1.0"/> + <dependency name="Locator" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index fee7634ac0..9c7beb8682 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -719,16 +719,20 @@ void HelpPlugin::activateContext() viewer->stop(); #endif viewer->setSource(source); - } - viewer->setFocus(); - connect(viewer, SIGNAL(loadFinished(bool)), this, - SLOT(highlightSearchTerms())); + connect(viewer, SIGNAL(loadFinished(bool)), this, + SLOT(highlightSearchTerms())); - if (source.toString().remove(source.fragment()) - == oldSource.toString().remove(oldSource.fragment())) { - highlightSearchTerms(); + if (source.toString().remove(source.fragment()) + == oldSource.toString().remove(oldSource.fragment())) { + highlightSearchTerms(); + } + } else { +#if !defined(QT_NO_WEBKIT) + viewer->page()->mainFrame()->scrollToAnchor(source.fragment()); +#endif } } + viewer->setFocus(); } } @@ -857,21 +861,21 @@ void HelpPlugin::highlightSearchTerms() if (name.isEmpty()) continue; - if (m_oldAttrValue == name) { + if (m_oldAttrValue == name + || name.startsWith(m_oldAttrValue + QLatin1Char('-'))) { QWebElement parent = element.parent(); parent.setStyleProperty(property, m_styleProperty); } - if (attrValue == name) { + if (attrValue == name || name.startsWith(attrValue + QLatin1Char('-'))) { QWebElement parent = element.parent(); m_styleProperty = parent.styleProperty(property, - QWebElement::InlineStyle); + QWebElement::ComputedStyle); parent.setStyleProperty(property, QLatin1String("yellow")); } } m_oldAttrValue = attrValue; #endif - viewer->findText(m_idFromContext, 0, false, true); } } diff --git a/src/plugins/locator/Locator.pluginspec b/src/plugins/locator/Locator.pluginspec index 47c683e1bc..13e69ca128 100644 --- a/src/plugins/locator/Locator.pluginspec +++ b/src/plugins/locator/Locator.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Locator" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Locator" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,6 +14,6 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Provides the Locator widget and the hooks for Locator filter implementations.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/mercurial/Mercurial.pluginspec b/src/plugins/mercurial/Mercurial.pluginspec index b3c1968f63..047759284f 100644 --- a/src/plugins/mercurial/Mercurial.pluginspec +++ b/src/plugins/mercurial/Mercurial.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Mercurial" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Mercurial" version="2.1.0" compatVersion="2.1.0"> <vendor>Brian McGillion</vendor> <copyright>(C) 2008-2009 Brian McGillion</copyright> <license> @@ -14,9 +14,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Mercurial integration.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="Core" version="2.0.80"/> - <dependency name="VCSBase" version="2.0.80"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="VCSBase" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/mercurial/mercurialclient.cpp b/src/plugins/mercurial/mercurialclient.cpp index 3db6b7a7f8..51c92d6a2b 100644 --- a/src/plugins/mercurial/mercurialclient.cpp +++ b/src/plugins/mercurial/mercurialclient.cpp @@ -61,6 +61,8 @@ inline Core::IEditor* locateEditor(const Core::ICore *core, const char *property return 0; } +static const char nonInteractiveOptionC[] = "--noninteractive"; + namespace Mercurial { namespace Internal { @@ -533,7 +535,8 @@ void MercurialClient::commit(const QString &repositoryRoot, const QStringList &f // refuse to do "autoadd" on a commit with working directory only, as this will // add all the untracked stuff. QTC_ASSERT(!(autoAddRemove && files.isEmpty()), return) - QStringList args(QLatin1String("commit")); + QStringList args = QStringList(QLatin1String(nonInteractiveOptionC)); + args.append(QLatin1String("commit")); if (!committerInfo.isEmpty()) args << QLatin1String("-u") << committerInfo; args << QLatin1String("-l") << commitMessageFile; diff --git a/src/plugins/mercurial/mercurialjobrunner.cpp b/src/plugins/mercurial/mercurialjobrunner.cpp index 185856a16d..5651868282 100644 --- a/src/plugins/mercurial/mercurialjobrunner.cpp +++ b/src/plugins/mercurial/mercurialjobrunner.cpp @@ -69,6 +69,11 @@ HgTask::HgTask(const QString &repositoryRoot, { } +VCSBase::VCSBaseEditor* HgTask::displayEditor() const +{ + return editor; +} + void HgTask::emitSucceeded() { emit succeeded(m_cookie); @@ -221,7 +226,7 @@ void MercurialJobRunner::task(const QSharedPointer<HgTask> &job) */ if (stdOutput.isEmpty()) stdOutput = stdErr; - emit output(stdOutput); + emit output(stdOutput); // This will clear the diff "Working..." text. taskData->emitSucceeded(); } else { emit error(QString::fromLocal8Bit(stdErr)); diff --git a/src/plugins/mercurial/mercurialjobrunner.h b/src/plugins/mercurial/mercurialjobrunner.h index ef9c7856c8..77f332b919 100644 --- a/src/plugins/mercurial/mercurialjobrunner.h +++ b/src/plugins/mercurial/mercurialjobrunner.h @@ -38,6 +38,7 @@ #include <QtCore/QSharedPointer> #include <QtCore/QVariant> #include <QtCore/QString> +#include <QtCore/QPointer> QT_BEGIN_NAMESPACE class QProcess; @@ -64,10 +65,10 @@ public: VCSBase::VCSBaseEditor *editor, const QVariant &cookie = QVariant()); - bool shouldEmit() { return emitRaw; } - VCSBase::VCSBaseEditor* displayEditor() { return editor; } - QStringList args() { return arguments; } - QString repositoryRoot() { return m_repositoryRoot; } + bool shouldEmit() const { return emitRaw; } + VCSBase::VCSBaseEditor* displayEditor() const; + QStringList args() const { return arguments; } + QString repositoryRoot() const { return m_repositoryRoot; } signals: void succeeded(const QVariant &cookie); // Use a queued connection @@ -81,7 +82,7 @@ private: const QStringList arguments; const bool emitRaw; const QVariant m_cookie; - VCSBase::VCSBaseEditor *editor; + QPointer<VCSBase::VCSBaseEditor> editor; // User might close it. }; /* A job queue running in a separate thread, executing commands diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index 958e5ae058..5a39e95071 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -581,7 +581,12 @@ void MercurialPlugin::showCommitWidget(const QList<QPair<QString, QString> > &st deleteCommitLog(); - changeLog = new QTemporaryFile(this); + // Open commit log + QString changeLogPattern = QDir::tempPath(); + if (!changeLogPattern.endsWith(QLatin1Char('/'))) + changeLogPattern += QLatin1Char('/'); + changeLogPattern += QLatin1String("qtcreator-hg-XXXXXX.msg"); + changeLog = new QTemporaryFile(changeLogPattern, this); if (!changeLog->open()) { outputWindow->appendError(tr("Unable to generate a temporary file for the commit editor.")); return; @@ -673,7 +678,6 @@ void MercurialPlugin::deleteCommitLog() if (changeLog) { delete changeLog; changeLog = 0; - m_submitRepository.clear(); } } diff --git a/src/plugins/perforce/Perforce.pluginspec b/src/plugins/perforce/Perforce.pluginspec index 90956c438e..f6402217df 100644 --- a/src/plugins/perforce/Perforce.pluginspec +++ b/src/plugins/perforce/Perforce.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Perforce" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Perforce" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,9 +14,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Perforce integration.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="Core" version="2.0.80"/> - <dependency name="VCSBase" version="2.0.80"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="VCSBase" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index f59ddb97a4..f958d426e0 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -190,6 +190,7 @@ plugin_qmlprojectmanager.depends = plugin_texteditor plugin_qmlprojectmanager.depends += plugin_projectexplorer plugin_qmlprojectmanager.depends += plugin_qmljseditor plugin_qmlprojectmanager.depends += plugin_debugger +plugin_qmlprojectmanager.depends += plugin_qt4projectmanager plugin_qmldesigner.subdir = qmldesigner plugin_qmldesigner.depends = plugin_coreplugin diff --git a/src/plugins/projectexplorer/ProjectExplorer.pluginspec b/src/plugins/projectexplorer/ProjectExplorer.pluginspec index ed71982e3a..ebc90164eb 100644 --- a/src/plugins/projectexplorer/ProjectExplorer.pluginspec +++ b/src/plugins/projectexplorer/ProjectExplorer.pluginspec @@ -1,4 +1,4 @@ -<plugin name="ProjectExplorer" version="2.0.80" compatVersion="2.0.80"> +<plugin name="ProjectExplorer" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,10 +14,10 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>ProjectExplorer framework that can be extended with different kind of project types.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> - <dependency name="Find" version="2.0.80"/> - <dependency name="Locator" version="2.0.80"/> - <dependency name="TextEditor" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="Find" version="2.1.0"/> + <dependency name="Locator" version="2.1.0"/> + <dependency name="TextEditor" version="2.1.0"/> </dependencyList> <argumentList> <argument name="-customwizard-verbose">Verbose loading of custom wizards</argument> diff --git a/src/plugins/projectexplorer/customwizard/customwizard.cpp b/src/plugins/projectexplorer/customwizard/customwizard.cpp index b9c8e7e18a..81a141e315 100644 --- a/src/plugins/projectexplorer/customwizard/customwizard.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizard.cpp @@ -331,13 +331,18 @@ QList<CustomWizard*> CustomWizard::createWizards() if (dir.exists(configFile)) { CustomWizardParametersPtr parameters(new Internal::CustomWizardParameters); Core::BaseFileWizardParameters baseFileParameters; - if (parameters->parse(dir.absoluteFilePath(configFile), &baseFileParameters, &errorMessage)) { + switch (parameters->parse(dir.absoluteFilePath(configFile), &baseFileParameters, &errorMessage)) { + case Internal::CustomWizardParameters::ParseOk: parameters->directory = dir.absolutePath(); if (CustomWizardPrivate::verbose) verboseLog += parameters->toString(); if (CustomWizard *w = createWizard(parameters, baseFileParameters)) rc.push_back(w); - } else { + case Internal::CustomWizardParameters::ParseDisabled: + if (CustomWizardPrivate::verbose) + qWarning("Ignoring disabled wizard %s...", qPrintable(dir.absolutePath())); + break; + case Internal::CustomWizardParameters::ParseFailed: qWarning("Failed to initialize custom project wizard in %s: %s", qPrintable(dir.absolutePath()), qPrintable(errorMessage)); } diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp index 2f3d902c88..034692039e 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp @@ -48,6 +48,7 @@ static const char customWizardElementC[] = "wizard"; static const char iconElementC[] = "icon"; static const char descriptionElementC[] = "description"; static const char displayNameElementC[] = "displayname"; +static const char wizardEnabledAttributeC[] = "enabled"; static const char idAttributeC[] = "id"; static const char kindAttributeC[] = "kind"; static const char klassAttributeC[] = "class"; @@ -329,9 +330,13 @@ static inline QString msgError(const QXmlStreamReader &reader, arg(fileName).arg(reader.lineNumber()).arg(reader.columnNumber()).arg(what); } -static inline bool booleanAttributeValue(const QXmlStreamReader &r, const char *name) +static inline bool booleanAttributeValue(const QXmlStreamReader &r, const char *nameC, + bool defaultValue) { - return r.attributes().value(QLatin1String(name)) == QLatin1String("true"); + const QStringRef attributeValue = r.attributes().value(QLatin1String(nameC)); + if (attributeValue.isEmpty()) + return defaultValue; + return attributeValue == QLatin1String("true"); } static inline int integerAttributeValue(const QXmlStreamReader &r, const char *name, int defaultValue) @@ -368,7 +373,8 @@ static inline QString localeLanguage() } // Main parsing routine -bool CustomWizardParameters::parse(QIODevice &device, +CustomWizardParameters::ParseResult + CustomWizardParameters::parse(QIODevice &device, const QString &configFileFullPath, Core::BaseFileWizardParameters *bp, QString *errorMessage) @@ -386,7 +392,7 @@ bool CustomWizardParameters::parse(QIODevice &device, switch (token) { case QXmlStreamReader::Invalid: *errorMessage = msgError(reader, configFileFullPath, reader.errorString()); - return false; + return ParseFailed; case QXmlStreamReader::StartElement: do { // Read out subelements applicable to current state @@ -401,8 +407,10 @@ bool CustomWizardParameters::parse(QIODevice &device, case ParseError: *errorMessage = msgError(reader, configFileFullPath, QString::fromLatin1("Unexpected start element %1").arg(reader.name().toString())); - return false; + return ParseFailed; case ParseWithinWizard: + if (!booleanAttributeValue(reader, wizardEnabledAttributeC, true)) + return ParseDisabled; bp->setId(attributeValue(reader, idAttributeC)); bp->setCategory(attributeValue(reader, categoryAttributeC)); bp->setKind(kindAttribute(reader)); @@ -411,14 +419,14 @@ bool CustomWizardParameters::parse(QIODevice &device, break; case ParseWithinField: // field attribute field.name = attributeValue(reader, fieldNameAttributeC); - field.mandatory = booleanAttributeValue(reader, fieldMandatoryAttributeC); + field.mandatory = booleanAttributeValue(reader, fieldMandatoryAttributeC, false); break; case ParseWithinFile: { // file attribute CustomWizardFile file; file.source = attributeValue(reader, fileNameSourceAttributeC); file.target = attributeValue(reader, fileNameTargetAttributeC); - file.openEditor = booleanAttributeValue(reader, fileNameOpenEditorAttributeC); - file.openProject = booleanAttributeValue(reader, fileNameOpenProjectAttributeC); + file.openEditor = booleanAttributeValue(reader, fileNameOpenEditorAttributeC, false); + file.openProject = booleanAttributeValue(reader, fileNameOpenProjectAttributeC, false); if (file.target.isEmpty()) file.target = file.source; if (file.source.isEmpty()) { @@ -438,7 +446,7 @@ bool CustomWizardParameters::parse(QIODevice &device, if (state == ParseError) { *errorMessage = msgError(reader, configFileFullPath, QString::fromLatin1("Unexpected end element %1").arg(reader.name().toString())); - return false; + return ParseFailed; } if (state == ParseWithinFields) { // Leaving a field element fields.push_back(field); @@ -449,17 +457,18 @@ bool CustomWizardParameters::parse(QIODevice &device, break; } } while (token != QXmlStreamReader::EndDocument); - return true; + return ParseOk; } -bool CustomWizardParameters::parse(const QString &configFileFullPath, +CustomWizardParameters::ParseResult + CustomWizardParameters::parse(const QString &configFileFullPath, Core::BaseFileWizardParameters *bp, QString *errorMessage) { QFile configFile(configFileFullPath); if (!configFile.open(QIODevice::ReadOnly|QIODevice::Text)) { *errorMessage = QString::fromLatin1("Cannot open %1: %2").arg(configFileFullPath, configFile.errorString()); - return false; + return ParseFailed; } return parse(configFile, configFileFullPath, bp, errorMessage); } diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.h b/src/plugins/projectexplorer/customwizard/customwizardparameters.h index f71de2b612..3d5b223d4c 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardparameters.h +++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.h @@ -67,12 +67,14 @@ struct CustomWizardFile { struct CustomWizardParameters { public: + enum ParseResult { ParseOk, ParseDisabled, ParseFailed }; + CustomWizardParameters(); void clear(); - bool parse(QIODevice &device, const QString &configFileFullPath, - Core::BaseFileWizardParameters *bp, QString *errorMessage); - bool parse(const QString &configFileFullPath, - Core::BaseFileWizardParameters *bp, QString *errorMessage); + ParseResult parse(QIODevice &device, const QString &configFileFullPath, + Core::BaseFileWizardParameters *bp, QString *errorMessage); + ParseResult parse(const QString &configFileFullPath, + Core::BaseFileWizardParameters *bp, QString *errorMessage); QString toString() const; QString directory; diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index bdea6c9ef2..12c47ee454 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -234,6 +234,8 @@ QString Project::projectDirectory() const QString Project::projectDirectory(const QString &proFile) { + if (proFile.isEmpty()) + return QString(); QFileInfo info(proFile); return info.absoluteDir().path(); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index fb4d5579c1..c87981803e 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -909,16 +909,8 @@ void ProjectExplorerPlugin::newProject() if (debug) qDebug() << "ProjectExplorerPlugin::newProject"; - QString defaultLocation; - if (currentProject()) { - QDir dir(currentProject()->projectDirectory()); - dir.cdUp(); - defaultLocation = dir.absolutePath(); - } - Core::ICore::instance()->showNewItemDialog(tr("New Project", "Title of dialog"), - Core::IWizard::wizardsOfKind(Core::IWizard::ProjectWizard), - defaultLocation); + Core::IWizard::wizardsOfKind(Core::IWizard::ProjectWizard)); updateActions(); } diff --git a/src/plugins/qmldesigner/QmlDesigner.pluginspec b/src/plugins/qmldesigner/QmlDesigner.pluginspec index 2f59fbd374..5660deede3 100644 --- a/src/plugins/qmldesigner/QmlDesigner.pluginspec +++ b/src/plugins/qmldesigner/QmlDesigner.pluginspec @@ -1,4 +1,4 @@ -<plugin name="QmlDesigner" version="2.0.80" compatVersion="2.0.80" experimental="true"> +<plugin name="QmlDesigner" version="2.1.0" compatVersion="2.1.0" experimental="true"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -20,8 +20,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license> <description>Visual Designer for QML files.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="QmlJSEditor" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="QmlJSEditor" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp index 10287437a0..342bc7ee5d 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp @@ -65,7 +65,7 @@ FormEditorScene::FormEditorScene(FormEditorWidget *view, FormEditorView *editorV m_manipulatorLayerItem->setZValue(1.0); m_formLayerItem->setZValue(0.0); - m_formLayerItem->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true); + m_formLayerItem->setFlag(QGraphicsItem::ItemClipsChildrenToShape, false); view->setScene(this); setItemIndexMethod(QGraphicsScene::NoIndex); diff --git a/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp b/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp index 1672e9947f..9a444be309 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp @@ -106,7 +106,7 @@ void CustomDragAndDropIcon::mouseMoveEvent(QMouseEvent *event) else { move(-1000, -1000); //if no top level widget is found we are out of the main window } - QWidget* target = QApplication::widgetAt(globalPos - QPoint(2,2)); //-(2, 2) because: + QWidget* target = QApplication::widgetAt(globalPos - QPoint(3,3)); //-(3, 3) because: // otherwise we just get this widget if (target != m_oldTarget) { if (CustomDragAndDrop::isAccepted()) diff --git a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp index 839a3b2138..e5c86aa385 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp @@ -123,7 +123,7 @@ class QWidgetDeclarativeUI : public QObject Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged) Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) - Q_PROPERTY(QUrl styleSheetFile READ styleSheetFile WRITE setStyleSheetFile NOTIFY styleSheetFileChanged) + Q_PROPERTY(QUrl styleSheetFile READ styleSheetFile WRITE setStyleSheetFile) Q_PROPERTY(QColor windowColor READ windowColor WRITE setWindowColor) Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor) @@ -782,7 +782,7 @@ private: class QComboBoxDeclarativeUI : public QObject { Q_OBJECT - Q_PROPERTY(QStringList items READ items WRITE setItems NOTIFY itemChanged) + Q_PROPERTY(QStringList items READ items WRITE setItems) Q_PROPERTY(QString currentText READ currentText WRITE setCurrentText NOTIFY currentTextChanged) public: @@ -879,7 +879,7 @@ class WidgetLoader : public QWidget Q_PROPERTY(QString sourceString READ sourceString WRITE setSourceString NOTIFY sourceChanged) Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) Q_PROPERTY(QUrl baseUrl READ baseUrl WRITE setBaseUrl) - Q_PROPERTY(QString qmlData READ qmlData WRITE setQmlData NOTIFY sourceQmlDataChanged) + Q_PROPERTY(QString qmlData READ qmlData WRITE setQmlData NOTIFY qmlDataChanged) Q_PROPERTY(QWidget *widget READ widget NOTIFY widgetChanged) Q_PROPERTY(QDeclarativeComponent *component READ component NOTIFY sourceChanged) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h index ff3912475f..55ba8061e7 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h @@ -82,7 +82,7 @@ class PropertyEditorValue : public QObject Q_PROPERTY(bool isInModel READ isInModel NOTIFY valueChangedQml FINAL) Q_PROPERTY(bool isInSubState READ isInSubState NOTIFY valueChangedQml FINAL) Q_PROPERTY(bool isBound READ isBound NOTIFY isBoundChanged FINAL) - Q_PROPERTY(bool isValid READ isValid NOTIFY isValid FINAL) + Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged FINAL) Q_PROPERTY(QString name READ name FINAL) Q_PROPERTY(PropertyEditorNodeWrapper* complexNode READ complexNode NOTIFY complexNodeChanged FINAL) diff --git a/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp b/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp index 0f9edd2c7d..e2b9eb1bd8 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp @@ -168,7 +168,7 @@ QmlItemNode QmlModelView::createQmlItemNode(const ItemLibraryEntry &itemLibraryE QmlItemNode newNode; RewriterTransaction transaction = beginRewriterTransaction(); { - if (itemLibraryEntry.typeName().contains('.')) { + if (itemLibraryEntry.typeName().contains('/')) { const QString newImportUrl = itemLibraryEntry.typeName().split('/').first(); const QString newImportVersion = QString("%1.%2").arg(QString::number(itemLibraryEntry.majorVersion()), QString::number(itemLibraryEntry.minorVersion())); Import newImport = Import::createLibraryImport(newImportUrl, newImportVersion); diff --git a/src/plugins/qmldesigner/settingspage.cpp b/src/plugins/qmldesigner/settingspage.cpp index 88ba6dfefa..2ea508a353 100644 --- a/src/plugins/qmldesigner/settingspage.cpp +++ b/src/plugins/qmldesigner/settingspage.cpp @@ -49,7 +49,7 @@ DesignerSettings SettingsPageWidget::settings() const DesignerSettings ds; ds.itemSpacing = m_ui.spinItemSpacing->value(); ds.snapMargin = m_ui.spinSnapMargin->value(); - ds.enableContextPane = m_ui.textEditHelperCheckBox->isChecked(); + ds.enableContextPane = false; return ds; } @@ -57,7 +57,6 @@ void SettingsPageWidget::setSettings(const DesignerSettings &s) { m_ui.spinItemSpacing->setValue(s.itemSpacing); m_ui.spinSnapMargin->setValue(s.snapMargin); - m_ui.textEditHelperCheckBox->setChecked(s.enableContextPane); } QString SettingsPageWidget::searchKeywords() const diff --git a/src/plugins/qmldesigner/settingspage.ui b/src/plugins/qmldesigner/settingspage.ui index 48b3f50b83..9a56b1cc31 100644 --- a/src/plugins/qmldesigner/settingspage.ui +++ b/src/plugins/qmldesigner/settingspage.ui @@ -99,22 +99,6 @@ </widget> </item> <item row="1" column="0"> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>Text Editor Helper</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QCheckBox" name="textEditHelperCheckBox"> - <property name="text"> - <string>enable</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="2" column="0"> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> diff --git a/src/plugins/qmlinspector/QmlInspector.pluginspec b/src/plugins/qmlinspector/QmlInspector.pluginspec index ebe1be3f0d..94a73b3ee9 100644 --- a/src/plugins/qmlinspector/QmlInspector.pluginspec +++ b/src/plugins/qmlinspector/QmlInspector.pluginspec @@ -1,4 +1,4 @@ -<plugin name="QmlInspector" version="2.0.80" compatVersion="2.0.80" experimental="true"> +<plugin name="QmlInspector" version="2.1.0" compatVersion="2.1.0" experimental="true"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -20,11 +20,11 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license> <description>Debugger for QML files</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="QmlProjectManager" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="CppTools" version="2.0.80"/> - <dependency name="CppEditor" version="2.0.80"/> - <dependency name="Debugger" version="2.0.80"/> - <dependency name="QmlJSEditor" version="2.0.80"/> + <dependency name="QmlProjectManager" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="CppTools" version="2.1.0"/> + <dependency name="CppEditor" version="2.1.0"/> + <dependency name="Debugger" version="2.1.0"/> + <dependency name="QmlJSEditor" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/qmljseditor/QmlJSEditor.pluginspec b/src/plugins/qmljseditor/QmlJSEditor.pluginspec index 8ab4e7282f..2b1b318ce3 100644 --- a/src/plugins/qmljseditor/QmlJSEditor.pluginspec +++ b/src/plugins/qmljseditor/QmlJSEditor.pluginspec @@ -1,4 +1,4 @@ -<plugin name="QmlJSEditor" version="2.0.80" compatVersion="2.0.80"> +<plugin name="QmlJSEditor" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,8 +14,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Editor for QML and JavaScript.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 7f0a4e2477..24f9d7e541 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -570,7 +570,6 @@ QmlJSEditorEditable::QmlJSEditorEditable(QmlJSTextEditor *editor) Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); m_context << uidm->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID); m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); - m_context << uidm->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU); } // Use preferred mode from Bauhaus settings diff --git a/src/plugins/qmljseditor/qmljseditor.pro b/src/plugins/qmljseditor/qmljseditor.pro index d7f95441dd..27130d97cd 100644 --- a/src/plugins/qmljseditor/qmljseditor.pro +++ b/src/plugins/qmljseditor/qmljseditor.pro @@ -20,8 +20,7 @@ HEADERS += \ qmljshighlighter.h \ qmljshoverhandler.h \ qmljsmodelmanager.h \ - qmljsmodelmanagerinterface.h \ - qmljspreviewrunner.h + qmljsmodelmanagerinterface.h SOURCES += \ qmljscodecompletion.cpp \ @@ -34,8 +33,7 @@ SOURCES += \ qmljshighlighter.cpp \ qmljshoverhandler.cpp \ qmljsmodelmanager.cpp \ - qmljsmodelmanagerinterface.cpp \ - qmljspreviewrunner.cpp + qmljsmodelmanagerinterface.cpp RESOURCES += qmljseditor.qrc OTHER_FILES += QmlJSEditor.pluginspec QmlJSEditor.mimetypes.xml diff --git a/src/plugins/qmljseditor/qmljseditorconstants.h b/src/plugins/qmljseditor/qmljseditorconstants.h index 0db49ad417..eb6989fdd3 100644 --- a/src/plugins/qmljseditor/qmljseditorconstants.h +++ b/src/plugins/qmljseditor/qmljseditorconstants.h @@ -36,7 +36,6 @@ namespace QmlJSEditor { namespace Constants { // menus -const char * const M_QTQUICK = "QtQuickDesigner.Menu"; const char * const M_CONTEXT = "QML JS Editor.ContextMenu"; const char * const RUN_SEP = "QmlJSEditor.Run.Separator"; diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index f998309ac1..6166cb11b4 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -36,7 +36,6 @@ #include "qmljshoverhandler.h" #include "qmljsmodelmanager.h" #include "qmlfilewizard.h" -#include "qmljspreviewrunner.h" #include <qmldesigner/qmldesignerconstants.h> @@ -99,8 +98,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e addAutoReleasedObject(m_modelManager); QList<int> context; - context << core->uniqueIDManager()->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID) - << core->uniqueIDManager()->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU); + context << core->uniqueIDManager()->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID); m_editor = new QmlJSEditorFactory(this); addObject(m_editor); @@ -122,19 +120,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e Core::ActionManager *am = core->actionManager(); Core::ActionContainer *contextMenu = am->createMenu(QmlJSEditor::Constants::M_CONTEXT); - Core::ActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS); - Core::ActionContainer *menuQtQuick = am->createMenu(Constants::M_QTQUICK); - menuQtQuick->menu()->setTitle(tr("Qt Quick")); - mtools->addMenu(menuQtQuick); - m_actionPreview = new QAction("&Preview", this); - - QList<int> toolsMenuContext = QList<int>() - << core->uniqueIDManager()->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU); - Core::Command *cmd = addToolAction(m_actionPreview, am, toolsMenuContext, - QLatin1String("QtQuick.Preview"), menuQtQuick, tr("Ctrl+Alt+R")); - connect(cmd->action(), SIGNAL(triggered()), SLOT(openPreview())); - m_previewRunner = new QmlJSPreviewRunner(this); - + Core::Command *cmd; QAction *followSymbolUnderCursorAction = new QAction(tr("Follow Symbol Under Cursor"), this); cmd = am->registerAction(followSymbolUnderCursorAction, Constants::FOLLOW_SYMBOL_UNDER_CURSOR, context); cmd->setDefaultKeySequence(QKeySequence(Qt::Key_F2)); @@ -170,15 +156,6 @@ void QmlJSEditorPlugin::extensionsInitialized() { } -void QmlJSEditorPlugin::openPreview() -{ - Core::EditorManager *em = Core::EditorManager::instance(); - - if (em->currentEditor() && em->currentEditor()->id() == Constants::C_QMLJSEDITOR_ID) - m_previewRunner->run(em->currentEditor()->file()->fileName()); - -} - void QmlJSEditorPlugin::initializeEditor(QmlJSEditor::Internal::QmlJSTextEditor *editor) { QTC_ASSERT(m_instance, /**/); diff --git a/src/plugins/qmljseditor/qmljseditorplugin.h b/src/plugins/qmljseditor/qmljseditorplugin.h index db534f0f29..d8cc225a0d 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.h +++ b/src/plugins/qmljseditor/qmljseditorplugin.h @@ -53,7 +53,6 @@ namespace Internal { class QmlJSEditorFactory; class QmlJSTextEditor; -class QmlJSPreviewRunner; class QmlJSEditorPlugin : public ExtensionSystem::IPlugin { @@ -75,18 +74,12 @@ public: public Q_SLOTS: void followSymbolUnderCursor(); -private Q_SLOTS: - void openPreview(); - private: Core::Command *addToolAction(QAction *a, Core::ActionManager *am, const QList<int> &context, const QString &name, Core::ActionContainer *c1, const QString &keySequence); static QmlJSEditorPlugin *m_instance; - QAction *m_actionPreview; - QmlJSPreviewRunner *m_previewRunner; - ModelManagerInterface *m_modelManager; QmlFileWizard *m_wizard; QmlJSEditorFactory *m_editor; diff --git a/src/plugins/qmljseditor/qmljspreviewrunner.cpp b/src/plugins/qmljseditor/qmljspreviewrunner.cpp deleted file mode 100644 index edae36100f..0000000000 --- a/src/plugins/qmljseditor/qmljspreviewrunner.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "qmljspreviewrunner.h" - -#include <projectexplorer/environment.h> -#include <utils/synchronousprocess.h> - -#include <QtGui/QMessageBox> -#include <QtGui/QApplication> - -#include <QDebug> - -namespace QmlJSEditor { -namespace Internal { - -QmlJSPreviewRunner::QmlJSPreviewRunner(QObject *parent) : - QObject(parent) -{ - // prepend creator/bin dir to search path (only useful for special creator-qml package) - const QString searchPath = QCoreApplication::applicationDirPath() - + Utils::SynchronousProcess::pathSeparator() - + QString(qgetenv("PATH")); - m_qmlViewerDefaultPath = Utils::SynchronousProcess::locateBinary(searchPath, QLatin1String("qml")); - - ProjectExplorer::Environment environment = ProjectExplorer::Environment::systemEnvironment(); - m_applicationLauncher.setEnvironment(environment.toStringList()); -} - - -void QmlJSPreviewRunner::run(const QString &filename) -{ - QString errorMessage; - if (!filename.isEmpty()) { - m_applicationLauncher.start(ProjectExplorer::ApplicationLauncher::Gui, m_qmlViewerDefaultPath, - QStringList() << filename); - - } else { - errorMessage = "No file specified."; - } - - if (!errorMessage.isEmpty()) - QMessageBox::warning(0, tr("Failed to preview Qt Quick file"), - tr("Could not preview Qt Quick (QML) file. Reason: \n%1").arg(errorMessage)); -} - - -} // namespace Internal -} // namespace QmlJSEditor diff --git a/src/plugins/qmljseditor/qmljspreviewrunner.h b/src/plugins/qmljseditor/qmljspreviewrunner.h deleted file mode 100644 index 869327b10c..0000000000 --- a/src/plugins/qmljseditor/qmljspreviewrunner.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef QMLJSPREVIEWRUNNER_H -#define QMLJSPREVIEWRUNNER_H - -#include <QObject> - -#include <projectexplorer/applicationlauncher.h> - -namespace QmlJSEditor { -namespace Internal { - -class QmlJSPreviewRunner : public QObject -{ - Q_OBJECT -public: - explicit QmlJSPreviewRunner(QObject *parent = 0); - void run(const QString &filename); - -signals: - -public slots: - -private: - QString m_qmlViewerDefaultPath; - - ProjectExplorer::ApplicationLauncher m_applicationLauncher; - -}; - - -} // namespace Internal -} // namespace QmlJSEditor - - -#endif // QMLJSPREVIEWRUNNER_H diff --git a/src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec b/src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec index c6481beacf..8e3405428e 100644 --- a/src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec +++ b/src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec @@ -1,4 +1,4 @@ -<plugin name="QmlProjectManager" version="2.0.80" compatVersion="2.0.80"> +<plugin name="QmlProjectManager" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,9 +14,11 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Qt Quick support</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="QmlJSEditor" version="2.0.80"/> - <dependency name="Debugger" version="2.0.80" /> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="QmlJSEditor" version="2.1.0"/> + <dependency name="Debugger" version="2.1.0" /> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="Qt4ProjectManager" version="2.1.0" /> </dependencyList> </plugin> diff --git a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp index d6a8256a25..d78a3ebac9 100644 --- a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp +++ b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp @@ -51,7 +51,6 @@ void FileFilterBaseItem::setFilter(const QString &filter) m_regExpList << QRegExp(pattern, Qt::CaseInsensitive, QRegExp::Wildcard); } - emit filterChanged(); updateFileList(); } @@ -222,13 +221,18 @@ QmlFileFilterItem::QmlFileFilterItem(QObject *parent) setFilter(QLatin1String("*.qml")); } - JsFileFilterItem::JsFileFilterItem(QObject *parent) : FileFilterBaseItem(parent) { setFilter(QLatin1String("*.js")); } +void JsFileFilterItem::setFilter(const QString &filter) +{ + FileFilterBaseItem::setFilter(filter); + emit filterChanged(); +} + ImageFileFilterItem::ImageFileFilterItem(QObject *parent) : FileFilterBaseItem(parent) { @@ -241,11 +245,23 @@ ImageFileFilterItem::ImageFileFilterItem(QObject *parent) setFilter(filter); } +void ImageFileFilterItem::setFilter(const QString &filter) +{ + FileFilterBaseItem::setFilter(filter); + emit filterChanged(); +} + CssFileFilterItem::CssFileFilterItem(QObject *parent) : FileFilterBaseItem(parent) { setFilter(QLatin1String("*.css")); } +void CssFileFilterItem::setFilter(const QString &filter) +{ + FileFilterBaseItem::setFilter(filter); + emit filterChanged(); +} + } // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h index bcfa22d242..ec27e1cd26 100644 --- a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h +++ b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.h @@ -17,7 +17,7 @@ class FileFilterBaseItem : public QmlProjectContentItem { Q_PROPERTY(QString directory READ directory WRITE setDirectory NOTIFY directoryChanged) Q_PROPERTY(bool recursive READ recursive WRITE setRecursive NOTIFY recursiveChanged) - Q_PROPERTY(QStringList paths READ pathsProperty WRITE setPathsProperty NOTIFY pathsPropertyChanged) + Q_PROPERTY(QStringList paths READ pathsProperty WRITE setPathsProperty) Q_PROPERTY(QStringList files READ files NOTIFY filesChanged DESIGNABLE false) @@ -46,7 +46,6 @@ signals: void recursiveChanged(); void pathsChanged(); void filesChanged(const QSet<QString> &added, const QSet<QString> &removed); - void filterChanged(); private slots: void updateFileList(); @@ -89,7 +88,12 @@ public: class JsFileFilterItem : public FileFilterBaseItem { Q_OBJECT - Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged()) + Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged) + + void setFilter(const QString &filter); + +signals: + void filterChanged(); public: JsFileFilterItem(QObject *parent = 0); @@ -97,7 +101,12 @@ public: class ImageFileFilterItem : public FileFilterBaseItem { Q_OBJECT - Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged()) + Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged) + + void setFilter(const QString &filter); + +signals: + void filterChanged(); public: ImageFileFilterItem(QObject *parent = 0); @@ -105,7 +114,12 @@ public: class CssFileFilterItem : public FileFilterBaseItem { Q_OBJECT - Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged()) + Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged) + + void setFilter(const QString &filter); + +signals: + void filterChanged(); public: CssFileFilterItem(QObject *parent = 0); diff --git a/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp b/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp index eafbc0385b..3f7727408e 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp @@ -69,10 +69,10 @@ Core::BaseFileWizardParameters QmlProjectApplicationWizard::parameters() p.drawPixmap(3, 3, 16, 16, QPixmap(QLatin1String(Constants::QML_WIZARD_ICON))); parameters.setIcon(icon); } - parameters.setDisplayName(tr("Qt QML Application")); + parameters.setDisplayName(tr("QML Application")); parameters.setId(QLatin1String("QA.QML Application")); - parameters.setDescription(tr("Creates a Qt QML application project with a single QML file containing the main view.\n\n" - "QML application projects are executed through the QML runtime and do not need to be built.")); + parameters.setDescription(tr("Creates a QML application project with a single QML file containing the main view.\n\n" + "QML application projects are executed by the Qt QML Viewer and do not need to be built.")); parameters.setCategory(QLatin1String(Constants::QML_WIZARD_CATEGORY)); parameters.setDisplayCategory(QCoreApplication::translate(Constants::QML_WIZARD_TR_SCOPE, Constants::QML_WIZARD_TR_CATEGORY)); diff --git a/src/plugins/qmlprojectmanager/qmlprojectimportwizard.cpp b/src/plugins/qmlprojectmanager/qmlprojectimportwizard.cpp index 39afe44706..640f0175e3 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectimportwizard.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectimportwizard.cpp @@ -61,7 +61,7 @@ namespace Internal { QmlProjectImportWizardDialog::QmlProjectImportWizardDialog(QWidget *parent) : Utils::Wizard(parent) { - setWindowTitle(tr("Import Existing Qt QML Directory")); + setWindowTitle(tr("Import Existing QML Directory")); // first page m_firstPage = new FileWizardPage; @@ -113,7 +113,7 @@ Core::BaseFileWizardParameters QmlProjectImportWizard::parameters() p.drawPixmap(3, 3, 16, 16, qApp->style()->standardIcon(QStyle::SP_DirIcon).pixmap(16)); parameters.setIcon(icon); } - parameters.setDisplayName(tr("Import Existing Qt QML Directory")); + parameters.setDisplayName(tr("Import Existing QML Directory")); parameters.setId(QLatin1String("QI.QML Import")); parameters.setDescription(tr("Creates a QML project from an existing directory of QML files.")); parameters.setCategory(QLatin1String(Constants::QML_WIZARD_CATEGORY)); diff --git a/src/plugins/qmlprojectmanager/qmlprojectmanager_dependencies.pri b/src/plugins/qmlprojectmanager/qmlprojectmanager_dependencies.pri index 74bc6fed60..9cdedcd2c3 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectmanager_dependencies.pri +++ b/src/plugins/qmlprojectmanager/qmlprojectmanager_dependencies.pri @@ -2,3 +2,4 @@ include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/texteditor/texteditor.pri) include(../../plugins/qmljseditor/qmljseditor.pri) include(../../plugins/debugger/debugger.pri) +include(../../plugins/qt4projectmanager/qt4projectmanager.pri) diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 3b959f83af..25f395034b 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -41,6 +41,8 @@ #include <coreplugin/ifile.h> #include <utils/synchronousprocess.h> #include <utils/pathchooser.h> +#include <qt4projectmanager/qtversionmanager.h> +#include <qt4projectmanager/qt4projectmanagerconstants.h> #include <QFormLayout> #include <QComboBox> @@ -94,20 +96,12 @@ void QmlProjectRunConfiguration::ctor() connect(em, SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(changeCurrentFile(Core::IEditor*))); - setDisplayName(tr("QML Viewer", "QMLRunConfiguration display name.")); + Qt4ProjectManager::QtVersionManager *qtVersions = Qt4ProjectManager::QtVersionManager::instance(); + connect(qtVersions, SIGNAL(qtVersionsChanged(QList<int>)), this, SLOT(updateEnabled())); + connect(qtVersions, SIGNAL(qtVersionsChanged(QList<int>)), this, SLOT(onViewerChanged())); - // prepend creator/bin dir to search path (only useful for special creator-qml package) - const QString searchPath = QCoreApplication::applicationDirPath() - + Utils::SynchronousProcess::pathSeparator() - + QString(qgetenv("PATH")); - -#ifdef Q_OS_MAC - const QString qmlViewerName = QLatin1String("QMLViewer"); -#else - const QString qmlViewerName = QLatin1String("qmlviewer"); -#endif - m_qmlViewerDefaultPath = Utils::SynchronousProcess::locateBinary(searchPath, qmlViewerName); + setDisplayName(tr("QML Viewer", "QMLRunConfiguration display name.")); } QmlProjectRunConfiguration::~QmlProjectRunConfiguration() @@ -128,7 +122,8 @@ QString QmlProjectRunConfiguration::viewerPath() const { if (!m_qmlViewerCustomPath.isEmpty()) return m_qmlViewerCustomPath; - return m_qmlViewerDefaultPath; + + return viewerDefaultPath(); } QStringList QmlProjectRunConfiguration::viewerArguments() const @@ -181,28 +176,22 @@ QWidget *QmlProjectRunConfiguration::createConfigurationWidget() Utils::PathChooser *qmlViewer = new Utils::PathChooser; qmlViewer->setExpectedKind(Utils::PathChooser::Command); - qmlViewer->setPath(viewerPath()); + qmlViewer->setPath(m_qmlViewerCustomPath); + connect(qmlViewer, SIGNAL(changed(QString)), this, SLOT(onViewerChanged())); + m_qmlViewerExecutable = new QLabel; + m_qmlViewerExecutable.data()->setText(viewerPath() + " " + m_qmlViewerArgs); + QLineEdit *qmlViewerArgs = new QLineEdit; qmlViewerArgs->setText(m_qmlViewerArgs); connect(qmlViewerArgs, SIGNAL(textChanged(QString)), this, SLOT(onViewerArgsChanged())); - QLineEdit *debugServer = new QLineEdit; - debugServer->setText(m_debugData.serverAddress); - connect(debugServer, SIGNAL(textChanged(QString)), this, SLOT(onDebugServerAddressChanged())); - - QSpinBox *debugPort = new QSpinBox; - debugPort->setMinimum(1024); // valid registered/dynamic/free ports according to http://www.iana.org/assignments/port-numbers - debugPort->setMaximum(65535); - debugPort->setValue(m_debugData.serverPort); - connect(debugPort, SIGNAL(valueChanged(int)), this, SLOT(onDebugServerPortChanged())); - form->addRow(tr("QML Viewer"), qmlViewer); form->addRow(tr("QML Viewer arguments:"), qmlViewerArgs); + form->addRow(QString(), m_qmlViewerExecutable.data()); + form->addRow(tr("Main QML File:"), m_fileListCombo.data()); - form->addRow(tr("Debugging Address:"), debugServer); - form->addRow(tr("Debugging Port:"), debugPort); return config; } @@ -267,7 +256,7 @@ void QmlProjectRunConfiguration::setMainScript(const QString &scriptFile) } else { m_usingCurrentFile = false; m_mainScriptFilename = qmlTarget()->qmlProject()->projectDir().absoluteFilePath(scriptFile); - setEnabled(true); + updateEnabled(); } } @@ -276,12 +265,19 @@ void QmlProjectRunConfiguration::onViewerChanged() if (Utils::PathChooser *chooser = qobject_cast<Utils::PathChooser *>(sender())) { m_qmlViewerCustomPath = chooser->path(); } + if (!m_qmlViewerExecutable.isNull()) { + m_qmlViewerExecutable.data()->setText(viewerPath() + " " + m_qmlViewerArgs); + } } void QmlProjectRunConfiguration::onViewerArgsChanged() { if (QLineEdit *lineEdit = qobject_cast<QLineEdit*>(sender())) m_qmlViewerArgs = lineEdit->text(); + + if (!m_qmlViewerExecutable.isNull()) { + m_qmlViewerExecutable.data()->setText(viewerPath() + " " + m_qmlViewerArgs); + } } void QmlProjectRunConfiguration::onDebugServerPortChanged() @@ -315,40 +311,79 @@ bool QmlProjectRunConfiguration::fromMap(const QVariantMap &map) return RunConfiguration::fromMap(map); } -void QmlProjectRunConfiguration::changeCurrentFile(Core::IEditor *editor) +void QmlProjectRunConfiguration::changeCurrentFile(Core::IEditor * /*editor*/) { + updateEnabled(); +} + +void QmlProjectRunConfiguration::updateEnabled() +{ + bool qmlFileFound = false; if (m_usingCurrentFile) { - bool enable = false; + Core::IEditor *editor = Core::EditorManager::instance()->currentEditor(); if (editor) { m_currentFileFilename = editor->file()->fileName(); if (Core::ICore::instance()->mimeDatabase()->findByFile(mainScript()).type() == QLatin1String("application/x-qml")) - enable = true; + qmlFileFound = true; } if (!editor || Core::ICore::instance()->mimeDatabase()->findByFile(mainScript()).type() == QLatin1String("application/x-qmlproject")) { // find a qml file with lowercase filename. This is slow but only done in initialization/other border cases. - foreach(const QString& filename, m_projectTarget->qmlProject()->files()) { + foreach(const QString &filename, m_projectTarget->qmlProject()->files()) { const QFileInfo fi(filename); if (!filename.isEmpty() && fi.baseName()[0].isLower() && Core::ICore::instance()->mimeDatabase()->findByFile(fi).type() == QLatin1String("application/x-qml")) { m_currentFileFilename = filename; - enable = true; + qmlFileFound = true; break; } } } + } else { // use default one + qmlFileFound = !m_mainScriptFilename.isEmpty(); + } - setEnabled(enable); + bool newValue = QFileInfo(viewerPath()).exists() && qmlFileFound; + + if (m_isEnabled != newValue) { + m_isEnabled = newValue; + emit isEnabledChanged(m_isEnabled); } } -void QmlProjectRunConfiguration::setEnabled(bool value) +QString QmlProjectRunConfiguration::viewerDefaultPath() const { - m_isEnabled = value; - emit isEnabledChanged(m_isEnabled); + QString path; + + // prepend creator/bin dir to search path (only useful for special creator-qml package) + const QString searchPath = QCoreApplication::applicationDirPath() + + Utils::SynchronousProcess::pathSeparator() + + QString::fromLocal8Bit(qgetenv("PATH")); + + +#ifdef Q_OS_MAC + const QString qmlViewerName = QLatin1String("QMLViewer"); +#else + const QString qmlViewerName = QLatin1String("qmlviewer"); +#endif + + path = Utils::SynchronousProcess::locateBinary(searchPath, qmlViewerName); + if (!path.isEmpty()) + return path; + + // Try to locate default path in Qt Versions + Qt4ProjectManager::QtVersionManager *qtVersions = Qt4ProjectManager::QtVersionManager::instance(); + foreach (Qt4ProjectManager::QtVersion *version, qtVersions->validVersions()) { + if (!version->qmlviewerCommand().isEmpty() + && version->supportsTargetId(Qt4ProjectManager::Constants::DESKTOP_TARGET_ID)) { + return version->qmlviewerCommand(); + } + } + + return path; } } // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h index 1782046f9e..1c3f12cd6e 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h @@ -34,6 +34,7 @@ #include <projectexplorer/runconfiguration.h> #include <QWeakPointer> #include <QComboBox> +#include <QLabel> QT_FORWARD_DECLARE_CLASS(QStringListModel); @@ -88,18 +89,19 @@ public slots: void changeCurrentFile(Core::IEditor*); private slots: - QString mainScript() const; void setMainScript(const QString &scriptFile); void updateFileComboBox(); + void updateEnabled(); + void onViewerChanged(); void onViewerArgsChanged(); void onDebugServerAddressChanged(); void onDebugServerPortChanged(); - protected: + QString viewerDefaultPath() const; QmlProjectRunConfiguration(Internal::QmlProjectTarget *parent, QmlProjectRunConfiguration *source); virtual bool fromMap(const QVariantMap &map); void setEnabled(bool value); @@ -114,13 +116,13 @@ private: QString m_scriptFile; QString m_qmlViewerCustomPath; - QString m_qmlViewerDefaultPath; QString m_qmlViewerArgs; QmlProjectRunConfigurationDebugData m_debugData; QStringListModel *m_fileListModel; // weakpointer is used to make sure we don't try to manipulate // widget which was deleted already, as can be the case here. + QWeakPointer<QLabel> m_qmlViewerExecutable; QWeakPointer<QComboBox> m_fileListCombo; Internal::QmlProjectTarget *m_projectTarget; diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp index de6e9bba30..3307df5b4c 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp @@ -37,7 +37,6 @@ #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/applicationlauncher.h> #include <utils/qtcassert.h> -#include <debugger/debuggerconstants.h> #include <debugger/debuggerconstants.h> #include <debugger/debuggeruiswitcher.h> @@ -147,8 +146,12 @@ QmlRunControlFactory::~QmlRunControlFactory() bool QmlRunControlFactory::canRun(RunConfiguration *runConfiguration, const QString &mode) const { - Q_UNUSED(mode); - return (qobject_cast<QmlProjectRunConfiguration*>(runConfiguration) != 0); + QmlProjectRunConfiguration *config = qobject_cast<QmlProjectRunConfiguration*>(runConfiguration); + if (mode == ProjectExplorer::Constants::RUNMODE) { + return config != 0; + } else { + return (config != 0) && Debugger::DebuggerUISwitcher::instance()->supportedLanguages().contains(Qml::Constants::LANG_QML); + } } RunControl *QmlRunControlFactory::create(RunConfiguration *runConfiguration, diff --git a/src/plugins/qt4projectmanager/Qt4ProjectManager.pluginspec b/src/plugins/qt4projectmanager/Qt4ProjectManager.pluginspec index b5aec34cd0..1ef60653d7 100644 --- a/src/plugins/qt4projectmanager/Qt4ProjectManager.pluginspec +++ b/src/plugins/qt4projectmanager/Qt4ProjectManager.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Qt4ProjectManager" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Qt4ProjectManager" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,11 +14,11 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Provides project type for Qt 4 pro files and tools.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="CppTools" version="2.0.80"/> - <dependency name="CppEditor" version="2.0.80"/> - <dependency name="Designer" version="2.0.80"/> - <dependency name="Debugger" version="2.0.80"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="CppTools" version="2.1.0"/> + <dependency name="CppEditor" version="2.1.0"/> + <dependency name="Designer" version="2.1.0"/> + <dependency name="Debugger" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp index a44cbb90d0..7aa32cae75 100644 --- a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp +++ b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp @@ -157,8 +157,14 @@ void GettingStartedWelcomePageWidget::updateCppExamples(const QString &examplePa QString fileName = examplePath + relativeProPath; if (!QFile::exists(fileName)) fileName = sourcePath + QLatin1String("/examples") + relativeProPath; + if (!QFile::exists(fileName)) { + continue; // might be .qmlproject + } + + QString dirName1 = dirName; + dirName1.replace(slash, QLatin1Char('-')); QString helpPath = QLatin1String("qthelp://com.trolltech.qt/qdoc/") + - dirName.replace(slash, QLatin1Char('-')) + + dirName1 + QLatin1Char('-') + fn + QLatin1String(".html"); QAction *exampleAction = subMenu->addAction(name); @@ -176,6 +182,15 @@ void GettingStartedWelcomePageWidget::updateCppExamples(const QString &examplePa break; } } + + // Remove empty categories + foreach (QAction *action, menu->actions()) { + if (QMenu *subMenu = action->menu()) { + if (subMenu->isEmpty()) { + menu->removeAction(action); + } + } + } } void GettingStartedWelcomePageWidget::updateQmlExamples(const QString &examplePath, diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index 12cbf8ab28..0125273668 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -179,7 +179,7 @@ bool QMakeStep::init() Qt4Project *pro = qt4BuildConfiguration()->qt4Target()->qt4Project(); QString proFile = pro->file()->fileName(); - m_tasks = qt4BuildConfiguration()->qtVersion()->reportIssues(proFile); + m_tasks = qt4BuildConfiguration()->qtVersion()->reportIssues(proFile, workingDirectory); m_scriptTemplate = pro->rootProjectNode()->projectType() == ScriptTemplate; return AbstractProcessStep::init(); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp index 7ff2747ddf..7d800e2e5c 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp @@ -116,7 +116,7 @@ MaemoDeviceConfig::MaemoDeviceConfig(const QSettings &settings, : name(settings.value(NameKey).toString()), type(static_cast<DeviceType>(settings.value(TypeKey, DefaultDeviceType).toInt())), gdbServerPort(settings.value(GdbServerPortKey, defaultGdbServerPort(type)).toInt()), - internalId(settings.value(InternalIdKey, nextId).toInt()) + internalId(settings.value(InternalIdKey, nextId).toULongLong()) { if (internalId == nextId) ++nextId; @@ -227,7 +227,7 @@ MaemoDeviceConfig MaemoDeviceConfigurations::find(const QString &name) const return resultIt == m_devConfigs.constEnd() ? MaemoDeviceConfig() : *resultIt; } -MaemoDeviceConfig MaemoDeviceConfigurations::find(int id) const +MaemoDeviceConfig MaemoDeviceConfigurations::find(quint64 id) const { QList<MaemoDeviceConfig>::ConstIterator resultIt = std::find_if(m_devConfigs.constBegin(), m_devConfigs.constEnd(), diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h index 7ffa28251e..0c07d3eb95 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h @@ -97,7 +97,7 @@ public: QList<MaemoDeviceConfig> devConfigs() const { return m_devConfigs; } void setDevConfigs(const QList<MaemoDeviceConfig> &devConfigs); MaemoDeviceConfig find(const QString &name) const; - MaemoDeviceConfig find(int id) const; + MaemoDeviceConfig find(quint64 id) const; signals: void updated(); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemopackagecontents.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemopackagecontents.cpp index a62c40609b..80774d0e50 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemopackagecontents.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemopackagecontents.cpp @@ -175,11 +175,9 @@ void MaemoPackageContents::fromMap(const QVariantMap &map) QString MaemoPackageContents::remoteExecutableFilePath() const { - if (m_remoteExecutableFilePath.isEmpty()) { - m_remoteExecutableFilePath = QLatin1String("/usr/local/bin/") - + m_packageStep->executableFileName(); - } - return m_remoteExecutableFilePath; + return m_remoteExecutableFilePath.isEmpty() + ? QLatin1String("/usr/local/bin/") + m_packageStep->executableFileName() + : m_remoteExecutableFilePath; } } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp index a4456c3e2b..aab42f7c2f 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp @@ -195,10 +195,6 @@ bool MaemoPackageCreationStep::createPackage() QByteArray rulesContents = rulesFile.readAll(); rulesContents.replace("DESTDIR", "INSTALL_ROOT"); - // Would be the right solution, but does not work (on Windows), - // because dpkg-genchanges doesn't know about it (and can't be told). - // rulesContents.replace("dh_builddeb", "dh_builddeb --destdir=."); - rulesFile.resize(0); rulesFile.write(rulesContents); if (rulesFile.error() != QFile::NoError) { @@ -220,30 +216,43 @@ bool MaemoPackageCreationStep::createPackage() } } - if (!runCommand(QLatin1String("dpkg-buildpackage -nc -uc -us"))) + if (!runCommand(QLatin1String("dh_installdirs"))) return false; - // Workaround for non-working dh_builddeb --destdir=. - if (!QDir(buildDir).isRoot()) { - const QString packageFileName = QFileInfo(packageFilePath()).fileName(); - const QString changesFileName = QFileInfo(packageFileName) - .completeBaseName() + QLatin1String(".changes"); - const QString packageSourceDir = buildDir + QLatin1String("/../"); - const QString packageSourceFilePath - = packageSourceDir + packageFileName; - const QString changesSourceFilePath - = packageSourceDir + changesFileName; - const QString changesTargetFilePath - = buildDir + QLatin1Char('/') + changesFileName; - QFile::remove(packageFilePath()); - QFile::remove(changesTargetFilePath); - if (!QFile::rename(packageSourceFilePath, packageFilePath()) - || !QFile::rename(changesSourceFilePath, changesTargetFilePath)) { - raiseError(tr("Packaging failed."), - tr("Could not move package files from %1 to %2.") - .arg(packageSourceDir, buildDir)); + const QDir debianRoot = QDir(buildDir % QLatin1String("/debian/") + % executableFileName().toLower()); + for (int i = 0; i < m_packageContents->rowCount(); ++i) { + const MaemoDeployable &d = m_packageContents->deployableAt(i); + const QString targetFile = debianRoot.path() + '/' + d.remoteFilePath; + const QString absTargetDir = QFileInfo(targetFile).dir().path(); + const QString relTargetDir = debianRoot.relativeFilePath(absTargetDir); + if (!debianRoot.exists(relTargetDir) + && !debianRoot.mkpath(relTargetDir)) { + raiseError(tr("Packaging Error: Could not create directory '%1'.") + .arg(QDir::toNativeSeparators(absTargetDir))); + return false; + } + if (QFile::exists(targetFile) && !QFile::remove(targetFile)) { + raiseError(tr("Packaging Error: Could not replace file '%1'.") + .arg(QDir::toNativeSeparators(targetFile))); return false; } + + if (!QFile::copy(d.localFilePath, targetFile)) { + raiseError(tr("Packaging Error: Could not copy '%1' to '%2'.") + .arg(QDir::toNativeSeparators(d.localFilePath)) + .arg(QDir::toNativeSeparators(targetFile))); + return false; + } + } + + const QStringList commands = QStringList() << QLatin1String("dh_link") + << QLatin1String("dh_fixperms") << QLatin1String("dh_installdeb") + << QLatin1String("dh_gencontrol") << QLatin1String("dh_md5sums") + << QLatin1String("dh_builddeb --destdir=."); + foreach (const QString &command, commands) { + if (!runCommand(command)) + return false; } emit addOutput(tr("Package created."), textCharFormat); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp index db90c406dd..579bf4e491 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp @@ -155,7 +155,7 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map) return false; setDeviceConfig(MaemoDeviceConfigurations::instance(). - find(map.value(DeviceIdKey, 0).toInt())); + find(map.value(DeviceIdKey, 0).toULongLong())); m_arguments = map.value(ArgumentsKey).toStringList(); getDeployTimesFromMap(map); const QDir dir = QDir(target()->project()->projectDirectory()); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp index 602cbe2c47..011e9644e9 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp @@ -98,13 +98,16 @@ MaemoSettingsWidget::MaemoSettingsWidget(QWidget *parent) m_ui(new Ui_MaemoSettingsWidget), m_devConfs(MaemoDeviceConfigurations::instance().devConfigs()), m_nameValidator(new NameValidator(m_devConfs)), - m_keyDeployer(0) + m_keyDeployer(0), + m_saveSettingsRequested(false) { initGui(); } MaemoSettingsWidget::~MaemoSettingsWidget() { + if (m_saveSettingsRequested) + MaemoDeviceConfigurations::instance().setDevConfigs(m_devConfs); } QString MaemoSettingsWidget::searchKeywords() const @@ -225,7 +228,8 @@ void MaemoSettingsWidget::fillInValues() void MaemoSettingsWidget::saveSettings() { - MaemoDeviceConfigurations::instance().setDevConfigs(m_devConfs); + // We must defer this step because of a stupid bug on MacOS. See QTCREATORBUG-1675. + m_saveSettingsRequested = true; } MaemoDeviceConfig &MaemoSettingsWidget::currentConfig() diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h index e8c676696a..d7a195f392 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.h @@ -103,6 +103,7 @@ private: MaemoDeviceConfig m_lastConfigSim; NameValidator * const m_nameValidator; MaemoSshRunner *m_keyDeployer; + bool m_saveSettingsRequested; }; } // namespace Internal diff --git a/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp b/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp index b08172cac6..d33e39b162 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp @@ -110,6 +110,10 @@ QemuRuntimeManager::QemuRuntimeManager(QObject *parent) SLOT(qemuProcessError(QProcess::ProcessError))); connect(m_qemuProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(qemuProcessFinished())); + connect(m_qemuProcess, SIGNAL(readyReadStandardOutput()), this, + SLOT(qemuOutput())); + connect(m_qemuProcess, SIGNAL(readyReadStandardError()), this, + SLOT(qemuOutput())); connect(this, SIGNAL(qemuProcessStatus(QemuStatus, QString)), this, SLOT(qemuStatusChanged(QemuStatus, QString))); } @@ -285,7 +289,7 @@ void QemuRuntimeManager::runConfigurationRemoved(ProjectExplorer::RunConfigurati void QemuRuntimeManager::runConfigurationChanged(ProjectExplorer::RunConfiguration *rc) { if (rc) - m_qemuAction->setEnabled(targetUsesRuntimeConfig(rc->target())); + m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(rc->target())); } void QemuRuntimeManager::buildConfigurationAdded(ProjectExplorer::BuildConfiguration *bc) @@ -321,7 +325,7 @@ void QemuRuntimeManager::environmentChanged() void QemuRuntimeManager::deviceConfigurationChanged(ProjectExplorer::Target *target) { - m_qemuAction->setEnabled(targetUsesRuntimeConfig(target)); + m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(target)); } void QemuRuntimeManager::startRuntime() @@ -330,52 +334,56 @@ void QemuRuntimeManager::startRuntime() Project *p = ProjectExplorerPlugin::instance()->session()->startupProject(); if (!p) return; - - Qt4Target *qt4Target = qobject_cast<Qt4Target*> (p->activeTarget()); - if (!qt4Target) - return; - - Qt4BuildConfiguration *bc = qt4Target->activeBuildConfiguration(); - if (!bc) + QtVersion *version; + if (!targetUsesMatchingRuntimeConfig(p->activeTarget(), &version)) { + qWarning("Strange: Qemu button was enabled, but target does not match."); return; + } - QtVersion *version = bc->qtVersion(); - if (version && m_runtimes.contains(version->uniqueId())) { - m_runningQtId = version->uniqueId(); - const QString root = - QDir::toNativeSeparators(maddeRoot(version->qmakeCommand()) + m_runningQtId = version->uniqueId(); + const QString root + = QDir::toNativeSeparators(maddeRoot(version->qmakeCommand()) + QLatin1Char('/')); - const Runtime rt = m_runtimes.value(version->uniqueId()); - QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + const Runtime rt = m_runtimes.value(version->uniqueId()); + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); #ifdef Q_OS_WIN - const QLatin1Char colon(';'); - const QLatin1String key("PATH"); - env.insert(key, env.value(key) % colon % root % QLatin1String("bin")); - env.insert(key, env.value(key) % colon % root % QLatin1String("madlib")); + const QLatin1Char colon(';'); + const QLatin1String key("PATH"); + env.insert(key, env.value(key) % colon % root % QLatin1String("bin")); + env.insert(key, env.value(key) % colon % root % QLatin1String("madlib")); #elif defined(Q_OS_UNIX) - const QLatin1String key("LD_LIBRARY_PATH"); - env.insert(key, env.value(key) % QLatin1Char(':') % rt.m_libPath); -#endif - m_qemuProcess->setProcessEnvironment(env); - m_qemuProcess->setWorkingDirectory(rt.m_root); - - const QString app = root + (QFileInfo(rt.m_bin).isRelative() +# if defined(Q_OS_MAC) + const QLatin1String key("DYLD_LIBRARY_PATH"); +# else + const QLatin1String key("LD_LIBRARY_PATH"); +# endif // MAC + env.insert(key, env.value(key) % QLatin1Char(':') % rt.m_libPath); +#endif // WIN/UNIX + m_qemuProcess->setProcessEnvironment(env); + m_qemuProcess->setWorkingDirectory(rt.m_root); + + // This is complex because of extreme MADDE weirdness. + const bool pathIsRelative = QFileInfo(rt.m_bin).isRelative(); + const QString app = +#ifdef Q_OS_WIN + root % (pathIsRelative ? QLatin1String("madlib/") % rt.m_bin // Fremantle. : rt.m_bin) // Haramattan. -#ifdef Q_OS_WIN - % QLatin1String(".exe") + % QLatin1String(".exe"); +#else + pathIsRelative + ? root % QLatin1String("madlib/") % rt.m_bin // Fremantle. + : rt.m_bin; // Haramattan. #endif - ; // keep - m_qemuProcess->start(app % QLatin1Char(' ') % rt.m_args, - QIODevice::ReadWrite); - if (!m_qemuProcess->waitForStarted()) - return; + m_qemuProcess->start(app % QLatin1Char(' ') % rt.m_args, + QIODevice::ReadWrite); + if (!m_qemuProcess->waitForStarted()) + return; - emit qemuProcessStatus(QemuStarting); - connect(m_qemuAction, SIGNAL(triggered()), this, SLOT(terminateRuntime())); - disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime())); - } + emit qemuProcessStatus(QemuStarting); + connect(m_qemuAction, SIGNAL(triggered()), this, SLOT(terminateRuntime())); + disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime())); } void QemuRuntimeManager::terminateRuntime() @@ -395,14 +403,20 @@ void QemuRuntimeManager::qemuProcessFinished() { m_runningQtId = -1; QemuStatus status = QemuFinished; + QString error; if (!m_userTerminated) { - status = m_qemuProcess->exitStatus() == QProcess::CrashExit - ? QemuCrashed : QemuFinished; + if (m_qemuProcess->exitStatus() == QProcess::CrashExit) { + status = QemuCrashed; + error = m_qemuProcess->errorString(); + } else if (m_qemuProcess->exitCode() != 0) { + error = tr("Qemu finished with error: Exit code was %1.") + .arg(m_qemuProcess->exitCode()); + } } m_userTerminated = false; - emit qemuProcessStatus(status); + emit qemuProcessStatus(status, error); } void QemuRuntimeManager::qemuProcessError(QProcess::ProcessError error) @@ -427,6 +441,7 @@ void QemuRuntimeManager::qemuStatusChanged(QemuStatus status, const QString &err message = tr("Qemu crashed"); break; case QemuFinished: + message = error; break; case QemuUserReason: message = error; @@ -440,6 +455,12 @@ void QemuRuntimeManager::qemuStatusChanged(QemuStatus status, const QString &err updateStarterIcon(running); } +void QemuRuntimeManager::qemuOutput() +{ + qDebug("%s", m_qemuProcess->readAllStandardOutput().data()); + qDebug("%s", m_qemuProcess->readAllStandardError().data()); +} + // -- private void QemuRuntimeManager::setupRuntimes() @@ -492,7 +513,7 @@ void QemuRuntimeManager::toggleStarterButton(Target *target) isRunning = false; m_qemuAction->setEnabled(m_runtimes.contains(uniqueId) - && targetUsesRuntimeConfig(target) && !isRunning); + && targetUsesMatchingRuntimeConfig(target) && !isRunning); } bool QemuRuntimeManager::sessionHasMaemoTarget() const @@ -505,19 +526,28 @@ bool QemuRuntimeManager::sessionHasMaemoTarget() const return result; } -bool QemuRuntimeManager::targetUsesRuntimeConfig(Target *target) +bool QemuRuntimeManager::targetUsesMatchingRuntimeConfig(Target *target, + QtVersion **qtVersion) { if (!target) return false; MaemoRunConfiguration *mrc = qobject_cast<MaemoRunConfiguration *> (target->activeRunConfiguration()); - if (mrc) { - const MaemoDeviceConfig &config = mrc->deviceConfig(); - if (config.isValid() && config.type == MaemoDeviceConfig::Simulator) - return true; - } - return false; + if (!mrc) + return false; + Qt4BuildConfiguration *bc + = qobject_cast<Qt4BuildConfiguration *>(target->activeBuildConfiguration()); + if (!bc) + return false; + QtVersion *version = bc->qtVersion(); + if (!version || !m_runtimes.contains(version->uniqueId())) + return false; + + if (qtVersion) + *qtVersion = version; + const MaemoDeviceConfig &config = mrc->deviceConfig(); + return config.isValid() && config.type == MaemoDeviceConfig::Simulator; } QString QemuRuntimeManager::maddeRoot(const QString &qmake) const diff --git a/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.h b/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.h index 3af6d60e25..f395a867a5 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.h +++ b/src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.h @@ -110,6 +110,7 @@ private slots: void qemuProcessFinished(); void qemuProcessError(QProcess::ProcessError error); void qemuStatusChanged(QemuStatus status, const QString &error); + void qemuOutput(); private: void setupRuntimes(); @@ -117,7 +118,8 @@ private: void updateStarterIcon(bool running); void toggleStarterButton(ProjectExplorer::Target *target); - bool targetUsesRuntimeConfig(ProjectExplorer::Target *target); + bool targetUsesMatchingRuntimeConfig(ProjectExplorer::Target *target, + QtVersion **qtVersion = 0); QString maddeRoot(const QString &qmake) const; QString targetRoot(const QString &qmake) const; diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp index 087b621946..ff4d540511 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devices.cpp @@ -524,25 +524,41 @@ QList<ProjectExplorer::HeaderPath> S60ToolChainMixin::epocHeaderPaths() const rc << ProjectExplorer::HeaderPath(epocRootPath, ProjectExplorer::HeaderPath::GlobalHeaderPath) + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("include"), + ProjectExplorer::HeaderPath::GlobalHeaderPath) + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("mkspecs/common/symbian"), + ProjectExplorer::HeaderPath::GlobalHeaderPath) + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include"), + ProjectExplorer::HeaderPath::GlobalHeaderPath) + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/osextensions/stdapis"), + ProjectExplorer::HeaderPath::GlobalHeaderPath) + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/osextensions/stdapis/sys"), + ProjectExplorer::HeaderPath::GlobalHeaderPath) << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/stdapis"), ProjectExplorer::HeaderPath::GlobalHeaderPath) << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/stdapis/sys"), ProjectExplorer::HeaderPath::GlobalHeaderPath) - << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/stdapis/stlportv5"), + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/osextensions/stdapis/stlport"), + ProjectExplorer::HeaderPath::GlobalHeaderPath) + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/stdapis/stlport"), + ProjectExplorer::HeaderPath::GlobalHeaderPath) + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/oem"), + ProjectExplorer::HeaderPath::GlobalHeaderPath) + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/middleware"), ProjectExplorer::HeaderPath::GlobalHeaderPath) - << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/mw"), + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/domain/middleware"), ProjectExplorer::HeaderPath::GlobalHeaderPath) - << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/platform/mw"), + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/osextensions"), ProjectExplorer::HeaderPath::GlobalHeaderPath) - << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/platform"), + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/domain/osextensions"), ProjectExplorer::HeaderPath::GlobalHeaderPath) - << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/platform/loc"), + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/domain/osextensions/loc"), ProjectExplorer::HeaderPath::GlobalHeaderPath) - << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/platform/mw/loc"), + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/domain/middleware/loc"), ProjectExplorer::HeaderPath::GlobalHeaderPath) - << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/platform/loc/sc"), + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/domain/osextensions/loc/sc"), ProjectExplorer::HeaderPath::GlobalHeaderPath) - << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/platform/mw/loc/sc"), + << ProjectExplorer::HeaderPath(epocRootPath + QLatin1String("epoc32/include/domain/middleware/loc/sc"), ProjectExplorer::HeaderPath::GlobalHeaderPath); return rc; } diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index fd34df2e73..7d3f74054b 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -1489,7 +1489,7 @@ TargetInformation Qt4ProFileNode::targetInformation(ProFileReader *reader) const result.workingDir = QDir::cleanPath(result.workingDir); QString wd = result.workingDir; - if (!reader->contains("DESTDIR") + if ( (!reader->contains("DESTDIR") || reader->value("DESTDIR") == ".") && reader->values("CONFIG").contains("debug_and_release") && reader->values("CONFIG").contains("debug_and_release_target")) { // If we don't have a destdir and debug and release is set diff --git a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp index 3aacc1bde2..7036038267 100644 --- a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp +++ b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp @@ -341,18 +341,35 @@ void Qt4ProjectConfigWidget::updateImportLabel() } } - QString sourceDirectory = - m_buildConfiguration->target()->project()->projectDirectory(); - if (!sourceDirectory.endsWith('/')) - sourceDirectory.append('/'); - bool invalidBuildDirectory = m_buildConfiguration->shadowBuild() - && m_buildConfiguration->buildDirectory().startsWith(sourceDirectory); - - if (invalidBuildDirectory) { + QString buildDirectory = m_buildConfiguration->target()->project()->projectDirectory();; + if (m_buildConfiguration->shadowBuild()) + buildDirectory = m_buildConfiguration->buildDirectory(); + QList<ProjectExplorer::Task> issues = m_buildConfiguration->qtVersion()->reportIssues(m_buildConfiguration->target()->project()->file()->fileName(), + buildDirectory); + + if (!issues.isEmpty()) { m_ui->problemLabel->setVisible(true); m_ui->warningLabel->setVisible(true); m_ui->importLabel->setVisible(visible); - m_ui->problemLabel->setText(tr("Building in subdirectories of the source directory is not supported by qmake.")); + QString text = "<nobr>"; + foreach (const ProjectExplorer::Task &task, issues) { + QString type; + switch (task.type) { + case ProjectExplorer::Task::Error: + type = tr("Error: "); + break; + case ProjectExplorer::Task::Warning: + type = tr("Warning: "); + break; + case ProjectExplorer::Task::Unknown: + default: + break; + } + if (!text.endsWith(QLatin1String("br>"))) + text.append(QLatin1String("<br>")); + text.append(type + task.description); + } + m_ui->problemLabel->setText(text); } else if (targetMatches) { m_ui->problemLabel->setVisible(false); m_ui->warningLabel->setVisible(false); diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.pri b/src/plugins/qt4projectmanager/qt4projectmanager.pri new file mode 100644 index 0000000000..34db66a9c4 --- /dev/null +++ b/src/plugins/qt4projectmanager/qt4projectmanager.pri @@ -0,0 +1,3 @@ +include(qt4projectmanager_dependencies.pri) + +LIBS *= -l$$qtLibraryTarget(Qt4ProjectManager) diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.pro b/src/plugins/qt4projectmanager/qt4projectmanager.pro index f4c492ac33..28f45408b6 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.pro +++ b/src/plugins/qt4projectmanager/qt4projectmanager.pro @@ -1,5 +1,6 @@ TEMPLATE = lib TARGET = Qt4ProjectManager +DEFINES += QT4PROJECTMANAGER_LIBRARY QT += network include(../../qtcreatorplugin.pri) include(qt4projectmanager_dependencies.pri) @@ -44,7 +45,8 @@ HEADERS += qt4projectmanagerplugin.h \ gettingstartedwelcomepage.h \ qt4buildconfiguration.h \ qt4target.h \ - qmakeparser.h + qmakeparser.h \ + qt4projectmanager_global.h SOURCES += qt4projectmanagerplugin.cpp \ qt4projectmanager.cpp \ qt4project.cpp \ diff --git a/src/plugins/qt4projectmanager/qt4projectmanager_global.h b/src/plugins/qt4projectmanager/qt4projectmanager_global.h new file mode 100644 index 0000000000..54880b014c --- /dev/null +++ b/src/plugins/qt4projectmanager/qt4projectmanager_global.h @@ -0,0 +1,41 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef QT4PROJECTMANAGER_GLOBAL_H +#define QT4PROJECTMANAGER_GLOBAL_H + +#include <QtCore/qglobal.h> + +#if defined(QT4PROJECTMANAGER_LIBRARY) +# define QT4PROJECTMANAGER_EXPORT Q_DECL_EXPORT +#else +# define QT4PROJECTMANAGER_EXPORT Q_DECL_IMPORT +#endif + +#endif // QT4PROJECTMANAGER_GLOBAL_H diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 02246c7c98..06b9d18ecd 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -638,10 +638,14 @@ bool QtVersion::supportsShadowBuilds() const } QList<ProjectExplorer::Task> -QtVersion::reportIssues(const QString &proFile) +QtVersion::reportIssues(const QString &proFile, const QString &buildDir) { QList<ProjectExplorer::Task> results; + QString tmpBuildDir = buildDir; + if (!buildDir.endsWith(QChar('/'))) + tmpBuildDir.append(QChar('/')); + if (!isValid()) { //: %1: Reason for being invalid const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", "The Qt version is invalid: %1").arg(invalidReason()); @@ -659,6 +663,26 @@ QtVersion::reportIssues(const QString &proFile) QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); } + QString sourcePath = QFileInfo(proFile).absolutePath(); + if (!sourcePath.endsWith(QChar('/'))) + sourcePath.append(QChar('/')); + + if ((tmpBuildDir.startsWith(sourcePath)) && (tmpBuildDir != sourcePath)) { + const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", + "Qmake does not support build directories below the source directory."); + results.append(ProjectExplorer::Task(ProjectExplorer::Task::Warning, msg, QString(), -1, + QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); + } else if (tmpBuildDir.count(QChar('/')) != sourcePath.count(QChar('/'))) { + // FIXME: We currently are in string freeze, so I have to reuse some existing text! + // const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", + // "The build directory needs to be at the same level as the source directory."); + const QString msg = QCoreApplication::translate("Qt4ProjectManager::QtVersion", + "Qmake does not support build directories below the source directory."); + + results.append(ProjectExplorer::Task(ProjectExplorer::Task::Warning, msg, QString(), -1, + QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); + } + QSet<QString> targets = supportedTargetIds(); if (targets.contains(Constants::S60_DEVICE_TARGET_ID) || targets.contains(Constants::S60_EMULATOR_TARGET_ID)) @@ -725,6 +749,7 @@ void QtVersion::setQMakeCommand(const QString& qmakeCommand) #endif m_designerCommand.clear(); m_linguistCommand.clear(); + m_qmlviewerCommand.clear(); m_uicCommand.clear(); m_toolChainUpToDate = false; // TODO do i need to optimize this? @@ -1178,6 +1203,22 @@ QString QtVersion::linguistCommand() const return m_linguistCommand; } +QString QtVersion::qmlviewerCommand() const +{ + if (!isValid()) + return QString(); + if (m_qmlviewerCommand.isNull()) { +#ifdef Q_OS_MAC + const QString qmlViewerName = QLatin1String("QMLViewer"); +#else + const QString qmlViewerName = QLatin1String("qmlviewer"); +#endif + + m_qmlviewerCommand = findQtBinary(possibleGuiBinaries(qmlViewerName)); + } + return m_qmlviewerCommand; +} + bool QtVersion::supportsTargetId(const QString &id) const { updateToolChainAndMkspec(); diff --git a/src/plugins/qt4projectmanager/qtversionmanager.h b/src/plugins/qt4projectmanager/qtversionmanager.h index 6ccacad406..fe4484ce3b 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.h +++ b/src/plugins/qt4projectmanager/qtversionmanager.h @@ -30,6 +30,7 @@ #ifndef QTVERSIONMANAGER_H #define QTVERSIONMANAGER_H +#include "qt4projectmanager_global.h" #include <projectexplorer/taskwindow.h> #include <projectexplorer/toolchain.h> #include <QSharedPointer> @@ -45,7 +46,7 @@ class QtOptionsPageWidget; class QtOptionsPage; } -class QtVersion +class QT4PROJECTMANAGER_EXPORT QtVersion { friend class QtVersionManager; public: @@ -70,6 +71,7 @@ public: QString uicCommand() const; QString designerCommand() const; QString linguistCommand() const; + QString qmlviewerCommand() const; bool supportsTargetId(const QString &id) const; QSet<QString> supportedTargetIds() const; @@ -147,7 +149,7 @@ public: /// its symbian setup. /// @return a list of tasks, ordered on severity (errors first, then /// warnings and finally info items. - QList<ProjectExplorer::Task> reportIssues(const QString &proFile); + QList<ProjectExplorer::Task> reportIssues(const QString &proFile, const QString &buildDir); private: QList<QSharedPointer<ProjectExplorer::ToolChain> > toolChains() const; @@ -189,6 +191,7 @@ private: mutable QString m_uicCommand; mutable QString m_designerCommand; mutable QString m_linguistCommand; + mutable QString m_qmlviewerCommand; mutable QSet<QString> m_targetIds; }; @@ -199,7 +202,7 @@ struct QMakeAssignment QString value; }; -class QtVersionManager : public QObject +class QT4PROJECTMANAGER_EXPORT QtVersionManager : public QObject { Q_OBJECT // for getUniqueId(); diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp index 111dea1c0c..491a6a5c2b 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp @@ -130,10 +130,20 @@ void TargetSetupPage::setImportInfos(const QList<ImportInfo> &infos) foreach (const ImportInfo &i, m_infos) { ++pos; + QString buildDir; + if (i.directory.isEmpty()) { + if (i.version->supportsShadowBuilds()) + buildDir = Qt4Target::defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(m_proFilePath), t); + else + buildDir = Qt4Project::projectDirectory(m_proFilePath); + } else { + buildDir = i.directory; + } + if (!i.version->supportsTargetId(t)) continue; QTreeWidgetItem *versionItem = new QTreeWidgetItem(targetItem); - QPair<QIcon, QString> issues = reportIssues(i.version); + QPair<QIcon, QString> issues = reportIssues(i.version, buildDir); QString toolTip = i.version->displayName(); if (!issues.second.isEmpty()) @@ -168,17 +178,9 @@ void TargetSetupPage::setImportInfos(const QList<ImportInfo> &infos) versionItem->setToolTip(1, status); // Column 2 (directory): - QString dir; - if (i.directory.isEmpty()) { - if (i.version->supportsShadowBuilds()) - dir = QDir::toNativeSeparators(Qt4Target::defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(m_proFilePath), t)); - else - dir = QDir::toNativeSeparators(Qt4Project::projectDirectory(m_proFilePath)); - } else { - dir = QDir::toNativeSeparators(i.directory); - } - versionItem->setText(2, dir); - versionItem->setToolTip(2, dir); + buildDir = QDir::toNativeSeparators(buildDir); + versionItem->setText(2, buildDir); + versionItem->setToolTip(2, buildDir); } } @@ -353,7 +355,7 @@ TargetSetupPage::recursivelyCheckDirectoryForBuild(const QString &directory, con { QList<ImportInfo> results; - if (maxdepth <= 0) + if (maxdepth <= 0 || directory.isEmpty()) return results; // Check for in-source builds first: @@ -441,7 +443,8 @@ void TargetSetupPage::resetInfos() m_infos.clear(); } -QPair<QIcon, QString> TargetSetupPage::reportIssues(Qt4ProjectManager::QtVersion *version) +QPair<QIcon, QString> TargetSetupPage::reportIssues(Qt4ProjectManager::QtVersion *version, + const QString &buildDir) { if (m_proFilePath.isEmpty()) return qMakePair(QIcon(), QString()); @@ -450,7 +453,7 @@ QPair<QIcon, QString> TargetSetupPage::reportIssues(Qt4ProjectManager::QtVersion ->getObject<ProjectExplorer::TaskWindow>(); QTC_ASSERT(taskWindow, return qMakePair(QIcon(), QString())); - QList<ProjectExplorer::Task> issues = version->reportIssues(m_proFilePath); + QList<ProjectExplorer::Task> issues = version->reportIssues(m_proFilePath, buildDir); QString text; diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.h b/src/plugins/qt4projectmanager/wizards/targetsetuppage.h index 27985d7622..9749422638 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.h +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.h @@ -121,7 +121,7 @@ private slots: private: void resetInfos(); - QPair<QIcon, QString> reportIssues(QtVersion *version); + QPair<QIcon, QString> reportIssues(QtVersion *version, const QString &buildDir); QList<ImportInfo> m_infos; bool m_preferMobile; diff --git a/src/plugins/regexp/RegExp.pluginspec b/src/plugins/regexp/RegExp.pluginspec index 00486fe352..bdd6b12655 100644 --- a/src/plugins/regexp/RegExp.pluginspec +++ b/src/plugins/regexp/RegExp.pluginspec @@ -1,4 +1,4 @@ -<plugin name="RegExp" version="2.0.80" compatVersion="2.0.80"> +<plugin name="RegExp" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -13,6 +13,6 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Regular Expression test widget.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/resourceeditor/ResourceEditor.pluginspec b/src/plugins/resourceeditor/ResourceEditor.pluginspec index b0fe4bf5bb..09c5c9fd39 100644 --- a/src/plugins/resourceeditor/ResourceEditor.pluginspec +++ b/src/plugins/resourceeditor/ResourceEditor.pluginspec @@ -1,4 +1,4 @@ -<plugin name="ResourceEditor" version="2.0.80" compatVersion="2.0.80"> +<plugin name="ResourceEditor" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,6 +14,6 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Editor for qrc files.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/snippets/Snippets.pluginspec b/src/plugins/snippets/Snippets.pluginspec index cf910ce9d0..af6c6440d4 100644 --- a/src/plugins/snippets/Snippets.pluginspec +++ b/src/plugins/snippets/Snippets.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Snippets" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Snippets" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -13,8 +13,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Code snippet plugin.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/subversion/Subversion.pluginspec b/src/plugins/subversion/Subversion.pluginspec index 60025cd9bd..141b0ff58e 100644 --- a/src/plugins/subversion/Subversion.pluginspec +++ b/src/plugins/subversion/Subversion.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Subversion" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Subversion" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,9 +14,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Subversion integration.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> - <dependency name="Core" version="2.0.80"/> - <dependency name="VCSBase" version="2.0.80"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="VCSBase" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/texteditor/TextEditor.pluginspec b/src/plugins/texteditor/TextEditor.pluginspec index 5086f05338..5ffa77efbb 100644 --- a/src/plugins/texteditor/TextEditor.pluginspec +++ b/src/plugins/texteditor/TextEditor.pluginspec @@ -1,4 +1,4 @@ -<plugin name="TextEditor" version="2.0.80" compatVersion="2.0.80"> +<plugin name="TextEditor" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,8 +14,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Text editor framework and the implementation of the basic text editor.</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> - <dependency name="Find" version="2.0.80"/> - <dependency name="Locator" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="Find" version="2.1.0"/> + <dependency name="Locator" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 601e64555c..b856d941eb 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -760,22 +760,22 @@ void BaseTextEditor::gotoLineEndWithSelection() void BaseTextEditor::gotoNextLine() { - moveCursor(QTextCursor::NextRow); + moveCursor(QTextCursor::Down); } void BaseTextEditor::gotoNextLineWithSelection() { - moveCursor(QTextCursor::NextRow, QTextCursor::KeepAnchor); + moveCursor(QTextCursor::Down, QTextCursor::KeepAnchor); } void BaseTextEditor::gotoPreviousLine() { - moveCursor(QTextCursor::PreviousRow); + moveCursor(QTextCursor::Up); } void BaseTextEditor::gotoPreviousLineWithSelection() { - moveCursor(QTextCursor::PreviousRow, QTextCursor::KeepAnchor); + moveCursor(QTextCursor::Up, QTextCursor::KeepAnchor); } void BaseTextEditor::gotoPreviousCharacter() diff --git a/src/plugins/vcsbase/VCSBase.pluginspec b/src/plugins/vcsbase/VCSBase.pluginspec index 5ac48dedea..cc6b6a274f 100644 --- a/src/plugins/vcsbase/VCSBase.pluginspec +++ b/src/plugins/vcsbase/VCSBase.pluginspec @@ -1,4 +1,4 @@ -<plugin name="VCSBase" version="2.0.80" compatVersion="2.0.80"> +<plugin name="VCSBase" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,8 +14,8 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Version Control System Base Plugin</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> - <dependency name="TextEditor" version="2.0.80"/> - <dependency name="ProjectExplorer" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> + <dependency name="TextEditor" version="2.1.0"/> + <dependency name="ProjectExplorer" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/plugins/welcome/Welcome.pluginspec b/src/plugins/welcome/Welcome.pluginspec index 14ecc57862..2c51d8af2f 100644 --- a/src/plugins/welcome/Welcome.pluginspec +++ b/src/plugins/welcome/Welcome.pluginspec @@ -1,4 +1,4 @@ -<plugin name="Welcome" version="2.0.80" compatVersion="2.0.80"> +<plugin name="Welcome" version="2.1.0" compatVersion="2.1.0"> <vendor>Nokia Corporation</vendor> <copyright>(C) 2010 Nokia Corporation</copyright> <license> @@ -14,6 +14,6 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General <description>Default Welcome Screen Plugin</description> <url>http://qt.nokia.com</url> <dependencyList> - <dependency name="Core" version="2.0.80"/> + <dependency name="Core" version="2.1.0"/> </dependencyList> </plugin> diff --git a/src/tools/qml/qmldump/main.cpp b/src/tools/qml/qmldump/main.cpp index adf3bf5395..4dcdb0156c 100644 --- a/src/tools/qml/qmldump/main.cpp +++ b/src/tools/qml/qmldump/main.cpp @@ -9,7 +9,10 @@ #include <QDebug> #include <iostream> #include <QtDeclarative> +#include <QtCore/private/qobject_p.h> +#include <QtCore/private/qmetaobject_p.h> #include <QtDeclarative/private/qdeclarativemetatype_p.h> +#include <QtDeclarative/private/qdeclarativeopenmetaobject_p.h> #include <QtDeclarative/QDeclarativeView> static QHash<QByteArray, const QDeclarativeType *> qmlTypeByCppName; @@ -46,7 +49,11 @@ void processMetaObject(const QMetaObject *meta, QSet<const QMetaObject *> *metas if (! meta || metas->contains(meta)) return; - metas->insert(meta); + // dynamic meta objects break things badly + const QMetaObjectPrivate *mop = reinterpret_cast<const QMetaObjectPrivate *>(meta->d.data); + if (!(mop->flags & DynamicMetaObject)) + metas->insert(meta); + processMetaObject(meta->superClass(), metas); } @@ -275,17 +282,35 @@ int main(int argc, char *argv[]) metas.insert(FriendlyQObject::qtMeta()); - // ### TODO: We don't treat extended types correctly. Currently only hits the - // QDeclarativeGraphicsWidget extension to QGraphicsWidget + QMultiHash<QByteArray, QByteArray> extensions; foreach (const QDeclarativeType *ty, QDeclarativeMetaType::qmlTypes()) { - if (ty->isExtendedType()) - continue; - - cppToQml.insert(ty->metaObject()->className(), ty->qmlTypeName()); qmlTypeByCppName.insert(ty->metaObject()->className(), ty); + if (ty->isExtendedType()) { + extensions.insert(ty->typeName(), ty->metaObject()->className()); + } else { + cppToQml.insert(ty->metaObject()->className(), ty->qmlTypeName()); + } processDeclarativeType(ty, &metas); } + // Adjust qml names of extended objects. + // The chain ends up being: + // __extended__.originalname - the base object + // __extension_0_.originalname - first extension + // .. + // __extension_n-2_.originalname - second to last extension + // originalname - last extension + foreach (const QByteArray &extendedCpp, extensions.keys()) { + const QByteArray extendedQml = cppToQml.value(extendedCpp); + cppToQml.insert(extendedCpp, "__extended__." + extendedQml); + QList<QByteArray> extensionCppNames = extensions.values(extendedCpp); + for (int i = 0; i < extensionCppNames.size() - 1; ++i) { + QByteArray adjustedName = QString("__extension__%1.%2").arg(QString::number(i), QString(extendedQml)).toAscii(); + cppToQml.insert(extensionCppNames.value(i), adjustedName); + } + cppToQml.insert(extensionCppNames.last(), extendedQml); + } + foreach (const QDeclarativeType *ty, QDeclarativeMetaType::qmlTypes()) { if (ty->isExtendedType()) continue; |