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

List:       kde-commits
Subject:    branches/kdepim/enterprise4/kdepimlibs/qgpgme
From:       Christoph Schleifenbaum <christoph () kdab ! net>
Date:       2010-10-26 14:56:45
Message-ID: 20101026145645.81977AC897 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1189985 by cschleifenbaum:

Say no to Read when the QIODevice is a QProcess having stdErr as read channel


 M  +7 -1      dataprovider.cpp  


--- branches/kdepim/enterprise4/kdepimlibs/qgpgme/dataprovider.cpp #1189984:1189985
@@ -144,8 +144,14 @@
 QIODeviceDataProvider::~QIODeviceDataProvider() {}
 
 bool QIODeviceDataProvider::isSupported( Operation op ) const {
+    const QProcess* const proc = qobject_cast<QProcess*>( mIO.get() );
+    bool canRead = true;
+    if ( proc ) {
+        canRead = proc->readChannel() == QProcess::StandardOutput;
+    }
+
     switch ( op ) {
-    case Read:    return mIO->isReadable();
+    case Read:    return mIO->isReadable() && canRead;
     case Write:   return mIO->isWritable();
     case Seek:    return !mIO->isSequential();
     case Release: return true;
[prev in list] [next in list] [prev in thread] [next in thread] 

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