Hi,

Am Samstag, 8. Dezember 2007 10:39 schrieb Michael Riepe:
> > But probably an empty string is returned anyhow if the keys have not been
> > not found...
>
> I guess it returns QString::null in that case if you don't specify a
> default.
>
> There is also an optional third argument (bool* ok) that one probably
> can use to detect missing keys, conversion errors and the like. But the
> documentation isn't very clear about the interaction between the second
> and third argument.

I would prefer the empty defaults since we anyhow have to check wether an user 
specified an empty string in his settings file!

The attached file (re)implements this... I'm sure you don't need it  but I 
anyhow wanted to send you a small patch which adds also an optional format 
option to the <expfile>-tag to be consistent with CLI! ;)

You remember? The tag Sven invented for automated project file creation
and which is only read but never written! 

One now can specify:

 <expfile path="/tmp/test.mpg" format="0" />

for DVD-compliant PS (which anyhow would be the default format for batch mode) 
but also:

 <expfile path="/tmp/dvd" format="4" />

to get a DVD-structure (without menus). 

BTW, just realized that it's also possible to write multi-titleset dvd's with 
format 4! The additional (unnecessary) postprocessing commands inbetween to 
create  the TOC don't do any harm! So one don't has to specify manually a 
(user) format 5 without post processing... :)

ciao
Ralph

PS: The other change just adds a missing initialization in the snapshot 
function (which had probabely no negative consequences before, but just in 
case...;))  

diff -Naur svn/ChangeLog r108-formattag/ChangeLog
--- svn/ChangeLog	2007-12-08 12:11:13.000000000 +0100
+++ r108-formattag/ChangeLog	2007-12-08 13:14:06.000000000 +0100
@@ -1,3 +1,10 @@
+2007-12-08  Ralph Glasstetter  <[EMAIL PROTECTED]>  (mr)
+        * src/dvbcut.cpp
+                Added format option to <expfile>-tag of project files
+
+        * src/settings.cpp
+                Empty defaults for pipe settings
+                
 2007-12-06  Ralph Glasstetter  <[EMAIL PROTECTED]>  (mr)
   
 	* src/settings.cpp
diff -Naur svn/src/dvbcut.cpp r108-formattag/src/dvbcut.cpp
--- svn/src/dvbcut.cpp	2007-12-08 12:11:13.000000000 +0100
+++ r108-formattag/src/dvbcut.cpp	2007-12-08 12:58:03.000000000 +0100
@@ -369,7 +369,7 @@
 
   QImage p;
   int pic, i, nr;
-  bool ok;
+  bool ok=false;
   for (std::vector<int>::iterator it = piclist.begin(); it != piclist.end(); ++it) {
 
     if(samples>1 && range>0)
@@ -1635,6 +1635,12 @@
 	      QString qs = e.attribute("path");
 	      if (!qs.isEmpty())
 		expfilename = (const char*)qs;
+	      qs = e.attribute("format");
+              bool okay=false;
+	      if (!qs.isEmpty()) {
+                int val = qs.toInt(&okay,0);
+		if(okay) exportformat = val;
+              }  
 	    }
 	  }
 	  // try old-style project file format
diff -Naur svn/src/settings.cpp r108-formattag/src/settings.cpp
--- svn/src/settings.cpp	2007-12-08 12:11:13.000000000 +0100
+++ r108-formattag/src/settings.cpp	2007-12-08 13:00:47.000000000 +0100
@@ -182,9 +182,9 @@
       pipe_format.push_back(format);
       QString key = "/" + QString::number(++i);
       beginGroup(key);
-	command = readEntry("/command");
-	post = readEntry("/post");
-	label = readEntry("/label");
+	command = readEntry("/command","");
+	post = readEntry("/post","");
+	label = readEntry("/label","");
 	format = readNumEntry("/format", 0);
       endGroup();	// key
     }
-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
DVBCUT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dvbcut-user

Reply via email to