forked from qt-creator/qt-creator
ICore: Change some path API to use FilePath
Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -125,8 +125,7 @@ HelpManager *HelpManager::instance()
|
||||
|
||||
QString HelpManager::collectionFilePath()
|
||||
{
|
||||
return QDir::cleanPath(ICore::userResourcePath()
|
||||
+ QLatin1String("/helpcollection.qhc"));
|
||||
return ICore::userResourcePath().pathAppended("helpcollection.qhc").toString();
|
||||
}
|
||||
|
||||
void HelpManager::registerDocumentation(const QStringList &files)
|
||||
|
||||
@@ -189,14 +189,14 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
|
||||
HelpPluginPrivate::HelpPluginPrivate()
|
||||
{
|
||||
const QString &locale = ICore::userInterfaceLanguage();
|
||||
const QString locale = ICore::userInterfaceLanguage();
|
||||
if (!locale.isEmpty()) {
|
||||
auto qtr = new QTranslator(this);
|
||||
auto qhelptr = new QTranslator(this);
|
||||
const QString &creatorTrPath = ICore::resourcePath() + "/translations";
|
||||
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||
const QString &trFile = QLatin1String("assistant_") + locale;
|
||||
const QString &helpTrFile = QLatin1String("qt_help_") + locale;
|
||||
const QString creatorTrPath = ICore::resourcePath().pathAppended("translations").toString();
|
||||
const QString qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||
const QString trFile = QLatin1String("assistant_") + locale;
|
||||
const QString helpTrFile = QLatin1String("qt_help_") + locale;
|
||||
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
||||
QCoreApplication::installTranslator(qtr);
|
||||
if (qhelptr->load(helpTrFile, qtTrPath) || qhelptr->load(helpTrFile, creatorTrPath))
|
||||
|
||||
@@ -584,8 +584,9 @@ void MacWebKitHelpViewer::setHtml(const QString &html)
|
||||
{
|
||||
@autoreleasepool {
|
||||
[m_widget->webView().mainFrame
|
||||
loadHTMLString:html.toNSString()
|
||||
baseURL:[NSURL fileURLWithPath:Core::ICore::resourcePath().toNSString()]];
|
||||
loadHTMLString:html.toNSString()
|
||||
baseURL:[NSURL
|
||||
fileURLWithPath:Core::ICore::resourcePath().toString().toNSString()]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user