diff options
| author | Peter Penz <[email protected]> | 2009-07-29 06:31:20 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2009-07-29 06:31:20 +0000 |
| commit | d4ba16b900782cbc5688e67b07de02abe1866c39 (patch) | |
| tree | 552c1d07b914062352b99e835c07de60037d6b1f /src/revisioncontrolplugin.cpp | |
| parent | 9eaecac01901d1d31171596cbd445bff44bcc635 (diff) | |
Use QProcess instead of the low-level API popen(). Thanks to André Wöbbeking for the hint.
svn path=/trunk/KDE/kdebase/apps/; revision=1004024
Diffstat (limited to 'src/revisioncontrolplugin.cpp')
| -rw-r--r-- | src/revisioncontrolplugin.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/revisioncontrolplugin.cpp b/src/revisioncontrolplugin.cpp index a5cfba5b9..3fc562eae 100644 --- a/src/revisioncontrolplugin.cpp +++ b/src/revisioncontrolplugin.cpp @@ -19,8 +19,6 @@ #include "revisioncontrolplugin.h" -#include <stdio.h> - RevisionControlPlugin::RevisionControlPlugin() { } @@ -35,15 +33,17 @@ RevisionControlPlugin::~RevisionControlPlugin() #include <kaction.h> #include <kdialog.h> +#include <kfileitem.h> #include <kicon.h> #include <klocale.h> #include <krun.h> #include <kshell.h> -#include <kfileitem.h> #include <kvbox.h> #include <QDir> #include <QLabel> +#include <QProcess> #include <QString> +#include <QStringList> #include <QTextEdit> #include <QTextStream> @@ -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]) { |
