Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/help/kio_help.cpp
Show All 28 Lines | |||||
29 | #include <KLocalizedString> | 29 | #include <KLocalizedString> | ||
30 | 30 | | |||
31 | #include <QDebug> | 31 | #include <QDebug> | ||
32 | 32 | | |||
33 | #include <QDir> | 33 | #include <QDir> | ||
34 | #include <QFileInfo> | 34 | #include <QFileInfo> | ||
35 | #include <QFile> | 35 | #include <QFile> | ||
36 | #include <QMimeDatabase> | 36 | #include <QMimeDatabase> | ||
37 | #include <QRegExp> | | |||
38 | #include <QStandardPaths> | 37 | #include <QStandardPaths> | ||
39 | #include <QUrl> | 38 | #include <QUrl> | ||
40 | 39 | | |||
41 | #include <libxslt/xsltutils.h> | 40 | #include <libxslt/xsltutils.h> | ||
42 | #include <libxslt/transform.h> | 41 | #include <libxslt/transform.h> | ||
43 | 42 | | |||
44 | using namespace KIO; | 43 | using namespace KIO; | ||
45 | 44 | | |||
▲ Show 20 Lines • Show All 249 Lines • ▼ Show 20 Line(s) | 293 | if (anchor.isEmpty() && url.hasFragment()) { | |||
295 | anchor = url.fragment(); | 294 | anchor = url.fragment(); | ||
296 | } | 295 | } | ||
297 | 296 | | |||
298 | //qDebug() << "anchor: " << anchor; | 297 | //qDebug() << "anchor: " << anchor; | ||
299 | 298 | | |||
300 | if (!anchor.isEmpty()) { | 299 | if (!anchor.isEmpty()) { | ||
301 | int index = 0; | 300 | int index = 0; | ||
302 | while (true) { | 301 | while (true) { | ||
303 | index = mParsed.indexOf(QRegExp(QStringLiteral("<a name=")), index); | 302 | index = mParsed.indexOf(QStringLiteral("<a name="), index); | ||
304 | if (index == -1) { | 303 | if (index == -1) { | ||
305 | //qDebug() << "no anchor\n"; | 304 | //qDebug() << "no anchor\n"; | ||
306 | break; // use whatever is the target, most likely index.html | 305 | break; // use whatever is the target, most likely index.html | ||
307 | } | 306 | } | ||
308 | 307 | | |||
309 | if (mParsed.mid(index, 11 + anchor.length()).toLower() == | 308 | if (mParsed.mid(index, 11 + anchor.length()).toLower() == | ||
310 | QStringLiteral("<a name=\"%1\">").arg(anchor)) { | 309 | QStringLiteral("<a name=\"%1\">").arg(anchor)) { | ||
311 | index = mParsed.lastIndexOf(QLatin1String("<FILENAME filename="), index) + | 310 | index = mParsed.lastIndexOf(QLatin1String("<FILENAME filename="), index) + | ||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |