┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/places/placesitemmodel.cpp
AgeCommit message (Collapse)Author
2022-01-09Port back to KFilePlacesViewKai Uwe Broulik
This removes the custom-view engine version of the places panel and replaces it with the upstream `KFilePlacesView` from KIO.
2021-02-14Remove a missing emit KEYWORDMéven Car
NO_CHANGELOG
2020-10-23Compile with QT_NO_KEYWORDSAlexander Lohnau
2020-10-23Show home folder if needed after unmounting mounted diskNate Graham
Right now, when you unmount a device that any active view containers are displaying, nothing in the view changes. As a result, it's possible to try to navigate to files or folders in that view, which cannot be done because the disk that the files or folders are located on has been unmounted! With this commit, we detect that case and switch the view containers to show the home folder after the disk whose contents they are displaying gets unmounted. BUG: 158934 FIXED-IN: 20.12
2020-08-25Output of licensedigger + manual cleanup afterwards.Elvis Angelaccio
Unfortunately licensedigger does not strip the trailing * characters. While at it, use a common style for all source files.
2019-11-10PlacesItemModel: remove redundant set of propertiesElvis Angelaccio
Summary: The text, icon and url properties are already set in `PlacesItem::setBookmark()`, so there is no need to set them here. The `OnlyInApp` property is part of the KBookmark object that we are going to set to the place item, so there is no need to set it here either. Test Plan: - Open both dolphin and the Plasma file dialog in some app - Edit the text, url, icon and the "Only show when using this application" checkbox in some place item from the file dialog - Check whether the place in dolphin keeps getting updated accordingly Reviewers: #dolphin, meven, ngraham Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25230
2019-11-09Remove unnecessary semicolons after Q_UNUSEDElvis Angelaccio
GIT_SILENT
2019-11-09Fix clazy non-pod-global-static warningElvis Angelaccio
This list of URLs is only used by cleanupBookmarks(), so there is no need to make it global (which is what clazy complains about). While at it, make it also a `const QVector`.
2019-10-27Unmounting busy device doesn't tell who is blockingDavid Hallas
Summary: Unmounting a busy device from the places panel doesn't tell which applications have open files blocking the unmount. Test Plan: Mount a USB stick using Dolphin Open a file from the USB stick Unmount the USB stick using Dolphin Observe the new error message. FEATURE: 189302 Reviewers: #dolphin, elvisangelaccio, ngraham, broulik, meven Reviewed By: #dolphin, elvisangelaccio, meven Subscribers: meven, davidedmundson, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D19989
2019-03-20Fix rearranging items in places panel with hidden itemsTigran Gabrielyan
Summary: `m_sourceModel->movePlace` is called using index from the view model. This becomes an issue when there are hidden places items. This change calls `m_sourceModel->movePlace` using the corresponding mapped source index. BUG: 399430 FIXED-IN: 19.04.0 Test Plan: # Create at least 4 Places items # Hide first item # Drag the now first visible item between second and third item Actual: The item does not move Expected: The first visible item should now be second visible item in the list Reviewers: #dolphin, ngraham Reviewed By: #dolphin, ngraham Subscribers: ngraham, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D19901
2018-11-17Merge remote-tracking branch 'origin/Applications/18.12'Thomas Surrel
2018-11-17Do not disconnect all StorageAccess signals when unmountingThomas Surrel
Summary: The problem is caused by the fact device interfaces returned by Solid (e.g. item->device().as<Solid::StorageAccess>()) are not full objects, but only references/pointers to a per-device-object, i.e. requesting the same interface for a device will return the same address every time. If the interface is used used in multiple places, calling disconnect on the interface address disconnects the signals for all users. BUG: 400992 Test Plan: In Dolphin, mount a local partition (e.g. a Windows partition) then unmount it (right click on it in Places, then Unmount). Try to access it again by clicking on it in Places, we should get access to it correctly. Reviewers: #dolphin, #frameworks, bruns, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D16857
2018-11-11[PlacesItemModel] Match KFilePlacesModel addPlaces() APIElvis Angelaccio
This will allow to create a place visible only from Dolphin, by passing an `appName` to the KFilePlacesModel. CCBUG: 376619
2018-10-13[PlacesItemModelTest] Revert last two commitsElvis Angelaccio
Commit c527dc2172 proves that on the CI sometimes the `QAbstractItemModel::dataChanged` signal is not being emitted at all (build #208 failed because the test timed out). KFilePlacesModel emits `dataChanged()` in the `_k_reloadBookmarks()` slot only when it's called after the KBookmarkManager emits the `changed()` signal. And the `changed()` signal is emitted after KDirWatch emits the `created` signal. On the CI server kdirwatch is probably not reliable, which would explain why the test randomly fails.
2018-10-13[PlacesItemModelTest] Try to use an event loop instead of an hardcoded timeoutElvis Angelaccio
Increasing the timeout from 5 to 10 seconds didn't work. Let's see if an eventloop does the job.
2018-10-04[PlacesItemModel] Drop dead codeElvis Angelaccio
m_bookmarkedItems is long gone (since commit da6f8fe0862585287153). Porting `showModelState()` to the new KFilePlacesModel source model is not worth it, since this was just a debugging function and most of the logic has been moved upstream anyway (see T7040).
2018-04-29Merge branch 'Applications/18.04'Antonio Rojas
2018-04-29Don't filter out duplicated entries from places panelAntonio Rojas
This can lead to crashes and is inconsistent with the KIO file picker dialog, which shows duplicated entries. BUG: 393528 Differential Revision: https://phabricator.kde.org/D12558
2018-04-01Split Image Size into Width/HeightJulian Schraner
Summary: This patch splits the single property "Image Size" into "Width" and "Height", providing more fine-tuned control for power users. FEATURE: 374559 Test Plan: - Sorting works correctly - No real change, only exposed differently Reviewers: #dolphin, elvisangelaccio, ngraham Reviewed By: #dolphin, elvisangelaccio, ngraham Subscribers: ngraham, elvisangelaccio Differential Revision: https://phabricator.kde.org/D11816
2018-04-01Fix detachingElvis Angelaccio
2018-03-19Introduce singleton for KFilePlacesModelKai Uwe Broulik
There are various places where Dolphin created a new KFilePlacesModel which would then query all storage devices and do other expensive work. Differential Revision: https://phabricator.kde.org/D11283
2018-03-04Remove unused #includeRoman Inflianskas
Summary: I used CLion inspection to hunt all unused #include Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: bcooksley, markg, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10985
2018-03-03Remove unused #includeRoman Inflianskas
Summary: I used CLion inspection to hunt all unused #include Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: markg, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10985
2018-01-26Fix place item edit after creationRenato Araujo Oliveira Filho
Summary: Make sure that the place can be edited after the creation. Depends on D9333 BUG: 389147 Test Plan: Create an item in dolphin places panel, make sure that you can rename it Reviewers: #dolphin, ngraham Reviewed By: ngraham Subscribers: michaelh, elvisangelaccio, lbeltrame, ngraham, #dolphin Differential Revision: https://phabricator.kde.org/D9985
2018-01-26Make sure that old URLs do not appear duplicated in places modelRenato Araujo Oliveira Filho
Summary: BUG: 389401 KIO model now provides Baloo URLs; we need to remove the old ones created by Dolphin places model BUG: 387888 Depends on D9332 Test Plan: unit test Reviewers: mwolff, #dolphin, ngraham, elvisangelaccio Reviewed By: #dolphin, ngraham, elvisangelaccio Subscribers: elvisangelaccio, broulik, ervin, ngraham, #dolphin Differential Revision: https://phabricator.kde.org/D9333
2018-01-19Revert "Ignore baloo urls created from new KIO model"Luca Beltrame
This reverts commit 9d3a019445d7a7fdf3177bca9eeef4c44599e706. Causes breakage in Dolphin in master. The proper fix is in D9333. CCBUG: 389147
2018-01-18Merge remote-tracking branch 'origin/Applications/17.12'Luca Beltrame
Conflicts: CMakeLists.txt [versions] src/panels/places/placesitemmodel.cpp
2018-01-11Explicitly pass iconNameForUrl when dropping places entryKai Uwe Broulik
Differential Revision: https://phabricator.kde.org/D9609
2018-01-08Fix PlacesItemModel loading with hidden devicesRenato Araujo Oliveira Filho
Summary: Make sure that hidden devices loaded after module initialization does not appear in the view. Check for item visibility before add it on the model. Test Plan: Unit test created Reviewers: franckarrecot Reviewed By: franckarrecot Subscribers: cfeck, ervin, #dolphin Differential Revision: https://phabricator.kde.org/D9441
2018-01-02Ignore baloo urls created from new KIO modelRenato Araujo Oliveira Filho
Summary: For now ignore baloo urls that was created by new KIO::KFilePlacesModel, until we make use of new KIO API. BUG: 387888 Test Plan: Open any KIO file dialog using the new API. Runs dolphin v17.12.0 Make sure that baloo urls does not appear duplicated Reviewers: ngraham, elvisangelaccio Reviewed By: ngraham, elvisangelaccio Subscribers: cfeck, elvisangelaccio, ervin, mlaurent, #dolphin Differential Revision: https://phabricator.kde.org/D9347
2017-12-14Implemented support for hide/show groupsRenato Araujo Oliveira Filho
Summary: Added an option on PlacesPanel context menu to show or hide the entire group of places. Depends on D8855 Test Plan: Open Donlphin and use PlacesPanel context menu to hide and show groups Reviewers: franckarrecot, mlaurent, mwolff, elvisangelaccio Reviewed By: franckarrecot, mlaurent, mwolff, elvisangelaccio Subscribers: rkflx, mwolff, elvisangelaccio, ngraham, #dolphin Differential Revision: https://phabricator.kde.org/D9242
2017-12-14Use Kio::KPlacesModel as source model for PlacesItemModelRenato Araujo Oliveira Filho
Summary: Use Kio::KPlacesModel as source model for PlacesItemModel avoiding duplicated code. Depends on D8862 Depends on D8332 Depends on D8434 Depends on D8348 Depends on D8630 Test Plan: Unit test created Reviewers: elvisangelaccio, emmanuelp, mlaurent, mwolff Reviewed By: elvisangelaccio, mlaurent, mwolff Subscribers: mwolff, mlaurent, anthonyfieroni, nicolasfella, ngraham, #dolphin Differential Revision: https://phabricator.kde.org/D8855
2017-11-21Modernize: Use nullptr everywhereKevin Funk
2017-11-11Prevent folders from drag and dropping onto themselves in dolphin main viewEmirald Mateli
Summary: This patch aims to improve user experience by not allowing the user to drag and drop a folder into itself. The current behavior shows a red message at the top which can then be closed by the user, instead of relying on that, this patch disables the option of dropping onto self and uses the "Invalid drop target cursor" to highlight the behavior. BUG: 307747 Since spectacle is unable to screenshot the cursor overlay, find attached a photo of the screen. {F3787651} Test Plan: 1. Drag a folder. 2. Drop it onto itself. Reviewers: #dolphin, elvisangelaccio, ngraham, rkflx, dfaure Reviewed By: #dolphin, elvisangelaccio, rkflx, dfaure Subscribers: rkflx, ngraham, elvisangelaccio, dfaure, anthonyfieroni, #konqueror Tags: #dolphin Differential Revision: https://phabricator.kde.org/D6281
2017-10-12Don't block unmounting when terminal panel's cwd is the mountpointMiklos Marton
When unmounting a removable media Dolphin checks if there are some files open on the device before performing the unmount. If the terminal window in dolphin is open and the to be unmounted path is open, the unmount process will be blocked. This patch sets the terminal window current path to the home directory upon unmount request if the terminal directory is set to the mount path. The unmount request could came from two sources: The user could hit right click on the media in the dolphin's places panel and hit unmount. The user could request an unmount from the indicator applet This patch was originally written by Arjun AK for the kdelibs4 version of Dolphin: https://git.reviewboard.kde.org/r/121613/ BUG: 158264 FIXED-IN: 17.11.80 Differential Revision: https://phabricator.kde.org/D7847
2017-06-11Ignore drops-onto-items from invalid places itemsElvis Angelaccio
If the QMimeData object created by PlacesItemModel doesn't have any url set (e.g. when dragging unmounted devices), it is detected by the resulting DropJob as "drop raw data" because the mimeData has one format set (the internalMimeType() used for dragging between places items). This results in a crash because the DropJob schedules a PasteJob, but in the meantime the QDrag from Dolphin ends and deletes the mimeData object that was passed to the paste job. The fix is to prevent the DropJob in the first place. We can introduce a new internal mimetype that we use to blacklist drops-onto-items (while still allowing drops-between-items). This way PlacesItemModel can set the blacklist flag if the mimeData is being created without urls. BUG: 373005 FIXED-IN: 17.04.3 Test Plan: Drag and drop an unmounted device to another place item or the DolphinView, doesn't crash anymore. Dropping the unmounted device between two places item still works. Differential Revision: https://phabricator.kde.org/D5535
2017-03-15[PlacesItemModel] Use QDir::homePath() instead of KUser().homeDir()Kai Uwe Broulik
KUser does quite a lot of stuff under the hood and also calls getpwuid which might block with network login. Differential Revision: https://phabricator.kde.org/D5049
2017-03-14Cleanup Places Panel context menusKai Uwe Broulik
Differential Revision: https://phabricator.kde.org/D4498
2017-01-21Change "Date" to "Modified" and allow access to new "Accessed" time fieldDon Nguyen
This is merge of #128964 and #128942. This will impelement changing the "Date" field to "Modified" and allow a new "Accessed" time field to be available. This also includes changes to update configuration files. REVIEW: 129077
2016-06-25add_definitions(-DQT_NO_URL_CAST_FROM_STRING) + fix compilationDavid Faure
This fixes some URLs built from local paths without scheme.
2016-03-16[CLAZY] Fixed all level 1 and level 2 warnings with small exceptionsArtur Puzio
REVIEW: 126771
2015-11-19Fix search in places panel.Weng Xuetian
addType("File") will create a invalid query for baloo. Currently seems there is no replacement for it, so just remove it. REVIEW: 126109 FIXED-IN: 15.12 BUG: 348902
2015-07-31Remove unused KBookmarkManager::bookmarksChanged signal-slot connection, ↵Emmanuel Pescosta
because we don't use KBoomark's D-Bus signaling anymore. REVIEW: 124497
2015-07-27Change the Dolphin places icons:Christian Butcher
* folder-txt => folder-text * folder-video => folder-videos * folder-image => folder-images Thanks to andreas_k and Christian Butcher! BUG: 347257 FIXED-IN: 15.08.0
2015-04-29Use user-places.xbel instead of bookmarks.xml in places model.Emmanuel Pescosta
REVIEW: 123526 CCBUG: 345174 FIXED-IN: 15.08.0
2015-02-26Port away from KDELibs4Support (we only use KDELibs4Support when baloo isn't ↵Emmanuel Pescosta
present, because KFileMetaDataWidget is in KDELibs4Support) Reviewed-By: Vishesh Handa
2015-02-25Merge branch 'master' into frameworksEmmanuel Pescosta
2015-02-24Replace kDebug/kWarning by categorized logging (org.kde.dolphin)Emmanuel Pescosta
2015-02-24Removed unused KGlobal includes and use KIO/Job instead of KIO/JobClassesEmmanuel Pescosta
2015-02-20Missed a saveBookmarks call in the PlacesItemModel's deconstructor (see ↵Emmanuel Pescosta
commit 2a79feaea0088730bbf4fd4b65baa1c4a91b84b9)