Commit 15694cdf authored by Minh Ngo's avatar Minh Ngo
Browse files

Refactoring Python backends.

Removing uneeded includes. Making code more cross-platform.
parent 050f5ae8
......@@ -18,8 +18,6 @@
Copyright (C) 2015 Minh Ngo <minh@fedoraproject.org>
*/
#include <unistd.h>
#include <QDebug>
#include <QApplication>
#include <QDBusError>
......@@ -39,7 +37,7 @@ int main(int argc, char *argv[])
return 1;
}
const QString& serviceName = QString::fromLatin1("org.kde.Cantor.Python3-%1").arg(getpid());
const QString& serviceName = QString::fromLatin1("org.kde.Cantor.Python3-%1").arg(app.applicationPid());
if (!QDBusConnection::sessionBus().registerService(serviceName))
{
......
......@@ -22,9 +22,6 @@
#include <Python.h>
#include <QDebug>
#include <QDBusConnection>
Python3Server::Python3Server(QObject* parent)
: QObject(parent)
{
......
......@@ -20,9 +20,6 @@
#include "python3session.h"
#include <signal.h>
#include <unistd.h>
#include <QDebug>
#include <QDBusConnection>
#include <QDBusInterface>
......@@ -72,7 +69,7 @@ void Python3Session::login()
const QString& serviceName = QString::fromLatin1("org.kde.Cantor.Python3-%1").arg(m_pProcess->pid());
m_pIface = new QDBusInterface(serviceName,
QString::fromAscii("/"), QString(), QDBusConnection::sessionBus());
QString::fromAscii("/"), QString(), QDBusConnection::sessionBus());
if (!m_pIface->isValid())
{
qWarning() << QDBusConnection::sessionBus().lastError().message();
......@@ -93,7 +90,7 @@ void Python3Session::logout()
void Python3Session::interrupt()
{
if (m_pProcess->pid())
kill(m_pProcess->pid(), 2);
m_pProcess->kill();
PythonSession::interrupt();
}
......
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