From e00354a40db497fe35fde7055521c2246e7a3e7c Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 7 Oct 2010 15:36:45 +0300 Subject: Implement support for DEPLOYMENT.display_name in Symbian The default package name and the default name that appears in the application menu is derived from the TARGET variable. Often the default is not optimal for displaying to end user. To set a better display name for these purposes DEPLOYMENT.display_name variable can now be used. Cherry picked to 4.7 branch from master branch as part of QTBUG-15068, original commit: 9cb24d1c4b7359ec84708ba770050de720b50cdf Task-number: QTBUG-15068 Task-number: QTBUG-14280 Reviewed-by: Janne Anttila --- doc/src/development/qmake-manual.qdoc | 7 +++++++ doc/src/snippets/code/doc_src_qmake-manual.qdoc | 4 ++++ qmake/generators/symbian/symbiancommon.cpp | 21 ++++++++++++++------- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 883c9d8..6531d25 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1491,6 +1491,13 @@ Additionally, some tools such as Runonphone may not work properly with sis packages that automatically run the application upon install. + On the Symbian platform, the default package name and the default name that + appears in application menu is derived from the \c TARGET variable. + Often the default is not optimal for displaying to end user. To set a better + display name for these purposes, use \c{DEPLOYMENT.display_name} variable: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 156 + On the Symbian platform, you can use \c{DEPLOYMENT.installer_header} variable to generate smart installer wrapper for your application. If you specify just UID of the installer package as the value, then diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index a5bc1f3..4f74e9c 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -1025,3 +1025,7 @@ dep_note.sources = install_note.txt dep_note.flags = FILETEXT TEXTEXIT DEPLOYMENT += dep_note //! [155] + +//! [156] +DEPLOYMENT.display_name = My Qt App +//! [156] diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index 5e8bc4a..0938b58 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -320,7 +320,9 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB // Package header QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n"; - QString visualTarget = generator->escapeFilePath(project->first("TARGET")); + QString visualTarget = project->values("DEPLOYMENT.display_name").join(" "); + if (visualTarget.isEmpty()) + visualTarget = generator->escapeFilePath(project->first("TARGET")); visualTarget = removePathSeparators(visualTarget); QString wrapperTarget = visualTarget + " installer"; @@ -641,6 +643,11 @@ void SymbianCommonGenerator::writeLocFile(QStringList &symbianLangCodes) if (ft.open(QIODevice::WriteOnly)) { generatedFiles << ft.fileName(); QTextStream t(&ft); + + QString displayName = generator->project->values("DEPLOYMENT.display_name").join(" "); + if (displayName.isEmpty()) + displayName = generator->escapeFilePath(generator->project->first("TARGET")); + t << "// ============================================================================" << endl; t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; @@ -649,16 +656,16 @@ void SymbianCommonGenerator::writeLocFile(QStringList &symbianLangCodes) t << "// ============================================================================" << endl; t << endl; t << "#ifdef LANGUAGE_SC" << endl; - t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; - t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; + t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl; + t << "#define STRING_r_caption \"" << displayName << "\"" << endl; foreach(QString lang, symbianLangCodes) { t << "#elif defined LANGUAGE_" << lang << endl; - t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; - t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; + t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl; + t << "#define STRING_r_caption \"" << displayName << "\"" << endl; } t << "#else" << endl; - t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; - t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; + t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl; + t << "#define STRING_r_caption \"" << displayName << "\"" << endl; t << "#endif" << endl; } else { PRINT_FILE_CREATE_ERROR(filename); -- cgit v0.12