Browse Source

fix various compilation warnings

Mostly taken from the changes in #1849
Ashish Kulkarni 10 years ago
parent
commit
84d7dbb384

+ 2 - 2
src/lib/imagesettings.cc

@@ -60,14 +60,14 @@ CropSettings::CropSettings():
 	height(-1) {}
 
 ImageGlobal::ImageGlobal():
-	screenWidth(1024),
-	screenHeight(0),
 	quiet(false),
 	transparent(false),
 	useGraphics(false),
 	in(""),
 	out(""),
 	fmt(""),
+	screenWidth(1024),
+	screenHeight(0),
 	quality(94),
 	smartWidth(true) {}
 

+ 2 - 2
src/lib/loadsettings.cc

@@ -138,14 +138,14 @@ LoadGlobal::LoadGlobal():
 LoadPage::LoadPage():
 	jsdelay(200),
 	windowStatus(""),
-	cacheDir(""),
 	zoomFactor(1.0),
 	repeatCustomHeaders(false),
 	blockLocalFileAccess(false),
 	stopSlowScripts(true),
 	debugJavascript(false),
 	loadErrorHandling(abort),
-	mediaLoadErrorHandling(ignore) {};
+	mediaLoadErrorHandling(ignore),
+	cacheDir("") {};
 
 }
 }

+ 2 - 0
src/lib/multipageloader.cc

@@ -121,6 +121,7 @@ bool MyQWebPage::javaScriptConfirm(QWebFrame *, const QString & msg) {
 bool MyQWebPage::javaScriptPrompt(QWebFrame *, const QString & msg, const QString & defaultValue, QString * result) {
 	resource.warning(QString("Javascript prompt: %1 (answered %2)").arg(msg,defaultValue));
 	result = (QString*)&defaultValue;
+	Q_UNUSED(result);
 	return true;
 }
 
@@ -296,6 +297,7 @@ void ResourceObject::loadDone() {
  * and password supplied on the command line
  */
 void ResourceObject::handleAuthenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator) {
+	Q_UNUSED(reply);
 
 	// XXX: Avoid calling 'reply->abort()' from within this signal.
 	//      As stated by doc, request would be finished when no

+ 4 - 0
src/lib/pdf_c_bindings.cc

@@ -297,7 +297,11 @@ CAPI(int) wkhtmltopdf_init(int use_graphics) {
 #ifdef __EXTENSIVE_WKHTMLTOPDF_QT_HACK__
 		ug = use_graphics;
 		if (!ug) QApplication::setGraphicsSystem("raster");
+#else
+		Q_UNUSED(use_graphics);
 #endif
+#else
+		Q_UNUSED(use_graphics);
 #endif
 		a = new QApplication(aa, arg, ug);
 		MyLooksStyle * style = new MyLooksStyle();

+ 2 - 1
src/lib/pdfconverter.cc

@@ -239,7 +239,7 @@ void PdfConverterPrivate::beginConvert() {
 // calculates header/footer height
 // returns millimeters
 qreal PdfConverterPrivate::calculateHeaderHeight(PageObject & object, QWebPage & header) {
-    typedef QPair<QWebElement, QString> p_t;
+    Q_UNUSED(object);
 
     TempFile   tempObj;
     QString    tempFile = tempObj.create(".pdf");
@@ -940,6 +940,7 @@ void PdfConverterPrivate::handleFooter(QWebPage * frame, int page) {
 }
 
 void PdfConverterPrivate::endPrintObject(PageObject & obj) {
+	Q_UNUSED(obj);
 	// If this page was skipped, we might not have
 	// anything to spool to printer..
 	if (webPrinter != 0) spoolTo(webPrinter->pageCount());

+ 3 - 3
src/lib/pdfsettings.cc

@@ -283,7 +283,7 @@ UnitReal strToUnitReal(const char * o, bool * ok) {
 	else if (!strcasecmp(o+i,"point") || !strcasecmp(o+i,"pt"))
 		u=QPrinter::Point;
 	else {
-		if (ok) ok=false;
+		if (ok) *ok=false;
 		return UnitReal(QString(o).left(i).toDouble()*s, u);
 	}
 	return UnitReal(QString(o).left(i).toDouble(ok)*s, u);
@@ -380,9 +380,9 @@ PdfGlobal::PdfGlobal():
 	out(""),
 	documentTitle(""),
 	useCompression(true),
+	viewportSize(""),
 	imageDPI(600),
-	imageQuality(94),
-	viewportSize(""){};
+	imageQuality(94){};
 
 TableOfContent::TableOfContent():
 	useDottedLines(true),