[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/runtime/kioslave/man
From: Michael Pyne <mpyne () purinchu ! net>
Date: 2008-08-22 3:43:02
Message-ID: 1219376582.600699.5834.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 850700 by mpyne:
Remove unnecessary path determinations in kio_man by using the help:/ kioslave
(this also means that the right path is selected in localized KDE environments
although no text is affected anyways). Also fix up the generated HTML.
M +1 -2 kio_man.cpp
M +0 -1 kio_man.h
M +14 -20 man2html.cpp
M +1 -2 man2html.h
--- trunk/KDE/kdebase/runtime/kioslave/man/kio_man.cpp #850699:850700
@@ -131,7 +131,6 @@
_self = this;
const QString common_dir = KGlobal::dirs()->findResourceDir( "html", "en/common/kde-default.css" );
const QString strPath=QString( "file:%1/en/common" ).arg( common_dir );
- m_htmlPath=strPath.toLocal8Bit(); // ### TODO encode for HTML
m_cssPath=strPath.toLocal8Bit(); // ### TODO encode for CSS
section_names << "1" << "2" << "3" << "3n" << "3p" << "4" << "5" << "6" << "7"
<< "8" << "9" << "l" << "n";
@@ -515,7 +514,7 @@
if (pageFound)
{
- setResourcePath(m_htmlPath,m_cssPath);
+ setResourcePath(m_cssPath);
setCssFile(m_manCSSFile);
m_outputBuffer.open(QIODevice::WriteOnly);
const QByteArray filename=QFile::encodeName(foundPages[0]);
--- trunk/KDE/kdebase/runtime/kioslave/man/kio_man.h #850699:850700
@@ -87,7 +87,6 @@
QString mySgml2RoffPath;
void getProgramPath();
- QByteArray m_htmlPath; ///< Path to KDE resources, encoded for HTML
QByteArray m_cssPath; ///< Path to KDE resources, encoded for CSS
QBuffer m_outputBuffer; ///< Buffer for the output
QByteArray m_manCSSFile; ///< Path to kio_man.css
--- trunk/KDE/kdebase/runtime/kioslave/man/man2html.cpp #850699:850700
@@ -631,13 +631,12 @@
static QList<char*> s_argumentList;
-static QByteArray htmlPath, cssPath, cssFile;
+static QByteArray cssPath, cssFile;
static QByteArray s_dollarZero; // Value of $0
-void setResourcePath(const QByteArray& _htmlPath, const QByteArray& _cssPath)
+void setResourcePath(const QByteArray& _cssPath)
{
- htmlPath=_htmlPath;
cssPath=_cssPath;
}
@@ -4083,9 +4082,8 @@
out_html( " Manpage</TITLE>\n");
// KDE defaults.
- out_html( "<link rel=\"stylesheet\" href=\"");
- out_html(htmlPath);
- out_html("/kde-default.css\" type=\"text/css\">\n" );
+ out_html( "<link rel=\"stylesheet\" href=\"help:/common/kde-default.css\"");
+ out_html( " type=\"text/css\">\n" );
// Output our custom stylesheet.
out_html( "<link rel=\"stylesheet\" href=\"");
@@ -4095,15 +4093,14 @@
// Some elements need background images, but this
// could not be included in the stylesheet,
// include it now.
- out_html("<style> #header_top { background-image: url(\"");
- out_html(htmlPath);
- out_html("/top.jpg\"); } #header_top div"
- " { background-image: url(\"");
- out_html(htmlPath);
- out_html("/top-left.jpg\"); } #header_top div div "
- "{ background-image: url(\"");
- out_html(htmlPath);
- out_html("/top-right.jpg\"); }</style>\n\n");
+ out_html("<style>\n#header_top { "
+ "background-image: url(\"help:/common/top.jpg\"); }\n\n"
+ "#header_top div { "
+ "background-image: url(\"help:/common/top-left.jpg\"); }\n\n"
+ "#header_top div div { "
+ "background-image: url(\"help:/common/top-right.jpg\"); }\n\n"
+ "</style>\n\n"
+ );
out_html( "<meta name=\"ROFF Type\" content=\"");
if (mandoc_command)
@@ -4115,11 +4112,9 @@
out_html( "</HEAD>\n\n" );
out_html("<BODY>\n\n" );
- out_html("<div id=\"header\"><div id=\"header_top\"\n");
+ out_html("<div id=\"header\"><div id=\"header_top\">\n");
out_html("<div><div>\n");
- out_html("<img src=\"");
- out_html(htmlPath);
- out_html("/top-kde.jpg\"> ");
+ out_html("<img src=\"help:/common/top-kde.jpg\"> ");
out_html( scan_troff(wordlist[0], 0, NULL ) );
out_html(" - KDE Man Page Viewer");
out_html("</div></div></div></div>\n");
@@ -5663,7 +5658,6 @@
#ifndef KIO_MAN_TEST
int main(int argc, char **argv)
{
- htmlPath = ".";
cssPath = ".";
if (argc < 2) {
std::cerr << "call: " << argv[0] << " <filename>\n";
--- trunk/KDE/kdebase/runtime/kioslave/man/man2html.h #850699:850700
@@ -17,12 +17,11 @@
/**
* Set the paths to KDE resources
*
- * \param htmlPath Path to the KDE resources, encoded for HTML
* \param cssPath Path to the KDE resources, encoded for CSS
* \since 3.5
*
*/
-extern void setResourcePath(const QByteArray& _htmlPath, const QByteArray& _cssPath);
+extern void setResourcePath(const QByteArray& _cssPath);
/*
* Sets the path to a CSS file that should be included with the generated
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic