pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel/kdiff3 kdiff3: add patches to fix crashes, etc.
details: https://anonhg.NetBSD.org/pkgsrc/rev/0d09b794ffa1
branches: trunk
changeset: 409131:0d09b794ffa1
user: gutteridge <gutteridge%pkgsrc.org@localhost>
date: Thu Jan 16 02:37:30 2020 +0000
description:
kdiff3: add patches to fix crashes, etc.
diffstat:
devel/kdiff3/Makefile | 4 +-
devel/kdiff3/distinfo | 8 +-
devel/kdiff3/patches/patch-src_directorymergewindow.cpp | 52 +++++++
devel/kdiff3/patches/patch-src_guiutils.h | 106 ++++++++++++++++
devel/kdiff3/patches/patch-src_kdiff3.cpp | 16 ++
devel/kdiff3/patches/patch-src_mergeresultwindow.cpp | 73 +++++++++++
devel/kdiff3/patches/patch-src_mergeresultwindow.h | 53 ++++++++
devel/kdiff3/patches/patch-src_pdiff.cpp | 28 ++++
8 files changed, 337 insertions(+), 3 deletions(-)
diffs (truncated from 383 to 300 lines):
diff -r d108f1f91d65 -r 0d09b794ffa1 devel/kdiff3/Makefile
--- a/devel/kdiff3/Makefile Thu Jan 16 02:31:49 2020 +0000
+++ b/devel/kdiff3/Makefile Thu Jan 16 02:37:30 2020 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.59 2019/11/03 10:39:15 rillig Exp $
+# $NetBSD: Makefile,v 1.60 2020/01/16 02:37:30 gutteridge Exp $
VERSION= 1.8.1
-PKGREVISION= 1
+PKGREVISION= 2
DISTNAME= kdiff3-${VERSION}
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_KDE:=kdiff3/}
diff -r d108f1f91d65 -r 0d09b794ffa1 devel/kdiff3/distinfo
--- a/devel/kdiff3/distinfo Thu Jan 16 02:31:49 2020 +0000
+++ b/devel/kdiff3/distinfo Thu Jan 16 02:37:30 2020 +0000
@@ -1,7 +1,13 @@
-$NetBSD: distinfo,v 1.8 2019/11/03 04:01:32 gutteridge Exp $
+$NetBSD: distinfo,v 1.9 2020/01/16 02:37:30 gutteridge Exp $
SHA1 (kdiff3-1.8.1.tar.xz) = cfb63e7fb8ef81e9ebc0ae47d6922f25a32a1ef9
RMD160 (kdiff3-1.8.1.tar.xz) = b5076a50461f3612071aa08732c1d7c3b5ec5d8b
SHA512 (kdiff3-1.8.1.tar.xz) = 09cddac0f3adffa91f1986dfb50982deb1c6a31c232215da8a2a396d7525b4d28ef6d3febdcd4ba89cf9f6371a7b34441ef4e10aa0e3468fadf95fb7f78d7720
Size (kdiff3-1.8.1.tar.xz) = 897692 bytes
+SHA1 (patch-src_directorymergewindow.cpp) = a2b429584e30467501ccadbc9266ffbf05250900
+SHA1 (patch-src_guiutils.h) = 82bb9629ce73057beb5e81cac031ef9b881d90ab
+SHA1 (patch-src_kdiff3.cpp) = d5c497d02064f716ea8a26521061605477fd9272
+SHA1 (patch-src_mergeresultwindow.cpp) = c7da5bcc2f9834a48e1fdd90d070295c6dc62332
+SHA1 (patch-src_mergeresultwindow.h) = 22412d26ff9879abd4759387fbd3fd195593b028
+SHA1 (patch-src_pdiff.cpp) = d88157d208116c63cbd7cc85b96a2717bd675a80
SHA1 (patch-src_smalldialogs.cpp) = d189a1631ba5bed1d794babb11764eff40efcf07
diff -r d108f1f91d65 -r 0d09b794ffa1 devel/kdiff3/patches/patch-src_directorymergewindow.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/kdiff3/patches/patch-src_directorymergewindow.cpp Thu Jan 16 02:37:30 2020 +0000
@@ -0,0 +1,52 @@
+$NetBSD: patch-src_directorymergewindow.cpp,v 1.1 2020/01/16 02:37:30 gutteridge Exp $
+
+kdiff3 fails to close files properly leading to stability and speed issues.
+Patches via Fedora:
+https://src.fedoraproject.org/rpms/kdiff3/c/8a700c10780b157e681637404e97718f5ba0cff2
+https://src.fedoraproject.org/rpms/kdiff3/c/bc38b46ef5c96b2b7800e1195b3895527bceea65
+
+--- src/directorymergewindow.cpp.orig 2019-05-18 01:01:30.000000000 +0000
++++ src/directorymergewindow.cpp
+@@ -741,6 +741,7 @@ bool DirectoryMergeWindow::DirectoryMerg
+
+ if(!fi2.open(QIODevice::ReadOnly))
+ {
++ fi1.close();
+ status = fi2.errorString();
+ return bEqual;
+ }
+@@ -758,17 +759,23 @@ bool DirectoryMergeWindow::DirectoryMerg
+ if(len != fi1.read(&buf1[0], len))
+ {
+ status = fi1.errorString();
++ fi1.close();
++ fi2.close();
+ return bEqual;
+ }
+
+ if(len != fi2.read(&buf2[0], len))
+ {
+- status = fi2.errorString();;
++ status = fi2.errorString();
++ fi1.close();
++ fi2.close();
+ return bEqual;
+ }
+
+ if(memcmp(&buf1[0], &buf2[0], len) != 0)
+ {
++ fi1.close();
++ fi2.close();
+ bError = false;
+ return bEqual;
+ }
+@@ -780,6 +787,9 @@ bool DirectoryMergeWindow::DirectoryMerg
+ // If the program really arrives here, then the files are really equal.
+ bError = false;
+ bEqual = true;
++
++ fi1.close();
++ fi2.close();
+ return bEqual;
+ }
+
diff -r d108f1f91d65 -r 0d09b794ffa1 devel/kdiff3/patches/patch-src_guiutils.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/kdiff3/patches/patch-src_guiutils.h Thu Jan 16 02:37:30 2020 +0000
@@ -0,0 +1,106 @@
+$NetBSD: patch-src_guiutils.h,v 1.1 2020/01/16 02:37:30 gutteridge Exp $
+
+Fix missing menu items. Patch via Fedora:
+https://src.fedoraproject.org/rpms/kdiff3/c/bc38b46ef5c96b2b7800e1195b3895527bceea65
+
+--- src/guiutils.h.orig 2019-05-18 01:01:30.000000000 +0000
++++ src/guiutils.h
+@@ -129,6 +129,98 @@ namespace GuiUtils {
+ theAction->setIconText( iconText );
+ return theAction;
+ }
++
++
++ //Allow actions to be created without connecting them immediately.
++
++ template <class T>
++ inline typename std::enable_if<std::is_same<T, QAction>::value, QAction>::type* createAction(
++ const QString& text,
++ KActionCollection* ac,
++ const QString& actionName)
++ {
++ Q_ASSERT(ac != nullptr);
++ QAction* theAction;
++
++ theAction = ac->addAction(actionName);
++ theAction->setText(text);
++
++ return theAction;
++ }
++
++ template <class T>
++ inline typename std::enable_if<std::is_same<T, KToggleAction>::value, KToggleAction>::type* createAction(
++ const QString& text,
++ KActionCollection* ac,
++ const QString &actionName) {
++ Q_ASSERT( ac != nullptr );
++ KToggleAction* theAction = new KToggleAction(ac);
++ ac->addAction( actionName, theAction );
++ theAction->setText( text );
++ return theAction;
++ }
++
++ template <class T>
++ T* createAction(
++ const QString& text,
++ const QKeySequence& shortcut,
++ KActionCollection* ac,
++ const QString &actionName)
++ {
++ T* theAction = createAction<T>( text, ac, actionName );
++ ac->setDefaultShortcut(theAction, shortcut);
++ return theAction;
++ }
++ template <class T>
++ T* createAction(
++ const QString& text,
++ const QIcon& icon,
++ KActionCollection* ac,
++ const QString &actionName)
++ {
++ T* theAction = createAction<T>( text, ac, actionName );
++ theAction->setIcon( icon );
++ return theAction;
++ }
++ template <class T>
++ T* createAction(
++ const QString& text,
++ const QIcon& icon,
++ const QString& iconText,
++ KActionCollection* ac,
++ const QString &actionName)
++ {
++ T* theAction = createAction<T>( text, ac, actionName );
++ theAction->setIcon( icon );
++ theAction->setIconText( iconText );
++ return theAction;
++ }
++ template <class T>
++ T* createAction(
++ const QString& text,
++ const QIcon& icon,
++ const QKeySequence& shortcut,
++ KActionCollection* ac,
++ const QString &actionName)
++ {
++ T* theAction = createAction<T>( text, shortcut, ac, actionName );
++ theAction->setIcon( icon );
++ return theAction;
++ }
++ template <class T>
++ T* createAction(
++ const QString& text,
++ const QIcon& icon,
++ const QString& iconText,
++ const QKeySequence& shortcut,
++ KActionCollection* ac,
++ const QString &actionName)
++ {
++ T* theAction = createAction<T>( text, shortcut, ac, actionName );
++ theAction->setIcon( icon );
++ theAction->setIconText( iconText );
++ return theAction;
++ }
+ }
+
+ #endif
diff -r d108f1f91d65 -r 0d09b794ffa1 devel/kdiff3/patches/patch-src_kdiff3.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/kdiff3/patches/patch-src_kdiff3.cpp Thu Jan 16 02:37:30 2020 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_kdiff3.cpp,v 1.1 2020/01/16 02:37:30 gutteridge Exp $
+
+Fix missing menu items. Patch via Fedora:
+https://src.fedoraproject.org/rpms/kdiff3/c/bc38b46ef5c96b2b7800e1195b3895527bceea65
+
+--- src/kdiff3.cpp.orig 2019-05-18 01:01:30.000000000 +0000
++++ src/kdiff3.cpp
+@@ -312,6 +312,8 @@ KDiff3App::KDiff3App(QWidget* pParent, c
+ ///////////////////////////////////////////////////////////////////
+ // call inits to invoke all other construction parts
+ initActions(actionCollection());
++ MergeResultWindow::initActions(actionCollection());
++
+ initStatusBar();
+
+ m_pFindDialog = new FindDialog(this);
diff -r d108f1f91d65 -r 0d09b794ffa1 devel/kdiff3/patches/patch-src_mergeresultwindow.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/kdiff3/patches/patch-src_mergeresultwindow.cpp Thu Jan 16 02:37:30 2020 +0000
@@ -0,0 +1,73 @@
+$NetBSD: patch-src_mergeresultwindow.cpp,v 1.1 2020/01/16 02:37:30 gutteridge Exp $
+
+Fix missing menu items. Patch via Fedora:
+https://src.fedoraproject.org/rpms/kdiff3/c/bc38b46ef5c96b2b7800e1195b3895527bceea65
+
+--- src/mergeresultwindow.cpp.orig 2019-05-18 01:01:30.000000000 +0000
++++ src/mergeresultwindow.cpp
+@@ -55,6 +55,16 @@ int g_bAutoSolve = true;
+
+ #undef leftInfoWidth
+
++QAction* MergeResultWindow::chooseAEverywhere = nullptr;
++QAction* MergeResultWindow::chooseBEverywhere = nullptr;
++QAction* MergeResultWindow::chooseCEverywhere = nullptr;
++QAction* MergeResultWindow::chooseAForUnsolvedConflicts = nullptr;
++QAction* MergeResultWindow::chooseBForUnsolvedConflicts = nullptr;
++QAction* MergeResultWindow::chooseCForUnsolvedConflicts = nullptr;
++QAction* MergeResultWindow::chooseAForUnsolvedWhiteSpaceConflicts = nullptr;
++QAction* MergeResultWindow::chooseBForUnsolvedWhiteSpaceConflicts = nullptr;
++QAction* MergeResultWindow::chooseCForUnsolvedWhiteSpaceConflicts = nullptr;
++
+ MergeResultWindow::MergeResultWindow(
+ QWidget* pParent,
+ Options* pOptions,
+@@ -148,6 +158,8 @@ void MergeResultWindow::init(
+ showUnsolvedConflictsStatusMessage();
+ }
+
++//This must be called before KXMLGui::SetXMLFile and friends or the actions will not be shown in the menu.
++//At that point in startup we don't have a MergeResultWindow object so we cannot connect the signals yet.
+ void MergeResultWindow::initActions(KActionCollection* ac)
+ {
+ if(ac == nullptr){
+@@ -155,15 +167,30 @@ void MergeResultWindow::initActions(KAct
+ exit(-1);//we cannot recover from this.
+ }
+
+- chooseAEverywhere = GuiUtils::createAction<QAction>(i18n("Choose A Everywhere"), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_1), this, &MergeResultWindow::slotChooseAEverywhere, ac,
"merge_choose_a_everywhere");
+- chooseBEverywhere = GuiUtils::createAction<QAction>(i18n("Choose B Everywhere"), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_2), this, &MergeResultWindow::slotChooseBEverywhere, ac,
"merge_choose_b_everywhere");
+- chooseCEverywhere = GuiUtils::createAction<QAction>(i18n("Choose C Everywhere"), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_3), this, &MergeResultWindow::slotChooseCEverywhere, ac,
"merge_choose_c_everywhere");
+- chooseAForUnsolvedConflicts = GuiUtils::createAction<QAction>(i18n("Choose A for All Unsolved Conflicts"), this, &MergeResultWindow::slotChooseAForUnsolvedConflicts, ac,
"merge_choose_a_for_unsolved_conflicts");
+- chooseBForUnsolvedConflicts = GuiUtils::createAction<QAction>(i18n("Choose B for All Unsolved Conflicts"), this, &MergeResultWindow::slotChooseBForUnsolvedConflicts, ac,
"merge_choose_b_for_unsolved_conflicts");
+- chooseCForUnsolvedConflicts = GuiUtils::createAction<QAction>(i18n("Choose C for All Unsolved Conflicts"), this, &MergeResultWindow::slotChooseCForUnsolvedConflicts, ac,
"merge_choose_c_for_unsolved_conflicts");
+- chooseAForUnsolvedWhiteSpaceConflicts = GuiUtils::createAction<QAction>(i18n("Choose A for All Unsolved Whitespace Conflicts"), this,
&MergeResultWindow::slotChooseAForUnsolvedWhiteSpaceConflicts, ac, "merge_choose_a_for_unsolved_whitespace_conflicts");
+- chooseBForUnsolvedWhiteSpaceConflicts = GuiUtils::createAction<QAction>(i18n("Choose B for All Unsolved Whitespace Conflicts"), this,
&MergeResultWindow::slotChooseBForUnsolvedWhiteSpaceConflicts, ac, "merge_choose_b_for_unsolved_whitespace_conflicts");
+- chooseCForUnsolvedWhiteSpaceConflicts = GuiUtils::createAction<QAction>(i18n("Choose C for All Unsolved Whitespace Conflicts"), this,
&MergeResultWindow::slotChooseCForUnsolvedWhiteSpaceConflicts, ac, "merge_choose_c_for_unsolved_whitespace_conflicts");
++ chooseAEverywhere = GuiUtils::createAction<QAction>(i18n("Choose A Everywhere"), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_1), ac, "merge_choose_a_everywhere");
++ chooseBEverywhere = GuiUtils::createAction<QAction>(i18n("Choose B Everywhere"), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_2), ac, "merge_choose_b_everywhere");
++ chooseCEverywhere = GuiUtils::createAction<QAction>(i18n("Choose C Everywhere"), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_3), ac, "merge_choose_c_everywhere");
++ chooseAForUnsolvedConflicts = GuiUtils::createAction<QAction>(i18n("Choose A for All Unsolved Conflicts"), ac, "merge_choose_a_for_unsolved_conflicts");
++ chooseBForUnsolvedConflicts = GuiUtils::createAction<QAction>(i18n("Choose B for All Unsolved Conflicts"), ac, "merge_choose_b_for_unsolved_conflicts");
++ chooseCForUnsolvedConflicts = GuiUtils::createAction<QAction>(i18n("Choose C for All Unsolved Conflicts"), ac, "merge_choose_c_for_unsolved_conflicts");
++ chooseAForUnsolvedWhiteSpaceConflicts = GuiUtils::createAction<QAction>(i18n("Choose A for All Unsolved Whitespace Conflicts"), ac, "merge_choose_a_for_unsolved_whitespace_conflicts");
++ chooseBForUnsolvedWhiteSpaceConflicts = GuiUtils::createAction<QAction>(i18n("Choose B for All Unsolved Whitespace Conflicts"), ac, "merge_choose_b_for_unsolved_whitespace_conflicts");
++ chooseCForUnsolvedWhiteSpaceConflicts = GuiUtils::createAction<QAction>(i18n("Choose C for All Unsolved Whitespace Conflicts"), ac, "merge_choose_c_for_unsolved_whitespace_conflicts");
++}
++
++void MergeResultWindow::connectActions()
++{
++ QObject::connect(chooseAEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseAEverywhere);
++ QObject::connect(chooseBEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseBEverywhere);
++ QObject::connect(chooseCEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseCEverywhere);
++
++ QObject::connect(chooseAForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseAForUnsolvedConflicts);
++ QObject::connect(chooseBForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseBForUnsolvedConflicts);
++ QObject::connect(chooseCForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseCForUnsolvedConflicts);
++
++ QObject::connect(chooseAForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseAForUnsolvedWhiteSpaceConflicts);
++ QObject::connect(chooseBForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseBForUnsolvedWhiteSpaceConflicts);
++ QObject::connect(chooseCForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseCForUnsolvedWhiteSpaceConflicts);
+ }
+
+ void MergeResultWindow::showUnsolvedConflictsStatusMessage()
diff -r d108f1f91d65 -r 0d09b794ffa1 devel/kdiff3/patches/patch-src_mergeresultwindow.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/kdiff3/patches/patch-src_mergeresultwindow.h Thu Jan 16 02:37:30 2020 +0000
@@ -0,0 +1,53 @@
+$NetBSD: patch-src_mergeresultwindow.h,v 1.1 2020/01/16 02:37:30 gutteridge Exp $
+
Home |
Main Index |
Thread Index |
Old Index