Changeset View
Changeset View
Standalone View
Standalone View
pythonstylechecking.cpp
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 61 | void StyleChecking::startChecker(const QString& text, const QString& select, | |||
---|---|---|---|---|---|
62 | const QString& ignore, const int maxLineLength) | 62 | const QString& ignore, const int maxLineLength) | ||
63 | { | 63 | { | ||
64 | // start up the server | 64 | // start up the server | ||
65 | if ( m_checkerProcess.state() == QProcess::NotRunning ) { | 65 | if ( m_checkerProcess.state() == QProcess::NotRunning ) { | ||
66 | auto python = Helper::getPythonExecutablePath(nullptr); | 66 | auto python = Helper::getPythonExecutablePath(nullptr); | ||
67 | auto serverPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kdevpythonsupport/codestyle.py"); | 67 | auto serverPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kdevpythonsupport/codestyle.py"); | ||
68 | if ( serverPath.isEmpty() ) { | 68 | if ( serverPath.isEmpty() ) { | ||
69 | qWarning() << "setup problem: codestyle.py not found"; | 69 | qWarning() << "setup problem: codestyle.py not found"; | ||
70 | m_mutex.unlock(); | ||||
70 | return; | 71 | return; | ||
71 | } | 72 | } | ||
72 | m_checkerProcess.start(python, {serverPath}); | 73 | m_checkerProcess.start(python, {serverPath}); | ||
73 | m_checkerProcess.waitForStarted(30); | 74 | m_checkerProcess.waitForStarted(30); | ||
74 | if ( m_checkerProcess.state() != QProcess::Running ) { | 75 | if ( m_checkerProcess.state() != QProcess::Running ) { | ||
75 | qWarning() << "failed to start code checker process"; | 76 | qWarning() << "failed to start code checker process"; | ||
77 | m_mutex.unlock(); | ||||
76 | return; | 78 | return; | ||
77 | } | 79 | } | ||
78 | } | 80 | } | ||
79 | 81 | | |||
80 | // send input | 82 | // send input | ||
81 | QByteArray data = text.toUtf8(); | 83 | QByteArray data = text.toUtf8(); | ||
82 | QByteArray header; | 84 | QByteArray header; | ||
83 | header.append(select.toUtf8()); | 85 | header.append(select.toUtf8()); | ||
▲ Show 20 Lines • Show All 126 Lines • Show Last 20 Lines |