Commit 34cefa0b authored by Nikita Sirgienko's avatar Nikita Sirgienko
Browse files

Move Cantor plugin path setting into Settings. Now user can manually change this path

parent 0e108c8b
......@@ -4,6 +4,8 @@
xsi:schemaLocation="https://www.kde.org/standards/kcfg/1.0
https://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<include>cantor_export.h</include>
<include>config-cantor.h</include>
<include>QUrl</include>
<kcfgfile/>
<group name="Cantor">
<entry name="DefaultBackend" type="String">
......@@ -54,6 +56,10 @@
<label>Limit of visible lines for text result</label>
<default>0</default>
</entry>
<entry name="PathToCantorPluginsDir" type="Url">
<label>Path to directory, which contains Cantor plugins (cantorpart and all backends)</label>
<default code="true">QUrl::fromLocalFile(QString::fromLocal8Bit(PATH_TO_CANTOR_PLUGINS))</default>
</entry>
</group>
</kcfg>
......@@ -31,6 +31,9 @@
#include <QUrl>
#include <QFileInfo>
#include <QDir>
#include <QDebug>
#include "settings.h"
static const char description[] =
I18N_NOOP("KDE Frontend to mathematical applications");
......@@ -39,14 +42,11 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
#ifdef PATH_TO_CANTOR_PLUGINS
// Add our custom plugins path, where we install our plugins, if it isn't default path
const QString& path = QString::fromLocal8Bit(PATH_TO_CANTOR_PLUGINS);
const QString& path = Settings::pathToCantorPluginsDir().toLocalFile();
qDebug() << "Adding additional application library path" << path;
if (!QCoreApplication::libraryPaths().contains(path))
QCoreApplication::addLibraryPath(path);
#else
qDebug() << "PATH_TO_CANTOR_PLUGINS variable is not set (probably a bug), so use the default library paths";
#endif
KCrash::initialize();
......
......@@ -148,6 +148,29 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox2">
<property name="title">
<string>Paths (advance settings)</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout2">
<item>
<widget class="QLabel" name="label2">
<property name="text">
<string>Path to Cantor plugin directory:</string>
</property>
</widget>
</item>
<item>
<widget class="KUrlRequester" name="kcfg_PathToCantorPluginsDir"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
......
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