Review Request 121265: Make modified flag work for KMainWindow::setCaption(QString, bool)

Martin Gräßlin mgraesslin at kde.org
Thu Nov 27 08:18:32 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121265/#review71000
-----------------------------------------------------------


weird suggestion: why not let the window manager handle it? Expose it as an X11 property which gets read by the window manager/desktop shell and applies a semantic way to highlight that it's modified.

- Martin Gräßlin


On Nov. 27, 2014, 4:10 a.m., Friedrich W. H. Kossebau wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121265/
> -----------------------------------------------------------
> 
> (Updated Nov. 27, 2014, 4:10 a.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kxmlgui
> 
> 
> Description
> -------
> 
> The API dox of KMainWindow::setCaption(const QString &caption, bool modified) claims that the flag modified specifies "whether the document is modified. This displays an additional sign in the title bar, usually "*"."
> See http://api.kde.org/frameworks-api/frameworks5-apidocs/kxmlgui/html/classKMainWindow.html#aa78364d5eeb1c1f5bd333c733378741d
> 
> Currently that is not true. Instead a warning is shown on the console:
> "QWidgetPrivate::setWindowModified_helper: QWidget::setWindowModified: The window title does not contain a '[*]' placeholder"
> 
> When 'KDialog::setCaption(QString, bool)' was moved to 'KMainWindow::setCaption(QString, bool)' for kf5, it was dumped that the old code also called ' makeStandardCaption(...)' which would add a custom "[modified]" string if the 'modified' flag was set. See http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/kdialog_8cpp_source.html#l00475
> 
> Now KMainWindow uses the 'windowModified' property of 'QWidget', and if doing so, the windowtitle needs a placeholder where to put the modified marker, by the form of "[*]". See https://qt-project.org/doc/qt-5/qwidget.html#windowTitle-prop
> 
> This patch proposes to comply to the API and to add that placeholder, so the method behaves as expected. It does not use "[modified]" flag like the kde4libs variant of the code did, but by using the Qt placeholder perhaps can even integrate better into the platform (not sure if there is a hook yet).
> 
> 
> Diffs
> -----
> 
>   src/kmainwindow.cpp 9562318 
> 
> Diff: https://git.reviewboard.kde.org/r/121265/diff/
> 
> 
> Testing
> -------
> 
> Modified is now properly marked to Off or On in the window title, when 'KMainWindow::setCaption(QString,bool)' is used. Tested with Okteta.
> 
> 
> Thanks,
> 
> Friedrich W. H. Kossebau
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20141127/42611122/attachment.html>


More information about the Kde-frameworks-devel mailing list