From b88d1a9c266a40f669b8efbe709449e14872c78f Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 4 Dec 2013 22:58:13 +0100 Subject: Fix adding newly created documents to MRU list in kate This resolves Bug 1680 --- kate/app/katemainwindow.cpp | 9 ++++++++- kate/app/katemainwindow.h | 7 ++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/kate/app/katemainwindow.cpp b/kate/app/katemainwindow.cpp index ada436a07..14a5341c5 100644 --- a/kate/app/katemainwindow.cpp +++ b/kate/app/katemainwindow.cpp @@ -791,12 +791,19 @@ bool KateMainWindow::showModOnDiskPrompt() void KateMainWindow::slotDocumentCreated (Kate::Document *doc) { connect(doc,TQT_SIGNAL(modStateChanged(Kate::Document *)),this,TQT_SLOT(updateCaption(Kate::Document *))); - connect(doc,TQT_SIGNAL(nameChanged(Kate::Document *)),this,TQT_SLOT(updateCaption(Kate::Document *))); + connect(doc,TQT_SIGNAL(nameChanged(Kate::Document *)),this,TQT_SLOT(slotNameChanged(Kate::Document *))); connect(doc,TQT_SIGNAL(nameChanged(Kate::Document *)),this,TQT_SLOT(slotUpdateOpenWith())); updateCaption (doc); } +void KateMainWindow::slotNameChanged(Kate::Document *doc) +{ + updateCaption(doc); + if (!doc->url().isEmpty()) + fileOpenRecent->addURL(doc->url()); +} + void KateMainWindow::updateCaption (Kate::Document *doc) { if (!m_viewManager->activeView()) diff --git a/kate/app/katemainwindow.h b/kate/app/katemainwindow.h index eb2891819..157b4e57d 100644 --- a/kate/app/katemainwindow.h +++ b/kate/app/katemainwindow.h @@ -156,10 +156,11 @@ class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBa void tipOfTheDay(); /* to update the caption */ - void slotDocumentCreated (Kate::Document *doc); - void updateCaption (Kate::Document *doc); + void slotDocumentCreated(Kate::Document *doc); + void slotNameChanged(Kate::Document *doc); + void updateCaption(Kate::Document *doc); - void pluginHelp (); + void pluginHelp(); void slotFullScreen(bool); public: -- cgit v1.2.1