summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/development/qmake-manual.qdoc37
-rw-r--r--doc/src/snippets/code/doc_src_qmake-manual.qdoc5
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp235
-rw-r--r--qmake/generators/symbian/symbiancommon.h11
-rw-r--r--tools/assistant/tools/assistant/bookmarkmanager.cpp8
-rw-r--r--tools/assistant/tools/assistant/mainwindow.cpp16
6 files changed, 213 insertions, 99 deletions
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index baa30fc..41081a0 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -1385,19 +1385,23 @@ is the application private directory on the drive it is installed to.
On the Symbian platform, generic PKG file content can also be specified with this
variable. You can use either \c pkg_prerules or \c pkg_postrules to
pass raw data to PKG file. The strings in \c pkg_prerules are added before
- package-body and \c pkg_postrules after. The strings defined in
- \c pkg_postrules or \c pkg_prerules are not parsed by qmake, so they
- should be in a format understood by Symbian package generation tools.
+ package-body and \c pkg_postrules after. \c pkg_prerules is used for
+ defining vendor information, dependencies, custom package headers, and the
+ like, while \c pkg_postrules is used for custom file deployment and
+ embedded sis directives.
+ The strings defined in \c pkg_postrules or \c pkg_prerules are not parsed
+ by qmake, so they should be in a format understood by Symbian package
+ generation tools.
Please consult the Symbian platform documentation for correct syntax.
-
- For example, to deploy DLL and add a new dependency:
+
+ For example, to deploy DLL and add a new dependency:
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 140
Please note that \c pkg_prerules can also replace default statements in
pkg file. If no pkg_prerules is defined, qmake makes sure that PKG file
syntax is correct and it contains all mandatory statements such as:
-
+
\list
\o languages, for example \BR
&EN,FR
@@ -1406,13 +1410,28 @@ is the application private directory on the drive it is installed to.
\o localized and unique vendor, for example \BR
%{"Vendor-EN", ..., "Vendor-FR"}
:"Unique vendor name"
- \endlist
-
- If you decide to override any of these statements, you need to pay
+ \endlist
+
+ If you decide to override any of these statements, you need to pay
attention that also other statements stay valid. For example if you
override languages statement, you must override also package-header
statement and all other statements which are language specific.
+ On the Symbian platform, three separate PKG files are generated:
+
+ \list
+ \o <app>_template.pkg - For application SIS file. Rules suffix: \c{.main}
+ \o <app>_installer.pkg - For smart installer SIS file. Rules suffix: \c{.installer}
+ \o <app>_stub.pkg - For ROM stubs. Rules suffix: \c{.stub}
+ \endlist
+
+ \c pkg_prerules and \c pkg_postrules given without rules suffix will
+ intelligently apply to each of these files, but rules can also be
+ targeted to only one of above files by appending listed rules suffix
+ to the variable name:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 152
+
On the Symbian platform, the \c default_deployment item specifies
default platform and package dependencies. Those dependencies can be
selectively disabled if alternative dependencies need to be defined
diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
index 4ac7d5e..0436130 100644
--- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc
+++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
@@ -1002,3 +1002,8 @@ symbian {
RSS_RULES.service_list += "uid = 0x12345678; datatype_list = \{\}; opaque_data = r_my_icon;"
RSS_RULES.footer +="RESOURCE CAPTION_AND_ICON_INFO r_my_icon \{ icon_file =\"$$PWD/my_icon.svg\"; \}"
//! [151]
+
+//! [152]
+my_note.pkg_postrules.installer = "\"myinstallnote.txt\" - \"\", FILETEXT, TEXTCONTINUE"
+DEPLOYMENT += my_note
+//! [152]
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index d124b02..5ca249c 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -202,44 +202,71 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
tw << headerComment.arg(wrapperPkgFilename).arg(dateStr);
ts << headerComment.arg(stubPkgFileName).arg(dateStr);
- // Construct QStringList from pkg_prerules since we need search it before printed to file
- // Note: Though there can't be more than one language or header line, use stringlists
+ QStringList commonRawPreRules;
+ QStringList mainRawPreRules;
+ QStringList instRawPreRules;
+ QStringList stubRawPreRules;
+
+ // Though there can't be more than one language or header line, use stringlists
// in case user wants comments to go with the rules.
- QStringList rawPkgPreRules;
+ // Note that it makes no sense to have file specific language or header rules,
+ // except what is provided for installer header via "DEPLOYMENT.installer_header" variable,
+ // because stub and main headers should always match. Vendor rules are similarly limited to
+ // make code cleaner as it is unlikely anyone will want different vendor in different files.
QStringList languageRules;
QStringList headerRules;
- foreach(QString deploymentItem, project->values("DEPLOYMENT")) {
- foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) {
- QStringList pkgrulesValue = project->values(pkgrulesItem);
- // If there is no stringlist defined for a rule, use rule name directly
- // This is convenience for defining single line mmp statements
- if (pkgrulesValue.isEmpty()) {
- if (pkgrulesItem.startsWith("&"))
- languageRules << pkgrulesItem;
- else if (pkgrulesItem.startsWith("#"))
- headerRules << pkgrulesItem;
- else
- rawPkgPreRules << pkgrulesItem;
- } else {
- if (containsStartWithItem('&', pkgrulesValue)) {
- foreach(QString pkgrule, pkgrulesValue) {
- languageRules << pkgrule;
- }
- } else if (containsStartWithItem('#', pkgrulesValue)) {
- foreach(QString pkgrule, pkgrulesValue) {
- headerRules << pkgrule;
- }
- } else {
- foreach(QString pkgrule, pkgrulesValue) {
- rawPkgPreRules << pkgrule;
- }
- }
- }
+ QStringList vendorRules;
+
+ QStringList commonRawPostRules;
+ QStringList mainRawPostRules;
+ QStringList instRawPostRules;
+ QStringList stubRawPostRules;
+
+ QStringList failList; // Used for detecting incorrect usage
+
+ QString emptySuffix;
+ QString mainSuffix(".main");
+ QString instSuffix(".installer");
+ QString stubSuffix(".stub");
+
+ foreach(QString item, project->values("DEPLOYMENT")) {
+ parsePreRules(item, emptySuffix, &commonRawPreRules, &languageRules, &headerRules, &vendorRules);
+ parsePreRules(item, mainSuffix, &mainRawPreRules, &failList, &failList, &failList);
+ parsePreRules(item, instSuffix, &instRawPreRules, &failList, &failList, &failList);
+ parsePreRules(item, stubSuffix, &stubRawPreRules, &failList, &failList, &failList);
+
+ parsePostRules(item, emptySuffix, &commonRawPostRules);
+ parsePostRules(item, mainSuffix, &mainRawPostRules);
+ parsePostRules(item, instSuffix, &instRawPostRules);
+ parsePostRules(item, stubSuffix, &stubRawPostRules);
+ }
+
+ if (!failList.isEmpty()) {
+ fprintf(stderr, "Warning: Custom language, header, or vendor definitions are not "
+ "supported by file specific pkg_prerules.* variables.\n"
+ "Use plain pkg_prerules and/or DEPLOYMENT.installer_header for customizing "
+ "these items.\n");
+ }
+
+ foreach(QString item, commonRawPreRules) {
+ if (item.startsWith("(")) {
+ // Only regular pkg file should have package dependencies
+ mainRawPreRules << item;
+ } else if (item.startsWith("[")) {
+ // stub pkg file should not have platform dependencies
+ mainRawPreRules << item;
+ instRawPreRules << item;
+ } else {
+ mainRawPreRules << item;
+ instRawPreRules << item;
+ stubRawPreRules << item;
}
}
- // Apply some defaults if specific data does not exist in PKG pre-rules
+ // Currently common postrules only go to main
+ mainRawPostRules << commonRawPostRules;
+ // Apply some defaults if specific data does not exist in PKG pre-rules
if (languageRules.isEmpty()) {
// language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS)
languageRules << "; Language\n&EN\n\n";
@@ -297,49 +324,38 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
ts << headerRules.join("\n") << endl;
}
- // Localized vendor name
- QString vendorName;
- if (!containsStartWithItem('%', rawPkgPreRules)) {
- vendorName += "; Localised Vendor name\n%{\"Vendor\"}\n\n";
+ // Vendor name
+ if (!containsStartWithItem('%', vendorRules)) {
+ vendorRules << "; Default localized vendor name\n%{\"Vendor\"}\n\n";
}
-
- // Unique vendor name
- if (!containsStartWithItem(':', rawPkgPreRules)) {
- vendorName += "; Unique Vendor name\n:\"Vendor\"\n\n";
+ if (!containsStartWithItem(':', vendorRules)) {
+ vendorRules << "; Default unique vendor name\n:\"Vendor\"\n\n";
}
- t << vendorName;
- tw << vendorName;
- ts << vendorName;
+ t << vendorRules.join("\n") << endl;
+ tw << vendorRules.join("\n") << endl;
+ ts << vendorRules.join("\n") << endl;
// PKG pre-rules - these are added before actual file installations i.e. SIS package body
- if (rawPkgPreRules.size()) {
- QString comment = "\n; Manual PKG pre-rules from PRO files\n";
+ QString comment = "\n; Manual PKG pre-rules from PRO files\n";
+
+ if (mainRawPreRules.size()) {
t << comment;
+ t << mainRawPreRules.join("\n") << endl;
+ }
+ if (instRawPreRules.size()) {
tw << comment;
+ tw << instRawPreRules.join("\n") << endl;
+ }
+ if (stubRawPreRules.size()) {
ts << comment;
-
- foreach(QString item, rawPkgPreRules) {
- // Only regular pkg file should have package dependencies
- if (item.startsWith("(")) {
- t << item << endl;
- }
- // stub pkg file should not have platform dependencies
- else if (item.startsWith("[")) {
- t << item << endl;
- tw << item << endl;
- }
- else {
- t << item << endl;
- ts << item << endl;
- tw << item << endl;
- }
- }
- t << endl;
- ts << endl;
- tw << endl;
+ ts << stubRawPreRules.join("\n") << endl;
}
+ t << endl;
+ tw << endl;
+ ts << endl;
+
// Begin Manufacturer block
if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) {
QString manufacturerStr("IF ");
@@ -465,21 +481,19 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
ts << endl;
// PKG post-rules - these are added after actual file installations i.e. SIS package body
- t << "; Manual PKG post-rules from PRO files" << endl;
- foreach(QString deploymentItem, project->values("DEPLOYMENT")) {
- foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_postrules")) {
- QStringList pkgrulesValue = project->values(pkgrulesItem);
- // If there is no stringlist defined for a rule, use rule name directly
- // This is convenience for defining single line statements
- if (pkgrulesValue.isEmpty()) {
- t << pkgrulesItem << endl;
- } else {
- foreach(QString pkgrule, pkgrulesValue) {
- t << pkgrule << endl;
- }
- }
- t << endl;
- }
+ comment = "; Manual PKG post-rules from PRO files\n";
+
+ if (mainRawPostRules.size()) {
+ t << comment;
+ t << mainRawPostRules.join("\n") << endl;
+ }
+ if (instRawPostRules.size()) {
+ tw << comment;
+ tw << instRawPostRules.join("\n") << endl;
+ }
+ if (stubRawPostRules.size()) {
+ ts << comment;
+ ts << stubRawPostRules.join("\n") << endl;
}
// Close Manufacturer block
@@ -1021,3 +1035,66 @@ void SymbianCommonGenerator::fillQt2S60LangMapTable()
qt2S60LangMapTable.insert("ny", "SC"); //Chewa //
}
+void SymbianCommonGenerator::parsePreRules(const QString &deploymentVariable,
+ const QString &variableSuffix,
+ QStringList *rawRuleList,
+ QStringList *languageRuleList,
+ QStringList *headerRuleList,
+ QStringList *vendorRuleList)
+{
+ QMakeProject *project = generator->project;
+ foreach(QString pkgrulesItem, project->values(deploymentVariable + ".pkg_prerules" + variableSuffix)) {
+ QStringList pkgrulesValue = project->values(pkgrulesItem);
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line statements
+ if (pkgrulesValue.isEmpty()) {
+ if (pkgrulesItem.startsWith("&"))
+ *languageRuleList << pkgrulesItem;
+ else if (pkgrulesItem.startsWith("#"))
+ *headerRuleList << pkgrulesItem;
+ else if (pkgrulesItem.startsWith("%") || pkgrulesItem.startsWith(":"))
+ *vendorRuleList << pkgrulesItem;
+ else
+ *rawRuleList << pkgrulesItem;
+ } else {
+ if (containsStartWithItem('&', pkgrulesValue)) {
+ foreach(QString pkgrule, pkgrulesValue) {
+ *languageRuleList << pkgrule;
+ }
+ } else if (containsStartWithItem('#', pkgrulesValue)) {
+ foreach(QString pkgrule, pkgrulesValue) {
+ *headerRuleList << pkgrule;
+ }
+ } else if (containsStartWithItem('%', pkgrulesValue)
+ || containsStartWithItem(':', pkgrulesValue)) {
+ foreach(QString pkgrule, pkgrulesValue) {
+ *vendorRuleList << pkgrule;
+ }
+ } else {
+ foreach(QString pkgrule, pkgrulesValue) {
+ *rawRuleList << pkgrule;
+ }
+ }
+ }
+ }
+}
+
+void SymbianCommonGenerator::parsePostRules(const QString &deploymentVariable,
+ const QString &variableSuffix,
+ QStringList *rawRuleList)
+{
+ QMakeProject *project = generator->project;
+ foreach(QString pkgrulesItem, project->values(deploymentVariable + ".pkg_postrules" + variableSuffix)) {
+ QStringList pkgrulesValue = project->values(pkgrulesItem);
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line statements
+ if (pkgrulesValue.isEmpty()) {
+ *rawRuleList << pkgrulesItem;
+ } else {
+ foreach(QString pkgrule, pkgrulesValue) {
+ *rawRuleList << pkgrule;
+ }
+ }
+ }
+}
+
diff --git a/qmake/generators/symbian/symbiancommon.h b/qmake/generators/symbian/symbiancommon.h
index dae1e4a..80f2079 100644
--- a/qmake/generators/symbian/symbiancommon.h
+++ b/qmake/generators/symbian/symbiancommon.h
@@ -86,6 +86,17 @@ protected:
QStringList symbianLangCodesFromTsFiles();
void fillQt2S60LangMapTable();
+ void parsePreRules(const QString &deploymentVariable,
+ const QString &variableSuffix,
+ QStringList *rawRuleList,
+ QStringList *languageRuleList,
+ QStringList *headerRuleList,
+ QStringList *vendorRuleList);
+ void parsePostRules(const QString &deploymentVariable,
+ const QString &variableSuffix,
+ QStringList *rawRuleList);
+
+
protected:
MakefileGenerator *generator;
diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp
index 65888fe..eb5a37a 100644
--- a/tools/assistant/tools/assistant/bookmarkmanager.cpp
+++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp
@@ -158,6 +158,8 @@ BookmarkManager::BookmarkManager()
: typeAndSearch(false)
, bookmarkMenu(0)
, bookmarkModel(new BookmarkModel)
+ , bookmarkFilterModel(0)
+ , typeAndSearchModel(0)
, bookmarkWidget(new BookmarkWidget)
, bookmarkTreeView(new BookmarkTreeView)
, bookmarkManagerWidget(0)
@@ -316,11 +318,13 @@ void BookmarkManager::setupFinished()
bookmarkTreeView->header()->setVisible(false);
bookmarkTreeView->header()->setStretchLastSection(true);
- bookmarkFilterModel = new BookmarkFilterModel(this);
+ if (!bookmarkFilterModel)
+ bookmarkFilterModel = new BookmarkFilterModel(this);
bookmarkFilterModel->setSourceModel(bookmarkModel);
bookmarkFilterModel->filterBookmarkFolders();
- typeAndSearchModel = new QSortFilterProxyModel(this);
+ if (!typeAndSearchModel)
+ typeAndSearchModel = new QSortFilterProxyModel(this);
typeAndSearchModel->setDynamicSortFilter(true);
typeAndSearchModel->setSourceModel(bookmarkFilterModel);
}
diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp
index b27d5a1..a47a501 100644
--- a/tools/assistant/tools/assistant/mainwindow.cpp
+++ b/tools/assistant/tools/assistant/mainwindow.cpp
@@ -118,6 +118,13 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
HelpEngineWrapper &helpEngineWrapper =
HelpEngineWrapper::instance(collectionFile);
+ if (!initHelpDB()) {
+ qDebug("Fatal error: Help engine initialization failed. "
+ "Error message was: %s\nAssistant will now exit.",
+ qPrintable(HelpEngineWrapper::instance().error()));
+ std::exit(1);
+ }
+
m_centralWidget = new CentralWidget(this);
setCentralWidget(m_centralWidget);
@@ -157,7 +164,6 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
connect(m_centralWidget, SIGNAL(addBookmark(QString, QString)),
bookMarkManager, SLOT(addBookmark(QString, QString)));
-#if 0
connect(bookMarkManager, SIGNAL(escapePressed()), this,
SLOT(activateCurrentCentralWidgetTab()));
connect(bookMarkManager, SIGNAL(setSource(QUrl)), m_centralWidget,
@@ -168,7 +174,6 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
QHelpSearchEngine *searchEngine = helpEngineWrapper.searchEngine();
connect(searchEngine, SIGNAL(indexingStarted()), this, SLOT(indexingStarted()));
connect(searchEngine, SIGNAL(indexingFinished()), this, SLOT(indexingFinished()));
-#endif
QString defWindowTitle = tr("Qt Assistant");
setWindowTitle(defWindowTitle);
@@ -177,13 +182,6 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
statusBar()->show();
m_centralWidget->connectTabBar();
- if (!initHelpDB()) {
- qDebug("Fatal error: Help engine initialization failed. "
- "Error message was: %s\nAssistant will now exit.",
- qPrintable(HelpEngineWrapper::instance().error()));
- std::exit(1);
- }
-
setupFilterToolbar();
setupAddressToolbar();