From d4ba16b900782cbc5688e67b07de02abe1866c39 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 29 Jul 2009 06:31:20 +0000 Subject: [PATCH] =?UTF-8?q?Use=20QProcess=20instead=20of=20the=20low-level?= =?UTF-8?q?=20API=20popen().=20Thanks=20to=20Andr=C3=A9=20W=C3=B6bbeking?= =?UTF-8?q?=20for=20the=20hint.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/KDE/kdebase/apps/; revision=1004024 --- src/revisioncontrolplugin.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/revisioncontrolplugin.cpp b/src/revisioncontrolplugin.cpp index a5cfba5b94..3fc562eae4 100644 --- a/src/revisioncontrolplugin.cpp +++ b/src/revisioncontrolplugin.cpp @@ -19,8 +19,6 @@ #include "revisioncontrolplugin.h" -#include - RevisionControlPlugin::RevisionControlPlugin() { } @@ -35,15 +33,17 @@ RevisionControlPlugin::~RevisionControlPlugin() #include #include +#include #include #include #include #include -#include #include #include #include +#include #include +#include #include #include @@ -101,14 +101,17 @@ bool SubversionPlugin::beginRetrieval(const QString& directory) { Q_ASSERT(directory.endsWith('/')); - const QString statusCommand = "svn status " + directory; - FILE* in = popen(statusCommand.toAscii().data(), "r"); - if (in == 0) { + QStringList arguments; + arguments << "status" << directory; + + QProcess process; + process.start("svn", arguments); + if (!process.waitForReadyRead()) { return false; } char buffer[1024]; - while (fgets(buffer, sizeof(buffer), in) != 0) { + while (process.readLine(buffer, sizeof(buffer)) > 0) { RevisionState state = NormalRevision; switch (buffer[0]) {