diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-06-11 12:06:41 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2010-06-11 12:06:41 (GMT) |
commit | d92d1106e8cb2ca14b26b8c027d52608ee2915e9 (patch) | |
tree | 91b75077ecf9fb4709f000b89d5963ab98cdfc9b /tools | |
parent | a295a69e76ff330a2716c97b70723f0bd408f197 (diff) | |
parent | 24bcac9de46c89f4d8b533946e7b0feeacca1b0d (diff) | |
download | Qt-d92d1106e8cb2ca14b26b8c027d52608ee2915e9.zip Qt-d92d1106e8cb2ca14b26b8c027d52608ee2915e9.tar.gz Qt-d92d1106e8cb2ca14b26b8c027d52608ee2915e9.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'tools')
56 files changed, 1750 insertions, 361 deletions
diff --git a/tools/activeqt/testcon/testcon.pro b/tools/activeqt/testcon/testcon.pro index dc98218..89f8067 100644 --- a/tools/activeqt/testcon/testcon.pro +++ b/tools/activeqt/testcon/testcon.pro @@ -16,6 +16,6 @@ RC_FILE = testcon.rc win32-borland { QMAKE_POST_LINK = -midl $$QT_SOURCE_TREE/tools/activeqt/testcon/testcon.idl } else { - !win32-g++:QMAKE_POST_LINK = midl $$QT_SOURCE_TREE/tools/activeqt/testcon/testcon.idl && move testcon.tlb $(TARGETDIR) + !win32-g++*:QMAKE_POST_LINK = midl $$QT_SOURCE_TREE/tools/activeqt/testcon/testcon.idl && move testcon.tlb $(TARGETDIR) } diff --git a/tools/assistant/lib/fulltextsearch/fulltextsearch.pro b/tools/assistant/lib/fulltextsearch/fulltextsearch.pro index fb1a0dd..4d2fddb 100644 --- a/tools/assistant/lib/fulltextsearch/fulltextsearch.pro +++ b/tools/assistant/lib/fulltextsearch/fulltextsearch.pro @@ -29,7 +29,7 @@ unix:QMAKE_PKGCONFIG_REQUIRES = QtCore CONFIG(exceptions_off) { CONFIG -= exceptions_off CONFIG += exceptions - !win32|win32-g++ { + !win32|win32-g++* { QMAKE_CFLAGS -= -fno-exceptions QMAKE_CXXFLAGS -= -fno-exceptions QMAKE_LFLAGS -= -fno-exceptions diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro index d926a76..64a6d9a 100644 --- a/tools/configure/configure.pro +++ b/tools/configure/configure.pro @@ -8,7 +8,7 @@ DEFINES += QT_BOOTSTRAPPED win32 : LIBS += -lole32 -ladvapi32 win32-msvc.net | win32-msvc2* : QMAKE_CXXFLAGS += /EHsc -win32-g++ : LIBS += -luuid +win32-g++* : LIBS += -luuid win32-msvc* { QMAKE_CFLAGS_RELEASE -= -MD diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index a5f9f2c..2e2d8ba 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1035,6 +1035,8 @@ void Configure::parseCmdLine() qmakeLibs += QString("-l" + configCmdLine.at(i)); } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS=")) { opensslLibs = configCmdLine.at(i); + } else if (configCmdLine.at(i).startsWith("PSQL_LIBS=")) { + psqlLibs = configCmdLine.at(i); } else if( ( configCmdLine.at(i) == "-override-version" ) || ( configCmdLine.at(i) == "-version-override" ) ){ @@ -2747,6 +2749,8 @@ void Configure::generateOutputVars() else qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32"); } + if (!psqlLibs.isEmpty()) + qmakeVars += QString("QT_LFLAGS_PSQL=") + psqlLibs.section("=", 1); if (!qmakeSql.isEmpty()) qmakeVars += QString("sql-drivers += ") + qmakeSql.join( " " ); if (!qmakeSqlPlugins.isEmpty()) diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 6c10dd8..ff2ee8b 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -133,6 +133,7 @@ private: QStringList qmakeIncludes; QStringList qmakeLibs; QString opensslLibs; + QString psqlLibs; QMap<QString,QString> licenseInfo; QString outputLine; diff --git a/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp index a25bd5d..5547761 100644 --- a/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp +++ b/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp @@ -63,6 +63,7 @@ #include <QtGui/QAction> #include <QtGui/QButtonGroup> #include <QtGui/QMenu> +#include <QtGui/QSortFilterProxyModel> #include <QtGui/QStandardItemModel> #include <QtGui/QComboBox> #include <QtGui/QApplication> @@ -712,9 +713,12 @@ SignalSlotEditorWindow::SignalSlotEditorWindow(QDesignerFormEditorInterface *cor m_remove_button(new QToolButton), m_core(core), m_model(new ConnectionModel(this)), + m_proxy_model(new QSortFilterProxyModel(this)), m_handling_selection_change(false) { - m_view->setModel(m_model); + m_proxy_model->setSourceModel(m_model); + m_view->setModel(m_proxy_model); + m_view->setSortingEnabled(true); m_view->setItemDelegate(new ConnectionDelegate(this)); m_view->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed); @@ -790,7 +794,7 @@ void SignalSlotEditorWindow::updateDialogSelection(Connection *con) if (m_handling_selection_change || m_editor == 0) return; - QModelIndex index = m_model->connectionToIndex(con); + QModelIndex index = m_proxy_model->mapFromSource(m_model->connectionToIndex(con)); if (index == m_view->currentIndex()) return; m_handling_selection_change = true; @@ -808,7 +812,7 @@ void SignalSlotEditorWindow::updateEditorSelection(const QModelIndex &index) if (m_editor == 0) return; - Connection *con = m_model->indexToConnection(index); + Connection *con = m_model->indexToConnection(m_proxy_model->mapToSource(index)); if (m_editor->selected(con)) return; m_handling_selection_change = true; diff --git a/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.h b/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.h index 9315955..665f0b7 100644 --- a/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.h +++ b/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.h @@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE class QDesignerFormWindowInterface; class QDesignerFormEditorInterface; class QModelIndex; +class QSortFilterProxyModel; class QTreeView; class QToolButton; @@ -84,6 +85,7 @@ private: QToolButton *m_add_button, *m_remove_button; QDesignerFormEditorInterface *m_core; ConnectionModel *m_model; + QSortFilterProxyModel *m_proxy_model; bool m_handling_selection_change; }; diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp index 543c405..094406c 100644 --- a/tools/linguist/lconvert/main.cpp +++ b/tools/linguist/lconvert/main.cpp @@ -240,7 +240,7 @@ int main(int argc, char *argv[]) tr.setLanguageCode(Translator::guessLanguageCodeFromFileName(inFiles[0].name)); if (!tr.load(inFiles[0].name, cd, inFiles[0].format)) { - qWarning() << qPrintable(cd.error()); + std::cerr << qPrintable(cd.error()); return 2; } tr.reportDuplicates(tr.resolveDuplicates(), inFiles[0].name, verbose); @@ -248,7 +248,7 @@ int main(int argc, char *argv[]) for (int i = 1; i < inFiles.size(); ++i) { Translator tr2; if (!tr2.load(inFiles[i].name, cd, inFiles[i].format)) { - qWarning() << qPrintable(cd.error()); + std::cerr << qPrintable(cd.error()); return 2; } tr2.reportDuplicates(tr2.resolveDuplicates(), inFiles[i].name, verbose); @@ -273,11 +273,11 @@ int main(int argc, char *argv[]) tr.normalizeTranslations(cd); if (!cd.errors().isEmpty()) { - qWarning("%s", qPrintable(cd.error())); + std::cerr << qPrintable(cd.error()); cd.clearErrors(); } if (!tr.save(outFileName, cd, outFormat)) { - qWarning("%s", qPrintable(cd.error())); + std::cerr << qPrintable(cd.error()); return 3; } return 0; diff --git a/tools/linguist/lrelease/main.cpp b/tools/linguist/lrelease/main.cpp index 266474e..b5cff90 100644 --- a/tools/linguist/lrelease/main.cpp +++ b/tools/linguist/lrelease/main.cpp @@ -55,6 +55,8 @@ #include <QtCore/QStringList> #include <QtCore/QTextStream> +#include <iostream> + QT_USE_NAMESPACE #ifdef QT_BOOTSTRAPPED @@ -106,7 +108,7 @@ static bool loadTsFile(Translator &tor, const QString &tsFileName, bool /* verbo ConversionData cd; bool ok = tor.load(tsFileName, cd, QLatin1String("auto")); if (!ok) { - qWarning("lrelease error: %s\n", qPrintable(cd.error())); + std::cerr << "lrelease error: " << qPrintable(cd.error()); } else { if (!cd.errors().isEmpty()) printOut(cd.error()); @@ -130,8 +132,8 @@ static bool releaseTranslator(Translator &tor, const QString &qmFileName, QFile file(qmFileName); if (!file.open(QIODevice::WriteOnly)) { - qWarning("lrelease error: cannot create '%s': %s\n", - qPrintable(qmFileName), qPrintable(file.errorString())); + std::cerr << "lrelease error: cannot create '" << qPrintable(qmFileName) + << "': " << qPrintable(file.errorString()) << std::endl; return false; } @@ -140,8 +142,8 @@ static bool releaseTranslator(Translator &tor, const QString &qmFileName, file.close(); if (!ok) { - qWarning("lrelease error: cannot save '%s': %s\n", - qPrintable(qmFileName), qPrintable(cd.error())); + std::cerr << "lrelease error: cannot save '" << qPrintable(qmFileName) + << "': " << qPrintable(cd.error()); } else if (!cd.errors().isEmpty()) { printOut(cd.error()); } @@ -253,19 +255,20 @@ int main(int argc, char **argv) visitor.setVerbose(cd.isVerbose()); if (!visitor.queryProFile(&pro)) { - qWarning("lrelease error: cannot read project file '%s'.", qPrintable(inputFile)); + std::cerr << "lrelease error: cannot read project file '" + << qPrintable(inputFile) << "'.\n"; continue; } if (!visitor.accept(&pro)) { - qWarning("lrelease error: cannot process project file '%s'.", qPrintable(inputFile)); + std::cerr << "lrelease error: cannot process project file '" + << qPrintable(inputFile) << "'.\n"; continue; } QStringList translations = visitor.values(QLatin1String("TRANSLATIONS")); if (translations.isEmpty()) { - qWarning("lrelease warning: Met no 'TRANSLATIONS' entry in" - " project file '%s'\n", - qPrintable(inputFile)); + std::cerr << "lrelease warning: Met no 'TRANSLATIONS' entry in project file '" + << qPrintable(inputFile) << "'\n"; } else { QDir proDir(fi.absolutePath()); foreach (const QString &trans, translations) diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp index db4bbca..b3e7e84 100644 --- a/tools/linguist/lupdate/cpp.cpp +++ b/tools/linguist/lupdate/cpp.cpp @@ -51,6 +51,8 @@ #include <QtCore/QTextCodec> #include <QtCore/QTextStream> +#include <iostream> + #include <ctype.h> // for isXXX() QT_BEGIN_NAMESPACE @@ -226,6 +228,8 @@ private: int elseLine; }; + std::ostream &yyMsg(int line = 0); + uint getChar(); uint getToken(); bool getMacroArgs(); @@ -352,6 +356,12 @@ CppParser::CppParser(ParseResults *_results) inDefine = false; } + +std::ostream &CppParser::yyMsg(int line) +{ + return std::cerr << qPrintable(yyFileName) << ':' << (line ? line : yyLineNo) << ": "; +} + void CppParser::setInput(const QString &in) { yyInStr = in; @@ -613,9 +623,9 @@ uint CppParser::getToken() if (yyBracketDepth != is.bracketDepth1st || yyBraceDepth != is.braceDepth1st || yyParenDepth != is.parenDepth1st) - qWarning("%s:%d: Parenthesis/bracket/brace mismatch between " - "#if and #else branches; using #if branch\n", - qPrintable(yyFileName), is.elseLine); + yyMsg(is.elseLine) + << "Parenthesis/bracket/brace mismatch between " + "#if and #else branches; using #if branch\n"; } else { is.bracketDepth1st = yyBracketDepth; is.braceDepth1st = yyBraceDepth; @@ -636,9 +646,9 @@ uint CppParser::getToken() if (yyBracketDepth != is.bracketDepth1st || yyBraceDepth != is.braceDepth1st || yyParenDepth != is.parenDepth1st) - qWarning("%s:%d: Parenthesis/brace mismatch between " - "#if and #else branches; using #if branch\n", - qPrintable(yyFileName), is.elseLine); + yyMsg(is.elseLine) + << "Parenthesis/brace mismatch between " + "#if and #else branches; using #if branch\n"; yyBracketDepth = is.bracketDepth1st; yyBraceDepth = is.braceDepth1st; yyParenDepth = is.parenDepth1st; @@ -664,8 +674,7 @@ uint CppParser::getToken() forever { yyCh = getChar(); if (yyCh == EOF) { - qWarning("%s:%d: Unterminated C++ comment\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "Unterminated C++ comment\n"; break; } @@ -795,8 +804,7 @@ uint CppParser::getToken() forever { yyCh = getChar(); if (yyCh == EOF) { - qWarning("%s:%d: Unterminated C++ comment\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "Unterminated C++ comment\n"; break; } *ptr++ = yyCh; @@ -829,8 +837,7 @@ uint CppParser::getToken() yyWord.resize(ptr - (ushort *)yyWord.unicode()); if (yyCh != '"') - qWarning("%s:%d: Unterminated C++ string\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "Unterminated C++ string\n"; else yyCh = getChar(); return Tok_String; @@ -867,8 +874,7 @@ uint CppParser::getToken() forever { if (yyCh == EOF || yyCh == '\n') { - qWarning("%s:%d: Unterminated C++ character\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "Unterminated C++ character\n"; break; } yyCh = getChar(); @@ -887,9 +893,9 @@ uint CppParser::getToken() case '}': if (yyBraceDepth == yyMinBraceDepth) { if (!inDefine) - qWarning("%s:%d: Excess closing brace in C++ code" - " (or abuse of the C++ preprocessor)\n", - qPrintable(yyFileName), yyCurLineNo); + yyMsg(yyCurLineNo) + << "Excess closing brace in C++ code" + " (or abuse of the C++ preprocessor)\n"; // Avoid things getting messed up even more yyCh = getChar(); return Tok_Semicolon; @@ -905,9 +911,9 @@ uint CppParser::getToken() return Tok_LeftParen; case ')': if (yyParenDepth == 0) - qWarning("%s:%d: Excess closing parenthesis in C++ code" - " (or abuse of the C++ preprocessor)\n", - qPrintable(yyFileName), yyCurLineNo); + yyMsg(yyCurLineNo) + << "Excess closing parenthesis in C++ code" + " (or abuse of the C++ preprocessor)\n"; else yyParenDepth--; yyCh = getChar(); @@ -920,9 +926,9 @@ uint CppParser::getToken() return Tok_LeftBracket; case ']': if (yyBracketDepth == 0) - qWarning("%s:%d: Excess closing bracket in C++ code" - " (or abuse of the C++ preprocessor)\n", - qPrintable(yyFileName), yyCurLineNo); + yyMsg(yyCurLineNo) + << "Excess closing bracket in C++ code" + " (or abuse of the C++ preprocessor)\n"; else yyBracketDepth--; yyCh = getChar(); @@ -1290,8 +1296,7 @@ void CppParser::processInclude(const QString &file, ConversionData &cd, QString cleanFile = QDir::cleanPath(file); if (inclusions.contains(cleanFile)) { - qWarning("%s:%d: circular inclusion of %s\n", - qPrintable(yyFileName), yyLineNo, qPrintable(cleanFile)); + yyMsg() << "circular inclusion of " << qPrintable(cleanFile) << std::endl; return; } @@ -1315,9 +1320,9 @@ void CppParser::processInclude(const QString &file, ConversionData &cd, QFile f(cleanFile); if (!f.open(QIODevice::ReadOnly)) { - qWarning("%s:%d: Cannot open %s: %s\n", - qPrintable(yyFileName), yyLineNo, - qPrintable(cleanFile), qPrintable(f.errorString())); + yyMsg() + << "Cannot open " << qPrintable(cleanFile) << ": " + << qPrintable(f.errorString()) << std::endl; return; } @@ -1656,8 +1661,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) // Forward-declared class definitions can be namespaced. NamespaceList nsl; if (!fullyQualify(namespaces, quali, true, &nsl, 0)) { - qWarning("%s:%d: Ignoring definition of undeclared qualified class\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "Ignoring definition of undeclared qualified class\n"; break; } namespaceDepths.push(namespaces.count()); @@ -1757,8 +1761,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) if (!tor) goto case_default; if (!sourcetext.isEmpty()) - qWarning("%s:%d: //%% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "//%% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n"; utf8 = (yyTok == Tok_trUtf8); line = yyLineNo; yyTok = getToken(); @@ -1779,10 +1782,9 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) QStringList unresolved; if (!fullyQualify(namespaces, pendingContext, true, &functionContext, &unresolved)) { functionContextUnresolved = unresolved.join(strColons); - qWarning("%s:%d: Qualifying with unknown namespace/class %s::%s\n", - qPrintable(yyFileName), yyLineNo, - qPrintable(stringifyNamespace(functionContext)), - qPrintable(unresolved.first())); + yyMsg() << "Qualifying with unknown namespace/class " + << qPrintable(stringifyNamespace(functionContext)) << "::" + << qPrintable(unresolved.first()) << std::endl; } pendingContext.clear(); } @@ -1790,8 +1792,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) if (functionContextUnresolved.isEmpty()) { int idx = functionContext.length(); if (idx < 2) { - qWarning("%s:%d: tr() cannot be called without context\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "tr() cannot be called without context\n"; break; } Namespace *fctx; @@ -1800,9 +1801,8 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) context = stringifyNamespace(functionContext); fctx = findNamespace(functionContext)->classDef; if (!fctx->complained) { - qWarning("%s:%d: Class '%s' lacks Q_OBJECT macro\n", - qPrintable(yyFileName), yyLineNo, - qPrintable(context)); + yyMsg() << "Class '" << qPrintable(context) + << "' lacks Q_OBJECT macro\n"; fctx->complained = true; } goto gotctx; @@ -1830,9 +1830,8 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) int last = prefix.lastIndexOf(strColons); QString className = prefix.mid(last == -1 ? 0 : last + 2); if (!className.isEmpty() && className == functionName) { - qWarning("%s::%d: It is not recommended to call tr() from within a constructor '%s::%s' ", - qPrintable(yyFileName), yyLineNo, - className.constData(), functionName.constData()); + yyMsg() << "It is not recommended to call tr() from within a constructor '" + << qPrintable(className) << "::" << qPrintable(functionName) << "'\n"; } #endif prefix.chop(2); @@ -1847,9 +1846,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) context = fctx->trQualification; } if (!fctx->hasTrFunctions && !fctx->complained) { - qWarning("%s:%d: Class '%s' lacks Q_OBJECT macro\n", - qPrintable(yyFileName), yyLineNo, - qPrintable(context)); + yyMsg() << "Class '" << qPrintable(context) << "' lacks Q_OBJECT macro\n"; fctx->complained = true; } } else { @@ -1870,8 +1867,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) if (!tor) goto case_default; if (!sourcetext.isEmpty()) - qWarning("%s:%d: //%% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "//%% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n"; utf8 = (yyTok == Tok_translateUtf8); line = yyLineNo; yyTok = getToken(); @@ -1925,8 +1921,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) if (!tor) goto case_default; if (!msgid.isEmpty()) - qWarning("%s:%d: //= cannot be used with qtTrId() / QT_TRID_NOOP(). Ignoring\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "//= cannot be used with qtTrId() / QT_TRID_NOOP(). Ignoring\n"; //utf8 = false; // Maybe use //%% or something like that line = yyLineNo; yyTok = getToken(); @@ -1993,15 +1988,13 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) if (isspace(c)) continue; if (c != '"') { - qWarning("%s:%d: Unexpected character in meta string\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "Unexpected character in meta string\n"; break; } forever { if (p >= yyWord.length()) { whoops: - qWarning("%s:%d: Unterminated meta string\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "Unterminated meta string\n"; break; } c = yyWord.unicode()[p++].unicode(); @@ -2054,8 +2047,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) case Tok_Arrow: yyTok = getToken(); if (yyTok == Tok_tr || yyTok == Tok_trUtf8) - qWarning("%s:%d: Cannot invoke tr() like this\n", - qPrintable(yyFileName), yyLineNo); + yyMsg() << "Cannot invoke tr() like this\n"; break; case Tok_ColonColon: if (yyBraceDepth == namespaceDepths.count() && yyParenDepth == 0 && !yyTokColonSeen) @@ -2123,17 +2115,17 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) } if (yyBraceDepth != 0) - qWarning("%s:%d: Unbalanced opening brace in C++ code" - " (or abuse of the C++ preprocessor)\n", - qPrintable(yyFileName), yyBraceLineNo); + yyMsg(yyBraceLineNo) + << "Unbalanced opening brace in C++ code" + " (or abuse of the C++ preprocessor)\n"; else if (yyParenDepth != 0) - qWarning("%s:%d: Unbalanced opening parenthesis in C++ code" - " (or abuse of the C++ preprocessor)\n", - qPrintable(yyFileName), yyParenLineNo); + yyMsg(yyParenLineNo) + << "Unbalanced opening parenthesis in C++ code" + " (or abuse of the C++ preprocessor)\n"; else if (yyBracketDepth != 0) - qWarning("%s:%d: Unbalanced opening bracket in C++ code" - " (or abuse of the C++ preprocessor)\n", - qPrintable(yyFileName), yyBracketLineNo); + yyMsg(yyBracketLineNo) + << "Unbalanced opening bracket in C++ code" + " (or abuse of the C++ preprocessor)\n"; } const ParseResults *CppParser::recordResults(bool isHeader) diff --git a/tools/linguist/lupdate/java.cpp b/tools/linguist/lupdate/java.cpp index 27988b04..dc66e2b 100644 --- a/tools/linguist/lupdate/java.cpp +++ b/tools/linguist/lupdate/java.cpp @@ -51,6 +51,8 @@ #include <QtCore/QString> #include <QtCore/QTextCodec> +#include <iostream> + #include <ctype.h> QT_BEGIN_NAMESPACE @@ -107,6 +109,11 @@ static QString yyPackage; static QStack<Scope*> yyScope; static QString yyDefaultContext; +std::ostream &yyMsg(int line = 0) +{ + return std::cerr << qPrintable(yyFileName) << ':' << (line ? line : yyLineNo) << ": "; +} + static QChar getChar() { if (yyInPos >= yyInStr.size()) @@ -189,10 +196,7 @@ static int getToken() while ( !metAsterSlash ) { yyCh = getChar(); if ( yyCh == EOF ) { - qFatal( "%s: Unterminated Java comment starting at" - " line %d\n", - qPrintable(yyFileName), yyLineNo ); - + yyMsg() << "Unterminated Java comment.\n"; return Tok_Comment; } @@ -228,8 +232,8 @@ static int getToken() else { int sub(yyCh.toLower().toAscii() - 87); if( sub > 15 || sub < 10) { - qFatal( "%s:%d: Invalid Unicode", - qPrintable(yyFileName), yyLineNo ); + yyMsg() << "Invalid Unicode value.\n"; + break; } unicode += sub; } @@ -251,8 +255,7 @@ static int getToken() } if ( yyCh != QLatin1Char('"') ) - qFatal( "%s:%d: Unterminated string", - qPrintable(yyFileName), yyLineNo ); + yyMsg() << "Unterminated string.\n"; yyCh = getChar(); @@ -365,9 +368,8 @@ static bool matchString( QString &s ) if (yyTok == Tok_String) s += yyString; else { - qWarning( "%s:%d: String used in translation can only contain strings" - " concatenated with other strings, not expressions or numbers.", - qPrintable(yyFileName), yyLineNo ); + yyMsg() << "String used in translation can contain only literals" + " concatenated with other literals, not expressions or numbers.\n"; return false; } yyTok = getToken(); @@ -475,8 +477,8 @@ static void parse( Translator *tor ) yyScope.push(new Scope(yyIdent, Scope::Clazz, yyLineNo)); } else { - qFatal( "%s:%d: Class must be followed by a classname", - qPrintable(yyFileName), yyLineNo ); + yyMsg() << "'class' must be followed by a class name.\n"; + break; } while (!match(Tok_LeftBrace)) { yyTok = getToken(); @@ -547,8 +549,7 @@ static void parse( Translator *tor ) case Tok_RightBrace: if ( yyScope.isEmpty() ) { - qFatal( "%s:%d: Unbalanced right brace in Java code\n", - qPrintable(yyFileName), yyLineNo ); + yyMsg() << "Excess closing brace.\n"; } else delete (yyScope.pop()); @@ -577,8 +578,7 @@ static void parse( Translator *tor ) yyPackage.append(QLatin1String(".")); break; default: - qFatal( "%s:%d: Package keyword should be followed by com.package.name;", - qPrintable(yyFileName), yyLineNo ); + yyMsg() << "'package' must be followed by package name.\n"; break; } yyTok = getToken(); @@ -591,11 +591,9 @@ static void parse( Translator *tor ) } if ( !yyScope.isEmpty() ) - qFatal( "%s:%d: Unbalanced braces in Java code\n", - qPrintable(yyFileName), yyScope.top()->line ); + yyMsg(yyScope.top()->line) << "Unbalanced opening brace.\n"; else if ( yyParenDepth != 0 ) - qFatal( "%s:%d: Unbalanced parentheses in Java code\n", - qPrintable(yyFileName), yyParenLineNo ); + yyMsg(yyParenLineNo) << "Unbalanced opening parenthesis.\n"; } diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index 6c9157a..a575192 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -57,16 +57,15 @@ static QString m_defaultExtensions; -static void printErr(const QString & out) -{ - qWarning("%s", qPrintable(out)); -} - static void printOut(const QString & out) { std::cerr << qPrintable(out); } +class LU { + Q_DECLARE_TR_FUNCTIONS(LUpdate) +}; + static void recursiveFileInfoList(const QDir &dir, const QSet<QString> &nameFilters, QDir::Filters filter, QFileInfoList *fileinfolist) @@ -150,24 +149,25 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil cd.m_sortContexts = !(options & NoSort); if (QFile(fileName).exists()) { if (!tor.load(fileName, cd, QLatin1String("auto"))) { - printErr(cd.error()); + printOut(cd.error()); *fail = true; continue; } tor.resolveDuplicates(); cd.clearErrors(); if (setCodec && fetchedTor.codec() != tor.codec()) - qWarning("lupdate warning: Codec for tr() '%s' disagrees with " - "existing file's codec '%s'. Expect trouble.", - fetchedTor.codecName().constData(), tor.codecName().constData()); + printOut(LU::tr("lupdate warning: Codec for tr() '%1' disagrees with" + " existing file's codec '%2'. Expect trouble.\n") + .arg(QString::fromLatin1(fetchedTor.codecName()), + QString::fromLatin1(tor.codecName()))); if (!targetLanguage.isEmpty() && targetLanguage != tor.languageCode()) - qWarning("lupdate warning: Specified target language '%s' disagrees with " - "existing file's language '%s'. Ignoring.", - qPrintable(targetLanguage), qPrintable(tor.languageCode())); + printOut(LU::tr("lupdate warning: Specified target language '%1' disagrees with" + " existing file's language '%2'. Ignoring.\n") + .arg(targetLanguage, tor.languageCode())); if (!sourceLanguage.isEmpty() && sourceLanguage != tor.sourceLanguageCode()) - qWarning("lupdate warning: Specified source language '%s' disagrees with " - "existing file's language '%s'. Ignoring.", - qPrintable(sourceLanguage), qPrintable(tor.sourceLanguageCode())); + printOut(LU::tr("lupdate warning: Specified source language '%1' disagrees with" + " existing file's language '%2'. Ignoring.\n") + .arg(sourceLanguage, tor.sourceLanguageCode())); } else { if (setCodec) tor.setCodec(fetchedTor.codec()); @@ -210,11 +210,11 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil out.normalizeTranslations(cd); if (!cd.errors().isEmpty()) { - printErr(cd.error()); + printOut(cd.error()); cd.clearErrors(); } if (!out.save(fileName, cd, QLatin1String("auto"))) { - printErr(cd.error()); + printOut(cd.error()); *fail = true; } } @@ -296,8 +296,9 @@ static void processProject( if (!tmp.isEmpty()) { codecForSource = tmp.last().toLatin1(); if (!QTextCodec::codecForName(codecForSource)) { - qWarning("lupdate warning: Codec for source '%s' is invalid. " - "Falling back to codec for tr().", codecForSource.constData()); + printOut(LU::tr("lupdate warning: Codec for source '%1' is invalid." + " Falling back to codec for tr().\n") + .arg(QString::fromLatin1(codecForSource))); codecForSource.clear(); } } @@ -452,7 +453,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-target-language")) { ++i; if (i == argc) { - qWarning("The option -target-language requires a parameter."); + printOut(LU::tr("The option -target-language requires a parameter.\n")); return 1; } targetLanguage = args[i]; @@ -460,7 +461,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-source-language")) { ++i; if (i == argc) { - qWarning("The option -source-language requires a parameter."); + printOut(LU::tr("The option -source-language requires a parameter.\n")); return 1; } sourceLanguage = args[i]; @@ -468,7 +469,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-disable-heuristic")) { ++i; if (i == argc) { - qWarning("The option -disable-heuristic requires a parameter."); + printOut(LU::tr("The option -disable-heuristic requires a parameter.\n")); return 1; } arg = args[i]; @@ -479,14 +480,14 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("number")) { options &= ~HeuristicNumber; } else { - qWarning("Invalid heuristic name passed to -disable-heuristic."); + printOut(LU::tr("Invalid heuristic name passed to -disable-heuristic.\n")); return 1; } continue; } else if (arg == QLatin1String("-locations")) { ++i; if (i == argc) { - qWarning("The option -locations requires a parameter."); + printOut(LU::tr("The option -locations requires a parameter.\n")); return 1; } if (args[i] == QLatin1String("none")) { @@ -496,7 +497,7 @@ int main(int argc, char **argv) } else if (args[i] == QLatin1String("absolute")) { options |= AbsoluteLocations; } else { - qWarning("Invalid parameter passed to -locations."); + printOut(LU::tr("Invalid parameter passed to -locations.\n")); return 1; } continue; @@ -522,7 +523,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-codecfortr")) { ++i; if (i == argc) { - qWarning("The -codecfortr option should be followed by a codec name."); + printOut(LU::tr("The -codecfortr option should be followed by a codec name.\n")); return 1; } codecForTr = args[i].toLatin1(); @@ -533,7 +534,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-extensions")) { ++i; if (i == argc) { - qWarning("The -extensions option should be followed by an extension list."); + printOut(LU::tr("The -extensions option should be followed by an extension list.\n")); return 1; } extensions = args[i]; @@ -541,7 +542,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-pro")) { ++i; if (i == argc) { - qWarning("The -pro option should be followed by a filename of .pro file."); + printOut(LU::tr("The -pro option should be followed by a filename of .pro file.\n")); return 1; } proFiles += args[i]; @@ -551,7 +552,7 @@ int main(int argc, char **argv) if (arg.length() == 2) { ++i; if (i == argc) { - qWarning("The -I option should be followed by a path."); + printOut(LU::tr("The -I option should be followed by a path.\n")); return 1; } includePath += args[i]; @@ -560,7 +561,7 @@ int main(int argc, char **argv) } continue; } else if (arg.startsWith(QLatin1String("-")) && arg != QLatin1String("-")) { - qWarning("Unrecognized option '%s'", qPrintable(arg)); + printOut(LU::tr("Unrecognized option '%1'.\n").arg(arg)); return 1; } @@ -568,8 +569,8 @@ int main(int argc, char **argv) if (arg.startsWith(QLatin1String("@"))) { QFile lstFile(arg.mid(1)); if (!lstFile.open(QIODevice::ReadOnly)) { - qWarning("lupdate error: List file '%s' is not readable", - qPrintable(lstFile.fileName())); + printOut(LU::tr("lupdate error: List file '%1' is not readable.\n") + .arg(lstFile.fileName())); return 1; } while (!lstFile.atEnd()) @@ -586,16 +587,16 @@ int main(int argc, char **argv) if (!fi.exists() || fi.isWritable()) { tsFileNames.append(QFileInfo(file).absoluteFilePath()); } else { - qWarning("lupdate warning: For some reason, '%s' is not writable.\n", - qPrintable(file)); + printOut(LU::tr("lupdate warning: For some reason, '%1' is not writable.\n") + .arg(file)); } found = true; break; } } if (!found) { - qWarning("lupdate error: File '%s' has no recognized extension\n", - qPrintable(file)); + printOut(LU::tr("lupdate error: File '%1' has no recognized extension.\n") + .arg(file)); return 1; } } @@ -604,7 +605,7 @@ int main(int argc, char **argv) foreach (const QString &file, files) { QFileInfo fi(file); if (!fi.exists()) { - qWarning("lupdate error: File '%s' does not exists\n", qPrintable(file)); + printOut(LU::tr("lupdate error: File '%1' does not exist.\n").arg(file)); return 1; } if (file.endsWith(QLatin1String(".pro"), Qt::CaseInsensitive) @@ -612,7 +613,7 @@ int main(int argc, char **argv) proFiles << file; } else if (fi.isDir()) { if (options & Verbose) - printOut(QObject::tr("Scanning directory '%1'...").arg(file)); + printOut(QObject::tr("Scanning directory '%1'...\n").arg(file)); QDir dir = QDir(fi.filePath()); projectRoots.insert(dir.absolutePath() + QLatin1Char('/')); if (extensionsNameFilters.isEmpty()) { @@ -650,6 +651,7 @@ int main(int argc, char **argv) } } else { sourceFiles << QDir::cleanPath(fi.absoluteFilePath());; + projectRoots.insert(fi.absolutePath() + QLatin1Char('/')); } } numFiles++; @@ -662,16 +664,16 @@ int main(int argc, char **argv) } if (!targetLanguage.isEmpty() && tsFileNames.count() != 1) - std::cerr << "lupdate warning: -target-language usually only " - "makes sense with exactly one TS file.\n"; + printOut(LU::tr("lupdate warning: -target-language usually only" + " makes sense with exactly one TS file.\n")); if (!codecForTr.isEmpty() && tsFileNames.isEmpty()) - std::cerr << "lupdate warning: -codecfortr has no effect without -ts.\n"; + printOut(LU::tr("lupdate warning: -codecfortr has no effect without -ts.\n")); bool fail = false; if (proFiles.isEmpty()) { if (tsFileNames.isEmpty()) - std::cerr << "lupdate warning: no TS files specified. " - "Only diagnostics will be produced.\n"; + printOut(LU::tr("lupdate warning:" + " no TS files specified. Only diagnostics will be produced.\n")); Translator fetchedTor; ConversionData cd; @@ -685,7 +687,8 @@ int main(int argc, char **argv) sourceLanguage, targetLanguage, options, &fail); } else { if (!sourceFiles.isEmpty() || !includePath.isEmpty()) { - qWarning("lupdate error: Both project and source files / include paths specified.\n"); + printOut(LU::tr("lupdate error:" + " Both project and source files / include paths specified.\n")); return 1; } if (!tsFileNames.isEmpty()) { diff --git a/tools/linguist/lupdate/qscript.cpp b/tools/linguist/lupdate/qscript.cpp index 33276e6..188ac36 100644 --- a/tools/linguist/lupdate/qscript.cpp +++ b/tools/linguist/lupdate/qscript.cpp @@ -53,6 +53,8 @@ #include <QtCore/qtextcodec.h> #include <QtCore/qvariant.h> +#include <iostream> + #include <ctype.h> #include <stdlib.h> #include <stdio.h> @@ -2214,13 +2216,13 @@ case 66: { if ((name == QLatin1String("qsTranslate")) || (name == QLatin1String("QT_TRANSLATE_NOOP"))) { QVariantList args = sym(2).toList(); if (args.size() < 2) { - qWarning("%s:%d: %s() requires at least two arguments", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "() requires at least two arguments.\n"; } else { if ((args.at(0).type() != QVariant::String) || (args.at(1).type() != QVariant::String)) { - qWarning("%s:%d: %s(): both arguments must be literal strings", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "(): both arguments must be literal strings.\n"; } else { QString context = args.at(0).toString(); QString text = args.at(1).toString(); @@ -2234,12 +2236,12 @@ case 66: { } else if ((name == QLatin1String("qsTr")) || (name == QLatin1String("QT_TR_NOOP"))) { QVariantList args = sym(2).toList(); if (args.size() < 1) { - qWarning("%s:%d: %s() requires at least one argument", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "() requires at least one argument.\n"; } else { if (args.at(0).type() != QVariant::String) { - qWarning("%s:%d: %s(): text to translate must be a literal string", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "(): text to translate must be a literal string.\n"; } else { QString context = QFileInfo(fileName).baseName(); QString text = args.at(0).toString(); @@ -2377,8 +2379,8 @@ bool loadQScript(Translator &translator, const QString &filename, ConversionData lexer.setCode(code, /*lineNumber=*/1); QScriptParser parser; if (!parser.parse(&lexer, filename, &translator)) { - qWarning("%s:%d: %s", qPrintable(filename), parser.errorLineNumber(), - qPrintable(parser.errorMessage())); + std::cerr << qPrintable(filename) << ':' << parser.errorLineNumber() << ": " + << qPrintable(parser.errorMessage()) << std::endl; return false; } diff --git a/tools/linguist/lupdate/qscript.g b/tools/linguist/lupdate/qscript.g index a473500..857c58a 100644 --- a/tools/linguist/lupdate/qscript.g +++ b/tools/linguist/lupdate/qscript.g @@ -90,6 +90,8 @@ #include <QtCore/qtextcodec.h> #include <QtCore/qvariant.h> +#include <iostream> + #include <ctype.h> #include <stdlib.h> #include <stdio.h> @@ -106,7 +108,7 @@ static void recordMessage( fileName, lineNo, QStringList(), TranslatorMessage::Unfinished, plural); msg.setExtraComment(extracomment.simplified()); - tor->replace(msg); + tor->extend(msg); } @@ -1630,13 +1632,13 @@ case $rule_number: { if ((name == QLatin1String("qsTranslate")) || (name == QLatin1String("QT_TRANSLATE_NOOP"))) { QVariantList args = sym(2).toList(); if (args.size() < 2) { - qWarning("%s:%d: %s() requires at least two arguments", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "() requires at least two arguments.\n"; } else { if ((args.at(0).type() != QVariant::String) || (args.at(1).type() != QVariant::String)) { - qWarning("%s:%d: %s(): both arguments must be literal strings", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "(): both arguments must be literal strings.\n"; } else { QString context = args.at(0).toString(); QString text = args.at(1).toString(); @@ -1650,12 +1652,12 @@ case $rule_number: { } else if ((name == QLatin1String("qsTr")) || (name == QLatin1String("QT_TR_NOOP"))) { QVariantList args = sym(2).toList(); if (args.size() < 1) { - qWarning("%s:%d: %s() requires at least one argument", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "() requires at least one argument.\n"; } else { if (args.at(0).type() != QVariant::String) { - qWarning("%s:%d: %s(): text to translate must be a literal string", - qPrintable(fileName), identLineNo, qPrintable(name)); + std::cerr << qPrintable(fileName) << ':' << identLineNo << ": " + << qPrintable(name) << "(): text to translate must be a literal string.\n"; } else { QString context = QFileInfo(fileName).baseName(); QString text = args.at(0).toString(); @@ -2009,8 +2011,8 @@ bool loadQScript(Translator &translator, const QString &filename, ConversionData lexer.setCode(code, /*lineNumber=*/1); QScriptParser parser; if (!parser.parse(&lexer, filename, &translator)) { - qWarning("%s:%d: %s", qPrintable(filename), parser.errorLineNumber(), - qPrintable(parser.errorMessage())); + std::cerr << qPrintable(filename) << ':' << parser.errorLineNumber() << ": " + << qPrintable(parser.errorMessage()) << std::endl; return false; } diff --git a/tools/linguist/phrasebooks/hungarian.qph b/tools/linguist/phrasebooks/hungarian.qph new file mode 100644 index 0000000..0e1dd12 --- /dev/null +++ b/tools/linguist/phrasebooks/hungarian.qph @@ -0,0 +1,752 @@ +<!DOCTYPE QPH> +<QPH language="hu_HU"> +<phrase> + <source>OK</source> + <target>OK</target> +</phrase> +<phrase> + <source>Bookmarks</source> + <target>Könyvjelzők</target> +</phrase> +<phrase> + <source>Remove</source> + <target>Törlés</target> +</phrase> +<phrase> + <source>New Folder</source> + <target>Új könyvtár</target> +</phrase> +<phrase> + <source>Add</source> + <target>Hozzáadás</target> +</phrase> +<phrase> + <source>Previous</source> + <target>Előző</target> +</phrase> +<phrase> + <source>Font</source> + <target>Betűtípus</target> +</phrase> +<phrase> + <source>Help</source> + <target>Segítség</target> +</phrase> +<phrase> + <source>Done</source> + <target>Kész</target> +</phrase> +<phrase> + <source>Install</source> + <target>Telepítés</target> +</phrase> +<phrase> + <source>Cancel</source> + <target>Mégsem</target> +</phrase> +<phrase> + <source>Installation Path:</source> + <target>Telepítési útvonal:</target> +</phrase> +<phrase> + <source>Index</source> + <target>Index</target> +</phrase> +<phrase> + <source>Contents</source> + <target>Tartalom</target> +</phrase> +<phrase> + <source>Search</source> + <target>Keresés</target> +</phrase> +<phrase> + <source>Print Preview...</source> + <target>Nyomtatási kép...</target> +</phrase> +<phrase> + <source>About...</source> + <target>Névjegy...</target> +</phrase> +<phrase> + <source>Toolbars</source> + <target>Eszköztárak</target> +</phrase> +<phrase> + <source>Address:</source> + <target>Cím:</target> +</phrase> +<phrase> + <source>Open Source Edition</source> + <target>Nyíltforrású kiadás</target> +</phrase> +<phrase> + <source>Yes</source> + <target>Igen</target> +</phrase> +<phrase> + <source>No</source> + <target>Nem</target> +</phrase> +<phrase> + <source>Apply</source> + <target>Alkalmaz</target> +</phrase> +<phrase> + <source>Ignore</source> + <target>Kihagyás</target> +</phrase> +<phrase> + <source>Abort</source> + <target>Megszakítás</target> +</phrase> +<phrase> + <source>Play</source> + <target>Lejátszás</target> +</phrase> +<phrase> + <source>Pause</source> + <target>Szünet</target> +</phrase> +<phrase> + <source>File</source> + <target>Fájl</target> + <definition>menu</definition> +</phrase> +<phrase> + <source>file</source> + <target>fájl</target> +</phrase> +<phrase> + <source>directory</source> + <target>könyvtár</target> +</phrase> +<phrase> + <source>Symlink</source> + <target>Szimbolikus link</target> +</phrase> +<phrase> + <source>Delete</source> + <target>Törlés</target> +</phrase> +<phrase> + <source>Rename</source> + <target>Átnevezés</target> +</phrase> +<phrase> + <source>Back</source> + <target>Vissza</target> +</phrase> +<phrase> + <source>Forward</source> + <target>Előre</target> +</phrase> +<phrase> + <source>Finish</source> + <target>Befejezés</target> +</phrase> +<phrase> + <source>Quit</source> + <target>Kilépés</target> +</phrase> +<phrase> + <source>Exit</source> + <target>Kilépés</target> +</phrase> +<phrase> + <source>Close</source> + <target>Bezárás</target> +</phrase> +<phrase> + <source>Close All</source> + <target>Mindent bezár</target> +</phrase> +<phrase> + <source>Error</source> + <target>Hiba</target> +</phrase> +<phrase> + <source>Warning</source> + <target>Figyelmeztetés</target> +</phrase> +<phrase> + <source>Information</source> + <target>Információ</target> +</phrase> +<phrase> + <source>Question</source> + <target>Kérdés</target> +</phrase> +<phrase> + <source>document</source> + <target>dokumentum</target> +</phrase> +<phrase> + <source>author</source> + <target>szerző</target> +</phrase> +<phrase> + <source>subsidiary(-ies)</source> + <target>leányvállalata(i)</target> +</phrase> +<phrase> + <source>Help</source> + <target>Súgó</target> +</phrase> +<phrase> + <source>Undo</source> + <target>Visszavonás</target> +</phrase> +<phrase> + <source>Redo</source> + <target>Újra</target> +</phrase> +<phrase> + <source>Open</source> + <target>Megnyitás</target> +</phrase> +<phrase> + <source>Save</source> + <target>Mentés</target> +</phrase> +<phrase> + <source>Save all</source> + <target>Mindet menti</target> +</phrase> +<phrase> + <source>click</source> + <target>kattintás</target> + <definition>noun</definition> +</phrase> +<phrase> + <source>click</source> + <target>kattintson</target> + <definition>ask</definition> +</phrase> +<phrase> + <source>Recent</source> + <target>Előző</target> + <definition>Recent files/Előző fájlok</definition> +</phrase> +<phrase> + <source>Window</source> + <target>Ablak</target> +</phrase> +<phrase> + <source>Cascade</source> + <target>Lépcsőzetes</target> +</phrase> +<phrase> + <source>Tile</source> + <target>Mozaikszerű</target> +</phrase> +<phrase> + <source>Game</source> + <target>Játék</target> +</phrase> +<phrase> + <source>New Game</source> + <target>Új játék</target> +</phrase> +<phrase> + <source>Untitled</source> + <target>Névtelen</target> +</phrase> +<phrase> + <source>Unknown error</source> + <target>Ismeretlen hiba</target> +</phrase> +<phrase> + <source>New Folder</source> + <target>Új mappa</target> +</phrase> +<phrase> + <source>folder</source> + <target>mappa</target> +</phrase> +<phrase> + <source>New Directory</source> + <target>Új könyvtár</target> +</phrase> +<phrase> + <source>unknown</source> + <target>ismeretlen</target> +</phrase> +<phrase> + <source>Copy</source> + <target>Másolás</target> +</phrase> +<phrase> + <source>Cut</source> + <target>Kivágás</target> +</phrase> +<phrase> + <source>Paste</source> + <target>Beillesztés</target> +</phrase> +<phrase> + <source>Paste special</source> + <target>Speciális beillesztés</target> +</phrase> +<phrase> + <source>Insert</source> + <target>Beszúrás</target> +</phrase> +<phrase> + <source>Copy here</source> + <target>Másolás ide</target> +</phrase> +<phrase> + <source>Minimize</source> + <target>Minimalizálás</target> +</phrase> +<phrase> + <source>Zoom</source> + <target>Nagyítás</target> +</phrase> +<phrase> + <source>&Edit</source> + <target>S&zerkesztés</target> +</phrase> +<phrase> + <source>&View</source> + <target>&Nézet</target> +</phrase> +<phrase> + <source>Application</source> + <target>Alkalmazás</target> +</phrase> +<phrase> + <source>Documentation</source> + <target>Dokumentáció</target> +</phrase> +<phrase> + <source>Network</source> + <target>Hálózat</target> +</phrase> +<phrase> + <source>Current Page</source> + <target>Aktuális oldal</target> +</phrase> +<phrase> + <source>Find</source> + <target>Keresés</target> +</phrase> +<phrase> + <source>Locale</source> + <target>Nyelv</target> +</phrase> +<phrase> + <source>Cannot open '%1'.</source> + <target>'%1' nem nyitható meg.</target> +</phrase> +<phrase> + <source>Cannot find the string '%1'.</source> + <target>A szöveg nem található: '%1'.</target> +</phrase> +<phrase> + <source>A file called '%1' already exists. Please choose another name.</source> + <target>'%1' nevű fájl már létezik. Válasszon egy másik nevet.</target> +</phrase> +<phrase> + <source>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</source> + <target>Ez a program abban a reményben került közreadásra, hogy hasznos lesz, de minden egyéb GARANCIA NÉLKÜL, az ELADHATÓSÁGRA vagy VALAMELY CÉLRA VALÓ ALKALMAZHATÓSÁGRA való származtatott garanciát is beleértve.</target> + <definition>License text in most Qt programs</definition> +</phrase> +<phrase> + <source>Open Link</source> + <target>Link megnyitása</target> +</phrase> +<phrase> + <source>Next</source> + <target>Következő</target> +</phrase> +<phrase> + <source>Case Sensitive</source> + <target>Kis/nagybetű érzékeny</target> +</phrase> +<phrase> + <source>Whole words</source> + <target>Teljes szó</target> +</phrase> +<phrase> + <source>Open Link in New Tab</source> + <target>Link megnyitása új lapon</target> +</phrase> +<phrase> + <source>Download canceled.</source> + <target>Letöltés megszakítva.</target> +</phrase> +<phrase> + <source>The file %1 already exists. Do you want to overwrite it?</source> + <target>A(z) '%1' nevű fájl már létezik. Felülírja?</target> +</phrase> +<phrase> + <source>Qt Assistant</source> + <target>Qt Asszisztens</target> +</phrase> +<phrase> + <source>Preferences...</source> + <target>Beállítások...</target> +</phrase> +<phrase> + <source>&File</source> + <target>&Fájl</target> +</phrase> +<phrase> + <source>Browser</source> + <target>Böngésző</target> +</phrase> +<phrase> + <source>Filters</source> + <target>Szűrők</target> +</phrase> +<phrase> + <source>Delete Folder</source> + <target>Mappa törlése</target> +</phrase> +<phrase> + <source>Rename Folder</source> + <target>Mappa átnevezése</target> +</phrase> +<phrase> + <source>You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://www.trolltech.com/company/model.html">www.trolltech.com/company/model.html</a> for an overview of Qt licensing.</source> + <target>Amennyiben zárt forrású alkalmazás fejlesztéséhez kívánja a Qt-t felhasználni, szüksége lesz a Qt kereskedelmi verziójára. Kérem tekintse meg az <tt>http://www.trolltech.com/company/model.html</tt> oldalt a Qt licenszelésének áttekintéséhez.</target> +</phrase> +<phrase> + <source>New Tab</source> + <target>Új fül</target> +</phrase> +<phrase> + <source>Close Tab</source> + <target>Fül bezárása</target> +</phrase> +<phrase> + <source>Close Other Tabs</source> + <target>A többi fül bezárása</target> +</phrase> +<phrase> + <source>True</source> + <target>Igaz</target> +</phrase> +<phrase> + <source>False</source> + <target>Hamis</target> +</phrase> +<phrase> + <source>Update</source> + <target>Frissítés</target> +</phrase> +<phrase> + <source>Normal</source> + <target>Normál</target> +</phrase> +<phrase> + <source>Bold</source> + <target>Félkövér</target> +</phrase> +<phrase> + <source>Italic</source> + <target>Dőlt</target> +</phrase> +<phrase> + <source>Greek</source> + <target>Görög</target> +</phrase> +<phrase> + <source>Cyrillic</source> + <target>Cirill</target> +</phrase> +<phrase> + <source>Armenian</source> + <target>Örmény</target> +</phrase> +<phrase> + <source>Hebrew</source> + <target>Héber</target> +</phrase> +<phrase> + <source>Arabic</source> + <target>Arab</target> +</phrase> +<phrase> + <source>Syriac</source> + <target>Szír</target> +</phrase> +<phrase> + <source>Permission denied</source> + <target>Hozzáférés megtagadva</target> +</phrase> +<phrase> + <source>Too many open files</source> + <target>Túl sok fájl van nyitva</target> +</phrase> +<phrase> + <source>No such file or directory</source> + <target>Nincs ilyen fájl vagy könyvtár</target> +</phrase> +<phrase> + <source>No space left on device</source> + <target>Nincs több hely az eszközön</target> +</phrase> +<phrase> + <source>Width:</source> + <target>Szélesség:</target> +</phrase> +<phrase> + <source>Height:</source> + <target>Magasság:</target> +</phrase> +<phrase> + <source>Margins</source> + <target>Margók</target> +</phrase> +<phrase> + <source>top margin</source> + <target>felső margó</target> +</phrase> +<phrase> + <source>left margin</source> + <target>bal margó</target> +</phrase> +<phrase> + <source>right margin</source> + <target>jobb margó</target> +</phrase> +<phrase> + <source>bottom margin</source> + <target>alsó margó</target> +</phrase> +<phrase> + <source>Next page</source> + <target>Következő oldal</target> +</phrase> +<phrase> + <source>Previous page</source> + <target>Előző oldal</target> +</phrase> +<phrase> + <source>First page</source> + <target>Első oldal</target> +</phrase> +<phrase> + <source>Last page</source> + <target>Utolsó oldal</target> +</phrase> +<phrase> + <source>Fit width</source> + <target>Szélesség igazítása</target> +</phrase> +<phrase> + <source>Fit page</source> + <target>Oldal igazítása</target> +</phrase> +<phrase> + <source>Zoom in</source> + <target>Nagyítás</target> +</phrase> +<phrase> + <source>Zoom out</source> + <target>Kicsinyítés</target> +</phrase> +<phrase> + <source>Portrait</source> + <target>Álló</target> +</phrase> +<phrase> + <source>Landscape</source> + <target>Fekvő</target> +</phrase> +<phrase> + <source>Print</source> + <target>Nyomtatás</target> +</phrase> +<phrase> + <source>Page setup</source> + <target>Oldalbeállítás</target> +</phrase> +<phrase> + <source>Color</source> + <target>Szín</target> +</phrase> +<phrase> + <source>Grayscale</source> + <target>Szürkeárnyalatos</target> +</phrase> +<phrase> + <source>None</source> + <target>Nincs</target> +</phrase> +<phrase> + <source>...</source> + <target>...</target> +</phrase> +<phrase> + <source>Menu</source> + <target>Menü</target> +</phrase> +<phrase> + <source>Keep</source> + <target>Meghagy</target> +</phrase> +<phrase> + <source>Pause</source> + <target>Megállít</target> +</phrase> +<phrase> + <source>Log</source> + <target>Napló</target> +</phrase> +<phrase> + <source>Mi&nimize</source> + <target>&Kis méret</target> +</phrase> +<phrase> + <source>Press</source> + <target>Nyomja meg</target> +</phrase> +<phrase> + <source>Submit</source> + <target>Küldés</target> +</phrase> +<phrase> + <source>Underline</source> + <target>Aláhúzott</target> +</phrase> +<phrase> + <source>Outline</source> + <target>Áthúzott</target> +</phrase> +<phrase> + <source>Direction</source> + <target>Irány</target> +</phrase> +<phrase> + <source>Configuration</source> + <target>Konfiguráció</target> +</phrase> +<phrase> + <source>None</source> + <target>Semmi</target> +</phrase> +<phrase> + <source>Save As...</source> + <target>Mentés másként...</target> +</phrase> +<phrase> + <source>Context</source> + <target>Környezet</target> +</phrase> +<phrase> + <source>Edit</source> + <target>Szerkesztés</target> +</phrase> +<phrase> + <source>Toolbar</source> + <target>Eszköztár</target> +</phrase> +<phrase> + <source>&Print...</source> + <target>&Nyomtatás...</target> +</phrase> +<phrase> + <source>E&xit</source> + <target>&Kilépés</target> +</phrase> +<phrase> + <source>Sidebar</source> + <target>Oldalsáv</target> +</phrase> +<phrase> + <source>Bookmark</source> + <target>Könyvjelző</target> +</phrase> +<phrase> + <source>Save As</source> + <target>Mentés másként</target> +</phrase> +<phrase> + <source>Select All</source> + <target>Összes kijelölése</target> +</phrase> +<phrase> + <source>Name</source> + <target>Név</target> +</phrase> +<phrase> + <source>Type</source> + <target>Típus</target> +</phrase> +<phrase> + <source>Date</source> + <target>Dátum</target> +</phrase> +<phrase> + <source>Name</source> + <target>Név</target> +</phrase> +<phrase> + <source>Unknown</source> + <target>Ismeretlen</target> +</phrase> +<phrase> + <source>Value</source> + <target>Érték</target> +</phrase> +<phrase> + <source>Default</source> + <target>Alapértelmezett</target> +</phrase> +<phrase> + <source>New</source> + <target>Új</target> +</phrase> +<phrase> + <source>Level</source> + <target>Szint</target> +</phrase> +<phrase> + <source>Location</source> + <target>Hely</target> +</phrase> +<phrase> + <source>Reload</source> + <target>Újratöltés</target> +</phrase> +<phrase> + <source>Pictures</source> + <target>Képek</target> +</phrase> +<phrase> + <source>Battery</source> + <target>Elem</target> +</phrase> +<phrase> + <source>No error</source> + <target>Nincs hiba</target> +</phrase> +<phrase> + <source>Whole words</source> + <target>Teljes szó</target> +</phrase> +<phrase> + <source>(Új bejegyzés)</source> + <target></target> +</phrase> +<phrase> + <source>Horizontal</source> + <target>Vízszintes</target> +</phrase> +<phrase> + <source>Enabled</source> + <target>Engedélyezve</target> +</phrase> +<phrase> + <source>Up</source> + <target>Fel</target> +</phrase> +<phrase> + <source>Down</source> + <target>Le</target> +</phrase> +</QPH> diff --git a/tools/linguist/shared/po.cpp b/tools/linguist/shared/po.cpp index 99a8751..a692332 100644 --- a/tools/linguist/shared/po.cpp +++ b/tools/linguist/shared/po.cpp @@ -353,6 +353,29 @@ static void slurpComment(QByteArray &msg, const QList<QByteArray> &lines, int & --l; } +static void splitContext(QByteArray *comment, QByteArray *context) +{ + char *data = comment->data(); + int len = comment->size(); + int sep = -1, j = 0; + + for (int i = 0; i < len; i++, j++) { + if (data[i] == '~' && i + 1 < len) + i++; + else if (data[i] == '|') + sep = j; + data[j] = data[i]; + } + if (sep >= 0) { + QByteArray tmp = comment->mid(sep + 1, j - sep - 1); + comment->truncate(sep); + *context = *comment; + *comment = tmp; + } else { + comment->truncate(j); + } +} + static QString makePoHeader(const QString &str) { return QLatin1String("po-header-") + str.toLower().replace(QLatin1Char('-'), QLatin1Char('_')); @@ -411,6 +434,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) lines.append(QByteArray()); int l = 0, lastCmtLine = -1; + bool qtContexts = false; PoItem item; for (; l != lines.size(); ++l) { QByteArray line = lines.at(l); @@ -437,7 +461,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) continue; int idx = hdr.indexOf(':'); if (idx < 0) { - cd.appendError(QString::fromLatin1("Unexpected PO header format '%1'\n") + cd.appendError(QString::fromLatin1("Unexpected PO header format '%1'") .arg(QString::fromLatin1(hdr))); error = true; break; @@ -449,6 +473,8 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) translator.setLanguageCode(QString::fromLatin1(hdrValue)); } else if (hdrName == "X-Source-Language") { translator.setSourceLanguageCode(QString::fromLatin1(hdrValue)); + } else if (hdrName == "X-Qt-Contexts") { + qtContexts = (hdrValue == "true"); } else if (hdrName == "Plural-Forms") { pluralForms = hdrValue; } else if (hdrName == "MIME-Version") { @@ -456,7 +482,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) } else if (hdrName == "Content-Type") { if (cd.m_codecForSource.isEmpty()) { if (!hdrValue.startsWith("text/plain; charset=")) { - cd.appendError(QString::fromLatin1("Unexpected Content-Type header '%1'\n") + cd.appendError(QString::fromLatin1("Unexpected Content-Type header '%1'") .arg(QString::fromLatin1(hdrValue))); error = true; // This will avoid a flood of conversion errors. @@ -465,7 +491,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) QByteArray cod = hdrValue.mid(20); QTextCodec *cdc = QTextCodec::codecForName(cod); if (!cdc) { - cd.appendError(QString::fromLatin1("Unsupported codec '%1'\n") + cd.appendError(QString::fromLatin1("Unsupported codec '%1'") .arg(QString::fromLatin1(cod))); error = true; // This will avoid a flood of conversion errors. @@ -477,7 +503,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) } } else if (hdrName == "Content-Transfer-Encoding") { if (hdrValue != "8bit") { - cd.appendError(QString::fromLatin1("Unexpected Content-Transfer-Encoding '%1'\n") + cd.appendError(QString::fromLatin1("Unexpected Content-Transfer-Encoding '%1'") .arg(QString::fromLatin1(hdrValue))); return false; } @@ -498,7 +524,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) // Keep in sync with savePO static const char * const dfltHdrs[] = { "MIME-Version", "Content-Type", "Content-Transfer-Encoding", - "Plural-Forms", "X-Language", "X-Source-Language" + "Plural-Forms", "X-Language", "X-Source-Language", "X-Qt-Contexts" }; uint cdh = 0; for (int cho = 0; cho < hdrOrder.length(); cho++) { @@ -596,7 +622,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) slurpComment(item.translatorComments, lines, l); break; case '.': - if (line.startsWith("#. ts-context ")) { + if (line.startsWith("#. ts-context ")) { // legacy item.context = line.mid(14); } else if (line.startsWith("#. ts-id ")) { item.id = line.mid(9); @@ -615,8 +641,10 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) codec->toUnicode(extra); } else if (line.startsWith("#| msgctxt ")) { item.oldTscomment = slurpEscapedString(lines, l, 11, "#| ", cd); + if (qtContexts) + splitContext(&item.oldTscomment, &item.context); } else { - cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'\n")) + cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'")) .arg(l + 1).arg(codec->toUnicode(lines[l]))); error = true; } @@ -633,13 +661,13 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) } else if (line.startsWith("#~ msgctxt ")) { item.tscomment = slurpEscapedString(lines, l, 11, "#~ ", cd); } else { - cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'\n")) + cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'")) .arg(l + 1).arg(codec->toUnicode(lines[l]))); error = true; } break; default: - cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'\n")) + cd.appendError(QString(QLatin1String("PO-format parse error in line %1: '%2'")) .arg(l + 1).arg(codec->toUnicode(lines[l]))); error = true; break; @@ -647,6 +675,8 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) lastCmtLine = l; } else if (line.startsWith("msgctxt ")) { item.tscomment = slurpEscapedString(lines, l, 8, QByteArray(), cd); + if (qtContexts) + splitContext(&item.tscomment, &item.context); } else if (line.startsWith("msgid ")) { item.msgId = slurpEscapedString(lines, l, 6, QByteArray(), cd); } else if (line.startsWith("msgid_plural ")) { @@ -655,7 +685,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) item.extra[QLatin1String("po-msgid_plural")] = codec->toUnicode(extra); item.isPlural = true; } else { - cd.appendError(QString(QLatin1String("PO-format error in line %1: '%2'\n")) + cd.appendError(QString(QLatin1String("PO-format error in line %1: '%2'")) .arg(l + 1).arg(codec->toUnicode(lines[l]))); error = true; } @@ -672,6 +702,16 @@ static void addPoHeader(Translator::ExtraData &headers, QStringList &hdrOrder, headers[makePoHeader(qName)] = value; } +static QString escapeComment(const QString &in, bool escape) +{ + QString out = in; + if (escape) { + out.replace(QLatin1Char('~'), QLatin1String("~~")); + out.replace(QLatin1Char('|'), QLatin1String("~|")); + } + return out; +} + bool savePO(const Translator &translator, QIODevice &dev, ConversionData &cd) { QString str_format = QLatin1String("-format"); @@ -680,6 +720,13 @@ bool savePO(const Translator &translator, QIODevice &dev, ConversionData &cd) QTextStream out(&dev); out.setCodec(cd.m_outputCodec.isEmpty() ? QByteArray("UTF-8") : cd.m_outputCodec); + bool qtContexts = false; + foreach (const TranslatorMessage &msg, translator.messages()) + if (!msg.context().isEmpty()) { + qtContexts = true; + break; + } + QString cmt = translator.extra(QLatin1String("po-header_comment")); if (!cmt.isEmpty()) out << cmt << '\n'; @@ -703,6 +750,8 @@ bool savePO(const Translator &translator, QIODevice &dev, ConversionData &cd) } if (!translator.sourceLanguageCode().isEmpty()) addPoHeader(headers, hdrOrder, "X-Source-Language", translator.sourceLanguageCode()); + if (qtContexts) + addPoHeader(headers, hdrOrder, "X-Qt-Contexts", QLatin1String("true")); QString hdrStr; foreach (const QString &hdr, hdrOrder) { hdrStr += hdr; @@ -721,8 +770,6 @@ bool savePO(const Translator &translator, QIODevice &dev, ConversionData &cd) if (!msg.extraComment().isEmpty()) out << poEscapedLines(QLatin1String("#."), true, msg.extraComment()); - if (!msg.context().isEmpty()) - out << QLatin1String("#. ts-context ") << msg.context() << '\n'; if (!msg.id().isEmpty()) out << QLatin1String("#. ts-id ") << msg.id() << '\n'; @@ -770,15 +817,21 @@ bool savePO(const Translator &translator, QIODevice &dev, ConversionData &cd) QString prefix = QLatin1String("#| "); if (!msg.oldComment().isEmpty()) - out << poEscapedString(prefix, QLatin1String("msgctxt"), noWrap, msg.oldComment()); + out << poEscapedString(prefix, QLatin1String("msgctxt"), noWrap, + escapeComment(msg.oldComment(), qtContexts)); if (!msg.oldSourceText().isEmpty()) out << poEscapedString(prefix, QLatin1String("msgid"), noWrap, msg.oldSourceText()); QString plural = msg.extra(QLatin1String("po-old_msgid_plural")); if (!plural.isEmpty()) out << poEscapedString(prefix, QLatin1String("msgid_plural"), noWrap, plural); prefix = QLatin1String((msg.type() == TranslatorMessage::Obsolete) ? "#~ " : ""); - if (!msg.comment().isEmpty()) - out << poEscapedString(prefix, QLatin1String("msgctxt"), noWrap, msg.comment()); + if (!msg.context().isEmpty()) + out << poEscapedString(prefix, QLatin1String("msgctxt"), noWrap, + escapeComment(msg.context(), true) + QLatin1Char('|') + + escapeComment(msg.comment(), true)); + else if (!msg.comment().isEmpty()) + out << poEscapedString(prefix, QLatin1String("msgctxt"), noWrap, + escapeComment(msg.comment(), qtContexts)); out << poEscapedString(prefix, QLatin1String("msgid"), noWrap, msg.sourceText()); if (!msg.isPlural()) { QString transl = msg.translation(); diff --git a/tools/linguist/shared/profileevaluator.cpp b/tools/linguist/shared/profileevaluator.cpp index 5e1ee1f..a21408c 100644 --- a/tools/linguist/shared/profileevaluator.cpp +++ b/tools/linguist/shared/profileevaluator.cpp @@ -2594,19 +2594,19 @@ void ProFileEvaluator::addProperties(const QHash<QString, QString> &properties) void ProFileEvaluator::logMessage(const QString &message) { if (d->m_verbose && !d->m_skipLevel) - qWarning("%s", qPrintable(message)); + fprintf(stderr, "%s\n", qPrintable(message)); } void ProFileEvaluator::fileMessage(const QString &message) { if (!d->m_skipLevel) - qWarning("%s", qPrintable(message)); + fprintf(stderr, "%s\n", qPrintable(message)); } void ProFileEvaluator::errorMessage(const QString &message) { if (!d->m_skipLevel) - qWarning("%s", qPrintable(message)); + fprintf(stderr, "%s\n", qPrintable(message)); } void ProFileEvaluator::setVerbose(bool on) diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp index e2c4f4a..6678943 100644 --- a/tools/linguist/shared/qm.cpp +++ b/tools/linguist/shared/qm.cpp @@ -773,11 +773,11 @@ static bool saveQM(const Translator &translator, QIODevice &dev, ConversionData if (saved && cd.isVerbose()) { int generatedCount = finished + unfinished; cd.appendError(QCoreApplication::translate("LRelease", - " Generated %n translation(s) (%1 finished and %2 unfinished)\n", 0, + " Generated %n translation(s) (%1 finished and %2 unfinished)", 0, QCoreApplication::CodecForTr, generatedCount).arg(finished).arg(unfinished)); if (untranslated) cd.appendError(QCoreApplication::translate("LRelease", - " Ignored %n untranslated source text(s)\n", 0, + " Ignored %n untranslated source text(s)", 0, QCoreApplication::CodecForTr, untranslated)); } return saved; diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp index c86a9dd..36af8da 100644 --- a/tools/linguist/shared/translator.cpp +++ b/tools/linguist/shared/translator.cpp @@ -43,6 +43,8 @@ #include "simtexth.h" +#include <iostream> + #include <stdio.h> #ifdef Q_OS_WIN // required for _setmode, to avoid _O_TEXT streams... @@ -586,22 +588,21 @@ void Translator::reportDuplicates(const Duplicates &dupes, const QString &fileName, bool verbose) { if (!dupes.byId.isEmpty() || !dupes.byContents.isEmpty()) { + std::cerr << "Warning: dropping duplicate messages in '" << qPrintable(fileName); if (!verbose) { - qWarning("Warning: dropping duplicate messages in '%s'\n(try -verbose for more info).", - qPrintable(fileName)); + std::cerr << "'\n(try -verbose for more info).\n"; } else { - qWarning("Warning: dropping duplicate messages in '%s':", qPrintable(fileName)); + std::cerr << "':\n"; foreach (int i, dupes.byId) - qWarning("\n* ID: %s", qPrintable(message(i).id())); + std::cerr << "\n* ID: " << qPrintable(message(i).id()) << std::endl; foreach (int j, dupes.byContents) { const TranslatorMessage &msg = message(j); - qWarning("\n* Context: %s\n* Source: %s", - qPrintable(msg.context()), - qPrintable(msg.sourceText())); + std::cerr << "\n* Context: " << qPrintable(msg.context()) + << "\n* Source: " << qPrintable(msg.sourceText()) << std::endl; if (!msg.comment().isEmpty()) - qWarning("* Comment: %s", qPrintable(msg.comment())); + std::cerr << "* Comment: " << qPrintable(msg.comment()) << std::endl; } - qWarning(); + std::cerr << std::endl; } } } @@ -688,7 +689,7 @@ void Translator::normalizeTranslations(ConversionData &cd) cd.appendError(QLatin1String( "Removed plural forms as the target language has less " "forms.\nIf this sounds wrong, possibly the target language is " - "not set or recognized.\n")); + "not set or recognized.")); } QString Translator::guessLanguageCodeFromFileName(const QString &filename) @@ -737,7 +738,7 @@ void Translator::setCodecName(const QByteArray &name) QTextCodec *codec = QTextCodec::codecForName(name); if (!codec) { if (!name.isEmpty()) - qWarning("No QTextCodec for %s available. Using Latin1\n", name.constData()); + std::cerr << "No QTextCodec for " << name.constData() << " available. Using Latin1.\n"; m_codec = QTextCodec::codecForName("ISO-8859-1"); } else { m_codec = codec; diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h index bb199f0..cfb2178 100644 --- a/tools/linguist/shared/translator.h +++ b/tools/linguist/shared/translator.h @@ -92,7 +92,7 @@ public: bool sortContexts() const { return m_sortContexts; } void appendError(const QString &error) { m_errors.append(error); } - QString error() const { return m_errors.join(QLatin1String("\n")); } + QString error() const { return m_errors.isEmpty() ? QString() : m_errors.join(QLatin1String("\n")) + QLatin1Char('\n'); } QStringList errors() const { return m_errors; } void clearErrors() { m_errors.clear(); } diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index bf80277..f6b8c06 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -519,14 +519,14 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE]; break; case Atom::Code: - out() << "<pre class=\"highlightedCode\">" + out() << "<pre class=\"highlightedCode brush: cpp\">" << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), marker,relative)) << "</pre>\n"; break; #ifdef QDOC_QML case Atom::Qml: - out() << "<pre class=\"highlightedCode\">" + out() << "<pre class=\"highlightedCode brush: cpp\">" << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), marker,relative)) << "</pre>\n"; @@ -534,7 +534,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, #endif case Atom::CodeNew: out() << "<p>you can rewrite it as</p>\n" - << "<pre class=\"highlightedCode\">" + << "<pre class=\"highlightedCode brush: cpp\">" << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), marker,relative)) << "</pre>\n"; @@ -543,7 +543,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << "<p>For example, if you have code like</p>\n"; // fallthrough case Atom::CodeBad: - out() << "<pre class=\"highlightedCode\">" + out() << "<pre class=\"highlightedCode brush: cpp\">" << trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string())))) << "</pre>\n"; break; @@ -1797,31 +1797,51 @@ void HtmlGenerator::generateHeader(const QString& title, out() << " <title>" << shortVersion << protectEnc(title) << "</title>\n"; - out() << " <!--[if IE]>"; - out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">"; - out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">"; - out() << "<![endif]-->"; - out() << "<!--[if lt IE 7]>"; - out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">"; - out() << "<![endif]-->"; - out() << "<!--[if IE 7]>"; - out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">"; - out() << "<![endif]-->"; - out() << "<!--[if IE 8]>"; - out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">"; - out() << "<![endif]-->"; - - //out() << " <title>Qt Reference Documentation</title>"; - out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />\n"; - out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n"; - out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n"; - out() << "</head>\n"; if (offlineDocs) - out() << "<body class=\"offline\" onload=\"CheckEmptyAndLoadList();\">\n"; + { + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/OfflineStyle.css\" />"; + out() << "</head>\n"; + out() << "<body class=\"offline narrow\" >\n"; // narrow mainly for Creator + } else - out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"; + { + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\"\n />"; + out() << " <!--[if IE]>\n"; + out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n"; + out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n"; + out() << "<![endif]-->\n"; + out() << "<!--[if lt IE 7]>\n"; + out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n"; + out() << "<![endif]-->\n"; + out() << "<!--[if IE 7]>\n"; + out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n"; + out() << "<![endif]-->\n"; + out() << "<!--[if IE 8]>\n"; + out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n"; + out() << "<![endif]-->\n"; + // jquery functions + out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n"; + out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n"; + // menus and small docs js and css + out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n"; + out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />"; + + // syntax highlighter js and css + // out() << " <link type=\"text/css\" rel=\"stylesheet\" href=\"style/shCore.css\"/>\n"; + // out() << " <link type=\"text/css\" rel=\"stylesheet\" href=\"style/shThemeDefault.css\"/>\n"; + // out() << " <script type=\"text/javascript\" src=\"scripts/shCore.js\"></script>\n"; + // out() << " <script type=\"text/javascript\" src=\"scripts/shBrushCpp.js\"></script>\n"; + // out() << " <script type=\"text/javascript\">\n"; + // out() << " SyntaxHighlighter.all();\n"; + // out() << " </script>\n"; + + out() << "</head>\n"; + out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"; + } #ifdef GENERATE_MAC_REFS if (mainPage) @@ -1863,8 +1883,16 @@ void HtmlGenerator::generateFooter(const Node *node) out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version()) << QString(address).replace("\\" + COMMAND_VERSION, myTree->version()); - out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n"; + + if (offlineDocs) + { out() << "</body>\n"; + } + else + { + out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n"; + out() << "</body>\n"; + } out() << "</html>\n"; } @@ -1886,7 +1914,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker, void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) { if (!inner->includes().isEmpty()) { - out() << "<pre class=\"highlightedCode\">" + out() << "<pre class=\"highlightedCode brush: cpp\">" << trimmedTrailing(highlightedCode(indent(codeIndent, marker->markedUpIncludes(inner->includes())), marker,inner)) @@ -2110,6 +2138,8 @@ void HtmlGenerator::generateNavigationBar(const NavigationBar& bar, out() << "</a>]\n"; #endif } + if (fake->name() != QString("index.html")) + { if (bar.current.begin() != 0) { out() << "[<a href=\"" << "home" << ".html\">Home</a>]\n"; @@ -2121,6 +2151,7 @@ void HtmlGenerator::generateNavigationBar(const NavigationBar& bar, out() << "</a>]\n"; } out() << "</p>\n"; + } } } #endif diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 4ba3a32..3c7e9dc 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -624,7 +624,7 @@ void InnerNode::removeChild(Node *child) QMap<QString, Node *>::Iterator prim = primaryFunctionMap.find(child->name()); NodeList& secs = secondaryFunctionMap[child->name()]; - if (*prim == child) { + if (prim != primaryFunctionMap.end() && *prim == child) { if (secs.isEmpty()) { primaryFunctionMap.remove(child->name()); } @@ -636,12 +636,12 @@ void InnerNode::removeChild(Node *child) secs.removeAll(child); } QMap<QString, Node *>::Iterator ent = childMap.find( child->name() ); - if ( *ent == child ) + if (ent != childMap.end() && *ent == child) childMap.erase( ent ); } else { QMap<QString, Node *>::Iterator ent = childMap.find(child->name()); - if (*ent == child) + if (ent != childMap.end() && *ent == child) childMap.erase(ent); } } diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 167bb19..4b52992 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -30,6 +30,7 @@ qhp.Assistant.extraFiles = images/bg_l.png \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/arrow-down.png \ images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ @@ -37,6 +38,7 @@ qhp.Assistant.extraFiles = images/bg_l.png \ images/dynamiclayouts-example.png \ scripts/functions.js \ scripts/jquery.js \ + style/OfflineStyle.css \ style/style_ie6.css \ style/style_ie7.css \ style/style_ie8.css \ diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index 48e3ea1..b1f37dc 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -30,6 +30,7 @@ qhp.Designer.extraFiles = images/bg_l.png \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/arrow-down.png \ images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ @@ -37,6 +38,7 @@ qhp.Designer.extraFiles = images/bg_l.png \ images/dynamiclayouts-example.png \ scripts/functions.js \ scripts/jquery.js \ + style/OfflineStyle.css \ style/style_ie6.css \ style/style_ie7.css \ style/style_ie8.css \ diff --git a/tools/qdoc3/test/images/bg_l.png b/tools/qdoc3/test/images/bg_l.png Binary files differnew file mode 100644 index 0000000..90b1da1 --- /dev/null +++ b/tools/qdoc3/test/images/bg_l.png diff --git a/tools/qdoc3/test/images/bg_l_blank.png b/tools/qdoc3/test/images/bg_l_blank.png Binary files differnew file mode 100644 index 0000000..5a9673d --- /dev/null +++ b/tools/qdoc3/test/images/bg_l_blank.png diff --git a/tools/qdoc3/test/images/bg_r.png b/tools/qdoc3/test/images/bg_r.png Binary files differnew file mode 100644 index 0000000..f0fb121 --- /dev/null +++ b/tools/qdoc3/test/images/bg_r.png diff --git a/tools/qdoc3/test/images/box_bg.png b/tools/qdoc3/test/images/box_bg.png Binary files differnew file mode 100644 index 0000000..3322f92 --- /dev/null +++ b/tools/qdoc3/test/images/box_bg.png diff --git a/tools/qdoc3/test/images/breadcrumb.png b/tools/qdoc3/test/images/breadcrumb.png Binary files differnew file mode 100644 index 0000000..0ded551 --- /dev/null +++ b/tools/qdoc3/test/images/breadcrumb.png diff --git a/tools/qdoc3/test/images/bullet_dn.png b/tools/qdoc3/test/images/bullet_dn.png Binary files differnew file mode 100644 index 0000000..f776247 --- /dev/null +++ b/tools/qdoc3/test/images/bullet_dn.png diff --git a/tools/qdoc3/test/images/bullet_gt.png b/tools/qdoc3/test/images/bullet_gt.png Binary files differnew file mode 100644 index 0000000..7561b4e --- /dev/null +++ b/tools/qdoc3/test/images/bullet_gt.png diff --git a/tools/qdoc3/test/images/bullet_sq.png b/tools/qdoc3/test/images/bullet_sq.png Binary files differnew file mode 100644 index 0000000..a84845e --- /dev/null +++ b/tools/qdoc3/test/images/bullet_sq.png diff --git a/tools/qdoc3/test/images/bullet_up.png b/tools/qdoc3/test/images/bullet_up.png Binary files differnew file mode 100644 index 0000000..285e741 --- /dev/null +++ b/tools/qdoc3/test/images/bullet_up.png diff --git a/tools/qdoc3/test/images/feedbackground.png b/tools/qdoc3/test/images/feedbackground.png Binary files differnew file mode 100644 index 0000000..3a38d99 --- /dev/null +++ b/tools/qdoc3/test/images/feedbackground.png diff --git a/tools/qdoc3/test/images/horBar.png b/tools/qdoc3/test/images/horBar.png Binary files differnew file mode 100644 index 0000000..100fe91 --- /dev/null +++ b/tools/qdoc3/test/images/horBar.png diff --git a/tools/qdoc3/test/images/page.png b/tools/qdoc3/test/images/page.png Binary files differnew file mode 100644 index 0000000..1db151b --- /dev/null +++ b/tools/qdoc3/test/images/page.png diff --git a/tools/qdoc3/test/images/page_bg.png b/tools/qdoc3/test/images/page_bg.png Binary files differnew file mode 100644 index 0000000..9b3bd99 --- /dev/null +++ b/tools/qdoc3/test/images/page_bg.png diff --git a/tools/qdoc3/test/images/sprites-combined.png b/tools/qdoc3/test/images/sprites-combined.png Binary files differnew file mode 100644 index 0000000..3a48b21 --- /dev/null +++ b/tools/qdoc3/test/images/sprites-combined.png diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index 8974bd7..26fb55c 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -30,13 +30,15 @@ qhp.Linguist.extraFiles = images/bg_l.png \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ - images/spinner.gif \ + images/arrow-down.png \ +s images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ images/coloreditorfactoryimage.png \ images/dynamiclayouts-example.png \ scripts/functions.js \ scripts/jquery.js \ + style/OfflineStyle.css \ style/style_ie6.css \ style/style_ie7.css \ style/style_ie8.css \ diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf index 0f2e381..74fd802 100644 --- a/tools/qdoc3/test/qdeclarative.qdocconf +++ b/tools/qdoc3/test/qdeclarative.qdocconf @@ -41,6 +41,7 @@ qhp.Qml.extraFiles = images/bg_l.png \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/arrow-down.png \ images/spinner.png \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ @@ -48,6 +49,7 @@ qhp.Qml.extraFiles = images/bg_l.png \ images/dynamiclayouts-example.png \ scripts/functions.js \ scripts/jquery.js \ + style/OfflineStyle.css \ style/style_ie6.css \ style/style_ie7.css \ style/style_ie8.css \ diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index ea58059..f069129 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -30,6 +30,7 @@ qhp.qmake.extraFiles = images/bg_l.png \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/arrow-down.png \ images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ @@ -37,6 +38,7 @@ qhp.qmake.extraFiles = images/bg_l.png \ images/dynamiclayouts-example.png \ scripts/functions.js \ scripts/jquery.js \ + style/OfflineStyle.css \ style/style_ie6.css \ style/style_ie7.css \ style/style_ie8.css \ diff --git a/tools/qdoc3/test/qt-api-only_ja_JP.qdocconf b/tools/qdoc3/test/qt-api-only_ja_JP.qdocconf new file mode 100644 index 0000000..aa3ab01 --- /dev/null +++ b/tools/qdoc3/test/qt-api-only_ja_JP.qdocconf @@ -0,0 +1,30 @@ +include(qt-build-docs_ja_JP.qdocconf) + +# Ensures that the generated index contains a URL that can be used by the +# tools documentation (assistant.qdocconf, designer.qdocconf, linguist.qdocconf, +# qmake.qdocconf). + +url = ./ + +# Ensures that the documentation for the tools is not included in the generated +# .qhp file. + +qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc \ + $QT_SOURCE_TREE/doc/src/development/designer-manual.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/calculatorform.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/customwidgetplugin.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/taskmenuextension.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/containerextension.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/worldtimeclockbuilder.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/worldtimeclockplugin.qdoc \ + $QT_SOURCE_TREE/doc/src/internationalization/linguist-manual.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/hellotr.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/arrowpad.qdoc \ + $QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \ + $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc + +outputdir = $QT_BUILD_TREE/doc-build/html-qt_ja_JP +tagfile = $QT_BUILD_TREE/doc-build/html-qt_ja_JP/qt.tags +base = file:$QT_BUILD_TREE/doc-build/html-qt_ja_JP diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index bd363a6..216ac6a 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -36,6 +36,7 @@ qhp.Qt.extraFiles = index.html \ images/page.png \ images/page_bg.png \ images/sprites-combined.png \ + images/arrow-down.png \ images/spinner.gif \ images/stylesheet-coffee-plastique.png \ images/taskmenuextension-example.png \ @@ -43,6 +44,7 @@ qhp.Qt.extraFiles = index.html \ images/dynamiclayouts-example.png \ scripts/functions.js \ scripts/jquery.js \ + style/OfflineStyle.css \ style/style_ie6.css \ style/style_ie7.css \ style/style_ie8.css \ @@ -113,6 +115,7 @@ excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \ $QT_SOURCE_TREE/src/3rdparty/phonon/mmf \ $QT_SOURCE_TREE/src/3rdparty/phonon/waveout \ $QT_SOURCE_TREE/doc/src/snippets \ + $QT_SOURCE_TREE/doc/src/ja_JP \ $QT_SOURCE_TREE/doc/src/zh_CN sources.fileextensions = "*.cpp *.qdoc *.mm" diff --git a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf new file mode 100644 index 0000000..e517b33 --- /dev/null +++ b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf @@ -0,0 +1,110 @@ +include(compat.qdocconf) +include(macros.qdocconf) +include(qt-cpp-ignore.qdocconf) +include(qt-html-templates_ja_JP.qdocconf) +include(qt-defines.qdocconf) + +project = Qt +description = Qt リファレンスドキュメント +url = http://qt.nokia.com/doc/ja_JP/4.7 + +sourceencoding = UTF-8 +outputencoding = UTF-8 +naturallanguage = ja + +indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index + +qhp.projects = Qt + +qhp.Qt.file = qt.qhp +qhp.Qt.namespace = com.trolltech.qt.470 +qhp.Qt.virtualFolder = qdoc +qhp.Qt.title = Qt +qhp.Qt.indexTitle = Qt +qhp.Qt.selectors = fake:example + +qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc ja_JP +qhp.Qt.customFilters.Qt.name = Qt 4.7.0 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 + +# Files not referenced in any qdoc file (last four are needed by qtdemo) +# See also extraimages.HTML +qhp.Qt.extraFiles = index.html \ + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/arrow-down.png \ + images/spinner.gif \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/OfflineStyle.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css + +language = Cpp + +sourcedirs = $QT_SOURCE_TREE/doc/src/ja_JP + +excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \ + $QT_SOURCE_TREE/src/3rdparty/des \ + $QT_SOURCE_TREE/src/3rdparty/freetype \ + $QT_SOURCE_TREE/src/3rdparty/harfbuzz \ + $QT_SOURCE_TREE/src/3rdparty/kdebase \ + $QT_SOURCE_TREE/src/3rdparty/libjpeg \ + $QT_SOURCE_TREE/src/3rdparty/libmng \ + $QT_SOURCE_TREE/src/3rdparty/libpng \ + $QT_SOURCE_TREE/src/3rdparty/libtiff \ + $QT_SOURCE_TREE/src/3rdparty/md4 \ + $QT_SOURCE_TREE/src/3rdparty/md5 \ + $QT_SOURCE_TREE/src/3rdparty/patches \ + $QT_SOURCE_TREE/src/3rdparty/sha1 \ + $QT_SOURCE_TREE/src/3rdparty/sqlite \ + $QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore \ + $QT_SOURCE_TREE/src/3rdparty/webkit/WebCore \ + $QT_SOURCE_TREE/src/3rdparty/wintab \ + $QT_SOURCE_TREE/src/3rdparty/zlib \ + $QT_SOURCE_TREE/doc/src/snippets \ + $QT_SOURCE_TREE/doc/src/zh_CN \ + $QT_SOURCE_TREE/src/3rdparty/phonon/gstreamer \ + $QT_SOURCE_TREE/src/3rdparty/phonon/ds9 \ + $QT_SOURCE_TREE/src/3rdparty/phonon/qt7 \ + $QT_SOURCE_TREE/src/3rdparty/phonon/mmf \ + $QT_SOURCE_TREE/src/3rdparty/phonon/waveout + +sources.fileextensions = "*.cpp *.qdoc *.mm" +examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp" +examples.imageextensions = "*.png" + +exampledirs = $QT_SOURCE_TREE/doc/src \ + $QT_SOURCE_TREE/examples/ja_JP \ + $QT_SOURCE_TREE/examples \ + $QT_SOURCE_TREE/examples/tutorials \ + $QT_SOURCE_TREE \ + $QT_SOURCE_TREE/qmake/examples \ + $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs +imagedirs = $QT_SOURCE_TREE/doc/src/ja_JP/images \ + $QT_SOURCE_TREE/doc/src/images \ + $QT_SOURCE_TREE/examples \ + $QT_SOURCE_TREE/doc/src/template/images +outputdir = $QT_BUILD_TREE/doc/html_ja_JP +tagfile = $QT_BUILD_TREE/doc/html_ja_JP/qt.tags +base = file:$QT_BUILD_TREE/doc/html_ja_JP + +HTML.generatemacrefs = "true" diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index caf5f73..909a2d4 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -30,31 +30,32 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/arrow-down.png \ + images/spinner.gif \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css language = Cpp @@ -79,6 +80,7 @@ excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \ $QT_SOURCE_TREE/src/3rdparty/wintab \ $QT_SOURCE_TREE/src/3rdparty/zlib \ $QT_SOURCE_TREE/doc/src/snippets \ + $QT_SOURCE_TREE/doc/src/ja_JP \ $QT_SOURCE_TREE/src/3rdparty/phonon/gstreamer \ $QT_SOURCE_TREE/src/3rdparty/phonon/ds9 \ $QT_SOURCE_TREE/src/3rdparty/phonon/qt7 \ diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf index 3e71d07..9e41d93 100644 --- a/tools/qdoc3/test/qt-defines.qdocconf +++ b/tools/qdoc3/test/qt-defines.qdocconf @@ -20,34 +20,49 @@ codeindent = 1 # See also qhp.Qt.extraFiles extraimages.HTML = qt-logo \ trolltech-logo \ - bg_l.png \ - bg_l_blank.png \ - bg_r.png \ - box_bg.png \ - breadcrumb.png \ - bullet_gt.png \ - bullet_dn.png \ - bullet_sq.png \ - bullet_up.png \ - feedbackground.png \ - horBar.png \ - page.png \ - page_bg.png \ - sprites-combined.png \ - spinner.gif \ - taskmenuextension-example.png \ - coloreditorfactoryimage.png \ - dynamiclayouts-example.png \ - stylesheet-coffee-plastique.png + bg_l.png \ + bg_l_blank.png \ + bg_ll_blank.png \ + bg_ul_blank.png \ + header_bg.png \ + bg_r.png \ + box_bg.png \ + breadcrumb.png \ + bullet_gt.png \ + bullet_dn.png \ + bullet_sq.png \ + bullet_up.png \ + arrow_down.png \ + feedbackground.png \ + horBar.png \ + page.png \ + page_bg.png \ + sprites-combined.png \ + spinner.gif \ + stylesheet-coffee-plastique.png \ + taskmenuextension-example.png \ + coloreditorfactoryimage.png \ + dynamiclayouts-example.png \ # This stuff is used by the new doc format. scriptdirs = $QT_SOURCE_TREE/doc/src/template/scripts styledirs = $QT_SOURCE_TREE/doc/src/template/style scripts.HTML = functions.js \ + shBrushCpp.js \ + shCore.js \ + shLegacy.js \ + narrow.js \ + superfish.js \ jquery.js styles.HTML = style.css \ + shCore.css \ + shThemeDefault.css \ + narrow.css \ + superfish.css \ + superfish_skin.css \ + OfflineStyle.css \ style_ie6.css \ style_ie7.css \ style_ie8.css diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index b72a1eb..60f5fb1 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -1,12 +1,19 @@ -HTML.stylesheets = style/style_ie6.css \ +HTML.stylesheets = style/style.css \ + style/OfflineStyle.css \ style/style_ie7.css \ style/style_ie8.css \ - style/style.css + style/style_ie6.css HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ + " <div class=\"content\"> \n" \ " <div id=\"nav-logo\">\n" \ " <a href=\"index.html\">Home</a></div>\n" \ " <a href=\"index.html\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \ + " <div id=\"narrowsearch\"><form onsubmit=\"return false;\" action=\"\" id=\"qtdocsearch\">\n" \ + " <fieldset>\n" \ + " <input type=\"text\" value=\"\" id=\"pageType\" name=\"searchstring\">\n" \ + " </fieldset>\n" \ + " </form></div>\n" \ " <div id=\"nav-topright\">\n" \ " <ul>\n" \ " <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \ @@ -21,9 +28,39 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <div id=\"shortCut\">\n" \ " <ul>\n" \ " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.7</a></span></li>\n" \ - " <li class=\"shortCut-topleft-active\"><a href=\"http://qt.nokia.com/doc/\">ALL Qt VERSIONS" \ + " <li class=\"shortCut-topleft-active\"><a href=\"http://qt.nokia.com/doc/\">ALL VERSIONS" \ " </a></li>\n" \ " </ul>\n" \ + " </div>\n" \ + " <ul class=\"sf-menu sf-js-enabled sf-shadow\" id=\"narrowmenu\"> \n" \ + " <li><a href=\"#\">API Lookup</a> \n" \ + " <ul id=\"topmenuLook\"> \n" \ + " <li><a href=\"classes.html\">Class index</a></li> \n" \ + " <li><a href=\"functions.html\">Function index</a></li> \n" \ + " <li><a href=\"modules.html\">Modules</a></li> \n" \ + " <li><a href=\"namespaces.html\">Namespaces</a></li> \n" \ + " <li><a href=\"qtglobal.html\">Global stuff</a></li> \n" \ + " <li><a href=\"qdeclarativeelements.html\">QML elements</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " <li><a href=\"#\">Qt Topics</a> \n" \ + " <ul id=\"topmenuTopic\"> \n" \ + " <li><a href=\"qt-basic-concepts.html\">Basic Qt architecture</a></li> \n" \ + " <li><a href=\"declarativeui.html\">Device UI's & Qt Quick</a></li> \n" \ + " <li><a href=\"qt-gui-concepts.html\">Desktop UI components</a></li> \n" \ + " <li><a href=\"platform-specific.html\">Platform-specific info</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " <li><a href=\"#\">Examples</a> \n" \ + " <ul id=\"topmenuexample\"> \n" \ + " <li><a href=\"all-examples.html\">Examples</a></li> \n" \ + " <li><a href=\"tutorials.html\">Tutorials</a></li> \n" \ + " <li><a href=\"demos.html\">Demos</a></li> \n" \ + " <li><a href=\"qdeclarativeexamples.html\">QML Examples</a></li> \n" \ + " <li><a href=\"qdeclarativeexamples.html#Demos\">QML Demos</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " </ul> \n" \ " </div>\n" \ " </div>\n" \ " <div class=\"wrapper\">\n" \ @@ -35,14 +72,14 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " <div class=\"searchlabel\">\n" \ " Search index:</div>\n" \ " <div class=\"search\">\n" \ - " <form id=\"qtdocsearch\" action=\"\">\n" \ + " <form id=\"qtdocsearch\" action=\"\" onsubmit=\"return false;\">\n" \ " <fieldset>\n" \ " <input type=\"text\" name=\"searchstring\" id=\"pageType\" value=\"\" />\n" \ " </fieldset>\n" \ " </form>\n" \ " </div>\n" \ " <div class=\"box first bottombar\" id=\"lookup\">\n" \ - " <h2><span></span>\n" \ + " <h2 title=\"API Lookup\"><span></span>\n" \ " API Lookup</h2>\n" \ " <div id=\"list001\" class=\"list\">\n" \ " <ul id=\"ul001\" >\n" \ @@ -56,7 +93,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " </div>\n" \ " </div>\n" \ " <div class=\"box bottombar\" id=\"topics\">\n" \ - " <h2><span></span>\n" \ + " <h2 title=\"Qt Topics\"><span></span>\n" \ " Qt Topics</h2>\n" \ " <div id=\"list002\" class=\"list\">\n" \ " <ul id=\"ul002\" >\n" \ @@ -68,7 +105,7 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ " </div>\n" \ " </div>\n" \ " <div class=\"box\" id=\"examples\">\n" \ - " <h2><span></span>\n" \ + " <h2 title=\"Examples\"><span></span>\n" \ " Examples</h2>\n" \ " <div id=\"list003\" class=\"list\">\n" \ " <ul id=\"ul003\">\n" \ @@ -129,7 +166,7 @@ HTML.footer = " <!-- /div -->\n" \ " </div>\n" \ " <div id=\"blurpage\">\n" \ " </div>\n" \ - "<!-- <script type=\"text/javascript\">\n" \ + "<script type=\"text/javascript\">\n" \ " var _gaq = _gaq || [];\n" \ " _gaq.push([\'_setAccount\', \'UA-4457116-5\']);\n" \ " _gaq.push([\'_trackPageview\']);\n" \ @@ -138,4 +175,4 @@ HTML.footer = " <!-- /div -->\n" \ " ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';\n" \ " var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);\n" \ " })();\n" \ - "</script> -->\n" + "</script>\n" diff --git a/tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf b/tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf new file mode 100644 index 0000000..027548e --- /dev/null +++ b/tools/qdoc3/test/qt-html-templates_ja_JP.qdocconf @@ -0,0 +1,178 @@ +HTML.stylesheets = style/style.css \ + style/OfflineStyle.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style_ie6.css + +HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ + " <div class=\"content\"> \n" \ + " <div id=\"nav-logo\">\n" \ + " <a href=\"index.html\">Home</a></div>\n" \ + " <a href=\"index.html\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \ + " <div id=\"narrowsearch\"><form onsubmit=\"return false;\" action=\"\" id=\"qtdocsearch\">\n" \ + " <fieldset>\n" \ + " <input type=\"text\" value=\"\" id=\"pageType\" name=\"searchstring\">\n" \ + " </fieldset>\n" \ + " </form></div>\n" \ + " <div id=\"nav-topright\">\n" \ + " <ul>\n" \ + " <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \ + " <li class=\"nav-topright-dev\"><a href=\"http://qt.nokia.com/developer\">DEV</a></li>\n" \ + " <li class=\"nav-topright-labs\"><a href=\"http://labs.qt.nokia.com/blogs/\">LABS</a></li>\n" \ + " <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://doc.qt.nokia.com/\">\n" \ + " DOC</a></li>\n" \ + " <li class=\"nav-topright-blog\"><a href=\"http://blog.qt.nokia.com/\">BLOG</a></li>\n" \ + " <li class=\"nav-topright-shop\"><a title=\"SHOP\" href=\"http://shop.qt.nokia.com\">SHOP</a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div id=\"shortCut\">\n" \ + " <ul>\n" \ + " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.7</a></span></li>\n" \ + " <li class=\"shortCut-topleft-active\"><a href=\"http://qt.nokia.com/doc/\">ALL VERSIONS" \ + " </a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <ul class=\"sf-menu sf-js-enabled sf-shadow\" id=\"narrowmenu\"> \n" \ + " <li><a href=\"#\">API Lookup</a> \n" \ + " <ul id=\"topmenuLook\"> \n" \ + " <li><a href=\"classes.html\">Class index</a></li> \n" \ + " <li><a href=\"functions.html\">Function index</a></li> \n" \ + " <li><a href=\"modules.html\">Modules</a></li> \n" \ + " <li><a href=\"namespaces.html\">Namespaces</a></li> \n" \ + " <li><a href=\"qtglobal.html\">Global stuff</a></li> \n" \ + " <li><a href=\"qdeclarativeelements.html\">QML elements</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " <li><a href=\"#\">Qt Topics</a> \n" \ + " <ul id=\"topmenuTopic\"> \n" \ + " <li><a href=\"qt-basic-concepts.html\">Basic Qt architecture</a></li> \n" \ + " <li><a href=\"declarativeui.html\">Device UI's & Qt Quick</a></li> \n" \ + " <li><a href=\"qt-gui-concepts.html\">Desktop UI components</a></li> \n" \ + " <li><a href=\"platform-specific.html\">Platform-specific info</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " <li><a href=\"#\">Examples</a> \n" \ + " <ul id=\"topmenuexample\"> \n" \ + " <li><a href=\"all-examples.html\">Examples</a></li> \n" \ + " <li><a href=\"tutorials.html\">チュートリアル</a></li> \n" \ + " <li><a href=\"demos.html\">Demos</a></li> \n" \ + " <li><a href=\"qdeclarativeexamples.html\">QML Examples</a></li> \n" \ + " <li><a href=\"qdeclarativeexamples.html#Demos\">QML Demos</a></li> \n" \ + " </ul> \n" \ + " </li> \n" \ + " </ul> \n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"wrapper\">\n" \ + " <div class=\"hd\">\n" \ + " <span></span>\n" \ + " </div>\n" \ + " <div class=\"bd group\">\n" \ + " <div class=\"sidebar\">\n" \ + " <div class=\"searchlabel\">\n" \ + " Search index:</div>\n" \ + " <div class=\"search\">\n" \ + " <form id=\"qtdocsearch\" action=\"\" onsubmit=\"return false;\">\n" \ + " <fieldset>\n" \ + " <input type=\"text\" name=\"searchstring\" id=\"pageType\" value=\"\" />\n" \ + " </fieldset>\n" \ + " </form>\n" \ + " </div>\n" \ + " <div class=\"box first bottombar\" id=\"lookup\">\n" \ + " <h2 title=\"API Lookup\"><span></span>\n" \ + " API Lookup</h2>\n" \ + " <div id=\"list001\" class=\"list\">\n" \ + " <ul id=\"ul001\" >\n" \ + " <li class=\"defaultLink\"><a href=\"classes.html\">Class index</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"functions.html\">Function index</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"modules.html\">Modules</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"namespaces.html\">Namespaces</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"qtglobal.html\">Global stuff</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"qdeclarativeelements.html\">QML elements</a></li>\n" \ + " </ul> \n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"box bottombar\" id=\"topics\">\n" \ + " <h2 title=\"Qt Topics\"><span></span>\n" \ + " Qt Topics</h2>\n" \ + " <div id=\"list002\" class=\"list\">\n" \ + " <ul id=\"ul002\" >\n" \ + " <li class=\"defaultLink\"><a href=\"qt-basic-concepts.html\">Basic Qt architecture</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"declarativeui.html\">Device UI's & Qt Quick</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"qt-gui-concepts.html\">Desktop UI components</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"platform-specific.html\">Platform-specific info</a></li>\n" \ + " </ul> \n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"box\" id=\"examples\">\n" \ + " <h2 title=\"Examples\"><span></span>\n" \ + " Examples</h2>\n" \ + " <div id=\"list003\" class=\"list\">\n" \ + " <ul id=\"ul003\">\n" \ + " <li class=\"defaultLink\"><a href=\"all-examples.html\">Examples</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"tutorials.html\">チュートリアル</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"demos.html\">Demos</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html\">QML Examples</a></li>\n" \ + " <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html#Demos\">QML Demos</a></li>\n" \ + " </ul> \n" \ + " </div>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"wrap\">\n" \ + " <div class=\"toolbar\">\n" \ + " <div class=\"breadcrumb toolblock\">\n" \ + " <ul>\n" \ + " <li class=\"first\"><a href=\"index.html\">Home</a></li>\n" \ + " <!-- Bread crumbs goes here -->\n" + +HTML.postpostheader = " </ul>\n" \ + " </div>\n" \ + " <div class=\"toolbuttons toolblock\">\n" \ + " <ul>\n" \ + " <li id=\"smallA\" class=\"t_button\">A</li>\n" \ + " <li id=\"medA\" class=\"t_button active\">A</li>\n" \ + " <li id=\"bigA\" class=\"t_button\">A</li>\n" \ + " <li id=\"print\" class=\"t_button\"><a href=\"javascript:this.print();\">\n" \ + " <span>Print</span></a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"content\">\n" + +HTML.footer = " <!-- /div -->\n" \ + " <div class=\"feedback t_button\">\n" \ + " [+] Documentation Feedback</div>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"ft\">\n" \ + " <span></span>\n" \ + " </div>\n" \ + " </div> \n" \ + " <div class=\"footer\">\n" \ + " <p>\n" \ + " <acronym title=\"Copyright\">©</acronym> 2008-2010 Nokia Corporation and/or its\n" \ + " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \ + " in Finland and/or other countries worldwide.</p>\n" \ + " <p>\n" \ + " All other trademarks are property of their respective owners. <a title=\"Privacy Policy\"\n" \ + " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy</a></p>\n" \ + " </div>\n" \ + " <div id=\"feedbackBox\">\n" \ + " <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \ + " <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \ + " <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\">Please submit you feedback...</textarea></p>\n" \ + " <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \ + " </form>\n" \ + " </div>\n" \ + " <div id=\"blurpage\">\n" \ + " </div>\n" \ + "<script type=\"text/javascript\">\n" \ + " var _gaq = _gaq || [];\n" \ + " _gaq.push([\'_setAccount\', \'UA-4457116-5\']);\n" \ + " _gaq.push([\'_trackPageview\']);\n" \ + " (function() {\n" \ + " var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;\n" \ + " ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';\n" \ + " var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);\n" \ + " })();\n" \ + "</script>\n" diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 267d536..d132771 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -28,13 +28,17 @@ qhp.Qt.indexRoot = qhp.Qt.extraFiles = index.html \ images/bg_l.png \ images/bg_l_blank.png \ - images/bg_r.png \ + images/bg_ll_blank.png \ + images/bg_ul_blank.png \ + images/header_bg.png \ + images/bg_r.png \ images/box_bg.png \ images/breadcrumb.png \ images/bullet_gt.png \ images/bullet_dn.png \ images/bullet_sq.png \ images/bullet_up.png \ + images/arrow_down.png \ images/feedbackground.png \ images/horBar.png \ images/page.png \ @@ -47,6 +51,17 @@ qhp.Qt.extraFiles = index.html \ images/dynamiclayouts-example.png \ scripts/functions.js \ scripts/jquery.js \ + scripts/shBrushCpp.js \ + scripts/shCore.js \ + scripts/shLegacy.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/shCore.css \ + style/shThemeDefault.css \ + style/narrow.css \ + style/superfish.css \ + style/superfish_skin.css \ + style/OfflineStyle.css \ style/style_ie6.css \ style/style_ie7.css \ style/style_ie8.css \ @@ -115,6 +130,7 @@ excludedirs = $QTDIR/src/3rdparty/clucene \ $QTDIR/src/3rdparty/phonon/mmf \ $QTDIR/src/3rdparty/phonon/waveout \ $QTDIR/doc/src/snippets \ + $QTDIR/doc/src/ja_JP \ $QTDIR/doc/src/zh_CN sources.fileextensions = "*.cpp *.qdoc *.mm" diff --git a/tools/qdoc3/test/qt_ja_JP.qdocconf b/tools/qdoc3/test/qt_ja_JP.qdocconf new file mode 100644 index 0000000..d4141c7 --- /dev/null +++ b/tools/qdoc3/test/qt_ja_JP.qdocconf @@ -0,0 +1,125 @@ +include(compat.qdocconf) +include(macros.qdocconf) +include(qt-cpp-ignore.qdocconf) +include(qt-html-templates_ja_JP.qdocconf) +include(qt-defines.qdocconf) + +project = Qt +versionsym = +version = %VERSION% +description = Qt リファレンスドキュメント +url = http://qt.nokia.com/doc/ja_JP/4.7 + +sourceencoding = UTF-8 +outputencoding = UTF-8 +naturallanguage = ja + +indexes = $QTDIR/doc/html/qt.index + +qhp.projects = Qt + +qhp.Qt.file = qt.qhp +qhp.Qt.namespace = com.trolltech.qt.470 +qhp.Qt.virtualFolder = qdoc +qhp.Qt.title = Qt +qhp.Qt.indexTitle = Qt +qhp.Qt.selectors = fake:example + +qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc ja_JP +qhp.Qt.customFilters.Qt.name = Qt 4.7.0 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 + +# Files not referenced in any qdoc file (last four are needed by qtdemo) +# See also extraimages.HTML +qhp.Qt.extraFiles = index.html \ + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_ll_blank.png \ + images/bg_ul_blank.png \ + images/header_bg.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/arrow_down.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/spinner.gif \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + scripts/shBrushCpp.js \ + scripts/shCore.js \ + scripts/shLegacy.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/shCore.css \ + style/shThemeDefault.css \ + style/narrow.css \ + style/superfish.css \ + style/superfish_skin.css \ + style/OfflineStyle.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css + +language = Cpp + +sourcedirs = $QTDIR/doc/src/ja_JP + +excludedirs = $QTDIR/src/3rdparty/clucene \ + $QTDIR/src/3rdparty/des \ + $QTDIR/src/3rdparty/freetype \ + $QTDIR/src/3rdparty/harfbuzz \ + $QTDIR/src/3rdparty/kdebase \ + $QTDIR/src/3rdparty/libjpeg \ + $QTDIR/src/3rdparty/libmng \ + $QTDIR/src/3rdparty/libpng \ + $QTDIR/src/3rdparty/libtiff \ + $QTDIR/src/3rdparty/md4 \ + $QTDIR/src/3rdparty/md5 \ + $QTDIR/src/3rdparty/patches \ + $QTDIR/src/3rdparty/sha1 \ + $QTDIR/src/3rdparty/sqlite \ + $QTDIR/src/3rdparty/webkit/JavaScriptCore \ + $QTDIR/src/3rdparty/webkit/WebCore \ + $QTDIR/src/3rdparty/wintab \ + $QTDIR/src/3rdparty/zlib \ + $QTDIR/doc/src/snippets \ + $QTDIR/doc/src/zh_CN \ + $QTDIR/src/3rdparty/phonon/gstreamer \ + $QTDIR/src/3rdparty/phonon/ds9 \ + $QTDIR/src/3rdparty/phonon/qt7 \ + $QTDIR/src/3rdparty/phonon/mmf \ + $QTDIR/src/3rdparty/phonon/waveout + +sources.fileextensions = "*.cpp *.qdoc *.mm" +examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp" +examples.imageextensions = "*.png" + +exampledirs = $QTDIR/doc/src \ + $QTDIR/examples/ja_JP \ + $QTDIR/examples \ + $QTDIR/examples/tutorials \ + $QTDIR \ + $QTDIR/qmake/examples \ + $QTDIR/src/3rdparty/webkit/WebKit/qt/docs +imagedirs = $QTDIR/doc/src/ja_JP/images \ + $QTDIR/doc/src/images \ + $QTDIR/examples \ + $QTDIR/doc/src/template/images +outputdir = $QTDIR/doc/html_ja_JP +tagfile = $QTDIR/doc/html_ja_JP/qt.tags +base = file:$QTDIR/doc/html_ja_JP + +HTML.generatemacrefs = "true" diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf index db02478..4983f9e 100644 --- a/tools/qdoc3/test/qt_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt_zh_CN.qdocconf @@ -32,28 +32,28 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/style.css + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/spinner.gif \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + style/style.css language = Cpp @@ -78,6 +78,7 @@ excludedirs = $QTDIR/src/3rdparty/clucene \ $QTDIR/src/3rdparty/wintab \ $QTDIR/src/3rdparty/zlib \ $QTDIR/doc/src/snippets \ + $QTDIR/doc/src/ja_JP \ $QTDIR/src/3rdparty/phonon/gstreamer \ $QTDIR/src/3rdparty/phonon/ds9 \ $QTDIR/src/3rdparty/phonon/qt7 \ diff --git a/tools/qml/deviceorientation.cpp b/tools/qml/deviceorientation.cpp index e7c70d5..a13b912 100644 --- a/tools/qml/deviceorientation.cpp +++ b/tools/qml/deviceorientation.cpp @@ -47,7 +47,7 @@ class DefaultDeviceOrientation : public DeviceOrientation { Q_OBJECT public: - DefaultDeviceOrientation() : DeviceOrientation(), m_orientation(DeviceOrientation::Portrait) {} + DefaultDeviceOrientation() : DeviceOrientation(), m_orientation(DeviceOrientation::TopUp) {} Orientation orientation() const { return m_orientation; diff --git a/tools/qml/deviceorientation.h b/tools/qml/deviceorientation.h index d209005..fe73868 100644 --- a/tools/qml/deviceorientation.h +++ b/tools/qml/deviceorientation.h @@ -52,7 +52,14 @@ class DeviceOrientation : public QObject Q_OBJECT Q_ENUMS(Orientation) public: - enum Orientation { UnknownOrientation, Portrait, Landscape }; + enum Orientation { + UnknownOrientation, + TopUp, + TopDown, + LeftUp, + RightUp + }; + virtual Orientation orientation() const = 0; virtual void setOrientation(Orientation) = 0; diff --git a/tools/qml/deviceorientation_maemo.cpp b/tools/qml/deviceorientation_maemo.cpp index 9f12f3d..501ff79 100644 --- a/tools/qml/deviceorientation_maemo.cpp +++ b/tools/qml/deviceorientation_maemo.cpp @@ -48,11 +48,11 @@ class MaemoOrientation : public DeviceOrientation Q_OBJECT public: MaemoOrientation() - : DeviceOrientation(),m_current(Portrait), m_lastSeen(Portrait), m_lastSeenCount(0) + : DeviceOrientation(),m_current(TopUp), m_lastSeen(TopUp), m_lastSeenCount(0) { m_current = get(); if (m_current == UnknownOrientation) - m_current = Portrait; + m_current = TopUp; startTimer(100); } @@ -101,9 +101,13 @@ private: if (abs(az) > 850) { o = UnknownOrientation; } else if (ax < -750) { - o = Portrait; + o = LeftUp; + } else if (ax > 750) { + o = RightUp; } else if (ay < -750) { - o = Landscape; + o = TopUp; + } else if (ay > 750) { + o = TopDown; } return o; diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index fe323c1..f681303 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -367,7 +367,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) #endif , loggerWindow(new LoggerWidget()) , frame_stream(0), mb(0) - , portraitOrientation(0), landscapeOrientation(0) + , orientation(0) , showWarningsWindow(0) , m_scriptOptions(0) , tester(0) @@ -418,7 +418,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags) if (!(flags & Qt::FramelessWindowHint)) { createMenu(menuBar(),0); - setPortrait(); + changeOrientation(orientation->actions().value(0)); } #if !defined(Q_OS_SYMBIAN) @@ -571,26 +571,25 @@ void QDeclarativeViewer::createMenu(QMenuBar *menu, QMenu *flatmenu) QMenu *propertiesMenu = settingsMenu->addMenu(tr("Properties")); - QActionGroup *orientation = new QActionGroup(parent); + 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())); + QAction *rotateOrientation = new QAction(tr("Rotate orientation"), parent); + rotateOrientation->setShortcut(QKeySequence("Ctrl+T")); + settingsMenu->addAction(rotateOrientation); + connect(rotateOrientation, SIGNAL(triggered()), this, SLOT(rotateOrientation())); orientation->setExclusive(true); - portraitOrientation = new QAction(tr("orientation: Portrait"), parent); - portraitOrientation->setCheckable(true); - connect(portraitOrientation, SIGNAL(triggered()), this, SLOT(setPortrait())); - orientation->addAction(portraitOrientation); - propertiesMenu->addAction(portraitOrientation); - - landscapeOrientation = new QAction(tr("orientation: Landscape"), parent); - landscapeOrientation->setCheckable(true); - connect(landscapeOrientation, SIGNAL(triggered()), this, SLOT(setLandscape())); - orientation->addAction(landscapeOrientation); - propertiesMenu->addAction(landscapeOrientation); + connect(orientation, SIGNAL(triggered(QAction*)), this, SLOT(changeOrientation(QAction*))); + + orientation->addAction(tr("orientation: TopUp")); + orientation->addAction(tr("orientation: LeftUp")); + orientation->addAction(tr("orientation: TopDown")); + orientation->addAction(tr("orientation: RightUp")); + QList<QAction *> actions = orientation->actions(); + for (int i=0; i<actions.count(); i++) { + propertiesMenu->addAction(actions[i]); + actions[i]->setCheckable(true); + } if (flatmenu) flatmenu->addSeparator(); @@ -624,21 +623,16 @@ void QDeclarativeViewer::proxySettingsChanged() reload (); } -void QDeclarativeViewer::setPortrait() -{ - DeviceOrientation::instance()->setOrientation(DeviceOrientation::Portrait); - portraitOrientation->setChecked(true); -} - -void QDeclarativeViewer::setLandscape() +void QDeclarativeViewer::rotateOrientation() { - DeviceOrientation::instance()->setOrientation(DeviceOrientation::Landscape); - landscapeOrientation->setChecked(true); -} + QAction *current = orientation->checkedAction(); + QList<QAction *> actions = orientation->actions(); + int index = actions.indexOf(current); + if (index < 0) + return; -void QDeclarativeViewer::toggleOrientation() -{ - DeviceOrientation::instance()->setOrientation(DeviceOrientation::instance()->orientation()==DeviceOrientation::Portrait?DeviceOrientation::Landscape:DeviceOrientation::Portrait); + QAction *newOrientation = actions[(index + 1) % actions.count()]; + changeOrientation(newOrientation); } void QDeclarativeViewer::toggleFullScreen() @@ -971,12 +965,7 @@ void QDeclarativeViewer::keyPressEvent(QKeyEvent *event) } else if (event->key() == Qt::Key_F9 || (event->key() == Qt::Key_9 && devicemode)) { toggleRecording(); } else if (event->key() == Qt::Key_F10) { - if (portraitOrientation) { - if (portraitOrientation->isChecked()) - setLandscape(); - else - setPortrait(); - } + rotateOrientation(); } QWidget::keyPressEvent(event); @@ -1181,6 +1170,23 @@ void QDeclarativeViewer::recordFrame() } } +void QDeclarativeViewer::changeOrientation(QAction *action) +{ + if (!action) + return; + action->setChecked(true); + + QString o = action->text().split(QLatin1Char(':')).value(1).trimmed(); + if (o == QLatin1String("TopUp")) + DeviceOrientation::instance()->setOrientation(DeviceOrientation::TopUp); + else if (o == QLatin1String("TopDown")) + DeviceOrientation::instance()->setOrientation(DeviceOrientation::TopDown); + else if (o == QLatin1String("LeftUp")) + DeviceOrientation::instance()->setOrientation(DeviceOrientation::LeftUp); + else if (o == QLatin1String("RightUp")) + DeviceOrientation::instance()->setOrientation(DeviceOrientation::RightUp); +} + void QDeclarativeViewer::orientationChanged() { if (canvas->resizeMode() == QDeclarativeView::SizeRootObjectToView) { diff --git a/tools/qml/qmlruntime.h b/tools/qml/qmlruntime.h index 5086e02..27bd217 100644 --- a/tools/qml/qmlruntime.h +++ b/tools/qml/qmlruntime.h @@ -124,7 +124,7 @@ public slots: void ffmpegFinished(int code); void showProxySettings (); void proxySettingsChanged (); - void toggleOrientation(); + void rotateOrientation(); void statusChanged(); void setSlowMode(bool); void launch(const QString &); @@ -140,9 +140,8 @@ private slots: void recordFrame(); void chooseRecordingOptions(); void pickRecordingFile(); - void setPortrait(); - void setLandscape(); void toggleFullScreen(); + void changeOrientation(QAction*); void orientationChanged(); void showWarnings(bool show); @@ -183,9 +182,7 @@ private: bool ffmpegAvailable; bool convertAvailable; - QAction *portraitOrientation; - QAction *landscapeOrientation; - + QActionGroup *orientation; QAction *showWarningsWindow; QString m_script; |