[qlandkartegt] fix crash when editing diary (#812605)

Dan Horák sharkcz at fedoraproject.org
Mon Apr 16 12:02:06 UTC 2012


commit 212811a511dc4adeda57f651b8e544d60dfcb87e
Author: Dan Horák <dan at danny.cz>
Date:   Mon Apr 16 14:02:01 2012 +0200

    fix crash when editing diary (#812605)

 qlandkartegt-1.4.0-diaryedit.patch |   59 ++++++++++++++++++++++++++++++++++++
 qlandkartegt.spec                  |   13 ++++----
 2 files changed, 66 insertions(+), 6 deletions(-)
---
diff --git a/qlandkartegt-1.4.0-diaryedit.patch b/qlandkartegt-1.4.0-diaryedit.patch
new file mode 100644
index 0000000..4e293f5
--- /dev/null
+++ b/qlandkartegt-1.4.0-diaryedit.patch
@@ -0,0 +1,59 @@
+From c1a1c042c2e7c6848bea56d032c0df33bb16435b Mon Sep 17 00:00:00 2001
+From: kiozen <kiozen at 0913f4f3-0441-0410-8e4e-9da9205379dc>
+Date: Mon, 16 Apr 2012 10:27:17 +0000
+Subject: [PATCH] fix crash in diary code
+
+git-svn-id: https://qlandkartegt.svn.sourceforge.net/svnroot/qlandkartegt/QLandkarteGT/trunk@3308 0913f4f3-0441-0410-8e4e-9da9205379dc
+---
+ src/CDiaryEdit.cpp |   26 ++++++++++++++------------
+ 1 files changed, 14 insertions(+), 12 deletions(-)
+
+diff --git a/src/CDiaryEdit.cpp b/src/CDiaryEdit.cpp
+index 6d8aa66..41b2aa6 100644
+--- a/src/CDiaryEdit.cpp
++++ b/src/CDiaryEdit.cpp
+@@ -477,27 +477,29 @@ void CDiaryEdit::slotCursorPositionChanged()
+     }
+ 
+     QTextTable * tbl = diary.tblTrk;
+-    for(i = 1; i <= diary.trks.count(); i++)
++    if(tbl)
+     {
+-        if(tbl->cellAt(i, eComment).firstCursorPosition() <= cursor && cursor <= tbl->cellAt(i, eComment).lastCursorPosition())
++        for(i = 1; i <= diary.trks.count(); i++)
+         {
+-            return;
++            if(tbl->cellAt(i, eComment).firstCursorPosition() <= cursor && cursor <= tbl->cellAt(i, eComment).lastCursorPosition())
++            {
++                return;
++            }
++
++            if(tbl->cellAt(i, eSym).firstCursorPosition() <= cursor && cursor <= tbl->cellAt(i, eInfo).lastCursorPosition())
++            {
++                textEdit->setTextCursor(tbl->cellAt(i, eComment).lastCursorPosition());
++                return;
++            }
+         }
+ 
+-        if(tbl->cellAt(i, eSym).firstCursorPosition() <= cursor && cursor <= tbl->cellAt(i, eInfo).lastCursorPosition())
++        if(cursor > tbl->cellAt(i-1, eComment).lastCursorPosition())
+         {
+-            textEdit->setTextCursor(tbl->cellAt(i, eComment).lastCursorPosition());
++            textEdit->setTextCursor(tbl->cellAt(i-1, eComment).lastCursorPosition());
+             return;
+         }
+     }
+ 
+-    if(cursor > tbl->cellAt(i-1, eComment).lastCursorPosition())
+-    {
+-        textEdit->setTextCursor(tbl->cellAt(i-1, eComment).lastCursorPosition());
+-        return;
+-    }
+-
+-
+     if(!diary.diaryFrame.isNull())
+     {
+         textEdit->setTextCursor(diary.diaryFrame->lastCursorPosition());
+-- 
+1.7.7.6
+
diff --git a/qlandkartegt.spec b/qlandkartegt.spec
index e2ccd35..d3b3263 100644
--- a/qlandkartegt.spec
+++ b/qlandkartegt.spec
@@ -1,6 +1,6 @@
 Name: qlandkartegt
 Version: 1.4.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: GPS device mapping tool
 
 Group: Applications/Communications
@@ -9,6 +9,8 @@ URL: http://www.qlandkarte.org/
 Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
 # <GL/glu.h> not included by qt >= 4.8
 Patch0: %{name}-1.3.0-glu.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=812605
+Patch1: %{name}-1.4.0-diaryedit.patch
 Requires: garmindev(interface) = 1.18
 Requires: gpsbabel
 
@@ -50,6 +52,7 @@ GDAL tools, but it will simplify their use to the demands of most users.
 %prep
 %setup -q
 %patch0 -p1 -b .glu
+%patch1 -p1 -b .diaryedit
 
 # create build direcotory
 mkdir build
@@ -69,12 +72,7 @@ make install DESTDIR=%{buildroot}
 desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
 
 
-%clean
-rm -rf %{buildroot}
-
-
 %files
-%defattr(-,root,root,-)
 %doc copying changelog.txt
 %{_bindir}/%{name}
 %{_bindir}/map2gcm
@@ -87,6 +85,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Mon Apr 16 2012 Dan Horák <dan[at]danny.cz> 1.4.0-2
+- fix crash when editing diary (#812605)
+
 * Mon Feb 27 2012 Dan Horák <dan[at]danny.cz> 1.4.0-1
 - update to 1.4.0
 


More information about the scm-commits mailing list