gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / tipp10-fix-compiling.patch
1 Description: Debian patches to make tipp10 compile
2 Author: Christoph Martin <chrism@debian.org>
3 Last-Update: 2016-07-20
4
5 https://sources.debian.net/data/main/t/tipp10/2.1.0-2/debian/patches/0001-FixCompiling
6
7 --- a/widget/tickerboard.cpp
8 +++ b/widget/tickerboard.cpp
9 @@ -97,7 +97,8 @@ void TickerBoard::startTicker(bool wasPa
10
11 if (tickerSpeed == 50) {
12 scrollOffset = 290;
13 - scroll(-290, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
14 + const QRect qr = QRect(10, 15, 590, 35);
15 + scroll(-290, 0, qr); //contentsRect());
16 }
17
18 startFlag = true;
19 @@ -153,7 +154,8 @@ void TickerBoard::changeChar() {
20 scrollOffset = 0;
21 } else {
22 scrollOffset = 290;
23 - scroll(-290, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
24 + const QRect qr = QRect(10, 15, 590, 35);
25 + scroll(-290, 0, qr); //contentsRect());
26 }
27 splitLesson();
28 }
29 @@ -242,7 +244,8 @@ void TickerBoard::progress() {
30
31 // Move ticker 1 pixel to left
32 scrollOffset++;
33 - scroll(-1, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
34 + const QRect qr = QRect(10, 15, 590, 35);
35 + scroll(-1, 0, qr); //contentsRect());
36
37 if ((lessonOffset - scrollOffset) <= 30) {
38 setSpeed(tickerSpeed);
39 @@ -265,14 +268,16 @@ void TickerBoard::progress() {
40 // 160 pixels overage (because the user must see at least the next word)
41 if ((lessonOffset - scrollOffset) > 200) {
42 scrollOffset += (lessonOffset - scrollOffset) - 200;
43 - scroll(-((lessonOffset - scrollOffset) - 200), 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
44 + const QRect qr = QRect(10, 15, 590, 35);
45 + scroll(-((lessonOffset - scrollOffset) - 200), 0, qr); //contentsRect());
46 }
47 } else {
48 // If the user types faster than the ticker, move ticker faster after
49 // 160 pixels overage (because the user must see at least the next word)
50 if ((lessonOffset - scrollOffset) > 280) {
51 scrollOffset += 570;
52 - scroll(-570, 0, QRect::QRect(10, 15, 590, 35)); //contentsRect());
53 + const QRect qr = QRect(10, 15, 590, 35);
54 + scroll(-570, 0, qr); //contentsRect());
55 }
56
57 }
58 --- a/widget/settingspages.cpp
59 +++ b/widget/settingspages.cpp
60 @@ -501,7 +501,7 @@ void DatabasePage::writeSettings() {
61 QSettings settings;
62 #endif
63 settings.beginGroup("database");
64 - settings.setValue("pathpro", lineDatabasePath->text() + "/" + QString::QString(APP_USER_DB));
65 + settings.setValue("pathpro", lineDatabasePath->text() + "/" + QString(APP_USER_DB));
66 settings.endGroup();
67 }
68
69 --- a/widget/lessondialog.cpp
70 +++ b/widget/lessondialog.cpp
71 @@ -89,7 +89,7 @@ void LessonDialog::updateContent() {
72 *lessonData = lineLessonContent->toPlainText().split("\n", QString::SkipEmptyParts);
73 // Delete empty lines
74 for (int i = 0; i < lessonData->size(); i++) {
75 - if (QString::QString(lessonData->at(i).toLocal8Bit().constData()).simplified() == "") {
76 + if (QString(lessonData->at(i).toLocal8Bit().constData()).simplified() == "") {
77 lessonData->removeAt(i);
78 }
79 }
80 @@ -259,7 +259,7 @@ void LessonDialog::clickSave() {
81 contentList = lineLessonContent->toPlainText().split("\n", QString::SkipEmptyParts);
82 // Delete empty lines
83 for (i = 0; i < contentList.size(); i++) {
84 - if (QString::QString(contentList.at(i).toLocal8Bit().constData()).simplified() == "") {
85 + if (QString(contentList.at(i).toLocal8Bit().constData()).simplified() == "") {
86 contentList.removeAt(i);
87 }
88 }
89 --- a/sql/chartablesql.cpp
90 +++ b/sql/chartablesql.cpp
91 @@ -57,7 +57,7 @@ QVariant CharSqlModel::data(const QModel
92 // Read the unicode value
93 unicode = value.toInt();
94 // Convert unicode to a char
95 - unicodeToChar = QString::QString(QChar(unicode)); //"\'" + QString::QString(QChar(unicode)) + "\'";
96 + unicodeToChar = QString(QChar(unicode)); //"\'" + QString::QString(QChar(unicode)) + "\'";
97 return unicodeToChar;
98 } else {
99 // Last column (error weight)
100 --- a/sql/startsql.cpp
101 +++ b/sql/startsql.cpp
102 @@ -344,7 +344,7 @@ bool StartSql::updateOwnLesson(QString l
103 for (i = 0; i < content.size(); i++) {
104 //simplifiedContent = QString::QString(
105 // content.at(i)).replace(QChar(0x27), "''", Qt::CaseSensitive).simplified();
106 - simplifiedContent = trim(QString::QString(
107 + simplifiedContent = trim(QString(
108 content.at(i)).replace(QChar(0x27), "''", Qt::CaseSensitive));
109
110 if (!query.exec("INSERT INTO own_content VALUES(NULL,'" +
111 --- a/def/defines.h
112 +++ b/def/defines.h
113 @@ -27,9 +27,9 @@ Foundation, Inc., 51 Franklin Street, Fi
114 #define DEFINES_H
115
116 // OS constants
117 -#define APP_WIN true
118 +#define APP_WIN false
119 #define APP_MAC false
120 -#define APP_X11 false
121 +#define APP_X11 true
122 #define APP_PORTABLE false //at least one of the 3 OS must be true too!
123
124 // Languages
125 @@ -47,6 +47,7 @@ Foundation, Inc., 51 Franklin Street, Fi
126 #define APP_URL "http://www.tipp10.com"
127 #define APP_DB "tipp10v2.template"
128 #define APP_USER_DB "tipp10v2.db"
129 +#define APP_SHARE_DIR "/usr/share/tipp10"
130
131 // Update constants
132 #define UPDATE_URL "www.tipp10.com"
133 --- a/tipp10.pro
134 +++ b/tipp10.pro
135 @@ -88,3 +88,15 @@ SOURCES += main.cpp \
136 sql/startsql.cpp \
137 games/abcrainwidget.cpp \
138 games/charball.cpp
139 +
140 +target.path = /usr/bin/
141 +INSTALLS += target
142 +share.path = /usr/share/tipp10/
143 +share.files = release/* *wav
144 +INSTALLS += share
145 +desktop.path = /usr/share/applications/
146 +desktop.files = tipp10.desktop
147 +INSTALLS += desktop
148 +pixmap.path = /usr/share/pixmaps/
149 +pixmap.files = tipp10.png
150 +INSTALLS += pixmap
151 --- a/sql/connection.h
152 +++ b/sql/connection.h
153 @@ -179,11 +179,13 @@ static bool createConnection() {
154 CANCEL_NO, "Betroffener Pfad:\n" + dbPath);*/
155 // Try to create new databae in user path
156 // Exist a database in the program dir?
157 - if (QFile::exists(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate)) {
158 + // if (QFile::exists(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate)) {
159 + if (QFile::exists(QString(APP_SHARE_DIR) + "/" + dbNameTemplate)) {
160 //if (QFile::exists(":/" + dbNameTemplate)) {
161 // A database exist in the program dir
162 // -> copy database to user home dir
163 - QFile file(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate);
164 + // QFile file(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate);
165 + QFile file(QString(APP_SHARE_DIR) + "/" + dbNameTemplate);
166 //QFile file(":/" + dbNameTemplate);
167 if (file.copy(dbPath)) {
168 QFile::setPermissions(dbPath, QFile::permissions(dbPath) | QFile::WriteUser);
169 @@ -229,7 +231,8 @@ static bool createConnection() {
170 // Exist a database in user's home dir?
171 if (!QFile::exists(dbPath)) {
172 // Exist a database template in the program dir?
173 - dbPath = QCoreApplication::applicationDirPath() + "/" + dbNameTemplate;
174 + // dbPath = QCoreApplication::applicationDirPath() + "/" + dbNameTemplate;
175 + dbPath = QString(APP_SHARE_DIR) + "/" + dbNameTemplate;
176 //dbPath = ":/" + dbNameTemplate;
177 if (QFile::exists(dbPath)) {
178 // A database template exist in the program dir
179 --- a/widget/helpbrowser.cpp
180 +++ b/widget/helpbrowser.cpp
181 @@ -52,13 +52,15 @@ HelpBrowser::HelpBrowser(QString link, Q
182 textBrowser->setOpenExternalLinks(true);
183
184 textBrowser->setSource(QString("file:///") +
185 - QCoreApplication::applicationDirPath() +
186 + // QCoreApplication::applicationDirPath() +
187 + APP_SHARE_DIR +
188 QString("/help/") + language + QString("/index.html"));
189
190 if (link != "") {
191
192 textBrowser->setSource(QString("file:///") +
193 - QCoreApplication::applicationDirPath() +
194 + // QCoreApplication::applicationDirPath() +
195 + APP_SHARE_DIR +
196 QString("/help/") + language + QString("/content/") + link);
197
198 }
199 --- a/tipp10.desktop
200 +++ b/tipp10.desktop
201 @@ -1,10 +1,10 @@
202 [Desktop Entry]
203 -Encoding=UTF-8
204 Name=TIPP10
205 Comment=Touch Typing Tutor
206 Comment[de]=10-Finger-Schreibtrainer
207 Exec=tipp10
208 Icon=tipp10.png
209 Terminal=false
210 Type=Application
211 Categories=Education;
212 +Keywords=learning;touchtyping