konversation: add patch to avoid DCC crashes, rebuild.

This commit is contained in:
shainer 2016-05-08 16:20:04 +01:00
parent b1c8b03a7d
commit 4aaec1314a
2 changed files with 65 additions and 3 deletions

View File

@ -3,7 +3,7 @@ source ../kdeapps.conf
pkgname=konversation
pkgver=1.6
pkgrel=2
pkgrel=3
pkgdesc="A user friendly IRC client for KDE"
arch=('x86_64')
url="http://konversation.kde.org"
@ -13,11 +13,15 @@ license=('GPL2' 'FDL')
categories=('communication')
screenshots=('http://konversation.kde.org/screenshots/konversation13_2.png')
install=${pkgname}.install
source=("http://download.kde.org/stable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.xz")
sha1sums=('16e8c1969b04c0946b48a436e8825654b0029bb9')
source=("http://download.kde.org/stable/${pkgname}/${pkgver}/src/${pkgname}-${pkgver}.tar.xz"
avoid-dcc-crashes.patch)
sha1sums=('16e8c1969b04c0946b48a436e8825654b0029bb9'
'357fe9815f3ac35bde5718fc6f556ba037e0b72c')
prepare(){
mkdir -p build
cd ${srcdir}/${pkgname}-${pkgver}
patch -p1 -i ../../avoid-dcc-crashes.patch
}
build() {
@ -30,3 +34,4 @@ package() {
cd build
make DESTDIR=${pkgdir} install
}

View File

@ -0,0 +1,57 @@
From 459d1f949caee1e15ee8d3f1b55dccedf923b1cc Mon Sep 17 00:00:00 2001
From: shainer <syn.shainer@gmail.com>
Date: Thu, 5 May 2016 00:36:10 +0100
Subject: [PATCH] canMoveView{Left,Right} returns a safe default in case of
invalid views.
---
src/viewer/viewcontainer.cpp | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/viewer/viewcontainer.cpp b/src/viewer/viewcontainer.cpp
index aafa5cc..a2308bc 100644
--- a/src/viewer/viewcontainer.cpp
+++ b/src/viewer/viewcontainer.cpp
@@ -54,7 +54,6 @@
#include <KWindowSystem>
#include <KIconLoader>
-
using namespace Konversation;
ViewMimeData::ViewMimeData(ChatWindow *view) : QMimeData()
@@ -1818,6 +1817,11 @@ bool ViewContainer::canMoveViewLeft() const
ChatWindow* view = static_cast<ChatWindow*>(m_tabWidget->widget(index));
+ // Safeguard in case we get returned an invalid object for some reason
+ if (view == nullptr) {
+ return false;
+ }
+
if (view->isTopLevelView() && index > 0) {
return true;
} else if (!view->isTopLevelView()) {
@@ -1842,6 +1846,11 @@ bool ViewContainer::canMoveViewRight() const
ChatWindow* view = static_cast<ChatWindow*>(m_tabWidget->widget(index));
+ // Safeguard in case we get returned an invalid object for some reason
+ if (view == nullptr) {
+ return false;
+ }
+
if (view->isTopLevelView()) {
int lastTopLevelView = -1;
@@ -2630,6 +2639,7 @@ void ViewContainer::closeDccPanel()
{
// hide it from view, does not delete it
if (m_tabWidget) m_tabWidget->removeTab(m_tabWidget->indexOf(m_dccPanel));
+
m_dccPanelOpen=false;
(dynamic_cast<KToggleAction*>(actionCollection()->action("open_dccstatus_window")))->setChecked(false);
}
--
2.7.4