Changeset View
Changeset View
Standalone View
Standalone View
step/infobrowser.cc
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Line(s) | 147 | "<div id='doc_box-body' class='box-body'>\n" | |||
---|---|---|---|---|---|
148 | "<div class='info'><p>\n" | 148 | "<div class='info'><p>\n" | ||
149 | + i18n("No current object.") + | 149 | + i18n("No current object.") + | ||
150 | "</p></div>\n" | 150 | "</p></div>\n" | ||
151 | "</div>\n" | 151 | "</div>\n" | ||
152 | "</div>\n" | 152 | "</div>\n" | ||
153 | "</body></html>", fromHistory, url ); | 153 | "</body></html>", fromHistory, url ); | ||
154 | return; | 154 | return; | ||
155 | } | 155 | } | ||
156 | QString fileName = QStringLiteral(":/objectinfo/%1.html").arg(className.toLower()); | 156 | QString fileName = QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("objinfo/l10n/%1/%2.html").arg(QLocale::system().uiLanguages().at(0), className)); | ||
157 | if(fileName.isEmpty()) { | ||||
158 | fileName = QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("objinfo/%1.html").arg(className)); | ||||
159 | } | ||||
157 | if(!fileName.isEmpty()) { | 160 | if(!fileName.isEmpty()) { | ||
158 | QFile file(fileName); | 161 | QFile file(fileName); | ||
159 | if(file.open(QIODevice::ReadOnly | QIODevice::Text)) { | 162 | if(file.open(QIODevice::ReadOnly | QIODevice::Text)) { | ||
160 | setHtml(QString::fromUtf8(file.readAll()), fromHistory, url); | 163 | setHtml(QString::fromUtf8(file.readAll()), fromHistory, url); | ||
161 | return; | 164 | return; | ||
162 | } else { | 165 | } else { | ||
163 | qWarning() << "Could not open help file at location:" << fileName; | 166 | qWarning() << "Could not open help file at location:" << fileName; | ||
164 | } | 167 | } | ||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |