diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-26 10:54:38 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-26 10:54:38 +0100 |
commit | 564a28dacd5e9c6705e2b79cae88a7f037e257cc (patch) | |
tree | 0fa40ffe7b4fe18086fe3ff08b0089a5519a7370 | |
parent | 75ff4069a664117a5301814f7e831c262bb6b3e3 (diff) | |
parent | 9ca1e89e0d7e11b9db60d7fcf7399c655bd0e31e (diff) | |
download | qttools-564a28dacd5e9c6705e2b79cae88a7f037e257cc.tar.gz qttools-564a28dacd5e9c6705e2b79cae88a7f037e257cc.tar.bz2 qttools-564a28dacd5e9c6705e2b79cae88a7f037e257cc.zip |
Merge remote-tracking branch 'origin/release' into stable
Change-Id: Ief9594bded2d96bdd3fc6b0e033df4511181bf7c
-rw-r--r-- | src/androiddeployqt/main.cpp | 49 | ||||
-rw-r--r-- | src/assistant/help/qhelpdbreader.cpp | 1 | ||||
-rw-r--r-- | src/designer/src/components/widgetbox/widgetboxtreewidget.cpp | 2 | ||||
-rw-r--r-- | src/linguist/lupdate/cpp.cpp | 7 | ||||
-rw-r--r-- | src/linguist/lupdate/main.cpp | 36 | ||||
-rw-r--r-- | src/linguist/shared/qmakebuiltins.cpp | 58 | ||||
-rw-r--r-- | src/linguist/shared/qmakeevaluator.cpp | 79 | ||||
-rw-r--r-- | src/linguist/shared/qmakeevaluator.h | 1 | ||||
-rw-r--r-- | src/linguist/shared/qmakeglobals.h | 3 |
9 files changed, 155 insertions, 81 deletions
diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp index 8a5e8510..e6def623 100644 --- a/src/androiddeployqt/main.cpp +++ b/src/androiddeployqt/main.cpp @@ -1221,7 +1221,7 @@ bool readDependenciesFromElf(Options *options, return true; } -bool goodToCopy(const Options *options, const QString &file); +bool goodToCopy(const Options *options, const QString &file, QStringList *unmetDependencies); bool readDependencies(Options *options) { @@ -1248,13 +1248,17 @@ bool readDependencies(Options *options) QSet<QString>::iterator start = remainingDependencies.begin(); QString fileName = qtDir+*start; remainingDependencies.erase(start); - if (goodToCopy(options, fileName)) { + + QStringList unmetDependencies; + if (goodToCopy(options, fileName, &unmetDependencies)) { bool ok = readDependenciesFromElf(options, fileName, &usedDependencies, &remainingDependencies); if (!ok) return false; + } else if (options->verbose) { + fprintf(stdout, "Skipping %s due to unmet dependencies: %s\n", + qPrintable(fileName), + qPrintable(unmetDependencies.join(QLatin1Char(',')))); } - else if (options->verbose) - fprintf(stdout, "Skipping %s due to unmet dependencies\n", qPrintable(fileName)); } return true; } @@ -1412,16 +1416,20 @@ bool fetchRemoteModifications(Options *options, const QString &directory) return true; } -bool goodToCopy(const Options *options, const QString &file) +bool goodToCopy(const Options *options, const QString &file, QStringList *unmetDependencies) { if (!file.endsWith(QLatin1String(".so"))) return true; - foreach (const QString &lib, getQtLibsFromElf(*options, file)) - if (!options->qtDependencies.contains(lib)) - return false; + bool ret = true; + foreach (const QString &lib, getQtLibsFromElf(*options, file)) { + if (!options->qtDependencies.contains(lib)) { + ret = false; + unmetDependencies->append(lib); + } + } - return true; + return ret; } bool deployToLocalTmp(Options *options, @@ -1432,9 +1440,12 @@ bool deployToLocalTmp(Options *options, QFileInfo fileInfo(options->qtInstallDirectory + QLatin1Char('/') + qtDependency); - if (!goodToCopy(options, fileInfo.absoluteFilePath())) { + QStringList unmetDependencies; + if (!goodToCopy(options, fileInfo.absoluteFilePath(), &unmetDependencies)) { if (options->verbose) - fprintf(stdout, " -- Skipping %s. It has unmet dependencies.\n", qPrintable(fileInfo.absoluteFilePath())); + fprintf(stdout, " -- Skipping %s. It has unmet dependencies: %s.\n", + qPrintable(fileInfo.absoluteFilePath()), + qPrintable(unmetDependencies.join(QLatin1Char(',')))); return true; } @@ -1533,9 +1544,13 @@ bool copyQtFiles(Options *options) return false; } - if (!goodToCopy(options, sourceFileName)) { - if (options->verbose) - fprintf(stdout, " -- Skipping %s. It has unmet dependencies.\n", qPrintable(sourceFileName)); + QStringList unmetDependencies; + if (!goodToCopy(options, sourceFileName, &unmetDependencies)) { + if (options->verbose) { + fprintf(stdout, " -- Skipping %s. It has unmet dependencies: %s.\n", + qPrintable(sourceFileName), + qPrintable(unmetDependencies.join(QLatin1Char(',')))); + } continue; } @@ -1863,11 +1878,9 @@ bool signPackage(const Options &options) return false; } - if (options.verbose) - zipAlignTool += QLatin1String(" -v"); - - zipAlignTool = QString::fromLatin1("\"%1\" -f 4 %2 %3") + zipAlignTool = QString::fromLatin1("\"%1\"%2 -f 4 %3 %4") .arg(zipAlignTool) + .arg(options.verbose ? QString::fromLatin1(" -v") : QString()) .arg(options.outputDirectory + QLatin1String("/bin/") + apkName(options) diff --git a/src/assistant/help/qhelpdbreader.cpp b/src/assistant/help/qhelpdbreader.cpp index 41571052..6262dfed 100644 --- a/src/assistant/help/qhelpdbreader.cpp +++ b/src/assistant/help/qhelpdbreader.cpp @@ -90,6 +90,7 @@ bool QHelpDBReader::init() return false; QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), m_uniqueId); + db.setConnectOptions(QLatin1String("QSQLITE_OPEN_READONLY")); db.setDatabaseName(m_dbName); if (!db.open()) { /*: The placeholders are: %1 - The name of the database which cannot be opened diff --git a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp index 27326725..ccf73e76 100644 --- a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp +++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp @@ -111,7 +111,7 @@ WidgetBoxTreeWidget::WidgetBoxTreeWidget(QDesignerFormEditorInterface *core, QWi header()->hide(); header()->setSectionResizeMode(QHeaderView::Stretch); setTextElideMode(Qt::ElideMiddle); - setVerticalScrollMode(ScrollPerPixel); + setVerticalScrollMode(ScrollPerItem); setItemDelegate(new SheetDelegate(this, this)); diff --git a/src/linguist/lupdate/cpp.cpp b/src/linguist/lupdate/cpp.cpp index 6e6bab12..d3a22356 100644 --- a/src/linguist/lupdate/cpp.cpp +++ b/src/linguist/lupdate/cpp.cpp @@ -1413,7 +1413,6 @@ void CppParser::processInclude(const QString &file, ConversionData &cd, const QS parser.namespaces = namespaces; parser.functionContext = functionContext; parser.functionContextUnresolved = functionContextUnresolved; - parser.pendingContext = pendingContext; parser.setInput(ts, cleanFile); parser.setTranslator(tor); QStringList stack = includeStack; @@ -1423,6 +1422,9 @@ void CppParser::processInclude(const QString &file, ConversionData &cd, const QS CppFiles::setBlacklisted(cleanFile); } inclusions.remove(cleanFile); + + prospectiveContext.clear(); + pendingContext.clear(); } /* @@ -1610,6 +1612,9 @@ void CppParser::parseInternal(ConversionData &cd, const QStringList &includeStac bool yyTokColonSeen = false; // Start of c'tor's initializer list metaExpected = true; + prospectiveContext.clear(); + pendingContext.clear(); + yyWord.reserve(yyInStr.size()); // Rather insane. That's because we do no length checking. yyInPtr = (const ushort *)yyInStr.unicode(); yyCh = getChar(); diff --git a/src/linguist/lupdate/main.cpp b/src/linguist/lupdate/main.cpp index aa06e0b3..41eb7fbd 100644 --- a/src/linguist/lupdate/main.cpp +++ b/src/linguist/lupdate/main.cpp @@ -519,6 +519,25 @@ static void excludeProjects(const ProFileEvaluator &visitor, QStringList *subPro } } +static bool processTs(Translator &fetchedTor, const QString &file, ConversionData &cd) +{ + foreach (const Translator::FileFormat &fmt, Translator::registeredFileFormats()) { + if (file.endsWith(QLatin1Char('.') + fmt.extension, Qt::CaseInsensitive)) { + Translator tor; + if (tor.load(file, cd, fmt.extension)) { + foreach (TranslatorMessage msg, tor.messages()) { + msg.setType(TranslatorMessage::Unfinished); + msg.setTranslations(QStringList()); + msg.setTranslatorComment(QString()); + fetchedTor.extend(msg, cd); + } + } + return true; + } + } + return false; +} + static void processSources(Translator &fetchedTor, const QStringList &sourceFiles, ConversionData &cd) { @@ -544,7 +563,7 @@ static void processSources(Translator &fetchedTor, || it->endsWith(QLatin1String(".qs"), Qt::CaseInsensitive)) requireQmlSupport = true; #endif // QT_NO_QML - else + else if (!processTs(fetchedTor, *it, cd)) sourceFilesCpp << *it; } @@ -747,6 +766,7 @@ int main(int argc, char **argv) int proDebug = 0; int numFiles = 0; bool metTsFlag = false; + bool metXTsFlag = false; bool recursiveScan = true; QString extensions = m_defaultExtensions; @@ -847,6 +867,11 @@ int main(int argc, char **argv) return 0; } else if (arg == QLatin1String("-ts")) { metTsFlag = true; + metXTsFlag = false; + continue; + } else if (arg == QLatin1String("-xts")) { + metTsFlag = false; + metXTsFlag = true; continue; } else if (arg == QLatin1String("-extensions")) { ++i; @@ -948,6 +973,8 @@ int main(int argc, char **argv) } } numFiles++; + } else if (metXTsFlag) { + alienFiles += files; } else { foreach (const QString &file, files) { QFileInfo fi(file); @@ -999,17 +1026,10 @@ int main(int argc, char **argv) } } } else { - foreach (const Translator::FileFormat &fmt, Translator::registeredFileFormats()) { - if (file.endsWith(QLatin1Char('.') + fmt.extension, Qt::CaseInsensitive)) { - alienFiles << file; - goto gotfile; - } - } sourceFiles << QDir::cleanPath(fi.absoluteFilePath());; projectRoots.insert(fi.absolutePath() + QLatin1Char('/')); } } - gotfile: numFiles++; } } // for args diff --git a/src/linguist/shared/qmakebuiltins.cpp b/src/linguist/shared/qmakebuiltins.cpp index 1d09de2c..4bfe5c00 100644 --- a/src/linguist/shared/qmakebuiltins.cpp +++ b/src/linguist/shared/qmakebuiltins.cpp @@ -1596,11 +1596,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( } case T_CACHE: { if (args.count() > 3) { - evalError(fL1S("cache(var, [set|add|sub] [transient] [super], [srcvar]) requires one to three arguments.")); + evalError(fL1S("cache(var, [set|add|sub] [transient] [super|stash], [srcvar]) requires one to three arguments.")); return ReturnFalse; } bool persist = true; - bool super = false; + enum { TargetStash, TargetCache, TargetSuper } target = TargetCache; enum { CacheSet, CacheAdd, CacheSub } mode = CacheSet; ProKey srcvar; if (args.count() >= 2) { @@ -1609,7 +1609,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( if (m_tmp3 == QLatin1String("transient")) { persist = false; } else if (m_tmp3 == QLatin1String("super")) { - super = true; + target = TargetSuper; + } else if (m_tmp3 == QLatin1String("stash")) { + target = TargetStash; } else if (m_tmp3 == QLatin1String("set")) { mode = CacheSet; } else if (m_tmp3 == QLatin1String("add")) { @@ -1648,7 +1650,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( m_option->mutex.lock(); #endif QMakeBaseEnv *baseEnv = - m_option->baseEnvs.value(QMakeBaseKey(m_buildRoot, hostBuild)); + m_option->baseEnvs.value(QMakeBaseKey(m_buildRoot, m_stashfile, hostBuild)); #ifdef PROEVALUATOR_THREAD_SAFE // It's ok to unlock this before locking baseEnv, // as we have no intention to initialize the env. @@ -1681,21 +1683,23 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( removeEach(&newval, diffval); } if (oldval != newval) { - baseEval->valuesRef(dstvar) = newval; - if (super) { - do { - if (dstvar == QLatin1String("QMAKEPATH")) { - baseEval->m_qmakepath = newval.toQStringList(); - baseEval->updateMkspecPaths(); - } else if (dstvar == QLatin1String("QMAKEFEATURES")) { - baseEval->m_qmakefeatures = newval.toQStringList(); - } else { - break; - } - baseEval->updateFeaturePaths(); - if (hostBuild == m_hostBuild) - m_featureRoots = baseEval->m_featureRoots; - } while (false); + if (target != TargetStash || !m_stashfile.isEmpty()) { + baseEval->valuesRef(dstvar) = newval; + if (target == TargetSuper) { + do { + if (dstvar == QLatin1String("QMAKEPATH")) { + baseEval->m_qmakepath = newval.toQStringList(); + baseEval->updateMkspecPaths(); + } else if (dstvar == QLatin1String("QMAKEFEATURES")) { + baseEval->m_qmakefeatures = newval.toQStringList(); + } else { + break; + } + baseEval->updateFeaturePaths(); + if (hostBuild == m_hostBuild) + m_featureRoots = baseEval->m_featureRoots; + } while (false); + } } changed = true; } @@ -1726,16 +1730,16 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( varstr += QLatin1Char('\n'); } QString fn; - if (super) { + if (target == TargetSuper) { if (m_superfile.isEmpty()) { - m_superfile = m_outputDir + QLatin1String("/.qmake.super"); + m_superfile = QDir::cleanPath(m_outputDir + QLatin1String("/.qmake.super")); printf("Info: creating super cache file %s\n", qPrintable(m_superfile)); valuesRef(ProKey("_QMAKE_SUPER_CACHE_")) << ProString(m_superfile); } fn = m_superfile; - } else { + } else if (target == TargetCache) { if (m_cachefile.isEmpty()) { - m_cachefile = m_outputDir + QLatin1String("/.qmake.cache"); + m_cachefile = QDir::cleanPath(m_outputDir + QLatin1String("/.qmake.cache")); printf("Info: creating cache file %s\n", qPrintable(m_cachefile)); valuesRef(ProKey("_QMAKE_CACHE_")) << ProString(m_cachefile); // We could update m_{source,build}Root and m_featureRoots here, or even @@ -1745,6 +1749,14 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( // The sub-projects will find the new cache all by themselves. } fn = m_cachefile; + } else { + fn = m_stashfile; + if (fn.isEmpty()) + fn = QDir::cleanPath(m_outputDir + QLatin1String("/.qmake.stash")); + if (!m_vfs->exists(fn)) { + printf("Info: creating stash file %s\n", qPrintable(fn)); + valuesRef(ProKey("_QMAKE_STASH_")) << ProString(fn); + } } return writeFile(fL1S("cache "), fn, QIODevice::Append, varstr); } diff --git a/src/linguist/shared/qmakeevaluator.cpp b/src/linguist/shared/qmakeevaluator.cpp index e5715fa5..27075531 100644 --- a/src/linguist/shared/qmakeevaluator.cpp +++ b/src/linguist/shared/qmakeevaluator.cpp @@ -79,19 +79,19 @@ QT_BEGIN_NAMESPACE #define fL1S(s) QString::fromLatin1(s) -QMakeBaseKey::QMakeBaseKey(const QString &_root, bool _hostBuild) - : root(_root), hostBuild(_hostBuild) +QMakeBaseKey::QMakeBaseKey(const QString &_root, const QString &_stash, bool _hostBuild) + : root(_root), stash(_stash), hostBuild(_hostBuild) { } uint qHash(const QMakeBaseKey &key) { - return qHash(key.root) ^ (uint)key.hostBuild; + return qHash(key.root) ^ qHash(key.stash) ^ (uint)key.hostBuild; } bool operator==(const QMakeBaseKey &one, const QMakeBaseKey &two) { - return one.root == two.root && one.hostBuild == two.hostBuild; + return one.root == two.root && one.stash == two.stash && one.hostBuild == two.hostBuild; } QMakeBaseEnv::QMakeBaseEnv() @@ -1144,6 +1144,19 @@ bool QMakeEvaluator::prepareProject(const QString &inDir) dir = qdfi.path(); } + dir = m_outputDir; + forever { + QString stashfile = dir + QLatin1String("/.qmake.stash"); + if (dir == (!superdir.isEmpty() ? superdir : m_buildRoot) || m_vfs->exists(stashfile)) { + m_stashfile = QDir::cleanPath(stashfile); + break; + } + QFileInfo qdfi(dir); + if (qdfi.isRoot()) + break; + dir = qdfi.path(); + } + return true; } @@ -1193,23 +1206,18 @@ bool QMakeEvaluator::loadSpec() QMakeEvaluator evaluator(m_option, m_parser, m_vfs, m_handler); evaluator.m_sourceRoot = m_sourceRoot; evaluator.m_buildRoot = m_buildRoot; - if (!m_superfile.isEmpty()) { - valuesRef(ProKey("_QMAKE_SUPER_CACHE_")) << ProString(m_superfile); - if (evaluator.evaluateFile( - m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) - return false; + + if (!m_superfile.isEmpty() && evaluator.evaluateFile( + m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) { + return false; } - if (!m_conffile.isEmpty()) { - valuesRef(ProKey("_QMAKE_CONF_")) << ProString(m_conffile); - if (evaluator.evaluateFile( - m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) - return false; + if (!m_conffile.isEmpty() && evaluator.evaluateFile( + m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) { + return false; } - if (!m_cachefile.isEmpty()) { - valuesRef(ProKey("_QMAKE_CACHE_")) << ProString(m_cachefile); - if (evaluator.evaluateFile( - m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) - return false; + if (!m_cachefile.isEmpty() && evaluator.evaluateFile( + m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) { + return false; } if (qmakespec.isEmpty()) { if (!m_hostBuild) @@ -1243,19 +1251,31 @@ bool QMakeEvaluator::loadSpec() cool: m_qmakespec = QDir::cleanPath(qmakespec); - if (!m_superfile.isEmpty() - && evaluateFile(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) { - return false; + if (!m_superfile.isEmpty()) { + valuesRef(ProKey("_QMAKE_SUPER_CACHE_")) << ProString(m_superfile); + if (evaluateFile( + m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) + return false; } if (!loadSpecInternal()) return false; - if (!m_conffile.isEmpty() - && evaluateFile(m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) { - return false; + if (!m_conffile.isEmpty()) { + valuesRef(ProKey("_QMAKE_CONF_")) << ProString(m_conffile); + if (evaluateFile( + m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) + return false; } - if (!m_cachefile.isEmpty() - && evaluateFile(m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) { - return false; + if (!m_cachefile.isEmpty()) { + valuesRef(ProKey("_QMAKE_CACHE_")) << ProString(m_cachefile); + if (evaluateFile( + m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) + return false; + } + if (!m_stashfile.isEmpty() && m_vfs->exists(m_stashfile)) { + valuesRef(ProKey("_QMAKE_STASH_")) << ProString(m_stashfile); + if (evaluateFile( + m_stashfile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) + return false; } return true; } @@ -1334,7 +1354,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile( #ifdef PROEVALUATOR_THREAD_SAFE m_option->mutex.lock(); #endif - QMakeBaseEnv **baseEnvPtr = &m_option->baseEnvs[QMakeBaseKey(m_buildRoot, m_hostBuild)]; + QMakeBaseEnv **baseEnvPtr = &m_option->baseEnvs[QMakeBaseKey(m_buildRoot, m_stashfile, m_hostBuild)]; if (!*baseEnvPtr) *baseEnvPtr = new QMakeBaseEnv; QMakeBaseEnv *baseEnv = *baseEnvPtr; @@ -1361,6 +1381,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile( baseEval->m_superfile = m_superfile; baseEval->m_conffile = m_conffile; baseEval->m_cachefile = m_cachefile; + baseEval->m_stashfile = m_stashfile; baseEval->m_sourceRoot = m_sourceRoot; baseEval->m_buildRoot = m_buildRoot; baseEval->m_hostBuild = m_hostBuild; diff --git a/src/linguist/shared/qmakeevaluator.h b/src/linguist/shared/qmakeevaluator.h index c1ba65ea..0cb2ccfe 100644 --- a/src/linguist/shared/qmakeevaluator.h +++ b/src/linguist/shared/qmakeevaluator.h @@ -300,6 +300,7 @@ public: QString m_superfile; QString m_conffile; QString m_cachefile; + QString m_stashfile; QString m_sourceRoot; QString m_buildRoot; QStringList m_qmakepath; diff --git a/src/linguist/shared/qmakeglobals.h b/src/linguist/shared/qmakeglobals.h index 8fcffab1..6a7b4377 100644 --- a/src/linguist/shared/qmakeglobals.h +++ b/src/linguist/shared/qmakeglobals.h @@ -66,9 +66,10 @@ class QMakeEvaluator; class QMakeBaseKey { public: - QMakeBaseKey(const QString &_root, bool _hostBuild); + QMakeBaseKey(const QString &_root, const QString &_stash, bool _hostBuild); QString root; + QString stash; bool hostBuild; }; |