Commit 35a11471 authored by Mike Kremer's avatar Mike Kremer

Updated helpBrowser such that it can handle relative links.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5861 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c1e68a28
......@@ -28,7 +28,7 @@ FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
GENERATE_QHP = YES
QHP_NAMESPACE = "org.openflipper.simpleplugin"
QHP_NAMESPACE = "org.openflipper.plugin-simpleplugin"
QHP_VIRTUAL_FOLDER = "doc"
QCH_FILE = simpleplugin-doc.qch
QHG_LOCATION = qhelpgenerator
......
#ifndef QTHELP
/** \page coreplugins Core plugins
*
* OpenFlipper comes along with some core plugins that are already integrated.
......@@ -14,25 +12,4 @@
* - \ref simplesmoother-plugin "Simple Smoother Plugin"
* - \ref smoother-plugin "Smoother Plugin"
*
*/
#else
/** \page coreplugins Core plugins
*
* OpenFlipper comes along with some core plugins that are already integrated.
* These plugins provide the most basic functions like file reading and writing,
* some mesh transformation operations, data selection, etc.
*
* Here is an overview of the core plugins:
*
* - <a style="text-decoration:none;" href="qthelp://org.openflipper.datacontrolplugin/doc/main.html"><b>Data Control Plugin</b></a>
* - Decimater Plugin
* - Move Plugin
* - Data Control Plugin
* - Simple Smoother Plugin
* - Smoother Plugin
*
*/
#endif
\ No newline at end of file
*/
\ No newline at end of file
......@@ -32,6 +32,43 @@ QVariant HelpBrowser::loadResource (int /*_type*/, const QUrl& _url) {
return QVariant(helpEngine_->fileData(_url));
}
else if (_url.toString().contains("../../")) {
// Relative link
// So convert into qthelp-link
QStringList list = _url.toString().split("/");
QString base = "";
for(int i = 0; i < list.size(); i++) {
if(list[i].toLower().contains("plugin")) {
base = list[i].toLower();
break;
}
}
if(base != "") {
// Build new link
QStringList docDomains = helpEngine_->registeredDocumentations();
QString newUrl = "qthelp://";
// This gives org.openflipper
newUrl += docDomains[0].split(".")[0] + "." + docDomains[0].split(".")[1];
newUrl += "." + base + "/doc/" + list.last();
if((helpEngine_->findFile(newUrl)).isValid()) {
return QVariant(helpEngine_->fileData(newUrl));
}
return QVariant();
}
return QVariant();
}
else {
QUrl newUrl;
......
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