Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Cantor
Commits
faacf1ce
Commit
faacf1ce
authored
Sep 04, 2020
by
Nikita Sirgienko
Browse files
[Python] Remove python server path from settings
parent
2acb346a
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/backends/python/pythonbackend.cpp
View file @
faacf1ce
...
...
@@ -99,7 +99,7 @@ KConfigSkeleton* PythonBackend::config() const
bool
PythonBackend
::
requirementsFullfilled
(
QString
*
const
reason
)
const
{
const
QString
&
path
=
PythonSettings
::
python
S
erver
Path
().
toLocalFile
(
);
const
QString
&
path
=
QStandardPaths
::
findExecutable
(
QLatin1String
(
"cantor_
python
s
erver
"
)
);
return
Cantor
::
Backend
::
checkExecutable
(
QLatin1String
(
"Cantor Python Server"
),
path
,
reason
);
}
...
...
src/backends/python/pythonbackend.kcfg
View file @
faacf1ce
...
...
@@ -6,10 +6,6 @@
<include>
QStandardPaths
</include>
<kcfgfile
name=
"cantorrc"
/>
<group
name=
"PythonBackend"
>
<entry
name=
"pythonServerPath"
type=
"Url"
>
<label>
Path to Cantor python server executable
</label>
<default
code=
"true"
>
QUrl::fromLocalFile(QStandardPaths::findExecutable(QLatin1String("cantor_pythonserver")))
</default>
</entry>
<entry
name=
"localDoc"
type=
"Url"
>
<label>
Url to the local Python documentation
</label>
</entry>
...
...
src/backends/python/pythonsession.cpp
View file @
faacf1ce
...
...
@@ -79,11 +79,12 @@ void PythonSession::login()
m_process
=
new
QProcess
(
this
);
m_process
->
setProcessChannelMode
(
QProcess
::
ForwardedErrorChannel
);
const
QString
&
serverExecutablePath
=
QStandardPaths
::
findExecutable
(
QLatin1String
(
"cantor_pythonserver"
));
#ifdef Q_OS_WIN
// On Windows QProcess can't handle paths with spaces, so add escaping
m_process
->
start
(
QLatin1String
(
"
\"
"
)
+
PythonSettings
::
pythonServerPath
().
toLocalFile
()
+
QLatin1String
(
"
\"
"
));
m_process
->
start
(
QLatin1String
(
"
\"
"
)
+
serverExecutablePath
+
QLatin1String
(
"
\"
"
));
#else
m_process
->
start
(
PythonSettings
::
pythonServerPath
().
toLocalFile
()
);
m_process
->
start
(
serverExecutablePath
);
#endif
m_process
->
waitForStarted
();
...
...
src/backends/python/settings.ui
View file @
faacf1ce
...
...
@@ -11,9 +11,6 @@
</rect>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"0"
column=
"3"
>
<widget
class=
"KUrlRequester"
name=
"kcfg_pythonServerPath"
/>
</item>
<item
row=
"1"
column=
"3"
>
<widget
class=
"KUrlRequester"
name=
"kcfg_localDoc"
>
<property
name=
"toolTip"
>
...
...
@@ -155,13 +152,6 @@
</property>
</spacer>
</item>
<item
row=
"0"
column=
"0"
colspan=
"3"
>
<widget
class=
"QLabel"
name=
"label3"
>
<property
name=
"text"
>
<string>
Executable:
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
colspan=
"3"
>
<widget
class=
"QLabel"
name=
"label2"
>
<property
name=
"toolTip"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment