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 (+92 lines)
Line 0 Link Here
1
# Run QPrinter initialization on first usage.
2
# This removes possible delay on application start for non-native printer(s).
3
4
--- src/stack.cpp.orig	2016-10-13 09:37:59 UTC
5
+++ src/stack.cpp
6
@@ -55,6 +55,7 @@
7
 Stack::Stack(QWidget* parent) :
8
 	QWidget(parent),
9
 	m_symbols_dialog(0),
10
+	m_printer(0),
11
 	m_current_document(0),
12
 	m_footer_margin(0),
13
 	m_header_margin(0),
14
@@ -78,17 +79,6 @@ Stack::Stack(QWidget* parent) :
15
 	m_find_dialog = new FindDialog(this);
16
 	connect(m_find_dialog, SIGNAL(findNextAvailable(bool)), this, SIGNAL(findNextAvailable(bool)));
17
 
18
-	m_printer = new QPrinter(QPrinter::HighResolution);
19
-#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
20
-	m_printer->setPageSize(QPageSize(QPageSize::Letter));
21
-	m_printer->setPageOrientation(QPageLayout::Portrait);
22
-	m_printer->setPageMargins(QMarginsF(1.0, 1.0, 1.0, 1.0), QPageLayout::Inch);
23
-#else
24
-	m_printer->setPageSize(QPrinter::Letter);
25
-	m_printer->setOrientation(QPrinter::Portrait);
26
-	m_printer->setPageMargins(1.0, 1.0, 1.0, 1.0, QPrinter::Inch);
27
-#endif
28
-
29
 	connect(ActionManager::instance(), SIGNAL(insertText(QString)), this, SLOT(insertSymbol(QString)));
30
 
31
 	m_layout = new QGridLayout(this);
32
@@ -129,7 +119,8 @@ Stack::~Stack()
33
 {
34
 	m_theme_renderer->wait();
35
 
36
-	delete m_printer;
37
+	if (m_printer)
38
+		delete m_printer;
39
 }
40
 
41
 //-----------------------------------------------------------------------------
42
@@ -380,6 +371,24 @@ void Stack::increaseIndent()
43
 
44
 //-----------------------------------------------------------------------------
45
 
46
+void Stack::initPrinter()
47
+{
48
+	if (!m_printer) {
49
+		m_printer = new QPrinter(QPrinter::HighResolution);
50
+#if (QT_VERSION >= QT_VERSION_CHECK(5,3,0))
51
+		m_printer->setPageSize(QPageSize(QPageSize::Letter));
52
+		m_printer->setPageOrientation(QPageLayout::Portrait);
53
+		m_printer->setPageMargins(QMarginsF(1.0, 1.0, 1.0, 1.0), QPageLayout::Inch);
54
+#else
55
+		m_printer->setPageSize(QPrinter::Letter);
56
+		m_printer->setOrientation(QPrinter::Portrait);
57
+		m_printer->setPageMargins(1.0, 1.0, 1.0, 1.0, QPrinter::Inch);
58
+#endif
59
+	}
60
+}
61
+
62
+//-----------------------------------------------------------------------------
63
+
64
 void Stack::paste()
65
 {
66
 	m_current_document->text()->paste();
67
@@ -397,6 +406,7 @@ void Stack::pasteUnformatted()
68
 
69
 void Stack::pageSetup()
70
 {
71
+	initPrinter();
72
 	QPageSetupDialog dialog(m_printer, this);
73
 	dialog.exec();
74
 }
75
@@ -405,6 +415,7 @@ void Stack::pageSetup()
76
 
77
 void Stack::print()
78
 {
79
+	initPrinter();
80
 	m_current_document->print(m_printer);
81
 }
82
 
83
--- src/stack.h.orig	2016-10-13 09:37:59 UTC
84
+++ src/stack.h
85
@@ -91,6 +91,7 @@ public slots:
86
 	void findNext();
87
 	void findPrevious();
88
 	void increaseIndent();
89
+	void initPrinter();
90
 	void paste();
91
 	void pasteUnformatted();
92
 	void pageSetup();
(-)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