KDevelop::MainWindow: use setWindowFilePath()
ClosedPublic

Authored by rjvbb on Jul 6 2017, 3:57 PM.

Details

Summary

Most native Mac applications show the registered icon in the titlebar when a known document type is opened, and provide a path dropdown menu under that icon (accessible via Command-LeftButton). Selecting one of the path components in that menu opens the corresponding folder in the Finder. The icon can also be "grabbed" with a mouse click and then dragged and dropped onto terminal windows and file dialogs (that is probably the more interesting feature).

Qt exposes this feature via QWidget::setWindowFilePath(); this change calls the method in MainWindow::updateCaption().

Test Plan

works as expected on Mac; has no effect on other platforms (verified on Linux).

Diff Detail

Repository
R33 KDevPlatform
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rjvbb created this revision.Jul 6 2017, 3:57 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJul 6 2017, 3:57 PM
rjvbb added a comment.Jul 6 2017, 3:59 PM

Screenshots. This uses pure native APIs behind the scenes so doesn't depend on widget style.

rjvbb edited the summary of this revision. (Show Details)Jul 6 2017, 4:05 PM
rjvbb edited the summary of this revision. (Show Details)Jul 6 2017, 4:11 PM
kfunk requested changes to this revision.Jul 6 2017, 4:22 PM
kfunk added a subscriber: kfunk.

Needs a setWindowFilePath({}) if there's no active view.

This revision now requires changes to proceed.Jul 6 2017, 4:22 PM
This revision was automatically updated to reflect the committed changes.
rjvbb added a comment.Jul 6 2017, 4:32 PM
In D6529#122269, @kfunk wrote:

Needs a setWindowFilePath({}) if there's no active view.

Doh, indeed. And I knew that... :-/

kfunk added a comment.Jul 6 2017, 4:55 PM

Backported to 5.1 -- this patch is trivial enough.

I also fixed up your last commit. Doing setWindowFilePath({}) in the else-branch could still leave you with an outdated windowFilePath set. I.e. in case there's an active view but no UrlDocument*.

rjvbb added a comment.Jul 6 2017, 10:06 PM
I also fixed up your last commit.

Not mine, actually; Sven committed this (in 2 commits)

brauch added a subscriber: brauch.Jul 6 2017, 10:38 PM

Yes, I felt responsible for fixing it after pushing the broken version and did that wrong, too :/ my bad. Thanks for the patch.