View | Details | Raw Unified | Return to bug 214827 | Differences between
and this patch

Collapse All | Expand All

(-)focuswriter/Makefile (-12 / +17 lines)
Lines 2-8 Link Here
2
# $FreeBSD: head/editors/focuswriter/Makefile 418731 2016-07-18 19:06:16Z pawel $
2
# $FreeBSD: head/editors/focuswriter/Makefile 418731 2016-07-18 19:06:16Z pawel $
3
3
4
PORTNAME=	focuswriter
4
PORTNAME=	focuswriter
5
PORTVERSION=	1.5.7
5
PORTVERSION=	1.6.2
6
DISTVERSIONPREFIX=	v
6
DISTVERSIONPREFIX=	v
7
CATEGORIES=	editors
7
CATEGORIES=	editors
8
8
Lines 19-25 Link Here
19
USE_GITHUB=	yes
19
USE_GITHUB=	yes
20
GH_ACCOUNT=	gottcode
20
GH_ACCOUNT=	gottcode
21
21
22
USES=		desktop-file-utils pkgconfig qmake
22
USES=		compiler:c++11-lib desktop-file-utils pkgconfig qmake
23
USE_GL=		gl
24
USE_QT5=	concurrent core gui multimedia network printsupport widgets \
25
		buildtools_build linguisttools_build
23
INSTALLS_ICONS=	yes
26
INSTALLS_ICONS=	yes
24
27
25
LIBS+=		-lz
28
LIBS+=		-lz
Lines 27-47 Link Here
27
PORTDATA=	*
30
PORTDATA=	*
28
PORTDOCS=	CREDITS NEWS README
31
PORTDOCS=	CREDITS NEWS README
29
32
30
OPTIONS_DEFINE=		DOCS
33
OPTIONS_DEFINE=	DOCS
31
OPTIONS_DEFAULT=	QT5
32
OPTIONS_SINGLE=		QT
33
OPTIONS_SINGLE_QT=	QT4 QT5
34
QT_DESC=		Qt toolkit
35
34
36
QT4_RUN_DEPENDS=	${LOCALBASE}/lib/libSDL2_mixer.so:audio/sdl2_mixer
35
.include <bsd.port.pre.mk>
37
QT4_USE=	QT4=corelib,gui,network,moc_build,rcc_build
38
QT5_USE=	QT5=concurrent,core,gui,multimedia,network,printsupport,widgets,buildtools_build
39
QT5_USE+=	GL=gl
40
36
41
post-patch:
37
post-patch:
42
	@${REINPLACE_CMD} -e '/PKGCONFIG/s/ zlib// ; \
38
	@${REINPLACE_CMD} -e '/PKGCONFIG/s/ zlib// ; \
43
		/INSTALLS/s/man //' \
39
		/INSTALLS/s/man //' \
44
		${WRKSRC}/focuswriter.pro
40
		${WRKSRC}/focuswriter.pro
41
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000054
42
	@${REINPLACE_CMD} -e 's/std::lround/lround/g' \
43
		${WRKSRC}/src/daily_progress_dialog.cpp \
44
		${WRKSRC}/src/scene_list.cpp \
45
		${WRKSRC}/src/theme_dialog.cpp \
46
		${WRKSRC}/src/fileformats/docx_reader.cpp \
47
		${WRKSRC}/src/fileformats/odt_reader.cpp \
48
		${WRKSRC}/src/fileformats/rtf_reader.cpp
49
.endif
45
50
46
do-install-DOCS-on:
51
do-install-DOCS-on:
47
	(cd ${WRKSRC} && ${COPYTREE_SHARE} "${PORTDOCS}" ${STAGEDIR}${DOCSDIR})
52
	(cd ${WRKSRC} && ${COPYTREE_SHARE} "${PORTDOCS}" ${STAGEDIR}${DOCSDIR})
Lines 50-53 Link Here
50
	${INSTALL_MAN} ${WRKSRC}/resources/unix/focuswriter.1 \
55
	${INSTALL_MAN} ${WRKSRC}/resources/unix/focuswriter.1 \
51
		${STAGEDIR}${PREFIX}/man/man1
56
		${STAGEDIR}${PREFIX}/man/man1
52
57
53
.include <bsd.port.mk>
58
.include <bsd.port.post.mk>
(-)focuswriter/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1468697342
1
TIMESTAMP = 1476351479
2
SHA256 (gottcode-focuswriter-v1.5.7_GH0.tar.gz) = 83d3e093360dfb8855602cb5b65a4c5249ada511031c76bdcee73e3dd0b09250
2
SHA256 (gottcode-focuswriter-v1.6.2_GH0.tar.gz) = dcc2c9fe081421c8fad9e7c653134f93659a28b0071e9925f9094c246520de3d
3
SIZE (gottcode-focuswriter-v1.5.7_GH0.tar.gz) = 5621646
3
SIZE (gottcode-focuswriter-v1.6.2_GH0.tar.gz) = 10326671
(-)focuswriter/files/patch-QPrinter.diff (+83 lines)
Line 0 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;
(-)focuswriter/pkg-plist (+2 lines)
Lines 2-7 Link Here
2
man/man1/focuswriter.1.gz
2
man/man1/focuswriter.1.gz
3
share/appdata/focuswriter.appdata.xml
3
share/appdata/focuswriter.appdata.xml
4
share/applications/focuswriter.desktop
4
share/applications/focuswriter.desktop
5
share/icons/hicolor/1024x1024/apps/focuswriter.png
5
share/icons/hicolor/128x128/apps/focuswriter.png
6
share/icons/hicolor/128x128/apps/focuswriter.png
6
share/icons/hicolor/16x16/apps/focuswriter.png
7
share/icons/hicolor/16x16/apps/focuswriter.png
7
share/icons/hicolor/22x22/apps/focuswriter.png
8
share/icons/hicolor/22x22/apps/focuswriter.png
Lines 9-14 Link Here
9
share/icons/hicolor/256x256/apps/focuswriter.png
10
share/icons/hicolor/256x256/apps/focuswriter.png
10
share/icons/hicolor/32x32/apps/focuswriter.png
11
share/icons/hicolor/32x32/apps/focuswriter.png
11
share/icons/hicolor/48x48/apps/focuswriter.png
12
share/icons/hicolor/48x48/apps/focuswriter.png
13
share/icons/hicolor/512x512/apps/focuswriter.png
12
share/icons/hicolor/64x64/apps/focuswriter.png
14
share/icons/hicolor/64x64/apps/focuswriter.png
13
share/icons/hicolor/scalable/apps/focuswriter.svg
15
share/icons/hicolor/scalable/apps/focuswriter.svg
14
share/pixmaps/focuswriter.xpm
16
share/pixmaps/focuswriter.xpm

Return to bug 214827