diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2010-12-02 12:13:07 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2010-12-02 12:13:07 (GMT) |
commit | 655bae506d4d2743ed016c78a767afa2150057a9 (patch) | |
tree | 9ccc2b4a56792616a2c48045faa9bd7081126167 /tools | |
parent | 16252a59afa58b0cb4b0ffb02a330dcf002c9750 (diff) | |
parent | f6f8ba94d5f82b8df723a217a3d0ecb50e570cbc (diff) | |
download | Qt-655bae506d4d2743ed016c78a767afa2150057a9.zip Qt-655bae506d4d2743ed016c78a767afa2150057a9.tar.gz Qt-655bae506d4d2743ed016c78a767afa2150057a9.tar.bz2 |
Merge remote branch 'origin/master' into file-engine-refactor
master's version of conflicting def files picked.
Conflicts:
src/s60installs/bwins/QtCoreu.def
src/s60installs/bwins/QtGuiu.def
src/s60installs/bwins/QtNetworku.def
src/s60installs/eabi/QtCoreu.def
src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'tools')
28 files changed, 456 insertions, 132 deletions
diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp index ba54dd6..553ffc4 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.cpp +++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp @@ -145,7 +145,7 @@ HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) /* * Otherwise we will waste time if several new docs are found, - * because we will start to index them, only to be interupted + * because we will start to index them, only to be interrupted * by the next request. Also, there is a nasty SQLITE bug that will * cause the application to hang for minutes in that case. * This call is reverted by initialDocSetupDone(), which must be diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 48469d4..d7d01da 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -460,14 +460,20 @@ void MainWindow::setupActions() menu->addAction(globalActions->printAction()); menu->addSeparator(); - QAction *tmp = menu->addAction(QIcon::fromTheme("application-exit"), - tr("&Quit"), this, SLOT(close())); - tmp->setMenuRole(QAction::QuitRole); + m_closeTabAction = menu->addAction(tr("&Close Tab"), m_centralWidget, + SLOT(closeTab())); + m_closeTabAction->setShortcuts(QKeySequence::Close); + + QIcon appExitIcon = QIcon::fromTheme("application-exit"); + QAction *tmp; #ifdef Q_OS_WIN + tmp = menu->addAction(appExitIcon, tr("E&xit"), this, SLOT(close())); tmp->setShortcut(QKeySequence(tr("CTRL+Q"))); #else + tmp = menu->addAction(appExitIcon, tr("&Quit"), this, SLOT(close())); tmp->setShortcut(QKeySequence::Quit); #endif + tmp->setMenuRole(QAction::QuitRole); menu = menuBar()->addMenu(tr("&Edit")); menu->addAction(globalActions->copyAction()); diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro index 867f483..608d876 100644 --- a/tools/configure/configure.pro +++ b/tools/configure/configure.pro @@ -67,8 +67,8 @@ HEADERS = configureapp.h environment.h tools.h\ $$QT_SOURCE_TREE/src/corelib/tools/qunicodetables_p.h \ $$QT_SOURCE_TREE/src/corelib/xml/qxmlstream.h \ $$QT_SOURCE_TREE/src/corelib/xml/qxmlutils_p.h \ - $$QT_SOURCE_TREE/tools/shared/symbian/epocroot.h \ - $$QT_SOURCE_TREE/tools/shared/windows/registry.h + $$QT_SOURCE_TREE/tools/shared/symbian/epocroot_p.h \ + $$QT_SOURCE_TREE/tools/shared/windows/registry_p.h SOURCES = main.cpp configureapp.cpp environment.cpp tools.cpp \ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 3ca57b4..479fd4c 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3236,7 +3236,8 @@ void Configure::generateConfigfiles() } // Copy configured mkspec to default directory, but remove the old one first, if there is any - QString defSpec = buildPath + "/mkspecs/default"; + QString mkspecsPath = buildPath + "/mkspecs"; + QString defSpec = mkspecsPath + "/default"; QFileInfo defSpecInfo(defSpec); if (defSpecInfo.exists()) { if (!Environment::rmdir(defSpec)) { @@ -3246,21 +3247,22 @@ void Configure::generateConfigfiles() } } - QString spec = dictionary.contains("XQMAKESPEC") ? dictionary["XQMAKESPEC"] : dictionary["QMAKESPEC"]; - QString pltSpec = sourcePath + "/mkspecs/" + spec; - if (!Environment::cpdir(pltSpec, defSpec)) { - cout << "Couldn't update default mkspec! Does " << qPrintable(pltSpec) << " exist?" << endl; + QDir mkspecsDir(mkspecsPath); + if (!mkspecsDir.mkdir("default")) { + cout << "Couldn't create default mkspec dir!" << endl; dictionary["DONE"] = "error"; return; } + QString spec = dictionary.contains("XQMAKESPEC") ? dictionary["XQMAKESPEC"] : dictionary["QMAKESPEC"]; + QString pltSpec = sourcePath + "/mkspecs/" + spec; outName = defSpec + "/qmake.conf"; - ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL); QFile qmakeConfFile(outName); - if (qmakeConfFile.open(QFile::Append | QFile::WriteOnly | QFile::Text)) { + if (qmakeConfFile.open(QFile::WriteOnly | QFile::Text)) { QTextStream qmakeConfStream; qmakeConfStream.setDevice(&qmakeConfFile); - qmakeConfStream << endl << "QMAKESPEC_ORIGINAL=" << pltSpec << endl; + qmakeConfStream << "QMAKESPEC_ORIGINAL=" << pltSpec << endl << endl; + qmakeConfStream << "include(" << pltSpec << "/qmake.conf)" << endl; qmakeConfStream.flush(); qmakeConfFile.close(); } @@ -3340,7 +3342,7 @@ void Configure::generateConfigfiles() if (tmpFile3.open()) { tmpStream.setDevice(&tmpFile3); tmpStream << "/* Evaluation license key */" << endl - << "static const char qt_eval_key_data [512 + 12] = \"qt_qevalkey=" << licenseInfo["LICENSEKEYEXT"] << "\";" << endl; + << "static const volatile char qt_eval_key_data [512 + 12] = \"qt_qevalkey=" << licenseInfo["LICENSEKEYEXT"] << "\";" << endl; tmpStream.flush(); tmpFile3.flush(); diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index 9446864..2efc58a 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -60,8 +60,8 @@ using namespace std; #include <qt_windows.h> #endif -#include <symbian/epocroot.h> // from tools/shared -#include <windows/registry.h> // from tools/shared +#include <symbian/epocroot_p.h> // from tools/shared +#include <windows/registry_p.h> // from tools/shared QT_BEGIN_NAMESPACE @@ -153,7 +153,7 @@ Compiler Environment::detectCompiler() QString paths = qgetenv("PATH"); QStringList pathlist = paths.toLower().split(";"); for(int i = 0; compiler_info[i].compiler; ++i) { - QString productPath = readRegistryKey(HKEY_LOCAL_MACHINE, compiler_info[i].regKey).toLower(); + QString productPath = qt_readRegistryKey(HKEY_LOCAL_MACHINE, compiler_info[i].regKey).toLower(); if (productPath.length()) { QStringList::iterator it; for(it = pathlist.begin(); it != pathlist.end(); ++it) { @@ -456,8 +456,8 @@ bool Environment::rmdir(const QString &name) QString Environment::symbianEpocRoot() { - // Call function defined in tools/shared/symbian/epocroot.h - return ::epocRoot(); + // Call function defined in tools/shared/symbian/epocroot_p.h + return ::qt_epocRoot(); } QT_END_NAMESPACE diff --git a/tools/designer/src/lib/shared/widgetdatabase.cpp b/tools/designer/src/lib/shared/widgetdatabase.cpp index 0c3e949..7ab450d 100644 --- a/tools/designer/src/lib/shared/widgetdatabase.cpp +++ b/tools/designer/src/lib/shared/widgetdatabase.cpp @@ -54,7 +54,8 @@ #include <QtDesigner/QDesignerFormEditorInterface> #include <QtXml/QXmlStreamWriter> -#include <QtCore/QtAlgorithms> + +#include <QtCore/QScopedPointer> #include <QtCore/qdebug.h> #include <QtCore/QMetaProperty> #include <QtCore/QTextStream> @@ -565,10 +566,10 @@ static QString xmlFromWidgetBox(const QDesignerFormEditorInterface *core, const const bool found = QDesignerWidgetBox::findWidget(core->widgetBox(), className, QString(), &widget); if (!found) return QString(); - DomUI *domUI = QDesignerWidgetBox::xmlToUi(className, widget.domXml(), false); - domUI->setAttributeVersion(QLatin1String("4.0")); - if (!domUI) + QScopedPointer<DomUI> domUI(QDesignerWidgetBox::xmlToUi(className, widget.domXml(), false)); + if (domUI.isNull()) return QString(); + domUI->setAttributeVersion(QLatin1String("4.0")); DomWidget *domWidget = domUI->elementWidget(); if (!domWidget) return QString(); @@ -615,7 +616,6 @@ static QString xmlFromWidgetBox(const QDesignerFormEditorInterface *core, const domUI->write(writer); writer.writeEndDocument(); } - delete domUI; return rc; } diff --git a/tools/linguist/lrelease/lrelease.pro b/tools/linguist/lrelease/lrelease.pro index 6beafa3..89694be 100644 --- a/tools/linguist/lrelease/lrelease.pro +++ b/tools/linguist/lrelease/lrelease.pro @@ -15,6 +15,7 @@ macx:SOURCES += $$QT_SOURCE_TREE/src/corelib/io/qsettings_mac.cpp include(../../../src/tools/bootstrap/bootstrap.pri) include(../shared/formats.pri) include(../shared/proparser.pri) +include(../../shared/symbian/epocroot.pri) win32:LIBS += -ladvapi32 # for qsettings_win.cpp diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index 49906e0..76a8756 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -350,6 +350,10 @@ static void processProjects( ProFileEvaluator visitor; visitor.setVerbose(options & Verbose); + QHash<QString, QStringList> lupdateConfig; + lupdateConfig.insert(QLatin1String("CONFIG"), QStringList(QLatin1String("lupdate_run"))); + visitor.addVariables(lupdateConfig); + QFileInfo pfi(proFile); ProFile pro(pfi.absoluteFilePath()); if (!visitor.queryProFile(&pro) || !visitor.accept(&pro)) { diff --git a/tools/linguist/lupdate/qscript.cpp b/tools/linguist/lupdate/qscript.cpp index 5323022..f9aff34 100644 --- a/tools/linguist/lupdate/qscript.cpp +++ b/tools/linguist/lupdate/qscript.cpp @@ -67,6 +67,8 @@ class LU { Q_DECLARE_TR_FUNCTIONS(LUpdate) }; +static QString MagicComment(QLatin1String("TRANSLATOR")); + class QScriptGrammar { public: @@ -2092,8 +2094,9 @@ public: ~QScriptParser(); void setLexer(QScript::Lexer *); + void setTranslator(Translator *); - bool parse(Translator *translator); + bool parse(); QString fileName() const { return lexer->fileName(); } @@ -2129,6 +2132,8 @@ protected: private: QScript::Lexer *lexer; + Translator *translator; + QString trcontext; QString extracomment; QString msgid; QString sourcetext; @@ -2160,7 +2165,8 @@ QScriptParser::QScriptParser(): sym_stack(0), state_stack(0), location_stack(0), - lexer(0) + lexer(0), + translator(0) { } @@ -2187,9 +2193,17 @@ void QScriptParser::setLexer(QScript::Lexer *lex) lexer = lex; } -bool QScriptParser::parse(Translator *translator) +void QScriptParser::setTranslator(Translator *tor) +{ + translator = tor; +} + +bool QScriptParser::parse() { Q_ASSERT(lexer != 0); + Q_ASSERT(translator != 0); + trcontext = QFileInfo(fileName()).baseName(); + const int INITIAL_STATE = 0; int yytoken = -1; @@ -2303,11 +2317,10 @@ case 66: { if (args.at(0).type() != QVariant::String) { yyMsg(identLineNo) << qPrintable(LU::tr("%1(): text to translate must be a literal string.\n").arg(name)); } else { - QString context = QFileInfo(fileName()).baseName(); QString text = args.at(0).toString(); QString comment = args.value(1).toString(); bool plural = (args.size() > 2); - recordMessage(translator, context, text, comment, extracomment, + recordMessage(translator, trcontext, text, comment, extracomment, msgid, extra, plural, fileName(), identLineNo); } } @@ -2533,6 +2546,32 @@ void QScriptParser::processComment(const QChar *chars, int length) } } sourcetext.resize(ptr - (ushort *)sourcetext.data()); + } else { + int idx = 0; + ushort c; + while ((c = chars[idx].unicode()) == ' ' || c == '\t' || c == '\n') + ++idx; + if (!memcmp(chars + idx, MagicComment.unicode(), MagicComment.length() * 2)) { + idx += MagicComment.length(); + QString comment = QString(chars + idx, length - idx).simplified(); + int k = comment.indexOf(QLatin1Char(' ')); + if (k == -1) { + trcontext = comment; + } else { + trcontext = comment.left(k); + comment.remove(0, k + 1); + TranslatorMessage msg( + trcontext, QString(), + comment, QString(), + fileName(), lexer->startLineNo(), QStringList(), + TranslatorMessage::Finished, /*plural=*/false); + msg.setExtraComment(extracomment.simplified()); + extracomment.clear(); + translator->append(msg); + translator->setExtras(extra); + extra.clear(); + } + } } } @@ -2558,7 +2597,8 @@ bool loadQScript(Translator &translator, const QString &filename, ConversionData QScript::Lexer lexer(&parser); lexer.setCode(code, filename, /*lineNumber=*/1); parser.setLexer(&lexer); - if (!parser.parse(&translator)) { + parser.setTranslator(&translator); + if (!parser.parse()) { 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 3655f2e..1335f55 100644 --- a/tools/linguist/lupdate/qscript.g +++ b/tools/linguist/lupdate/qscript.g @@ -104,6 +104,8 @@ class LU { Q_DECLARE_TR_FUNCTIONS(LUpdate) }; +static QString MagicComment(QLatin1String("TRANSLATOR")); + static void recordMessage( Translator *tor, const QString &context, const QString &text, const QString &comment, const QString &extracomment, const QString &msgid, const TranslatorMessage::ExtraData &extra, @@ -1423,8 +1425,9 @@ public: ~QScriptParser(); void setLexer(QScript::Lexer *); + void setTranslator(Translator *); - bool parse(Translator *translator); + bool parse(); QString fileName() const { return lexer->fileName(); } @@ -1460,6 +1463,8 @@ protected: private: QScript::Lexer *lexer; + Translator *translator; + QString trcontext; QString extracomment; QString msgid; QString sourcetext; @@ -1491,7 +1496,8 @@ QScriptParser::QScriptParser(): sym_stack(0), state_stack(0), location_stack(0), - lexer(0) + lexer(0), + translator(0) { } @@ -1518,9 +1524,17 @@ void QScriptParser::setLexer(QScript::Lexer *lex) lexer = lex; } -bool QScriptParser::parse(Translator *translator) +void QScriptParser::setTranslator(Translator *tor) +{ + translator = tor; +} + +bool QScriptParser::parse() { Q_ASSERT(lexer != 0); + Q_ASSERT(translator != 0); + trcontext = QFileInfo(fileName()).baseName(); + const int INITIAL_STATE = 0; int yytoken = -1; @@ -1719,11 +1733,10 @@ case $rule_number: { if (args.at(0).type() != QVariant::String) { yyMsg(identLineNo) << qPrintable(LU::tr("%1(): text to translate must be a literal string.\n").arg(name)); } else { - QString context = QFileInfo(fileName()).baseName(); QString text = args.at(0).toString(); QString comment = args.value(1).toString(); bool plural = (args.size() > 2); - recordMessage(translator, context, text, comment, extracomment, + recordMessage(translator, trcontext, text, comment, extracomment, msgid, extra, plural, fileName(), identLineNo); } } @@ -2181,6 +2194,32 @@ void QScriptParser::processComment(const QChar *chars, int length) } } sourcetext.resize(ptr - (ushort *)sourcetext.data()); + } else { + int idx = 0; + ushort c; + while ((c = chars[idx].unicode()) == ' ' || c == '\t' || c == '\n') + ++idx; + if (!memcmp(chars + idx, MagicComment.unicode(), MagicComment.length() * 2)) { + idx += MagicComment.length(); + QString comment = QString(chars + idx, length - idx).simplified(); + int k = comment.indexOf(QLatin1Char(' ')); + if (k == -1) { + trcontext = comment; + } else { + trcontext = comment.left(k); + comment.remove(0, k + 1); + TranslatorMessage msg( + trcontext, QString(), + comment, QString(), + fileName(), lexer->startLineNo(), QStringList(), + TranslatorMessage::Finished, /*plural=*/false); + msg.setExtraComment(extracomment.simplified()); + extracomment.clear(); + translator->append(msg); + translator->setExtras(extra); + extra.clear(); + } + } } } @@ -2206,7 +2245,8 @@ bool loadQScript(Translator &translator, const QString &filename, ConversionData QScript::Lexer lexer(&parser); lexer.setCode(code, filename, /*lineNumber=*/1); parser.setLexer(&lexer); - if (!parser.parse(&translator)) { + parser.setTranslator(&translator); + if (!parser.parse()) { std::cerr << qPrintable(filename) << ':' << parser.errorLineNumber() << ": " << qPrintable(parser.errorMessage()) << std::endl; return false; diff --git a/tools/qdoc3/doc/files/qt.qdocconf b/tools/qdoc3/doc/files/qt.qdocconf index 4546c7a..44cfbc1 100644 --- a/tools/qdoc3/doc/files/qt.qdocconf +++ b/tools/qdoc3/doc/files/qt.qdocconf @@ -22,7 +22,7 @@ edition.DesktopLight.groups = -graphicsview-api qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.471 +qhp.Qt.namespace = com.trolltech.qt.472 qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation qhp.Qt.indexRoot = @@ -36,9 +36,9 @@ qhp.Qt.extraFiles = classic.css \ images/dynamiclayouts-example.png \ images/stylesheet-coffee-plastique.png -qhp.Qt.filterAttributes = qt 4.7.1 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.7.1 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.1 +qhp.Qt.filterAttributes = qt 4.7.2 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.7.2 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2 qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index 448ed23..f59fdf0 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -13,7 +13,7 @@ indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Designer qhp.Designer.file = designer.qhp -qhp.Designer.namespace = com.trolltech.designer.470 +qhp.Designer.namespace = com.trolltech.designer.480 qhp.Designer.virtualFolder = qdoc qhp.Designer.indexTitle = Qt Designer Manual qhp.Designer.extraFiles = images/bg_l.png \ diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf index 45f48a6..4abe40c 100644 --- a/tools/qdoc3/test/qdeclarative.qdocconf +++ b/tools/qdoc3/test/qdeclarative.qdocconf @@ -21,7 +21,7 @@ edition.DesktopLight.groups = -graphicsview-api qhp.projects = Qml qhp.Qml.file = qml.qhp -qhp.Qml.namespace = com.trolltech.qml.470 +qhp.Qml.namespace = com.trolltech.qml.480 qhp.Qml.virtualFolder = qdoc qhp.Qml.indexTitle = Qml Reference @@ -61,9 +61,9 @@ qhp.Qml.extraFiles = images/bg_l.png \ style/style_ie8.css \ style/style.css -qhp.Qml.filterAttributes = qt 4.7.0 qtrefdoc -qhp.Qml.customFilters.Qt.name = Qt 4.7.0 -qhp.Qml.customFilters.Qt.filterAttributes = qt 4.7.0 +qhp.Qml.filterAttributes = qt 4.8.0 qtrefdoc +qhp.Qml.customFilters.Qt.name = Qt 4.8.0 +qhp.Qml.customFilters.Qt.filterAttributes = qt 4.8.0 qhp.Qml.subprojects = classes qhp.Qml.subprojects.classes.title = Elements qhp.Qml.subprojects.classes.indexTitle = Qml Elements diff --git a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf index c24ddef..e775228 100644 --- a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf @@ -17,15 +17,15 @@ 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.namespace = com.trolltech.qt.480 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 +qhp.Qt.filterAttributes = qt 4.8.0 qtrefdoc ja_JP +qhp.Qt.customFilters.Qt.name = Qt 4.8.0 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.8.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index dedf806..b7b5371 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -62,7 +62,6 @@ qhp.Qt.extraFiles = index.html \ qhp.Qt.filterAttributes = qt 4.8.0 qtrefdoc qhp.Qt.customFilters.Qt.name = Qt 4.8.0 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.8.0 -qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects = classes qmlelements overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes diff --git a/tools/qdoc3/test/qt_ja_JP.qdocconf b/tools/qdoc3/test/qt_ja_JP.qdocconf index f9ce142..69c0748 100644 --- a/tools/qdoc3/test/qt_ja_JP.qdocconf +++ b/tools/qdoc3/test/qt_ja_JP.qdocconf @@ -19,15 +19,15 @@ indexes = $QTDIR/doc/html/qt.index qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.470 +qhp.Qt.namespace = com.trolltech.qt.480 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 +qhp.Qt.filterAttributes = qt 4.8.0 qtrefdoc ja_JP +qhp.Qt.customFilters.Qt.name = Qt 4.8.0 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.8.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp index d348e70..b660eb3 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp @@ -46,6 +46,7 @@ #include <private/qgraphicssystem_runtime_p.h> #include <private/qpixmap_raster_p.h> #include "qmeegoruntime.h" +#include "qmeegoswitchevent.h" QString QMeeGoGraphicsSystemHelper::runningGraphicsSystemName() { @@ -81,8 +82,16 @@ void QMeeGoGraphicsSystemHelper::switchToMeeGo() if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime")) qWarning("Can't switch to meego - switching only supported with 'runtime' graphics system."); else { + QMeeGoSwitchEvent willSwitchEvent(QLatin1String("meego"), QMeeGoSwitchEvent::WillSwitch); + foreach (QWidget *widget, QApplication::topLevelWidgets()) + QCoreApplication::sendEvent(widget, &willSwitchEvent); + QApplication *app = static_cast<QApplication *>(QCoreApplication::instance()); app->setGraphicsSystem(QLatin1String("meego")); + + QMeeGoSwitchEvent didSwitchEvent(QLatin1String("meego"), QMeeGoSwitchEvent::DidSwitch); + foreach (QWidget *widget, QApplication::topLevelWidgets()) + QCoreApplication::sendEvent(widget, &didSwitchEvent); } } @@ -94,8 +103,16 @@ void QMeeGoGraphicsSystemHelper::switchToRaster() if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime")) qWarning("Can't switch to raster - switching only supported with 'runtime' graphics system."); else { + QMeeGoSwitchEvent willSwitchEvent(QLatin1String("raster"), QMeeGoSwitchEvent::WillSwitch); + foreach (QWidget *widget, QApplication::topLevelWidgets()) + QCoreApplication::sendEvent(widget, &willSwitchEvent); + QApplication *app = static_cast<QApplication *>(QCoreApplication::instance()); app->setGraphicsSystem(QLatin1String("raster")); + + QMeeGoSwitchEvent didSwitchEvent(QLatin1String("raster"), QMeeGoSwitchEvent::DidSwitch); + foreach (QWidget *widget, QApplication::topLevelWidgets()) + QCoreApplication::sendEvent(widget, &didSwitchEvent); } } diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h index 2baacbb..d47c829 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h @@ -102,6 +102,9 @@ public: When running with the 'runtime' graphics system, sets the currently active system to 'meego'. The window surface and all the resources are automatically migrated to OpenGL. Will fail if the active graphics system is not 'runtime'. + Calling this function will emit QMeeGoSwitchEvent to the top level widgets. + Two events will be emitted for each switch -- one before the switch (QMeeGoSwitchEvent::WillSwitch) + and one after the switch (QMeeGoSwitchEvent::DidSwitch). */ static void switchToMeeGo(); @@ -111,6 +114,9 @@ public: system to 'raster'. The window surface and the graphics resources (including the EGL shared image resources) are automatically migrated back to the CPU. All OpenGL resources (surface, context, cache, font cache) are automaticall anihilated. + Calling this function will emit QMeeGoSwitchEvent to the top level widgets. + Two events will be emitted for each switch -- one before the switch (QMeeGoSwitchEvent::WillSwitch) + and one after the switch (QMeeGoSwitchEvent::DidSwitch). */ static void switchToRaster(); diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro index 161a31b..360847e 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro @@ -6,5 +6,5 @@ include(../../src/qbase.pri) QT += gui INCLUDEPATH += '../../src/plugins/graphicssystems/meego' -HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h -SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegofencesync.cpp +HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegoswitchevent.h +SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegofencesync.cpp qmeegoswitchevent.cpp qmeegoswitchevent.h diff --git a/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp new file mode 100644 index 0000000..22ea0fe --- /dev/null +++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmeegoswitchevent.h" + +static int switchEventNumber = -1; + +QMeeGoSwitchEvent::QMeeGoSwitchEvent(const QString &graphicsSystemName, QMeeGoSwitchEvent::State s) : QEvent(QMeeGoSwitchEvent::eventNumber()) +{ + name = graphicsSystemName; + switchState = s; +} + +QString QMeeGoSwitchEvent::graphicsSystemName() const +{ + return name; +} + +QMeeGoSwitchEvent::State QMeeGoSwitchEvent::state() const +{ + return switchState; +} + +QEvent::Type QMeeGoSwitchEvent::eventNumber() +{ + if (switchEventNumber < 0) + switchEventNumber = QEvent::registerEventType(); + + return (QEvent::Type) switchEventNumber; +}
\ No newline at end of file diff --git a/tools/qmeegographicssystemhelper/qmeegoswitchevent.h b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h new file mode 100644 index 0000000..0ddbd3d --- /dev/null +++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QEvent> +#include <QString> + +//! A custom event representing a graphics system switch. +/*! + This event is sent two times -- before the actual switch and after the switch. + The current mode of the event can be detected by looking at the State of the + event. + + The end-user application can use the event to drop it's own allocated GL resources + when going to software mode. +*/ + +class QMeeGoSwitchEvent : public QEvent +{ +public: + + //! The state represented by this event. + enum State { + WillSwitch, + DidSwitch + }; + + //! Constructor for the event. + /*! + Creates a new event with the given name and the given state. + */ + QMeeGoSwitchEvent(const QString &graphicsSystemName, State s); + + //! Returns the name of the target graphics system. + /*! + Depending on the state, the name represents the system we're about to swtich to, + or the system we just switched to. + */ + QString graphicsSystemName() const; + + //! Returns the state represented by this event. + State state() const; + + //! Returns the event type/number for QMeeGoSwitchEvent. + /*! + The type is registered on first access. Use this to detect incoming + QMeeGoSwitchEvents. + */ + QEvent::Type eventNumber(); + +private: + QString name; + State switchState; +}; diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 579f1ab..209c72f 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -155,7 +155,11 @@ void usage() qWarning(" -I <directory> ........................... prepend to the module import search path,"); qWarning(" display path if <directory> is empty"); qWarning(" -P <directory> ........................... prepend to the plugin search path"); +#if defined(Q_WS_MAC) + qWarning(" -no-opengl ............................... don't use a QGLWidget for the viewport"); +#else qWarning(" -opengl .................................. use a QGLWidget for the viewport"); +#endif qWarning(" -script <path> ........................... set the script to use"); qWarning(" -scriptopts <options>|help ............... set the script options to use"); @@ -370,8 +374,13 @@ static void parseCommandLineOptions(const QStringList &arguments) } else if (arg == "-translation") { if (lastArg) usage(); opts.translationFile = arguments.at(++i); +#if defined(Q_WS_MAC) + } else if (arg == "-no-opengl") { + opts.useGL = false; +#else } else if (arg == "-opengl") { opts.useGL = true; +#endif } else if (arg == "-qmlbrowser") { opts.useNativeFileBrowser = false; } else if (arg == "-warnings") { diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 78bc409..7ea77d1 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -1012,7 +1012,7 @@ void QDeclarativeViewer::addPluginPath(const QString& plugin) void QDeclarativeViewer::reload() { - open(currentFileOrUrl); + launch(currentFileOrUrl); } void QDeclarativeViewer::openFile() diff --git a/tools/shared/symbian/epocroot.cpp b/tools/shared/symbian/epocroot.cpp index ae1dcb1..eabae98 100644 --- a/tools/shared/symbian/epocroot.cpp +++ b/tools/shared/symbian/epocroot.cpp @@ -39,13 +39,13 @@ ** ****************************************************************************/ -#include <iostream> - #include <QtCore/qdir.h> #include <QtCore/qxmlstream.h> -#include "epocroot.h" -#include "../windows/registry.h" +#include "epocroot_p.h" +#include "../windows/registry_p.h" + +QT_BEGIN_NAMESPACE // Registry key under which the location of the Symbian devices.xml file is // stored. @@ -64,35 +64,26 @@ // Stored as a static value in order to avoid unnecessary re-evaluation. static QString epocRootValue; -#ifdef QT_BUILD_QMAKE -std::ostream &operator<<(std::ostream &s, const QString &val) { - s << val.toLocal8Bit().data(); - return s; -} -#else -// Operator implemented in configureapp.cpp -std::ostream &operator<<(std::ostream &s, const QString &val); -#endif - -QString getDevicesXmlPath() +static QString getDevicesXmlPath() { // Note that the following call will return a null string on platforms other // than Windows. If support is required on other platforms for devices.xml, // an alternative mechanism for retrieving the location of this file will // be required. - return readRegistryKey(SYMBIAN_SDKS_REG_HANDLE, SYMBIAN_SDKS_REG_SUBKEY); + return qt_readRegistryKey(SYMBIAN_SDKS_REG_HANDLE, QLatin1String(SYMBIAN_SDKS_REG_SUBKEY)); } /** * Checks whether epocRootValue points to an existent directory. * If not, epocRootValue is set to an empty string and an error message is printed. */ -void checkEpocRootExists(const QString &source) +static void checkEpocRootExists(const QString &source) { if (!epocRootValue.isEmpty()) { QDir dir(epocRootValue); if (!dir.exists()) { - std::cerr << "Warning: " << source << " is set to an invalid path: " << epocRootValue << std::endl; + qWarning("Warning: %s is set to an invalid path: '%s'", qPrintable(source), + qPrintable(epocRootValue)); epocRootValue = QString(); } } @@ -103,32 +94,30 @@ void checkEpocRootExists(const QString &source) */ static void fixEpocRoot(QString &path) { - path.replace("\\", "/"); + path.replace(QLatin1Char('\\'), QLatin1Char('/')); - if (!path.size() || path[path.size()-1] != QChar('/')) { - path += QChar('/'); + if (!path.size() || path[path.size()-1] != QLatin1Char('/')) { + path += QLatin1Char('/'); } } /** * Determine the epoc root for the currently active SDK. */ -QString epocRoot() +QString qt_epocRoot() { if (epocRootValue.isEmpty()) { // 1. If environment variable EPOCROOT is set and points to an existent // directory, this is returned. - epocRootValue = qgetenv("EPOCROOT"); - checkEpocRootExists("EPOCROOT"); + epocRootValue = QString::fromLocal8Bit(qgetenv("EPOCROOT").constData()); + checkEpocRootExists(QLatin1String("EPOCROOT environment variable")); if (epocRootValue.isEmpty()) { // 2. The location of devices.xml is specified by a registry key. If this // file exists, it is parsed. QString devicesXmlPath = getDevicesXmlPath(); - if (devicesXmlPath.isEmpty()) { - std::cerr << "Error: Symbian SDK registry key not found" << std::endl; - } else { - devicesXmlPath += "/devices.xml"; + if (!devicesXmlPath.isEmpty()) { + devicesXmlPath += QLatin1String("/devices.xml"); QFile devicesFile(devicesXmlPath); if (devicesFile.open(QIODevice::ReadOnly)) { @@ -138,87 +127,90 @@ QString epocRoot() // 4. If a device element marked as default is found in devices.xml and its // epocroot value points to an existent directory, this is returned. - const QString epocDeviceValue = qgetenv("EPOCDEVICE"); + const QString epocDeviceValue = QString::fromLocal8Bit(qgetenv("EPOCDEVICE").constData()); bool epocDeviceFound = false; QXmlStreamReader xml(&devicesFile); while (!xml.atEnd()) { xml.readNext(); - if (xml.isStartElement() && xml.name() == "devices") { - if (xml.attributes().value("version") == "1.0") { - while (!(xml.isEndElement() && xml.name() == "devices") && !xml.atEnd()) { + if (xml.isStartElement() && xml.name() == QLatin1String("devices")) { + if (xml.attributes().value(QLatin1String("version")) == QLatin1String("1.0")) { + while (!(xml.isEndElement() && xml.name() == QLatin1String("devices")) && !xml.atEnd()) { xml.readNext(); - if (xml.isStartElement() && xml.name() == "device") { - const bool isDefault = xml.attributes().value("default") == "yes"; - const QString id = xml.attributes().value("id").toString(); - const QString name = xml.attributes().value("name").toString(); - const QString alias = xml.attributes().value("alias").toString(); - bool epocDeviceMatch = (id + ":" + name) == epocDeviceValue; + if (xml.isStartElement() && xml.name() == QLatin1String("device")) { + const bool isDefault = xml.attributes().value(QLatin1String("default")) == QLatin1String("yes"); + const QString id = xml.attributes().value(QLatin1String("id")).toString(); + const QString name = xml.attributes().value(QLatin1String("name")).toString(); + const QString alias = xml.attributes().value(QLatin1String("alias")).toString(); + bool epocDeviceMatch = QString(id + QLatin1String(":") + name) == epocDeviceValue; if (!alias.isEmpty()) epocDeviceMatch |= alias == epocDeviceValue; epocDeviceFound |= epocDeviceMatch; if((epocDeviceValue.isEmpty() && isDefault) || epocDeviceMatch) { // Found a matching device - while (!(xml.isEndElement() && xml.name() == "device") && !xml.atEnd()) { + while (!(xml.isEndElement() && xml.name() == QLatin1String("device")) && !xml.atEnd()) { xml.readNext(); - if (xml.isStartElement() && xml.name() == "epocroot") { + if (xml.isStartElement() && xml.name() == QLatin1String("epocroot")) { epocRootValue = xml.readElementText(); const QString deviceSource = epocDeviceValue.isEmpty() - ? "default device" - : "EPOCDEVICE (" + epocDeviceValue + ")"; + ? QLatin1String("default device") + : QString(QLatin1String("EPOCDEVICE (") + epocDeviceValue + QLatin1String(")")); checkEpocRootExists(deviceSource); } } if (epocRootValue.isEmpty()) - xml.raiseError("No epocroot element found"); + xml.raiseError(QLatin1String("No epocroot element found")); } } } } else { - xml.raiseError("Invalid 'devices' element version"); + xml.raiseError(QLatin1String("Invalid 'devices' element version")); } } } if (xml.hasError()) { - std::cerr << "Error: \"" << xml.errorString() << "\" when parsing devices.xml" << std::endl; + qWarning("Warning: Error \"%s\" when parsing devices.xml", + qPrintable(xml.errorString())); } else { if (epocRootValue.isEmpty()) { if (!epocDeviceValue.isEmpty()) { if (epocDeviceFound) { - std::cerr << "Error: missing or invalid epocroot attribute " - << "in device '" << epocDeviceValue << "'"; + qWarning("Warning: Missing or invalid epocroot attribute in device '%s' in devices.xml.", + qPrintable(epocDeviceValue)); } else { - std::cerr << "Error: no device matching EPOCDEVICE (" - << epocDeviceValue << ")"; + qWarning("Warning: No device matching EPOCDEVICE (%s) in devices.xml.", + qPrintable(epocDeviceValue)); } } else { if (epocDeviceFound) { - std::cerr << "Error: missing or invalid epocroot attribute " - << "in default device"; + qWarning("Warning: Missing or invalid epocroot attribute in default device in devices.xml."); } else { - std::cerr << "Error: no default device"; + qWarning("Warning: No default device set in devices.xml."); } } - std::cerr << " found in devices.xml file." << std::endl; } } } else { - std::cerr << "Error: could not open file " << devicesXmlPath << std::endl; + qWarning("Warning: Could not open file: '%s'.", qPrintable(devicesXmlPath)); } } } if (epocRootValue.isEmpty()) { // 5. An empty string is returned. - std::cerr << "Error: failed to find epoc root" << std::endl - << "Either" << std::endl - << " 1. Set EPOCROOT environment variable to a valid value" << std::endl - << " or 2. Ensure that the HKEY_LOCAL_MACHINE\\" SYMBIAN_SDKS_REG_SUBKEY - " registry key is set, and then" << std::endl - << " a. Set EPOCDEVICE environment variable to a valid device" << std::endl - << " or b. Specify a default device in the devices.xml file." << std::endl; + qWarning("Warning: failed to resolve epocroot." +#ifdef Q_OS_WIN32 + "\nEither\n" + " 1. Set EPOCROOT environment variable to a valid value.\n" + " or 2. Ensure that the HKEY_LOCAL_MACHINE\\" SYMBIAN_SDKS_REG_SUBKEY + " registry key is set, and then\n" + " a. Set EPOCDEVICE environment variable to a valid device\n" + " or b. Specify a default device in the devices.xml file."); +#else + " Set EPOCROOT environment variable to a valid value."); +#endif } else { fixEpocRoot(epocRootValue); } @@ -227,3 +219,4 @@ QString epocRoot() return epocRootValue; } +QT_END_NAMESPACE diff --git a/tools/shared/symbian/epocroot.pri b/tools/shared/symbian/epocroot.pri new file mode 100644 index 0000000..f0f0dab --- /dev/null +++ b/tools/shared/symbian/epocroot.pri @@ -0,0 +1,11 @@ +# Epocroot resolving is only required for tools, so omit it from all mobile/embedded builds +!symbian:!wince*:!embedded { +HEADERS += \ + $$QT_SOURCE_TREE/tools/shared/symbian/epocroot_p.h \ + $$QT_SOURCE_TREE/tools/shared/windows/registry_p.h +SOURCES += \ + $$QT_SOURCE_TREE/tools/shared/symbian/epocroot.cpp \ + $$QT_SOURCE_TREE/tools/shared/windows/registry.cpp +INCLUDEPATH += $$QT_SOURCE_TREE/tools/shared +DEFINES += QLIBRARYINFO_EPOCROOT +} diff --git a/tools/shared/symbian/epocroot.h b/tools/shared/symbian/epocroot_p.h index 9846485..c97b593 100644 --- a/tools/shared/symbian/epocroot.h +++ b/tools/shared/symbian/epocroot_p.h @@ -39,11 +39,24 @@ ** ****************************************************************************/ -#ifndef SYMBIAN_EPOCROOT_H -#define SYMBIAN_EPOCROOT_H +#ifndef QT_SYMBIAN_EPOCROOT_H +#define QT_SYMBIAN_EPOCROOT_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// #include <QtCore/qstring.h> +QT_BEGIN_NAMESPACE + /** * Determine the epoc root for the currently active SDK. * @@ -62,6 +75,9 @@ * Any return value other than the empty string therefore is guaranteed to * point to an existent directory. */ -QString epocRoot(); +QString qt_epocRoot(); + +QT_END_NAMESPACE + +#endif // QT_SYMBIAN_EPOCROOT_H -#endif // EPOCROOT_H diff --git a/tools/shared/windows/registry.cpp b/tools/shared/windows/registry.cpp index 67d9b56..48e9ae6 100644 --- a/tools/shared/windows/registry.cpp +++ b/tools/shared/windows/registry.cpp @@ -40,8 +40,11 @@ ****************************************************************************/ #include <QtCore/qstringlist.h> -#include "registry.h" +#include "registry_p.h" +QT_BEGIN_NAMESPACE + +#ifdef Q_OS_WIN32 /*! Returns the path part of a registry key. e.g. @@ -73,12 +76,13 @@ static QString keyName(const QString &rKey) return rKey; QString res(rKey.mid(idx + 1)); - if (res == "Default" || res == ".") - res = ""; + if (res == QLatin1String("Default") || res == QLatin1String(".")) + res = QString(); return res; } +#endif -QString readRegistryKey(HKEY parentHandle, const QString &rSubkey) +QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey) { QString result; @@ -128,7 +132,7 @@ QString readRegistryKey(HKEY parentHandle, const QString &rSubkey) break; l.append(s); } - result = l.join(", "); + result = l.join(QLatin1String(", ")); break; } @@ -158,4 +162,5 @@ QString readRegistryKey(HKEY parentHandle, const QString &rSubkey) return result; } +QT_END_NAMESPACE diff --git a/tools/shared/windows/registry.h b/tools/shared/windows/registry_p.h index 3896527..4aae5f9 100644 --- a/tools/shared/windows/registry.h +++ b/tools/shared/windows/registry_p.h @@ -39,8 +39,21 @@ ** ****************************************************************************/ -#ifndef WINDOWS_REGISTRY_H -#define WINDOWS_REGISTRY_H +#ifndef QT_WINDOWS_REGISTRY_H +#define QT_WINDOWS_REGISTRY_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_NAMESPACE #include <QtCore/qglobal.h> @@ -59,6 +72,9 @@ * if this code is compiled for a platform other than Windows), a null * string is returned. */ -QString readRegistryKey(HKEY parentHandle, const QString &rSubkey); +QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey); + +QT_END_NAMESPACE + +#endif // QT_WINDOWS_REGISTRY_H -#endif // WINDOWS_REGISTRY_H |