Skip to content

Commit

Permalink
Moving QProcess to pointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
fpoussin committed Jan 5, 2016
1 parent fbaac31 commit 94422d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions doxygenplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ bool DoxygenPlugin::initialize(const QStringList &arguments, QString *errorStrin
dox, SLOT(documentCurrentProject(DoxygenSettingsStruct)));

// Process connection for Doxygen
connect(&m_process, SIGNAL(finished(int,QProcess::ExitStatus)),
m_process = new QProcess();
connect(m_process, SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(processExited(int,QProcess::ExitStatus)));
connect(&m_process, SIGNAL(readyRead()),
connect(m_process, SIGNAL(readyRead()),
this, SLOT(readProcessOutput()));

return true;
Expand Down Expand Up @@ -308,13 +309,13 @@ void DoxygenPlugin::runDoxygen(const QStringList &arguments, QString workingDire
const QString outputText = tr("Executing: %1 %2\n").arg(executable).arg(DoxygenSettingsStruct::formatArguments(allArgs));
externalString(outputText);

m_process.close();
m_process.waitForFinished();
m_process->close();
m_process->waitForFinished();

m_process.setWorkingDirectory(workingDirectory);
m_process->setWorkingDirectory(workingDirectory);

m_process.start(executable, allArgs);
m_process.waitForStarted();
m_process->start(executable, allArgs);
m_process->waitForStarted();

return;
}
Expand All @@ -329,8 +330,8 @@ void DoxygenPlugin::processExited(int returnCode, QProcess::ExitStatus exitStatu
{
DoxygenResponse response;
response.error = true;
response.stdErr = m_process.readAllStandardError();
response.stdOut = m_process.readAllStandardOutput();
response.stdErr = m_process->readAllStandardError();
response.stdOut = m_process->readAllStandardOutput();
switch (exitStatus)
{
case QProcess::NormalExit:
Expand All @@ -348,7 +349,7 @@ void DoxygenPlugin::processExited(int returnCode, QProcess::ExitStatus exitStatu

void DoxygenPlugin::readProcessOutput()
{
externalString(m_process.readAll());
externalString(m_process->readAll());
}

DoxygenSettingsStruct DoxygenPlugin::settings() const
Expand Down
2 changes: 1 addition & 1 deletion doxygenplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class DoxygenPlugin : public ExtensionSystem::IPlugin
QAction* m_doxygenDocumentActiveProjectAction;
QAction* m_doxygenBuildDocumentationAction;
QAction* m_doxygenDoxyfileWizardAction;
QProcess m_process;
QProcess* m_process;

signals:
void doxyDocumentEntity(const DoxygenSettingsStruct &DoxySettings, Core::IEditor *editor);
Expand Down

0 comments on commit 94422d3

Please sign in to comment.