[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdevelop/lib/plugins/vcs/cvs
From:       Robert Gruber <rgruber () users ! sourceforge ! net>
Date:       2007-04-29 14:22:24
Message-ID: 1177856544.128417.26372.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 659122 by rgruber:

Allow to override the default communication mode for CvsJobs


 M  +9 -3      cvsjob.cpp  
 M  +13 -2     cvsjob.h  


--- trunk/KDE/kdevelop/lib/plugins/vcs/cvs/cvsjob.cpp #659121:659122
@@ -21,12 +21,11 @@
 #include <QStringList>
 #include <KDebug>
 #include <KLocale>
-#include <K3Process>
 
 
 struct CvsJob::Private
 {
-    Private() : isRunning(false)
+    Private() : isRunning(false), commMode(K3Process::AllOutput)
     {
         childproc = new K3Process;
         childproc->setUseShell(true, "/bin/sh");
@@ -39,6 +38,7 @@
     QString     directory;
     bool        isRunning;
     QString     outputLines;
+    K3Process::Communication commMode;
 };
 
 
@@ -152,10 +152,16 @@
 
     d->outputLines.clear();
     d->isRunning = true;
-    d->childproc->start(K3Process::NotifyOnExit, K3Process::AllOutput);
+    d->childproc->start(K3Process::NotifyOnExit, d->commMode);
 }
 
 
+void CvsJob::setCommunicationMode(K3Process::Communication comm)
+{
+    d->commMode = comm;
+}
+
+
 void CvsJob::cancel()
 {
     d->childproc->kill();
--- trunk/KDE/kdevelop/lib/plugins/vcs/cvs/cvsjob.h #659121:659122
@@ -19,9 +19,8 @@
 
 #include <QStringList>
 #include <KJob>
+#include <K3Process>
 
-class K3Process;
-
 /**
  * This class is capable of running our cvs commands 
  * Connect to Kjob::result(KJob*) to be notified when the job finished.
@@ -45,10 +44,22 @@
 
     /**
      * Call this mehod to start this job.
+     * @note Default communiaction mode is K3Process::AllOutput.
+     * @see Use setCommunicationMode() to override the default communication mode.
      */
     virtual void start();
 
     /**
+     * In some cases it's needed to specify the communisation mode between the 
+     * process and the job object. This is for instance done for the "cvs status"
+     * command. If stdout and stderr are processed as separate streams their signals
+     * do not always get emmited in correct order by K3Process. Which will lead to a 
+     * screwed up ouput.
+     * @note Default communiaction mode is K3Process::AllOutput.
+     */
+    void setCommunicationMode(K3Process::Communication comm);
+
+    /**
      * @return The command that is executed when calling start()
      */
     QString cvsCommand() const;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic