Bug 130000

Summary: kpdf watch file option does not work with PS files
Product: [Applications] kpdf Reporter: Philip <pv+kde>
Component: generalAssignee: Albert Astals Cid <aacid>
Status: RESOLVED FIXED    
Severity: normal CC: rdieter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Philip 2006-06-29 02:27:03 UTC
Version:            (using KDE KDE 3.5.3)
Installed from:    Fedora RPMs
Compiler:          used yum/rpms to install/update 
OS:                Linux

Hi, watch file works with KDE 3.5.3. .fc4 
but not with KDE 3.5.3-0.2.fc5.

kghostview manages to update with changed files so the watch file infrastructure is functional.

Test: have 1.ps and 2.ps
cp 1.ps a.ps
kpdf a.ps &
cp 2.ps a.ps
cp 1.ps a.ps 
cp 2.ps a.ps 

and notice no changes occur between the overwrites.
Comment 1 Albert Astals Cid 2006-06-29 19:14:36 UTC
You should file that bug against Fedora packagers, that is, in Fedora bug system, because we do not create packages and you are using 3.5.3 in both fc4 and fc5, so that is not a kpdf fault.
Comment 2 Rex Dieter 2006-06-30 03:28:49 UTC
I take it then, Albert, the feature works for you?
Comment 3 Albert Astals Cid 2006-07-01 00:06:33 UTC
well if he says it works for him in KDE 3.5.3.fc4 and not in KDE 3.5.3-0.2.fc5 it should be a packaging bug, no?
Comment 4 Albert Astals Cid 2006-07-01 00:15:54 UTC
hmmm, wait, he is using ps files, that can be the problem as ps file support is a BIG HACK, let me check...

... yeah it does not work with ps files
Comment 5 Philip 2006-07-01 01:57:02 UTC
I should change the headline (but I don't know how, can someone else?) to: 
"kpdf watch file option does not work on .ps files"

(doesn't work on either fc4 or fc5)

Albert, does this mean the bug status should be Confirmed?

Comment 6 Albert Astals Cid 2006-07-01 12:40:15 UTC
SVN commit 556704 by aacid:

Make the watch function work too when opening ps files through ps2pdf
BUGS: 130000

Ei, that's a nice bug number :-D


 M  +5 -0      part.cpp  


--- branches/KDE/3.5/kdegraphics/kpdf/part.cpp #556703:556704
@@ -586,8 +586,13 @@
 
 void Part::psTransformEnded()
 {
+	QString aux = m_file;
 	m_file = m_temporaryLocalFile;
 	openFile();
+	m_file = aux; // so watching works, we have to watch the ps file not the autogenerated pdf
+	m_watcher->removeFile(m_temporaryLocalFile);
+	if ( !m_watcher->contains(m_file) )
+		m_watcher->addFile(m_file);
 }
 
 void Part::cannotQuit()