kde-applications
This commit is contained in:
@@ -18,56 +18,56 @@ diff --git a/addons/filebrowser/katefilebrowser.cpp b/addons/filebrowser/katefil
|
||||
index 54c1fa1fb..a1e5e4eba 100644
|
||||
--- a/addons/filebrowser/katefilebrowser.cpp
|
||||
+++ b/addons/filebrowser/katefilebrowser.cpp
|
||||
@@ -115,8 +115,6 @@ KateFileBrowser::KateFileBrowser(KTextEditor::MainWindow *mainWindow, QWidget *p
|
||||
connect(m_mainWindow, &KTextEditor::MainWindow::viewChanged, this, &KateFileBrowser::autoSyncFolder);
|
||||
@@ -115,8 +115,6 @@ kateFileBrowser::kateFileBrowser(ktexteditor::MainWindow *mainWindow, QWidget *p
|
||||
connect(m_mainWindow, &ktexteditor::MainWindow::viewChanged, this, &kateFileBrowser::autoSyncFolder);
|
||||
|
||||
connect(m_dirOperator, &KDirOperator::contextMenuAboutToShow, this, &KateFileBrowser::contextMenuAboutToShow);
|
||||
connect(m_dirOperator, &KDirOperator::contextMenuAboutToShow, this, &kateFileBrowser::contextMenuAboutToShow);
|
||||
-
|
||||
- autoSyncFolder();
|
||||
}
|
||||
|
||||
KateFileBrowser::~KateFileBrowser()
|
||||
kateFileBrowser::~kateFileBrowser()
|
||||
diff --git a/addons/filebrowser/katefilebrowserplugin.cpp b/addons/filebrowser/katefilebrowserplugin.cpp
|
||||
index f03c78698..3e415b025 100644
|
||||
--- a/addons/filebrowser/katefilebrowserplugin.cpp
|
||||
+++ b/addons/filebrowser/katefilebrowserplugin.cpp
|
||||
@@ -52,10 +52,7 @@ KTextEditor::ConfigPage *KateFileBrowserPlugin::configPage(int number, QWidget *
|
||||
@@ -52,10 +52,7 @@ ktexteditor::ConfigPage *kateFileBrowserPlugin::configPage(int number, QWidget *
|
||||
if (number != 0) {
|
||||
return nullptr;
|
||||
}
|
||||
- if (!m_views[0]->m_fileBrowser) {
|
||||
- m_views[0]->createFileBrowser(true);
|
||||
- }
|
||||
- return new KateFileBrowserConfigPage(parent, m_views[0]->m_fileBrowser.get());
|
||||
+ return new KateFileBrowserConfigPage(parent, m_views[0]->m_fileBrowser);
|
||||
- return new kateFileBrowserConfigPage(parent, m_views[0]->m_fileBrowser.get());
|
||||
+ return new kateFileBrowserConfigPage(parent, m_views[0]->m_fileBrowser);
|
||||
}
|
||||
// END KateFileBrowserPlugin
|
||||
// END kateFileBrowserPlugin
|
||||
|
||||
@@ -67,50 +64,34 @@ KateFileBrowserPluginView::KateFileBrowserPluginView(KTextEditor::Plugin *plugin
|
||||
KTextEditor::MainWindow::Left,
|
||||
@@ -67,50 +64,34 @@ kateFileBrowserPluginView::kateFileBrowserPluginView(ktexteditor::Plugin *plugin
|
||||
ktexteditor::MainWindow::Left,
|
||||
QIcon::fromTheme(QStringLiteral("document-open")),
|
||||
i18n("Filesystem")))
|
||||
+ , m_fileBrowser(new KateFileBrowser(mainWindow, m_toolView))
|
||||
+ , m_fileBrowser(new kateFileBrowser(mainWindow, m_toolView))
|
||||
, m_mainWindow(mainWindow)
|
||||
{
|
||||
m_toolView->installEventFilter(this);
|
||||
- connect(m_toolView.get(), SIGNAL(toolVisibleChanged(bool)), this, SLOT(createFileBrowser(bool)));
|
||||
}
|
||||
|
||||
-void KateFileBrowserPluginView::readSessionConfig(const KConfigGroup &config)
|
||||
+KateFileBrowserPluginView::~KateFileBrowserPluginView()
|
||||
-void kateFileBrowserPluginView::readSessionConfig(const kconfigGroup &config)
|
||||
+kateFileBrowserPluginView::~kateFileBrowserPluginView()
|
||||
{
|
||||
- if (m_fileBrowser) {
|
||||
- m_fileBrowser->readSessionConfig(config);
|
||||
- } else {
|
||||
- cg.reset(new KConfigGroup(config));
|
||||
- cg.reset(new kconfigGroup(config));
|
||||
- }
|
||||
+ // cleanup, kill toolview + console
|
||||
+ delete m_fileBrowser->parentWidget();
|
||||
}
|
||||
|
||||
-void KateFileBrowserPluginView::writeSessionConfig(KConfigGroup &config)
|
||||
+void KateFileBrowserPluginView::readSessionConfig(const KConfigGroup &config)
|
||||
-void kateFileBrowserPluginView::writeSessionConfig(kconfigGroup &config)
|
||||
+void kateFileBrowserPluginView::readSessionConfig(const kconfigGroup &config)
|
||||
{
|
||||
- if (m_fileBrowser) {
|
||||
- m_fileBrowser->writeSessionConfig(config);
|
||||
@@ -75,8 +75,8 @@ index f03c78698..3e415b025 100644
|
||||
+ m_fileBrowser->readSessionConfig(config);
|
||||
}
|
||||
|
||||
-void KateFileBrowserPluginView::createFileBrowser(bool visible)
|
||||
+void KateFileBrowserPluginView::writeSessionConfig(KConfigGroup &config)
|
||||
-void kateFileBrowserPluginView::createFileBrowser(bool visible)
|
||||
+void kateFileBrowserPluginView::writeSessionConfig(kconfigGroup &config)
|
||||
{
|
||||
- if (!visible) {
|
||||
- return;
|
||||
@@ -86,14 +86,14 @@ index f03c78698..3e415b025 100644
|
||||
- Q_ASSERT(!m_fileBrowser);
|
||||
-
|
||||
- disconnect(m_toolView.get(), SIGNAL(toolVisibleChanged(bool)), this, SLOT(createFileBrowser(bool)));
|
||||
- m_fileBrowser = std::make_unique<KateFileBrowser>(m_mainWindow, m_toolView.get());
|
||||
- m_fileBrowser = std::make_unique<kateFileBrowser>(m_mainWindow, m_toolView.get());
|
||||
- m_fileBrowser->readSessionConfig(*cg);
|
||||
- // delete the config now
|
||||
- cg.reset();
|
||||
+ m_fileBrowser->writeSessionConfig(config);
|
||||
}
|
||||
|
||||
bool KateFileBrowserPluginView::eventFilter(QObject *obj, QEvent *event)
|
||||
bool kateFileBrowserPluginView::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
|
||||
@@ -109,11 +109,11 @@ index 2517d3453..9fb6610c4 100644
|
||||
--- a/addons/filebrowser/katefilebrowserplugin.h
|
||||
+++ b/addons/filebrowser/katefilebrowserplugin.h
|
||||
@@ -11,15 +11,12 @@
|
||||
#ifndef KATE_FILEBROWSER_PLUGIN_H
|
||||
#define KATE_FILEBROWSER_PLUGIN_H
|
||||
#ifndef kate_FILEBROWSER_PLUGIN_H
|
||||
#define kate_FILEBROWSER_PLUGIN_H
|
||||
|
||||
-#include <KConfigGroup>
|
||||
#include <KTextEditor/SessionConfigInterface>
|
||||
-#include <kconfigGroup>
|
||||
#include <ktexteditor/SessionConfigInterface>
|
||||
#include <ktexteditor/configpage.h>
|
||||
#include <ktexteditor/document.h>
|
||||
#include <ktexteditor/mainwindow.h>
|
||||
@@ -121,32 +121,32 @@ index 2517d3453..9fb6610c4 100644
|
||||
|
||||
-#include <memory>
|
||||
-
|
||||
class KateFileBrowser;
|
||||
class KateFileBrowserPluginView;
|
||||
class kateFileBrowser;
|
||||
class kateFileBrowserPluginView;
|
||||
|
||||
@@ -56,16 +53,19 @@ public:
|
||||
*/
|
||||
KateFileBrowserPluginView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mainWindow);
|
||||
kateFileBrowserPluginView(ktexteditor::Plugin *plugin, ktexteditor::MainWindow *mainWindow);
|
||||
|
||||
+ /**
|
||||
+ * Virtual destructor.
|
||||
+ */
|
||||
+ ~KateFileBrowserPluginView() override;
|
||||
+ ~kateFileBrowserPluginView() override;
|
||||
+
|
||||
void readSessionConfig(const KConfigGroup &config) override;
|
||||
void writeSessionConfig(KConfigGroup &config) override;
|
||||
void readSessionConfig(const kconfigGroup &config) override;
|
||||
void writeSessionConfig(kconfigGroup &config) override;
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject *, QEvent *) override;
|
||||
- Q_SLOT void createFileBrowser(bool visible);
|
||||
|
||||
- std::unique_ptr<QWidget> m_toolView;
|
||||
- std::unique_ptr<KateFileBrowser> m_fileBrowser = nullptr;
|
||||
- std::unique_ptr<KConfigGroup> cg;
|
||||
- std::unique_ptr<kateFileBrowser> m_fileBrowser = nullptr;
|
||||
- std::unique_ptr<kconfigGroup> cg;
|
||||
+ QWidget *m_toolView;
|
||||
+ KateFileBrowser *m_fileBrowser;
|
||||
KTextEditor::MainWindow *m_mainWindow;
|
||||
friend class KateFileBrowserPlugin;
|
||||
+ kateFileBrowser *m_fileBrowser;
|
||||
ktexteditor::MainWindow *m_mainWindow;
|
||||
friend class kateFileBrowserPlugin;
|
||||
};
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Revert "fix crash on file browser activation"
|
||||
|
||||
This reverts commit a28624c877cfe6db6ae6ab257f95af36213b25e0.
|
||||
|
||||
=> this fix is not enough, the KConfigGroup is just not valid anymore here
|
||||
=> this fix is not enough, the kconfigGroup is just not valid anymore here
|
||||
in some cases
|
||||
|
||||
BUG: 453795
|
||||
@@ -17,10 +17,10 @@ diff --git a/addons/filebrowser/katefilebrowserplugin.cpp b/addons/filebrowser/k
|
||||
index 6df25239a..f03c78698 100644
|
||||
--- a/addons/filebrowser/katefilebrowserplugin.cpp
|
||||
+++ b/addons/filebrowser/katefilebrowserplugin.cpp
|
||||
@@ -100,12 +100,9 @@ void KateFileBrowserPluginView::createFileBrowser(bool visible)
|
||||
@@ -100,12 +100,9 @@ void kateFileBrowserPluginView::createFileBrowser(bool visible)
|
||||
|
||||
disconnect(m_toolView.get(), SIGNAL(toolVisibleChanged(bool)), this, SLOT(createFileBrowser(bool)));
|
||||
m_fileBrowser = std::make_unique<KateFileBrowser>(m_mainWindow, m_toolView.get());
|
||||
m_fileBrowser = std::make_unique<kateFileBrowser>(m_mainWindow, m_toolView.get());
|
||||
-
|
||||
- // read config only if there yet, see bug 453234
|
||||
- if (cg) {
|
||||
@@ -32,7 +32,7 @@ index 6df25239a..f03c78698 100644
|
||||
+ cg.reset();
|
||||
}
|
||||
|
||||
bool KateFileBrowserPluginView::eventFilter(QObject *obj, QEvent *event)
|
||||
bool kateFileBrowserPluginView::eventFilter(QObject *obj, QEvent *event)
|
||||
--
|
||||
GitLab
|
||||
|
||||
|
||||
@@ -16,14 +16,14 @@ diff -Nuar a/apps/kate/main.cpp b/apps/kate/main.cpp
|
||||
- // Prohibit using sudo or kdesu (but allow using the root user directly)
|
||||
- if (getuid() == 0) {
|
||||
- if (!qEnvironmentVariableIsEmpty("SUDO_USER")) {
|
||||
- std::cout << "Running Kate with sudo can cause bugs and expose you to security vulnerabilities. "
|
||||
- "Instead use Kate normally and you will be prompted for elevated privileges when "
|
||||
- std::cout << "Running kate with sudo can cause bugs and expose you to security vulnerabilities. "
|
||||
- "Instead use kate normally and you will be prompted for elevated privileges when "
|
||||
- "saving documents if needed."
|
||||
- << std::endl;
|
||||
- return EXIT_FAILURE;
|
||||
- } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
|
||||
- std::cout << "Running Kate with kdesu can cause bugs and expose you to security vulnerabilities. "
|
||||
- "Instead use Kate normally and you will be prompted for elevated privileges when "
|
||||
- } else if (!qEnvironmentVariableIsEmpty("kdesu_USER")) {
|
||||
- std::cout << "Running kate with kdesu can cause bugs and expose you to security vulnerabilities. "
|
||||
- "Instead use kate normally and you will be prompted for elevated privileges when "
|
||||
- "saving documents if needed."
|
||||
- << std::endl;
|
||||
- return EXIT_FAILURE;
|
||||
|
||||
@@ -22,7 +22,7 @@ diff -Nuar a/apps/kwrite/main.cpp b/apps/kwrite/main.cpp
|
||||
- "saving documents if needed."
|
||||
- << std::endl;
|
||||
- return EXIT_FAILURE;
|
||||
- } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
|
||||
- } else if (!qEnvironmentVariableIsEmpty("kdesu_USER")) {
|
||||
- std::cout << "Running KWrite with kdesu can cause bugs and expose you to security vulnerabilities. "
|
||||
- "Instead use KWrite normally and you will be prompted for elevated privileges when "
|
||||
- "saving documents if needed."
|
||||
|
||||
@@ -58,67 +58,67 @@ GenericName[vi]=Trình biên tập văn bản nâng cao
|
||||
GenericName[x-test]=xxAdvanced Text Editorxx
|
||||
GenericName[zh_CN]=高级文本编辑器
|
||||
GenericName[zh_TW]=進階文字編輯器
|
||||
Name=Kate
|
||||
Name=kate
|
||||
Name[ar]=كيت
|
||||
Name[ast]=Kate
|
||||
Name[be]=Kate
|
||||
Name[bg]=Kate
|
||||
Name[bs]=Kate
|
||||
Name[ca]=Kate
|
||||
Name[ca@valencia]=Kate
|
||||
Name[cs]=Kate
|
||||
Name[da]=Kate
|
||||
Name[de]=Kate
|
||||
Name[el]=Kate
|
||||
Name[en_GB]=Kate
|
||||
Name[eo]=Kate
|
||||
Name[es]=Kate
|
||||
Name[et]=Kate
|
||||
Name[eu]=Kate
|
||||
Name[fi]=Kate
|
||||
Name[fr]=Kate
|
||||
Name[ga]=Kate
|
||||
Name[gl]=Kate
|
||||
Name[he]=Kate
|
||||
Name[hu]=Kate
|
||||
Name[ia]=Kate
|
||||
Name[it]=Kate
|
||||
Name[ja]=Kate
|
||||
Name[kk]=Kate
|
||||
Name[km]=Kate
|
||||
Name[ko]=Kate
|
||||
Name[lt]=Kate
|
||||
Name[lv]=Kate
|
||||
Name[ast]=kate
|
||||
Name[be]=kate
|
||||
Name[bg]=kate
|
||||
Name[bs]=kate
|
||||
Name[ca]=kate
|
||||
Name[ca@valencia]=kate
|
||||
Name[cs]=kate
|
||||
Name[da]=kate
|
||||
Name[de]=kate
|
||||
Name[el]=kate
|
||||
Name[en_GB]=kate
|
||||
Name[eo]=kate
|
||||
Name[es]=kate
|
||||
Name[et]=kate
|
||||
Name[eu]=kate
|
||||
Name[fi]=kate
|
||||
Name[fr]=kate
|
||||
Name[ga]=kate
|
||||
Name[gl]=kate
|
||||
Name[he]=kate
|
||||
Name[hu]=kate
|
||||
Name[ia]=kate
|
||||
Name[it]=kate
|
||||
Name[ja]=kate
|
||||
Name[kk]=kate
|
||||
Name[km]=kate
|
||||
Name[ko]=kate
|
||||
Name[lt]=kate
|
||||
Name[lv]=kate
|
||||
Name[mr]=केट
|
||||
Name[ms]=Kate
|
||||
Name[nb]=Kate
|
||||
Name[nds]=Kate
|
||||
Name[ms]=kate
|
||||
Name[nb]=kate
|
||||
Name[nds]=kate
|
||||
Name[ne]=केट
|
||||
Name[nl]=Kate
|
||||
Name[nn]=Kate
|
||||
Name[nl]=kate
|
||||
Name[nn]=kate
|
||||
Name[pa]=ਕੇਟ
|
||||
Name[pl]=Kate
|
||||
Name[pt]=Kate
|
||||
Name[pt_BR]=Kate
|
||||
Name[ro]=Kate
|
||||
Name[ru]=Kate
|
||||
Name[si]=Kate
|
||||
Name[sk]=Kate
|
||||
Name[sl]=Kate
|
||||
Name[pl]=kate
|
||||
Name[pt]=kate
|
||||
Name[pt_BR]=kate
|
||||
Name[ro]=kate
|
||||
Name[ru]=kate
|
||||
Name[si]=kate
|
||||
Name[sk]=kate
|
||||
Name[sl]=kate
|
||||
Name[sr]=Кејт
|
||||
Name[sr@ijekavian]=Кејт
|
||||
Name[sr@ijekavianlatin]=Kate
|
||||
Name[sr@latin]=Kate
|
||||
Name[sv]=Kate
|
||||
Name[sr@ijekavianlatin]=kate
|
||||
Name[sr@latin]=kate
|
||||
Name[sv]=kate
|
||||
Name[tg]=Кейт
|
||||
Name[tr]=Kate
|
||||
Name[ug]=Kate
|
||||
Name[uk]=Kate
|
||||
Name[vi]=Kate
|
||||
Name[wa]=Kate
|
||||
Name[x-test]=xxKatexx
|
||||
Name[zh_CN]=Kate
|
||||
Name[zh_TW]=Kate
|
||||
Name[tr]=kate
|
||||
Name[ug]=kate
|
||||
Name[uk]=kate
|
||||
Name[vi]=kate
|
||||
Name[wa]=kate
|
||||
Name[x-test]=xxkatexx
|
||||
Name[zh_CN]=kate
|
||||
Name[zh_TW]=kate
|
||||
MimeType=text/plain;
|
||||
Exec=kate -b %U
|
||||
X-KDE-StartupNotify=false
|
||||
|
||||
Reference in New Issue
Block a user