Commit graph

4747 commits

Author SHA1 Message Date
Emmanuel Pescosta 7b0c9bbc58 Merge branch 'KDE/4.14' 2014-08-22 22:44:53 +02:00
Arjun AK 4290827540 Hide an already visible KMessageWidget message before showing a new one
1. Do some operation that causes the KMessageWidget to show an error message
2. Immediately Repeat the same action.

The user has no way to know whether the error message is from the second operation or
is a leftover from the first one. By hiding the widget first and then showing it using
animatedShow(), the user can clearly see that a new message was generated. Also once the
directory successfully loads, the widget should be hidden.

BUG: 323077
FIXED-IN: 4.14.1
REVIEW: 119401
2014-08-22 18:42:50 +05:30
David Faure ee946d362c Port away from KonqOperations::askDeleteConfirmation and KonqOperations::del
and remove them. Porting docs added to https://community.kde.org/Frameworks/Porting_Notes#libkonq
2014-08-22 10:16:48 +02:00
David Faure e44ddfa5ab Remove KonqOperations::emptyTrash() and port to KIO::emptyTrash() instead. 2014-08-21 22:01:23 +02:00
Emmanuel Pescosta 2d2d55f3df Save the view states in addition to the view urls and splitter state in DolphinTabPage.
Also added version numbers to view and tab state.

REVIEW: 119792
2014-08-20 23:06:39 +02:00
David Faure 5a6ac1b5f7 Port from KonqOperations::restoreTrashedItems to KIO::restoreFromTrash. 2014-08-19 22:31:50 +02:00
Emmanuel Pescosta 4b758c386f Merge branch 'KDE/4.14'
Conflicts:
	dolphin/src/dolphin.appdata.xml
2014-08-14 18:28:51 +02:00
Mathieu Tarral b73aeb4598 Fixes display issues of Dolphin statusbar widgets when a high DPI value is used (>= 196 for example).
BUG: 334271
REVIEW: 119701
FIXED-IN: 4.14.1
2014-08-14 18:12:08 +02:00
Emmanuel Pescosta cdebd19925 Merge branch 'master' of git://anongit.kde.org/kde-baseapps 2014-08-14 17:57:44 +02:00
l10n daemon script 4d2877e4bb SVN_SILENT made messages (after extraction) 2014-08-14 01:41:42 +00:00
Emmanuel Pescosta 39d8fb12c1 React on the redirection signal from DolphinView to properly update the tab and window titles.
REVIEW: 119697
BUG: 305721
2014-08-13 22:06:28 +02:00
Emmanuel Pescosta 62418c58a5 Use DolphinTabPage saveState/restoreState to remember and re-open closed tabs.
REVIEW: 118968
2014-08-13 20:50:36 +02:00
David Faure 3e5ff13f92 Port from KonqMimeData to KIO::isClipboardDataCut/setClipboardDataCut 2014-08-13 18:27:09 +02:00
l10n daemon script c7e300db90 SVN_SILENT made messages (after extraction) 2014-08-13 05:58:14 +00:00
Frank Reininghaus 4b70446c17 Merge branch 'KDE/4.14' 2014-08-12 09:23:24 +02:00
Frank Reininghaus bf1ac8ee9b Always clear DolphinView's m_currentItemUrl member in updateViewState()
Before this patch, we still kept the URL in m_currentItemUrl if the URL
was not found in the model. This could cause problems the next time
updateViewState() was called, because the current index would then be
set to 0, which could cause other issues.

For example, all items between the first item in the view and a folder
which was expanded in Details View could be selected.

In principle, it is possible that updateViewState() is called multiple
times if many large files are being pasted in the view, but since the
item which should be made the current item (and which the view should
be scrolled to) should always be the first pasted item, this change
will most likely not cause any other problems.

BUG: 329377
REVIEW: 119703
FIXED-IN: 4.14.0
2014-08-12 09:17:41 +02:00
Frank Reininghaus 4ed068ffff Fix crash when restoring a session stored with Dolphin 4.13 or earlier
Since DolphinTabPage::saveState() and
DolphinTabPage::restoreState(const QByteArray& state) save and restore
the state of each tab in a different format than DolphinMainWindow did
before the refactoring, we can run into problems: the first time a user
logs into a session that has Dolphin 4.14, Dolphin might read session
data that does not contain the QByteArray that DolphinTabPage wants to
read the data from.

In restoreState, isSplitViewEnabled will thus have the value false, and
no secondary view will be created. Later on, m_primaryViewActive will
also be set to false, but the else branch of the following
"if (m_primaryViewActive)" then tries to activate the secondary view,
which does not exist -> we get a crash.

The easiest solution is to not restore the tab state if no session data
in the new format is found.

BUG: 338187
REVIEW: 119718
FIXED-IN: 4.14.0
2014-08-12 09:08:30 +02:00
Frederik Gladhorn 316539b9f3 Port accessibility to Qt 5
REVIEW: 119428
2014-08-10 19:00:02 +02:00
Emmanuel Pescosta 38381bc6a2 Implemented DolphinTabWidget class to encapsulate the tab handling from DolphinMainWindow.
REVIEW: 119115
2014-08-10 18:52:06 +02:00
l10n daemon script 013b2346f5 SVN_SILENT made messages (after extraction) 2014-08-10 05:48:43 +00:00
l10n daemon script 1ffb64db1f SVN_SILENT made messages (after extraction) 2014-08-10 01:35:56 +00:00
Emmanuel Pescosta 18a976c435 Fix wrong text eliding in some corner cases.
BUG: 337104
FIXED-IN: 4.14.0
REVIEW: 119546
2014-08-04 19:43:07 +02:00
Luca Beltrame df871967c9 Merge branch 'master' into frameworks
Conflicts:
	dolphin/src/panels/places/placesitemmodel.cpp
	kdepasswd/kcm/CMakeLists.txt [deleted in frameworks]
	kdepasswd/kcm/main.cpp [deleted in frameworks]
2014-08-03 18:49:43 +02:00
Frank Reininghaus 9203fdc4d9 Merge branch 'KDE/4.14' 2014-08-03 10:55:58 +02:00
Michael Reeves a31b836479 Fix warning on launch "QPixmap::scaled: Pixmap is a null pixmap"
If Dolphin is launched with the information panel on and set to display
previews, PixmapViewer::paintEvent is called three times before any
pixmap is set. Each time the above warning message is output.

REVIEW: 119553
FIXED-IN: 4.14.0
2014-08-03 10:51:41 +02:00
l10n daemon script 3d076f7c5e SVN_SILENT made messages (.desktop file) 2014-08-03 07:30:09 +00:00
l10n daemon script 2b1267d71e SVN_SILENT made messages (after extraction) 2014-08-03 05:46:42 +00:00
l10n daemon script e7bc1cb09d SVN_SILENT made messages (.desktop file) 2014-08-03 04:28:42 +00:00
l10n daemon script 6970c5acb6 SVN_SILENT made messages (after extraction) 2014-08-03 01:38:10 +00:00
l10n daemon script 09ab78a8bb SVN_SILENT made messages (after extraction) 2014-08-02 05:39:42 +00:00
l10n daemon script 9d758fd54b SVN_SILENT made messages (after extraction) 2014-08-02 01:34:38 +00:00
Luca Beltrame 228aadd4d9 Actually the include was unused, remove it 2014-08-01 11:26:51 +02:00
Luca Beltrame 611ba7c2e8 Attempt to fix build (try 2) 2014-08-01 11:22:17 +02:00
l10n daemon script 7697451998 SVN_SILENT made messages (after extraction) 2014-08-01 01:49:50 +00:00
Arnold Dumas ed20a18a73 Clean up KAction leftovers. 2014-07-31 20:06:17 +02:00
l10n daemon script 39e1197536 SVN_SILENT made messages (after extraction) 2014-07-31 05:55:50 +00:00
l10n daemon script ec6d53e70e SVN_SILENT made messages (after extraction) 2014-07-31 01:40:02 +00:00
Lukáš Tinkl 1fd21301ff s/kcmshell4/kcmshell5 2014-07-31 02:51:27 +02:00
Arjun AK c654019eb9 Prevent multiple connections between sender and receiver
Use a Qt::uniqueConnection so that only one connection exists between the sender and receiver.

REVIEW: 119532
2014-07-30 18:26:39 +05:30
l10n daemon script d1f12e1778 SVN_SILENT made messages (after extraction) 2014-07-27 05:45:07 +00:00
l10n daemon script 7299d007f2 SVN_SILENT made messages (.desktop file) 2014-07-25 05:22:21 +00:00
l10n daemon script ecf7a1d1ed SVN_SILENT made messages (after extraction) 2014-07-25 01:49:32 +00:00
l10n daemon script cb8d725451 SVN_SILENT made messages (.desktop file) 2014-07-24 04:37:28 +00:00
l10n daemon script a2bd1a9188 SVN_SILENT made messages (after extraction) 2014-07-24 01:34:11 +00:00
Luca Beltrame 674a9c08bb Fix build 2014-07-22 16:15:25 +02:00
Luca Beltrame de3e2ae40f Merge branch 'master' into frameworks 2014-07-22 15:58:03 +02:00
Arjun AK 9a69506572 make CTRL+SHIFT+T reopen last closed tab
BUG: 336818
FEATURE: 118994
2014-07-22 17:31:49 +05:30
Luca Beltrame 2b75a555ca Merge branch 'master' into frameworks 2014-07-21 21:20:05 +02:00
l10n daemon script c2f8389acb SVN_SILENT made messages (after extraction) 2014-07-21 05:43:56 +00:00
l10n daemon script 17688f23e7 SVN_SILENT made messages (after extraction) 2014-07-19 01:34:04 +00:00
Montel Laurent 8ec8450c36 install rc file to KXMLGUI_INSTALL_DIR 2014-07-18 09:26:12 +02:00
Montel Laurent 31230ccdb5 Use xi18n when text has markup 2014-07-16 13:26:56 +02:00
l10n daemon script 603e1775c8 SVN_SILENT made messages (.desktop file) 2014-07-16 08:22:33 +00:00
Luca Beltrame e242d9548d Merge branch 'master' into frameworks
Conflicts:
	kdepasswd/kcm/kcm_useraccount.desktop [deleted in frameworks branch]
	plasma/applets/folderview/plasma-applet-folderview.desktop [deleted in frameworks branch]
2014-07-16 10:13:57 +02:00
Frank Reininghaus abd114f710 Merge branch 'KDE/4.14' 2014-07-16 09:16:24 +02:00
Frank Reininghaus 7cb193de10 Fix regression concerning the "Places" selector in the location bar
This commit ensures that the selector is visible in all location bars
if and only if the Places Panel is hidden. It fixes a regression caused
by commit 6a98d83312.

BUG: 337389
FIXED-IN: 4.14.0
REVIEW: 119238
2014-07-16 09:12:16 +02:00
l10n daemon script ebae393190 SVN_SILENT made messages (.desktop file) 2014-07-16 04:52:24 +00:00
l10n daemon script 31a106a63a SVN_SILENT made messages (after extraction) 2014-07-16 01:50:43 +00:00
Emmanuel Pescosta fc4315d57e Merge branch 'master' into frameworks
Conflicts:
	dolphin/src/dolphinmainwindow.cpp
	dolphin/src/dolphinviewcontainer.cpp
2014-07-10 22:49:05 +02:00
Emmanuel Pescosta 1dfafcb176 Implemented (QTabBar based) DolphinTabBar class to encapsulate the tab bar handling from DolphinMainWindow.
REVIEW: 118969
2014-07-08 19:38:18 +02:00
Emmanuel Pescosta 00754dda30 Avoid opening unused tabs which are closed again after startup has finished (when directory/file urls are given)
Instead of always opening a new tab with the home url and closing it again when directory/file urls are passed on,
we now use the given directories/files directly to open new tabs on startup.

Makes the code easier and we can reuse openDirectories/openFiles in future (if needed).

REVIEW: 118966
2014-07-08 19:16:17 +02:00
l10n daemon script c25b501898 SVN_SILENT made messages (after extraction) 2014-07-06 01:33:37 +00:00
l10n daemon script baeb21e96e SVN_SILENT made messages (after extraction) 2014-07-05 01:36:55 +00:00
Emmanuel Pescosta b0fb590ebd Implemented DolphinTabPage class to encapsulate the split view handling from DolphinMainWindow.
The signal activeViewUrlChanged in DolphinTabPage is currently unused, but we need it later when
we implement the tab widget and tab bar.

DolphinTabPage has saveState/restoreState which are using a QByteArray instead of the KConfigGroup to
be more generic.

REVIEW: 118964
2014-07-04 17:16:03 +02:00
Luca Beltrame c640dec3f6 Merge branch 'master' into frameworks 2014-07-04 07:22:29 +02:00
Frank Reininghaus 20e13c31df Improve drawing selected items in Compact/Details View and Places Panel
This commit removes the icon tinting for the selected item in Compact
and Details View, and extends the selection rectangle such that it
includes the icon area as well. The icon tinting can be disturbing, and
having a selection rectangle that only includes the text can look a bit
strange, especially in the Places Panel.

BUG: 304643
REVIEW: 119018
FIXED-IN: 4.14.0
2014-07-04 00:49:46 +02:00
Frank Reininghaus 4d8f89f55a Remove current item highlighting in the Places Panel
In the Places Panel, there is always exactly one selected item, which is
equal to the current item. Since the selected item is highlighted by
drawing its background in a different color, it is not really necessary
to highlight additionally that it is the current item.

This is achieved by removing the calls to
KItemListWidget::setCurrent(true) from KItemListView. The "current"
information in the widget is only used for deciding if the "current item
highlighting", like an underline in Oxygen, should be drawn.

The motivation for this change is that I have seem some complaints about
the "current item" highlighting, which can be even more distracting with
non-Oxygen styles.

REVIEW: 119019
2014-07-04 00:42:38 +02:00
l10n daemon script 1e22db8ba5 SVN_SILENT made messages (after extraction) 2014-07-03 01:30:12 +00:00
Arjun AK 97da9f9a5c Fix typo: chnage -> change
REVIEW: 119084
GIT_SILENT
2014-07-02 16:17:18 +05:30
Kai Uwe Broulik fb9c403518 Add support for high-precision touchpad scrolling
REVIEW: 119001
2014-06-30 13:56:45 +02:00
l10n daemon script f57f4e1a01 SVN_SILENT made messages (after extraction) 2014-06-30 01:42:40 +00:00
Christophe Giboudeaux 6cddb788a0 KFileItemModelBenchmark is a manual test 2014-06-29 21:36:55 +02:00
Frank Reininghaus 81b84a1eaf Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	dolphin/src/dolphinmainwindow.cpp
	dolphin/src/dolphinmainwindow.h
2014-06-29 20:28:46 +02:00
Christophe Giboudeaux a769261131 Remove the automoc noise 2014-06-29 10:36:32 +02:00
l10n daemon script 74d8522ac6 SVN_SILENT made messages (after extraction) 2014-06-29 01:36:02 +00:00
Christophe Giboudeaux ae1960be45 Reenable tests. 2014-06-29 02:07:41 +02:00
Christophe Giboudeaux 37492b2275 KF5ify Dolphin. 2014-06-29 01:35:37 +02:00
Christophe Giboudeaux c8a2db7d4e Create KF5::Konq 2014-06-28 22:17:55 +02:00
l10n daemon script caadc66bd8 SVN_SILENT made messages (after extraction) 2014-06-28 01:32:56 +00:00
Christophe Giboudeaux 7fa0c566ed Revert "Fix build"
This reverts commit 780e76f35bca0ced37a691a50367cf705388cc38.

Update your kfilemetadata/baloo/baloo-widgets builds instead.
2014-06-27 18:05:36 +02:00
Rohan Garg 50d123a60d Fix build 2014-06-27 17:00:12 +02:00
Christophe Giboudeaux 3614b7fea7 Fix build. 2014-06-27 10:34:57 +02:00
Christophe Giboudeaux 4417875294 Rename the Baloo modules. 2014-06-27 10:08:24 +02:00
l10n daemon script e99e511236 SVN_SILENT made messages (after extraction) 2014-06-27 01:41:26 +00:00
Arjun AK 0a607c28f5 prevent goBack, goForward, goHome and goUp from being called twice
REVIEW: 118782
2014-06-25 18:53:05 +05:30
Emmanuel Pescosta 4a40a2c66e Add AppStream meta data file (imported from https://github.com/ximion/kde-appstream-metadata-templates/blob/master/apps/dolphin.appdata.xml)
Thanks to Matthias Klumpp for providing this file!

REVIEW: 118701
2014-06-25 14:31:15 +02:00
Scarlett Clark ea1e7822e5 Kde-baseapps frameworks - replace generic soversion.
Review:118851
2014-06-20 13:08:48 -07:00
Lukáš Tinkl 96f4646b66 i18n fixes 2014-06-20 21:12:34 +02:00
Scarlett Clark e41c969063 kde-baseapps frameworks dolphin with snapshot frameworks branch baloo/baloo-widgets path fixes. 2014-06-20 04:18:58 -07:00
Emmanuel Pescosta 24823bbfd1 Implemented DolphinRecentTabsMenu to encapsulate the recent
tabs menu related code from DolphinMainWindow in a new class.

The DolphinRecentTabsMenu remembers the tab configuration if a
tab has been closed.

REVIEW: 118805
2014-06-19 22:04:36 +02:00
Frank Reininghaus efa19caa46 Implement TODO concerning changed roles
When emitting the itemsChanged signal in KFileItemModel::setRoles,
use the changed roles in the argument of the signal.

A warning message which was related to this issue was removed in
7a83252e0d

REVIEW: 118815
2014-06-19 20:35:22 +02:00
Frank Reininghaus 7a593fc92b Merge branch 'KDE/4.13' 2014-06-19 20:32:30 +02:00
Frank Reininghaus a8e86cf7ef Remove confusing warning message
The message
"TODO: Emitting itemsChanged() with no information what has changed!"
is not helpful for the user.

The implementation of the TODO will be done in master, see
https://git.reviewboard.kde.org/r/118815/

CCBUG: 336174
2014-06-19 20:27:58 +02:00
Frank Reininghaus 6bccf73e92 Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	dolphin/src/dolphincontextmenu.cpp
	dolphin/src/panels/folders/treeviewcontextmenu.cpp
2014-06-12 08:51:50 +02:00
Frank Reininghaus 9dc1513f8b Do not crash if QApplication::clipboard()->mimeData() is a null pointer
This removes the remaining unchecked accesses to the clipboard mime
data after commit 7828b057da. According
to a bug report, it can be a null pointer on Wayland.

BUG: 335053
REVIEW: 118649
2014-06-12 08:37:11 +02:00
l10n daemon script 3b119c4ff9 SVN_SILENT made messages (.desktop file) 2014-06-09 04:33:35 +00:00
Frank Reininghaus 05c8254ee4 Make the settings dialog work in the frameworks branch
The KF5 version of KPageDialog has no virtual slot
"slotButtonClicked(int button)". Its kdelibs 4.x counterpart had such
a slot, which was connected automatically to the corresponding signal.

This slot was overriden by

DolphinSettingsDialog::slotButtonClicked(int button)

which was responsible for applying the changed setting and restoring
the default values if the corresponding button was clicked.

The lack of the buttonClicked(int) signal and the corresponding slot
caused the problem that clicking a button in the settings dialog had no
effect.

This patch makes the functions applySettings() and restoreDefaults()
functions slots, and connects them directly to the "clicked" signal of
the corresponding buttons.

BUG: 335709
REVIEW: 118576
2014-06-06 00:51:15 +02:00
Frank Reininghaus c12dc996f5 Merge remote-tracking branch 'origin/master' into frameworks 2014-06-05 08:57:31 +02:00
Frank Reininghaus ea713e7a79 Merge remote-tracking branch 'origin/KDE/4.13' 2014-06-05 08:54:06 +02:00
Frank Reininghaus e07468c784 Separate width and height info in the layouting code
By separating the width and height info, we can save some unnecessary
overhead in terms of memory and CPU cycles, and make the calculation of
the height of a row (or the width of a column in Compact View) a bit
simpler.

To achieve this, this patch extends the concept of "logical rows"
(which are actually columns in Compact View) to "logical width" and
"logical height" (which is the actual height and width, respectively, in
 Compact View). The distinction between rows/columns and "logical"
rows/columns may be a bit confusing, but the confusion is already in the
current code, and I hope that it will be mitigated a bit by prefixing
the corresponding variables with "logical".

REVIEW: 118454
2014-06-05 08:50:52 +02:00
Frank Reininghaus 470e305be4 Change the Dolphin version in frameworks to 4.60
Since the KF5 libraries and the applications will not have a
synchronized release schedule any more, it does not make sense to
continue using KDE_VERSION_STRING as the Dolphin version.
2014-06-04 22:03:08 +02:00
Frank Reininghaus c7d607a7fc Make Dolphin windows with multiple tabs closable
The return type and return values of KMessageBox::createKMessageBox()
have changed in KF5. We have to adjust the code
in DolphinMainWindow::closeEvent(QCloseEvent* event) in order to make
windows with multiple tabs closable.

BUG: 335732
REVIEW: 118508
2014-06-04 21:56:36 +02:00
Frank Reininghaus 352f644159 Fix possible crash if a kioslave adds multiple items with the same URL
When opening the URL "man:", there are multiple items with the same
name (for example, _exit is shown twice here). When opening a new tab,
the kioslave reports some items as deleted (I have not quite understood
why). The problem is that it reports some of the duplicate items twice
in the list of deleted items. This confused KFileItemModel and
corrupted the internal data structures, and finally, caused a crash.

The fix is to remove all duplicates from
KItemRangeList::fromSortedContainer(const Container& container).

New unit tests included.

BUG: 335672
REVIEW: 118507
FIXED-IN: 4.13.2
2014-06-04 21:49:02 +02:00
Frank Reininghaus 59d01e8acc Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	lib/konq/konq_operations.cpp
2014-06-01 14:52:56 +02:00
Frank Reininghaus 90e27974a4 Merge remote-tracking branch 'origin/KDE/4.13' 2014-06-01 14:48:30 +02:00
Emmanuel Pescosta 96c34cfe65 Fix Bug 334696 - File/directory icons/names move to the right when opening/refreshing contents of Dolphin
Take the scrollbar spacing into account.

BUG: 334696
REVIEW: 118319
FIXED-IN: 4.13.2
2014-05-29 15:33:03 +02:00
Emmanuel Pescosta fb69036dbd Use "selectionToggleRect().contains(pos)" instead
of "m_selectionToggle->contains(pos)" in
KItemListWidget::setHoverPosition(const QPointF& pos).

This wrong check was accidentally introduced by
commit 24326d4473

BUG: 299328
REVIEW: 118320
FIXED-IN: 4.13.2
2014-05-29 15:31:24 +02:00
Emmanuel Pescosta fa36c3fd1f Merge branch 'master' into frameworks
Conflicts:
	dolphin/src/statusbar/statusbarspaceinfo.cpp
2014-05-25 14:43:18 +02:00
Frank Reininghaus 4fe788f115 Keep the "free space" information updated in all visible views
The old code would watch the free space on a mount point, i.e.,
determine the free space again, in 10-second intervals, only until the
view became invisible once (even if it was invisible only for a very
short moment, i.e., while splitting the view).

This commit ensures that the mount point is watched again as soon as
the corresponding view becomes visible again.

Moreover, the object that watches the free space for a mount point is
shared among all views that show URLs that belong to this mount point.
To achieve this, there is a central cache which can be used to obtain
an existing MountPointObserver for a certain path. If necessary, a new
MountPointObserver is created and added to the cache.

The MountPointObserver is removed from the cache and destroyed only if
no views use it any more, and no new users appear until the next update
(which happens every 10 seconds). This prevents that the free space is
measured repeatedly when changing the current directory on the same
mount point.

Many thanks to Emmanuel Pescosta for the initial ideas to factor out
the "free space" code and to establish a central storage for the
"observer" objects, and for providing many good suggestions how to
improve the code!

BUG: 327708
REVIEW: 118208
FIXED-IN: 4.14.0
2014-05-22 18:42:17 +02:00
Frank Reininghaus a46121dc51 Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	dolphin/src/search/filenamesearchprotocol.cpp
2014-05-21 22:49:40 +02:00
Frank Reininghaus f27c124237 Merge remote-tracking branch 'origin/KDE/4.13' 2014-05-21 22:44:48 +02:00
Frank Reininghaus 4ecdb8fe6e Remove debug output
This debug output was pushed accidentally in commit
c52ba9446b
2014-05-20 08:39:56 +02:00
Frank Reininghaus 1f9d35db19 Do not lose translation of Places items if a Dolphin window is closed
If the "Places" are updated outside the current Dolphin process,
PlacesItemModel::updateBookmarks() is called, which invokes
PlacesItem::setBookmark(const KBookmark& bookmark) for each item. This
commit ensures that the correct translation is used for system
bookmarks like "Root", "Network", etc.

Without this patch, all Places entries in the remaining Dolphin windows
would switch to US English if one of multiple windows is closed.

See http://lists.kde.org/?t=139660468400004&r=1&w=2 for details.

BUG: 334999
REVIEW: 118207
FIXED-IN: 4.13.2
2014-05-20 08:31:31 +02:00
Hrvoje Senjan 6edcabf9a0 Fix build when baloo is found 2014-05-14 18:05:28 +02:00
Hrvoje Senjan ee92e7a8b9 Adjust to changes in KAboutData 2014-05-14 18:04:38 +02:00
Frank Reininghaus d152bfc53b Merge branch 'KDE/4.13' 2014-05-13 19:14:25 +02:00
Frank Reininghaus 99e8f8e2e6 Stop listing children of collapsed folders
Before this patch, KDirLister would continue listing any children of
collapsed folders, even though the children themselves were removed
from the model. This could lead to new items being inserted as
top-level items at some later point, because no parent could be found
for them. This inconsistent model state could lead to a crash later on.

Many thanks to Martin Koller for helping to debug this problem!

BUG: 332102
REVIEW: 118055
FIXED-IN: 4.13.2
2014-05-13 19:06:42 +02:00
Frank Reininghaus 66f1759b6f Ensure that all children of a collapsed folder are removed
Before this patch, any (direct or indirect) children that might have
been in m_pendingItemsToInsert, i.e., that were not inserted into the
model yet because KDirLister had not finished listing the directory
yet, would be added to the model later without a proper parent. This
could cause a crash later on.

CCBUG: 332102
FIXED-IN: 4.13.2
2014-05-13 19:04:09 +02:00
Uzair Shamim 24d0ade8e3 Allow the widget in the "Additional Information" dialog to resize
BUG: 334355
REVIEW: 118088
FIXED-IN: 4.13.2
2014-05-13 18:59:34 +02:00
Frank Reininghaus 4cf04b91dd Merge remote-tracking branch 'origin/master' into frameworks
Since the master branch had never been merged into frameworks since the
creation of the frameworks branch, I had to fix a couple of merge
conflicts and make another change in order to make it build - I hope I
did not get anything wrong.

We should probably merge master into frameworks on a regular basis from
now on.

CCMAIL:kfm-devel@kde.org

Conflicts:
	dolphin/src/dolphinmainwindow.cpp
	dolphin/src/search/dolphinfacetswidget.cpp
	dolphin/src/statusbar/dolphinstatusbar.cpp
	dolphin/src/views/dolphinview.cpp
2014-05-13 18:42:05 +02:00
Alex Richardson 7e92abb4ea KF5::KDE4Support -> KF5::KDELibs4Support 2014-05-05 23:11:12 +02:00
Alex Richardson 9d7af8a24a Fix build of tests
This is the last commit for review 117395

REVIEW: 117395
2014-05-05 23:05:34 +02:00
Alex Richardson 497e2b2fef Allow compiling with the frameworks branches of Baloo 2014-05-05 23:05:34 +02:00
Alex Richardson 8611c990f0 KIcon -> QIcon and KMimeType::iconNameForUrl() -> KIO::iconNameForUrl() 2014-05-05 23:05:34 +02:00
Alex Richardson 00ee5d6727 dolphin: convert the remaining code to Qt5 signal/slot syntax
Middle clicking on Forward/Backward/Home/etc. will no longer open a new
tab since the QAction triggered signal no longer tell us which mouse
button was pressed
2014-05-05 23:05:34 +02:00
Alex Richardson 7a26fbc5c5 dolphin: convert statusbar, settings and search to qt5 signals/slot syntax 2014-05-05 23:05:34 +02:00
Alex Richardson 05f2c9c320 dolphin: convert views/ to qt5 signal/slot syntax
Removed arguments from DolphinViewActionHandler::slotTrashActivated since
they were unused and made the connection fail.

Also fixed a bad connection in dolphinview.cpp, there is no signal
KFileItemModel::loadingCompleted
2014-05-05 23:05:34 +02:00
Alex Richardson b069fb9b43 dolphin: convert panels/ and filterbar to qt signal/slot syntax
TerminalPanel connections to konsole part were not converted since there
is no header available that defines these function, we have to keep the
old syntax here.

Additionally the new syntax no longer accepts QPointer arguments, we have
to explicitly call .data() there.
2014-05-05 23:05:33 +02:00
Alex Richardson bb642c92d3 dolphin: convert kitemviews/ to qt5 signal slot syntax
This conversion was performed automatically using convert2qt5signalslot.
The only manual changes required were changing the overloaded signal
KDirLister::redirection and KDirLister::completed from KUrl to QUrl. All
other cases were no problem since these signals are not overloaded and a
static_cast for disambiguation is not necessary.

Code inside HAVE_BALOO is not converted yet, will do that once I can build
a version with Baloo.
2014-05-05 23:05:33 +02:00
Alex Richardson 1ee5cd6488 make FileNameSearchProtocol::listDir override the KIO::SlaveBase method
The parameter changed from KUrl to QUrl -> we have to add this.

Found with -Woverloaded-virtual
2014-05-05 23:05:33 +02:00
Alex Richardson a6b03236d2 completely disable QAccessible for now, since it causes assertions 2014-05-05 23:05:33 +02:00
Alex Richardson 693bf89f2e KParts::ReadOnlyPart::openUrl() changed from KUrl parameter to QUrl 2014-05-05 23:05:33 +02:00
Alex Richardson 2f045c6010 Allow compiling Dolphin with KF5
This does not work properly yet, there are probably quite a few bad signal/
slot connections due to KUrl -> QUrl. However dolphin starts without
crashing.

Accessibility is not ported since that changed quite a lot from Qt4 -> Qt5
and I have no idea how it is supposed to be used.

This is the first commit for review 117395
2014-05-05 23:05:13 +02:00
Frank Reininghaus 4660ea3a48 Update the "Paste" action only if it is necessary
Updating this action is only required if the clipboard contents change,
or if the "is writable" state of the current location changes. In all
other cases, an update of this action should be prevented because it
can be very expensive if many files are in the clipboard.

In particular, the update when the selection changes could make
changing the current item in the view very slow.

BUG: 333903
REVIEW: 117782
FIXED-IN: 4.13.1
2014-04-30 09:34:32 +02:00
Renato Atilio 5780fab172 Change the icon text for Previous and Next toolbar buttons
In addition to the current long text for previous and next toolbar
buttons ("Activate Previous/Next Tab"), this commit adds shorter icon
texts for them to be used only on the toolbar ("Previous/Next Tab").

BUG: 332629
REVIEW: 117794
FIXED-IN: 4.14.0
2014-04-29 21:54:33 +02:00
Frank Reininghaus eddb62ac0c Merge branch 'KDE/4.13' 2014-04-29 21:44:46 +02:00
Emmanuel Pescosta 5f29eec075 Merge branch 'KDE/4.13' of git://anongit.kde.org/kde-baseapps into KDE/4.13 2014-04-26 13:08:31 +02:00
Emmanuel Pescosta 5e82e598ea Mount partitions when you open them in a new tab.
Instead of just emitting the slotItemMiddleClicked signal in
PlacesPanel::slotItemContextMenuRequested we now use triggerItem with
Qt::MiddleButton, which does set up the storage first and emit
the slotItemMiddleClicked signal afterwards.

BUG: 311226
FIXED-IN: 4.13.1
REVIEW: 117755
2014-04-26 13:07:04 +02:00
Frank Reininghaus b5ca0e2de9 Do not change the selection when re-sorting the view
If a range of items has been selected by Shift-clicking or by pressing
Shift+Arrow, then each of them is added individually to the selection
before the items are re-sorted.

Before this commit, the first and the last item in the range were
moved, and all items between them were selected, even though these were
not necessarily the items which had been selected before the
re-sorting.

BUG: 333457
REVIEW: 117603
FIXED-IN: 4.13.1
2014-04-26 12:37:39 +02:00
Renato Atilio afa1a8ef11 Enable the previous and next tab toolbar buttons
when multiple tabs are opened. Disable them again
when there is only one remaining tab.

Additionally set the default state to disabled.

BUG: 332628
FIXED-IN: 4.13.1
REVIEW: 117778
2014-04-26 12:28:42 +02:00
Emmanuel Pescosta 272cbbd16b Fix memory leak with Dropbox version control plugin.
In the current version we only call endRetrieval when
beginRetrieval was successfully in UpdateItemStatesThread::run().
This causes some problems with version control plugins (like Dropbox plugin),
which have to do cleanups in endRetrieval.

Now we always call endRetrieval after beginRetrieval when updating the version states.

FIXED-IN: 4.13.1
REVIEW: 117753
2014-04-25 12:30:39 +02:00
Emmanuel Pescosta bf4b163a0e Scroll to the right position when going back and show hidden files is enabled.
Instead of emitting the directoryLoadingCompleted signal (via slotCompleted) in
KFileItemModel::setShowHiddenFiles directly, we now call
dispatchPendingItemsToInsert instead.

@Frank: Thanks for your help!

FIXED-IN: 4.13.1
BUG: 332159
REVIEW: 117021
2014-04-24 20:16:30 +02:00
Frank Reininghaus e8eca7c266 Merge branch 'KDE/4.12' into KDE/4.13 2014-04-14 23:11:00 +02:00
Frank Reininghaus a7562862e3 Update the "is cut" state of items if necessary
The icons of items which are "cut" are shown faded in the view. The
"is cut" state of the widget representing an item is updated if the
clipboard contents change. Before this commit, if the sort order was
changed however, then each widget kept the "is cut" state of the item
which had been shown previously at its position.

The solution is to update the "is cut" state also if any of the
widget's data change.

BUG: 332792
REVIEW: 117451
FIXED-IN: 4.12.5
2014-04-14 22:55:58 +02:00
Marco Nelles ae5bcfcdee Translate bookmark text on update. 2014-04-04 11:41:28 +02:00
Frank Reininghaus 0d191c9da2 KDirectoryContentsCounter: do not delete currently active worker objects
Before this patch, the destructor of KDirectoryContentsCounter might
delete the worker object, which lives in another thread, while one of
its methods was still being executed. This could cause a crash. Only if
the destroyed KDirectoryContentsCounter was the last one, the worker
thread was stopped, and the destructor waited until all workers are
done.

BUG: 332767
FIXED-IN: 4.13.0
REVIEW: 117209
2014-04-03 09:03:47 +02:00
Albert Astals Cid 3185b565d4 Merge remote-tracking branch 'origin/KDE/4.13' 2014-03-31 01:16:22 +02:00
Albert Astals Cid 05acaf9345 Make this thing compile
CCMAIL: emmanuelpescosta099@gmail.com
2014-03-31 01:15:45 +02:00
Vishesh Handa 2849f71ba0 Merge branch 'KDE/4.13' 2014-03-30 20:33:53 +02:00
Emmanuel Pescosta 5d63b9a111 When you open a new tab while the search mode is enabled, the
newly opened tab also starts the same search (Because new tab is opened with
the current view url), but the search box is in read-only mode. So you cannot
close the search bar nor edit the search text.

This patch fixes this by parsing the search url. The value of the "search"
parameter is used as search text and the value of the "url" parameter is used
for the search path ("root" folder for the search when "Search from here" mode
is enabled).

In case of Baloo search urls, we use Baloo::Query::fromSearchUrl.

Removed everything related to read only mode in DolphinSearchBox, not needed
anymore.

REVIEW: 111968
BUG: 311950
FIXED-IN: 4.13.0
2014-03-28 18:48:48 +01:00
Emmanuel Pescosta 5c2f52e62a Set m_anyType as checked by default.
CCMAIL: me@vhanda.in
2014-03-25 23:39:47 +01:00
Vishesh Handa 76e5fd4834 Dolphin Facet Widget: Convert type selection into radio buttons
They were previously checkboxes. Most files cannot have more than 1 type
considering that the exposed types were "Document", "Image", "Video" and
"Audio".

Also, it is not very simple in baloo to search through ORs for types.
Not through the exposed API anyway.

REVIEW: 117015
2014-03-24 14:38:15 +01:00
Vishesh Handa 3e576a1659 DolphinSearchBox: Only search through filename is search text is not empty 2014-03-24 10:37:59 +01:00
Vishesh Handa 466868efa8 Dolphin Facet Widgets: Implement date based filtering
This required changes in Baloo which require reindexing. Since the
storage location has changed for Beta 3 everyone should be re-indexing
everything, so it won't be a problem.
2014-03-19 16:17:06 +01:00
Emmanuel Pescosta 53c48af236 Add the Baloo::Term to the Baloo:Query in DolphinSearchBox::balooUrlForSearching(). REVIEW: 116837 FIXED-IN: 4.13.0 2014-03-17 19:49:32 +01:00
Raymond Wooninck 6c437c1291 Merge remote-tracking branch 'origin/KDE/4.13' 2014-03-16 18:32:50 +01:00
Frank Reininghaus dd18909eec Merge branch 'KDE/4.12' into KDE/4.13 2014-03-16 18:10:24 +01:00
Frank Reininghaus d803ecec24 Use MIME type inheritance to find out if a file contains text
Before this commit, filenamesearch checked if a file's MIME type begins
with "text/" to determine if its content can be searched. This prevented
that text inside shell scripts is found.

BUG: 332143
REVIEW: 116805
FIXED-IN: 4.12.4
2014-03-16 18:02:43 +01:00
Frank Reininghaus 47de539169 Merge branch 'KDE/4.13' 2014-03-11 09:15:15 +01:00
Frank Reininghaus 773d505493 Use QMutableHashIterator for deleting items from a QHash
KItemListViewAnimation::slotFinished() used a QHashIterator to iterate
over a QHash, and then removes an item from the hash using
QHash::remove() inside the loop.

This is quite unusual - the recommended way is to use a
QMutableHashIterator (or std-style iterators and then QHash::erase(it)).

This might be related to the cause of a crash in this function.

BUG: 331876
REVIEW: 116666
FIXED-IN: 4.13.0
2014-03-11 09:07:23 +01:00
Emmanuel Pescosta 6747241934 Fix Bug 326210 - Dolphin unnecessarily truncates names of soft links in compact mode
FIXED-IN: 4.13.0
BUG: 326210
BUG: 310592
REVIEW: 116121
2014-03-05 10:48:33 +01:00
Frank Reininghaus 4e574ffae5 Merge remote-tracking branch 'origin/KDE/4.13' 2014-03-05 08:46:45 +01:00
Frank Reininghaus 08b8d28154 Remove some unused functions
REVIEW: 116562
2014-03-05 08:44:45 +01:00
l10n daemon script 8b556c8279 SVN_SILENT made messages (.desktop file) 2014-03-04 05:44:46 +00:00
Emmanuel Pescosta d980dccb12 Add a hover effect for the selection toggle.
FIXED-IN: 4.13.0
REVIEW: 116028
BUG: 299328
2014-03-03 22:06:56 +01:00
Frank Reininghaus eab1b76b76 Always go back/forward in history when pressing the respective buttons
Before this patch, pressing one of these buttons while an item is
hovered selected this item. The motivation for this behavior was to
provide a fast way to select items. However, this was counter-intuitive
and confusing for many users.

BUG: 310288
FIXED-IN: 4.13.0
REVIEW: 116469
2014-03-01 12:14:47 +01:00
Emmanuel Pescosta b740404447 Scroll to newly dropped files.
If multiple files are dropped, scroll to the first dropped file.

BUG: 315722
FIXED-IN: 4.13
REVIEW: 116020
2014-02-27 12:17:48 +01:00
Frank Reininghaus 80305554f4 Merge branch 'KDE/4.13' 2014-02-27 09:15:54 +01:00
Frank Reininghaus 006f667ab1 Merge remote-tracking branch 'origin/KDE/4.12' into KDE/4.13 2014-02-27 09:11:48 +01:00
l10n daemon script 1eadb296e5 SVN_SILENT made messages (.desktop file) 2014-02-27 04:42:34 +00:00
Emmanuel Pescosta c5d9791ad3 Show the correct icon size in the zoom slider tooltip.
BUG: 305694
FIXED-IN: 4.12.3
REVIEW: 111197
2014-02-25 19:41:45 +01:00
Emmanuel Pescosta 9a9ab6e50c Fix Bug 330605 - Dropbox plugin prevents git plugin from working
Use scoring to find the best matching plugin for the given directory.

Thanks to Phil Schaf for testing this patch!

BUG: 330605
FIXED-IN: 4.12.3
REVIEW: 116019
2014-02-25 19:38:57 +01:00
Frank Reininghaus 342822e83d Make the handling of the "maximum text lines" setting more robust
If the user sets a maximum number of text lines in the settings, this
number was translated into a maximum height in pixels using
QFontMetrics::lineSpacing() before this commit.

In KStandardItemListWidgetInformant::itemSizeHint(), this maximum height
limited the size that is reserved for the item.

However, in KStandardItemListWidget::updateIconsLayoutTextCache(), the
maximum height was translated back into a maximum number of lines,
which limits the number of lines that are created using the QTextLayout.

This approach could lead to problems if the real height of the layouted
text is 1 pixel more or less than QFontMetrics::lineSpacing() times
"number of lines".

Now we do not store a "maximum height" inside the "maximum size"
explicitly, but store a maximum number of lines and a maximum with (for
Compact View) separately, and then use the number of lines also to
calculate the required size in
KStandardItemListWidgetInformant::itemSizeHint(). This should make sure
that the correct height is reserved for each item.

Thanks to Christoph Feck and Emmanuel Pescosta for helping to debug this
problem and testing the patch.

BUG: 323841
FIXED-IN: 4.13
REVIEW: 113871
2014-02-24 21:05:09 +01:00
Emmanuel Pescosta 0d37038b40 Handle font and palette changes in Dolphin list views.
Also update the font of the meta data widget in InformationPanelContent (smallest readable font).

BUG: 329186
BUG: 315061
FIXED-IN: 4.13
REVIEW: 115958
2014-02-24 14:17:03 +01:00
Emmanuel Pescosta c2887688f1 Remove some unused functions.
void KFileItemModel::slotClear(const KUrl& url)

bool UpdateItemsThread::lockPlugin()    <- Done with QMutexLocker
void UpdateItemsThread::unlockPlugin()

REVIEW: 115627
2014-02-11 20:30:50 +01:00
Frank Reininghaus 502016c1a7 Ensure that KItemListViewLayouter always has a size hint resolver
KItemListViewLayouter uses a KItemListSizeHintResolver to find out how
much space the items will need in the view.

Before this commit, the size hint resolver object could be changed at
runtime, and it could also be null. However, we never made use of these
possibilities, so all the code that checks if m_sizeHintResolver is
null is actually not needed at all.
2014-02-11 18:28:32 +01:00
Christophe Giboudeaux 709c336776 Fix includes 2014-02-07 15:41:48 +01:00
Frank Reininghaus 016cf47c53 Merge remote-tracking branch 'origin/KDE/4.12' 2014-02-07 10:26:00 +01:00
Frank Reininghaus bb22ac0a47 Only initialize the hash m_items in KFileItemModel if it is needed
Moreover, clear the entire hash if items are added or removed.

This saves time and memory when loading a directory, and it fixes
problems that might occur if the model is in an inconsistent state, such
as crashes that can happen when we try to remove individual items from
m_items.

BUG: 329494
FIXED-IN: 4.13.0
REVIEW: 115432
2014-02-07 10:22:17 +01:00
Frank Reininghaus 564dcb08fd Fix build if Baloo is not installed 2014-02-07 10:14:29 +01:00
Vishesh Handa 64afe7b226 Port Dolphin to Baloo
Nepomuk is being replaced with Baloo
2014-02-06 20:29:09 +01:00
Emmanuel Pescosta 2c20502c34 Set the Details View colummns width to the preferred column width, by double-clicking the header grips.
BUG: 293315
FIXED-IN: 4.13
REVIEW: 115503
2014-02-06 13:00:28 +01:00
Frank Reininghaus 75c0f24020 Restore the URLs of both views correctly when restoring a session
The problem was that we restored the URL of the right view while the
left one is still active. When we received the signal
urlChanged(KUrl& url) from the right URL navigator, we then set the URL
of the active (i.e., left) view to 'url', such that both views showed
the same URL.

BUG: 330047
FIXED-IN: 4.12.3
REVIEW: 115406
2014-02-02 10:19:57 +01:00
Emmanuel Pescosta 4d9193b85b Don't store the index of the file item in the VersionControlObserver::ItemState, get the index of the file item on demand instead.
Fixes some "old"-index problems, esp. when you copy/move around files while the version control thread is still running.

FIXED-IN: 4.13
REVIEW: 115410
2014-01-31 20:56:57 +01:00
Frank Reininghaus 900a4ba3b9 Always enable the "Create New..." menu if the URL is writable
This commit works around the problem that KDirLister may not provide a
"rootItem" for some kioslaves by setting up a KFileItem with the view
URL and using this to find out if the URL is writable.

BUG: 330001
CCBUG: 330015
REVIEW: 115405
FIXED-IN: 4.12.2
2014-01-30 22:10:31 +01:00
l10n daemon script df2179ec6b SVN_SILENT made messages (.desktop file) 2014-01-22 06:22:47 +00:00
l10n daemon script 2946cc30fc SVN_SILENT made messages (.desktop file) 2014-01-22 03:54:49 +00:00
Frank Reininghaus d44436c30b Merge remote-tracking branch 'origin/KDE/4.12' 2014-01-21 19:14:44 +01:00
Frank Reininghaus 55678afcc1 Use only one "directory contents counting" thread per process
The pointer to QThread object is stored in a global variable, and each
view increments/decrements a reference count when it starts/stops using
the thread. If this thread reaches zero, the thread is stopped.

Note that we cannot just use a smart pointer, like QSharedPointer, to
manage the thread, because we must make sure that the thread is not
running any more before the QThread is deleted.

REVIEW: 115064
2014-01-21 19:08:07 +01:00
Emmanuel Pescosta f90fa0b38a Don't show tooltips while inline-renaming.
FIXED-IN: 4.12.2
REVIEW: 115146
BUG: 330126
2014-01-20 17:41:44 +01:00
Emmanuel Pescosta 419c7578f0 Remove the "retrieved items" code from UpdateItemStatesThread and VersionControlObserver.
Showing an error message, makes no sense in this case - the user can see it when all items are "unversioned".
The plugins still have the ability to show error/warning messages on real errors. (and only where it makes sense ;)

REVIEW: 114992
FIXED-IN: 4.13
2014-01-16 12:55:42 +01:00
Emmanuel Pescosta 8a46dd8d8e Use the QMap iterator instead of foreach(key, map.keys()) in UpdateItemStatesThread::run()
and in VersionControlObserver::slotThreadFinished().

So we get O(n) complexity instead of O(n*logn), and O(1) memory instead of O(n).
Thanks to Thiago Macieira for providing this information.

FIXED-IN: 4.13
REVIEW: 115018
2014-01-15 20:27:20 +01:00
Emmanuel Pescosta 3ff6e83491 Calculate all item size hints at once.
The speed up is really small, but theses changes are mostly straightforward and make the code a bit nicer - break
the KStandardItemListWidgetInformant::itemSizeHint beast into three smaller functions.

FIXED-IN: 4.13
REVIEW: 112979
2014-01-12 23:24:00 +01:00
Frank Reininghaus ace34ac134 Update copyright year 2014-01-12 16:56:09 +01:00
Frank Reininghaus 1cc335f410 Merge remote-tracking branch 'origin/KDE/4.12' 2014-01-06 20:19:48 +01:00
Frank Reininghaus 4ff27ee637 Kill any running preview jobs before starting a new one
If loading a preview takes long, it was possible before this commit
that a preview for a new item was requested before the first preview
was shown. In that case, there was a race condition, and the first
preview to arrive stayed in the Information Panel.

This commit fixes this by keeping a pointer to the preview job and
killing it before starting a new one.

BUG: 250787
FIXED-IN: 4.12.1
REVIEW: 114561
2014-01-06 20:15:11 +01:00
Frank Reininghaus 24ad08714e Avoid calling KFileItemModel::index() in KFileItemModelRolesUpdater
KFileItemModel allows to find out the index of a KFileItem with its
index(const KFileItem&) method. Calling this method is not extremely
expensive, but it's also not free (it looks up the URL of the KFileItem
in a QHash, i.e., it has to call qHash(QString) for the full URL).

In KFileItemModelRolesUpdater, we sometimes converted the known index to
a KFileItem and then back to an index in applyResolvedRoles(KFileItem).
This patch fixes this by modifying applyResolvedRoles such that it takes
the index directly as its argument.

REVIEW: 114847
2014-01-06 20:10:08 +01:00
Frank Reininghaus 4ddc3cfdde Merge remote-tracking branch 'origin/KDE/4.12' 2013-12-29 09:50:17 +01:00
Frank Reininghaus 9866e4826e Remove redundant data from KItemListViewLayouter's ItemInfo struct
It is not necessary to save the position of each item as a QPointF
because all items in a row will have the same y-coordinate, and all
items in a column will have the same x-coordinate. Therefore, we can
reduce the number of doubles that we store from

(number of items) * 2

to

(number of rows) + (number of colums)

which is at least 50% less.

REVIEW: 114460
2013-12-29 09:42:25 +01:00
Frank Reininghaus 280fa647f1 Disable the "Create folder" action in read-only directories
The action can be triggered, e.g., by pressing F10.

BUG: 294054
FIXED-IN: 4.12.1
REVIEW: 114560
2013-12-29 09:23:17 +01:00
Frank Reininghaus 545d872b81 Merge remote-tracking branch 'origin/KDE/4.12' 2013-12-22 13:20:02 +01:00
Frank Reininghaus 2e4991d5f0 Fix crash when dragging children of expanded folders in Details View
The problem was that the loop in KFileItemModel::createMimeData() which
is supposed to find out if any parent of an item has been added to the
QMimeData already (because it is not necessary to add the item in that
case) did not loop through the parents of the item, but incorrectly
replaced the local variable 'itemData' by its parent.

BUG: 329119
REVIEW: 114562
2013-12-22 13:17:05 +01:00
Frank Reininghaus c2108b122e Add unit test for KFileItemModel::createMimeData().
The test verifies that creating the mime data for a child of an expanced
folder does not cause a crash. The regression happenened in the master
branch, but it doesn't hurt to have the test also in KDE/4.12.

CCBUG: 329119
2013-12-22 13:12:51 +01:00
Frank Reininghaus d5d1ae124a Update filtered items when the "refreshItems" signal is received
This fixes the problem that the new file name is not shown in the view
if an item is renamed while it is filtered.

BUG: 329118
FIXED-IN: 4.12.1
REVIEW: 114459
2013-12-22 12:50:14 +01:00
Frank Reininghaus 8210d5e472 Update the roles for filtered items if necessary
Since Dolphin 4.11, we store not only KFileItems, but also the
corresponding ItemData struct for filtered items. This is required for
keeping track of the parent-child relationships, and has the nice side
effect that the ItemData need not be re-determined when the items are
shown again.

However, this can become a problem if the visible roles or the sort role
change while some items are filtered.

This is fixed by is fixed by clearing the QHash "values" for the
filtered items if the visible roles change. The hash will be
re-populated with all requested data as soon as the items are shown
again and the data(int) method of the model is called.

Moreover, before the items are inserted into the model after filtering,
we have to make sure that the sort role "Permissions"/"User"/etc. is
present in the hash "values". This is achieved by factoring out the code
that currently does this job for new items in createItemDataList() into
a new function, and calling this in insertItems(), because the same
treatment is required for the previously filtered files.

BUG: 328791
FIXED-IN: 4.12.1
REVIEW: 114266
2013-12-14 11:51:07 +01:00
Frank Reininghaus 2619cc1c3d Merge remote-tracking branch 'origin/KDE/4.12' 2013-12-06 01:36:42 +01:00
Frank Reininghaus 6e36733058 Make KFileItemModel::createMimeData() faster
Moreover, this commit ensures that the order of the URLs in the
QMimeData object is the same as the order of the items in the view.

Selecting many items and copying them to the clipboard could take quite
a bit of time. This is because we used
KDirModel::simplifiedUrlList(urls) to remove child items from the list
of URLs, and this function sorts the URLs internally to make it easier
to find out which of them are child URLs.

However, since commit 5c5d87fec4, the
selected indices are already stored in ascending order, and this makes
it easy to detect if an item is a child of the last item that has been
added to the QMimeData.

BUG: 283409
REVIEW: 113515
FIXED-IN: 4.13.0
2013-12-06 01:22:39 +01:00
Frank Reininghaus f3537f5b5f Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12 2013-12-06 00:56:34 +01:00
Emmanuel Pescosta c4c999d243 Fix Bug 328262 - rename bug if you cancel when folder already exists
Only connect the renamingFailed signal if there is no item with the new name in the model yet.

BUG: 328262
FIXED-IN: 4.11.5
REVIEW: 114228
2013-12-03 19:00:28 +01:00
Frank Reininghaus 03f8c373c5 Lazy-load the item data also in Compact View
The recent changes which prevent that all data for each item are saved
in a QHash already when loading the folder (see
https://git.reviewboard.kde.org/r/112725/), which save both memory and
time, do not work yet in Compact View, because
KItemListWidgetInformant::itemSizeHint() calls the model's data(int)
method for every item, which then initializes the hash.

This patch prevents that by accessing the file name directly if only
the "Name" is shown in the view, just like it's done in Icons View.

REVIEW: 113849
2013-12-02 23:14:39 +01:00
Frank Reininghaus 92cb6b3a18 Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12 2013-11-21 00:51:08 +01:00
Yichao Yu c3ad6c7406 Fix incorrect geometry updates in KItemListContainer
When resizing the window and when KItemListContainer::updateGeometries
is called before the scrollbar visibility is updated, a relayout is
triggered in `m_controller->view()->setGeometry` which updates the
scrollbar visibility and calls back to
`KItemListContainer::updateGeometries` again. Since the first call,
which has the wrong geometry (due to the incorrect scrollbar states),
updates the geometries of the scene and viewport after the second call
(which has the right geometry!!) returns, the final result is a size
that corresponded to the old scrollbar state before this commit.

This patch uses the new geometry of the view after updating it (since
it might not be the size we put in) and therefore makes the sizes
consistent.

BUG: 327709
FIXED-IN: 4.11.4
REVIEW: 113939
2013-11-21 00:47:40 +01:00
Frank Reininghaus 32264f5546 Make the "Create New..." menu in the "item context menu" work again
Since https://git.reviewboard.kde.org/r/111989/, the "Create New..."
menu in the context menu that appears when right-clicking a folder was
not a child of the DolphinMainWindow any more, but of the context menu
itself. This is the reason why the dialog that asks for a file name
when choosing one of the "Create New..." options disappeared
immediately.

This patch makes sure that the main window is the parent of the
"Create New..." menu again.

BUG: 327783
REVIEW: 113930
2013-11-21 00:41:33 +01:00
Patrick von Reth d7ed6c8805 dolphinnewfilemenu.cpp is part of dolphinprivate 2013-11-19 19:51:16 +01:00
Frank Reininghaus d0b98ba085 Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12 2013-11-18 23:44:45 +01:00
Yichao Yu c89cd8e789 Fix scrollbar spacing when no scrollbar is visible in dolphin.
Before this commit, Dolphin reserved space for the scrollbar spacing
even when no scrollbar is visible resulting in a ugly gap in the view
when:

1. the theme uses QStyle::SH_ScrollView_FrameOnlyAroundContents and
2. the theme has a positive PM_ScrollView_ScrollBarSpacing.

QtCurve can have both while Oxygen have 1 but not 2.
To reproduce the problem with Oxygen style. Replace the
`width += ....` (which returns -2 or 0 for Oxygen) with `width += 2`.

See more info here:
https://github.com/QtCurve/qtcurve-qt4/issues/9#issuecomment-28630517

CCBUG: 306631
FIXED-IN: 4.11.4
REVIEW: 113902
2013-11-18 23:40:45 +01:00
Frank Reininghaus ac8722dc7d Update the Places Panel entries when switching the language
Before this commit, we stored the translated "Places" in
.kde4/share/apps/kfileplaces/bookmarks.xml. This was not intentional -
it only happened because
PlacesItem::updateBookmarkForRole(const QByteArray& role) always stored
the translated text (returned by PlacesItem::text()) in the KBookmark.

This is be fixed by first checking if the text() is equal to the
translation of the text that is already stored in the KBookmark, and
not updating it in that case.

Note that we have to make sure that all "Places"-related use the same
context "KFile System Bookmarks" to make that work.

Thanks to Burkhard Lück and Albert Astals Cid for helping to fix this
problem!

BUG: 319282
FIXED-IN: 4.12.0
REVIEW: 113850
2013-11-15 09:20:10 +01:00
Frank Reininghaus 980846ab36 Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12 2013-11-14 09:14:51 +01:00
David Rosca c5ba8a56e7 Do not select items when navigating back/forward with the mouse
If we detect that the user pressed the back/forward buttons while
hovering the empty space of the view, such that
DolphinView::slotMouseButtonPressed(int, Qt::MouseButtons) will request
that Dolphin navigates back/forward in the history, handling the mouse
press event should stop. This prevents the possible unexpected selection
of items in the new directory.

BUG: 327412
FIXED-IN: 4.11.4
2013-11-14 09:08:29 +01:00
Wolfgang Bauer b1448a0c32 Make it build with QT_STRICT_ITERATORS
Redo commit 81c99da7e0 by Kevin Ottens

Was removed by mistake during the last merge with KDE/4.11, sorry!
2013-11-06 17:53:43 +01:00
Wolfgang Bauer ee92ff0d42 Merge branch 'KDE/4.11' into KDE/4.12
Revert "Files passed as arguments: Ignore unsupported files"

This reverts commit cd9e50ae4f.

See bug#327224 for details.
2013-11-06 17:07:10 +01:00
Wolfgang Bauer ae1911e6b0 Revert "Files passed as arguments: Ignore unsupported files"
This reverts commit cd9e50ae4f.

See bug#327224 for details.
2013-11-06 16:46:09 +01:00
Frank Reininghaus a5e266e538 Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12 2013-11-05 08:47:37 +01:00
Frank Reininghaus 971aa67665 Only do a fast pre-sorting when "Sort by Name" is used
This is a follow-up to commit 0e9f4a3987,
which tries to speed up sorting the items naturally by their name using
the idea that a fast non-natural pre-sorting already sorts the items
mostly correctly and thus reduces the number of expensive natural
comparisons.

This change only makes sense if the view is really sorted by "Name". In
other cases, the pre-sorting will most likely not be useful.

Thanks to Christoph Feck for pointing this out!
2013-11-05 08:44:31 +01:00
Emmanuel Pescosta c2bf208fe6 Fix Bug 287983 - Dolphin truncates tooltip information for long file names
Use KStringHandler and QTextLayout to wrap the text (file name)
into the maximum width of the label "name".

Make use of QFontMetrics to calculate a font size aware tooltip size.

BUG: 287983
FIXED-IN: 4.11.3
REVIEW: 113101
2013-11-02 00:12:33 +01:00
Frank Reininghaus fc2ab47898 Store the selected items in a more efficient way
Since Dolphin 2.0, we have stored the selected items in a QSet<int>,
which is neither space-efficient nor particularly fast when inserting
many items which are in a consecutive range.

This commit replaces the QSet<int> by a new class "KItemSet", which
stores the items in a sorted list of ranges. For each range, we only
store the first index and the length of the range, so we need a lot
less memory for most common selection patterns, and we also save quite
a few CPU cycles in many situations, because adding an item to the
KItemSet will in many cases not need a memory allocation at all, and
it's particularly easy when inserting sorted items into the KItemSet in
a row.

KItemSet contains a minimal subset of QSet's API which makes it
suitable as a drop-in replacement for our needs. It also has iterators,
such that the items can be iterated through easily, also with foreach.
One advantage of KItemSet compared to QSet<int> is that the items are
always iterated through in ascending order.

REVIEW: 113488
2013-10-30 23:22:23 +01:00
Frank Reininghaus 903381a898 Sort in items in two stages to speed up natural sorting
Sort the items in a folder first according to their name, without doing
a natural/locale-aware sorting. This is very fast, but the order of the
items is then already close to the final order in most cases.

The number of expensive natural comparisons required to sort the items
is thus greatly reduced.

In my experiments with a folder with 100,000 items, the time required
to sort the files was reduced by 63% with this patch.

REVIEW: 113485
2013-10-30 17:48:42 +01:00
Frank Reininghaus e518cea0cf Prevent storing some redundant data in KItemListViewLayouter
In KItemListViewLayouter, we have always stored a QRectF for each item,
which is "the area that the item occupies". However, the size of the
QRectF is already stored in the size hint resolver.

Therefore, it is sufficient to store the position of the top left
corner of the QRectF in a QPointF and construct the QRectF on demand.

This patch reduces the memory usage by 16 bytes for each item in the
view:

* a QRectF is 4 doubles -> 32 byes
* a QPointF contains only 2 doubles -> 16 bytes

REVIEW: 113487
2013-10-30 17:40:23 +01:00
Frank Reininghaus 5a019aec3a Restore the tree state in Details View if a folder is re-expanded
This patch actually does two things when collapsing an expanded folder
with expanded children:

(a) It removes all expanded children (which are removed from the model)
    from m_expandedDirs.

(b) It remembers the expanded children and restores them if the
    top-level folder is re-expanded.

BUG: 304363
FIXED-IN: 4.12.0
REVIEW: 113293
2013-10-26 09:36:50 +02:00
Frank Reininghaus 70cd04df40 Merge remote-tracking branch 'origin/KDE/4.11' 2013-10-26 09:30:18 +02:00
Frank Reininghaus f55119945f Fix broken view state restoration
The fix for bug 161385 (which was about Dolphin still showing an empty
view if a device that had been unmounted earlier was clicked in the
Places Panel) caused a regression: the view state (current item, scroll
position, Details View expansion state) was not restored any more when
going "Back".

The reason is that "m_view->reload()" in
DolphinViewContainer::setUrl(const KUrl& newUrl) was always executed
just after entering a directory, and that command overwrites this
information.

Distinguishing between "change URL" and "reload the view" works better
if it's done in DolphinMainWindow instead of DolphinViewContainer.

BUG: 326039
FIXED-IN: 4.11.3
REVIEW: 113290
2013-10-26 09:24:04 +02:00
Frank Reininghaus 76ae282ad9 Two small simplifications in KItemListViewLayouter
1. Remove the unneeded variable rowCount.

2. Simplify the calculation of the member m_maximumScrollOffset. We can
   just use the current value of "y" because this is the offset that
   the next row would have.

REVIEW: 113233
2013-10-16 23:02:06 +02:00
Frank Reininghaus 77fd0e771a Abort loading the current URL if the user presses Escape
BUG: 323181
FIXED-IN: 4.12.0
REVIEW: 113234
2013-10-16 22:39:47 +02:00
Kevin Ottens 011299eb6e Make it build with QT_STRICT_ITERATORS 2013-10-16 19:24:01 +02:00
David Faure 8bbddb3b63 Merge remote-tracking branch 'origin/KDE/4.11' 2013-10-15 09:08:47 +02:00
Frank Reininghaus 96ba990d86 Fix crash when triggereing the "Compare files" action via D-Bus
If the number of selected items is not two, Dolphin disables this
action. However, it is still possible to trigger it via D-Bus, and this
could cause a crash in DolphinMainWindow::compareFiles() because this
function did not test at all if there are really two items selected.

This patch adds such a check and simplifies the code in that function.

BUG: 325517
FIXED-IN: 4.11.3
2013-10-13 10:55:21 +02:00
Erik Hahn 0c55297ce4 Files passed as arguments: Ignore unsupported files
With this patch, Dolphin ignores all files passed to it that it can't

Also, archives are now opened inside Dolphin so it can be used as an
archive manager at least for local files. If the user tries to open a
remote archive Dolphin still opens it externally; I have observed that
if it receives one as an argument, it will display a pseudo-folder that
contains only said archive. So having it set as the archive handler is
still broken, but in a less annoying way.

CCBUG: 318683
REVIEW: 113191
FIXED-IN: 4.11.3
2013-10-13 10:48:00 +02:00
Dawit Alemayehu e3b840e4aa Moved all the extension code into dolphinpart_ext.*
REVIEW: 113132
2013-10-12 13:33:42 -04:00
Emmanuel Pescosta 2114210905 Use the icon size from KItemListStyleOption for the width and height of the
expansion area instead of KIconLoad::SizeSmall.

BUG: 325543
REVIEW: 113169
FIXED-IN: 4.12
2013-10-09 19:52:53 +02:00
Frank Reininghaus b4efdc620e Merge remote-tracking branch 'origin/KDE/4.11' 2013-10-07 09:31:45 +02:00
Frank Reininghaus 9f24c02a75 Make the code that removes items from KFileItemModel more robust
When we remove items from the model, we called the function
KFileItemModel::removeItems(const KFileItemList&, RemoveItemsBehavior).
This function then looked up the indexes of the items using the hash
m_items. This is wasteful in the situations when the indexes of the
removed items are known in advance (like when an expanded folder is
collapsed in Details View), and it can cause trouble if one item is
contained in the model multiple times (can happen when searching, and a
file both matches the search and is a child of a folder that matches
the search). Even if expanding folders in the search results list might
not be particularly useful most of the time, it makes sense to make the
model more robust to prevent crashes and other unexpected behavior in
such situations.

This patch makes the following changes to achieve that goal:

* Change the argument of removeItems() from KFileItemList to
  KItemRangeList. To make this work, the "look the indexes up in
  m_items" code is moved from that function to slotItemsDeleted(). In
  the other places where removeItems() is called, the indexes are
  calculated directly (which is not more difficult than determining the
  removed items as a KFileItemList, if one considers that we needed the
  function childItems(KFileItem) for that, which is not needed any more
  with this patch).

* Also removeFilteredChildren() takes a KItemRangeList now. Rather than
  putting the parent KFileItems into a QSet for O(1) lookup (which
  prevents O(N^2) worst case behavior for the entire function), it uses
  a QSet<ItemData*> now, which should even be more efficient (hashing a
  pointer is cheaper than hashing a KFileItem/KUrl).

BUG: 324371
BUG: 325359
FIXED-IN: 4.12.0
REVIEW: 113070
2013-10-07 09:26:51 +02:00
Frank Reininghaus 5bfb5031a5 Reload the view if a previously unmounted device is mounted again
The problem was that DolphinViewContainer::setUrl(newUrl) was ignored
if newUrl is equal to the URL which is shown in the view already.

The new approach is to reload the view in that method if it is empty, to
make sure that we do not miss that a previously unmounted device has
been re-mounted.

Thanks to Grigoriadis Grigoris for analyzing the root cause of this
issue!

BUG: 161385
FIXED-IN: 4.11.3
2013-10-07 09:17:48 +02:00
Frank Reininghaus 46a27ca937 Include "Space" in the keyboard search string
Before this commit, we only added pressed keys to the search string if
they have no other meaning. This means that files containing a Space in
their name could not be searched because Ctrl+Space toggles the
selection state of the current item, and Space alone selects the
current item.

After this commit, Space is added to the search string if

(a) the key press did not have any other effect, i.e., if Ctrl was not
    pressed, and the current item is selected already, and
(b) a keyboard search has been started already (to prevent unexpected
    effects when pressing Space accidentally - I think that it's rather
    uncommon to have files whose names start with a Space - and to make
    the unit test simpler).

I modified the unit test of KItemListController, which did not test
keyboard search yet. This uncovered a small problem in
KItemListController::slotChangeCurrentItem() when NoSelection mode is
used. It's not really relevant for anything that is executed inside
Dolphin, but I still fixed it to make the unit test happy.

BUG: 324479
FIXED-IN: 4.11.3
REVIEW: 113071
2013-10-07 09:09:00 +02:00
Frank Reininghaus ae587d2682 Save memory and time in KFileItemModel by lazy-loading the "ItemData"
To reduce unnecessary memory comsumption and CPU usage, we only fill the
QHash<QByteArray, QVariant> if the methods data(int) or setData(int) are
called for the corresponding index, or the data is necessary for sorting
the model.

According to my tests, this patch reduces the memory usage when loading
a folder with 100,000 items by 17% in Icons View, and by 26% in Details
View.

REVIEW: 112725
2013-10-02 19:08:39 +02:00
Frank Reininghaus 926782d3be Merge remote-tracking branch 'origin/KDE/4.11' 2013-10-01 00:15:04 +02:00
Frank Reininghaus 4cb0a239e5 Add unit test for the calculation of "name" groups with expanded items
This prevents a possible regression that would have happened with the
first version of https://git.reviewboard.kde.org/r/112725/

The problem was that isChildItem(int index) would return "false"
incorrectly when the QHash for that item was not initialized yet. The
grouping code would then try to read the "text" from the empty QHash,
which yielded an empty QString, and then accessing the first character
of that string caused a crash.
2013-10-01 00:09:25 +02:00
Emmanuel Pescosta c44b9e685e Show the right version states for expanded items.
BUG: 267171
FIXED-IN: 4.11.3
REVIEW: 112980
2013-09-29 18:08:06 +02:00
Frank Reininghaus 08710b05c7 Make sure that removeExpandedItems() also removes filtered items
This fixes the problem that filtered child items in Details View may
reappear when switching the view mode and the clearing the filter.

BUG: 325344
REVIEW: 112962
FIXED-IN: 4.11.3
2013-09-29 15:45:14 +02:00
l10n daemon script 71a2be8d4c SVN_SILENT made messages (.desktop file) 2013-09-27 07:07:49 +00:00
l10n daemon script c185694f79 SVN_SILENT made messages (.desktop file) 2013-09-27 04:24:51 +00:00