devel/qcad qcad-assistant.patch,1.1,1.2

Gérard Milmeister (gemi) fedora-extras-commits at redhat.com
Sun Feb 20 23:28:48 UTC 2005


Author: gemi

Update of /cvs/extras/devel/qcad
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31394

Modified Files:
	qcad-assistant.patch 
Log Message:
Modified patch opening gnome-help instead of assistant if assistant not present


qcad-assistant.patch:

Index: qcad-assistant.patch
===================================================================
RCS file: /cvs/extras/devel/qcad/qcad-assistant.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- qcad-assistant.patch	14 Feb 2005 23:00:18 -0000	1.1
+++ qcad-assistant.patch	20 Feb 2005 23:28:46 -0000	1.2
@@ -1,7 +1,17 @@
 diff -Nur qcad-2.0.4.0-1.src-orig/qcad/src/qc_applicationwindow.cpp qcad-2.0.4.0-1.src/qcad/src/qc_applicationwindow.cpp
 --- qcad-2.0.4.0-1.src-orig/qcad/src/qc_applicationwindow.cpp	2004-09-14 22:13:07.000000000 +0200
-+++ qcad-2.0.4.0-1.src/qcad/src/qc_applicationwindow.cpp	2005-02-14 23:13:42.569182424 +0100
-@@ -2774,11 +2774,19 @@
++++ qcad-2.0.4.0-1.src/qcad/src/qc_applicationwindow.cpp	2005-02-15 19:21:39.559936344 +0100
+@@ -27,6 +27,9 @@
+ #include "qc_applicationwindow.h"
+ 
+ #include <fstream>
++#include <sys/types.h>
++#include <sys/wait.h>
++#include <unistd.h>
+ 
+ #include <qaccel.h>
+ #include <qaction.h>
+@@ -2774,11 +2777,40 @@
  #if QT_VERSION>=0x030200 
          assistant->setArguments(args);
  #endif
@@ -11,12 +21,33 @@
      //assistant->showPage("index.html");
  }
  
-+void QC_ApplicationWindow::slotAssistantError(const QString& msg) {
-+    QString tmpMsg = msg;
++void QC_ApplicationWindow::slotAssistantError(const QString&) {
 +    if ( !assistant->isOpen() ) {
-+        tmpMsg += "\n\nIf Qt Assistant is missing, you need to install the qt-devel package.";
++        pid_t pid;
++	if ( (pid = fork()) < 0 ) {
++	    perror( "fork" );
++	    QMessageBox::critical( this, QC_APPNAME, "Could not fork child process." );
++	    return;
++	}
++	if ( pid==0 ) {  // child
++  	    pid_t gcpid;
++	    if ( (gcpid = fork()) < 0 ) {
++	        perror( "fork" );
++		_exit(1);
++	    }
++	    if ( gcpid==0 ) {  // grandchild
++	        char* argv[] = { "gnome-open",
++				 "/usr/share/qcad/doc/cad/index.html",
++				 0
++		};
++		execvp( argv[0], argv);
++		perror( "execvp" );
++		_exit(1);
++	    }
++	    _exit(0);
++	}
++	// parent
 +    }
-+    QMessageBox::warning( this, QC_APPNAME, tmpMsg );
 +}
  
  




More information about the fedora-extras-commits mailing list