Commit graph

807 commits

Author SHA1 Message Date
Eike Hein
ac18ec1712 Fix inadvertent losses of custom icon positions due to config handling.
The configChanged() implementation could unnecessarily schedule a
reload due to a bug in a has-this-config-element-changed comparison,
which would result in icon position losses in scenarios such as
changing the wallpaper or the workspace theme, without having touched
any sorting-related options. Further, OK'ing the config dialog could
undo the unsorted state entered by moving an icon while the dialog
was open; this is now handled by updating the sorting mode combo box
in the dialog after the icon is dropped.

The later relies on a preceding fix in kde-workspace.git to make
Applet::isUserConfiguring() work for containments if Folder View is
used as desktop containment.
2013-04-15 16:20:03 +02:00
Eike Hein
49bbb88343 Merge branch 'KDE/4.10' 2013-04-15 10:42:50 +02:00
Eike Hein
f979fab6c8 Tint icon by selection color if selected, consistent with Dolphin. 2013-04-15 10:42:34 +02:00
Eike Hein
15428f1910 Default to main view sorting defaults if the main view is unsorted. 2013-04-15 10:42:25 +02:00
Ignat Semenov
ed34d83fd5 no need to check pointer before deleting it 2013-04-11 16:38:56 +04:00
Ignat Semenov
b7364ade72 no need to check pointer before deleting it 2013-04-11 16:31:04 +04:00
Script Kiddy
246f429e18 SVN_SILENT made messages (.desktop file) 2013-03-26 16:54:49 +01:00
Ignat Semenov
c3b160dae8 unbreak build with a Q_DECLARE_METATYPE 2013-03-25 22:36:48 +04:00
Ignat Semenov
c7884e2122 unbreak build with a Q_DECLARE_METATYPE 2013-03-25 22:30:47 +04:00
Ignat Semenov
391fd1b7a5 int -> QVariant for IconView::Flow 2013-03-25 22:21:33 +04:00
Ignat Semenov
f5d55278d2 int -> QVariant for IconView::Flow 2013-03-25 22:15:00 +04:00
Ignat Semenov
3b1bc8346f rename the applet to "Folder" 2013-03-25 16:18:01 +04:00
Aaron Seigo
8cd943f5c1 automatically focus the line edit when custom title is selected 2013-03-25 15:51:02 +04:00
Aaron Seigo
edd0e0405c buddies, tab order, click message 2013-03-25 15:50:49 +04:00
Aaron Seigo
3c9f0c2d5a a colon (:) after Title as per the gui guidelines 2013-03-25 15:50:31 +04:00
Ignat Semenov
4197a2b88b redo the title configuration ui
- move the title configuration UI to the Location page
- use one combobox + one lineedit
- use an enum instead of comparing strings
- clean up the code

BUG:313940
FIXED-IN:4.11
2013-03-25 15:49:20 +04:00
Ignat Semenov
5fb0a7236b streamline the filter combobox code
- int m_filterType -> ProxyModel::FilterType m_filterType
- ProxyModel::filterModeFromInt(int) -> static_cast<ProxyModel::FilterType>(int)
- int -> QVariant<ProxyModel::FilterType> in the config UI
- selectUnselectAll() -> two separate methods; eliminate sender() call

This also fixes filterChanged() and configAccepted() wrt this config key.
Use the actual filter mode value instead of the combobox index which is
error-prone in case the order of the items in the combobox changes.

BUG:317323
FIXED_IN:4.10.2
2013-03-25 15:48:33 +04:00
Ignat Semenov
050a8c33aa streamline the filter combobox code
- int m_filterType -> ProxyModel::FilterType m_filterType
- ProxyModel::filterModeFromInt(int) -> static_cast<ProxyModel::FilterType>(int)
- int -> QVariant<ProxyModel::FilterType> in the config UI
- selectUnselectAll() -> two separate methods; eliminate sender() call

This also fixes filterChanged() and configAccepted() wrt this config key.
Use the actual filter mode value instead of the combobox index which is
error-prone in case the order of the items in the combobox changes.

BUG:317323
FIXED_IN:4.10.2
2013-03-25 15:41:56 +04:00
Script Kiddy
7a4946e49a SVN_SILENT made messages (.desktop file) 2013-03-15 14:57:44 +01:00
Script Kiddy
d19745cd6a SVN_SILENT made messages (.desktop file) 2013-03-15 10:09:23 +01:00
Script Kiddy
de34d5edc9 SVN_SILENT made messages (.desktop file) 2013-03-14 17:08:18 +01:00
Script Kiddy
986aaa766f SVN_SILENT made messages (.desktop file) 2013-03-14 09:38:14 +01:00
Patrick von Reth
e3cbdc2312 fixed build on non x11 systems
(cherry picked from commit 8e6d6a0f2d)
2013-02-19 16:10:06 +01:00
Thiago Macieira
81f7f6ac23 Make sure we find X11 libraries.
Both Konqueror and the folderview applet use X11 functions directly so
we need to make sure CMake is finding it. Right now, this works
because Qt4ConfigDependentSettings.cmake that is distributed with KDE
does an indirect find_package. The one in upstream CMake does not, so
it's a ticking time bomb and depends on installation configuration.
2013-02-18 08:59:10 -08:00
Aaron Seigo
331a177499 compare against new value, not against itself
typo found by Ömer Fadıl USTA
2013-02-17 12:27:24 +01:00
Aaron Seigo
342e894932 compare against new value, not against itself
typo found by Ömer Fadıl USTA
2013-02-17 12:23:36 +01:00
Ignat Semenov
b71c205996 style 2013-02-15 20:41:21 +04:00
Ignat Semenov
35fa98757b fix warning 2013-02-05 21:45:52 +04:00
Ignat Semenov
1e8bfcc503 fix warning 2013-02-05 21:45:38 +04:00
Ignat Semenov
7db7557465 remove networkStatusChanged() as redundant
* Use networkAvailable() instead of networkStatusChanged()
* Enable the "network not reachable" error message
* Connect to the network status update notification in init()
2013-02-05 17:17:09 +04:00
Ignat Semenov
125cfae8d5 fix a typo:reload the url if it's not local 2013-02-05 16:23:26 +04:00
Ignat Semenov
7259d5efc6 fix a typo:reload the url if it's not local 2013-02-05 16:23:03 +04:00
Patrick von Reth
8e6d6a0f2d fixed build on non x11 systems 2013-01-13 14:24:57 +01:00
Script Kiddy
90caebf153 SVN_SILENT made messages (.desktop file) 2013-01-11 08:13:08 +01:00
Script Kiddy
d8ab9f5c43 SVN_SILENT made messages (.desktop file) 2013-01-10 12:19:18 +01:00
Aaron Seigo
35841f2536 these methods aren't implemented 2013-01-09 17:31:52 +01:00
Script Kiddy
a8c475eefa SVN_SILENT made messages (.desktop file) 2012-12-24 08:54:15 +01:00
Ignat Semenov
0df2b730ea fix crash: delete the Dialog and its child ListView in the applet dtor
The ListView object ownership is transferred to Dialog upon creation, so
not deleting the Dialog object in the applet dtor results in a leaked
ListView. However, when the leaked ListView receives a repaint signal on
plasma theme change, the model pointer in that view is already invalid,
which leads to the crash in m_model->rowCount().

BUG:299077
FIXED-IN:4.9.5
2012-12-23 23:22:25 +04:00
Script Kiddy
1a3fc37886 SVN_SILENT made messages (.desktop file) 2012-12-23 07:50:02 +01:00
Script Kiddy
a0330ee72b SVN_SILENT made messages (.desktop file) 2012-12-22 08:05:56 +01:00
Ignat Semenov
09c8e911d6 Revert "delete m_listView in constraintsEvent()"
This reverts commit f9ec7cf53d.

BUG:311754
2012-12-16 21:35:55 +04:00
Script Kiddy
6f2a295092 SVN_SILENT made messages (.desktop file) 2012-12-10 07:32:47 +01:00
Aaron Seigo
37747c3a2f simplify 2012-11-20 12:14:52 +01:00
Marco Martin
b66a3e6ea3 use kwin for shadows 2012-11-16 16:08:15 +01:00
Christoph Feck
299c8332dd Merge remote-tracking branch 'origin/KDE/4.9' 2012-10-26 01:58:50 +02:00
Jekyll Wu
f6cd6d1d81 Remove unused local variables (-Wunused-variable) 2012-10-24 10:27:52 +08:00
Ignat Semenov
f9ec7cf53d delete m_listView in constraintsEvent()
CCBUG: 299077
2012-10-22 18:37:42 +04:00
Dawit Alemayehu
a469cd9847 Merge remote-tracking branch 'origin/KDE/4.9' 2012-10-16 00:38:13 -04:00
Ignat Semenov
9888a438d8 check the "paste" action pointer in PopupView::showContextMenu 2012-10-13 18:43:58 +04:00
Ignat Semenov
fe8b9eafcb check if the model index list is empty in PopupView::contextMenuRequest
TODO: Context menu code is duplicated between FolderView and PopupView, and needs to
be factored out.

BUG:292127
FIXED-IN:4.9.3
2012-10-13 00:59:28 +04:00
Ignat Semenov
30ae111f75 check if the model index list is empty in PopupView::contextMenuRequest
TODO: Context menu code is duplicated between FolderView and PopupView, and needs to
be factored out.

BUG:292127
FIXED-IN:4.9.3
2012-10-13 00:56:11 +04:00
Gregor Tätzner
1465967cac Use folder-blue instead of user-folder as iconName for unkown icons. 2012-10-02 13:11:20 +02:00
Raphael Kubo da Costa
396c2c3fcf Adjust to Ark's drag'n'drop D-Bus interface changes.
Ark's drag'n'drop D-Bus interface needs to be changed: so far, the object
path was always /DndExtract, but this does not work if Ark is being used as
an embedded KPart (in Konqueror or Rekonq, for example), as all tabs will
end up calling QDBusConnection::registerObject() with the same path. Only
the first call will work, and the result is that dragging and dropping from
any tab previewing an archive with Ark will extract from the first archive
being previewed.

To fix that, applications that accept the application/x-kde-dndextract
mimetype should now be adjusted to check the
application/x-kde-ark-dndextract-service and
application/x-kde-ark-dndextract-path ones instead; the former contains the
same service information that used to be passed, while the latter tells
which object path should be talked to.

This is the folderview part of the change, modeled after the changes made to
Dolphin.

CCBUG: 304860
2012-08-26 01:29:43 -03:00
Ignat Semenov
d3b8716c57 only start the clear saved positions timer if it is already running
CCBUG:265774
2012-07-13 21:05:47 +04:00
Ignat Semenov
87691b0cb8 use m_model instead of m_dirModel since the view can be filtered 2012-07-06 16:50:19 +04:00
Script Kiddy
0388171e04 SVN_SILENT made messages (.desktop file) 2012-06-26 19:08:12 +02:00
Script Kiddy
12abf054b8 SVN_SILENT made messages (.desktop file) 2012-06-18 10:06:11 +02:00
Script Kiddy
8aa8921501 SVN_SILENT made messages (.desktop file) 2012-06-16 12:13:06 +02:00
Ivan Čukić
b9379ec086 Selecting the proper item in the configuration dialogue when showing
the files from the current activity (activities:/current/)
2012-05-25 09:39:32 +02:00
Ignat Semenov
c1a82f1321 use Plasma::viewFor() to locate the relevant QGraphicsView
QGraphicsView::underMouse() can fail if the mouseEnterEvent has not been
delivered. E.g. opening a context menu in a folder peek popup and then clicking
the desktop makes subsequent underMouse() calls return false.

This replaces underMouse() with the standard Plasma method based on using the
item's scene coordinates.

BUG:300386
FIXED-IN:4.8.4
2012-05-21 20:38:01 +04:00
Ivan Čukić
70ca713486 Showing current activity 2012-05-16 22:41:16 +02:00
Ivan Čukić
93fba26f56 Added folderview option to show files related to the current activity 2012-05-16 17:54:04 +02:00
Script Kiddy
234818d7a0 SVN_SILENT made messages (.desktop file) 2012-04-17 16:06:32 +02:00
Ignat Semenov
87d7b70509 add public slot FolderView::addUrl(KUrl)
This slot can be used e.g. by Kickoff for the "Add to Desktop" action to add a real link
instead of an Icon applet.

REVIEW:104328
2012-03-29 16:23:55 +04:00
Ignat Semenov
1417342151 automatically disable action buttons if they cover the actual icon
REVIEW:104413
2012-03-27 10:50:59 +04:00
Ignat Semenov
046c8cf4c6 set the custom icon position data before setting the model
This is to avoid a potential race condition between the end of the layouting
process and setting the custom icon position data.

CCBUG:265774
2012-03-26 18:05:47 +04:00
Ignat Semenov
0b534c25dc give "Display" configuration page labels sane names 2012-03-25 19:20:20 +04:00
Ignat Semenov
a20258c2ee do not shrink icons on mouse press+Ctrl and mouse press+Shift 2012-03-25 17:11:28 +04:00
Ignat Semenov
9c7cf7525a fix previously unselected icon repaint on mouse press event
This fies a bug introduced in 98e43df2c5
2012-03-25 16:53:00 +04:00
Ignat Semenov
8d3055fb4a scroll automatically on dragging the rubberband over the view edge
BUG:189350
REVIEW:104396
2012-03-24 20:22:41 +04:00
Ignat Semenov
2f74937497 document the icon position data format and setIconPositionsData() 2012-03-24 19:47:57 +04:00
Ignat Semenov
2e80f9b45a correctly handle m_sortDirsFirst in configChanged() 2012-03-24 19:43:26 +04:00
Ignat Semenov
98e43df2c5 repaint less on mousePressEvent, mouseReleaseEvent and mouseDoubleClickEvent
Only call markAreaDirty() for those items that have really changed their state
as a result of the mouse event.

REVIEW:103822
2012-03-22 20:27:39 +04:00
Aaron Seigo
410c44bf99 only restore state when coming out of being iconified
BUG:295535
2012-03-19 20:31:41 +01:00
Aaron Seigo
fb25c1d284 Containment::saveState does useful things as well 2012-03-19 20:31:29 +01:00
Aaron Seigo
91a0c51e13 Revert "resize to the default size in constraintsEvent(), not in the applet constructor"
This reverts commit b0f8ba9d84.
2012-03-19 20:19:08 +01:00
Aaron Seigo
53af4e8d14 nest if's suck :) 2012-03-19 20:19:02 +01:00
Ignat Semenov
568d85d63e do not crash when passing a url in the ctor
Do not call setUrl in the ctor since m_dirLister does not exist yet.
Instead, assign m_url and call setUrl later in init().
2012-03-17 13:44:21 +04:00
Ignat Semenov
f838eb40df update the size hint on setting icon size and word wrap
Use updateSizeHint() instead of markAreaDirty() in setWordWrap()
and setIconSize() to relayout the view automatically.
2012-03-14 22:24:43 +04:00
Ignat Semenov
4327bca491 scale correctly when placed in a panel
1)Use setPreferredSize instead of setMinimumSize
2)Set the size policy to QSizePolicy::Minimum

Also, remove update() from constraintesEvent() as per the docs.

BUG:295531
FIXED-IN:4.8.2
2012-03-12 23:50:58 +04:00
Ignat Semenov
2f7a07157f close the folder peek popups on triggering the "Open With" action
Close all open popups on "Open With" selected to maintain consistency with activating an item in the folder peek popup and in order not to occlude the dialog with the popup
1)Expose the KFileItemActions object in KonqPopupMenu
2)Add a method hideThisAndParentPopup() to hide the open popups without deletion;actually delete the popups only after executing the context menu in order to avoid a crash in contextMenuRequest() after deleting the popups

BUG:240414
FIXED-IN:4.8.2

reviewed by fredrikh
2012-03-06 19:37:03 +04:00
Ignat Semenov
2ccb2c2cff use QVector instead of QList for storing the check state of the model items
This makes the data() call for Qt::CheckStateRole O(1) instead of O(n).

reviewed by fredrikh
2012-02-25 18:54:00 +04:00
Ignat Semenov
0a24ae1bee properly handle the m_showPreviews setting in configChanged() and configAccepted()
BUG:294377
FIXED-IN:4.8.1
2012-02-25 16:35:10 +04:00
Ignat Semenov
4ba8055d84 do not inherit parent model filtering settings in the popup view 2012-02-22 18:33:09 +04:00
Ralf Jung
39baedcf97 make folderview compile with Qt 4.7
REVIEW: 104030
2012-02-21 12:10:47 +01:00
Script Kiddy
6d74e9f516 SVN_SILENT made messages (.desktop file) 2012-02-16 10:49:16 +01:00
Ignat Semenov
8ff2cf1357 inherit parent text line count in the popup view 2012-02-12 23:09:14 +04:00
Ignat Semenov
303e963f4e correctly apply text line count settings in list view
1)Apply the text line count setting in updateListViewState() - removed an incorrect pointer check
2)Relayout the items in the list view on text line count change and recalculate the list view size

This correctly fixes bug 261207, as it allows the user to set the text line count to 1, thus saving vertical space.

BUG:261207
FIXED-IN:4.8.1
2012-02-12 22:14:48 +04:00
Ignat Semenov
b0f8ba9d84 resize to the default size in constraintsEvent(), not in the applet constructor
This has the added benefit of the applet behaving correctly if dragged out of a panel and dropped onto the desktop.
2012-02-11 22:32:47 +04:00
Ignat Semenov
fe323abef1 read custom icon size in init() 2012-02-11 22:01:49 +04:00
Ignat Semenov
f1d15d2a8c do not paint the hovered frame on the pressed icon during the drag 2012-02-11 20:43:49 +04:00
Ignat Semenov
5304ebf8b9 re-read the flow settings in configChanged() 2012-02-11 14:13:41 +04:00
Ignat Semenov
89208d71a9 do not scale the folderview icon when in panel
1)Keep the folderview panel icon size constant independent of the panel height / width.
2)Update icon size on panel icon size change using KGlobalSettings.
3)Check for m_iconWidget in the panle branch of constraintsEvent() to avoid creating duplicates / ghost entries on constraintEvent().

BUG:244557
FIXED-IN:4.8.1
REVIEW:103915
2012-02-11 00:23:35 +04:00
Ignat Semenov
84a2cb8b81 when sorting files by category other than the name, and the data in that category is the same for both files, sort by the name instead
fix sorting by size

1)If the files have identical size, type or modification time, sort them by name for consistency - this fixes "random" sorting
2)Explicitly handle sorting by size (previously done by size_t->string, resulting in wrong sorting)
3)When sorting by size, put folders on top of the list and sort them by the number of child items
4)Introduce three-level fallback for file name comparison, as done in Dolphin. Thanks goes to Peter Penz

BUG:265774
FIXED-IN:4.8.1
CCMAIL:peter.penz19@gmail.com
REVIEW:103895
2012-02-09 22:45:22 +04:00
Ignat Semenov
5c82f31cba account for the possible margin size change on plasma theme change in IconView and ListView
move m_itemFrame to AbstractItemView; code duplication--

BUG:290694
FIXED-IN:4.8
2012-02-09 22:06:46 +04:00
Ignat Semenov
69bc39db13 give folders sorting precedence regardless of the sorting order used
When comparing folders wth other file items in ProxyModel::lessThan(), take into account the current sorting order to allow folders to get to the start of the list. Note that the folders are still sorted according to the current sorting order.

CCBUG:180646
REVIEW:103884
2012-02-08 01:39:58 +04:00
Ignat Semenov
4a31a10022 disable on-hover item animation if the KDE graphic effects level is lower than SimpleAnimation
reviewed by fredrikh
2012-02-07 18:39:55 +04:00
Ignat Semenov
e7d7c3086f Open sub-popups automatically on hovering over folder items 2012-02-07 11:55:45 +04:00
Ignat Semenov
8d28cbecee Revert "Do not account for the vertical frame margins in the listview item size calculation to save vertical space."
This reverts commit c2d6531eaa.
2012-02-07 11:47:56 +04:00
Ignat Semenov
1d32c2cf35 check the m_iconView pointer in clickSettingsChanged()
This fixes a crash when applying mouse settings with a folderview in a panel.
2012-02-06 20:29:31 +04:00