Only in khtml2png-2.0.5: config.h
Only in khtml2png-2.0.5: config.log
Only in khtml2png-2.0.5: config.status
Only in khtml2png-2.0.5/doc/en: index.cache.bz2
Only in khtml2png-2.0.5/doc/en: Makefile
Only in khtml2png-2.0.5/doc: Makefile
Only in khtml2png-2.0.5: libtool
Only in khtml2png-2.0.5: Makefile
Only in khtml2png-2.0.5/po: Makefile
Only in khtml2png-2.0.5/src: .deps
Only in khtml2png-2.0.5/src: khtml2png2
diff -ru khtml2png-2.0.5.orig/src/khtml2png.cpp khtml2png-2.0.5/src/khtml2png.cpp
--- khtml2png-2.0.5.orig/src/khtml2png.cpp	2006-01-11 23:10:02.000000000 +0100
+++ khtml2png-2.0.5/src/khtml2png.cpp	2007-05-15 16:51:49.000000000 +0200
@@ -175,7 +175,7 @@
 **parameter yPos (global): top position to scroll to
 **returns the visible part as a pointer QImage
 **/
-QImage* KHTML2PNG::create(const QString &path, int flashDelay)
+QImage* KHTML2PNG::create(const QString &path, int flashDelay, int pageTimeout)
 {
 	int visibleX,visibleY;
 
@@ -198,14 +198,22 @@
 
 	//resize the window to the wanted size
 	m_html->view()->resize(xCapture, yCapture);
+	startTimer(pageTimeout * 1000);
+	m_completed = false;
+	//start loop
+	while (!m_completed)
+		kapp->processOneEvent();
+	killTimers();
 
 	//check what visible size we've got
 	visibleX=m_html->view()->clipper()->rect().width();
 	visibleY=m_html->view()->clipper()->rect().height();
 
 	//calculate the difference and adjust the capture size
+	printf("before %d/%d\n",xCapture,yCapture);
 	yCapture+=yCapture-visibleY;
 	xCapture+=xCapture-visibleX;
+	printf("after %d/%d\n",xCapture,yCapture);
 
 	//set the new capture size (we get hopefully the correct size *cross your fingers*)
 	m_html->view()->resize(xCapture, yCapture);
@@ -215,11 +223,11 @@
 	m_html->stopAnimations();
 	
 
-	m_completed = false;
+	//m_completed = false;
 	//start loop
-	while (!m_completed)
-		kapp->processOneEvent();
-	killTimers();
+	//while (!m_completed)
+	//	kapp->processOneEvent();
+	//killTimers();
 
 	//scroll to the beginning of the next part
 	m_html->view()->verticalScrollBar()->setValue(yPos);
@@ -352,6 +360,7 @@
 		yNr = 0;
 
 	int flashDelay = 2;
+	int pageTimeout = 30;
 
 	char 	nrStr[10], //temporary buffer to convert int -> char
 			cmd[5000], //command line string
@@ -361,6 +370,10 @@
 	{
 		flashDelay = QString::fromLatin1(args->getOption("flash-delay")).toInt();
 	}
+	if (args->isSet("time"))
+	{
+		pageTimeout = QString::fromLatin1(args->getOption("time")).toInt();
+	}
 
 	KInstance inst(&aboutData);
 	KApplication app;
@@ -392,7 +405,7 @@
 					xCapture = xRemain;
 
 					//capture the part of the screen
-					QImage* renderedImage = convertor->create(path, flashDelay);
+					QImage* renderedImage = convertor->create(path, flashDelay, pageTimeout);
 
 					//generate the filename of the capture part file
 					QString filename = "/tmp/khtml2png.png";
@@ -406,6 +419,7 @@
 					xNr ++;
 					xPos += xVisible;
 					xRemain -= xVisible;
+					printf("xRemain: %d\n",xRemain);
 
 					if (xRemain <= 0)
 						lastXShot=true;
@@ -415,6 +429,7 @@
 
 			yPos += yVisible;
 			yRemain -= yVisible;
+			printf("yRemain: %d\n",yRemain);
 			
 			if (yRemain <= 0)
 				lastYShot=true;
diff -ru khtml2png-2.0.5.orig/src/khtml2png.h khtml2png-2.0.5/src/khtml2png.h
--- khtml2png-2.0.5.orig/src/khtml2png.h	2005-11-18 21:49:48.000000000 +0100
+++ khtml2png-2.0.5/src/khtml2png.h	2007-05-15 16:52:14.000000000 +0200
@@ -29,7 +29,7 @@
 	Q_OBJECT
 
 public:
-	QImage* create(const QString &path, int flashDelay);
+	QImage* create(const QString &path, int flashDelay, int pageTimeout);
 	void showMiniBrowser(const QString &path);
 
 public slots:
Only in khtml2png-2.0.5/src: khtml2png.moc
Only in khtml2png-2.0.5/src: khtml2png.o
Only in khtml2png-2.0.5/src: .libs
Only in khtml2png-2.0.5/src: Makefile
Only in khtml2png-2.0.5: stamp-h1
