summaryrefslogtreecommitdiffstats
path: root/kate/app/katemainwindow.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2019-08-23 23:11:45 +0900
committerMichele Calgaro <[email protected]>2019-08-23 23:11:45 +0900
commit9599fe545110b6d676da07e3361d52e1837b0e4c (patch)
tree9937a6319896ddb63e397b7172a8b8b1f2f9b18a /kate/app/katemainwindow.cpp
parent027c45db6f63a04eb31eac481f9264ab9760dce1 (diff)
downloadtdebase-9599fe545110b6d676da07e3361d52e1837b0e4c.tar.gz
tdebase-9599fe545110b6d676da07e3361d52e1837b0e4c.zip
Kate: added checkbox to select whether to display the session name on the
window caption or not. This relates to issue #62. Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'kate/app/katemainwindow.cpp')
-rw-r--r--kate/app/katemainwindow.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/kate/app/katemainwindow.cpp b/kate/app/katemainwindow.cpp
index 1a021beb9..1e0a4b37d 100644
--- a/kate/app/katemainwindow.cpp
+++ b/kate/app/katemainwindow.cpp
@@ -423,8 +423,9 @@ void KateMainWindow::readOptions ()
TDEConfig *config = KateApp::self()->config ();
config->setGroup("General");
- syncKonsole = config->readBoolEntry("Sync Konsole", true);
- useInstance = config->readBoolEntry("UseInstance", false);
+ showSessionName = config->readBoolEntry("Show session name", false);
+ syncKonsole = config->readBoolEntry("Sync Konsole", true);
+ useInstance = config->readBoolEntry("UseInstance", false);
modNotification = config->readBoolEntry("Modified Notification", false);
KateDocManager::self()->setSaveMetaInfos(config->readBoolEntry("Save Meta Infos", true));
KateDocManager::self()->setDaysMetaInfos(config->readNumEntry("Days Meta Infos", 30));
@@ -447,6 +448,7 @@ void KateMainWindow::saveOptions ()
else
config->writeEntry("Show Console", false);
+ config->writeEntry("Show session name", showSessionName);
config->writeEntry("Save Meta Infos", KateDocManager::self()->getSaveMetaInfos());
config->writeEntry("Days Meta Infos", KateDocManager::self()->getDaysMetaInfos());
config->writeEntry("Show Full Path in Title", m_viewManager->getShowFullPath());
@@ -820,7 +822,7 @@ void KateMainWindow::slotNameChanged(Kate::Document *doc)
fileOpenRecent->addURL(doc->url());
}
-void KateMainWindow::updateCaption (Kate::Document *doc)
+void KateMainWindow::updateCaption(Kate::Document *doc)
{
if (!m_viewManager->activeView())
{
@@ -841,12 +843,20 @@ void KateMainWindow::updateCaption (Kate::Document *doc)
c = m_viewManager->activeView()->getDoc()->url().prettyURL();
}
- TQString sessName = KateApp::self()->sessionManager()->getActiveSessionName();
- if ( !sessName.isEmpty() )
- sessName = TQString("%1: ").arg( sessName );
-
- setCaption( sessName + KStringHandler::lsqueeze(c,64),
- m_viewManager->activeView()->getDoc()->isModified());
+ if (showSessionName)
+ {
+ TQString sessName = KateApp::self()->sessionManager()->getActiveSessionName();
+ if (!sessName.isEmpty())
+ {
+ sessName = TQString("%1: ").arg(sessName);
+ }
+ setCaption(KStringHandler::lsqueeze(sessName,32) + KStringHandler::lsqueeze(c,64),
+ m_viewManager->activeView()->getDoc()->isModified());
+ }
+ else
+ {
+ setCaption(KStringHandler::lsqueeze(c,64), m_viewManager->activeView()->getDoc()->isModified());
+ }
}
void KateMainWindow::saveProperties(TDEConfig *config)