View | Details | Raw Unified | Return to bug 215232
Collapse All | Expand All

(-)focuswriter/Makefile (-1 / +1 lines)
Lines 2-8 Link Here
2
# $FreeBSD: head/editors/focuswriter/Makefile 427751 2016-12-04 01:16:10Z jhale $
2
# $FreeBSD: head/editors/focuswriter/Makefile 427751 2016-12-04 01:16:10Z jhale $
3
3
4
PORTNAME=	focuswriter
4
PORTNAME=	focuswriter
5
PORTVERSION=	1.6.2
5
PORTVERSION=	1.6.3
6
DISTVERSIONPREFIX=	v
6
DISTVERSIONPREFIX=	v
7
CATEGORIES=	editors
7
CATEGORIES=	editors
8
8
(-)focuswriter/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1480811966
1
TIMESTAMP = 1481462900
2
SHA256 (gottcode-focuswriter-v1.6.2_GH0.tar.gz) = dcc2c9fe081421c8fad9e7c653134f93659a28b0071e9925f9094c246520de3d
2
SHA256 (gottcode-focuswriter-v1.6.3_GH0.tar.gz) = 6a456a7da397b988bc05d3d92c57bc3070c3c7dcf1a0a62561deef99ea3f8dc9
3
SIZE (gottcode-focuswriter-v1.6.2_GH0.tar.gz) = 10326671
3
SIZE (gottcode-focuswriter-v1.6.3_GH0.tar.gz) = 10325804
(-)focuswriter/files/patch-QPrinter.diff (-83 lines)
Lines 1-83 Link Here
1
# Origin: https://github.com/gottcode/focuswriter/commit/e7311fb017782a0bbf017d0055f6f01b36233b89
2
# Subject: FIXED: Possible delay on start when creating non-native printer.
3
# Origin: https://github.com/gottcode/focuswriter/commit/1423754c4eae874857ce34613bddead8224ee887
4
# Subject: FIXED: Memory leak from creating multiple printers.
5
6
--- src/stack.cpp.orig	2016-10-13 09:37:59 UTC
7
+++ src/stack.cpp
8
@@ -55,6 +55,7 @@
9
 Stack::Stack(QWidget* parent) :
10
 	QWidget(parent),
11
 	m_symbols_dialog(0),
12
+	m_printer(0),
13
 	m_current_document(0),
14
 	m_footer_margin(0),
15
 	m_header_margin(0),
16
@@ -78,17 +79,6 @@ Stack::Stack(QWidget* parent) :
17
 	m_find_dialog = new FindDialog(this);
18
 	connect(m_find_dialog, SIGNAL(findNextAvailable(bool)), this, SIGNAL(findNextAvailable(bool)));
19
 
20
-	m_printer = new QPrinter(QPrinter::HighResolution);
21
-#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
22
-	m_printer->setPageSize(QPageSize(QPageSize::Letter));
23
-	m_printer->setPageOrientation(QPageLayout::Portrait);
24
-	m_printer->setPageMargins(QMarginsF(1.0, 1.0, 1.0, 1.0), QPageLayout::Inch);
25
-#else
26
-	m_printer->setPageSize(QPrinter::Letter);
27
-	m_printer->setOrientation(QPrinter::Portrait);
28
-	m_printer->setPageMargins(1.0, 1.0, 1.0, 1.0, QPrinter::Inch);
29
-#endif
30
-
31
 	connect(ActionManager::instance(), SIGNAL(insertText(QString)), this, SLOT(insertSymbol(QString)));
32
 
33
 	m_layout = new QGridLayout(this);
34
@@ -397,6 +387,7 @@ void Stack::pasteUnformatted()
35
 
36
 void Stack::pageSetup()
37
 {
38
+	initPrinter();
39
 	QPageSetupDialog dialog(m_printer, this);
40
 	dialog.exec();
41
 }
42
@@ -405,6 +396,7 @@ void Stack::pageSetup()
43
 
44
 void Stack::print()
45
 {
46
+	initPrinter();
47
 	m_current_document->print(m_printer);
48
 }
49
 
50
@@ -835,3 +827,23 @@ void Stack::updateMenuIndexes()
51
 }
52
 
53
 //-----------------------------------------------------------------------------
54
+
55
+void Stack::initPrinter()
56
+{
57
+	if (m_printer) {
58
+		return;
59
+	}
60
+
61
+	m_printer = new QPrinter(QPrinter::HighResolution);
62
+#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
63
+	m_printer->setPageSize(QPageSize(QPageSize::Letter));
64
+	m_printer->setPageOrientation(QPageLayout::Portrait);
65
+	m_printer->setPageMargins(QMarginsF(1.0, 1.0, 1.0, 1.0), QPageLayout::Inch);
66
+#else
67
+	m_printer->setPageSize(QPrinter::Letter);
68
+	m_printer->setOrientation(QPrinter::Portrait);
69
+	m_printer->setPageMargins(1.0, 1.0, 1.0, 1.0, QPrinter::Inch);
70
+#endif
71
+}
72
+
73
+//-----------------------------------------------------------------------------
74
--- src/stack.h.orig	2016-10-13 09:37:59 UTC
75
+++ src/stack.h
76
@@ -140,6 +140,7 @@ private:
77
 #if (QT_VERSION < QT_VERSION_CHECK(5,6,0))
78
 	qreal devicePixelRatioF() const { return devicePixelRatio(); }
79
 #endif
80
+	void initPrinter();
81
 
82
 private:
83
 	AlertLayer* m_alerts;

Return to bug 215232