Merge branch '2.0'

Conflicts:
	src/plugins/qmlinspector/QmlInspector.pluginspec
This commit is contained in:
Friedemann Kleint
2010-07-13 15:20:54 +02:00
8 changed files with 80 additions and 21 deletions

View File

@@ -32,6 +32,7 @@ extraimages.HTML = qt-logo \
bg_ll_blank.png \ bg_ll_blank.png \
bg_l_blank.png \ bg_l_blank.png \
breadcrumb.png \ breadcrumb.png \
bullet_up.png \
bullet_dn.png \ bullet_dn.png \
bullet_gt.png \ bullet_gt.png \
bullet_sq.png \ bullet_sq.png \

View File

@@ -4570,12 +4570,14 @@
In \gui Debug mode, you can use several views to interact with the In \gui Debug mode, you can use several views to interact with the
program you are debugging. Frequently used views are shown by program you are debugging. Frequently used views are shown by
default and rarely used ones are hidden. To change the default settings, default and rarely used ones are hidden. To change the default settings,
select \gui Debug > \gui Views, and then select views to display select \gui {Window > Views}, and then select views to display or hide.
or hide. You can also lock views. The position of views is saved for future
sessions.
\image qtcreator-debugger-views.png "Debug mode views" \image qtcreator-debugger-views.png "Debug mode views"
By default, the views are locked into place in the workspace. Select
\gui {Window > Views > Locked} to unlock the views. Drag and drop the
views into new positions on the screen. Drag view borders to resize the
views. The size and position of views are saved for future sessions.
\section1 Starting the Debugger \section1 Starting the Debugger

View File

@@ -95,7 +95,7 @@ void Core::Internal::ProgressManagerPrivate::setApplicationLabel(const QString &
font.setPointSize(font.pointSize()-2); font.setPointSize(font.pointSize()-2);
p.setFont(font); p.setFont(font);
p.drawText(QRect(QPoint(0,0), pix.size()), Qt::AlignHCenter|Qt::AlignCenter, text); p.drawText(QRect(QPoint(0,0), pix.size()), Qt::AlignHCenter|Qt::AlignCenter, text);
pITask->SetOverlayIcon(winId, pix.toWinHICON(), text.utf16()); pITask->SetOverlayIcon(winId, pix.toWinHICON(), (wchar_t*)text.utf16());
} }
} }

View File

@@ -257,9 +257,9 @@ static bool mapDeviceToDriveLetter(QString *s)
for (const TCHAR *driveLetter = driveLetters; *driveLetter; driveLetter++) { for (const TCHAR *driveLetter = driveLetters; *driveLetter; driveLetter++) {
szDrive[0] = *driveLetter; // Look up each device name szDrive[0] = *driveLetter; // Look up each device name
if (QueryDosDevice(szDrive, driveName, MAX_PATH)) { if (QueryDosDevice(szDrive, driveName, MAX_PATH)) {
const QString deviceName = QString::fromUtf16(driveName); const QString deviceName = QString::fromWCharArray(driveName);
if (s->startsWith(deviceName)) { if (s->startsWith(deviceName)) {
s->replace(0, deviceName.size(), QString::fromUtf16(szDrive)); s->replace(0, deviceName.size(), QString::fromWCharArray(szDrive));
return true; return true;
} }
} }
@@ -275,7 +275,7 @@ static bool mapDeviceToDriveLetter(QString *s)
static inline QString normalizeFileNameCaseHelper(const QString &f) static inline QString normalizeFileNameCaseHelper(const QString &f)
{ {
HANDLE hFile = CreateFile(f.utf16(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); HANDLE hFile = CreateFile((const wchar_t*)f.utf16(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if(hFile == INVALID_HANDLE_VALUE) if(hFile == INVALID_HANDLE_VALUE)
return f; return f;
// Get the file size. We need a non-empty file to map it. // Get the file size. We need a non-empty file to map it.
@@ -305,7 +305,7 @@ static inline QString normalizeFileNameCaseHelper(const QString &f)
pszFilename[0] = 0; pszFilename[0] = 0;
// Get a file name of the form "/Device/HarddiskVolume1/file.cpp" // Get a file name of the form "/Device/HarddiskVolume1/file.cpp"
if (GetMappedFileName (GetCurrentProcess(), pMem, pszFilename, MAX_PATH)) { if (GetMappedFileName (GetCurrentProcess(), pMem, pszFilename, MAX_PATH)) {
rc = QString::fromUtf16(pszFilename); rc = QString::fromWCharArray(pszFilename);
if (!mapDeviceToDriveLetter(&rc)) if (!mapDeviceToDriveLetter(&rc))
rc.clear(); rc.clear();
} }

View File

@@ -296,7 +296,7 @@ bool CoreEngine::init(const QString &dllEnginePath, QString *errorMessage)
*errorMessage = msgComFailed("GetImagePathWide", hr); *errorMessage = msgComFailed("GetImagePathWide", hr);
return false; return false;
} }
m_baseImagePath = QString::fromUtf16(buf); m_baseImagePath = QString::fromWCharArray(buf);
hr = lib.debugCreate( __uuidof(IDebugRegisters2), reinterpret_cast<void**>(&m_cif.debugRegisters)); hr = lib.debugCreate( __uuidof(IDebugRegisters2), reinterpret_cast<void**>(&m_cif.debugRegisters));
if (FAILED(hr)) { if (FAILED(hr)) {
@@ -447,7 +447,7 @@ bool CoreEngine::startDebuggerWithExecutable(const QString &workingDirectory,
PCWSTR workingDirC = 0; PCWSTR workingDirC = 0;
const QString workingDirN = workingDirectory.isEmpty() ? QString() : QDir::toNativeSeparators(workingDirectory); const QString workingDirN = workingDirectory.isEmpty() ? QString() : QDir::toNativeSeparators(workingDirectory);
if (!workingDirN.isEmpty()) if (!workingDirN.isEmpty())
workingDirC = workingDirN.utf16(); workingDirC = (PCWSTR)workingDirN.utf16();
hr = m_cif.debugClient->CreateProcess2Wide(NULL, hr = m_cif.debugClient->CreateProcess2Wide(NULL,
reinterpret_cast<PWSTR>(const_cast<ushort *>(cmd.utf16())), reinterpret_cast<PWSTR>(const_cast<ushort *>(cmd.utf16())),
&dbgopts, sizeof(dbgopts), &dbgopts, sizeof(dbgopts),
@@ -820,7 +820,7 @@ quint64 CoreEngine::getSourceLineAddress(const QString &file,
{ {
ULONG64 rc = 0; ULONG64 rc = 0;
const HRESULT hr = m_cif.debugSymbols->GetOffsetByLineWide(line, const HRESULT hr = m_cif.debugSymbols->GetOffsetByLineWide(line,
const_cast<ushort*>(file.utf16()), (wchar_t*)(file.utf16()),
&rc); &rc);
if (FAILED(hr)) { if (FAILED(hr)) {
*errorMessage = QString::fromLatin1("Unable to determine address of %1:%2 : %3"). *errorMessage = QString::fromLatin1("Unable to determine address of %1:%2 : %3").

View File

@@ -79,6 +79,12 @@
#include <QtHelp/QHelpEngine> #include <QtHelp/QHelpEngine>
#if !defined(QT_NO_WEBKIT)
#include <QtWebKit/QWebElement>
#include <QtWebKit/QWebElementCollection>
#include <QtWebKit/QWebFrame>
#endif
using namespace Core::Constants; using namespace Core::Constants;
using namespace Help::Internal; using namespace Help::Internal;
@@ -688,13 +694,11 @@ void HelpPlugin::activateContext()
} else if (m_core->modeManager()->currentMode() == m_mode) } else if (m_core->modeManager()->currentMode() == m_mode)
return; return;
QString id;
QMap<QString, QUrl> links;
// Find out what to show // Find out what to show
QMap<QString, QUrl> links;
if (IContext *context = m_core->currentContextObject()) { if (IContext *context = m_core->currentContextObject()) {
id = context->contextHelpId(); m_idFromContext = context->contextHelpId();
links = Core::HelpManager::instance()->linksForIdentifier(id); links = Core::HelpManager::instance()->linksForIdentifier(m_idFromContext);
} }
if (HelpViewer* viewer = viewerForContextMode()) { if (HelpViewer* viewer = viewerForContextMode()) {
@@ -702,16 +706,24 @@ void HelpPlugin::activateContext()
// No link found or no context object // No link found or no context object
viewer->setHtml(tr("<html><head><title>No Documentation</title>" viewer->setHtml(tr("<html><head><title>No Documentation</title>"
"</head><body><br/><center><b>%1</b><br/>No documentation " "</head><body><br/><center><b>%1</b><br/>No documentation "
"available.</center></body></html>").arg(id)); "available.</center></body></html>").arg(m_idFromContext));
viewer->setSource(QUrl()); viewer->setSource(QUrl());
} else { } else {
const QUrl &source = *links.begin(); const QUrl &source = *links.begin();
if (viewer->source() != source) const QUrl &oldSource = viewer->source();
if (source != oldSource) {
viewer->stop();
viewer->setSource(source); viewer->setSource(source);
}
viewer->setFocus(); viewer->setFocus();
connect(viewer, SIGNAL(loadFinished(bool)), this,
SLOT(highlightSearchTerms()));
if (source.toString().remove(source.fragment())
== oldSource.toString().remove(oldSource.fragment())) {
highlightSearchTerms();
}
} }
if (viewer != m_helpViewerForSideBar)
activateHelpMode();
} }
} }
@@ -819,6 +831,45 @@ void HelpPlugin::addBookmark()
manager->showBookmarkDialog(m_centralWidget, viewer->title(), url); manager->showBookmarkDialog(m_centralWidget, viewer->title(), url);
} }
void HelpPlugin::highlightSearchTerms()
{
if (HelpViewer* viewer = viewerForContextMode()) {
disconnect(viewer, SIGNAL(loadFinished(bool)), this,
SLOT(highlightSearchTerms()));
#if !defined(QT_NO_WEBKIT)
const QString &attrValue = m_idFromContext.mid(m_idFromContext
.lastIndexOf(QChar(':')) + 1);
if (attrValue.isEmpty())
return;
const QWebElement &document = viewer->page()->mainFrame()->documentElement();
const QWebElementCollection &collection = document.findAll(QLatin1String("h3.fn a"));
const QLatin1String property("background-color");
foreach (const QWebElement &element, collection) {
const QString &name = element.attribute(QLatin1String("name"));
if (name.isEmpty())
continue;
if (m_oldAttrValue == name) {
QWebElement parent = element.parent();
parent.setStyleProperty(property, m_styleProperty);
}
if (attrValue == name) {
QWebElement parent = element.parent();
m_styleProperty = parent.styleProperty(property,
QWebElement::InlineStyle);
parent.setStyleProperty(property, QLatin1String("yellow"));
}
}
m_oldAttrValue = attrValue;
#endif
viewer->findText(m_idFromContext, 0, false, true);
}
}
void HelpPlugin::handleHelpRequest(const QUrl &url) void HelpPlugin::handleHelpRequest(const QUrl &url)
{ {
if (HelpViewer::launchWithExternalApp(url)) if (HelpViewer::launchWithExternalApp(url))

View File

@@ -98,6 +98,7 @@ private slots:
void updateCloseButton(); void updateCloseButton();
void setupHelpEngineIfNeeded(); void setupHelpEngineIfNeeded();
void highlightSearchTerms();
void handleHelpRequest(const QUrl &url); void handleHelpRequest(const QUrl &url);
private: private:
@@ -134,6 +135,10 @@ private:
Core::MiniSplitter *m_splitter; Core::MiniSplitter *m_splitter;
QToolButton *m_closeButton; QToolButton *m_closeButton;
QString m_oldAttrValue;
QString m_styleProperty;
QString m_idFromContext;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -1,4 +1,4 @@
<plugin name="QmlInspector" version="2.1.80" compatVersion="2.1.80"> <plugin name="QmlInspector" version="2.1.80" compatVersion="2.1.80" experimental="true">
<vendor>Nokia Corporation</vendor> <vendor>Nokia Corporation</vendor>
<copyright>(C) 2010 Nokia Corporation</copyright> <copyright>(C) 2010 Nokia Corporation</copyright>
<license> <license>