Package: kadu / 4.1-1.1

02-about-dialog.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Description: Fixes contents of "About" dialog's tabs.
 In Kadu, "About" dialog displays, among others, a license (GPLv2) and
 ChangeLog's contents. Originally these two files are installed into
 $(CMAKE_INSTALL_PREFIX)/share subdir. To achieve that, ChangeLog must not be
 compressed (gzipped). To avoid Lintian's complaints, we change ChangeLog's
 name to about-changes-tab.txt and (in this patch) change "About" dialog's
 behavior to read this file instead of ChangeLog.
 .
 It's discouraged to ship license file if it is one of most commonly used
 licenses (like GPL) and reference to /usr/share/common-licenses/. Originally
 Kadu ships COPYING file containing GPLv2 license text. It's not installed in
 Debian package, so we have to (and we do in this patch) instruct "About"
 dialog to read /usr/share/common-licenses/GPL-2 instead of COPYING.
Author: Patryk Cisek <patryk@debian.org>
---
diff --git a/kadu-core/gui/windows/about.cpp b/kadu-core/gui/windows/about.cpp
index 74f5b85..3a7055e 100644
--- a/kadu-core/gui/windows/about.cpp
+++ b/kadu-core/gui/windows/about.cpp
@@ -179,7 +179,7 @@ void About::init()
 	tb_changelog->setOpenLinks(false);
 	tb_changelog->setFrameStyle(QFrame::NoFrame);
 	tb_changelog->viewport()->setAutoFillBackground(false);
-	QString changelog = Qt::escape(loadFile("ChangeLog"));
+	QString changelog = Qt::escape(loadFile("about-changes-tab.txt"));
 	changelog.replace('\n', "<br/>");
 	// #bug_no -> Redmine URL
 	changelog.replace(QRegExp("#(\\d+)"), "<a href=\"http://www.kadu.im/redmine/issues/\\1\">#\\1</a>");
@@ -258,8 +258,17 @@ void About::keyPressEvent(QKeyEvent *event)
 QString About::loadFile(const QString &name)
 {
 	kdebugf();
-
-	QFile file(m_pathsProvider->dataPath() + name);
+        QString fullPathName;
+
+        if(name.startsWith("COPYING"))
+        {
+            fullPathName = "/usr/share/common-licenses/GPL-2";
+        }
+        else
+        {
+            fullPathName = "/usr/share/doc/kadu/" + name;
+        }
+	QFile file(fullPathName);
 	if (!file.open(QIODevice::ReadOnly))
 	{
 		kdebugm(KDEBUG_ERROR, "About::loadFile(%s) cannot open file\n", qPrintable(name));