Commit 3ebce5aa authored by Pino Toscano's avatar Pino Toscano

Add hidden configuration for showing the document title (if any) in the title...

Add hidden configuration for showing the document title (if any) in the title bar. Default is true (as before).
Based on a patch by Alejandro Exojo, thanks!
$ kwriteconfig --file okularpartrc --group General --key DisplayDocumentTitle --type bool false

BUG: 158401

svn path=/trunk/KDE/kdegraphics/okular/; revision=890576
parent a6bfc8bb
......@@ -156,6 +156,9 @@
<entry key="ShowOSD" type="Bool" >
<default>true</default>
</entry>
<entry key="DisplayDocumentTitle" type="Bool" >
<default>true</default>
</entry>
<entry key="UseKTTSD" type="Bool" />
<entry key="WatchFile" type="Bool" >
<default>true</default>
......
......@@ -703,16 +703,20 @@ void Part::loadCancelled(const QString &reason)
void Part::setWindowTitleFromDocument()
{
// if the document have a 'DocumentTitle' flag set (and it is not empty), set it as title
QString title = m_document->metaData( "DocumentTitle" ).toString();
if ( !title.isEmpty() && !title.trimmed().isEmpty() )
{
emit setWindowCaption( title );
}
else
// If 'DocumentTitle' should be used, check if the document has one. If
// either case is false, use the file name.
QString title = realUrl().fileName();
if ( Okular::Settings::displayDocumentTitle() )
{
emit setWindowCaption( realUrl().fileName() );
const QString docTitle = m_document->metaData( "DocumentTitle" ).toString();
if ( !docTitle.isEmpty() && !docTitle.trimmed().isEmpty() )
{
title = docTitle;
}
}
emit setWindowCaption( title );
}
void Part::slotGeneratorPreferences( )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment