Merge remote-tracking branch 'origin/2.5'

Conflicts:
	src/libs/qmljsdebugclient/qmlprofilereventlist.cpp

Change-Id: Ic6251d47ecd032ea1db4fc58dc80e19b6e6cf23d
This commit is contained in:
Eike Ziller
2012-03-15 15:01:54 +01:00
67 changed files with 283 additions and 161 deletions

2
dist/changes-2.5.0 vendored
View File

@@ -31,7 +31,7 @@ Editing
* Fix position of code-assist popup when cursor is outside viewport * Fix position of code-assist popup when cursor is outside viewport
(QTCREATORBUG-6843) (QTCREATORBUG-6843)
* Add experimental plugin for showing "TODO"s in files * Add experimental plugin for showing "TODO"s in files
[by Dmitry Savchenko] [by Dmitry Savchenko, initial version by Vasiliy Sorokin]
* Add "Open with" context menu in resource editor (QTCREATORBUG-4224) * Add "Open with" context menu in resource editor (QTCREATORBUG-4224)
* Add task indicators in the left margin of a line * Add task indicators in the left margin of a line

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 839 B

After

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 826 B

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -44,7 +44,7 @@
\o \l{Creating a Qt Quick Application} \o \l{Creating a Qt Quick Application}
Learn about the basic Qt Quick concepts and QML elements. Learn about the basic Qt Quick concepts and QML elements.
\o \l{Creating a Qt Quick Application Using Qt Quick Components} \o \l{Using Qt Quick Components}
Learn how to develop a Qt Quick application for mobile devices. Learn how to develop a Qt Quick application for mobile devices.

View File

@@ -82,9 +82,8 @@
\list 1 \list 1
\o In the \gui Projects pane, open the project file (.pro). \o In the \gui Projects pane, right-click the project name to open the
context menu and select
\o Right-click in the code editor to open the context menu and select
\gui {Add Library}. \gui {Add Library}.
\o Follow the instructions of the wizard. \o Follow the instructions of the wizard.
@@ -102,7 +101,7 @@
\list 1 \list 1
\o Choose \gui {File > New File or Project > Other Projects > \o Choose \gui {File > New File or Project > Libraries >
C++ Library} to create the library. C++ Library} to create the library.
The \gui {Introduction and Product Location} dialog opens. The \gui {Introduction and Product Location} dialog opens.
@@ -118,10 +117,8 @@
\gui {Project Management} dialog. In the \gui {Add to project} \gui {Project Management} dialog. In the \gui {Add to project}
list, select a project. For example, \bold myapp. list, select a project. For example, \bold myapp.
\o In the \gui Projects pane, open the project file (.pro). \o In the \gui Projects pane, right-click the project name to open the
For example, \bold myapp.pro. context menu and select
\o Right-click in the code editor to open the context menu and select
\gui {Add Library > Internal Library > Next}. \gui {Add Library > Internal Library > Next}.
\o In the \gui Library field, select \bold mylib and click \gui Next. \o In the \gui Library field, select \bold mylib and click \gui Next.

View File

@@ -39,7 +39,7 @@
To view and modify the settings for currently open projects, switch to the To view and modify the settings for currently open projects, switch to the
\gui Projects mode by pressing \key Ctrl+5. \gui Projects mode by pressing \key Ctrl+5.
\image qtcreator-projectpane.png \image qtcreator-project-targets.png
You can add a target if the development environment for the target platform You can add a target if the development environment for the target platform
is installed on the development PC and the Qt version is configured. Click is installed on the development PC and the Qt version is configured. Click
@@ -60,19 +60,19 @@
\list \list
\o If you have installed the development environment for only
one target, the \gui Targets tab is replaced by a \gui Build
tab and a \gui Run tab.
\o If you have not configured the project for building, the
\gui Targets tab is replaced by the \l{Opening Projects}
{Configure Projects} tab.
\endlist
\o \l{Specifying Build Settings}{Build Settings} \o \l{Specifying Build Settings}{Build Settings}
\o \l{Specifying Run Settings}{Run Settings} \o \l{Specifying Run Settings}{Run Settings}
\endlist
\note If you have installed the development environment for only
one target, the \gui Targets tab is replaced by a \gui Build
tab and a \gui Run tab.
If you have not configured the project for building, the
\gui Targets tab is replaced by the \l{Opening Projects}
{Configure Projects} tab.
\o \l{Specifying Editor Settings}{Editor Settings} \o \l{Specifying Editor Settings}{Editor Settings}
\o \l{Specifying Code Style Settings}{Code Style Settings} \o \l{Specifying Code Style Settings}{Code Style Settings}

View File

@@ -136,7 +136,7 @@
\o \l{Tutorials} \o \l{Tutorials}
\list \list
\o \l{Creating a Qt Quick Application} \o \l{Creating a Qt Quick Application}
\o \l{Creating a Qt Quick Application Using Qt Quick Components} \o \l{Using Qt Quick Components}
\o \l{Creating a Qt Widget Based Application} \o \l{Creating a Qt Widget Based Application}
\endlist \endlist
\endlist \endlist

View File

@@ -31,7 +31,7 @@
\page creator-qml-components-example.html \page creator-qml-components-example.html
\nextpage creator-writing-program.html \nextpage creator-writing-program.html
\title Creating a Qt Quick Application Using Qt Quick Components \title Using Qt Quick Components
\note To complete this tutorial, you must install the Qt Quick Components \note To complete this tutorial, you must install the Qt Quick Components
for Symbian and the Symbian Anna target as part of the \QSDK. In addition, for Symbian and the Symbian Anna target as part of the \QSDK. In addition,
@@ -50,17 +50,14 @@
\list 1 \list 1
\o Select \gui{File > New File or Project > Qt Quick Project > Qt Quick \o Select \gui{File > New File or Project > Applications > Qt Quick
Application > Choose}. Application for Symbian > Choose}.
\o In the \gui{Name} field, type \bold {BatteryStatus}. \o In the \gui{Name} field, type \bold {BatteryStatus}.
\o In the \gui {Create in} field, enter the path for the project files. \o In the \gui {Create in} field, enter the path for the project files.
For example, \c {C:\Qt\examples}, and then click \gui{Next}. For example, \c {C:\Qt\examples}, and then click \gui{Next}.
\o In the \gui {Application Type} dialog, select \gui {Qt Quick
Components for Symbian}, and then click \gui{Next}.
\o Select \gui {Symbian Device} and \gui {\QS} targets, and \o Select \gui {Symbian Device} and \gui {\QS} targets, and
then click \gui{Next}. then click \gui{Next}.

View File

@@ -45,7 +45,7 @@
\list 1 \list 1
\o Select \gui{File > New File or Project > Qt Widget Project > Qt Gui \o Select \gui{File > New File or Project > Applications > Qt Gui
Application > Choose}. Application > Choose}.
\image qtcreator-new-qt-gui-application.png "New File or Project dialog" \image qtcreator-new-qt-gui-application.png "New File or Project dialog"

View File

@@ -245,6 +245,7 @@ def main():
sys.exit(2) sys.exit(2)
QT_INSTALL_LIBS = readQmakeVar(qmake_bin, 'QT_INSTALL_LIBS') QT_INSTALL_LIBS = readQmakeVar(qmake_bin, 'QT_INSTALL_LIBS')
QT_INSTALL_BINS = readQmakeVar(qmake_bin, 'QT_INSTALL_BINS')
QT_INSTALL_PLUGINS = readQmakeVar(qmake_bin, 'QT_INSTALL_PLUGINS') QT_INSTALL_PLUGINS = readQmakeVar(qmake_bin, 'QT_INSTALL_PLUGINS')
QT_INSTALL_IMPORTS = readQmakeVar(qmake_bin, 'QT_INSTALL_IMPORTS') QT_INSTALL_IMPORTS = readQmakeVar(qmake_bin, 'QT_INSTALL_IMPORTS')
QT_INSTALL_TRANSLATIONS = readQmakeVar(qmake_bin, 'QT_INSTALL_TRANSLATIONS') QT_INSTALL_TRANSLATIONS = readQmakeVar(qmake_bin, 'QT_INSTALL_TRANSLATIONS')
@@ -257,6 +258,9 @@ def main():
global debug_build global debug_build
debug_build = is_debug_build(install_dir) debug_build = is_debug_build(install_dir)
if sys.platform.startswith('win'):
copy_qt_libs(install_dir, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, plugins, imports)
else:
copy_qt_libs(install_dir, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, plugins, imports) copy_qt_libs(install_dir, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, plugins, imports)
copy_translations(install_dir, QT_INSTALL_TRANSLATIONS, tr_catalogs) copy_translations(install_dir, QT_INSTALL_TRANSLATIONS, tr_catalogs)

View File

@@ -99,7 +99,7 @@ QString Html5ApplicationViewerPrivate::adjustPath(const QString &path)
} }
#endif #endif
#endif #endif
return path; return QFileInfo(path).absoluteFilePath();
} }
void Html5ApplicationViewerPrivate::quit() void Html5ApplicationViewerPrivate::quit()
@@ -130,7 +130,7 @@ Html5ApplicationViewer::~Html5ApplicationViewer()
void Html5ApplicationViewer::loadFile(const QString &fileName) void Html5ApplicationViewer::loadFile(const QString &fileName)
{ {
m_d->m_webView->setUrl(QUrl(Html5ApplicationViewerPrivate::adjustPath(fileName))); m_d->m_webView->setUrl(QUrl::fromLocalFile(Html5ApplicationViewerPrivate::adjustPath(fileName)));
} }
void Html5ApplicationViewer::loadUrl(const QUrl &url) void Html5ApplicationViewer::loadUrl(const QUrl &url)

View File

@@ -21220,7 +21220,7 @@ Fehler: %2</translation>
</message> </message>
<message> <message>
<source>Import build from %1.</source> <source>Import build from %1.</source>
<translation>Build aus %1. importieren.</translation> <translation>Build aus %1 importieren.</translation>
</message> </message>
<message> <message>
<source>Already imported build</source> <source>Already imported build</source>

View File

@@ -115,6 +115,7 @@ Item {
} }
Column { Column {
y: -4
x: parent.margin + 8 x: parent.margin + 8
//y: parent.margin //y: parent.margin
id: innerColumn id: innerColumn
@@ -149,7 +150,7 @@ Item {
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
maximumLineCount: 2 maximumLineCount: 2
elide: Text.ElideRight elide: Text.ElideRight
height: font.pixelSize * 2 + 4 height: lineCount == 2 ? font.pixelSize * 2 + 4 : font.pixelSize + 2
color: "#6b6b6b" color: "#6b6b6b"
width: delegate.ListView.view.width - 48 width: delegate.ListView.view.width - 48
MouseArea { MouseArea {
@@ -220,7 +221,6 @@ Item {
} }
Item { Item {
x: delegate.ListView.view.width - 65 x: delegate.ListView.view.width - 65
width: 38 width: 38
height: 20 height: 20

View File

@@ -76,8 +76,7 @@ Item {
anchors.fill: parent anchors.fill: parent
verticalMinimumValue: vscrollbar.minimumValue verticalMinimumValue: vscrollbar.minimumValue
verticalMaximumValue: vscrollbar.maximumValue verticalMaximumValue: vscrollbar.maximumValue
onVerticalValueChanged: root.contentY = verticalValue
onVerticalValueChanged: root.contentY = Math.round(verticalValue / root.delegateHeight) * root.delegateHeight
} }
ScrollBar { ScrollBar {
@@ -92,7 +91,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
singleStep: root.delegateHeight singleStep: root.delegateHeight
anchors.topMargin: styleitem.style === "mac" ? 1 : 0 anchors.topMargin: styleitem.style === "mac" ? 1 : 0
onValueChanged: root.contentY = Math.round(value / root.delegateHeight) * root.delegateHeight onValueChanged: root.contentY = value
anchors.rightMargin: styleitem.frameoffset anchors.rightMargin: styleitem.frameoffset
anchors.bottomMargin: styleitem.frameoffset anchors.bottomMargin: styleitem.frameoffset
value: root.contentY value: root.contentY

View File

@@ -64,6 +64,7 @@ public:
ProjectInfo(QPointer<ProjectExplorer::Project> project) ProjectInfo(QPointer<ProjectExplorer::Project> project)
: project(project) : project(project)
, tryQmlDump(false)
{ } { }
operator bool() const operator bool() const

View File

@@ -333,7 +333,9 @@ Core::IWizard *NewDialog::showDialog()
const int retVal = exec(); const int retVal = exec();
idx = m_ui->templateCategoryView->currentIndex(); idx = m_ui->templateCategoryView->currentIndex();
lastCategory = m_model->itemFromIndex(m_twoLevelProxyModel->mapToSource(idx))->data(Qt::UserRole).toString(); QStandardItem *currentItem = m_model->itemFromIndex(m_twoLevelProxyModel->mapToSource(idx));
if (currentItem)
lastCategory = currentItem->data(Qt::UserRole).toString();
if (retVal != Accepted) if (retVal != Accepted)
return 0; return 0;

View File

@@ -2381,7 +2381,10 @@ bool CPPEditorWidget::handleDocumentationComment(QKeyEvent *e)
if (followinPos == text.length() if (followinPos == text.length()
|| text.at(followinPos) != QLatin1Char('*')) { || text.at(followinPos) != QLatin1Char('*')) {
QString newLine(QLatin1Char('\n')); QString newLine(QLatin1Char('\n'));
newLine.append(QString(offset, QLatin1Char(' '))); QTextCursor c(cursor);
c.movePosition(QTextCursor::StartOfBlock);
c.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, offset);
newLine.append(c.selectedText());
if (text.at(offset) == QLatin1Char('/')) { if (text.at(offset) == QLatin1Char('/')) {
newLine.append(QLatin1String(" *")); newLine.append(QLatin1String(" *"));
} else { } else {

View File

@@ -56,7 +56,6 @@ DoxygenGenerator::DoxygenGenerator()
, m_generateBrief(true) , m_generateBrief(true)
, m_startComment(true) , m_startComment(true)
, m_style(QtStyle) , m_style(QtStyle)
, m_commentOffset(0)
{} {}
void DoxygenGenerator::setStyle(DocumentationStyle style) void DoxygenGenerator::setStyle(DocumentationStyle style)
@@ -308,16 +307,11 @@ void DoxygenGenerator::assignCommentOffset(QTextCursor cursor)
cursor.setPosition(cursor.anchor()); cursor.setPosition(cursor.anchor());
} }
m_commentOffset = cursor.positionInBlock(); cursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor);
m_commentOffset = cursor.selectedText();
} }
QString DoxygenGenerator::offsetString() const QString DoxygenGenerator::offsetString() const
{ {
// Note: Currently we don't indent comments, but simply preserve them in the original return m_commentOffset;
// relative positions. What we do here is just to make sure that such positions are correct,
// although they might still be wrong from an indentation point of view (for instance,
// using spaces instead of tabs). Therefore, the content generated should still have
// the indentation strings fixed.
return QString(m_commentOffset, QLatin1Char(' '));
} }

View File

@@ -95,7 +95,7 @@ private:
bool m_startComment; bool m_startComment;
DocumentationStyle m_style; DocumentationStyle m_style;
CPlusPlus::Overview m_printer; CPlusPlus::Overview m_printer;
int m_commentOffset; QString m_commentOffset;
}; };
} // CppTools } // CppTools

View File

@@ -75,8 +75,9 @@ public:
virtual void changeBreakpoint(const BreakpointModelId &id) = 0; virtual void changeBreakpoint(const BreakpointModelId &id) = 0;
virtual void synchronizeBreakpoints() = 0; virtual void synchronizeBreakpoints() = 0;
virtual void assignValueInDebugger(const QByteArray expr, const quint64 &id, virtual void assignValueInDebugger(const WatchData *data,
const QString &property, const QString &value) = 0; const QString &expression,
const QVariant &valueV) = 0;
virtual void updateWatchData(const WatchData &data) = 0; virtual void updateWatchData(const WatchData &data) = 0;
virtual void executeDebuggerCommand(const QString &command) = 0; virtual void executeDebuggerCommand(const QString &command) = 0;

View File

@@ -119,11 +119,13 @@ private:
InteractiveInterpreter m_interpreter; InteractiveInterpreter m_interpreter;
bool m_validContext; bool m_validContext;
QHash<QString,BreakpointModelId> pendingBreakpoints; QHash<QString,BreakpointModelId> pendingBreakpoints;
bool m_retryOnConnectFail;
}; };
QmlEnginePrivate::QmlEnginePrivate(QmlEngine *q) QmlEnginePrivate::QmlEnginePrivate(QmlEngine *q)
: m_adapter(q), : m_adapter(q),
m_validContext(false) m_validContext(false),
m_retryOnConnectFail(false)
{} {}
class ASTWalker: public Visitor class ASTWalker: public Visitor
@@ -344,15 +346,15 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters,
connect(&d->m_outputParser, SIGNAL(waitingForConnectionViaOst()), connect(&d->m_outputParser, SIGNAL(waitingForConnectionViaOst()),
this, SLOT(beginConnection())); this, SLOT(beginConnection()));
connect(&d->m_outputParser, SIGNAL(noOutputMessage()), connect(&d->m_outputParser, SIGNAL(noOutputMessage()),
this, SLOT(beginConnection())); this, SLOT(tryToConnect()));
connect(&d->m_outputParser, SIGNAL(errorMessage(QString)), connect(&d->m_outputParser, SIGNAL(errorMessage(QString)),
this, SLOT(connectionStartupFailed(QString))); this, SLOT(appStartupFailed(QString)));
// Only wait 8 seconds for the 'Waiting for connection' on application ouput, then just try to connect // Only wait 8 seconds for the 'Waiting for connection' on application ouput, then just try to connect
// (application output might be redirected / blocked) // (application output might be redirected / blocked)
d->m_noDebugOutputTimer.setSingleShot(true); d->m_noDebugOutputTimer.setSingleShot(true);
d->m_noDebugOutputTimer.setInterval(8000); d->m_noDebugOutputTimer.setInterval(8000);
connect(&d->m_noDebugOutputTimer, SIGNAL(timeout()), this, SLOT(beginConnection())); connect(&d->m_noDebugOutputTimer, SIGNAL(timeout()), this, SLOT(tryToConnect()));
qtMessageLogHandler()->setHasEditableRow(true); qtMessageLogHandler()->setHasEditableRow(true);
@@ -360,6 +362,9 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters,
SIGNAL(documentUpdated(QmlJS::Document::Ptr)), SIGNAL(documentUpdated(QmlJS::Document::Ptr)),
this, this,
SLOT(documentUpdated(QmlJS::Document::Ptr))); SLOT(documentUpdated(QmlJS::Document::Ptr)));
// we won't get any debug output
d->m_retryOnConnectFail = startParameters.useTerminal;
} }
QmlEngine::~QmlEngine() QmlEngine::~QmlEngine()
@@ -409,6 +414,12 @@ void QmlEngine::connectionEstablished()
notifyEngineRunAndInferiorRunOk(); notifyEngineRunAndInferiorRunOk();
} }
void QmlEngine::tryToConnect(quint16 port)
{
d->m_retryOnConnectFail = true;
beginConnection(port);
}
void QmlEngine::beginConnection(quint16 port) void QmlEngine::beginConnection(quint16 port)
{ {
d->m_noDebugOutputTimer.stop(); d->m_noDebugOutputTimer.stop();
@@ -434,7 +445,7 @@ void QmlEngine::beginConnection(quint16 port)
} }
} }
void QmlEngine::connectionStartupFailed(const QString &errorMessage) void QmlEngine::connectionStartupFailed()
{ {
if (isSlaveEngine()) { if (isSlaveEngine()) {
if (masterEngine()->state() != InferiorRunOk) { if (masterEngine()->state() != InferiorRunOk) {
@@ -443,23 +454,19 @@ void QmlEngine::connectionStartupFailed(const QString &errorMessage)
return; return;
} }
} }
if (d->m_retryOnConnectFail) {
beginConnection();
return;
}
QMessageBox *infoBox = new QMessageBox(Core::ICore::mainWindow()); QMessageBox *infoBox = new QMessageBox(Core::ICore::mainWindow());
infoBox->setIcon(QMessageBox::Critical); infoBox->setIcon(QMessageBox::Critical);
infoBox->setWindowTitle(tr("Qt Creator")); infoBox->setWindowTitle(tr("Qt Creator"));
if (qobject_cast<QmlAdapter *>(sender())) {
infoBox->setText(tr("Could not connect to the in-process QML debugger." infoBox->setText(tr("Could not connect to the in-process QML debugger."
"\nDo you want to retry?")); "\nDo you want to retry?"));
infoBox->setStandardButtons(QMessageBox::Retry | QMessageBox::Cancel | infoBox->setStandardButtons(QMessageBox::Retry | QMessageBox::Cancel |
QMessageBox::Help); QMessageBox::Help);
infoBox->setDefaultButton(QMessageBox::Retry); infoBox->setDefaultButton(QMessageBox::Retry);
}
if (qobject_cast<QmlJsDebugClient::QDeclarativeOutputParser *>(sender())) {
infoBox->setText(tr("Could not connect to the in-process QML debugger."
"\n%1").arg(errorMessage));
infoBox->setStandardButtons(QMessageBox::Ok | QMessageBox::Help);
infoBox->setDefaultButton(QMessageBox::Ok);
}
infoBox->setModal(true); infoBox->setModal(true);
connect(infoBox, SIGNAL(finished(int)), connect(infoBox, SIGNAL(finished(int)),
@@ -468,6 +475,22 @@ void QmlEngine::connectionStartupFailed(const QString &errorMessage)
infoBox->show(); infoBox->show();
} }
void QmlEngine::appStartupFailed(const QString &errorMessage)
{
QMessageBox *infoBox = new QMessageBox(Core::ICore::mainWindow());
infoBox->setIcon(QMessageBox::Critical);
infoBox->setWindowTitle(tr("Qt Creator"));
infoBox->setText(tr("Could not connect to the in-process QML debugger."
"\n%1").arg(errorMessage));
infoBox->setStandardButtons(QMessageBox::Ok | QMessageBox::Help);
infoBox->setDefaultButton(QMessageBox::Ok);
connect(infoBox, SIGNAL(finished(int)),
this, SLOT(errorMessageBoxFinished(int)));
infoBox->show();
notifyEngineRunFailed();
}
void QmlEngine::errorMessageBoxFinished(int result) void QmlEngine::errorMessageBoxFinished(int result)
{ {
switch (result) { switch (result) {
@@ -484,7 +507,7 @@ void QmlEngine::errorMessageBoxFinished(int result)
if (state() == InferiorRunOk) { if (state() == InferiorRunOk) {
notifyInferiorSpontaneousStop(); notifyInferiorSpontaneousStop();
notifyInferiorIll(); notifyInferiorIll();
} else { } else if (state() == EngineRunRequested) {
notifyEngineRunFailed(); notifyEngineRunFailed();
} }
break; break;
@@ -576,6 +599,8 @@ void QmlEngine::runEngine()
beginConnection(); beginConnection();
else else
startApplicationLauncher(); startApplicationLauncher();
} else {
d->m_noDebugOutputTimer.start();
} }
} }
@@ -973,9 +998,10 @@ bool QmlEngine::setToolTipExpression(const QPoint &mousePos,
void QmlEngine::assignValueInDebugger(const WatchData *data, void QmlEngine::assignValueInDebugger(const WatchData *data,
const QString &expression, const QVariant &valueV) const QString &expression, const QVariant &valueV)
{ {
quint64 objectId = data->id; if (!expression.isEmpty() && d->m_adapter.activeDebuggerClient()) {
if (objectId > 0 && !expression.isEmpty() && d->m_adapter.activeDebuggerClient()) { d->m_adapter.activeDebuggerClient()->assignValueInDebugger(data,
d->m_adapter.activeDebuggerClient()->assignValueInDebugger(expression.toUtf8(), objectId, expression, valueV.toString()); expression,
valueV);
} }
} }

View File

@@ -161,9 +161,11 @@ signals:
TextEditor::ITextEditor *editor, int cursorPos); TextEditor::ITextEditor *editor, int cursorPos);
private slots: private slots:
void tryToConnect(quint16 port = 0);
void beginConnection(quint16 port = 0); void beginConnection(quint16 port = 0);
void connectionEstablished(); void connectionEstablished();
void connectionStartupFailed(const QString &errorMessage = QString()); void connectionStartupFailed();
void appStartupFailed(const QString &errorMessage);
void connectionError(QAbstractSocket::SocketError error); void connectionError(QAbstractSocket::SocketError error);
void serviceConnectionError(const QString &service); void serviceConnectionError(const QString &service);
void appendMessage(const QString &msg, Utils::OutputFormat); void appendMessage(const QString &msg, Utils::OutputFormat);

View File

@@ -1153,11 +1153,12 @@ void QmlV8DebuggerClient::synchronizeBreakpoints()
//NOT USED //NOT USED
} }
void QmlV8DebuggerClient::assignValueInDebugger(const QByteArray /*expr*/, const quint64 &/*id*/, void QmlV8DebuggerClient::assignValueInDebugger(const WatchData * /*data*/,
const QString &property, const QString &value) const QString &expr,
const QVariant &valueV)
{ {
StackHandler *stackHandler = d->engine->stackHandler(); StackHandler *stackHandler = d->engine->stackHandler();
QString expression = QString(_("%1 = %2;")).arg(property).arg(value); QString expression = QString(_("%1 = %2;")).arg(expr).arg(valueV.toString());
if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) { if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) {
d->evaluate(expression, false, false, stackHandler->currentIndex()); d->evaluate(expression, false, false, stackHandler->currentIndex());
} else { } else {
@@ -1309,6 +1310,14 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
BreakpointModelId id = d->breakpointsSync.take(seq); BreakpointModelId id = d->breakpointsSync.take(seq);
d->breakpoints.insert(id, index); d->breakpoints.insert(id, index);
//Is actual position info present? Then breakpoint was
//accepted
const QVariantList actualLocations =
breakpointData.value(
_("actual_locations")).toList();
if (actualLocations.count()) {
//The breakpoint requested line should be same as
//actual line
BreakHandler *handler = d->engine->breakHandler(); BreakHandler *handler = d->engine->breakHandler();
if (handler->state(id) != BreakpointInserted) { if (handler->state(id) != BreakpointInserted) {
BreakpointResponse br = handler->response(id); BreakpointResponse br = handler->response(id);
@@ -1317,6 +1326,7 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
handler->setResponse(id, br); handler->setResponse(id, br);
handler->notifyBreakpointInsertOk(id); handler->notifyBreakpointInsertOk(id);
} }
}
} else { } else {
@@ -1480,6 +1490,12 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
br.functionName = invocationText; br.functionName = invocationText;
handler->setResponse(id, br); handler->setResponse(id, br);
} }
if (handler->state(id) != BreakpointInserted) {
br.lineNumber = breakData.value(
_("sourceLine")).toInt() + 1;
handler->setResponse(id, br);
handler->notifyBreakpointInsertOk(id);
}
} }
} }
} }

View File

@@ -87,8 +87,9 @@ public:
void changeBreakpoint(const BreakpointModelId &id); void changeBreakpoint(const BreakpointModelId &id);
void synchronizeBreakpoints(); void synchronizeBreakpoints();
void assignValueInDebugger(const QByteArray expr, const quint64 &id, void assignValueInDebugger(const WatchData *data,
const QString &property, const QString &value); const QString &expression,
const QVariant &valueV);
void updateWatchData(const WatchData &); void updateWatchData(const WatchData &);
void executeDebuggerCommand(const QString &command); void executeDebuggerCommand(const QString &command);

View File

@@ -222,7 +222,9 @@ void QScriptDebuggerClient::startSession()
//Set all breakpoints //Set all breakpoints
BreakHandler *handler = d->engine->breakHandler(); BreakHandler *handler = d->engine->breakHandler();
foreach (BreakpointModelId id, handler->engineBreakpointIds(d->engine)) { DebuggerEngine * engine = d->engine->isSlaveEngine() ?
d->engine->masterEngine() : d->engine;
foreach (BreakpointModelId id, handler->engineBreakpointIds(engine)) {
QTC_CHECK(handler->state(id) == BreakpointInsertProceeding); QTC_CHECK(handler->state(id) == BreakpointInsertProceeding);
handler->notifyBreakpointInsertOk(id); handler->notifyBreakpointInsertOk(id);
} }
@@ -313,17 +315,19 @@ void QScriptDebuggerClient::synchronizeBreakpoints()
sendMessage(reply); sendMessage(reply);
} }
void QScriptDebuggerClient::assignValueInDebugger(const QByteArray expr, const quint64 &id, void QScriptDebuggerClient::assignValueInDebugger(const WatchData *data,
const QString &property, const QString &value) const QString &expr,
const QVariant &valueV)
{ {
QByteArray reply; QByteArray reply;
QDataStream rs(&reply, QIODevice::WriteOnly); QDataStream rs(&reply, QIODevice::WriteOnly);
QByteArray cmd = "SET_PROPERTY"; QByteArray cmd = "EXEC";
rs << cmd; rs << cmd;
rs << expr << id << property << value; QString expression = QString(_("%1 = %2;")).arg(expr).arg(valueV.toString());
d->logSendMessage(QString::fromLatin1("%1 %2 %3 %4 %5"). rs << data->iname << expression;
arg(QLatin1String(cmd), QLatin1String(expr), d->logSendMessage(QString::fromLatin1("%1 %2 %3 %4").
QString::number(id), property, value)); arg(QLatin1String(cmd), QLatin1String(data->iname), expr,
valueV.toString()));
sendMessage(reply); sendMessage(reply);
} }
@@ -365,6 +369,10 @@ void QScriptDebuggerClient::synchronizeWatchers(const QStringList &watchers)
void QScriptDebuggerClient::expandObject(const QByteArray &iname, quint64 objectId) void QScriptDebuggerClient::expandObject(const QByteArray &iname, quint64 objectId)
{ {
//Check if id is valid
if (qint64(objectId) == -1)
return;
QByteArray reply; QByteArray reply;
QDataStream rs(&reply, QIODevice::WriteOnly); QDataStream rs(&reply, QIODevice::WriteOnly);
QByteArray cmd = "EXPAND"; QByteArray cmd = "EXPAND";
@@ -431,7 +439,8 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
data.iname = d->engine->watchHandler()->watcherName(data.exp); data.iname = d->engine->watchHandler()->watcherName(data.exp);
d->engine->watchHandler()->insertData(data); d->engine->watchHandler()->insertData(data);
if (d->engine->watchHandler()->expandedINames().contains(data.iname)) { if (d->engine->watchHandler()->expandedINames().contains(data.iname) &&
qint64(data.id) != -1) {
needPing = true; needPing = true;
expandObject(data.iname,data.id); expandObject(data.iname,data.id);
} }
@@ -441,7 +450,8 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
data.iname = "local." + data.exp; data.iname = "local." + data.exp;
d->engine->watchHandler()->insertData(data); d->engine->watchHandler()->insertData(data);
if (d->engine->watchHandler()->expandedINames().contains(data.iname)) { if (d->engine->watchHandler()->expandedINames().contains(data.iname) &&
qint64(data.id) != -1) {
needPing = true; needPing = true;
expandObject(data.iname,data.id); expandObject(data.iname,data.id);
} }
@@ -511,6 +521,9 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
d->engine->watchHandler()->insertData(data); d->engine->watchHandler()->insertData(data);
} else if (iname == "console") { } else if (iname == "console") {
d->engine->showMessage(data.value, QtMessageLogOutput); d->engine->showMessage(data.value, QtMessageLogOutput);
} else if (iname.startsWith("local.")) {
data.name = data.name.left(data.name.indexOf(QLatin1Char(' ')));
d->engine->watchHandler()->insertData(data);
} else { } else {
qWarning() << "QmlEngine: Unexcpected result: " << iname << data.value; qWarning() << "QmlEngine: Unexcpected result: " << iname << data.value;
} }
@@ -527,7 +540,8 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
data.iname = iname + '.' + data.exp; data.iname = iname + '.' + data.exp;
d->engine->watchHandler()->insertData(data); d->engine->watchHandler()->insertData(data);
if (d->engine->watchHandler()->expandedINames().contains(data.iname)) { if (d->engine->watchHandler()->expandedINames().contains(data.iname) &&
qint64(data.id) != -1) {
needPing = true; needPing = true;
expandObject(data.iname, data.id); expandObject(data.iname, data.id);
} }
@@ -552,7 +566,8 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
data.iname = d->engine->watchHandler()->watcherName(data.exp); data.iname = d->engine->watchHandler()->watcherName(data.exp);
d->engine->watchHandler()->insertData(data); d->engine->watchHandler()->insertData(data);
if (d->engine->watchHandler()->expandedINames().contains(data.iname)) { if (d->engine->watchHandler()->expandedINames().contains(data.iname) &&
qint64(data.id) != -1) {
needPing = true; needPing = true;
expandObject(data.iname, data.id); expandObject(data.iname, data.id);
} }
@@ -561,7 +576,8 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
foreach (WatchData data, locals) { foreach (WatchData data, locals) {
data.iname = "local." + data.exp; data.iname = "local." + data.exp;
d->engine->watchHandler()->insertData(data); d->engine->watchHandler()->insertData(data);
if (d->engine->watchHandler()->expandedINames().contains(data.iname)) { if (d->engine->watchHandler()->expandedINames().contains(data.iname) &&
qint64(data.id) != -1) {
needPing = true; needPing = true;
expandObject(data.iname, data.id); expandObject(data.iname, data.id);
} }

View File

@@ -72,8 +72,8 @@ public:
void changeBreakpoint(const BreakpointModelId &id); void changeBreakpoint(const BreakpointModelId &id);
void synchronizeBreakpoints(); void synchronizeBreakpoints();
void assignValueInDebugger(const QByteArray expr, const quint64 &id, void assignValueInDebugger(const WatchData *data, const QString &expression,
const QString &property, const QString &value); const QVariant &valueV);
void updateWatchData(const WatchData &data); void updateWatchData(const WatchData &data);
void executeDebuggerCommand(const QString &command); void executeDebuggerCommand(const QString &command);

View File

@@ -107,7 +107,7 @@ SourceAgentPrivate::~SourceAgentPrivate()
} }
SourceAgent::SourceAgent(DebuggerEngine *engine) SourceAgent::SourceAgent(DebuggerEngine *engine)
: QObject(0), d(new SourceAgentPrivate) : d(new SourceAgentPrivate)
{ {
d->engine = engine; d->engine = engine;
} }

View File

@@ -33,7 +33,7 @@
#ifndef DEBUGGER_SOURCE_AGENT_H #ifndef DEBUGGER_SOURCE_AGENT_H
#define DEBUGGER_SOURCE_AGENT_H #define DEBUGGER_SOURCE_AGENT_H
#include <QObject> #include <QString>
namespace Debugger { namespace Debugger {
@@ -42,7 +42,7 @@ class DebuggerEngine;
namespace Internal { namespace Internal {
class SourceAgentPrivate; class SourceAgentPrivate;
class SourceAgent : public QObject class SourceAgent
{ {
public: public:
explicit SourceAgent(Debugger::DebuggerEngine *engine); explicit SourceAgent(Debugger::DebuggerEngine *engine);

View File

@@ -72,8 +72,11 @@ enum { debugModel = 0 };
#define MODEL_DEBUG(s) do { if (debugModel) qDebug() << s; } while (0) #define MODEL_DEBUG(s) do { if (debugModel) qDebug() << s; } while (0)
#define MODEL_DEBUGX(s) qDebug() << s #define MODEL_DEBUGX(s) qDebug() << s
QHash<QByteArray, int> WatchHandler::m_watcherNames; static QHash<QByteArray, int> theWatcherNames;
QHash<QByteArray, int> WatchHandler::m_typeFormats; static QHash<QByteArray, int> theTypeFormats;
static QHash<QByteArray, int> theIndividualFormats;
static int theUnprintableBase = -1;
static QByteArray stripForFormat(const QByteArray &ba) static QByteArray stripForFormat(const QByteArray &ba)
{ {
@@ -97,17 +100,15 @@ static QByteArray stripForFormat(const QByteArray &ba)
return res; return res;
} }
static int m_unprintableBase = -1;
void WatchHandler::setUnprintableBase(int base) void WatchHandler::setUnprintableBase(int base)
{ {
m_unprintableBase = base; theUnprintableBase = base;
emitAllChanged(); emitAllChanged();
} }
int WatchHandler::unprintableBase() int WatchHandler::unprintableBase()
{ {
return m_unprintableBase; return theUnprintableBase;
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@@ -706,10 +707,10 @@ static QString truncateValue(QString v)
int WatchModel::itemFormat(const WatchData &data) const int WatchModel::itemFormat(const WatchData &data) const
{ {
const int individualFormat = m_handler->m_individualFormats.value(data.iname, -1); const int individualFormat = theIndividualFormats.value(data.iname, -1);
if (individualFormat != -1) if (individualFormat != -1)
return individualFormat; return individualFormat;
return m_handler->m_typeFormats.value(stripForFormat(data.type), -1); return theTypeFormats.value(stripForFormat(data.type), -1);
} }
static inline QString expression(const WatchItem *item) static inline QString expression(const WatchItem *item)
@@ -733,8 +734,10 @@ QString WatchModel::display(const WatchItem *item, int col) const
QString result; QString result;
switch (col) { switch (col) {
case 0: case 0:
if (item->name.isEmpty()) if (m_type == WatchersWatch && item->name.isEmpty())
result = tr("<Edit>"); result = tr("<Edit>");
else if (m_type == ReturnWatch && item->iname.count('.') == 1)
result = tr("returned value");
else if (item->name == QLatin1String("*") && item->parent) else if (item->name == QLatin1String("*") && item->parent)
result = QLatin1Char('*') + item->parent->name; result = QLatin1Char('*') + item->parent->name;
else else
@@ -837,10 +840,10 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
return QString::fromLatin1(data.type); return QString::fromLatin1(data.type);
case LocalsTypeFormatRole: case LocalsTypeFormatRole:
return m_handler->m_typeFormats.value(stripForFormat(data.type), -1); return theTypeFormats.value(stripForFormat(data.type), -1);
case LocalsIndividualFormatRole: case LocalsIndividualFormatRole:
return m_handler->m_individualFormats.value(data.iname, -1); return theIndividualFormats.value(data.iname, -1);
case LocalsRawValueRole: case LocalsRawValueRole:
return data.value; return data.value;
@@ -911,9 +914,9 @@ bool WatchModel::setData(const QModelIndex &index, const QVariant &value, int ro
case LocalsIndividualFormatRole: { case LocalsIndividualFormatRole: {
const int format = value.toInt(); const int format = value.toInt();
if (format == -1) { if (format == -1) {
m_handler->m_individualFormats.remove(data.iname); theIndividualFormats.remove(data.iname);
} else { } else {
m_handler->m_individualFormats[data.iname] = format; theIndividualFormats[data.iname] = format;
} }
engine()->updateWatchData(data); engine()->updateWatchData(data);
break; break;
@@ -1249,9 +1252,9 @@ QDebug operator<<(QDebug d, const WatchModel &m)
void WatchModel::formatRequests(QByteArray *out, const WatchItem *item) const void WatchModel::formatRequests(QByteArray *out, const WatchItem *item) const
{ {
int format = m_handler->m_individualFormats.value(item->iname, -1); int format = theIndividualFormats.value(item->iname, -1);
if (format == -1) if (format == -1)
format = m_handler->m_typeFormats.value(stripForFormat(item->type), -1); format = theTypeFormats.value(stripForFormat(item->type), -1);
if (format != -1) if (format != -1)
*out += item->iname + ":format=" + QByteArray::number(format) + ','; *out += item->iname + ":format=" + QByteArray::number(format) + ',';
foreach (const WatchItem *child, item->children) foreach (const WatchItem *child, item->children)
@@ -1311,7 +1314,7 @@ void WatchHandler::endCycle()
void WatchHandler::cleanup() void WatchHandler::cleanup()
{ {
m_expandedINames.clear(); m_expandedINames.clear();
m_watcherNames.remove(QByteArray()); theWatcherNames.remove(QByteArray());
m_return->reinitialize(); m_return->reinitialize();
m_locals->reinitialize(); m_locals->reinitialize();
m_tooltips->reinitialize(); m_tooltips->reinitialize();
@@ -1429,21 +1432,21 @@ void WatchHandler::removeData(const QByteArray &iname)
QByteArray WatchHandler::watcherName(const QByteArray &exp) QByteArray WatchHandler::watcherName(const QByteArray &exp)
{ {
return "watch." + QByteArray::number(m_watcherNames[exp]); return "watch." + QByteArray::number(theWatcherNames[exp]);
} }
void WatchHandler::watchExpression(const QString &exp) void WatchHandler::watchExpression(const QString &exp)
{ {
QTC_ASSERT(m_engine, return); QTC_ASSERT(m_engine, return);
// Do not insert the same entry more then once. // Do not insert the same entry more then once.
if (m_watcherNames.value(exp.toLatin1())) if (theWatcherNames.value(exp.toLatin1()))
return; return;
// FIXME: 'exp' can contain illegal characters // FIXME: 'exp' can contain illegal characters
WatchData data; WatchData data;
data.exp = exp.toLatin1(); data.exp = exp.toLatin1();
data.name = exp; data.name = exp;
m_watcherNames[data.exp] = m_watcherCounter++; theWatcherNames[data.exp] = m_watcherCounter++;
saveWatchers(); saveWatchers();
if (exp.isEmpty()) if (exp.isEmpty())
@@ -1560,12 +1563,12 @@ void WatchHandler::showEditValue(const WatchData &data)
void WatchHandler::clearWatches() void WatchHandler::clearWatches()
{ {
if (m_watcherNames.isEmpty()) if (theWatcherNames.isEmpty())
return; return;
const QList<WatchItem *> watches = m_watchers->rootItem()->children; const QList<WatchItem *> watches = m_watchers->rootItem()->children;
for (int i = watches.size() - 1; i >= 0; i--) for (int i = watches.size() - 1; i >= 0; i--)
m_watchers->destroyItem(watches.at(i)); m_watchers->destroyItem(watches.at(i));
m_watcherNames.clear(); theWatcherNames.clear();
m_watcherCounter = 0; m_watcherCounter = 0;
updateWatchersWindow(); updateWatchersWindow();
emitAllChanged(); emitAllChanged();
@@ -1576,7 +1579,7 @@ void WatchHandler::removeWatchExpression(const QString &exp0)
{ {
QByteArray exp = exp0.toLatin1(); QByteArray exp = exp0.toLatin1();
MODEL_DEBUG("REMOVE WATCH: " << exp); MODEL_DEBUG("REMOVE WATCH: " << exp);
m_watcherNames.remove(exp); theWatcherNames.remove(exp);
foreach (WatchItem *item, m_watchers->rootItem()->children) { foreach (WatchItem *item, m_watchers->rootItem()->children) {
if (item->exp == exp) { if (item->exp == exp) {
m_watchers->destroyItem(item); m_watchers->destroyItem(item);
@@ -1598,7 +1601,7 @@ QStringList WatchHandler::watchedExpressions()
{ {
// Filter out invalid watchers. // Filter out invalid watchers.
QStringList watcherNames; QStringList watcherNames;
QHashIterator<QByteArray, int> it(m_watcherNames); QHashIterator<QByteArray, int> it(theWatcherNames);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
const QByteArray &watcherName = it.key(); const QByteArray &watcherName = it.key();
@@ -1621,14 +1624,14 @@ void WatchHandler::loadTypeFormats()
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
if (!it.key().isEmpty()) if (!it.key().isEmpty())
m_typeFormats.insert(it.key().toUtf8(), it.value().toInt()); theTypeFormats.insert(it.key().toUtf8(), it.value().toInt());
} }
} }
void WatchHandler::saveTypeFormats() void WatchHandler::saveTypeFormats()
{ {
QMap<QString, QVariant> typeFormats; QMap<QString, QVariant> typeFormats;
QHashIterator<QByteArray, int> it(m_typeFormats); QHashIterator<QByteArray, int> it(theTypeFormats);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
const int format = it.value(); const int format = it.value();
@@ -1651,7 +1654,7 @@ void WatchHandler::saveSessionData()
void WatchHandler::loadSessionData() void WatchHandler::loadSessionData()
{ {
loadTypeFormats(); loadTypeFormats();
m_watcherNames.clear(); theWatcherNames.clear();
m_watcherCounter = 0; m_watcherCounter = 0;
QVariant value = debuggerCore()->sessionValue(QLatin1String("Watchers")); QVariant value = debuggerCore()->sessionValue(QLatin1String("Watchers"));
foreach (WatchItem *item, m_watchers->rootItem()->children) foreach (WatchItem *item, m_watchers->rootItem()->children)
@@ -1667,7 +1670,7 @@ void WatchHandler::updateWatchers()
foreach (WatchItem *item, m_watchers->rootItem()->children) foreach (WatchItem *item, m_watchers->rootItem()->children)
m_watchers->destroyItem(item); m_watchers->destroyItem(item);
// Copy over all watchers and mark all watchers as incomplete. // Copy over all watchers and mark all watchers as incomplete.
foreach (const QByteArray &exp, m_watcherNames.keys()) { foreach (const QByteArray &exp, theWatcherNames.keys()) {
WatchData data; WatchData data;
data.iname = watcherName(exp); data.iname = watcherName(exp);
data.setAllNeeded(); data.setAllNeeded();
@@ -1737,9 +1740,9 @@ void WatchHandler::setFormat(const QByteArray &type0, int format)
{ {
const QByteArray type = stripForFormat(type0); const QByteArray type = stripForFormat(type0);
if (format == -1) if (format == -1)
m_typeFormats.remove(type); theTypeFormats.remove(type);
else else
m_typeFormats[type] = format; theTypeFormats[type] = format;
saveTypeFormats(); saveTypeFormats();
m_return->emitDataChanged(1); m_return->emitDataChanged(1);
m_locals->emitDataChanged(1); m_locals->emitDataChanged(1);
@@ -1751,9 +1754,9 @@ int WatchHandler::format(const QByteArray &iname) const
{ {
int result = -1; int result = -1;
if (const WatchData *item = findItem(iname)) { if (const WatchData *item = findItem(iname)) {
int result = m_individualFormats.value(item->iname, -1); int result = theIndividualFormats.value(item->iname, -1);
if (result == -1) if (result == -1)
result = m_typeFormats.value(stripForFormat(item->type), -1); result = theTypeFormats.value(stripForFormat(item->type), -1);
} }
return result; return result;
} }
@@ -1778,8 +1781,8 @@ QByteArray WatchHandler::expansionRequests() const
QByteArray WatchHandler::typeFormatRequests() const QByteArray WatchHandler::typeFormatRequests() const
{ {
QByteArray ba; QByteArray ba;
if (!m_typeFormats.isEmpty()) { if (!theTypeFormats.isEmpty()) {
QHashIterator<QByteArray, int> it(m_typeFormats); QHashIterator<QByteArray, int> it(theTypeFormats);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
ba.append(it.key().toHex()); ba.append(it.key().toHex());
@@ -1795,8 +1798,8 @@ QByteArray WatchHandler::typeFormatRequests() const
QByteArray WatchHandler::individualFormatRequests() const QByteArray WatchHandler::individualFormatRequests() const
{ {
QByteArray ba; QByteArray ba;
if (!m_individualFormats.isEmpty()) { if (!theIndividualFormats.isEmpty()) {
QHashIterator<QByteArray, int> it(m_individualFormats); QHashIterator<QByteArray, int> it(theIndividualFormats);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
ba.append(it.key()); ba.append(it.key());
@@ -1911,5 +1914,10 @@ bool WatchHandler::isValidToolTip(const QByteArray &iname) const
return item && !item->type.trimmed().isEmpty(); return item && !item->type.trimmed().isEmpty();
} }
QHash<QByteArray, int> WatchHandler::watcherNames()
{
return theWatcherNames;
}
} // namespace Internal } // namespace Internal
} // namespace Debugger } // namespace Debugger

View File

@@ -179,8 +179,7 @@ public:
QSet<QByteArray> expandedINames() const QSet<QByteArray> expandedINames() const
{ return m_expandedINames; } { return m_expandedINames; }
static QStringList watchedExpressions(); static QStringList watchedExpressions();
static QHash<QByteArray, int> watcherNames() static QHash<QByteArray, int> watcherNames();
{ return m_watcherNames; }
QByteArray expansionRequests() const; QByteArray expansionRequests() const;
QByteArray typeFormatRequests() const; QByteArray typeFormatRequests() const;
@@ -222,9 +221,6 @@ private:
typedef QMap<QByteArray, QPointer<QObject> > EditHandlers; typedef QMap<QByteArray, QPointer<QObject> > EditHandlers;
EditHandlers m_editHandlers; EditHandlers m_editHandlers;
static QHash<QByteArray, int> m_watcherNames;
static QHash<QByteArray, int> m_typeFormats;
QHash<QByteArray, int> m_individualFormats; // Indexed by iname.
TypeFormats m_reportedTypeFormats; TypeFormats m_reportedTypeFormats;
// Items expanded in the Locals & Watchers view. // Items expanded in the Locals & Watchers view.

View File

@@ -33,6 +33,7 @@
#include "filesselectionwizardpage.h" #include "filesselectionwizardpage.h"
#include "genericprojectwizard.h" #include "genericprojectwizard.h"
#include "genericprojectconstants.h"
#include "selectablefilesmodel.h" #include "selectablefilesmodel.h"
#include <coreplugin/mimedatabase.h> #include <coreplugin/mimedatabase.h>
@@ -56,7 +57,9 @@ FilesSelectionWizardPage::FilesSelectionWizardPage(GenericProjectWizardDialog *g
hbox->addWidget(m_filterLabel); hbox->addWidget(m_filterLabel);
m_filterLineEdit = new QLineEdit; m_filterLineEdit = new QLineEdit;
m_filterLineEdit->setText("Makefile*; *.o; *.obj; *~; *.files; *.config; *.creator; *.user; *.includes"); const QString filter = Core::ICore::settings()->value(Constants::FILEFILTER_SETTING,
Constants::FILEFILTER_DEFAULT).toString();
m_filterLineEdit->setText(filter);
m_filterLineEdit->hide(); m_filterLineEdit->hide();
hbox->addWidget(m_filterLineEdit); hbox->addWidget(m_filterLineEdit);
m_applyFilterButton = new QPushButton(tr("Apply Filter"), this); m_applyFilterButton = new QPushButton(tr("Apply Filter"), this);
@@ -140,5 +143,7 @@ QStringList FilesSelectionWizardPage::selectedFiles() const
void FilesSelectionWizardPage::applyFilter() void FilesSelectionWizardPage::applyFilter()
{ {
m_model->applyFilter(m_filterLineEdit->text()); const QString filter = m_filterLineEdit->text();
Core::ICore::settings()->setValue(Constants::FILEFILTER_SETTING, filter);
m_model->applyFilter(filter);
} }

View File

@@ -56,6 +56,9 @@ const char *const GENERICPROJECT_ID = "GenericProjectManager.GenericProject";
const char *const EDITFILESACTION = "GenericProjectManager.EditFiles"; const char *const EDITFILESACTION = "GenericProjectManager.EditFiles";
const char *const FILEFILTER_SETTING = "GenericProject/FileFilter";
const char *const FILEFILTER_DEFAULT = "Makefile*; *.o; *.obj; *~; *.files; *.config; *.creator; *.user; *.includes";
} // namespace Constants } // namespace Constants
} // namespace GenericProjectManager } // namespace GenericProjectManager

View File

@@ -31,8 +31,10 @@
**************************************************************************/ **************************************************************************/
#include "selectablefilesmodel.h" #include "selectablefilesmodel.h"
#include "genericprojectconstants.h"
#include <coreplugin/fileiconprovider.h> #include <coreplugin/fileiconprovider.h>
#include <coreplugin/icore.h>
#include <utils/QtConcurrentTools> #include <utils/QtConcurrentTools>
#include <QHBoxLayout> #include <QHBoxLayout>
@@ -119,6 +121,8 @@ bool SelectableFilesModel::filter(Tree *t)
{ {
if (t->isDir) if (t->isDir)
return false; return false;
if (m_files.contains(t->fullPath))
return false;
foreach (const Glob &g, m_filter) { foreach (const Glob &g, m_filter) {
if (g.mode == Glob::EXACT) { if (g.mode == Glob::EXACT) {
if (g.matchString == t->name) if (g.matchString == t->name)
@@ -521,7 +525,9 @@ SelectableFilesDialog::SelectableFilesDialog(const QString &path, const QStringL
hbox->addWidget(m_filterLabel); hbox->addWidget(m_filterLabel);
m_filterLineEdit = new QLineEdit(this); m_filterLineEdit = new QLineEdit(this);
m_filterLineEdit->setText("Makefile*; *.o; *.obj; *~; *.files; *.config; *.creator; *.user; *.includes"); const QString filter = Core::ICore::settings()->value(Constants::FILEFILTER_SETTING,
Constants::FILEFILTER_DEFAULT).toString();
m_filterLineEdit->setText(filter);
m_filterLineEdit->hide(); m_filterLineEdit->hide();
hbox->addWidget(m_filterLineEdit); hbox->addWidget(m_filterLineEdit);
m_applyFilterButton = new QPushButton(tr("Apply Filter"), this); m_applyFilterButton = new QPushButton(tr("Apply Filter"), this);
@@ -611,5 +617,7 @@ QStringList SelectableFilesDialog::selectedFiles() const
void SelectableFilesDialog::applyFilter() void SelectableFilesDialog::applyFilter()
{ {
m_selectableFilesModel->applyFilter(m_filterLineEdit->text()); const QString filter = m_filterLineEdit->text();
Core::ICore::settings()->setValue(Constants::FILEFILTER_SETTING, filter);
m_selectableFilesModel->applyFilter(filter);
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -42,6 +42,7 @@ namespace Internal {
QmlProfilerCanvas::QmlProfilerCanvas() QmlProfilerCanvas::QmlProfilerCanvas()
: m_context2d(new Context2D(this)) : m_context2d(new Context2D(this))
, m_dirty(true)
{ {
setFlag(QGraphicsItem::ItemHasNoContents, false); setFlag(QGraphicsItem::ItemHasNoContents, false);
setAcceptedMouseButtons(Qt::LeftButton); setAcceptedMouseButtons(Qt::LeftButton);

View File

@@ -393,6 +393,7 @@ QmlProfilerEventsMainView::~QmlProfilerEventsMainView()
{ {
clear(); clear();
delete d->m_model; delete d->m_model;
delete d;
} }
void QmlProfilerEventsMainView::profilerDataModelStateChanged() void QmlProfilerEventsMainView::profilerDataModelStateChanged()

View File

@@ -315,7 +315,7 @@ QList<DeploymentFolder> Html5App::deploymentFolders() const
return result; return result;
} }
const int Html5App::StubVersion = 10; const int Html5App::StubVersion = 11;
} // namespace Internal } // namespace Internal
} // namespace Qt4ProjectManager } // namespace Qt4ProjectManager

View File

@@ -212,7 +212,7 @@ QModelIndex DataModel::indexForObject(const Function *function) const
static QString noWrap(const QString &str) static QString noWrap(const QString &str)
{ {
QString escapedStr = str; QString escapedStr = str;
return escapedStr.replace("-", "&#8209;"); return escapedStr.replace(QLatin1Char('-'), "&#8209;");
} }
QVariant DataModel::data(const QModelIndex &index, int role) const QVariant DataModel::data(const QModelIndex &index, int role) const

View File

@@ -163,6 +163,7 @@ WelcomeMode::WelcomeMode() :
scrollArea->setWidget(m_welcomePage); scrollArea->setWidget(m_welcomePage);
scrollArea->setWidgetResizable(true); scrollArea->setWidgetResizable(true);
m_welcomePage->setMinimumWidth(860); m_welcomePage->setMinimumWidth(860);
m_welcomePage->setMinimumHeight(548);
PluginManager *pluginManager = PluginManager::instance(); PluginManager *pluginManager = PluginManager::instance();
connect(pluginManager, SIGNAL(objectAdded(QObject*)), SLOT(welcomePluginAdded(QObject*))); connect(pluginManager, SIGNAL(objectAdded(QObject*)), SLOT(welcomePluginAdded(QObject*)));

View File

@@ -54,13 +54,16 @@ void tst_Version::version()
QFETCH(int, gdbVersion); QFETCH(int, gdbVersion);
QFETCH(int, gdbBuildVersion); QFETCH(int, gdbBuildVersion);
QFETCH(bool, isMacGdb); QFETCH(bool, isMacGdb);
QFETCH(bool, isQnxGdb);
int v = 0, bv = 0; int v = 0, bv = 0;
bool mac = true; bool mac = true;
Debugger::Internal::extractGdbVersion(msg, &v, &bv, &mac); bool qnx = true;
qDebug() << msg << " -> " << v << bv << mac; Debugger::Internal::extractGdbVersion(msg, &v, &bv, &mac, &qnx);
qDebug() << msg << " -> " << v << bv << mac << qnx;
QCOMPARE(v, gdbVersion); QCOMPARE(v, gdbVersion);
QCOMPARE(bv, gdbBuildVersion); QCOMPARE(bv, gdbBuildVersion);
QCOMPARE(mac, isMacGdb); QCOMPARE(mac, isMacGdb);
QCOMPARE(qnx, isQnxGdb);
} }
void tst_Version::version_data() void tst_Version::version_data()
@@ -69,42 +72,47 @@ void tst_Version::version_data()
QTest::addColumn<int>("gdbVersion"); QTest::addColumn<int>("gdbVersion");
QTest::addColumn<int>("gdbBuildVersion"); QTest::addColumn<int>("gdbBuildVersion");
QTest::addColumn<bool>("isMacGdb"); QTest::addColumn<bool>("isMacGdb");
QTest::addColumn<bool>("isQnxGdb");
QTest::newRow("Debian") QTest::newRow("Debian")
<< "GNU gdb (GDB) 7.0.1-debian" << "GNU gdb (GDB) 7.0.1-debian"
<< 70001 << 0 << false; << 70001 << 0 << false << false;
QTest::newRow("CVS 7.0.90") QTest::newRow("CVS 7.0.90")
<< "GNU gdb (GDB) 7.0.90.20100226-cvs" << "GNU gdb (GDB) 7.0.90.20100226-cvs"
<< 70090 << 20100226 << false; << 70090 << 20100226 << false << false;
QTest::newRow("Ubuntu Lucid") QTest::newRow("Ubuntu Lucid")
<< "GNU gdb (GDB) 7.1-ubuntu" << "GNU gdb (GDB) 7.1-ubuntu"
<< 70100 << 0 << false; << 70100 << 0 << false << false;
QTest::newRow("Fedora 13") QTest::newRow("Fedora 13")
<< "GNU gdb (GDB) Fedora (7.1-22.fc13)" << "GNU gdb (GDB) Fedora (7.1-22.fc13)"
<< 70100 << 22 << false; << 70100 << 22 << false << false;
QTest::newRow("Gentoo") QTest::newRow("Gentoo")
<< "GNU gdb (Gentoo 7.1 p1) 7.1" << "GNU gdb (Gentoo 7.1 p1) 7.1"
<< 70100 << 1 << false; << 70100 << 1 << false << false;
QTest::newRow("Fedora EL5") QTest::newRow("Fedora EL5")
<< "GNU gdb Fedora (6.8-37.el5)" << "GNU gdb Fedora (6.8-37.el5)"
<< 60800 << 37 << false; << 60800 << 37 << false << false;
QTest::newRow("SUSE") QTest::newRow("SUSE")
<< "GNU gdb (GDB) SUSE (6.8.91.20090930-2.4)" << "GNU gdb (GDB) SUSE (6.8.91.20090930-2.4)"
<< 60891 << 20090930 << false; << 60891 << 20090930 << false << false;
QTest::newRow("Apple") QTest::newRow("Apple")
<< "GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2)" << "GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2)"
<< 60350 << 1461 << true; << 60350 << 1461 << true << false;
QTest::newRow("Apple") QTest::newRow("Apple")
<< "GNU gdb 6.3.50-20050815 (Apple version gdb-960)" << "GNU gdb 6.3.50-20050815 (Apple version gdb-960)"
<< 60350 << 960 << true; << 60350 << 960 << true << false;
QTest::newRow("QNX")
<< "GNU gdb (GDB) 7.3 qnx (rev. 613)"
<< 70300 << 613 << false << true;
} }

View File

@@ -5847,6 +5847,37 @@ namespace bug6858 {
} }
} }
namespace bug6863 {
class MyObject : public QObject
{
Q_OBJECT
public:
MyObject() {}
};
void setProp(QObject *obj)
{
obj->setProperty("foo", "bar");
BREAK_HERE;
// Expand obj.
// Check obj.[QObject].properties <2 items>.
// Continue.
dummyStatement(&obj);
}
void test6863()
{
QFile file("/tmp/tt");
setProp(&file);
MyObject obj;
setProp(&obj);
}
}
namespace bug6933 { namespace bug6933 {
class Base class Base
@@ -6164,6 +6195,7 @@ int main(int argc, char *argv[])
bug6465::test6465(); bug6465::test6465();
bug6857::test6857(); bug6857::test6857();
bug6858::test6858(); bug6858::test6858();
bug6863::test6863();
bug6933::test6933(); bug6933::test6933();
gdb13393::test13393(); gdb13393::test13393();
gdb10586::test10586(); gdb10586::test10586();