r22827 by jghali - Small refactoring for PdfImportOptions::updatePreview()

scribus-commit scribus-commit at lists.scribus.net
Sat Feb 2 00:44:38 UTC 2019


Author: jghali
Date: Sat Feb  2 00:44:38 2019
New Revision: 22827

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22827
Log:
Small refactoring for PdfImportOptions::updatePreview()

Modified:
    trunk/Scribus/scribus/plugins/import/pdf/pdfimportoptions.cpp

Modified: trunk/Scribus/scribus/plugins/import/pdf/pdfimportoptions.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22827&path=/trunk/Scribus/scribus/plugins/import/pdf/pdfimportoptions.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/pdfimportoptions.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/pdfimportoptions.cpp	Sat Feb  2 00:44:38 2019
@@ -106,19 +106,19 @@
 
 void PdfImportOptions::updatePreview(int pg)
 {
-	if (m_plugin)
-	{
-		int cb = 0;
-		if (ui->cropGroup->isChecked())
-			cb =  ui->cropBox->currentIndex();
-		QImage img = m_plugin->readPreview(pg, ui->previewWidget->width(), ui->previewWidget->height(), cb);
-		ui->previewWidget->setPixmap(QPixmap::fromImage(img));
-		disconnect(ui->spinBox, SIGNAL(valueChanged(int)), this, SLOT(updateFromSpinBox(int)));
-		disconnect(ui->spinBox, SIGNAL(valueChanged(int)), this, SLOT(updatePreview(int)));
-		ui->spinBox->setValue(pg);
-		connect(ui->spinBox, SIGNAL(valueChanged(int)), this, SLOT(updateFromSpinBox(int)));
-		connect(ui->spinBox, SIGNAL(valueChanged(int)), this, SLOT(updatePreview(int)));
-	}
+	if (!m_plugin)
+		return;
+
+	int cb = 0;
+	if (ui->cropGroup->isChecked())
+		cb =  ui->cropBox->currentIndex();
+	QImage img = m_plugin->readPreview(pg, ui->previewWidget->width(), ui->previewWidget->height(), cb);
+	ui->previewWidget->setPixmap(QPixmap::fromImage(img));
+	disconnect(ui->spinBox, SIGNAL(valueChanged(int)), this, SLOT(updateFromSpinBox(int)));
+	disconnect(ui->spinBox, SIGNAL(valueChanged(int)), this, SLOT(updatePreview(int)));
+	ui->spinBox->setValue(pg);
+	connect(ui->spinBox, SIGNAL(valueChanged(int)), this, SLOT(updateFromSpinBox(int)));
+	connect(ui->spinBox, SIGNAL(valueChanged(int)), this, SLOT(updatePreview(int)));
 }
 
 void PdfImportOptions::createPageNumberRange()




More information about the scribus-commit mailing list