forked from qt-creator/qt-creator
All: Replace deprecated QLibraryInfo::location
... by QLibraryInfo::path() which exists since 6.0 Change-Id: I0e1e071e0d279ddaf1f1027a0e6ce350ab21739a Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -647,7 +647,7 @@ int main(int argc, char **argv)
|
|||||||
for (QString locale : std::as_const(uiLanguages)) {
|
for (QString locale : std::as_const(uiLanguages)) {
|
||||||
locale = QLocale(locale).name();
|
locale = QLocale(locale).name();
|
||||||
if (translator.load("qtcreator_" + locale, creatorTrPath)) {
|
if (translator.load("qtcreator_" + locale, creatorTrPath)) {
|
||||||
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
const QString &qtTrPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
|
||||||
const QString &qtTrFile = QLatin1String("qt_") + locale;
|
const QString &qtTrFile = QLatin1String("qt_") + locale;
|
||||||
// Binary installer puts Qt tr files into creatorTrPath
|
// Binary installer puts Qt tr files into creatorTrPath
|
||||||
if (qtTranslator.load(qtTrFile, qtTrPath) || qtTranslator.load(qtTrFile, creatorTrPath)) {
|
if (qtTranslator.load(qtTrFile, qtTrPath) || qtTranslator.load(qtTrFile, creatorTrPath)) {
|
||||||
|
|||||||
@@ -399,7 +399,7 @@ static QString filled(const QString &s, int min)
|
|||||||
QString PluginManager::systemInformation()
|
QString PluginManager::systemInformation()
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
CommandLine qtDiag(FilePath::fromString(QLibraryInfo::location(QLibraryInfo::BinariesPath))
|
CommandLine qtDiag(FilePath::fromString(QLibraryInfo::path(QLibraryInfo::BinariesPath))
|
||||||
.pathAppended("qtdiag").withExecutableSuffix());
|
.pathAppended("qtdiag").withExecutableSuffix());
|
||||||
Process qtDiagProc;
|
Process qtDiagProc;
|
||||||
qtDiagProc.setCommand(qtDiag);
|
qtDiagProc.setCommand(qtDiag);
|
||||||
|
|||||||
@@ -114,9 +114,9 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent)
|
|||||||
qRegisterMetaType<QmlJS::PathsAndLanguages>("QmlJS::PathsAndLanguages");
|
qRegisterMetaType<QmlJS::PathsAndLanguages>("QmlJS::PathsAndLanguages");
|
||||||
|
|
||||||
m_defaultProjectInfo.qtQmlPath =
|
m_defaultProjectInfo.qtQmlPath =
|
||||||
FilePath::fromUserInput(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath));
|
FilePath::fromUserInput(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath));
|
||||||
m_defaultProjectInfo.qmllsPath = ModelManagerInterface::qmllsForBinPath(
|
m_defaultProjectInfo.qmllsPath = ModelManagerInterface::qmllsForBinPath(
|
||||||
FilePath::fromUserInput(QLibraryInfo::location(QLibraryInfo::BinariesPath)),
|
FilePath::fromUserInput(QLibraryInfo::path(QLibraryInfo::BinariesPath)),
|
||||||
QLibraryInfo::version());
|
QLibraryInfo::version());
|
||||||
m_defaultProjectInfo.qtVersionString = QLibraryInfo::version().toString();
|
m_defaultProjectInfo.qtVersionString = QLibraryInfo::version().toString();
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q)
|
|||||||
|
|
||||||
static bool hasQmFilesForLocale(const QString &locale, const QString &creatorTrPath)
|
static bool hasQmFilesForLocale(const QString &locale, const QString &creatorTrPath)
|
||||||
{
|
{
|
||||||
static const QString qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
static const QString qtTrPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
|
||||||
|
|
||||||
const QString trFile = QLatin1String("/qt_") + locale + QLatin1String(".qm");
|
const QString trFile = QLatin1String("/qt_") + locale + QLatin1String(".qm");
|
||||||
return QFile::exists(qtTrPath + trFile) || QFile::exists(creatorTrPath + trFile);
|
return QFile::exists(qtTrPath + trFile) || QFile::exists(creatorTrPath + trFile);
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ static QList<FilterRuleSpec> fetchOriginalRules()
|
|||||||
};
|
};
|
||||||
|
|
||||||
Utils::FilePath iniFile = Utils::FilePath::fromString(
|
Utils::FilePath iniFile = Utils::FilePath::fromString(
|
||||||
QLibraryInfo::location(QLibraryInfo::DataPath)).pathAppended("qtlogging.ini");
|
QLibraryInfo::path(QLibraryInfo::DataPath)).pathAppended("qtlogging.ini");
|
||||||
if (iniFile.exists())
|
if (iniFile.exists())
|
||||||
appendRulesFromFile(iniFile.toString());
|
appendRulesFromFile(iniFile.toString());
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void FormEditorPlugin::initialize()
|
|||||||
if (!locale.isEmpty()) {
|
if (!locale.isEmpty()) {
|
||||||
auto qtr = new QTranslator(this);
|
auto qtr = new QTranslator(this);
|
||||||
const QString creatorTrPath = ICore::resourcePath("translations").toString();
|
const QString creatorTrPath = ICore::resourcePath("translations").toString();
|
||||||
const QString qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
const QString qtTrPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
|
||||||
const QString trFile = "designer_" + locale;
|
const QString trFile = "designer_" + locale;
|
||||||
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
||||||
QCoreApplication::installTranslator(qtr);
|
QCoreApplication::installTranslator(qtr);
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ HelpPluginPrivate::HelpPluginPrivate()
|
|||||||
auto qtr = new QTranslator(this);
|
auto qtr = new QTranslator(this);
|
||||||
auto qhelptr = new QTranslator(this);
|
auto qhelptr = new QTranslator(this);
|
||||||
const QString creatorTrPath = ICore::resourcePath("translations").toString();
|
const QString creatorTrPath = ICore::resourcePath("translations").toString();
|
||||||
const QString qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
const QString qtTrPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
|
||||||
const QString trFile = QLatin1String("assistant_") + locale;
|
const QString trFile = QLatin1String("assistant_") + locale;
|
||||||
const QString helpTrFile = QLatin1String("qt_help_") + locale;
|
const QString helpTrFile = QLatin1String("qt_help_") + locale;
|
||||||
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ void PuppetEnvironmentBuilder::addImportPaths() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_availablePuppetType == PuppetType::Fallback)
|
if (m_availablePuppetType == PuppetType::Fallback)
|
||||||
importPaths.prepend(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath));
|
importPaths.prepend(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath));
|
||||||
|
|
||||||
constexpr auto pathSep = Utils::HostOsInfo::pathListSeparator();
|
constexpr auto pathSep = Utils::HostOsInfo::pathListSeparator();
|
||||||
m_environment.appendOrSet("QML2_IMPORT_PATH", importPaths.join(pathSep), pathSep);
|
m_environment.appendOrSet("QML2_IMPORT_PATH", importPaths.join(pathSep), pathSep);
|
||||||
|
|||||||
@@ -201,9 +201,9 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
|
|||||||
projectInfo.qmllsPath = ModelManagerInterface::qmllsForBinPath(qtVersion->hostBinPath(), v);
|
projectInfo.qmllsPath = ModelManagerInterface::qmllsForBinPath(qtVersion->hostBinPath(), v);
|
||||||
projectInfo.qtVersionString = qtVersion->qtVersionString();
|
projectInfo.qtVersionString = qtVersion->qtVersionString();
|
||||||
} else if (!activeKit || !activeKit->value(QtSupport::SuppliesQtQuickImportPath::id(), false).toBool()) {
|
} else if (!activeKit || !activeKit->value(QtSupport::SuppliesQtQuickImportPath::id(), false).toBool()) {
|
||||||
projectInfo.qtQmlPath = FilePath::fromUserInput(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath));
|
projectInfo.qtQmlPath = FilePath::fromUserInput(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath));
|
||||||
projectInfo.qmllsPath = ModelManagerInterface::qmllsForBinPath(
|
projectInfo.qmllsPath = ModelManagerInterface::qmllsForBinPath(
|
||||||
FilePath::fromUserInput(QLibraryInfo::location(QLibraryInfo::BinariesPath)), QLibraryInfo::version());
|
FilePath::fromUserInput(QLibraryInfo::path(QLibraryInfo::BinariesPath)), QLibraryInfo::version());
|
||||||
projectInfo.qtVersionString = QLatin1String(qVersion());
|
projectInfo.qtVersionString = QLatin1String(qVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ void QmlProfilerDetailsRewriterTest::seedRewriter()
|
|||||||
|
|
||||||
QmlJS::PathsAndLanguages lPaths;
|
QmlJS::PathsAndLanguages lPaths;
|
||||||
lPaths.maybeInsert(
|
lPaths.maybeInsert(
|
||||||
Utils::FilePath::fromString(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)),
|
Utils::FilePath::fromString(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath)),
|
||||||
QmlJS::Dialect::Qml);
|
QmlJS::Dialect::Qml);
|
||||||
QmlJS::ModelManagerInterface::importScan(QmlJS::ModelManagerInterface::workingCopy(),
|
QmlJS::ModelManagerInterface::importScan(QmlJS::ModelManagerInterface::workingCopy(),
|
||||||
lPaths, m_modelManager, false);
|
lPaths, m_modelManager, false);
|
||||||
|
|||||||
@@ -851,7 +851,7 @@ static inline QString fixComponentPathForIncompatibleQt(const QString &component
|
|||||||
if (componentPath.contains(importString)) {
|
if (componentPath.contains(importString)) {
|
||||||
int index = componentPath.indexOf(importString) + 8;
|
int index = componentPath.indexOf(importString) + 8;
|
||||||
const QString relativeImportPath = componentPath.right(componentPath.length() - index);
|
const QString relativeImportPath = componentPath.right(componentPath.length() - index);
|
||||||
QString fixedComponentPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath) + relativeImportPath;
|
QString fixedComponentPath = QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath) + relativeImportPath;
|
||||||
fixedComponentPath.replace(QLatin1Char('\\'), QLatin1Char('/'));
|
fixedComponentPath.replace(QLatin1Char('\\'), QLatin1Char('/'));
|
||||||
if (QFileInfo::exists(fixedComponentPath))
|
if (QFileInfo::exists(fixedComponentPath))
|
||||||
return fixedComponentPath;
|
return fixedComponentPath;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ void tst_Check::initTestCase()
|
|||||||
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
|
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
|
||||||
|
|
||||||
PathsAndLanguages lPaths;
|
PathsAndLanguages lPaths;
|
||||||
QStringList paths(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath));
|
QStringList paths(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath));
|
||||||
for (auto p: paths)
|
for (auto p: paths)
|
||||||
lPaths.maybeInsert(Utils::FilePath::fromString(p), Dialect::Qml);
|
lPaths.maybeInsert(Utils::FilePath::fromString(p), Dialect::Qml);
|
||||||
ModelManagerInterface::importScan(ModelManagerInterface::workingCopy(), lPaths,
|
ModelManagerInterface::importScan(ModelManagerInterface::workingCopy(), lPaths,
|
||||||
|
|||||||
Reference in New Issue
Block a user