Commit 6d47e158 authored by Jonathan Marten's avatar Jonathan Marten

man ioslave: Do not depend on Plasma for version numbers

The version numbers are only used for display to the user in specially
formatted KDE man pages.  Take them from the version of the kio-extras
package.

BUG:379593
parent 6be8b06a
......@@ -39,3 +39,9 @@
/* type to use in place of socklen_t if not defined */
#define kde_socklen_t socklen_t
/*
* Used for the "KDE" version string in generated man pages.
* Using the definition from this project so as to be independent of Plasma.
*/
#define KDE_VERSION_STRING "@PROJECT_VERSION@"
......@@ -143,7 +143,6 @@
# include <QTextDocument>
# include <QDebug>
# include <KLocalizedString>
# include <plasma_version.h>
# define BYTEARRAY(x) x
#endif
......@@ -294,7 +293,7 @@ static void InitStringDefinitions(void)
// \*S "Change to default font size"
#ifndef SIMPLE_MAN2HTML
// Special KDE KIO man:
const QByteArray kdeversion(PLASMA_VERSION_STRING);
const QByteArray kdeversion(KDE_VERSION_STRING);
s_stringDefinitionMap.insert(".KDE_VERSION_STRING", StringDefinition(kdeversion.length(), kdeversion));
#endif
}
......@@ -1510,14 +1509,18 @@ static int read_only_number_register(const QByteArray& name)
return s_nroff;
#ifndef SIMPLE_MAN2HTML
// Special KDE KIO man:
else if (name == ".KDE_VERSION_MAJOR")
return PLASMA_VERSION_MAJOR;
const QString version_string(KDE_VERSION_STRING);
const int version_major = version_string.section('.', 0, 0).toInt();
const int version_minor = version_string.section('.', 1, 1).toInt();
const int version_patch = version_string.section('.', 2, 2).toInt();
if (name == ".KDE_VERSION_MAJOR")
return version_major;
else if (name == ".KDE_VERSION_MINOR")
return PLASMA_VERSION_MINOR;
return version_minor;
else if (name == ".KDE_VERSION_RELEASE")
return PLASMA_VERSION_PATCH;
return version_patch;
else if (name == ".KDE_VERSION")
return PLASMA_VERSION;
return (version_major << 16) | (version_minor << 8) | version_patch;
#endif
else if ( name == ".T" )
return 0; // Set to 1 in nroff, if -T option used; always 0 in troff.
......@@ -6012,7 +6015,7 @@ void scan_man_page(const char *man_page)
output_real("Generated by kio_man");
#else
output_real("Generated by kio_man, KDE version ");
output_real(QString(PLASMA_VERSION_STRING).toHtmlEscaped().toLocal8Bit());
output_real(QString(KDE_VERSION_STRING).toHtmlEscaped().toLocal8Bit());
#endif
output_real("</div></div>\n\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment