summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/lib/qhelpsearchquerywidget.cpp71
-rw-r--r--tools/assistant/lib/qhelpsearchquerywidget.h3
-rw-r--r--tools/assistant/lib/qhelpsearchresultwidget.cpp8
-rw-r--r--tools/assistant/lib/qhelpsearchresultwidget.h1
-rw-r--r--tools/assistant/tools/assistant/centralwidget.cpp91
-rw-r--r--tools/assistant/tools/assistant/centralwidget.h8
-rw-r--r--tools/assistant/tools/assistant/doc/assistant.qdocconf2
-rw-r--r--tools/assistant/tools/assistant/helpviewer.cpp11
-rw-r--r--tools/configure/configureapp.cpp33
-rw-r--r--tools/designer/src/lib/shared/widgetfactory.cpp2
-rw-r--r--tools/qdoc3/test/assistant.qdocconf2
-rw-r--r--tools/qdoc3/test/designer.qdocconf2
-rw-r--r--tools/qdoc3/test/linguist.qdocconf2
-rw-r--r--tools/qdoc3/test/macros.qdocconf2
-rw-r--r--tools/qdoc3/test/qmake.qdocconf2
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf8
-rw-r--r--tools/qdoc3/test/qt.qdocconf10
-rw-r--r--tools/qmlviewer/main.cpp5
-rw-r--r--tools/qmlviewer/qmlviewer.cpp184
-rw-r--r--tools/qmlviewer/qmlviewer.h7
-rw-r--r--tools/qttracereplay/main.cpp28
-rw-r--r--tools/runonphone/main.cpp11
-rw-r--r--tools/runonphone/runonphone.pro6
-rw-r--r--tools/runonphone/serenum_stub.cpp53
-rw-r--r--tools/runonphone/serenum_unix.cpp64
-rw-r--r--tools/runonphone/trk/launcher.cpp101
-rw-r--r--tools/runonphone/trk/launcher.h15
-rw-r--r--tools/runonphone/trk/trkdevice.cpp34
-rw-r--r--tools/runonphone/trk/trkutils.h7
29 files changed, 579 insertions, 194 deletions
diff --git a/tools/assistant/lib/qhelpsearchquerywidget.cpp b/tools/assistant/lib/qhelpsearchquerywidget.cpp
index a2b3ca2..b614cb4 100644
--- a/tools/assistant/lib/qhelpsearchquerywidget.cpp
+++ b/tools/assistant/lib/qhelpsearchquerywidget.cpp
@@ -120,6 +120,22 @@ private:
// nothing todo
}
+ void retranslate()
+ {
+ simpleSearchLabel->setText(tr("Search for:"));
+ prevQueryButton->setToolTip(tr("Previous search"));
+ nextQueryButton->setToolTip(tr("Next search"));
+ searchButton->setText(tr("Search"));
+#ifdef QT_CLUCENE_SUPPORT
+ advancedSearchLabel->setText(tr("Advanced search"));
+ similarLabel->setText(tr("words <B>similar</B> to:"));
+ withoutLabel->setText(tr("<B>without</B> the words:"));
+ exactLabel->setText(tr("with <B>exact phrase</B>:"));
+ allLabel->setText(tr("with <B>all</B> of the words:"));
+ atLeastLabel->setText(tr("with <B>at least one</B> of the words:"));
+#endif
+ }
+
QString escapeString(const QString &text)
{
QString retValue = text;
@@ -360,6 +376,13 @@ private:
friend class QHelpSearchQueryWidget;
bool simpleSearch;
+ QLabel *simpleSearchLabel;
+ QLabel *advancedSearchLabel;
+ QLabel *similarLabel;
+ QLabel *withoutLabel;
+ QLabel *exactLabel;
+ QLabel *allLabel;
+ QLabel *atLeastLabel;
QPushButton *searchButton;
QWidget* advancedSearchWidget;
QToolButton *showHideAdvancedSearchButton;
@@ -408,19 +431,17 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
vLayout->setMargin(0);
QHBoxLayout* hBoxLayout = new QHBoxLayout();
- QLabel *label = new QLabel(tr("Search for:"), this);
+ d->simpleSearchLabel = new QLabel(this);
d->defaultQuery = new QLineEdit(this);
d->defaultQuery->setCompleter(&d->searchCompleter);
d->prevQueryButton = new QToolButton(this);
d->prevQueryButton->setArrowType(Qt::LeftArrow);
- d->prevQueryButton->setToolTip(tr("Previous search"));
d->prevQueryButton->setEnabled(false);
d->nextQueryButton = new QToolButton(this);
d->nextQueryButton->setArrowType(Qt::RightArrow);
- d->nextQueryButton->setToolTip(tr("Next search"));
d->nextQueryButton->setEnabled(false);
- d->searchButton = new QPushButton(tr("Search"), this);
- hBoxLayout->addWidget(label);
+ d->searchButton = new QPushButton(this);
+ hBoxLayout->addWidget(d->simpleSearchLabel);
hBoxLayout->addWidget(d->defaultQuery);
hBoxLayout->addWidget(d->prevQueryButton);
hBoxLayout->addWidget(d->nextQueryButton);
@@ -439,15 +460,15 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
d->showHideAdvancedSearchButton->setText(QLatin1String("+"));
d->showHideAdvancedSearchButton->setMinimumSize(25, 20);
- label = new QLabel(tr("Advanced search"), this);
+ d->advancedSearchLabel = new QLabel(this);
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
- sizePolicy.setHeightForWidth(label->sizePolicy().hasHeightForWidth());
- label->setSizePolicy(sizePolicy);
+ sizePolicy.setHeightForWidth(d->advancedSearchLabel->sizePolicy().hasHeightForWidth());
+ d->advancedSearchLabel->setSizePolicy(sizePolicy);
QFrame* hLine = new QFrame(this);
hLine->setFrameStyle(QFrame::HLine);
hBoxLayout->addWidget(d->showHideAdvancedSearchButton);
- hBoxLayout->addWidget(label);
+ hBoxLayout->addWidget(d->advancedSearchLabel);
hBoxLayout->addWidget(hLine);
vLayout->addLayout(hBoxLayout);
@@ -457,32 +478,32 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
QGridLayout *gLayout = new QGridLayout(d->advancedSearchWidget);
gLayout->setMargin(0);
- label = new QLabel(tr("words <B>similar</B> to:"), this);
- gLayout->addWidget(label, 0, 0);
+ d->similarLabel = new QLabel(this);
+ gLayout->addWidget(d->similarLabel, 0, 0);
d->similarQuery = new QLineEdit(this);
d->similarQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->similarQuery, 0, 1);
- label = new QLabel(tr("<B>without</B> the words:"), this);
- gLayout->addWidget(label, 1, 0);
+ d->withoutLabel = new QLabel(this);
+ gLayout->addWidget(d->withoutLabel, 1, 0);
d->withoutQuery = new QLineEdit(this);
d->withoutQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->withoutQuery, 1, 1);
- label = new QLabel(tr("with <B>exact phrase</B>:"), this);
- gLayout->addWidget(label, 2, 0);
+ d->exactLabel = new QLabel(this);
+ gLayout->addWidget(d->exactLabel, 2, 0);
d->exactQuery = new QLineEdit(this);
d->exactQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->exactQuery, 2, 1);
- label = new QLabel(tr("with <B>all</B> of the words:"), this);
- gLayout->addWidget(label, 3, 0);
+ d->allLabel = new QLabel(this);
+ gLayout->addWidget(d->allLabel, 3, 0);
d->allQuery = new QLineEdit(this);
d->allQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->allQuery, 3, 1);
- label = new QLabel(tr("with <B>at least one</B> of the words:"), this);
- gLayout->addWidget(label, 4, 0);
+ d->atLeastLabel = new QLabel(this);
+ gLayout->addWidget(d->atLeastLabel, 4, 0);
d->atLeastQuery = new QLineEdit(this);
d->atLeastQuery->setCompleter(&d->searchCompleter);
gLayout->addWidget(d->atLeastQuery, 4, 1);
@@ -490,6 +511,8 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent)
vLayout->addWidget(d->advancedSearchWidget);
d->advancedSearchWidget->hide();
+ d->retranslate();
+
connect(d->exactQuery, SIGNAL(returnPressed()), this, SIGNAL(search()));
connect(d->similarQuery, SIGNAL(returnPressed()), this, SIGNAL(search()));
connect(d->withoutQuery, SIGNAL(returnPressed()), this, SIGNAL(search()));
@@ -531,4 +554,14 @@ void QHelpSearchQueryWidget::focusInEvent(QFocusEvent *focusEvent)
}
}
+/*! \reimp
+*/
+void QHelpSearchQueryWidget::changeEvent(QEvent *event)
+{
+ if (event->type() == QEvent::LanguageChange)
+ d->retranslate();
+ else
+ QWidget::changeEvent(event);
+}
+
QT_END_NAMESPACE
diff --git a/tools/assistant/lib/qhelpsearchquerywidget.h b/tools/assistant/lib/qhelpsearchquerywidget.h
index a99bae0..2afc4b4 100644
--- a/tools/assistant/lib/qhelpsearchquerywidget.h
+++ b/tools/assistant/lib/qhelpsearchquerywidget.h
@@ -74,7 +74,8 @@ Q_SIGNALS:
void search();
private:
- void focusInEvent(QFocusEvent *focusEvent);
+ virtual void focusInEvent(QFocusEvent *focusEvent);
+ virtual void changeEvent(QEvent *event);
private:
QHelpSearchQueryWidgetPrivate *d;
diff --git a/tools/assistant/lib/qhelpsearchresultwidget.cpp b/tools/assistant/lib/qhelpsearchresultwidget.cpp
index 3cac880..a3f5aed 100644
--- a/tools/assistant/lib/qhelpsearchresultwidget.cpp
+++ b/tools/assistant/lib/qhelpsearchresultwidget.cpp
@@ -408,6 +408,14 @@ QHelpSearchResultWidget::QHelpSearchResultWidget(QHelpSearchEngine *engine)
connect(engine, SIGNAL(searchingFinished(int)), d, SLOT(setResults(int)));
}
+/*! \reimp
+*/
+void QHelpSearchResultWidget::changeEvent(QEvent *event)
+{
+ if (event->type() == QEvent::LanguageChange)
+ d->setResults(d->searchEngine->hitCount());
+}
+
/*!
Destroys the search result widget.
*/
diff --git a/tools/assistant/lib/qhelpsearchresultwidget.h b/tools/assistant/lib/qhelpsearchresultwidget.h
index d078079..ff29adc 100644
--- a/tools/assistant/lib/qhelpsearchresultwidget.h
+++ b/tools/assistant/lib/qhelpsearchresultwidget.h
@@ -75,6 +75,7 @@ private:
QHelpSearchResultWidgetPrivate *d;
QHelpSearchResultWidget(QHelpSearchEngine *engine);
+ virtual void changeEvent(QEvent *event);
};
QT_END_NAMESPACE
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp
index 0b177ae..055fa1c 100644
--- a/tools/assistant/tools/assistant/centralwidget.cpp
+++ b/tools/assistant/tools/assistant/centralwidget.cpp
@@ -358,7 +358,7 @@ void CentralWidget::zoomOut()
void CentralWidget::findNext()
{
- find(findWidget->editFind->text(), true, false);
+ find(findWidget->editFind->text(), true);
}
void CentralWidget::nextPage()
@@ -389,7 +389,7 @@ void CentralWidget::previousPage()
void CentralWidget::findPrevious()
{
- find(findWidget->editFind->text(), false, true);
+ find(findWidget->editFind->text(), false);
}
void CentralWidget::closeTab()
@@ -697,7 +697,7 @@ HelpViewer *CentralWidget::newEmptyTab()
void CentralWidget::findCurrentText(const QString &text)
{
- find(text, false, false);
+ find(text, true);
}
void CentralWidget::connectSignals()
@@ -896,19 +896,35 @@ void CentralWidget::keyPressEvent(QKeyEvent *e)
QWidget::keyPressEvent(e);
}
-void CentralWidget::find(const QString &ttf, bool forward, bool backward)
+void CentralWidget::find(const QString &ttf, bool forward)
{
QPalette p = findWidget->editFind->palette();
p.setColor(QPalette::Active, QPalette::Base, Qt::white);
- if (!ttf.isEmpty()) {
- HelpViewer *viewer = currentHelpViewer();
+ bool found = false;
- bool found = false;
+#if defined(QT_NO_WEBKIT)
+ found = findInTextBrowser(ttf, forward);
+#else
+ found = findInWebPage(ttf, forward);
+#endif
+
+ if (!found && !ttf.isEmpty())
+ p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102));
+
+ if (!findWidget->isVisible())
+ findWidget->show();
+ findWidget->editFind->setPalette(p);
+}
+
+bool CentralWidget::findInWebPage(const QString &ttf, bool forward)
+{
#if !defined(QT_NO_WEBKIT)
- if (viewer) {
- QWebPage::FindFlags options;
- if (backward)
+ if (HelpViewer *viewer = currentHelpViewer()) {
+ bool found = false;
+ QWebPage::FindFlags options;
+ if (!ttf.isEmpty()) {
+ if (!forward)
options |= QWebPage::FindBackward;
if (findWidget->checkCase->isChecked())
@@ -923,30 +939,27 @@ void CentralWidget::find(const QString &ttf, bool forward, bool backward)
if (found)
findWidget->labelWrapped->show();
}
- } else if (tabWidget->currentWidget() == m_searchWidget) {
- QTextBrowser *browser = qFindChild<QTextBrowser*>(m_searchWidget);
- found = findInTextBrowser(browser, ttf, forward, backward);
}
-#else
- QTextBrowser *browser = qobject_cast<QTextBrowser*>(viewer);
- if (tabWidget->currentWidget() == m_searchWidget)
- browser = qFindChild<QTextBrowser*>(m_searchWidget);
- found = findInTextBrowser(browser, ttf, forward, backward);
-#endif
-
- if (!found)
- p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102));
+ // force highlighting of all other matches, also when empty (clear)
+ options = QWebPage::HighlightAllOccurrences;
+ viewer->findText(QLatin1String(""), options);
+ viewer->findText(ttf, options);
+ return found;
}
- if (!findWidget->isVisible())
- findWidget->show();
- findWidget->editFind->setPalette(p);
+ // this needs to stay, case for active search results page
+ return findInTextBrowser(ttf, forward);
+#endif
+ return false;
}
-bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf,
- bool forward, bool backward)
+bool CentralWidget::findInTextBrowser(const QString &ttf, bool forward)
{
- if (!browser)
+ QTextBrowser *browser = qobject_cast<QTextBrowser*>(currentHelpViewer());
+ if (tabWidget->currentWidget() == m_searchWidget)
+ browser = qFindChild<QTextBrowser*>(m_searchWidget);
+
+ if (!browser || ttf.isEmpty())
return false;
QTextDocument *doc = browser->document();
@@ -962,7 +975,7 @@ bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf,
QTextCursor::MoveAnchor);
}
- if (backward)
+ if (!forward)
options |= QTextDocument::FindBackward;
if (findWidget->checkCase->isChecked())
@@ -1074,20 +1087,29 @@ void
CentralWidget::setSourceFromSearch(const QUrl &url)
{
setSource(url);
+#if defined(QT_NO_WEBKIT)
highlightSearchTerms();
+#else
+ connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this,
+ SLOT(highlightSearchTerms()));
+#endif
}
void
CentralWidget::setSourceFromSearchInNewTab(const QUrl &url)
{
setSourceInNewTab(url);
+#if defined(QT_NO_WEBKIT)
highlightSearchTerms();
+#else
+ connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this,
+ SLOT(highlightSearchTerms()));
+#endif
}
void
CentralWidget::highlightSearchTerms()
{
-#if defined(QT_NO_WEBKIT)
HelpViewer *viewer = currentHelpViewer();
if (!viewer)
return;
@@ -1109,6 +1131,7 @@ CentralWidget::highlightSearchTerms()
}
}
+#if defined(QT_NO_WEBKIT)
viewer->viewport()->setUpdatesEnabled(false);
QTextCharFormat marker;
@@ -1140,6 +1163,14 @@ CentralWidget::highlightSearchTerms()
viewer->setTextCursor(firstHit);
viewer->viewport()->setUpdatesEnabled(true);
+#else
+ viewer->findText("", QWebPage::HighlightAllOccurrences);
+ // clears existing selections
+ foreach (const QString& term, terms)
+ viewer->findText(term, QWebPage::HighlightAllOccurrences);
+
+ disconnect(viewer, SIGNAL(loadFinished(bool)), this,
+ SLOT(highlightSearchTerms()));
#endif
}
diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h
index 6c23190..9e32985 100644
--- a/tools/assistant/tools/assistant/centralwidget.h
+++ b/tools/assistant/tools/assistant/centralwidget.h
@@ -182,16 +182,16 @@ private slots:
void printPreview(QPrinter *printer);
void setSourceFromSearch(const QUrl &url);
void setSourceFromSearchInNewTab(const QUrl &url);
+ void highlightSearchTerms();
private:
void connectSignals();
bool eventFilter(QObject *object, QEvent *e);
- void find(const QString &ttf, bool forward, bool backward);
- bool findInTextBrowser(QTextBrowser* browser, const QString &ttf,
- bool forward, bool backward);
+ void find(const QString &ttf, bool forward);
+ bool findInWebPage(const QString &ttf, bool forward);
+ bool findInTextBrowser(const QString &ttf, bool forward);
void initPrinter();
QString quoteTabTitle(const QString &title) const;
- void highlightSearchTerms();
void setLastShownPages();
void getBrowserFontFor(QWidget* viewer, QFont *font);
diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf
index 584c3ce..b8726a4 100644
--- a/tools/assistant/tools/assistant/doc/assistant.qdocconf
+++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf
@@ -12,5 +12,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
"<td width=\"30%\" align=\"left\">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
"<td width=\"40%\" align=\"center\">Trademarks</td>\n" \
- "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6.1</div></td>\n" \
+ "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6.2</div></td>\n" \
"</tr></table></div></address>"
diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp
index a9abda5..be6245a 100644
--- a/tools/assistant/tools/assistant/helpviewer.cpp
+++ b/tools/assistant/tools/assistant/helpviewer.cpp
@@ -141,17 +141,18 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/,
if (mimeType.endsWith(QLatin1String(".svg"))
|| mimeType.endsWith(QLatin1String(".svgz"))) {
mimeType = QLatin1String("image/svg+xml");
- }
- else if (mimeType.endsWith(QLatin1String(".css"))) {
+ } else if (mimeType.endsWith(QLatin1String(".css"))) {
mimeType = QLatin1String("text/css");
- }
- else if (mimeType.endsWith(QLatin1String(".js"))) {
+ } else if (mimeType.endsWith(QLatin1String(".js"))) {
mimeType = QLatin1String("text/javascript");
+ } else if (mimeType.endsWith(QLatin1String(".txt"))) {
+ mimeType = QLatin1String("text/plain");
} else {
mimeType = QLatin1String("text/html");
}
- return new HelpNetworkReply(request, helpEngine->fileData(url), mimeType);
+ const QByteArray &ba = helpEngine->fileData(url);
+ return new HelpNetworkReply(request, ba.isEmpty() ? " " : ba, mimeType);
}
class HelpPage : public QWebPage
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 46f2280..7751143 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -317,6 +317,7 @@ Configure::Configure( int& argc, char** argv )
dictionary[ "OPENSSL" ] = "auto";
dictionary[ "DBUS" ] = "auto";
dictionary[ "S60" ] = "yes";
+ dictionary[ "SYMBIAN_DEFFILES" ] = "yes";
dictionary[ "STYLE_WINDOWS" ] = "yes";
dictionary[ "STYLE_WINDOWSXP" ] = "auto";
@@ -482,6 +483,7 @@ void Configure::parseCmdLine()
dictionary[ "BUILDNOKIA" ] = "yes";
dictionary[ "BUILDDEV" ] = "yes";
dictionary["LICENSE_CONFIRMED"] = "yes";
+ dictionary[ "SYMBIAN_DEFFILES" ] = "no";
}
else if( configCmdLine.at(i) == "-opensource" ) {
dictionary[ "BUILDTYPE" ] = "opensource";
@@ -803,7 +805,7 @@ void Configure::parseCmdLine()
else if( configCmdLine.at(i) == "-no-native-gestures" )
dictionary[ "NATIVE_GESTURES" ] = "no";
#if !defined(EVAL)
- // Others ---------------------------------------------------
+ // Symbian Support -------------------------------------------
else if (configCmdLine.at(i) == "-fpu" )
{
++i;
@@ -812,12 +814,17 @@ void Configure::parseCmdLine()
dictionary[ "ARM_FPU_TYPE" ] = configCmdLine.at(i);
}
- // S60 Support -------------------------------------------
else if( configCmdLine.at(i) == "-s60" )
dictionary[ "S60" ] = "yes";
else if( configCmdLine.at(i) == "-no-s60" )
dictionary[ "S60" ] = "no";
+ else if( configCmdLine.at(i) == "-usedeffiles" )
+ dictionary[ "SYMBIAN_DEFFILES" ] = "yes";
+ else if( configCmdLine.at(i) == "-no-usedeffiles" )
+ dictionary[ "SYMBIAN_DEFFILES" ] = "no";
+
+ // Others ---------------------------------------------------
else if (configCmdLine.at(i) == "-fast" )
dictionary[ "FAST" ] = "yes";
else if (configCmdLine.at(i) == "-no-fast" )
@@ -1822,7 +1829,9 @@ bool Configure::displayHelp()
desc("FREETYPE", "yes", "-qt-freetype", "Use the libfreetype bundled with Qt.");
desc( "-fpu <flags>", "VFP type on ARM, supported options: softvfp(default) | vfpv2 | softvfp+vfpv2");
desc("S60", "no", "-no-s60", "Do not compile in S60 support.");
- desc("S60", "yes", "-s60", "Compile with support for the S60 UI Framework\n");
+ desc("S60", "yes", "-s60", "Compile with support for the S60 UI Framework");
+ desc("SYMBIAN_DEFFILES", "no", "-no-usedeffiles", "Disable the usage of DEF files.");
+ desc("SYMBIAN_DEFFILES", "yes", "-usedeffiles", "Enable the usage of DEF files.\n");
return true;
}
return false;
@@ -2744,6 +2753,13 @@ void Configure::generateCachefile()
if ( dictionary["PLUGIN_MANIFESTS"] == "no" )
configStream << " no_plugin_manifest";
+ if ( dictionary.contains("SYMBIAN_DEFFILES") ) {
+ if(dictionary["SYMBIAN_DEFFILES"] == "yes" ) {
+ configStream << " def_files";
+ } else if ( dictionary["SYMBIAN_DEFFILES"] == "no" ) {
+ configStream << " def_files_disabled";
+ }
+ }
configStream << endl;
configStream << "QT_ARCH = " << dictionary[ "ARCHITECTURE" ] << endl;
if (dictionary["QT_EDITION"].contains("OPENSOURCE"))
@@ -2770,8 +2786,9 @@ void Configure::generateCachefile()
if (!dictionary["QT_LIBINFIX"].isEmpty())
configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl;
+ configStream << "#Qt for Symbian FPU settings" << endl;
if(!dictionary["ARM_FPU_TYPE"].isEmpty()) {
- configStream<<"QMAKE_CXXFLAGS.ARMCC += --fpu "<< dictionary["ARM_FPU_TYPE"];
+ configStream<<"MMP_RULES += \"ARMFPU "<< dictionary["ARM_FPU_TYPE"]<< "\"";
}
configStream.flush();
@@ -3267,6 +3284,14 @@ void Configure::displayConfig()
cout << "Support for S60............." << dictionary[ "S60" ] << endl;
}
+ if (dictionary.contains("SYMBIAN_DEFFILES")) {
+ cout << "Symbian DEF files enabled..." << dictionary[ "SYMBIAN_DEFFILES" ] << endl;
+ if(dictionary["SYMBIAN_DEFFILES"] == "no") {
+ cout << "WARNING: Disabling DEF files will mean that Qt is NOT binary compatible with previous versions." << endl;
+ cout << " This feature is only intended for use during development, NEVER for release builds." << endl;
+ }
+ }
+
if(dictionary["ASSISTANT_WEBKIT"] == "yes")
cout << "Using WebKit as html rendering engine in Qt Assistant." << endl;
diff --git a/tools/designer/src/lib/shared/widgetfactory.cpp b/tools/designer/src/lib/shared/widgetfactory.cpp
index eda551d..c7b13a1 100644
--- a/tools/designer/src/lib/shared/widgetfactory.cpp
+++ b/tools/designer/src/lib/shared/widgetfactory.cpp
@@ -774,6 +774,8 @@ void WidgetFactory::applyStyleTopLevel(const QString &styleName, QWidget *w)
void WidgetFactory::applyStyleToTopLevel(QStyle *style, QWidget *widget)
{
+ if (!style)
+ return;
const QPalette standardPalette = style->standardPalette();
if (widget->style() == style && widget->palette() == standardPalette)
return;
diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf
index adca7b4..38da552 100644
--- a/tools/qdoc3/test/assistant.qdocconf
+++ b/tools/qdoc3/test/assistant.qdocconf
@@ -17,7 +17,7 @@ qhp.Assistant.namespace = com.trolltech.assistant.460
qhp.Assistant.virtualFolder = qdoc
qhp.Assistant.indexTitle = Qt Assistant Manual
qhp.Assistant.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png
-qhp.Assistant.filterAttributes = qt 4.6.1 tools assistant
+qhp.Assistant.filterAttributes = qt 4.6.2 tools assistant
qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual
qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant
qhp.Assistant.subprojects = manual examples
diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf
index d30ade9..57d21a9 100644
--- a/tools/qdoc3/test/designer.qdocconf
+++ b/tools/qdoc3/test/designer.qdocconf
@@ -17,7 +17,7 @@ qhp.Designer.namespace = com.trolltech.designer.460
qhp.Designer.virtualFolder = qdoc
qhp.Designer.indexTitle = Qt Designer Manual
qhp.Designer.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png
-qhp.Designer.filterAttributes = qt 4.6.1 tools designer
+qhp.Designer.filterAttributes = qt 4.6.2 tools designer
qhp.Designer.customFilters.Designer.name = Qt Designer Manual
qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer
qhp.Designer.subprojects = manual examples
diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf
index f06671b..5860b33 100644
--- a/tools/qdoc3/test/linguist.qdocconf
+++ b/tools/qdoc3/test/linguist.qdocconf
@@ -17,7 +17,7 @@ qhp.Linguist.namespace = com.trolltech.linguist.460
qhp.Linguist.virtualFolder = qdoc
qhp.Linguist.indexTitle = Qt Linguist Manual
qhp.Linguist.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png
-qhp.Linguist.filterAttributes = qt 4.6.1 tools linguist
+qhp.Linguist.filterAttributes = qt 4.6.2 tools linguist
qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual
qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist
qhp.Linguist.subprojects = manual examples
diff --git a/tools/qdoc3/test/macros.qdocconf b/tools/qdoc3/test/macros.qdocconf
index dbb8ab8..22db23e 100644
--- a/tools/qdoc3/test/macros.qdocconf
+++ b/tools/qdoc3/test/macros.qdocconf
@@ -32,4 +32,4 @@ macro.mdash.HTML = "&mdash;"
macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
macro.endfloat.HTML = "</div>"
-macro.clearfloat.HTML = "<div style=\"clear: both\">"
+macro.clearfloat.HTML = "<br style=\"clear: both\" />"
diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf
index ad27d75..0e7d960 100644
--- a/tools/qdoc3/test/qmake.qdocconf
+++ b/tools/qdoc3/test/qmake.qdocconf
@@ -17,7 +17,7 @@ qhp.qmake.namespace = com.trolltech.qmake.460
qhp.qmake.virtualFolder = qdoc
qhp.qmake.indexTitle = QMake Manual
qhp.qmake.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png
-qhp.qmake.filterAttributes = qt 4.6.1 tools qmake
+qhp.qmake.filterAttributes = qt 4.6.2 tools qmake
qhp.qmake.customFilters.qmake.name = qmake Manual
qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake
qhp.qmake.subprojects = manual
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index 09dd979..dee9a10 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -32,9 +32,9 @@ qhp.Qt.extraFiles = classic.css \
images/dynamiclayouts-example.png \
images/stylesheet-coffee-plastique.png
-qhp.Qt.filterAttributes = qt 4.6.1 qtrefdoc
-qhp.Qt.customFilters.Qt.name = Qt 4.6.1
-qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.1
+qhp.Qt.filterAttributes = qt 4.6.2 qtrefdoc
+qhp.Qt.customFilters.Qt.name = Qt 4.6.2
+qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.2
qhp.Qt.subprojects = classes overviews examples
qhp.Qt.subprojects.classes.title = Classes
qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
@@ -96,7 +96,7 @@ excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \
$QT_SOURCE_TREE/src/3rdparty/phonon/waveout
sources.fileextensions = "*.cpp *.qdoc *.mm"
-examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp"
+examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml"
examples.imageextensions = "*.png"
exampledirs = $QT_SOURCE_TREE/doc/src \
diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index 6d25432..c0ad121 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -34,9 +34,9 @@ qhp.Qt.extraFiles = classic.css \
images/dynamiclayouts-example.png \
images/stylesheet-coffee-plastique.png
-qhp.Qt.filterAttributes = qt 4.6.1 qtrefdoc
-qhp.Qt.customFilters.Qt.name = Qt 4.6.1
-qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.1
+qhp.Qt.filterAttributes = qt 4.6.2 qtrefdoc
+qhp.Qt.customFilters.Qt.name = Qt 4.6.2
+qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.2
qhp.Qt.subprojects = classes overviews examples
qhp.Qt.subprojects.classes.title = Classes
qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
@@ -99,7 +99,7 @@ excludedirs = $QTDIR/src/3rdparty/clucene \
$QTDIR/src/3rdparty/phonon/waveout
sources.fileextensions = "*.cpp *.qdoc *.mm"
-examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp"
+examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml"
examples.imageextensions = "*.png"
exampledirs = $QTDIR/doc/src \
@@ -110,7 +110,7 @@ exampledirs = $QTDIR/doc/src \
$QTDIR/src/3rdparty/webkit/WebKit/qt/docs
imagedirs = $QTDIR/doc/src/images \
$QTDIR/examples \
- $QTDIR/doc/src/declarative/pics
+ $QTDIR/doc/src/declarative/pics
outputdir = $QTDIR/doc/html
tagfile = $QTDIR/doc/html/qt.tags
base = file:$QTDIR/doc/html
diff --git a/tools/qmlviewer/main.cpp b/tools/qmlviewer/main.cpp
index 8a5efa3..b7a3f1a 100644
--- a/tools/qmlviewer/main.cpp
+++ b/tools/qmlviewer/main.cpp
@@ -83,6 +83,7 @@ void usage()
qWarning(" -skin <qvfbskindir> ...................... run with a skin window frame");
qWarning(" \"list\" for a list of built-ins");
qWarning(" -resizeview .............................. resize the view, not the skin");
+ qWarning(" -qmlbrowser .............................. use a QML-based file browser");
qWarning(" -recordfile <output> ..................... set video recording file");
qWarning(" - ImageMagick 'convert' for GIF)");
qWarning(" - png file for raw frames");
@@ -222,6 +223,8 @@ int main(int argc, char ** argv)
translationFile = argv[++i];
} else if (arg == "-opengl") {
useGL = true;
+ } else if (arg == "-qmlbrowser") {
+ useNativeFileBrowser = false;
} else if (arg == "-L") {
if (lastArg) usage();
libraries << QString(argv[++i]);
@@ -296,7 +299,6 @@ int main(int argc, char ** argv)
usage();
}
- viewer.setUseGL(useGL);
foreach (QString lib, libraries)
viewer.addLibraryPath(lib);
viewer.setNetworkCacheSize(cache);
@@ -335,6 +337,7 @@ int main(int argc, char ** argv)
if (useNativeFileBrowser)
viewer.openFile();
}
+ viewer.setUseGL(useGL);
viewer.raise();
return app.exec();
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp
index 21288c4..71ba81c 100644
--- a/tools/qmlviewer/qmlviewer.cpp
+++ b/tools/qmlviewer/qmlviewer.cpp
@@ -45,13 +45,16 @@
#include "qmlviewer.h"
#include <qmlcontext.h>
#include <qmlengine.h>
+#include <qmlnetworkaccessmanagerfactory.h>
#include "qml.h"
#include <private/qperformancelog_p_p.h>
#include <private/qabstractanimation_p.h>
#include <QAbstractAnimation>
#include "deviceskin.h"
+#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
#include <private/qzipreader_p.h>
+#endif
#include <QSettings>
#include <QXmlStreamReader>
@@ -78,6 +81,8 @@
#include <QTimer>
#include <QNetworkProxyFactory>
#include <QKeyEvent>
+#include <QMutex>
+#include <QMutexLocker>
#include "proxysettings.h"
#include "deviceorientation.h"
@@ -296,9 +301,22 @@ public:
PersistentCookieJar(QObject *parent) : QNetworkCookieJar(parent) { load(); }
~PersistentCookieJar() { save(); }
+ virtual QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const
+ {
+ QMutexLocker lock(&mutex);
+ return QNetworkCookieJar::cookiesForUrl(url);
+ }
+
+ virtual bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url)
+ {
+ QMutexLocker lock(&mutex);
+ return QNetworkCookieJar::setCookiesFromUrl(cookieList, url);
+ }
+
private:
void save()
{
+ QMutexLocker lock(&mutex);
QList<QNetworkCookie> list = allCookies();
QByteArray data;
foreach (QNetworkCookie cookie, list) {
@@ -313,12 +331,90 @@ private:
void load()
{
+ QMutexLocker lock(&mutex);
QSettings settings("Nokia", "QtQmlViewer");
QByteArray data = settings.value("Cookies").toByteArray();
setAllCookies(QNetworkCookie::parseCookies(data));
}
+
+ mutable QMutex mutex;
};
+class NetworkAccessManagerFactory : public QmlNetworkAccessManagerFactory
+{
+public:
+ NetworkAccessManagerFactory() : cookieJar(0), cacheSize(0) {}
+
+ QNetworkAccessManager *create(QObject *parent) {
+ QMutexLocker lock(&mutex);
+ QNetworkAccessManager *manager = new QNetworkAccessManager(parent);
+ if (!cookieJar)
+ cookieJar = new PersistentCookieJar(this);
+ manager->setCookieJar(cookieJar);
+ cookieJar->setParent(this);
+ setupProxy(manager);
+ if (cacheSize > 0) {
+ QNetworkDiskCache *cache = new QNetworkDiskCache;
+ cache->setCacheDirectory(QDir::tempPath()+QLatin1String("/qml-duiviewer-network-cache"));
+ cache->setMaximumCacheSize(cacheSize);
+ manager->setCache(cache);
+ } else {
+ manager->setCache(0);
+ }
+ qDebug() << "created new manager for" << parent;
+ return manager;
+ }
+
+ void setupProxy(QNetworkAccessManager *nam)
+ {
+ class SystemProxyFactory : public QNetworkProxyFactory
+ {
+ public:
+ virtual QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query)
+ {
+ QString protocolTag = query.protocolTag();
+ if (httpProxyInUse && (protocolTag == "http" || protocolTag == "https")) {
+ QList<QNetworkProxy> ret;
+ ret << httpProxy;
+ return ret;
+ }
+ return QNetworkProxyFactory::systemProxyForQuery(query);
+ }
+ void setHttpProxy (QNetworkProxy proxy)
+ {
+ httpProxy = proxy;
+ httpProxyInUse = true;
+ }
+ void unsetHttpProxy ()
+ {
+ httpProxyInUse = false;
+ }
+ private:
+ bool httpProxyInUse;
+ QNetworkProxy httpProxy;
+ };
+
+ SystemProxyFactory *proxyFactory = new SystemProxyFactory;
+ if (ProxySettings::httpProxyInUse())
+ proxyFactory->setHttpProxy(ProxySettings::httpProxy());
+ else
+ proxyFactory->unsetHttpProxy();
+ nam->setProxyFactory(proxyFactory);
+ }
+
+ void setCacheSize(int size) {
+ if (size != cacheSize) {
+ cacheSize = size;
+ invalidate();
+ }
+ }
+
+ PersistentCookieJar *cookieJar;
+ QMutex mutex;
+ int cacheSize;
+};
+
+
QString QmlViewer::getVideoFileName()
{
QString title = convertAvailable || ffmpegAvailable ? tr("Save Video File") : tr("Save PNG Frames");
@@ -395,8 +491,8 @@ QmlViewer::QmlViewer(QWidget *parent, Qt::WindowFlags flags)
setCentralWidget(canvas);
#endif
- setupProxy();
- canvas->engine()->networkAccessManager()->setCookieJar(new PersistentCookieJar(this));
+ namFactory = new NetworkAccessManagerFactory;
+ canvas->engine()->setNetworkAccessManagerFactory(namFactory);
connect(&autoStartTimer, SIGNAL(triggered()), this, SLOT(autoStartRecording()));
connect(&autoStopTimer, SIGNAL(triggered()), this, SLOT(autoStopRecording()));
@@ -407,6 +503,12 @@ QmlViewer::QmlViewer(QWidget *parent, Qt::WindowFlags flags)
recordTimer.setRepeating(true);
}
+QmlViewer::~QmlViewer()
+{
+ canvas->engine()->setNetworkAccessManagerFactory(0);
+ delete namFactory;
+}
+
void QmlViewer::adjustSizeSlot()
{
resize(sizeHint());
@@ -540,6 +642,13 @@ void QmlViewer::createMenu(QMenuBar *menu, QMenu *flatmenu)
QMenu *propertiesMenu = settingsMenu->addMenu(tr("Properties"));
QActionGroup *orientation = new QActionGroup(parent);
+
+ QAction *toggleOrientation = new QAction(tr("&Toggle Orientation"), parent);
+ toggleOrientation->setCheckable(true);
+ toggleOrientation->setShortcut(QKeySequence("Ctrl+T"));
+ settingsMenu->addAction(toggleOrientation);
+ connect(toggleOrientation, SIGNAL(triggered()), this, SLOT(toggleOrientation()));
+
orientation->setExclusive(true);
portraitOrientation = new QAction(tr("orientation: Portrait"), parent);
portraitOrientation->setCheckable(true);
@@ -582,7 +691,7 @@ void QmlViewer::showProxySettings()
void QmlViewer::proxySettingsChanged()
{
- setupProxy ();
+ namFactory->invalidate();
reload ();
}
@@ -598,6 +707,11 @@ void QmlViewer::setLandscape()
landscapeOrientation->setChecked(true);
}
+void QmlViewer::toggleOrientation()
+{
+ DeviceOrientation::instance()->setOrientation(DeviceOrientation::instance()->orientation()==DeviceOrientation::Portrait?DeviceOrientation::Landscape:DeviceOrientation::Portrait);
+}
+
void QmlViewer::toggleFullScreen()
{
if (isFullScreen())
@@ -751,16 +865,19 @@ void QmlViewer::reload()
void QmlViewer::open(const QString& doc)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
if (doc.endsWith(".wgt",Qt::CaseInsensitive)
|| doc.endsWith(".wgz",Qt::CaseInsensitive)
|| doc.endsWith(".zip",Qt::CaseInsensitive))
openWgt(doc);
else
+#endif
openQml(doc);
}
void QmlViewer::openWgt(const QString& doc)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
// XXX This functionality could be migrated to QmlView once refined
QUrl url(doc);
@@ -770,8 +887,10 @@ void QmlViewer::openWgt(const QString& doc)
QNetworkAccessManager * nam = canvas->engine()->networkAccessManager();
wgtreply = nam->get(QNetworkRequest(url));
connect(wgtreply,SIGNAL(finished()),this,SLOT(unpackWgt()));
+#endif
}
+#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
static void removeRecursive(const QString& dirname)
{
QDir dir(dirname);
@@ -783,9 +902,11 @@ static void removeRecursive(const QString& dirname)
dir.remove(entries[i].fileName());
QDir().rmdir(dirname);
}
+#endif
void QmlViewer::unpackWgt()
{
+#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
QByteArray all = wgtreply->readAll();
QBuffer buf(&all);
buf.open(QIODevice::ReadOnly);
@@ -839,6 +960,7 @@ void QmlViewer::unpackWgt()
}
openQml(rootfile);
+#endif
}
void QmlViewer::openFile()
@@ -1303,63 +1425,9 @@ void QmlViewer::setDeviceKeys(bool on)
devicemode = on;
}
-void QmlViewer::setupProxy()
-{
- class SystemProxyFactory : public QNetworkProxyFactory
- {
- public:
- virtual QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query)
- {
- QString protocolTag = query.protocolTag();
- if (httpProxyInUse && (protocolTag == "http" || protocolTag == "https")) {
- QList<QNetworkProxy> ret;
- ret << httpProxy;
- return ret;
- }
- return QNetworkProxyFactory::systemProxyForQuery(query);
- }
- void setHttpProxy (QNetworkProxy proxy)
- {
- httpProxy = proxy;
- httpProxyInUse = true;
- }
- void unsetHttpProxy ()
- {
- httpProxyInUse = false;
- }
- private:
- bool httpProxyInUse;
- QNetworkProxy httpProxy;
- };
-
- QNetworkAccessManager * nam = canvas->engine()->networkAccessManager();
- SystemProxyFactory *proxyFactory = new SystemProxyFactory;
- if (ProxySettings::httpProxyInUse())
- proxyFactory->setHttpProxy(ProxySettings::httpProxy());
- else
- proxyFactory->unsetHttpProxy();
- nam->setProxyFactory(proxyFactory);
-}
-
void QmlViewer::setNetworkCacheSize(int size)
{
- QNetworkAccessManager * nam = canvas->engine()->networkAccessManager();
- QNetworkDiskCache *cache = qobject_cast<QNetworkDiskCache*>(nam->cache());
- if (!cache) {
- if (size==0)
- return;
- cache = new QNetworkDiskCache;
- cache->setCacheDirectory(QDir::tempPath()+QLatin1String("/qml-duiviewer-network-cache"));
- nam->setCache(cache);
- }
- if (size == cache->maximumCacheSize())
- return;
- if (size>0) {
- // Setup a caching network manager
- cache->setMaximumCacheSize(size);
- } else {
- nam->setCache(0);
- }
+ namFactory->setCacheSize(size);
}
void QmlViewer::setUseGL(bool useGL)
diff --git a/tools/qmlviewer/qmlviewer.h b/tools/qmlviewer/qmlviewer.h
index 39bedc3..6b05584 100644
--- a/tools/qmlviewer/qmlviewer.h
+++ b/tools/qmlviewer/qmlviewer.h
@@ -57,6 +57,8 @@ class QProcess;
class RecordingDialog;
class QmlGraphicsTester;
class QNetworkReply;
+class QNetworkCookieJar;
+class NetworkAccessManagerFactory;
class QmlViewer
#if defined(Q_OS_SYMBIAN)
@@ -68,6 +70,7 @@ class QmlViewer
Q_OBJECT
public:
QmlViewer(QWidget *parent=0, Qt::WindowFlags flags=0);
+ ~QmlViewer();
enum ScriptOption {
Play = 0x00000001,
@@ -132,12 +135,12 @@ private slots:
void adjustSizeSlot();
void setPortrait();
void setLandscape();
+ void toggleOrientation();
void startNetwork();
void toggleFullScreen();
void unpackWgt();
private:
- void setupProxy();
QString getVideoFileName();
PreviewDeviceSkin *skin;
@@ -180,6 +183,8 @@ private:
QNetworkReply *wgtreply;
QString wgtdir;
+ NetworkAccessManagerFactory *namFactory;
+
bool useQmlFileBrowser;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QmlViewer::ScriptOptions)
diff --git a/tools/qttracereplay/main.cpp b/tools/qttracereplay/main.cpp
index 85e9b12..a932d72 100644
--- a/tools/qttracereplay/main.cpp
+++ b/tools/qttracereplay/main.cpp
@@ -52,6 +52,7 @@ public:
ReplayWidget(const QString &filename);
void paintEvent(QPaintEvent *event);
+ void resizeEvent(QResizeEvent *event);
public slots:
void updateRect();
@@ -64,14 +65,15 @@ public:
int currentIteration;
QTime timer;
+ QList<uint> visibleUpdates;
QList<uint> iterationTimes;
QString filename;
};
void ReplayWidget::updateRect()
{
- if (!updates.isEmpty())
- update(updates.at(currentFrame));
+ if (!visibleUpdates.isEmpty())
+ update(updates.at(visibleUpdates.at(currentFrame)));
}
void ReplayWidget::paintEvent(QPaintEvent *)
@@ -80,10 +82,10 @@ void ReplayWidget::paintEvent(QPaintEvent *)
// p.setClipRegion(frames.at(currentFrame).updateRegion);
- buffer.draw(&p, currentFrame);
+ buffer.draw(&p, visibleUpdates.at(currentFrame));
++currentFrame;
- if (currentFrame >= buffer.numFrames()) {
+ if (currentFrame >= visibleUpdates.size()) {
currentFrame = 0;
++currentIteration;
@@ -119,7 +121,7 @@ void ReplayWidget::paintEvent(QPaintEvent *)
if (iterationTimes.size() >= 10 || stddev < 4) {
printf("%s, iterations: %d, frames: %d, min(ms): %d, median(ms): %d, stddev: %f %%, max(fps): %f\n", qPrintable(filename),
- iterationTimes.size(), updates.size(), min, median, stddev, 1000. * updates.size() / min);
+ iterationTimes.size(), visibleUpdates.size(), min, median, stddev, 1000. * visibleUpdates.size() / min);
deleteLater();
return;
}
@@ -130,6 +132,21 @@ void ReplayWidget::paintEvent(QPaintEvent *)
QTimer::singleShot(0, this, SLOT(updateRect()));
}
+void ReplayWidget::resizeEvent(QResizeEvent *event)
+{
+ visibleUpdates.clear();
+
+ QRect bounds = rect();
+ for (int i = 0; i < updates.size(); ++i) {
+ if (updates.at(i).intersects(bounds))
+ visibleUpdates << i;
+ }
+
+ if (visibleUpdates.size() != updates.size())
+ printf("Warning: skipped %d frames due to limited resolution\n", updates.size() - visibleUpdates.size());
+
+}
+
ReplayWidget::ReplayWidget(const QString &filename_)
: currentFrame(0)
, currentIteration(0)
@@ -138,7 +155,6 @@ ReplayWidget::ReplayWidget(const QString &filename_)
setWindowTitle(filename);
QFile file(filename);
- QRect bounds;
if (!file.open(QIODevice::ReadOnly)) {
printf("Failed to load input file '%s'\n", qPrintable(filename_));
return;
diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp
index d8c306f..a77e713 100644
--- a/tools/runonphone/main.cpp
+++ b/tools/runonphone/main.cpp
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
QString serialPortFriendlyName;
QString sisFile;
QString exeFile;
- QString cmdLine;
+ QStringList cmdLine;
QStringList args = QCoreApplication::arguments();
QTextStream outstream(stdout);
QTextStream errstream(stderr);
@@ -124,7 +124,6 @@ int main(int argc, char *argv[])
i++;
for(;i<args.size();i++) {
cmdLine.append(args.at(i));
- if(i + 1 < args.size()) cmdLine.append(' ');
}
}
}
@@ -175,7 +174,11 @@ int main(int argc, char *argv[])
}
if(loglevel > 0)
outstream << "Connecting to target via " << serialPortName << endl;
+#ifdef Q_OS_WIN
launcher->setTrkServerName(QString("\\\\.\\") + serialPortName);
+#else
+ launcher->setTrkServerName(serialPortName);
+#endif
launcher->setFileName(QString("c:\\sys\\bin\\") + exeFile);
launcher->setCommandLineArgs(cmdLine);
@@ -200,8 +203,8 @@ int main(int argc, char *argv[])
QObject::connect(launcher.data(), SIGNAL(applicationOutputReceived(const QString &)), &handler, SLOT(applicationOutputReceived(const QString &)));
QObject::connect(launcher.data(), SIGNAL(copyProgress(int)), &handler, SLOT(copyProgress(int)));
QObject::connect(launcher.data(), SIGNAL(stateChanged(int)), &handler, SLOT(stateChanged(int)));
- QObject::connect(launcher.data(), SIGNAL(stopped(uint,uint,uint,QString)), &handler, SLOT(stopped(uint,uint,uint,QString)));
- QObject::connect(&handler, SIGNAL(resume(uint,uint)), launcher.data(), SLOT(resume(uint,uint)));
+ QObject::connect(launcher.data(), SIGNAL(processStopped(uint,uint,uint,QString)), &handler, SLOT(stopped(uint,uint,uint,QString)));
+ QObject::connect(&handler, SIGNAL(resume(uint,uint)), launcher.data(), SLOT(resumeProcess(uint,uint)));
QObject::connect(&handler, SIGNAL(terminate()), launcher.data(), SLOT(terminate()));
QObject::connect(launcher.data(), SIGNAL(finished()), &handler, SLOT(finished()));
diff --git a/tools/runonphone/runonphone.pro b/tools/runonphone/runonphone.pro
index cf0c055..2c1be98 100644
--- a/tools/runonphone/runonphone.pro
+++ b/tools/runonphone/runonphone.pro
@@ -18,3 +18,9 @@ windows {
-luuid \
-ladvapi32
}
+else:unix:!symbian {
+ SOURCES += serenum_unix.cpp
+}
+else {
+ SOURCES += serenum_stub.cpp
+}
diff --git a/tools/runonphone/serenum_stub.cpp b/tools/runonphone/serenum_stub.cpp
new file mode 100644
index 0000000..f39765e
--- /dev/null
+++ b/tools/runonphone/serenum_stub.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "serenum.h"
+#include <QByteArray>
+#include <QString>
+#include <QDebug>
+
+QList<SerialPortId> enumerateSerialPorts()
+{
+ QList<SerialPortId> list;
+ qWarning() << "enumerateSerialPorts not implemented" << endl;
+ return list;
+}
+
diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp
new file mode 100644
index 0000000..ca6c437
--- /dev/null
+++ b/tools/runonphone/serenum_unix.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "serenum.h"
+#include <QByteArray>
+#include <QString>
+#include <QDebug>
+#include <QFileInfo>
+#include <QDir>
+
+QList<SerialPortId> enumerateSerialPorts()
+{
+ QList<SerialPortId> list;
+ QDir dir("/dev/serial/by-id/");
+ QFileInfoList ports(dir.entryInfoList());
+ foreach(QFileInfo info, ports) {
+ if (!info.isDir()) {
+ SerialPortId id;
+ id.friendlyName = info.fileName();
+ id.portName = info.canonicalFilePath();
+ list << id;
+ }
+ }
+ return list;
+}
+
diff --git a/tools/runonphone/trk/launcher.cpp b/tools/runonphone/trk/launcher.cpp
index 8f150c6..1796fc5 100644
--- a/tools/runonphone/trk/launcher.cpp
+++ b/tools/runonphone/trk/launcher.cpp
@@ -76,7 +76,7 @@ struct LauncherPrivate {
CopyState m_copyState;
QString m_fileName;
- QString m_commandLineArgs;
+ QStringList m_commandLineArgs;
QString m_installFileName;
int m_verbose;
Launcher::Actions m_startupActions;
@@ -159,7 +159,7 @@ void Launcher::setInstallFileName(const QString &name)
d->m_installFileName = name;
}
-void Launcher::setCommandLineArgs(const QString &args)
+void Launcher::setCommandLineArgs(const QStringList &args)
{
d->m_commandLineArgs = args;
}
@@ -189,8 +189,10 @@ bool Launcher::startServer(QString *errorMessage)
{
errorMessage->clear();
if (d->m_verbose) {
- const QString msg = QString::fromLatin1("Port=%1 Executable=%2 Package=%3 Remote Package=%4 Install file=%5")
- .arg(d->m_trkServerName, d->m_fileName, d->m_copyState.sourceFileName, d->m_copyState.destinationFileName, d->m_installFileName);
+ const QString msg = QString::fromLatin1("Port=%1 Executable=%2 Arguments=%3 Package=%4 Remote Package=%5 Install file=%6")
+ .arg(d->m_trkServerName, d->m_fileName,
+ d->m_commandLineArgs.join(QString(QLatin1Char(' '))),
+ d->m_copyState.sourceFileName, d->m_copyState.destinationFileName, d->m_installFileName);
logMessage(msg);
}
if (d->m_startupActions & ActionCopy) {
@@ -296,6 +298,34 @@ void Launcher::handleRemoteProcessKilled(const TrkResult &result)
disconnectTrk();
}
+QString Launcher::msgStopped(uint pid, uint tid, uint address, const QString &why)
+{
+ return QString::fromLatin1("Process %1, thread %2 stopped at 0x%3: %4").
+ arg(pid).arg(tid).arg(address, 0, 16).
+ arg(why.isEmpty() ? QString::fromLatin1("<Unknown reason>") : why);
+}
+
+bool Launcher::parseNotifyStopped(const QByteArray &dataBA,
+ uint *pid, uint *tid, uint *address,
+ QString *why /* = 0 */)
+{
+ if (why)
+ why->clear();
+ *address = *pid = *tid = 0;
+ if (dataBA.size() < 12)
+ return false;
+ const char *data = dataBA.data();
+ *address = extractInt(data);
+ *pid = extractInt(data + 4);
+ *tid = extractInt(data + 8);
+ if (why && dataBA.size() >= 14) {
+ const unsigned short len = extractShort(data + 12);
+ if (len > 0)
+ *why = QString::fromLatin1(data + 14, len);
+ }
+ return true;
+}
+
void Launcher::handleResult(const TrkResult &result)
{
QByteArray prefix = "READ BUF: ";
@@ -315,25 +345,13 @@ void Launcher::handleResult(const TrkResult &result)
break;
}
case TrkNotifyStopped: { // Notified Stopped
- logMessage(prefix + "NOTE: STOPPED " + str);
- // 90 01 78 6a 40 40 00 00 07 23 00 00 07 24 00 00
QString reason;
- if (result.data.size() >= 14) {
- uint pc = extractInt(result.data.mid(0,4).constData());
- uint pid = extractInt(result.data.mid(4,4).constData());
- uint tid = extractInt(result.data.mid(8,4).constData());
- ushort len = extractShort(result.data.mid(12,2).constData());
- if(len > 0)
- reason = result.data.mid(14, len);
- emit(stopped(pc, pid, tid, reason));
- } else {
- emit(stopped(0, 0, 0, reason));
- }
- //const char *data = result.data.data();
-// uint addr = extractInt(data); //code address: 4 bytes; code base address for the library
-// uint pid = extractInt(data + 4); // ProcessID: 4 bytes;
-// uint tid = extractInt(data + 8); // ThreadID: 4 bytes
- //logMessage(prefix << " ADDR: " << addr << " PID: " << pid << " TID: " << tid);
+ uint pc;
+ uint pid;
+ uint tid;
+ parseNotifyStopped(result.data, &pid, &tid, &pc, &reason);
+ logMessage(prefix + msgStopped(pid, tid, pc, reason));
+ emit(processStopped(pc, pid, tid, reason));
d->m_device->sendTrkAck(result.token);
break;
}
@@ -681,31 +699,38 @@ void Launcher::handleInstallPackageFinished(const TrkResult &result)
}
}
-void Launcher::startInferiorIfNeeded()
+QByteArray Launcher::startProcessMessage(const QString &executable,
+ const QStringList &arguments)
{
- emit startingApplication();
- if (d->m_session.pid != 0) {
- logMessage("Process already 'started'");
- return;
- }
// It's not started yet
QByteArray ba;
appendShort(&ba, 0, TargetByteOrder); // create new process
appendByte(&ba, 0); // options - currently unused
+ if(arguments.isEmpty()) {
+ appendString(&ba, executable.toLocal8Bit(), TargetByteOrder);
+ return ba;
+ }
+ // Append full command line as one string (leading length information).
+ QByteArray commandLineBa;
+ commandLineBa.append(executable.toLocal8Bit());
+ commandLineBa.append('\0');
+ commandLineBa.append(arguments.join(QString(QLatin1Char(' '))).toLocal8Bit());
+ appendString(&ba, commandLineBa, TargetByteOrder);
+ return ba;
+}
- if(d->m_commandLineArgs.isEmpty()) {
- appendString(&ba, d->m_fileName.toLocal8Bit(), TargetByteOrder);
- } else {
- QByteArray ba2;
- ba2.append(d->m_fileName.toLocal8Bit());
- ba2.append('\0');
- ba2.append(d->m_commandLineArgs.toLocal8Bit());
- appendString(&ba, ba2, TargetByteOrder);
+void Launcher::startInferiorIfNeeded()
+{
+ emit startingApplication();
+ if (d->m_session.pid != 0) {
+ logMessage("Process already 'started'");
+ return;
}
- d->m_device->sendTrkMessage(TrkCreateItem, TrkCallback(this, &Launcher::handleCreateProcess), ba); // Create Item
+ d->m_device->sendTrkMessage(TrkCreateItem, TrkCallback(this, &Launcher::handleCreateProcess),
+ startProcessMessage(d->m_fileName, d->m_commandLineArgs)); // Create Item
}
-void Launcher::resume(uint pid, uint tid)
+void Launcher::resumeProcess(uint pid, uint tid)
{
QByteArray ba;
appendInt(&ba, pid, BigEndian);
diff --git a/tools/runonphone/trk/launcher.h b/tools/runonphone/trk/launcher.h
index 5dded53..8dc6ebe 100644
--- a/tools/runonphone/trk/launcher.h
+++ b/tools/runonphone/trk/launcher.h
@@ -95,7 +95,7 @@ public:
void setFileName(const QString &name);
void setCopyFileName(const QString &srcName, const QString &dstName);
void setInstallFileName(const QString &name);
- void setCommandLineArgs(const QString &args);
+ void setCommandLineArgs(const QStringList &args);
bool startServer(QString *errorMessage);
void setVerbose(int v);
void setSerialFrame(bool b);
@@ -109,6 +109,15 @@ public:
// becomes valid after successful execution of ActionPingOnly
QString deviceDescription(unsigned verbose = 0u) const;
+ static QByteArray startProcessMessage(const QString &executable,
+ const QStringList &arguments);
+ // Parse a TrkNotifyStopped message
+ static bool parseNotifyStopped(const QByteArray &a,
+ uint *pid, uint *tid, uint *address,
+ QString *why = 0);
+ // Helper message
+ static QString msgStopped(uint pid, uint tid, uint address, const QString &why);
+
signals:
void copyingStarted();
void canNotConnect(const QString &errorMessage);
@@ -125,11 +134,11 @@ signals:
void applicationOutputReceived(const QString &output);
void copyProgress(int percent);
void stateChanged(int);
- void stopped(uint pc, uint pid, uint tid, const QString& reason);
+ void processStopped(uint pc, uint pid, uint tid, const QString& reason);
public slots:
void terminate();
- void resume(uint pid, uint tid);
+ void resumeProcess(uint pid, uint tid);
private slots:
void handleResult(const trk::TrkResult &data);
diff --git a/tools/runonphone/trk/trkdevice.cpp b/tools/runonphone/trk/trkdevice.cpp
index 53f4490..fe3261b 100644
--- a/tools/runonphone/trk/trkdevice.cpp
+++ b/tools/runonphone/trk/trkdevice.cpp
@@ -99,6 +99,8 @@ QString winErrorMessage(unsigned long error)
#endif
+enum { verboseTrk = 0 };
+
namespace trk {
///////////////////////////////////////////////////////////////////////
@@ -128,6 +130,12 @@ TrkMessage::TrkMessage(byte c, byte t, TrkCallback cb) :
{
}
+QDebug operator<<(QDebug d, const TrkMessage &msg)
+{
+ return d << "Message: Code: " << msg.code
+ << " Token: " << msg.token << " " << msg.data.toHex();
+}
+
} // namespace trk
Q_DECLARE_METATYPE(trk::TrkMessage)
@@ -204,6 +212,8 @@ byte TrkWriteQueue::nextTrkWriteToken()
++m_trkWriteToken;
if (m_trkWriteToken == 0)
++m_trkWriteToken;
+ if (verboseTrk)
+ qDebug() << "Write token: " << m_trkWriteToken;
return m_trkWriteToken;
}
@@ -334,7 +344,8 @@ DeviceContext::DeviceContext() :
///////////////////////////////////////////////////////////////////////
-class WriterThread : public QThread {
+class WriterThread : public QThread
+{
Q_OBJECT
Q_DISABLE_COPY(WriterThread)
public:
@@ -400,15 +411,18 @@ int WriterThread::writePendingMessage()
m_waitMutex.unlock();
if (m_terminate)
return 1;
+
// Send off message
m_dataMutex.lock();
TrkMessage message;
const TrkWriteQueue::PendingMessageResult pr = m_queue.pendingMessage(&message);
m_dataMutex.unlock();
+
switch (pr) {
case TrkWriteQueue::NoMessage:
break;
case TrkWriteQueue::PendingMessage: {
+ //qDebug() << "Write pending message " << message;
// Untested: try to re-send a few times
bool success = false;
for (int r = 0; !success && (r < MaxAttempts); r++) {
@@ -428,6 +442,8 @@ int WriterThread::writePendingMessage()
break;
case TrkWriteQueue::NoopMessageDequeued:
// Sync with thread that owns us via a blocking signal
+ if (verboseTrk)
+ qDebug() << "Noop message dequeued" << message;
emit internalNoopMessageDequeued(message);
break;
} // switch
@@ -499,6 +515,8 @@ static inline bool overlappedSyncWrite(HANDLE file,
bool WriterThread::write(const QByteArray &data, QString *errorMessage)
{
+ if (verboseTrk)
+ qDebug() << "Write raw data: " << data.toHex();
QMutexLocker locker(&m_context->mutex);
#ifdef Q_OS_WIN
DWORD charsWritten;
@@ -557,6 +575,7 @@ void WriterThread::slotHandleResult(const TrkResult &result)
tryWrite(); // Have messages been enqueued in-between?
}
+
///////////////////////////////////////////////////////////////////////
//
// ReaderThreadBase: Base class for a thread that reads data from
@@ -566,7 +585,8 @@ void WriterThread::slotHandleResult(const TrkResult &result)
//
///////////////////////////////////////////////////////////////////////
-class ReaderThreadBase : public QThread {
+class ReaderThreadBase : public QThread
+{
Q_OBJECT
Q_DISABLE_COPY(ReaderThreadBase)
public:
@@ -625,7 +645,8 @@ void ReaderThreadBase::readMessages()
//
///////////////////////////////////////////////////////////////////////
-class WinReaderThread : public ReaderThreadBase {
+class WinReaderThread : public ReaderThreadBase
+{
Q_OBJECT
Q_DISABLE_COPY(WinReaderThread)
public:
@@ -835,7 +856,8 @@ void UnixReaderThread::terminate()
{
// Trigger select() by writing to the pipe
char c = 0;
- write(m_terminatePipeFileDescriptors[1], &c, 1);
+ int written = write(m_terminatePipeFileDescriptors[1], &c, 1);
+ // FIXME: Use result.
wait();
}
@@ -1021,6 +1043,8 @@ void TrkDevice::setVerbose(int b)
void TrkDevice::slotMessageReceived(const trk::TrkResult &result, const QByteArray &rawData)
{
d->writerThread->slotHandleResult(result);
+ if (d->verbose > 1)
+ qDebug() << "Received: " << result.toString();
emit messageReceived(result);
if (!rawData.isEmpty())
emit rawDataReceived(rawData);
@@ -1057,6 +1081,8 @@ bool TrkDevice::sendTrkAck(byte token)
TrkMessage msg(0x80, token);
msg.token = token;
msg.data.append('\0');
+ if (verboseTrk)
+ qDebug() << "Write synchroneous message: " << msg;
return d->writerThread->trkWriteRawMessage(msg);
// 01 90 00 07 7e 80 01 00 7d 5e 7e
}
diff --git a/tools/runonphone/trk/trkutils.h b/tools/runonphone/trk/trkutils.h
index c636ac0..328dd2b 100644
--- a/tools/runonphone/trk/trkutils.h
+++ b/tools/runonphone/trk/trkutils.h
@@ -119,7 +119,8 @@ struct Library
uint dataseg;
};
-struct TrkAppVersion {
+struct TrkAppVersion
+{
TrkAppVersion();
void reset();
@@ -153,6 +154,10 @@ struct Session
typedef QList<Library> Libraries;
Libraries libraries;
+ typedef uint Thread;
+ typedef QList<Thread> Threads;
+ Threads threads;
+
// Gdb request
uint currentThread;
QStringList modules;