summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-06 01:30:58 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-06 01:30:58 (GMT)
commitf4bb08bc61df49b9e28bb365ea2aa10e056a2862 (patch)
tree5b725a4581b29c9661de7267c1a272494c4fd2f4 /tools
parenta8ff8e81f7b120e1ecdd434093be075cdd92fb24 (diff)
parentbbd444559359df3e211fedb28d40b175af778030 (diff)
downloadQt-f4bb08bc61df49b9e28bb365ea2aa10e056a2862.zip
Qt-f4bb08bc61df49b9e28bb365ea2aa10e056a2862.tar.gz
Qt-f4bb08bc61df49b9e28bb365ea2aa10e056a2862.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Update def files for d524da81ee257a6bd67d32d0bc870280a7d5b8a4. Remove useless QString::clear() from QSharedData example snippet. Move note on connectToBus() not actually being able to reconnect to Designer: Prevent rich text from being copied into style sheets. QXmlPatterns QAbstractDateTime: only parse 3 digits of time fraction qdoc: Removed three unused config variables. qdoc: Cleaned up the application option specification and use. Doc: Adding GS QML example files Doc: Images for QML GS Doc: Editied version of QML GS Doc: Adding text to GS page Fix link error when building Bearer application with Qt Mobility Doc: nesting up orphant pages
Diffstat (limited to 'tools')
-rw-r--r--tools/designer/src/lib/shared/stylesheeteditor.cpp1
-rw-r--r--tools/qdoc3/config.h4
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp1
-rw-r--r--tools/qdoc3/htmlgenerator.cpp127
-rw-r--r--tools/qdoc3/htmlgenerator.h9
-rw-r--r--tools/qdoc3/main.cpp70
-rw-r--r--tools/qdoc3/test/assistant.qdocconf3
-rw-r--r--tools/qdoc3/test/designer.qdocconf3
-rw-r--r--tools/qdoc3/test/linguist.qdocconf3
-rw-r--r--tools/qdoc3/test/qdeclarative.qdocconf3
-rw-r--r--tools/qdoc3/test/qmake.qdocconf3
-rw-r--r--tools/qdoc3/test/qt-api-only.qdocconf3
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf3
-rw-r--r--tools/qdoc3/test/qt.qdocconf3
14 files changed, 96 insertions, 140 deletions
diff --git a/tools/designer/src/lib/shared/stylesheeteditor.cpp b/tools/designer/src/lib/shared/stylesheeteditor.cpp
index b76d700..e809447 100644
--- a/tools/designer/src/lib/shared/stylesheeteditor.cpp
+++ b/tools/designer/src/lib/shared/stylesheeteditor.cpp
@@ -79,6 +79,7 @@ StyleSheetEditor::StyleSheetEditor(QWidget *parent)
: QTextEdit(parent)
{
setTabStopWidth(fontMetrics().width(QLatin1Char(' '))*4);
+ setAcceptRichText(false);
new CssHighlighter(document());
}
diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h
index 7665f1a..335a0d6 100644
--- a/tools/qdoc3/config.h
+++ b/tools/qdoc3/config.h
@@ -143,9 +143,7 @@ class Config
#define CONFIG_MACRO "macro"
#define CONFIG_NATURALLANGUAGE "naturallanguage"
#define CONFIG_OBSOLETELINKS "obsoletelinks"
-#define CONFIG_ONLINE "online"
-#define CONFIG_OFFLINE "offline"
-#define CONFIG_CREATOR "creator"
+#define CONFIG_APPLICATION "application"
#define CONFIG_OUTPUTDIR "outputdir"
#define CONFIG_OUTPUTENCODING "outputencoding"
#define CONFIG_OUTPUTLANGUAGE "outputlanguage"
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index 4789c67..816ab9f 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -440,7 +440,6 @@ void DitaXmlGenerator::initializeGenerator(const Config &config)
DITAXMLGENERATOR_GENERATEMACREFS);
project = config.getString(CONFIG_PROJECT);
- offlineDocs = !config.getBool(CONFIG_ONLINE);
projectDescription = config.getString(CONFIG_DESCRIPTION);
if (projectDescription.isEmpty() && !project.isEmpty())
projectDescription = project + " Reference Documentation";
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 723f516..b1a8336 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -219,9 +219,7 @@ HtmlGenerator::HtmlGenerator()
inTableHeader(false),
numTableRows(0),
threeColumnEnumValueTable(true),
- offlineDocs(false),
- onlineDocs(false),
- creatorDocs(true),
+ application(Online),
funcLeftParen("\\S(\\()"),
myTree(0),
slow(false),
@@ -290,11 +288,17 @@ void HtmlGenerator::initializeGenerator(const Config &config)
project = config.getString(CONFIG_PROJECT);
- onlineDocs = config.getBool(CONFIG_ONLINE);
-
- offlineDocs = config.getBool(CONFIG_OFFLINE);
-
- creatorDocs = config.getBool(CONFIG_CREATOR);
+ QString app = config.getString(CONFIG_APPLICATION);
+ if (app == "online")
+ application = Online;
+ else if (app == "creator")
+ application = Creator;
+ else if (app == "assistant")
+ application = Assistant;
+ else if (app == "base")
+ application = Assistant;
+ else
+ application = Online;
projectDescription = config.getString(CONFIG_DESCRIPTION);
if (projectDescription.isEmpty() && !project.isEmpty())
@@ -1811,9 +1815,8 @@ void HtmlGenerator::generateHeader(const QString& title,
// Setting some additional style sheet related details depending on configuration (e.g. online/offline)
-
- if(onlineDocs==true) // onlineDocs is for the web
- {
+ switch (application) {
+ case Online:
// Browser spec styles
out() << " <!--[if IE]>\n";
out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
@@ -1832,22 +1835,19 @@ void HtmlGenerator::generateHeader(const QString& title,
out() << "</head>\n";
// CheckEmptyAndLoadList activating search
out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
- }
- else if (offlineDocs == true) // offlineDocs is for ???
- {
+ break;
+ case Assistant:
out() << "</head>\n";
- out() << "<body class=\"offline \">\n"; // offline
- }
- else if (creatorDocs == true) // creatorDocs is for Assistant/Creator
- {
+ out() << "<body class=\"offline \">\n";
+ break;
+ case Creator:
out() << "</head>\n";
out() << "<body class=\"offline narrow creator\">\n"; // offline narrow
- }
- // default -- not used except if one forgets to set any of the above settings to true
- else
- {
+ break;
+ default:
out() << "</head>\n";
- out() << "<body>\n";
+ out() << "<body>\n";
+ break;
}
#ifdef GENERATE_MAC_REFS
@@ -1855,31 +1855,27 @@ void HtmlGenerator::generateHeader(const QString& title,
generateMacRef(node, marker);
#endif
-
- if(onlineDocs==true) // onlineDocs is for the web
- {
+ switch (application) {
+ case Online:
out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version());
generateBreadCrumbs(title,node,marker);
out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
- }
- else if (offlineDocs == true) // offlineDocs is for ???
- {
+ break;
+ case Assistant:
out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
generateBreadCrumbs(title,node,marker);
- out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
- }
- else if (creatorDocs == true) // creatorDocs is for Assistant/Creator
- {
+ out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
+ break;
+ case Creator:
out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
generateBreadCrumbs(title,node,marker);
out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
- }
- // default -- not used except if one forgets to set any of the above settings to true
- else
- {
+ break;
+ default: // default -- not used except if one forgets to set any of the above settings to true
out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
generateBreadCrumbs(title,node,marker);
- out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
+ out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
+ break;
}
#if 0 // Removed for new doc format. MWS
@@ -1914,34 +1910,33 @@ void HtmlGenerator::generateFooter(const Node *node)
out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version())
<< QString(address).replace("\\" + COMMAND_VERSION, myTree->version());
-
- if (onlineDocs == true)
- {
- out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
- out() << " <!-- <script type=\"text/javascript\">\n";
- out() << " var _gaq = _gaq || [];\n";
- out() << " _gaq.push(['_setAccount', 'UA-4457116-5']);\n";
- out() << " _gaq.push(['_trackPageview']);\n";
- out() << " (function() {\n";
- out() << " var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n";
- out() << " ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n";
- out() << " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n";
- out() << " })();\n";
- out() << " </script> -->\n";
- out() << "</body>\n";
- }
- else if (offlineDocs == true)
- {
- out() << "</body>\n";
- }
- else if (creatorDocs == true)
- {
- out() << "</body>\n";
- }
- else
- {
- out() << "</body>\n";
- }
+
+ switch (application) {
+ case Online:
+ out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+ out() << " <!-- <script type=\"text/javascript\">\n";
+ out() << " var _gaq = _gaq || [];\n";
+ out() << " _gaq.push(['_setAccount', 'UA-4457116-5']);\n";
+ out() << " _gaq.push(['_trackPageview']);\n";
+ out() << " (function() {\n";
+ out() << " var ga = document.createElement('script'); ";
+ out() << "ga.type = 'text/javascript'; ga.async = true;\n";
+ out() << " ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + ";
+ out() << "'.google-analytics.com/ga.js';\n";
+ out() << " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n";
+ out() << " })();\n";
+ out() << " </script> -->\n";
+ out() << "</body>\n";
+ break;
+ case Assistant:
+ out() << "</body>\n";
+ break;
+ case Creator:
+ out() << "</body>\n";
+ break;
+ default:
+ out() << "</body>\n";
+ }
out() << "</html>\n";
}
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index d92c349..ec79896 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -95,6 +95,11 @@ class HtmlGenerator : public PageGenerator
LastSinceType
};
+ enum Application {
+ Online,
+ Assistant,
+ Creator};
+
public:
HtmlGenerator();
~HtmlGenerator();
@@ -294,9 +299,7 @@ class HtmlGenerator : public PageGenerator
bool inTableHeader;
int numTableRows;
bool threeColumnEnumValueTable;
- bool onlineDocs;
- bool offlineDocs;
- bool creatorDocs;
+ Application application;
QString link;
QStringList sectionNumber;
QRegExp funcLeftParen;
diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp
index 47a4b67..38b76a4 100644
--- a/tools/qdoc3/main.cpp
+++ b/tools/qdoc3/main.cpp
@@ -105,8 +105,7 @@ static bool showInternal = false;
static bool obsoleteLinks = false;
static QStringList defines;
static QHash<QString, Tree *> trees;
-static QString application = "base"; //application
-static bool applicationArg = 0; //if 1, then the argument is provided and it will override the qdocconf file
+static QString appArg; // application
/*!
Find the Tree for language \a lang and return a pointer to it.
@@ -194,36 +193,25 @@ static void processQdocconfFile(const QString &fileName)
config.load(fileName);
/*
- Set the application to which qdoc will create the output.
- The three applications are:
- base: simple, basic html output. Best suited for offline viewing
- creator: additional formatting.
- online: full-featured online version with search and links to Qt topics
-
- Note: This will override the offline, online, creator defines.
+ Set the application to which qdoc will create the output.
+ The three applications are:
+
+ base or assistant: simple, basic html output
+ for offline viewing in the Assistant application.
+
+ creator: additional formatting for viewing in
+ the Creator application.
+
+ online: full-featured online version with search and
+ links to Qt topics
*/
- if(applicationArg == false){
-
- QString appConfig = config.getString(CONFIG_APPLICATION);
- if (!appConfig.isEmpty()){
- application = appConfig;
- }
- }
- if(application == "online"){
- config.setStringList(CONFIG_ONLINE, QStringList("true"));
- config.setStringList(CONFIG_OFFLINE, QStringList("false"));
- config.setStringList(CONFIG_CREATOR, QStringList("false"));
- }
- else if(application == "creator"){
- config.setStringList(CONFIG_ONLINE, QStringList("false"));
- config.setStringList(CONFIG_OFFLINE, QStringList("true"));
- config.setStringList(CONFIG_CREATOR, QStringList("false"));
- }
- else if(application == "base"){
- config.setStringList(CONFIG_ONLINE, QStringList("false"));
- config.setStringList(CONFIG_OFFLINE, QStringList("false"));
- config.setStringList(CONFIG_CREATOR, QStringList("true"));
+ if (appArg.isEmpty()) {
+ qDebug() << "Warning: Application flag not specified on"
+ << "command line. Options are -assistant, -creator,"
+ << "and -online (default).";
+ appArg = "online";
}
+ config.setStringList(CONFIG_APPLICATION, QStringList(appArg));
/*
Add the defines to the configuration variables.
@@ -496,18 +484,14 @@ int main(int argc, char **argv)
else if (opt == "-obsoletelinks") {
obsoleteLinks = true;
}
- else if (opt == "-base") {
- application = "base";
- applicationArg = true;
- }
- else if (opt == "-creator") {
- application = "creator";
- applicationArg = true;
- }
- else if (opt == "-online") {
- application = "online";
- applicationArg = true;
- }
+ else if (opt == "-base")
+ appArg = "base";
+ else if (opt == "-assistant")
+ appArg = "assistant";
+ else if (opt == "-creator")
+ appArg = "creator";
+ else if (opt == "-online")
+ appArg = "online";
else {
qdocFiles.append(opt);
}
@@ -522,7 +506,7 @@ int main(int argc, char **argv)
Main loop.
*/
foreach (QString qf, qdocFiles) {
- qDebug() << "PROCESSING:" << qf;
+ //qDebug() << "PROCESSING:" << qf;
processQdocconfFile(qf);
}
diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf
index 119a676..8cf5722 100644
--- a/tools/qdoc3/test/assistant.qdocconf
+++ b/tools/qdoc3/test/assistant.qdocconf
@@ -7,9 +7,6 @@ include(qt-defines.qdocconf)
project = Qt Assistant
description = Qt Assistant Manual
url = http://qt.nokia.com/doc/4.7
-online = false
-offline = false
-creator = true
indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index
diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf
index 0595417..b1f37dc 100644
--- a/tools/qdoc3/test/designer.qdocconf
+++ b/tools/qdoc3/test/designer.qdocconf
@@ -7,9 +7,6 @@ include(qt-defines.qdocconf)
project = Qt Designer
description = Qt Designer Manual
url = http://qt.nokia.com/doc/4.7
-online = false
-offline = false
-creator = true
indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index
diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf
index 7dd57fb..26fb55c 100644
--- a/tools/qdoc3/test/linguist.qdocconf
+++ b/tools/qdoc3/test/linguist.qdocconf
@@ -7,9 +7,6 @@ include(qt-defines.qdocconf)
project = Qt Linguist
description = Qt Linguist Manual
url = http://qt.nokia.com/doc/4.7
-online = false
-offline = false
-creator = true
indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index
diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf
index 7628519..80bca29 100644
--- a/tools/qdoc3/test/qdeclarative.qdocconf
+++ b/tools/qdoc3/test/qdeclarative.qdocconf
@@ -8,9 +8,6 @@ project = Qml
description = Qml Reference Documentation
url = http://qt.nokia.com/doc/4.7/
qmlonly = true
-online = false
-offline = false
-creator = true
edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \
QtXmlPatterns QtTest
diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf
index c666288..f069129 100644
--- a/tools/qdoc3/test/qmake.qdocconf
+++ b/tools/qdoc3/test/qmake.qdocconf
@@ -7,9 +7,6 @@ include(qt-defines.qdocconf)
project = QMake
description = QMake Manual
url = http://qt.nokia.com/doc/4.7
-online = false
-offline = false
-creator = true
indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index
diff --git a/tools/qdoc3/test/qt-api-only.qdocconf b/tools/qdoc3/test/qt-api-only.qdocconf
index 7387810..cdd7a7c 100644
--- a/tools/qdoc3/test/qt-api-only.qdocconf
+++ b/tools/qdoc3/test/qt-api-only.qdocconf
@@ -5,9 +5,6 @@ include(qt-build-docs.qdocconf)
# qmake.qdocconf).
url = ./
-online = false
-offline = false
-creator = true
# Ensures that the documentation for the tools is not included in the generated
# .qhp file.
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index 415457e..bb47b57 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -7,9 +7,6 @@ include(qt-defines.qdocconf)
project = Qt
description = Qt Reference Documentation
url = http://qt.nokia.com/doc/4.7
-online = false
-offline = false
-creator = true
sourceencoding = UTF-8
outputencoding = UTF-8
diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index a5e6578..f78bd38 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -9,9 +9,6 @@ versionsym =
version = %VERSION%
description = Qt Reference Documentation
url = http://qt.nokia.com/doc/4.7
-online = true
-offline = false
-creator = false
sourceencoding = UTF-8
outputencoding = UTF-8