Commit graph

4508 commits

Author SHA1 Message Date
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 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 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 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
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 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
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 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