Nate Graham [Mon, 8 Apr 2019 22:03:48 +0000 (16:03 -0600)]
Don't show "Open With" menu items for empty directories
Summary:
Any app that registers itself as able to open directories generally can't do anything
useful with an empty directory. So, don't show the {nav Open With} menu items for them.
Méven Car [Sun, 24 Mar 2019 17:37:10 +0000 (18:37 +0100)]
When hovering over a file on the not-focus view panel, the information panel gets updated
Test Plan:
- In Dolphin with two views (split view) and with the information panels
- Hover over a file on the not selected view
- > the information panel show information about this file
Plasma considers khotkeys deprecated, so we shouldn't add new users
making the migration even harder.
Dolphin should use the `X-KDE-Shortcuts` desktop entry instead.
More details in David's comment: https://phabricator.kde.org/D19831#437096
Méven Car [Sun, 17 Mar 2019 20:21:33 +0000 (21:21 +0100)]
When the previewed video stops playing (because of the user or because the media playback has ended), show the regular preview only if the preview setting is on.
Test Plan:
In dolphin with the information panel
Select a video
Play the video
Disable the preview through the context menu (the video stays playing and visible and this will get fixed in a subsequent review)
Stop the video -> the video preview reappears when it should not
Méven Car [Sun, 17 Mar 2019 16:24:30 +0000 (17:24 +0100)]
Fix a todo: InformationPanelContent::configureSettings code is moved to InformationPanel::contextMenuEvent
Summary:
Fix a TODO : InformationPanelContent::configureSettings code is moved to InformationPanel::contextMenuEvent
Adding necessary accessors and changing visibility of one slot.
Test Plan:
1 compile
2 in dolphin right on the information panel
3 toggle preview
4 from the same context menu, click configure, metadadata settings appears
5 toggle "condensed date" if available
David Hallas [Wed, 13 Mar 2019 19:27:40 +0000 (20:27 +0100)]
Fix crash at shutdown after showing a tooltip
Summary:
Fix crash at shutdown after showing a tooltip. The commit 94d7e1471e0a81b72285795ad91c4f6196157ae4 introduced a crash that occurs
when closing Dolphin after Dolphin has showed a tooltip. This happens
because the ToolTipManager::showToolTip function calls the
KToopTipWidget::showBelow function passing in the pointer to the
DolphinFileMetaDataWidget. But this also passes the ownership of the
pointer to the KToopTipWidget as long as a new tooltip is not shown. The
problem is that at shutdown, the KToopTipWidget instance will be
destoyed first and therefore also destroy the DolphinFileMetaDataWidget
instance (which the ToolTipManager still owns through the
QScopedPointer) causing it to be deleted twice. The fix for this is
simply to swap the order of these two members so that the
DolphinFileMetaDataWidget is destroyed first by the QScopedPointer
thereby removing it from the KToopTipWidget if it has been set as it's
parent.
Test Plan:
Open Dolphin
Show a Tool Tip
Close Dolphin
Elvis Angelaccio [Sun, 17 Mar 2019 15:43:20 +0000 (16:43 +0100)]
Make global view properties the default setting
Summary:
Automatic creation of .directory files is one of the most
complained about things in dolphin.
These days applications are supposed to store application-specific data
within $XDG_DATA_HOME. Long-term that's the proper solution for this
issue, but for now we can at least flip the default so that we no longer
create .directory files out of the box.
A tooltip is also added as a kind of warning for the users who want to
change the setting. Ideally a proper warning should be shown using a
KMessageWidget or KMessageBox, but neither play too well with the
setting dialog workflow used by dolphin.
Méven Car [Tue, 12 Mar 2019 14:54:46 +0000 (08:54 -0600)]
Correctly position context menu of the information panel under wayland with a secondary screen
Summary:
According to my testing this bug occurs because Qcursor::pos() does not work as expected under wayland on a secondary screen, then it returns inaccurate data.
This could hide bugs elsewhere.
BUG: 404799
FIXED-IN: 19.04.0
Test Plan:
Under Wayland test the context menu on both screens.
Do the same under Xorg.
David Hallas [Sun, 3 Mar 2019 06:37:52 +0000 (07:37 +0100)]
Fixes leak of DolphinFileMetaDataWidget in ToolTipManager
Summary:
Fixes leak of DolphinFileMetaDataWidget in ToolTipManager. The
destructor of ToolTipManager failed to delete the m_fileMetaDataWidget
member. This is seen at shutdown but also when you close a tab that has
displayed a tooltip.
Test Plan:
Compile Dolphin with address sanitizer
Open Dolphin
Show a tooltip
Close Dolphin
Elvis Angelaccio [Sun, 17 Feb 2019 11:26:52 +0000 (12:26 +0100)]
Fix context for QDateTime::toString() translations
Summary:
The documentation of QDateTime::toString() says that:
Any sequence of characters that are enclosed in single
quotes will be treated as text and not be used as an expression.
This means that translators cannot replace single quotes with other
characters such as «...». This is now described in the context of the
affected strings.
We also check that the translated string contains exactly 2 single
quotes, and we use the untraslated string otherwise.
David Hallas [Thu, 21 Feb 2019 14:45:27 +0000 (15:45 +0100)]
New tab placed after current tab when middle-clicking
Summary:
New tabs should be placed after the currently active tab when using
middle click.
Test Plan:
Open new tab from the places panel using middle click, verify that the
Open new tab from the folders panel using middle click, verify that the
tab is opened after the current tab
Open new tab by middle clicking on the Back button, verify that the tab
is opened after the current tab
Open new tab by middle clicking on the Forward button, verify that the tab
is opened after the current tab
Simon Depiets [Wed, 6 Mar 2019 00:15:43 +0000 (08:15 +0800)]
Improve wording of split view/pane settings
Summary:
I found these strings very hard to understand then translate without looking into the code because the use of "view" refers to both "the split view" and "the left pane and the right pane of the split view".
This patch attempts to explicitly mention panes when needed.
David Hallas [Sun, 29 Jul 2018 10:10:16 +0000 (12:10 +0200)]
Fixes memory leak of KItemListHeader
Summary:
Fixes memory leak of KItemListHeader
The KItemListHeader passed the listView parent object to the QObject
base class, but that pointer seems to always be nullptr causing the
KItemListHeader to not be memory managed by anything. Instead simple
use the listView as parent pointer.
Test Plan: This leak was found using Address Sanitizer
David Hallas [Sat, 16 Feb 2019 15:50:42 +0000 (16:50 +0100)]
Fix crash during shutdown
Summary:
Fix crash during shutdown. The root cause is that when Dolphin in stopped as
part of an activity, the KItemListViewAccessible destructor is called after
QApplication::exec has returned causing Qt to already having cleaned up the
QAccessibleInterface instances kept in KItemListViewAccessible. Instead of
storing the pointers to QAccessibleInterface we store the QAccessible::Id so
that we can use the QAccessible::deleteAccessibleInterface function for
deleting the instances.
BUG: 402784
Test Plan:
I wasn't able to reproduce the crash in the first place, but I have just
opened and closed Dolphin a few times and verified the the QAccessibleInterface
instances are correctly cleaned up.
Nate Graham [Tue, 12 Feb 2019 19:21:34 +0000 (12:21 -0700)]
Word-wrap KMessageWidget text
Summary:
Word-wrap KMessageWidget text to prevent the window from being widened
when the text is very long.
CCBUG: 404232
Only `CCBUG: ` because word wrap only works where QLabel detects a word boundary;
it will not wrap a string with no spaces or other word boundaries (e.g.
"aaaaaaaaaaaaaaaaaaaa...")
Test Plan:
- Create a new text file with a 300-character name that has spaces in it
- In the KMessageWidget's error message, the file name is wrapped at the word
boundaries
David Hallas [Tue, 12 Feb 2019 10:07:43 +0000 (11:07 +0100)]
New tab should be placed after the current tab
Summary:
When opening a new using the context menu the new tab should be placed
after the currently open tab, not at the end of the tab list.
BUG: 403690
Test Plan:
Open multiple tabs and select a different tab than the last one.
Open a new tab using the context menu and see that it opens after the currently
selected tab.
Open a tab using Ctrl+T and see that it opens at the end.
Kai Uwe Broulik [Mon, 4 Feb 2019 08:12:35 +0000 (09:12 +0100)]
Use more suitable default view mode for recent documents and Downloads folder
Sort them descending by date as well as:
* for Recent Documents: switch to details view
* for Downloads enable grouping and disable sorting folders first
Nate Graham [Tue, 29 Jan 2019 13:31:46 +0000 (06:31 -0700)]
After opening and switching to a new tab, always focus the view
Summary:
When Dolphin opens a new tab and immediately switches to it, the URL navigator gets focus if it's editable. If it's not, the breadcrumbs bar gets keyboard focus, which is not very useful since it's not really intended for keyboard navigation.
This patch changes that behavior so that the view always gets focus, which seems more useful and more consistent.
BUG: 401899
FIXED-IN: 19.04.0
Test Plan:
1. Put the URL navigator into breadcrumbs mode
2. Open a new tab
3. Observe that the view gets keyboard focus
4. Put the URL navigator into editable mode
5. Open a new tab
6. Observe that the view still gets keyboard focus
Nate Graham [Sat, 19 Jan 2019 15:11:26 +0000 (08:11 -0700)]
Ask for confirmation when Closing Dolphin windows with a terminal panel running a program
Summary:
Ask for confirmation when Closing Dolphin windows with a terminal panel running a program.
FEATURE: 304816
FIXED-IN: 19.04.0
Test Plan:
# Open terminal panel
# Run `watch ls`
# Close Dolphin
# Observe confirmation
# Disable confirmation
# Repeat, observe no confirmation
# Enable confirmation in the settings
# Repeat, observe a confirmation
Chris Rizzitello [Mon, 14 Jan 2019 01:55:07 +0000 (20:55 -0500)]
Abort updateWindowTitle and activeViewChanged if not changed.
Summary:
- Prevent activeViewChanged from updating the window if the view is the same view (happens at least once when starting up)
- Stop updateWindowTitle from updating the title if its not changed.
Summary:
The DolphinTabPage::activeViewUrlChanged signal triggers the title
update in DolphinMainWindow, which sets the new title from the
`m_activeViewContainer` instance.
This means we need to notify the main window that the active view
changed before telling it that the current url changed.
Nate Graham [Sun, 16 Dec 2018 20:49:57 +0000 (13:49 -0700)]
Return editable URL navigator to breadcrumb mode if it has focus and everything is selected and when Ctrl+L is pressed
Summary:
This patch makes an editable location bar return to breadcrumb mode when {key Ctrl L} is pressed, but only if the location bar currently has focus and everything is selected. Otherwise, it will simply return focus to it as before.
This provides a slightly easier way to make the location bar return to breadcrumbs mode
Test Plan:
- Compile and deploy and make the location bar be breadcrumbs
- Hit {key Ctrl L} twice in a row -> location field turns to being in breadcrumb mode. Focus is correctly returned to the main view.
- Hit {key Ctrl L}, move focus elsewhere, then hit {key Ctrl L} again -> Location bar is editable and focused with everything selected.
- Hit {key Ctrl L}, deselect some of the text, then hit {key Ctrl L} again -> Location bar selects everything.
Anton Kreuzkamp [Mon, 3 Dec 2018 14:01:36 +0000 (15:01 +0100)]
KItemListWidget: Use initStyleOption
Instead of using QStyleOption::initFrom, let's use
QGraphicsWidget::initStyleOption, which is made for exactly the purpose
of KItemListWidget. This is especially important since, according to the
docs of QGraphicsItem::paint "The widget argument is optional. [...]
For cached painting, widget is always 0.". Even though currently no code
in dolphin does cached painting, for the sake of modularity one should
not rely on widget to be non-null. Using QStyleOption::initFrom does
assume that, though.
In fact, GammaRay asks the items to do cached painting when attaching it
to the application, causing it to crash.