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

List:       kde-commits
Subject:    kdewebdev
From:       Keith Isdale <k_isdale () tpg ! com ! au>
Date:       2004-11-19 1:02:16
Message-ID: 20041119010216.C9EE816DB7 () office ! kde ! org
[Download RAW message or body]

CVS commit by isdale: 


Bug fix for KXSLDbg/xsldbg :
    Fault: No explanation displayed user why output command failed
    Fix: Strengthen preconitions for output command, be more verbose if the output \
command has/can fail 


  M +2 -2      doc/xsldbg/commands.docbook   1.2
  M +8 -13     kxsldbg/kxsldbgpart/xsldbgconfigimpl.cpp   1.13
  M +12 -5     kxsldbg/kxsldbgpart/libxsldbg/file_cmds.cpp   1.12


--- kdewebdev/doc/xsldbg/commands.docbook  #1.1:1.2
@@ -381,10 +381,10 @@
 
 <sect1 id="output_cmd"><title id="output_cmd.title">Output</title>
-<para>Specify the output file name</para>
+<para>Specify a local, writable file to be used for output of results</para>
 <para>Shortcut name : o</para>
 <table><title>Output usage</title>
 <tgroup cols="1">
 <tbody>
-<row><entry>output &lt;FILENAME&gt;&nbsp;&nbsp;&nbsp;&nbsp;<emphasis>(A local file \
name. Which can have a "~" prefix on *nix and CYGWIN platforms. Or environment \
variables under RISC OS)</emphasis></entry></row> +<row><entry>output \
&lt;FILENAME&gt;&nbsp;&nbsp;&nbsp;&nbsp;<emphasis>(A local writable file name. Which \
can have a "~" prefix on *nix and CYGWIN platforms. Or environment variables under \
RISC OS)</emphasis></entry></row>  <row><entry>output \
&lt;URI&gt;&nbsp;&nbsp;&nbsp;&nbsp;<emphasis>(The &lt;URI&gt; must only use the \
"file://" protocol. This is then converted to a file name suitable for the operating \
system)</emphasis></entry></row>  <row><entry>output \
-&nbsp;&nbsp;&nbsp;&nbsp;<emphasis>( Send to standard output. Must only be used when \
using xsldbg's command line prompt )</emphasis></entry></row>

--- kdewebdev/kxsldbg/kxsldbgpart/xsldbgconfigimpl.cpp  #1.12:1.13
@@ -472,9 +472,5 @@ void XsldbgConfigImpl::slotApply()
 {
 
-    if (1){
-        update();
-        return;
-    }else{
-        // TODO redundant code to be removed ?  
+    // Validate the users choices before applying it 
         QString msg;
         if (isValid(msg)){
@@ -487,5 +483,4 @@ void XsldbgConfigImpl::slotApply()
                     msg, QMessageBox::Ok);
         }
-    }
 }
 

--- kdewebdev/kxsldbg/kxsldbgpart/libxsldbg/file_cmds.cpp  #1.11:1.12
@@ -243,5 +243,8 @@ int xslDbgShellOutput(const xmlChar *arg
                              NULL);
       result = 1;
-    }else {
+    } else if (!xmlStrnCmp(arg, "ftp://", 6) || !xmlStrnCmp(arg, "http://", 7)){
+        xsldbgGenericErrorFunc(i18n("Error: Invalid arguments for the command \
%1.\n").arg("output")); +        return 0;
+    } else {
       /* assume that we were provided a local file name
        * that may need expanding 
@@ -249,9 +252,13 @@ int xslDbgShellOutput(const xmlChar *arg
       xmlChar *expandedName = filesExpandName(arg);
       
-      if (expandedName) {
-        optionsSetStringOption
-          (OPTIONS_OUTPUT_FILE_NAME, expandedName);
+      // The output file must not be the same as our SOURCE or DATA file
+      if (expandedName && 
+        (!xmlStrEqual(optionsGetStringOption(OPTIONS_SOURCE_FILE_NAME), \
expandedName)) && +        \
(!xmlStrEqual(optionsGetStringOption(OPTIONS_DATA_FILE_NAME), expandedName)) ){ +     \
optionsSetStringOption(OPTIONS_OUTPUT_FILE_NAME, expandedName);  \
xmlFree(expandedName);  result = 1;
+      }else{
+        xsldbgGenericErrorFunc(i18n("Error: Invalid arguments for the command \
%1.\n").arg("output"));  }
     }


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

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