app-editors/kile: Drop kde-frameworks/khtml dep, various fixes

- update HOMEPAGE while at it
- drop obsolete blocker

KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=413473
KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=413506
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2020-10-17 21:57:45 +02:00
parent e4e21e515d
commit 7931d9873c
5 changed files with 358 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
From 483743aa9f194376a8b496ac4e58a946070a36af Mon Sep 17 00:00:00 2001
From: Michel Ludwig <michel.ludwig@kdemail.net>
Date: Sun, 1 Dec 2019 09:09:55 +0100
Subject: [PATCH] Don't crash when deleting templates
BUG: 413506
---
src/dialogs/managetemplatesdialog.cpp | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/src/dialogs/managetemplatesdialog.cpp b/src/dialogs/managetemplatesdialog.cpp
index fe6537ad..c5298b21 100644
--- a/src/dialogs/managetemplatesdialog.cpp
+++ b/src/dialogs/managetemplatesdialog.cpp
@@ -317,17 +317,6 @@ bool ManageTemplatesDialog::removeTemplate()
KileTemplate::Info templateInfo = templateItem->getTemplateInfo();
- KIO::StatJob* statJob = KIO::stat(QUrl::fromUserInput(templateInfo.path), KIO::StatJob::DestinationSide, 0);
- KIO::StatJob* statJob2 = KIO::stat(QUrl::fromUserInput(templateInfo.icon), KIO::StatJob::DestinationSide, 0);
- KJobWidgets::setWindow(statJob, this);
- KJobWidgets::setWindow(statJob2, this);
- statJob->exec();
- statJob2->exec();
- if ((statJob->error() && statJob2->error()) || !QFileInfo(templateInfo.icon).exists()) {
- KMessageBox::error(this, i18n("Sorry, but you do not have the necessary permissions to remove the selected template."));
- return false;
- }
-
if (KMessageBox::warningYesNo(this, i18n("You are about to remove the template \"%1\"; are you sure?", templateInfo.name)) == KMessageBox::No) {
return false;
}
--
GitLab

View File

@@ -0,0 +1,25 @@
From 5c268679da2fb2cdc414890bdd79a5592e37cb22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= <andrius@stikonas.eu>
Date: Tue, 15 Sep 2020 15:33:51 +0100
Subject: [PATCH] Fix KToolbar usage.
---
src/widgets/scriptsmanagementwidget.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/widgets/scriptsmanagementwidget.cpp b/src/widgets/scriptsmanagementwidget.cpp
index 79552da3..94f58f18 100644
--- a/src/widgets/scriptsmanagementwidget.cpp
+++ b/src/widgets/scriptsmanagementwidget.cpp
@@ -66,7 +66,7 @@ ScriptsManagement::ScriptsManagement(KileInfo *kileInfo, QWidget *parent, const
baseLayout->setContentsMargins(0, 0, 0, 0);
setLayout(baseLayout);
- m_toolBar = new KToolBar(this, "scriptControlToolBar");
+ m_toolBar = new KToolBar("scriptControlToolBar", this);
m_toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_toolBar->setIconDimensions(KIconLoader::SizeSmall);
--
GitLab

View File

@@ -0,0 +1,164 @@
From 7a55cf2d93c9daa13f2fa2ec1ae25646507cfc0c Mon Sep 17 00:00:00 2001
From: Michel Ludwig <michel.ludwig@kdemail.net>
Date: Sun, 1 Dec 2019 15:56:05 +0100
Subject: [PATCH] Fix overriding of existing templates
Also, don't delete the original file after the template has been
created from it.
BUG: 413473
* asturm 2020-10-17: backport to 2.9.93 (drop unnecessary string change)
---
src/dialogs/managetemplatesdialog.cpp | 7 ++-
src/templates.cpp | 78 ++-------------------------
src/templates.h | 10 ++--
3 files changed, 12 insertions(+), 83 deletions(-)
diff --git a/src/dialogs/managetemplatesdialog.cpp b/src/dialogs/managetemplatesdialog.cpp
index c5298b21..77d5d6ff 100644
--- a/src/dialogs/managetemplatesdialog.cpp
+++ b/src/dialogs/managetemplatesdialog.cpp
@@ -292,11 +292,10 @@ void ManageTemplatesDialog::addTemplate()
reject();
return;
}
- returnValue = m_templateManager->replace(templateInfo, m_sourceURL, templateName, iconURL);
- }
- else {
- returnValue = m_templateManager->add(m_sourceURL, templateName, iconURL);
}
+
+ returnValue = m_templateManager->add(m_sourceURL, templateName, iconURL);
+
if (!returnValue) {
KMessageBox::error(this, i18n("Failed to create the template."));
reject();
diff --git a/src/templates.cpp b/src/templates.cpp
--- a/src/templates.cpp
+++ b/src/templates.cpp
@@ -82,7 +82,10 @@ bool Manager::copyAppData(const QUrl &src, const QString& subdir, const QString&
testDir.mkpath(dir);
}
// copy file
- KIO::FileCopyJob* copyJob = KIO::file_copy(src, targetURL);
+ if(src == targetURL) { // copying a file over itself
+ return true;
+ }
+ KIO::FileCopyJob* copyJob = KIO::file_copy(src, targetURL, -1, KIO::Overwrite);
KJobWidgets::setWindow(copyJob, m_kileInfo->mainWindow());
return copyJob->exec();
}
@@ -130,77 +133,6 @@ bool Manager::remove(Info ti) {
return removeAppData(ti.path) && removeAppData(ti.icon);
}
-bool Manager::replace(const KileTemplate::Info& toBeReplaced, const QUrl &newTemplateSourceURL, const QString& newName, const QUrl& newIcon) {
- KileDocument::Type type = m_kileInfo->extensions()->determineDocumentType(newTemplateSourceURL);
-
- //start by copying the files that belong to the new template to a safe place
- QString templateTempFile, iconTempFile;
-
- if( newTemplateSourceURL.isLocalFile() ) {
- // file protocol. We do not need the network
- templateTempFile = newTemplateSourceURL.toLocalFile();
- }
- else {
- QTemporaryFile tmpFile;
- tmpFile.setAutoRemove( false );
- tmpFile.open();
-
- templateTempFile = tmpFile.fileName();
- m_TempFilePath = tmpFile.fileName();
- KIO::FileCopyJob* fileCopyJob = KIO::file_copy( newTemplateSourceURL, QUrl::fromLocalFile(templateTempFile), -1, KIO::Overwrite );
- KJobWidgets::setWindow( fileCopyJob, m_kileInfo->mainWindow() );
-
- if( ! fileCopyJob->exec() ) {
- return false;
- }
- }
-
- if( newIcon.isLocalFile() ) {
- // file protocol. We do not need the network
- iconTempFile = newIcon.toLocalFile();
- }
- else {
- QTemporaryFile tmpFile;
- tmpFile.setAutoRemove( false );
- tmpFile.open();
-
- iconTempFile = tmpFile.fileName();
- m_TempFilePath = tmpFile.fileName();
- KIO::FileCopyJob* fileCopyJob = KIO::file_copy( newIcon, QUrl::fromLocalFile(iconTempFile), -1, KIO::Overwrite );
- KJobWidgets::setWindow( fileCopyJob, m_kileInfo->mainWindow() );
-
- if( ! fileCopyJob->exec() ) {
- if( ! templateTempFile.isEmpty() )
- QFile::remove( templateTempFile );
- return false;
- }
- }
-
- //now delete the template that should be replaced
- if(!remove(toBeReplaced)) {
- if( ! templateTempFile.isEmpty() )
- QFile::remove( templateTempFile );
- if( ! iconTempFile.isEmpty() )
- QFile::remove( iconTempFile );
- }
-
- //finally, create the new template
- if(!add(QUrl::fromUserInput(templateTempFile), type, newName, QUrl::fromUserInput(iconTempFile))) {
- if( ! templateTempFile.isEmpty() )
- QFile::remove( templateTempFile );
- if( ! iconTempFile.isEmpty() )
- QFile::remove( iconTempFile );
- return false;
- }
-
- if( ! templateTempFile.isEmpty() )
- QFile::remove( templateTempFile );
- if( ! iconTempFile.isEmpty() )
- QFile::remove( iconTempFile );
-
- return true;
-}
-
void Manager::scanForTemplates() {
KILE_DEBUG_MAIN << "===scanForTemplates()===================";
QStringList dirs = KileUtilities::locateAll(QStandardPaths::AppDataLocation, "templates", QStandardPaths::LocateDirectory);
diff --git a/src/templates.h b/src/templates.h
--- a/src/templates.h
+++ b/src/templates.h
@@ -1,7 +1,7 @@
/***************************************************************************************
begin : Sat Apr 26 2003
copyright : (C) 2003 by Jeroen Wijnhout (wijnhout@science.uva.nl)
- 2007, 2008 by Michel Ludwig (michel.ludwig@kdemail.net)
+ 2007-2019 by Michel Ludwig (michel.ludwig@kdemail.net)
***************************************************************************************/
/***************************************************************************
@@ -79,15 +79,13 @@ public:
**/
bool searchForTemplate(const QString& name, KileDocument::Type& type) const;
- // add a template in $HOME/kile/templates/
+ // Add a template in .kde/share/kile/templates/
+ // This function will override any existing template.
bool add(const QUrl &templateSourceURL, const QString &name, const QUrl &icon);
- // remove a template from $HOME/kile/templates/
+ // Remove a template from .kde/share/kile/templates/
bool remove(KileTemplate::Info ti);
- // replaces a template
- bool replace(const KileTemplate::Info& toBeReplaced, const QUrl &newTemplateSourceURL, const QString& newName, const QUrl& newIcon);
-
// these have to be methods as we cannot use i18n calls in global objects
static QString defaultEmptyTemplateCaption();
static QString defaultEmptyLaTeXTemplateCaption();
--
GitLab

View File

@@ -0,0 +1,58 @@
From 7c050b5e306cab115573aea1bfc951aaaa1203e9 Mon Sep 17 00:00:00 2001
From: Michel Ludwig <michel.ludwig@kdemail.net>
Date: Fri, 22 Nov 2019 09:40:53 +0100
Subject: [PATCH] Remove dependency on KHTML
---
CMakeLists.txt | 1 -
src/CMakeLists.txt | 2 --
src/kilelauncher.cpp | 1 -
3 files changed, 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1bea621f..1b25e3a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,7 +46,6 @@ find_package(KF5 5.31 REQUIRED COMPONENTS
I18n
IconThemes
Init
- KHtml
KIO
Parts
TextEditor
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 77626894..e23480fd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -55,7 +55,6 @@ set(kile_SRCS
dialogs/usermenu/usermenuitem.cpp
dialogs/usermenu/usermenutree.cpp
dialogs/validatorinputdialog.cpp
- docpart.cpp
documentinfo.cpp
editorcommands.cpp
editorextension.cpp
@@ -238,7 +237,6 @@ PUBLIC
KF5::Crash
KF5::DBusAddons
KF5::GuiAddons
- KF5::KHtml
KF5::I18n
KF5::IconThemes
KF5::KIOCore
diff --git a/src/kilelauncher.cpp b/src/kilelauncher.cpp
index c0bcdf9d..24a1f5b4 100644
--- a/src/kilelauncher.cpp
+++ b/src/kilelauncher.cpp
@@ -16,7 +16,6 @@
#include <config.h>
-#include "docpart.h"
#include "kileconfig.h"
#include "kileinfo.h"
#include "kiletool.h"
--
GitLab

View File

@@ -0,0 +1,76 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
ECM_HANDBOOK="forceoptional"
KDE_ORG_CATEGORY="office"
KFMIN=5.74.0
QTMIN=5.14.2
inherit ecm kde.org
DESCRIPTION="Latex Editor and TeX shell based on KDE Frameworks"
HOMEPAGE="https://kde.org/applications/en/kile https://kile.sourceforge.io/"
if [[ ${KDE_BUILD_TYPE} == release ]]; then
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
KEYWORDS="~amd64 ~x86"
fi
LICENSE="FDL-1.2 GPL-2"
SLOT="5"
IUSE="+pdf +png"
DEPEND="
>=dev-qt/qtdbus-${QTMIN}:5
>=dev-qt/qtscript-${QTMIN}:5
>=dev-qt/qttest-${QTMIN}:5
>=dev-qt/qtwidgets-${QTMIN}:5
kde-apps/okular:5
>=kde-frameworks/kconfig-${KFMIN}:5
>=kde-frameworks/kcoreaddons-${KFMIN}:5
>=kde-frameworks/kcrash-${KFMIN}:5
>=kde-frameworks/kdbusaddons-${KFMIN}:5
>=kde-frameworks/kdoctools-${KFMIN}:5
>=kde-frameworks/kguiaddons-${KFMIN}:5
>=kde-frameworks/ki18n-${KFMIN}:5
>=kde-frameworks/kiconthemes-${KFMIN}:5
>=kde-frameworks/kinit-${KFMIN}:5
>=kde-frameworks/kio-${KFMIN}:5
>=kde-frameworks/kparts-${KFMIN}:5
>=kde-frameworks/ktexteditor-${KFMIN}:5
>=kde-frameworks/kwindowsystem-${KFMIN}:5
>=kde-frameworks/kxmlgui-${KFMIN}:5
pdf? ( app-text/poppler[qt5] )
"
RDEPEND="${DEPEND}
kde-apps/konsole:5
kde-apps/okular:5[pdf?]
virtual/latex-base
virtual/tex-base
pdf? (
app-text/ghostscript-gpl
app-text/texlive-core
)
png? (
app-text/dvipng
virtual/imagemagick-tools[png?]
)
"
DOCS=( AUTHORS ChangeLog kile-remote-control.txt README{,.cwl} )
PATCHES=(
"${FILESDIR}/${P}-cmake.patch"
"${FILESDIR}/${P}-no-khtml.patch"
"${FILESDIR}/${P}-fix-crash-when-deleting-templates.patch"
"${FILESDIR}/${P}-fix-overriding-existing-templates.patch"
"${FILESDIR}/${P}-fix-ktoolbar-usage.patch"
)
src_configure() {
local mycmakeargs=(
$(cmake_use_find_package pdf Poppler)
)
ecm_src_configure
}