r23823 by jghali - Fix cleanup of temporary files generated by print preview + some cleanups

scribus-commit scribus-commit at lists.scribus.net
Thu May 21 17:38:45 UTC 2020


Author: jghali
Date: Thu May 21 17:38:45 2020
New Revision: 23823

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23823
Log:
Fix cleanup of temporary files generated by print preview + some cleanups

Modified:
    trunk/Scribus/scribus/ui/printpreview.cpp
    trunk/Scribus/scribus/ui/printpreview.h

Modified: trunk/Scribus/scribus/ui/printpreview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23823&path=/trunk/Scribus/scribus/ui/printpreview.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/printpreview.cpp	(original)
+++ trunk/Scribus/scribus/ui/printpreview.cpp	Thu May 21 17:38:45 2020
@@ -296,13 +296,14 @@
 	previewLabel->resize(previewLabel->pixmap()->size());
 	previewArea->setWidget(previewLabel);
 	int w = previewLabel->width() + tbWidth + 50;
-	resize(qMin(QApplication::desktop()->width()-30,w), 500);
+	resize(qMin(QApplication::desktop()->width() - 30, w), 500);
 	if (!PrefsManager::instance().appPrefs.printPreviewPrefs.PrPr_Mode)
 	{
 		if (haveTiffSep)
 			inkTable->setEnabled(false);
 	}
 	pageSelector->setGUIForPage(doc->currentPage()->pageNr());
+
 	// tooltips
 	antiAliasing->setToolTip( "<qt>" + tr( "Provides a more pleasant view of Type 1 fonts, TrueType Fonts, OpenType Fonts, EPS, PDF and vector graphics in the preview, at the expense of a slight slowdown in previewing" ) + "</qt>" );
 	showTransparency->setToolTip( "<qt>" + tr( "Shows transparency and transparent items in your document. Requires Ghostscript 7.07 or later." ) + "</qt>");
@@ -337,7 +338,7 @@
 	if ((d.exists()) && (d.count() != 0))
 	{
 		for (uint i = 0; i < d.count(); i++)
-			QFile::remove(prefsManager.preferencesLocation() + "/" + d[i]);
+			QFile::remove(tempFileDir + "/" + d[i]);
 	}
 }
 
@@ -1192,13 +1193,12 @@
 void PrintPreview::resizeEvent(QResizeEvent * event)
 {
 	QDialog::resizeEvent(event);
-	int cx = scaleBox->currentIndex();
-	// repaint only for "fit to" options in the combo box
-	if (cx > 3)
-	{
-		// HACK: m_scaleMode is reset to insane value to force redraw
-		// as the value is checked for change.
-		m_scaleMode = -1;
-		scaleBox_valueChanged(cx);
-	}
-}
+	int scaleIndex = scaleBox->currentIndex();
+	// Repaint only for "fit to" options in the combo box
+	if (scaleIndex <= 3)
+		return;
+	// HACK: m_scaleMode is reset to insane value to force redraw
+	// as the value is checked for change.
+	m_scaleMode = -1;
+	scaleBox_valueChanged(scaleIndex);
+}

Modified: trunk/Scribus/scribus/ui/printpreview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23823&path=/trunk/Scribus/scribus/ui/printpreview.h
==============================================================================
--- trunk/Scribus/scribus/ui/printpreview.h	(original)
+++ trunk/Scribus/scribus/ui/printpreview.h	Thu May 21 17:38:45 2020
@@ -125,7 +125,7 @@
 
 	int m_currentPage { -1 };
 	int m_scaleMode { 1 };
-	int m_gsVersion;
+	int m_gsVersion { 0 };
 	int m_inkMax { 1020 }; // 4 * 255
 	bool m_colorMode { false };
 	bool m_useAntialiasing { false };




More information about the scribus-commit mailing list