Changeset View
Changeset View
Standalone View
Standalone View
man/kio_man.cpp
Show First 20 Lines • Show All 666 Lines • ▼ Show 20 Line(s) | 661 | { | |||
---|---|---|---|---|---|
667 | { | 667 | { | ||
668 | error(KIO::ERR_MALFORMED_URL, url.url()); | 668 | error(KIO::ERR_MALFORMED_URL, url.url()); | ||
669 | return; | 669 | return; | ||
670 | } | 670 | } | ||
671 | 671 | | |||
672 | qCDebug(KIO_MAN_LOG) << "URL " << url.url() << " parsed to title='" << title << "' section=" << section; | 672 | qCDebug(KIO_MAN_LOG) << "URL " << url.url() << " parsed to title='" << title << "' section=" << section; | ||
673 | 673 | | |||
674 | UDSEntry entry; | 674 | UDSEntry entry; | ||
675 | entry.reserve(3); | ||||
675 | entry.fastInsert(KIO::UDSEntry::UDS_NAME, title); | 676 | entry.fastInsert(KIO::UDSEntry::UDS_NAME, title); | ||
676 | entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG); | 677 | entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG); | ||
677 | entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, QString::fromLatin1("text/html")); | 678 | entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, QString::fromLatin1("text/html")); | ||
678 | 679 | | |||
679 | #if 0 // not useful, is it? | 680 | #if 0 // not useful, is it? | ||
680 | QString newUrl = "man:"+title; | 681 | QString newUrl = "man:"+title; | ||
681 | if (!section.isEmpty()) | 682 | if (!section.isEmpty()) | ||
682 | newUrl += QString("(%1)").arg(section); | 683 | newUrl += QString("(%1)").arg(section); | ||
▲ Show 20 Lines • Show All 693 Lines • ▼ Show 20 Line(s) | 1375 | if (!title.isEmpty() && title != "/") { | |||
1376 | return; | 1377 | return; | ||
1377 | } | 1378 | } | ||
1378 | 1379 | | |||
1379 | UDSEntryList uds_entry_list; | 1380 | UDSEntryList uds_entry_list; | ||
1380 | 1381 | | |||
1381 | if (section.isEmpty()) { | 1382 | if (section.isEmpty()) { | ||
1382 | for (QStringList::ConstIterator it = section_names.constBegin(); it != section_names.constEnd(); ++it) { | 1383 | for (QStringList::ConstIterator it = section_names.constBegin(); it != section_names.constEnd(); ++it) { | ||
1383 | UDSEntry uds_entry; | 1384 | UDSEntry uds_entry; | ||
1385 | uds_entry.reserve(3); | ||||
1384 | 1386 | | |||
1385 | QString name = "man:/(" + *it + ')'; | 1387 | QString name = "man:/(" + *it + ')'; | ||
1386 | uds_entry.fastInsert( KIO::UDSEntry::UDS_NAME, sectionName( *it ) ); | 1388 | uds_entry.fastInsert( KIO::UDSEntry::UDS_NAME, sectionName( *it ) ); | ||
1387 | uds_entry.fastInsert( KIO::UDSEntry::UDS_URL, name ); | 1389 | uds_entry.fastInsert( KIO::UDSEntry::UDS_URL, name ); | ||
1388 | uds_entry.fastInsert( KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR ); | 1390 | uds_entry.fastInsert( KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR ); | ||
1389 | 1391 | | |||
1390 | uds_entry_list.append( uds_entry ); | 1392 | uds_entry_list.append( uds_entry ); | ||
1391 | } | 1393 | } | ||
1392 | } | 1394 | } | ||
1393 | 1395 | | |||
1394 | QStringList list = findPages( section, QString(), false ); | 1396 | QStringList list = findPages( section, QString(), false ); | ||
1395 | 1397 | | |||
1396 | QStringList::Iterator it = list.begin(); | 1398 | QStringList::Iterator it = list.begin(); | ||
1397 | QStringList::Iterator end = list.end(); | 1399 | QStringList::Iterator end = list.end(); | ||
1398 | 1400 | | |||
1399 | for ( ; it != end; ++it ) { | 1401 | for ( ; it != end; ++it ) { | ||
1400 | stripExtension( &(*it) ); | 1402 | stripExtension( &(*it) ); | ||
1401 | 1403 | | |||
1402 | UDSEntry uds_entry; | 1404 | UDSEntry uds_entry; | ||
1405 | uds_entry.reserve(3); | ||||
1403 | uds_entry.fastInsert(KIO::UDSEntry::UDS_NAME, *it); | 1406 | uds_entry.fastInsert(KIO::UDSEntry::UDS_NAME, *it); | ||
1404 | uds_entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG); | 1407 | uds_entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG); | ||
1405 | uds_entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, QString::fromLatin1("text/html")); | 1408 | uds_entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, QString::fromLatin1("text/html")); | ||
1406 | uds_entry_list.append( uds_entry ); | 1409 | uds_entry_list.append( uds_entry ); | ||
1407 | } | 1410 | } | ||
1408 | 1411 | | |||
1409 | listEntries( uds_entry_list ); | 1412 | listEntries( uds_entry_list ); | ||
1410 | finished(); | 1413 | finished(); | ||
Show All 21 Lines |