Commit 90e40d47 authored by Jason Wood's avatar Jason Wood

Prevent KRender from continually trying to open a process if the url does not point to a file.

svn path=/branches/release-0_2_0/kdenlive/; revision=168
parent 63136a84
......@@ -15,13 +15,15 @@
* *
***************************************************************************/
#include <kio/netaccess.h>
#include "krender.h"
#include <kdebug.h>
KRender::KRender(KURL appPath, unsigned int port, QObject *parent, const char *name ) :
QObject(parent, name),
QXmlDefaultHandler()
QObject(parent, name),
QXmlDefaultHandler(),
m_appPathInvalid(false)
{
startTimer(200);
m_parsing = false;
......@@ -150,12 +152,19 @@ void KRender::processExited()
/** Launches a renderer process. */
void KRender::launchProcess()
{
if(m_appPathInvalid) return;
if(!KIO::NetAccess::exists(m_appPath)) {
kdError() << "Application '" << m_appPath.path() << "' does not exist" << endl;
m_appPathInvalid = true;
return;
}
m_process.clearArguments();
m_process.setExecutable("artsdsp");
m_process << m_appPath.path();
m_process << "-d";
m_process << "-p " + QString::number(m_portNum);
m_process << m_appPath.path();
m_process << "-d";
m_process << "-p" << QString::number(m_portNum);
kdDebug() << "Launching process " << m_appPath.path() << " as server on port " << m_portNum << endl;
if(m_process.start(KProcess::NotifyOnExit, KProcess::AllOutput)) {
......
......@@ -96,7 +96,7 @@ private: // Private attributes
/** The socket that will connect to the server */
QSocket m_socket;
/** If we have started our own renderer, this is it's process */
KProcess m_process;
KProcess m_process;
/** The port number used to connect to the renderer */
unsigned int m_portNum;
/** The XML reader */
......@@ -113,6 +113,9 @@ private: // Private attributes
QDomDocument m_sceneList;
/** Holds the buffered communication from the socket, ready for processing. */
QString m_buffer;
/** Becomes true if it is known that the application path does not point to a valid file, false if
this is unknown, or if a valid executable is known to exist */
bool m_appPathInvalid;
/** A function pointer to the relevant method that should parse tagOpen events */
bool (KRender::*m_funcStartElement)(const QString & namespaceURI, const QString & localName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment