diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b43d67e3e..05c6e9cbe2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,2 +1,127 @@
+cmake_minimum_required(VERSION 2.8.12)
+
+project(Dolphin)
+
+set(DOLPHIN_VERSION "14.12.95")
+
+set(QT_MIN_VERSION "5.4.0")
+set(KF5_MIN_VERSION "5.7.0")
+set(ECM_MIN_VERSION "1.6.0")
+
+# ECM setup
+find_package(ECM ${ECM_MIN_VERSION} CONFIG REQUIRED)
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
+
+include(ECMSetupVersion)
+include(ECMGenerateHeaders)
+include(ECMPackageConfigHelpers)
+include(GenerateExportHeader)
+include(FeatureSummary)
+include(KDEInstallDirs)
+include(KDECMakeSettings)
+include(KDEFrameworkCompilerSettings)
+
+ecm_setup_version(${DOLPHIN_VERSION} VARIABLE_PREFIX DOLPHINVCS
+ VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h"
+ PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake"
+ SOVERSION 5
+)
+
+ecm_setup_version(${DOLPHIN_VERSION} VARIABLE_PREFIX DOLPHINPRIVATE
+ SOVERSION 5
+)
+
+find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
+ Core
+ Widgets
+ Gui
+ DBus
+ Test
+)
+
+find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
+ DocTools
+ Init
+ KCMUtils
+ NewStuff
+ CoreAddons
+ I18n
+ DBusAddons
+ Bookmarks
+ Config
+ KIO
+ Parts
+ Solid
+ IconThemes
+ Completion
+ TextEditor
+ WindowSystem
+ Notifications
+)
+find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS
+ Activities
+)
+
+find_package(Phonon4Qt5 CONFIG REQUIRED)
+
+find_package(KF5Baloo 4.97)
+set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "Baloo Core libraries"
+ URL "http://www.kde.org"
+ TYPE OPTIONAL
+ PURPOSE "For adding desktop-wide search and tagging support to dolphin"
+ )
+
+find_package(KF5BalooWidgets 4.97)
+set_package_properties(KF5BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets"
+ URL "http://www.kde.org"
+ TYPE OPTIONAL
+ )
+
+find_package(KF5FileMetaData 4.97)
+set_package_properties(KF5FileMetaData PROPERTIES
+ URL "https://projects.kde.org/kfilemetadata"
+ TYPE OPTIONAL
+ PURPOSE "For accessing file metadata labels"
+ )
+
+if (KF5Baloo_FOUND AND KF5BalooWidgets_FOUND AND KF5FileMetaData_FOUND)
+ message(STATUS "Baloo packages are found")
+ set(HAVE_BALOO TRUE)
+else()
+ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
+ KDELibs4Support # for KFileMetaDataWidget
+ )
+endif()
add_subdirectory(src)
+add_subdirectory(docs)
+
+# CMake files
+set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/DolphinVcs")
+
+ecm_configure_package_config_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/DolphinVcsConfig.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfig.cmake"
+ INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
+)
+
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfig.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake"
+ DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+ COMPONENT Devel
+)
+
+install(EXPORT DolphinVcsTargets
+ DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+ FILE DolphinVcsTargets.cmake
+)
+
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h"
+ DESTINATION "${KDE_INSTALL_INCLUDEDIR}/Dolphin"
+ COMPONENT Devel
+)
+
+feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
+
diff --git a/DolphinVcsConfig.cmake.in b/DolphinVcsConfig.cmake.in
new file mode 100644
index 0000000000..7e7a2296fd
--- /dev/null
+++ b/DolphinVcsConfig.cmake.in
@@ -0,0 +1,6 @@
+@PACKAGE_INIT@
+
+find_dependency(Qt5Widgets)
+find_dependency(KF5KIO)
+
+include("${CMAKE_CURRENT_LIST_DIR}/DolphinVcsTargets.cmake")
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
new file mode 100644
index 0000000000..57e195bcec
--- /dev/null
+++ b/docs/CMakeLists.txt
@@ -0,0 +1,2 @@
+
+kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR dolphin)
diff --git a/docs/default-ui.png b/docs/default-ui.png
new file mode 100644
index 0000000000..611b8bd26c
Binary files /dev/null and b/docs/default-ui.png differ
diff --git a/docs/grouping-view.png b/docs/grouping-view.png
new file mode 100644
index 0000000000..b0ac00cb99
Binary files /dev/null and b/docs/grouping-view.png differ
diff --git a/docs/index.docbook b/docs/index.docbook
new file mode 100644
index 0000000000..fe3357c2f5
--- /dev/null
+++ b/docs/index.docbook
@@ -0,0 +1,2134 @@
+
+Dolphin">
+
+
+
+
+]>
+
+
+
+
+The &dolphin; Handbook
+
+
+
+Peter
+
+Penz
+
+peter.penz@gmx.at
+
+
+
+Orville
+Bennett
+
+&Orville.Bennett.mail;
+
+
+
+Michael
+Austin
+
+tuxedup@users.sourceforge.net
+
+
+
+David
+Edmundson
+
+kde@davidedmundson.co.uk
+
+
+
+Alan
+Blanchflower
+
+
+Frank
+Reininghaus
+
+frank78ac@googlemail.com
+
+
+
+
+
+
+
+2006
+Peter Penz
+
+
+2006
+&Orville.Bennett;
+Michael Austin
+
+
+2009
+Frank Reininghaus
+
+
+&FDLNotice;
+
+2013-06-28
+4.11 (&kde; 4.11)
+
+
+
+&dolphin; is the default file manager for &kde;, designed with usability as a primary focus.
+
+
+
+
+KDE
+Dolphin
+Filemanager
+file
+management
+
+
+
+
+
+Introduction
+
+
+&dolphin; is &kde;'s default file manager. It aims to improve usability at the
+user interface level. &dolphin; focuses only on being a file manager whereas
+&konqueror;, which was &kde;'s default file manager in &kde; 3 and can still be
+used for file management, is a universal viewer for many file types.
+
+
+
+This design approach allows the developers to concentrate on optimizing the user
+interface for the specific task of file management.
+
+
+
+Please report any problems or feature requests to the &dolphin; author via the
+bug report dialog. This is accessible either from the Control
+button at the right of the toolbar in the default mode without
+menubar; or from HelpReport Bug...
+menu of the application, if the menubar is shown.
+
+
+
+
+
+Using &dolphin;
+
+
+&dolphin; User Interface
+
+
+The screenshot below shows &dolphin;'s default user interface:
+
+
+
+Screenshot of &dolphin;'s default user interface
+
+
+
+
+
+&dolphin;'s default user interface.
+
+
&dolphin;'s default user interface.
+
+
+
+
+The elements of the default user interface are:
+
+
+
+
+The toolbar, which can be used for quick access to frequently used actions. The
+toolbar can be customized by clicking it with the &RMB; and choosing
+Configure Toolbars...
+from the context menu, with Configure Toolbars...
+from the Control button at the
+right of the toolbar or via Settings
+Configure Toolbars...
+from the main menu.
+
+
+Screenshot of &dolphin;'s toolbar
+
+
+
+
+
+The default toolbar.
+
+
+
+Toolbar items where the icon is sufficient for knowing the command do not have text
+alongside the icons. This can be changed by a &RMB; click and selecting the item text
+below Show Text. The Control
+button at the right side of the toolbar is only displayed if the menubar is hidden.
+
+
+
+
+
+
+
+The location bar, which always displays the path to the current folder. It can
+be switched between two different modes, see the
+section on the location bar for details.
+
+
+
+The view, which shows all files
+and folders in the current folder.
+
+
+
+The Places panel, which
+provides quick access to bookmarked locations and disks or other media.
+
+If desktop search and file indexing are enabled in the Desktop Search
+module in the &systemsettings; the panel provides Recently Saved
+items and allows you to search for Documents, Images,
+Audio Files and Video.
+
+
+
+The status bar. It displays the name, size and type of the file which is
+currently hovered over with the mouse, or the number and size of the files which are
+selected. At the right, there is a zoom slider that allows you to adjust the size
+of the icons in the view.
+
+
+
+The menubar (hidden by default), which provides access to all commands and configuration options.
+See the Command Reference for a list of
+all menu commands. The menubar can be toggled with
+Show Menubar (&Ctrl;M)
+from the Settings menu or the Control button.
+
+If the menubar is hidden, all its actions are available from the
+Control button.
+
+
+
+The additional Information, Folders
+and Terminal panels are hidden
+by default, for more information see Panels.
+
+
+
+
+
+
+
+
+
+The &dolphin; View
+
+
+Using the View
+
+
+The view displays all files and folders in the current folder. These items
+can be accessed or manipulated in different ways:
+
+
+
+
+A file or folder can be opened by clicking it with the &LMB; (or
+double-clicking, if Double-click to open files and folders
+is enabled in the Navigation
+section of the settings).
+
+
+
+Clicking any item or the white area around the items with the &RMB; opens a
+context menu which provides access to many frequently used actions for the item
+or the current folder, respectively.
+
+
+
+If the &LMB; is pressed on an item, but not immediately released, the item can
+be dragged and dropped in another folder in the current view or in another
+&dolphin; view (in another &dolphin; window or in the same window if the
+view is split, see below) to move or copy it or to create a symbolic link.
+Items can even be dropped in another application to open them in that application.
+
+
+
+
+&dolphin; remembers the history of visited folders. To navigate backward or
+forward in the history, the corresponding buttons in the toolbar can be used:
+
+
+
+Screenshot of &dolphin;'s toolbar
+
+
+
+
+
+The Back and Forward buttons in the toolbar.
+
+
+
+The Back and Forward buttons in
+the toolbar can be used to navigate in the history.
+
+
+
+
+
+
+
+
+&dolphin; View Appearance
+
+
+The toolbar contains buttons to control the appearance of the view:
+
+
+
+Screenshot of &dolphin;'s toolbar
+
+
+
+
+
+The buttons in the toolbar which control the appearance of the view.
+
+
+The buttons in the toolbar which control the appearance of the view.
+
+
+
+
+
+All the settings discussed below and other options concerning, ⪚ the
+sorting of the files in the current folder, can also be modified in the
+View menu and in the
+View Properties dialog. By
+default, these settings are remembered for each folder separately. This
+behavior can be changed in the
+General section of the settings.
+
+
+
+View Modes
+
+
+The first three buttons in the above screenshot switch between &dolphin;'s
+view modes.
+
+
+
+
+In the Icons view, which is the default, files will be
+represented by an icon that visualizes the file type, and a folder icon will be
+shown for subfolders. The names of folders and files, and the items enabled in
+ViewAdditional Information,
+are displayed below the icons.
+
+
+
+The Compact view shows the folder contents as icons with
+the name beside it and the items enabled in
+ViewAdditional Information
+below the name. The items are grouped in columns similar to the Short View
+in the &kde; file dialog.
+
+
+
+In the Details view, the folder contents are displayed
+as a detailed list which contains the name, size and last modification time of
+each item. Additional columns can be added by clicking a column header with the
+&RMB;.
+
+In the context menu of the header line you can choose between custom or automatic
+column width. Automatic width adjusts the width of all columns once to display the longest
+item in the column completely, except for the Name column where
+the extension is replaced by ...
+
+The order of columns can be changed by drag and drop of column headers, except for
+the Name header, which is always the first column in this view.
+
+
+The details view allows you to view the current directory
+in a tree-like fashion if
+Expandable folders are enabled:
+Each subfolder of the current folder can be
+expanded or collapsed by clicking on the >
+or v icon next to it.
+
+
+
+
+Grouped View
+
+
+
+
+
+Grouped View
+
+
All view modes support grouping by the sort type selected
+in ViewSort by
+
+
+
+
+
+
+
+Information in the View
+
+In all view modes &kappname; shows at least an icon and a name for each item.
+Using Additional Information in the View
+menu or the context menu of the header in Details mode, you can select
+more information for each item to be shown:
+
+
+
+Size, Date,
+Type, Rating,
+Tags or Comment.
+
+
+Depending on the file type, additionally, sorting criteria can be selected:
+
+ Document: Number of words and lines
+ Image: Size and orientation
+ Audio: Artist, album, duration and track
+
+
+
+The Other submenu allows you to select
+Path, Link Destination,
+Copied From,
+Permissions, Owner or
+User Group.
+
+
+
+
+
+Preview
+
+
+If Preview is enabled, the icons are based on the actual
+file or folder contents; ⪚ for images a scaled down preview of the image is
+shown.
+
+
+
+
+
+Split
+
+
+If Split is clicked, two views are shown which can
+display the contents of different folders. This can be convenient for moving or
+copying files.
+
+
+
+
+
+
+
+Selecting Items in the View
+
+
+There are several ways to select items in the view. Once a group of items
+is selected, all actions, such as
+Cut,
+Copy,
+Move to Trash,
+and drag and drop operations, affect all selected items.
+
+
+
+Selecting Items Using the Mouse
+
+
+
+
+You can press the &LMB; somewhere in the view and draw a rectangle around
+a group of items before releasing the button. This will select all items in the
+rectangle and clear the previous selection. If the &Shift; key is pressed during
+the selection process, the previous selection is kept.
+
+
+
+If the &Ctrl; key is pressed while an item is clicked with the &LMB;, the
+selection state of this item is toggled. If the &Ctrl; key is pressed while a
+rectangle is drawn around a group of items as described above, the selection
+state of all items in the rectangle will be toggled.
+
+
+
+If the &Shift; key is pressed while an item is clicked with the &LMB;, all items
+between the previous current item and the clicked item will be selected.
+
+
+
+If Show selection marker is enabled in the
+Behavior
+tab of the General section of the settings, a small
++ or - button appears in the top
+left corner of the item which is currently hovered over with the mouse. Clicking
+this sign selects or deselects the item, respectively.
+
+
+
+
+
+
+
+Selecting Items Using the Keyboard
+
+
+
+
+If an arrow key, Page Up, Page Down,
+Home, or End is pressed, the new current item
+is selected, and the previous selection is cleared.
+
+
+
+If the &Ctrl; key is held while one of the above keys is pressed, the selection
+remains unchanged.
+
+
+
+If the &Shift; key is held while one of the above keys is pressed, all items
+between the previous current item and the new current item will be selected.
+
+
+
+If &Ctrl;Space is pressed,
+the selection state of the current item is toggled.
+
+
+
+&Ctrl;A selects all items
+in the view.
+
+
+
+&Ctrl;&Shift;A toggles the
+selection state of all items in the view.
+
+
+
+Select a file or folder by typing the first few letters of its name and the
+first matching item is selected.
+To clear the selection and cancel the keyboard search press &Esc; or wait longer than
+the timeout of 1 second.
+
+
+
+
+
+
+
+
+
+
+
+
+Location Bar
+
+
+The location bar, which can be found above &dolphin;'s view, displays
+the path to the current folder. The location bar has two modes.
+
+
+
+Bread Crumb Mode
+
+
+In the bread crumb mode, which is the default, each folder name in
+the path to the current folder is a button which can be clicked to quickly open
+that folder. Moreover, clicking the > sign to the right of a
+folder opens a menu which allows you to quickly open a subfolder of that folder.
+
+
+
+Screenshot of the location bar in bread crumb mode
+
+
+
+
+
+Location bar in bread crumb mode.
+
+
Location bar in bread crumb mode.
+
+
+
+
+
+
+Editable Mode
+
+
+When in bread crumb mode, clicking in the gray area to the right of the path
+with the &LMB; switches the location bar to editable mode,
+in which the path can be edited using the keyboard. To switch back to bread
+crumb mode, click the check mark at the right of the location bar with the &LMB;.
+
+
+
+Screenshot of the location bar in editable mode
+
+
+
+
+
+Location bar in editable mode.
+
+
Location bar in editable mode.
+
+
+
+
+Using Kioslaves
+
+If the location bar is empty in editable mode, a drop down box appears in
+front of the bar listing all available kioslaves on your system. Kioslaves are
+programs built into &kde; which add support for many different protocols to
+&dolphin; and other &kde; applications.
+
+For example with the fish kioslave &dolphin; can be
+used to manage files and folders on a remote host that is accessible
+via SSH. To do this you would type fish://username@remotehost
+into the location bar. Similar remote file management can be done on
+remote hosts accessible via the &FTP;, NFS, SFTP, SMB (CIFS) or webdav protocols.
+
+It is also possible to use the kioslaves drop down list to access
+&systemsettings;, fonts, trash, other programs and devices attached to your computer.
+See the drop down list for the full list of capabilities available from kioslaves on your system.
+
+
+Screenshot of the list of kioslaves
+
+
+
+
+
+Location bar showing list of available kioslaves.
+
+
List of available kioslaves.
+
+
+
+
+
+
+
+Places and Context
+
+
+If the Places panel is hidden; in both modes an additional icon
+in front of the path is displayed. This icon can be clicked with the &LMB; to open a
+menu which offers quick access to places and storage media. See the
+section about the Places Panel for details.
+
+
+
+Location bar with Places icon
+
+
+
+
+
+Location bar with Places icon
+
+
+
+
+The context menu of the location bar offers actions to switch between the modes and
+to copy and paste the path using the clipboard. Check the last option in this context menu to
+display either the full path starting with the root folder of the file system or to display
+the path starting with the current places entry.
+
+
+
+Location bar context menu
+
+
+
+
+
+Location bar context menu
+
+
+
+
+
+
+
+
+
+Panels
+
+
+&dolphin; allows a number of panels to be placed next to the view. These can
+be enabled in ViewPanels.
+By unlocking the panels and clicking and dragging a panel title, the panel can be moved
+to a different position, even outside the window.
+
+
+
+Places
+
+
+
+The Places panel is located at the left of the window by
+default. The Places panel shows any locations you have
+bookmarked. It also shows any disk or media attached to the computer, recently accessed items
+and allows you to search for certain type of files. The order of these entries can be changed by drag and drop.
+
+
+
+The easiest way to add a folder to the Places panel is to
+drag it and drop it in the panel. Moreover, you can click inside the panel with
+the &RMB; and choose Add Entry...
+from the context menu. The first procedure creates a system wide bookmark, the second
+procedure can be used to add the current path of the location bar or any desired folder or device.
+A dialog opens where label, location and icon can be edited and the usage of this entry
+can be restricted to &dolphin;.
+
+
+A &RMB; click opens the context menu to edit, add, hide or remove entries
+and change the icon size to one of the predefined values or lock/unlock the panels.
+
+The context menu has an action to open the entry in a new tab.
+Devices can be unmounted using the context menu.
+
+
+
+
+Information
+
+
+The Information panel shows extended information about the
+selected items(s) or about the current folder or the file which is currently hovered
+over with the mouse, including size, type, and date of last modification. It also
+features a large preview of the selected item and allows you to assign a rating,
+tags, and comments to it.
+
+
+
+
+
+Folders
+
+
+The Folders panel shows a tree view structure of the file
+system. It only shows folders. Clicking a folder with the &LMB; opens this folder
+in the &dolphin; view.
+
+
+
+
+
+
+Terminal
+
+
+This panel contains a terminal. The terminal will open at the folder currently
+shown in the &dolphin; view. Changing the folder in the active &dolphin;
+view will update the working folder of the terminal. Changing the directory in
+the terminal will update the working folder in the &dolphin; view. The
+terminal only works with local media.
+
+
+
+
+
+
+
+Quick Tips
+
+
+The following are a number of tips to save time when using &dolphin;.
+
+
+
+Quick Bookmarking
+
+
+To quickly create a bookmark in the Places panel for the
+current folder, &RMB; click in the work space and click
+Add to Places in the context menu.
+
+
+
+
+
+Finding Files and Searching in Files
+
+
+&dolphin; is capable of searching for files and for content in files. If
+&Ctrl;F is pressed or Edit
+Find... is used, the Find
+bar will open already set up to search for files within the current folder and any sub-folders.
+Start to type into the find input box and the search starts immediately.
+
+Search files and for content in files
+
+
+
+
+
+Search files and for content in files
+
+
&dolphin; searching files and for content in files.
+
+
+
+The search is case insensitive, and does not require surrounding wildcards
+(*foo* and foo are equivalent),
+but you can use wildcards inside the search term. * will match
+zero or more characters, ? only one single character.
+This feature can be used with running Baloo services; without these services
+a KIOSlave is launched to provide the search results.
+The option from Everywhere with activated Baloo
+services searches in all indexed folders, without Baloo this option
+starts the search from the user's Home folder.
+
+
+Search with More Options
+
+
+
+
+
+Search with More Options
+
+
&dolphin; searching with More Options.
+
+
+
+
+Use the More Options button to extend the Find
+bar. This provides a very comfortable way for
+the user to shrink the number of search results.
+To start a search select one or more file types (Documents,
+Audio, Video, Images),
+ a time period and rating
+
+Alternatively you can use these options in the Places panel
+together with the Filter bar to find files using Baloo or limit
+the search to files matching the filter expression.
+
+
+
+
+Mounting Storage Media
+
+
+A quick way to mount Storage Media is to click on the device in the
+Places panel. This will mount and open the device in &dolphin;.
+
+
+
+
+
+Undo Actions
+
+
+&dolphin; is capable of undoing changes you have made to files. For example if
+you moved a file to the Trash, &dolphin; can undo this and move it back to its
+original location. To undo an action, press &Ctrl;Z
+or select EditUndo: (action name)
+in the menu, ⪚ Undo: Rename.
+
+
+
+
+
+Renaming A Batch Of Files
+
+&dolphin; is capable of renaming a number of files at the same time. Each file
+will have the file name specified, including a number, ⪚, Image1.jpg,
+Image2.jpg, Image3.jpg. This can be useful, ⪚, for pictures taken with a digital camera.
+
+
+
+If you wish to rename a batch of files, first select the files to be renamed.
+This can be done by pressing the &LMB; and drawing a rectangle around the files
+to be renamed before releasing it, or by holding &Ctrl; and clicking each file
+to be renamed (see Selecting Items in the View
+for more details on item selection). Then open the batch-rename dialog by pressing
+F2 or via the File menu:
+FileRename...
+
+
+
+Then enter the name you wish to give the files. The # character must be present
+within the name. The files will then be renamed, where the #
+character is replaced by a different consecutive number for each file.
+
+
+If all file extensions in your selection are different, the name of all files
+can be changed without using a # placeholder while preserving
+the file extensions. This is ⪚ useful to rename a video file and all associated
+subtitle files, which have the same filename, but different extensions.
+
+
+
+
+Comparing A Selection Of Files or Folders
+
+
+If the &kompare; application is installed, you can use it to see the differences
+between two files or folders.
+
+
+
+First select the two files or folders to be compared. Then launch the &kompare; application
+via the Tools menu: ToolsCompare Files.
+&kompare; will then open showing the differences between the files or folders.
+
+
+
+
+
+Filtering Files
+
+
+&dolphin; is capable of filtering files, &ie; showing only those items in the
+view whose name contains a given text. For example, if you wish to show
+only the MP3 files within a folder, you could filter for .mp3.
+This would then filter out all files whose name does not contain .mp3.
+
+
+
+To filter files, first enable the filter bar, either by pressing &Ctrl;I
+or via the menu: ToolsShow Filter Bar.
+You can then enter the text to be filtered for in the filter bar. The filter bar can
+be disabled either by pressing &Esc;, or with a &LMB; click on the
+Hide Filter Bar icon.
+
+
+
+
+
+
+
+
+
+Configuring &dolphin;
+
+
+&dolphin; distinguishes two different kinds of settings:
+
+
+
+
+Settings which affect the general behavior of &dolphin;. These can be configured
+using the Preferences Dialog.
+
+
+
+Settings which determine how the contents of a folder are displayed in &dolphin;.
+These settings are called View Properties
+and can be controlled with toolbar buttons, via the View menu,
+and with the View Properties Dialog.
+In the default configuration, the view properties are remembered for each folder,
+but &dolphin; can also be configured to use common view properties for all folders
+in the General
+section of the settings.
+
+
+
+
+
+
+
+The &dolphin; Preferences Dialog
+
+The Preferences Dialog is opened via Settings
+Configure &dolphin;... in the menu in
+&dolphin;'s main window. The settings are divided into several groups which can
+be accessed by clicking the corresponding icon on the left of the dialog.
+
+
+All settings except for the Startup page and the Status Bar
+tab on the General page are shared with &konqueror; in filemanager mode.
+
+
+
+Startup
+
+
+This group contains settings which control the appearance of &dolphin; on startup.
+
+
+Screenshot of the Startup settings in &dolphin;'s preferences dialog
+
+
+
+
+
+Startup Settings.
+
+
Startup Settings in &dolphin;'s Preferences Dialog.
+
+
+
+
+
+
+The Home Folder is the folder which is opened on startup. The
+location of the folder can be entered directly or chosen in a dialog which can
+be opened by clicking the button showing a folder icon. Moreover,
+the current location or the default location (which is the user's home folder)
+can be used as the Home Folder by clicking the corresponding button.
+
+
+
+Split View Mode controls if the
+&dolphin; view is split on startup
+or not.
+
+
+
+Editable location bar controls if the location bar is in
+editable mode on startup. The bread crumb mode of the location bar is used
+otherwise. See the section about the location bar
+for details about the two modes.
+
+
+
+If Show full path inside location bar is enabled, the full
+path of the current location is shown in the bread crumb mode of the location bar.
+Otherwise, a shortened version of the path is shown if it begins with the path of
+one of the places in the Places panel.
+
+
+
+Show filter bar controls if the filter bar is shown on
+startup or not. See the section on the filter bar
+for details.
+
+
+
+
+
+
+
+
+
+View Modes
+
+
+This group contains settings which control the behavior of &dolphin;'s view
+modes. The three view modes (Icons, Compact, and Details) are accessible via the
+tab bar at the top.
+
+
+Screenshot of the Icons View settings in &dolphin;'s preferences dialog
+
+
+
+
+
+View Modes Settings.
+
+
View Modes Settings in &dolphin;'s Preferences Dialog.
+
+
+
+
+
+
+Common settings for all view modes
+
+
+All three view modes have some common settings:
+
+
+
+
+Sliders which control the size of the icons. The Default or
+Preview sizes are used if previews are disabled or enabled,
+respectively. Note that the icon size can be changed easily with the zoom slider
+in the status bar if the corresponding option is enabled in the
+General
+section of the settings.
+
+
+
+A setting for the font used in the view mode: either the system font or a
+custom font can be chosen.
+
+
+
+
+The other settings in the Text section which apply to only
+one of the view modes are discussed below.
+
+
+
+
+
+Icons
+
+
+
+Width controls the minimum width that is reserved for
+the text of a file item.
+
+
+ Maximum lines means maximum number of text lines below the icon.
+
+
+
+
+
+
+Compact
+
+
+
+Maximum width controls the maximum width that is reserved for
+the text of a file item.
+
+
+
+
+
+
+Details
+
+
+
+Expandable folders determines whether any folders that have subfolders
+are displayed in a tree view, where the sub items can be expanded by &LMB; clicking the
+> icon and collapsed by clicking the v icon.
+
+
+
+
+
+
+
+
+Navigation
+
+
+This group contains settings which control how navigation in the folder
+structure and in archives works.
+
+
+Screenshot of the Navigation settings in &dolphin;'s preferences dialog
+
+
+
+
+
+Navigation Settings.
+
+
Navigation Settings in &dolphin;'s Preferences Dialog.
+
+
+
+
+
+
+&dolphin; can be configured to open items with a single mouse click
+(Single-click to open files and folders) or a double mouse
+click (Double-click to open files and folders). In the
+latter case, a single mouse click will select the file or folder.
+
+
+This is a system wide setting and can be changed in the &systemsettings; in the
+Input DevicesMouse
+module as well.
+
+
+
+
+Archives will be opened inside &dolphin;, and not in an external application, if
+Open Archives as folder is enabled.
+
+
+
+If Open folders during drag operations is enabled, dragging
+an item with the mouse and hovering over a folder with it for a short time will open
+that folder. This allows you to move or copy items quickly to folders which are
+several levels deeper in the folder hierarchy.
+
+
+
+
+
+
+
+
+
+Services
+
+
+This group offers a selection of services that can be shown in the
+Actions submenu of &dolphin;'s context menu which
+appears when clicking a file or folder with the &RMB;.
+
+
+
+Screenshot of the Services settings in &dolphin;'s preferences dialog
+
+
+
+
+
+Services Settings.
+
+
Services Settings in &dolphin;'s Preferences Dialog.
+
+
+
+
+Using the Download New Services you can fetch additional
+services for the context menu.
+
+
+If you have installed &dolphin;'s plugins for Bazaar,
+Mercurial, Git or
+Subversion from the kdesdk module these services are shown in the list.
+If these plugins are enabled and you enter a folder which is under version control,
+the version state (locally changed, up to date &etc;) is indicated by icons
+and you have additional entries in the
+context menu like commit, update, add, remove &etc;
+
+
+In the service list you can also choose if the Delete,
+Copy To, and Move To
+commands are shown in the context menu.
+
+
+&dolphin; has to be restarted to activate the changes for some of these settings.
+
+
+
+
+
+
+Trash
+
+
+This group contains settings which control the behavior of the trash.
+
+
+Screenshot of the Trash settings in &dolphin;'s preferences dialog
+
+
+
+
+
+Trash Settings.
+
+
Trash Settings in &dolphin;'s Preferences Dialog.
+
+
+
+
+
+
+Files which are older than a configurable number of days can be deleted automatically.
+
+
+
+The size of the trash can be limited to a configurable percentage of the disk
+size. If this limit is reached, a warning can be issued, or the oldest or
+largest files can be deleted automatically.
+
+
+
+
+
+
+
+
+
+General
+
+
+This group contains settings which control the general behavior of &dolphin;.
+The group is divided further into four subgroups which can be accessed using the
+tab bar at the top.
+
+
+Screenshot of the General settings in &dolphin;'s preferences dialog
+
+
+
+
+
+General Settings.
+
+
General Settings in &dolphin;'s Preferences Dialog.
+
+
+
+
+
+
+Behavior Tab
+
+
+
+
+
+
+In the View section, you can configure whether the
+ view properties are stored for each
+folder or if common view properties are to be used for all folders.
+
+
+When hovering over a file or folder with the mouse, a small window with relevant
+information is shown if Show tooltips is enabled.
+
+
+
+Show selection marker shows a small +
+or - button above an item's icon if the item is hovered over
+with the mouse. These can be used to select or deselect the item.
+
+
+
+Natural sorting of items controls how items are sorted in
+the view. If this option is enabled, the sort order of three example files
+will be
+
+File1,
+File2,
+File10.
+
+If this option is disabled, the normal alphabetical sorting will be used, which
+leads to the sort order
+
+File1,
+File10,
+File2.
+
+
+
+
+Enable Rename inline to use this mode if only one item is currently selected.
+If this option is disabled or several items are selected, a dialog will be displayed for renaming.
+
+
+
+
+
+
+
+
+
+Previews Tab
+
+
+In this tab, you can configure for which file types previews are shown.
+Moreover, the maximum size of remote files for which previews are generated can be chosen.
+
+
+If previews are enabled for folders, previews of some files in the folder will
+be shown inside a folder's icon.
+
+
+
+
+Confirmations Tab
+
+In the ask for confirmation section, you can enable warning dialogs that
+are shown before potentially harmful actions .
+
+The confirmation settings for Moving files or folders to trash and
+Deleting files or folders affect file operations in &dolphin;, &konqueror;,
+Gwenview and all &kde; applications using the default &kde; file dialog,
+whereas Closing Dolphin windows
+ with multiple tabs is a &dolphin; specific setting.
+
+
+
+Status Bar Tab
+
+
+In this tab, some additional items can be enabled for the status bar, provided
+the status bar is wide enough:
+
+
+
+
+A zoom slider which can be used to change the icon size quickly.
+
+
+
+A bar that shows how much space is free on the current drive.
+
+
+
+
+
+
+Since &dolphin; 4.9 the Delete,
+Copy To, and Move To
+commands of the context menu have to be enabled on the Services page.
+
+
+
+
+
+
+
+
+
+Folder View Properties
+
+
+The following settings control how the contents of a folder are displayed in the
+&kappname; view, and are stored on a per-folder basis by default:
+
+
+
+
+The view mode (Icons, Compact, Details)
+
+
+
+The sorting of items, which is determined by the sort order (ascending,
+descending) and the attribute (such as name, size,...) that the items are
+sorted by
+
+
+
+Sorting of folders and files – are folders shown first or not?
+
+
+
+Previews – are they shown instead of icons (based on the settings made in
+Previews
+tab of &kappname;'s General settings) or not?
+
+
+
+Are items shown in groups in the views?
+
+
+
+Are hidden files shown?
+
+
+
+What additional information (besides the name) is shown in the Icons or Details view?
+
+
+
+
+The view properties can be configured in the
+View menu, some (such as the view
+mode) can also be changed using toolbar buttons.
+
+
+
+The View Properties Dialog
+
+
+
+
+Screenshot of the View Properties dialog
+
+
+
+
+
+The View Properties dialog.
+
+
The View Properties Dialog.
+
+
+
+The View Properties dialog can be used to quickly modify
+several view properties at once. This is done for the current folder, for the
+current folder including all subfolders, or even for all folders, depending on
+the choice made in the Apply View Properties To section.
+
+
+
+If Use these view properties as default is enabled, the chosen view
+properties will also be used for all folders which do not have customized view
+properties yet.
+
+
+
+
+
+
+
+
+
+Command Reference
+By default the menubar is not shown. All actions described here either can
+be accessed with toolbar buttons or with items in the menu of the
+Control toolbar button.
+
+
+The Menubar in &dolphin;'s Main Window
+
+
+The File Menu
+
+
+
+
+
+File
+Create New
+
+Creates a new object (such as a folder or a text file) in the current
+folder.
+You will find an explanation of all available objects in &konqueror;'s handbook in the chapter
+Create New.
+
+
+
+
+
+
+&Ctrl;N
+
+File
+New Window
+
+Opens a new &dolphin; window.
+
+
+
+
+
+&Ctrl;T
+
+File
+New Tab
+
+Opens a new tab.
+
+
+
+
+
+&Ctrl;W
+
+File
+Close Tab
+
+Closes the current tab.
+
+
+
+
+
+F2
+
+File
+Rename
+
+Renames one currently selected item inline.
+Opens the batch rename dialog if several
+items are selected.
+
+
+
+
+
+Del
+
+File
+Move to Trash
+
+Moves the currently selected item(s) to the
+trash.
+
+
+
+
+
+&Shift;Del
+
+File
+Delete
+
+Permanently deletes the currently selected item(s). The items are not moved
+to the trash and cannot be restored.
+
+
+
+
+
+&Alt;Return
+
+File
+Properties
+
+Shows the properties dialog for the currently selected
+item(s).
+
+
+
+
+
+&Ctrl;Q
+
+File
+Quit
+
+Exits &dolphin;.
+
+
+
+
+
+
+
+The Edit Menu
+
+
+
+
+
+
+&Ctrl;Z
+
+Edit
+Undo
+
+Undoes the last action performed by &dolphin;.
+
+
+
+
+
+&Ctrl;X
+
+Edit
+Cut
+
+Cuts the currently selected item(s).
+
+
+
+
+
+&Ctrl;C
+
+Edit
+Copy
+
+Copies the currently selected item(s).
+
+
+
+
+
+&Ctrl;V
+
+Edit
+Paste Clipboard Contents...
+
+Pastes the currently copied/cut items to the current
+folder. If the clipboard does not contain files or folders, the clipboard
+contents (such as text or image data) will be pasted into a new file.
+The name of this file has to be entered in a dialog.
+
+
+
+
+
+
+&Ctrl;F
+
+Edit
+Find...
+
+Opens the find bar. Enter a search term into the edit box and select to search for filename
+or in contents of files starting from the current folder or everywhere.
+
+
+
+
+
+&Ctrl;A
+
+Edit
+Select All
+
+Selects all files and folders in the current
+folder.
+
+
+
+
+
+&Ctrl;&Shift;A
+
+Edit
+Invert Selection
+
+
+Selects all unselected items and deselects all selected items in the current folder.
+
+
+
+
+
+
+
+The View Menu
+
+
+
+
+
+
+&Ctrl;+
+
+View
+Zoom In
+
+Increases the size of icons in the view.
+
+
+
+
+
+&Ctrl;-
+
+View
+Zoom Out
+
+Decreases the size of icons in the view.
+
+
+
+
+View
+View Mode
+
+Changes the view mode to Icons
+(&Ctrl;1), Compact
+(&Ctrl;2) or Details
+(&Ctrl;3).
+
+
+
+
+View
+Sort By
+
+Changes whether items are sorted by Name
+or other criteria described in Information in the View.
+Descending reverses the sort order.
+Folders First sorts folders before files.
+
+
+
+
+
+View
+Additional Information
+
+Displays additional information
+described in Information in the View.
+
+
+
+
+
+View
+Preview
+
+Displays a symbolic preview of the file contents in the different
+view modes.
+
+
+
+
+View
+Show in Groups
+
+Displays the content of the
+current folder grouped by the option selected in Sort By.
+
+
+
+
+
+
+&Alt;.
+
+View
+Show Hidden Files
+
+Shows all the hidden files and sub-folders within the current
+folder.
+
+
+
+
+
+F3
+
+View
+Split
+
+Enables and disables the split view mode.
+
+
+
+
+
+F5
+
+View
+Reload
+
+Reloads the current folder.
+
+
+
+
+View
+Stop
+
+Stops loading/reading the contents of the current
+folder.
+
+
+
+
+View
+Panels
+
+Enables and disables the different panels:
+Places (F9), Information
+(F11), Folders (F7),
+Terminal (F4).
+With Lock Panels the panel header with caption and two buttons is
+hidden to save space and the panels are immutable, with Unlock Panels
+the header is visible and the panel can be moved to the right or left or even
+outside the main window.
+
+
+
+
+
+
+
+F6
+
+View
+Location Bar
+Editable Location
+
+Changes the location bar between the two modes; the
+bread crumb mode and the
+editable mode.
+
+
+
+
+
+
+&Ctrl;L
+
+View
+Location Bar
+Replace Location
+
+Switches the location bar to editable mode,
+if necessary, and selects the location such that it can be replaced quickly.
+
+
+
+
+
+View
+Adjust View Properties...
+
+Opens the View Properties
+Dialog.
+
+
+
+
+
+
+
+The Go Menu
+
+
+
+
+
+
+&Alt;Up
+
+Go
+Up
+
+Changes to the folder above the current folder.
+
+
+
+
+
+&Alt;Left
+
+Go
+Back
+
+Changes to the previously viewed folder.
+
+
+
+
+
+&Alt;Right
+
+Go
+Forward
+
+Undoes a Go Back action.
+
+
+
+
+
+&Alt;Home
+
+Go
+Home
+
+Changes to the users home folder, ⪚
+/home/Peter/.
+
+
+
+
+Go
+Recently Closed Tabs
+
+Shows a list of recently closed tabs which can
+be reopened.
+
+
+
+
+
+
+The Tools Menu
+
+
+
+
+
+
+&Ctrl;I
+
+Tools
+Show Filter Bar
+
+Enables and disables the filter bar.
+
+
+
+
+
+&Shift;F4
+
+Tools
+Open Terminal
+
+Opens &konsole; within the current folder.
+
+
+
+
+Tools
+Compare Files
+
+Compare the currently selected files or folders with
+&kompare;. This action is only enabled if two files or folders are selected.
+
+
+
+
+Tools
+Select Remote Charset
+
+Allows you to choose the charset used by a remote
+connection manually.
+
+
+
+
+
+
+The Settings and Help Menu
+
+&dolphin; has the common &kde; Settings and Help
+menu items, for more information read the sections about the Settings Menu and Help Menu
+of the &kde; Fundamentals.
+
+
+
+
+
+
+
+Miscellaneous Questions
+
+
+
+
+Has &dolphin; replaced &konqueror;?
+
+
+
+&dolphin; is not intended to be a competitor to &konqueror;: &konqueror; acts as
+a universal viewer being able to show &HTML; pages, text documents, folders and a
+lot more, whereas &dolphin; focuses on being only a file manager. This approach
+allows the optimization of the user interface for the task of file management.
+
+
+
+
+
+
+How can I get involved with the development of &dolphin;?
+
+
+
+The easiest way to get involved with &dolphin; is to subscribe to the developer
+mailing list kfm-devel
+and drop an email to the developer mailing list. Email what you can do, how much time
+you can devote &etc;, the developers will let you know what you can do in the
+project. If you wish to contribute to the documentation please email the
+&kde; Documentation Team list.
+
+
+
+
+
+
+How can I submit bug reports?
+
+
+
+The official channel for submitting bug reports is via the &kde; bug tracking
+system. The &kde; bug tracker can be found at
+http://bugs.kde.org.
+
+
+
+
+
+
+How can I submit feature requests?
+
+
+
+The official channel for submitting feature requests is via the &kde; bug
+tracking system. The &kde; bug tracker can be found at
+http://bugs.kde.org.
+
+
+
+
+
+
+
+
+
+
+Credits and License
+
+
+&dolphin;
+
+
+Program copyright 2006–2013 Peter Penz peter.penz@gmx.at and
+Frank Reininghaus frank78ac@googlemail.com
+
+Contributors:
+
+Cvetoslav Ludmiloff ludmiloff@gmail.com
+Stefan Monov logixoul@gmail.com
+Michael Austin tuxedup@users.sourceforge.net
+&Orville.Bennett; &Orville.Bennett.mail;
+
+
+
+
+Documentation copyright 2005 Peter Penz peter.penz@gmx.at
+
+
+Documentation copyright 2006 &Orville.Bennett; &Orville.Bennett.mail;
+
+
+Documentation copyright 2006 Michael Austin tuxedup@users.sourceforge.net
+
+
+Documentation copyright 2009 Frank Reininghaus frank78ac@googlemail.com
+
+
+
+
+&underFDL;
+&underGPL;
+
+
+
+
+How to get &dolphin;
+&dolphin; is part of the &package; package which is an essential part of
+&kde;.
+
+For instructions on acquiring &kde; please see http://www.kde.org or read the chapter
+Installing &kde;
+in the &kde; Fundamentals.
+
+For further information about &dolphin; you might want to visit
+http://dolphin.kde.org or
+http://userbase.kde.org/Dolphin.
+
+
+
+&documentation.index;
+
+
+
diff --git a/docs/locationbar-breadcrumb.png b/docs/locationbar-breadcrumb.png
new file mode 100644
index 0000000000..e6970bdb50
Binary files /dev/null and b/docs/locationbar-breadcrumb.png differ
diff --git a/docs/locationbar-context-menu.png b/docs/locationbar-context-menu.png
new file mode 100644
index 0000000000..7635427fa2
Binary files /dev/null and b/docs/locationbar-context-menu.png differ
diff --git a/docs/locationbar-editable.png b/docs/locationbar-editable.png
new file mode 100644
index 0000000000..8af9e69313
Binary files /dev/null and b/docs/locationbar-editable.png differ
diff --git a/docs/locationbar-kioslaves-menu.png b/docs/locationbar-kioslaves-menu.png
new file mode 100644
index 0000000000..3bbd14eb27
Binary files /dev/null and b/docs/locationbar-kioslaves-menu.png differ
diff --git a/docs/locationbar-places-icon.png b/docs/locationbar-places-icon.png
new file mode 100644
index 0000000000..37ec235051
Binary files /dev/null and b/docs/locationbar-places-icon.png differ
diff --git a/docs/nepomuk-search-more-options.png b/docs/nepomuk-search-more-options.png
new file mode 100644
index 0000000000..9e80d37ed9
Binary files /dev/null and b/docs/nepomuk-search-more-options.png differ
diff --git a/docs/nepomuk-search.png b/docs/nepomuk-search.png
new file mode 100644
index 0000000000..1554ad7599
Binary files /dev/null and b/docs/nepomuk-search.png differ
diff --git a/docs/preferences-general-behavior.png b/docs/preferences-general-behavior.png
new file mode 100644
index 0000000000..843ebac52d
Binary files /dev/null and b/docs/preferences-general-behavior.png differ
diff --git a/docs/preferences-navigation.png b/docs/preferences-navigation.png
new file mode 100644
index 0000000000..d7d3d93ec0
Binary files /dev/null and b/docs/preferences-navigation.png differ
diff --git a/docs/preferences-services.png b/docs/preferences-services.png
new file mode 100644
index 0000000000..84dd9632da
Binary files /dev/null and b/docs/preferences-services.png differ
diff --git a/docs/preferences-startup.png b/docs/preferences-startup.png
new file mode 100644
index 0000000000..86bf270860
Binary files /dev/null and b/docs/preferences-startup.png differ
diff --git a/docs/preferences-trash.png b/docs/preferences-trash.png
new file mode 100644
index 0000000000..0ea1ec24c1
Binary files /dev/null and b/docs/preferences-trash.png differ
diff --git a/docs/preferences-viewmodes-icons.png b/docs/preferences-viewmodes-icons.png
new file mode 100644
index 0000000000..1b8b970dd2
Binary files /dev/null and b/docs/preferences-viewmodes-icons.png differ
diff --git a/docs/toolbar-navigation.png b/docs/toolbar-navigation.png
new file mode 100644
index 0000000000..0fdfa74f82
Binary files /dev/null and b/docs/toolbar-navigation.png differ
diff --git a/docs/toolbar-view-appearance.png b/docs/toolbar-view-appearance.png
new file mode 100644
index 0000000000..5606fcfc78
Binary files /dev/null and b/docs/toolbar-view-appearance.png differ
diff --git a/docs/toolbar.png b/docs/toolbar.png
new file mode 100644
index 0000000000..7b8919c562
Binary files /dev/null and b/docs/toolbar.png differ
diff --git a/docs/viewproperties-dialog.png b/docs/viewproperties-dialog.png
new file mode 100644
index 0000000000..99567cc50c
Binary files /dev/null and b/docs/viewproperties-dialog.png differ
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6f256a2f43..9ea45e34b6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,39 +1,62 @@
-macro_optional_find_package(Baloo)
-set_package_properties(Baloo PROPERTIES DESCRIPTION "Baloo Core libraries"
- URL "http://www.kde.org"
- TYPE OPTIONAL
- PURPOSE "For adding desktop-wide search and tagging support to dolphin"
- )
-macro_optional_find_package(BalooWidgets)
-set_package_properties(BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets"
- URL "http://www.kde.org"
- TYPE OPTIONAL
- )
+configure_file(config-baloo.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-baloo.h)
-macro_optional_find_package(KFileMetaData)
-set_package_properties(KFileMetaData PROPERTIES
- URL "https://projects.kde.org/kfilemetadata"
- TYPE OPTIONAL
- PURPOSE "For accessing file metadata labels"
- )
+configure_file(config-dolphin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-dolphin.h)
-if (Baloo_FOUND AND BalooWidgets_FOUND AND KFileMetaData_FOUND)
- set(HAVE_BALOO TRUE)
+add_definitions(
+ -DTRANSLATION_DOMAIN=\"dolphin\"
+ -DQT_USE_FAST_CONCATENATION
+ -DQT_USE_FAST_OPERATOR_PLUS
+)
+remove_definitions(
+ -DQT_NO_CAST_FROM_BYTEARRAY
+ -DQT_NO_URL_CAST_FROM_STRING
+ -DQT_NO_SIGNALS_SLOTS_KEYWORDS
+ -DQT_NO_CAST_FROM_ASCII
+ -DQT_NO_CAST_TO_ASCII
+)
+
+if(X11_Xrender_FOUND)
+ set(HAVE_XRENDER TRUE)
endif()
-configure_file(config-baloo.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-baloo.h )
+configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h)
-macro_bool_to_01(X11_Xrender_FOUND HAVE_XRENDER)
-configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h )
+##########################################
-include_directories( ${KACTIVITIES_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} )
+set(dolphinvcs_LIB_SRCS
+ views/versioncontrol/kversioncontrolplugin.cpp
+)
-if(HAVE_BALOO)
- include_directories(${BALOO_INCLUDE_DIR} ${BALOO_WIDGETS_INCLUDE_DIR} ${KFILEMETADATA_INCLUDE_DIR})
-endif()
+add_library(dolphinvcs ${dolphinvcs_LIB_SRCS})
-add_subdirectory(tests)
+generate_export_header(dolphinvcs BASE_NAME dolphin)
+
+target_link_libraries(
+ dolphinvcs PUBLIC
+ Qt5::Widgets
+ KF5::KIOCore
+)
+
+set_target_properties(dolphinvcs PROPERTIES
+ VERSION ${DOLPHINVCS_VERSION_STRING}
+ SOVERSION ${DOLPHINVCS_SOVERSION}
+ EXPORT_NAME DolphinVcs
+)
+
+ecm_generate_headers(dolphinvcs_LIB_HEADERS
+ HEADER_NAMES
+ KVersionControlPlugin
+
+ RELATIVE "views/versioncontrol"
+ REQUIRED_HEADERS dolphinvcs_LIB_HEADERS
+)
+
+install(TARGETS dolphinvcs EXPORT DolphinVcsTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
+
+install(FILES views/versioncontrol/fileviewversioncontrolplugin.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dolphin_export.h DESTINATION ${KDE_INSTALL_INCLUDEDIR} COMPONENT Devel)
+install(FILES ${dolphinvcs_LIB_HEADERS} DESTINATION "${KDE_INSTALL_INCLUDEDIR}/Dolphin" COMPONENT Devel)
########### next target ###############
@@ -95,6 +118,7 @@ set(dolphinprivate_LIB_SRCS
views/zoomlevelinfo.cpp
dolphinremoveaction.cpp
dolphinnewfilemenu.cpp
+ dolphindebug.cpp
)
if(HAVE_BALOO)
@@ -104,7 +128,7 @@ if(HAVE_BALOO)
)
endif()
-kde4_add_kcfg_files(dolphinprivate_LIB_SRCS
+kconfig_add_kcfg_files(dolphinprivate_LIB_SRCS GENERATE_MOC
settings/dolphin_compactmodesettings.kcfgc
settings/dolphin_directoryviewpropertysettings.kcfgc
settings/dolphin_detailsmodesettings.kcfgc
@@ -113,21 +137,35 @@ kde4_add_kcfg_files(dolphinprivate_LIB_SRCS
settings/dolphin_versioncontrolsettings.kcfgc
)
-kde4_add_library(dolphinprivate SHARED ${dolphinprivate_LIB_SRCS})
+add_library(dolphinprivate ${dolphinprivate_LIB_SRCS})
target_link_libraries(
- dolphinprivate
- ${KDE4_KFILE_LIBS}
- konq
- ${KDE4_KNEWSTUFF3_LIBS}
+ dolphinprivate PUBLIC
+ dolphinvcs
+ Qt5::Gui
+ KF5::I18n
+ KF5::IconThemes
+ KF5::KIOCore
+ KF5::KIOWidgets
+ KF5::KIOFileWidgets
+ KF5::Completion
+ KF5::TextEditor
+ KF5::WindowSystem
+ KF5::ConfigCore
+ KF5::NewStuff
)
if(HAVE_BALOO)
target_link_libraries(
- dolphinprivate
- ${BALOO_LIBRARIES}
- ${BALOO_WIDGETS_LIBRARY}
- ${KFILEMETADATA_LIBRARY}
+ dolphinprivate PUBLIC
+ KF5::FileMetaData
+ KF5::Baloo
+ KF5::BalooWidgets
+ )
+else()
+ target_link_libraries(
+ dolphinprivate PUBLIC
+ KF5::KDELibs4Support # for KFileMetaDataWidget
)
endif()
@@ -135,38 +173,35 @@ if(X11_Xrender_FOUND)
target_link_libraries(dolphinprivate ${X11_Xrender_LIB})
endif(X11_Xrender_FOUND)
-target_link_libraries(dolphinprivate ${KDE4_PLASMA_LIBS})
+set_target_properties(dolphinprivate PROPERTIES
+ VERSION ${DOLPHINPRIVATE_VERSION_STRING}
+ SOVERSION ${DOLPHINPRIVATE_SOVERSION}
+)
-set_target_properties(dolphinprivate PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
-install(TARGETS dolphinprivate ${INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS dolphinprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
##########################################
set(dolphinpart_SRCS
dolphinpart.cpp
+ dolphinpart_ext.cpp
+ dolphindebug.cpp
)
-# Add dolphinpart_ext.cpp conditionally, only with KDE > 4.9.1.
-if (${KDE_VERSION} VERSION_GREATER "4.9.1")
-set(dolphinpart_SRCS
- ${dolphinpart_SRCS}
- dolphinpart_ext.cpp)
-endif (${KDE_VERSION} VERSION_GREATER "4.9.1")
+add_library(dolphinpart MODULE ${dolphinpart_SRCS})
-kde4_add_plugin(dolphinpart ${dolphinpart_SRCS})
-
-target_link_libraries(dolphinpart dolphinprivate konq ${KDE4_KPARTS_LIBS} ${KDE4_KFILE_LIBS})
+target_link_libraries(dolphinpart
+ dolphinprivate
+)
install(TARGETS dolphinpart DESTINATION ${PLUGIN_INSTALL_DIR})
-install(FILES dolphinpart.rc DESTINATION ${DATA_INSTALL_DIR}/dolphinpart)
-install(FILES dolphinpart.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-install(FILES views/versioncontrol/fileviewversioncontrolplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
+install(FILES dolphinpart.rc DESTINATION ${CMAKE_INSTALL_KXMLGUI5DIR}/dolphinpart)
+install(FILES dolphinpart.desktop DESTINATION ${SERVICES_INSTALL_DIR})
##########################################
set(dolphin_SRCS
- dolphinapplication.cpp
dolphindockwidget.cpp
dolphinmainwindow.cpp
dolphinviewcontainer.cpp
@@ -217,12 +252,14 @@ set(dolphin_SRCS
statusbar/dolphinstatusbar.cpp
statusbar/mountpointobserver.cpp
statusbar/mountpointobservercache.cpp
+ statusbar/spaceinfotoolsmenu.cpp
statusbar/spaceinfoobserver.cpp
statusbar/statusbarspaceinfo.cpp
views/zoomlevelinfo.cpp
+ dolphindebug.cpp
)
-kde4_add_kcfg_files(dolphin_SRCS
+kconfig_add_kcfg_files(dolphin_SRCS GENERATE_MOC
panels/folders/dolphin_folderspanelsettings.kcfgc
panels/information/dolphin_informationpanelsettings.kcfgc
panels/places/dolphin_placespanelsettings.kcfgc
@@ -236,40 +273,36 @@ kde4_add_kcfg_files(dolphin_SRCS
if(NOT WIN32)
set(dolphin_SRCS ${dolphin_SRCS} panels/terminal/terminalpanel.cpp)
-endif(NOT WIN32)
+endif()
-kde4_add_app_icon(dolphin_SRCS "${KDE4_ICON_INSTALL_DIR}/oxygen/*/apps/system-file-manager.png")
+# TODO Does anything replace kde4_add_app_icon ?
+#kde4_add_app_icon(dolphin_SRCS "${KDE4_ICON_INSTALL_DIR}/oxygen/*/apps/system-file-manager.png")
-kde4_add_kdeinit_executable(dolphin ${dolphin_SRCS})
+kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS})
+
+target_include_directories(kdeinit_dolphin PRIVATE ${PHONON_INCLUDES})
target_link_libraries(kdeinit_dolphin
- ${KDE4_KDEPRINT_LIBS}
- ${KDE4_KFILE_LIBS}
- ${KDE4_KPARTS_LIBS}
- ${KDE4_KCMUTILS_LIBRARY}
- konq
dolphinprivate
- knewstuff3
- ${KDE4_SOLID_LIBS}
- ${KDE4_PHONON_LIBS}
+ KF5::Parts
+ KF5::KCMUtils
+ KF5::Solid
+ KF5::CoreAddons
+ KF5::DBusAddons
+ KF5::Bookmarks
+ KF5::Notifications
+ Phonon::phonon4qt5
)
-if(HAVE_BALOO)
- target_link_libraries(kdeinit_dolphin
- ${BALOO_LIBRARIES}
- ${BALOO_WIDGETS_LIBRARY}
+if (KF5Activities_FOUND)
+ target_link_libraries(
+ kdeinit_dolphin
+ KF5::Activities
)
endif()
-if (KActivities_FOUND)
- target_link_libraries(
- kdeinit_dolphin
- ${KACTIVITIES_LIBRARY}
- )
-endif (KActivities_FOUND)
-
-install(TARGETS kdeinit_dolphin ${INSTALL_TARGETS_DEFAULT_ARGS})
-install(TARGETS dolphin ${INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS kdeinit_dolphin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS dolphin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
##########################################
@@ -302,7 +335,7 @@ set(kcm_dolphingeneral_PART_SRCS
settings/serviceitemdelegate.cpp
settings/servicemodel.cpp)
-kde4_add_kcfg_files(kcm_dolphinviewmodes_PART_SRCS
+kconfig_add_kcfg_files(kcm_dolphinviewmodes_PART_SRCS
settings/dolphin_compactmodesettings.kcfgc
settings/dolphin_directoryviewpropertysettings.kcfgc
settings/dolphin_detailsmodesettings.kcfgc
@@ -311,42 +344,34 @@ kde4_add_kcfg_files(kcm_dolphinviewmodes_PART_SRCS
settings/dolphin_versioncontrolsettings.kcfgc
)
-kde4_add_kcfg_files(kcm_dolphinnavigation_PART_SRCS
+kconfig_add_kcfg_files(kcm_dolphinnavigation_PART_SRCS
settings/dolphin_generalsettings.kcfgc)
-kde4_add_kcfg_files(kcm_dolphinservices_PART_SRCS
+kconfig_add_kcfg_files(kcm_dolphinservices_PART_SRCS
settings/dolphin_generalsettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc)
-kde4_add_kcfg_files(kcm_dolphingeneral_PART_SRCS
+kconfig_add_kcfg_files(kcm_dolphingeneral_PART_SRCS
settings/dolphin_generalsettings.kcfgc)
-kde4_add_plugin(kcm_dolphinviewmodes ${kcm_dolphinviewmodes_PART_SRCS})
-kde4_add_plugin(kcm_dolphinnavigation ${kcm_dolphinnavigation_PART_SRCS})
-kde4_add_plugin(kcm_dolphinservices ${kcm_dolphinservices_PART_SRCS})
-kde4_add_plugin(kcm_dolphingeneral ${kcm_dolphingeneral_PART_SRCS})
+add_library(kcm_dolphinviewmodes MODULE ${kcm_dolphinviewmodes_PART_SRCS})
+add_library(kcm_dolphinnavigation MODULE ${kcm_dolphinnavigation_PART_SRCS})
+add_library(kcm_dolphinservices MODULE ${kcm_dolphinservices_PART_SRCS})
+add_library(kcm_dolphingeneral MODULE ${kcm_dolphingeneral_PART_SRCS})
-target_link_libraries(kcm_dolphinviewmodes ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} dolphinprivate)
-target_link_libraries(kcm_dolphinnavigation ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} dolphinprivate)
-target_link_libraries(kcm_dolphinservices ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KNEWSTUFF3_LIBRARY} dolphinprivate)
-target_link_libraries(kcm_dolphingeneral ${KDE4_KDEUI_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS} dolphinprivate)
+target_link_libraries(kcm_dolphinviewmodes dolphinprivate)
+target_link_libraries(kcm_dolphinnavigation dolphinprivate)
+target_link_libraries(kcm_dolphinservices dolphinprivate)
+target_link_libraries(kcm_dolphingeneral dolphinprivate)
install(TARGETS kcm_dolphinviewmodes DESTINATION ${PLUGIN_INSTALL_DIR} )
install(TARGETS kcm_dolphinnavigation DESTINATION ${PLUGIN_INSTALL_DIR} )
install(TARGETS kcm_dolphinservices DESTINATION ${PLUGIN_INSTALL_DIR} )
install(TARGETS kcm_dolphingeneral DESTINATION ${PLUGIN_INSTALL_DIR} )
-#########################################
-
-set(kio_search_PART_SRCS
- search/filenamesearchprotocol.cpp)
-kde4_add_plugin(kio_filenamesearch ${kio_search_PART_SRCS})
-target_link_libraries(kio_filenamesearch ${KDE4_KIO_LIBS})
-install(TARGETS kio_filenamesearch DESTINATION ${PLUGIN_INSTALL_DIR})
-
########### install files ###############
-install( PROGRAMS dolphin.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+install( PROGRAMS org.kde.dolphin.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES settings/dolphin_directoryviewpropertysettings.kcfg
settings/dolphin_generalsettings.kcfg
settings/dolphin_compactmodesettings.kcfg
@@ -354,9 +379,8 @@ install( FILES settings/dolphin_directoryviewpropertysettings.kcfg
settings/dolphin_detailsmodesettings.kcfg
settings/dolphin_versioncontrolsettings.kcfg
DESTINATION ${KCFG_INSTALL_DIR} )
-install( FILES dolphinui.rc DESTINATION ${DATA_INSTALL_DIR}/dolphin )
+install( FILES dolphinui.rc DESTINATION ${CMAKE_INSTALL_KXMLGUI5DIR}/dolphin )
install( FILES dolphin.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata )
-install( FILES search/filenamesearch.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES settings/kcm/kcmdolphinviewmodes.desktop DESTINATION
${SERVICES_INSTALL_DIR} )
install( FILES settings/kcm/kcmdolphinnavigation.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
@@ -366,3 +390,7 @@ install( FILES settings/services/servicemenu.knsrc DESTINATION ${CONFIG_INSTALL_
install( PROGRAMS settings/services/servicemenuinstallation DESTINATION ${BIN_INSTALL_DIR} )
install( PROGRAMS settings/services/servicemenudeinstallation DESTINATION ${BIN_INSTALL_DIR} )
+if(BUILD_TESTING)
+ find_package(Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED)
+ add_subdirectory(tests)
+endif()
diff --git a/src/config-dolphin.h.cmake b/src/config-dolphin.h.cmake
new file mode 100644
index 0000000000..45e7208e1a
--- /dev/null
+++ b/src/config-dolphin.h.cmake
@@ -0,0 +1,4 @@
+
+/* Define to 1 if you have the KActivities library. */
+#cmakedefine KF5Activities_FOUND 1
+
diff --git a/src/dolphin.appdata.xml b/src/dolphin.appdata.xml
index 1d894a5851..1f6ce01b05 100644
--- a/src/dolphin.appdata.xml
+++ b/src/dolphin.appdata.xml
@@ -1,6 +1,6 @@
- dolphin.desktop
+ org.kde.dolphin.desktopCC0-1.0GPL-2.0+Dolphin
diff --git a/src/dolphinapplication.cpp b/src/dolphinapplication.cpp
deleted file mode 100644
index a4b105b90f..0000000000
--- a/src/dolphinapplication.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2006-2011 by Peter Penz *
- * Copyright (C) 2006 by Holger 'zecke' Freyther *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
- ***************************************************************************/
-
-#include "dolphinapplication.h"
-#include "dolphinmainwindow.h"
-#include "dolphin_generalsettings.h"
-
-#include
-#include
-#include
-#include
-
-DolphinApplication::DolphinApplication() :
- m_mainWindow(0)
-{
- KGlobal::locale()->insertCatalog("libkonq"); // Needed for applications using libkonq
-
- m_mainWindow = new DolphinMainWindow();
- m_mainWindow->setAttribute(Qt::WA_DeleteOnClose);
-
- KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
-
- const int argsCount = args->count();
-
- QList urls;
- for (int i = 0; i < argsCount; ++i) {
- const KUrl url = args->url(i);
- if (url.isValid()) {
- urls.append(url);
- }
- }
-
- bool resetSplitSettings = false;
- if (args->isSet("split") && !GeneralSettings::splitView()) {
- // Dolphin should be opened with a split view although this is not
- // set in the GeneralSettings. Temporary adjust the setting until
- // all passed URLs have been opened.
- GeneralSettings::setSplitView(true);
- resetSplitSettings = true;
-
- // We need 2 URLs to open Dolphin in split view mode
- if (urls.isEmpty()) { // No URL given - Open home URL in all two views
- urls.append(GeneralSettings::homeUrl());
- urls.append(GeneralSettings::homeUrl());
- } else if (urls.length() == 1) { // Only 1 URL given - Open given URL in all two views
- urls.append(urls.at(0));
- }
- }
-
- if (!urls.isEmpty()) {
- if (args->isSet("select")) {
- m_mainWindow->openFiles(urls);
- } else {
- m_mainWindow->openDirectories(urls);
- }
- } else {
- const KUrl homeUrl(GeneralSettings::homeUrl());
- m_mainWindow->openNewActivatedTab(homeUrl);
- }
-
- if (resetSplitSettings) {
- GeneralSettings::setSplitView(false);
- }
-
- args->clear();
-
- m_mainWindow->show();
-}
-
-DolphinApplication::~DolphinApplication()
-{
-}
-
-DolphinApplication* DolphinApplication::app()
-{
- return qobject_cast(qApp);
-}
-
-void DolphinApplication::restoreSession()
-{
- const QString className = KXmlGuiWindow::classNameOfToplevel(1);
- if (className == QLatin1String("DolphinMainWindow")) {
- m_mainWindow->restore(1);
- } else {
- kWarning() << "Unknown class " << className << " in session saved data!";
- }
-}
-
-#include "dolphinapplication.moc"
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index e692c8fa9a..27ad19924c 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -27,34 +27,30 @@
#include "dolphinremoveaction.h"
#include
-#include
-#include
-#include
+#include
#include
#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
+#include
#include
#include
-#include
-#include
#include
-#include
-#include
+#include
#include
-#include
#include
+#include
+#include
+#include
+#include
+#include
+
#include
#include
-#include
-#include
-#include
#include "views/dolphinview.h"
#include "views/viewmodecontroller.h"
@@ -62,8 +58,8 @@
DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
const QPoint& pos,
const KFileItem& fileInfo,
- const KUrl& baseUrl) :
- KMenu(parent),
+ const QUrl& baseUrl) :
+ QMenu(parent),
m_pos(pos),
m_mainWindow(parent),
m_fileInfo(fileInfo),
@@ -97,7 +93,7 @@ void DolphinContextMenu::setCustomActions(const QList& actions)
DolphinContextMenu::Command DolphinContextMenu::open()
{
// get the context information
- if (m_baseUrl.protocol() == QLatin1String("trash")) {
+ if (m_baseUrl.scheme() == QLatin1String("trash")) {
m_context |= TrashContext;
}
@@ -128,7 +124,7 @@ void DolphinContextMenu::keyPressEvent(QKeyEvent *ev)
if (m_removeAction && ev->key() == Qt::Key_Shift) {
m_removeAction->update();
}
- KMenu::keyPressEvent(ev);
+ QMenu::keyPressEvent(ev);
}
void DolphinContextMenu::keyReleaseEvent(QKeyEvent *ev)
@@ -136,14 +132,14 @@ void DolphinContextMenu::keyReleaseEvent(QKeyEvent *ev)
if (m_removeAction && ev->key() == Qt::Key_Shift) {
m_removeAction->update();
}
- KMenu::keyReleaseEvent(ev);
+ QMenu::keyReleaseEvent(ev);
}
void DolphinContextMenu::openTrashContextMenu()
{
Q_ASSERT(m_context & TrashContext);
- QAction* emptyTrashAction = new QAction(KIcon("trash-empty"), i18nc("@action:inmenu", "Empty Trash"), this);
+ QAction* emptyTrashAction = new QAction(QIcon::fromTheme("trash-empty"), i18nc("@action:inmenu", "Empty Trash"), this);
KConfig trashConfig("trashrc", KConfig::SimpleConfig);
emptyTrashAction->setEnabled(!trashConfig.group("Status").readEntry("Empty", true));
addAction(emptyTrashAction);
@@ -156,7 +152,13 @@ void DolphinContextMenu::openTrashContextMenu()
addShowMenuBarAction();
if (exec(m_pos) == emptyTrashAction) {
- KonqOperations::emptyTrash(m_mainWindow);
+ KIO::JobUiDelegate uiDelegate;
+ uiDelegate.setWindow(m_mainWindow);
+ if (uiDelegate.askDeleteConfirmation(QList(), KIO::JobUiDelegate::EmptyTrash, KIO::JobUiDelegate::DefaultConfirmation)) {
+ KIO::Job* job = KIO::emptyTrash();
+ KJobWidgets::setWindow(job, m_mainWindow);
+ job->ui()->setAutoErrorHandlingEnabled(true);
+ }
}
}
@@ -175,12 +177,14 @@ void DolphinContextMenu::openTrashItemContextMenu()
addAction(propertiesAction);
if (exec(m_pos) == restoreAction) {
- KUrl::List selectedUrls;
+ QList selectedUrls;
foreach (const KFileItem &item, m_selectedItems) {
selectedUrls.append(item.url());
}
- KonqOperations::restoreTrashedItems(selectedUrls, m_mainWindow);
+ KIO::RestoreJob *job = KIO::restoreFromTrash(selectedUrls);
+ KJobWidgets::setWindow(job, m_mainWindow);
+ job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
}
@@ -188,6 +192,7 @@ void DolphinContextMenu::openItemContextMenu()
{
Q_ASSERT(!m_fileInfo.isNull());
+ QAction* openParentAction = 0;
QAction* openParentInNewWindowAction = 0;
QAction* openParentInNewTabAction = 0;
QAction* addToPlacesAction = 0;
@@ -202,12 +207,12 @@ void DolphinContextMenu::openItemContextMenu()
newFileMenu->checkUpToDate();
newFileMenu->setPopupFiles(m_fileInfo.url());
newFileMenu->setEnabled(selectedItemsProps.supportsWriting());
- connect(newFileMenu, SIGNAL(fileCreated(KUrl)), newFileMenu, SLOT(deleteLater()));
- connect(newFileMenu, SIGNAL(directoryCreated(KUrl)), newFileMenu, SLOT(deleteLater()));
+ connect(newFileMenu, &DolphinNewFileMenu::fileCreated, newFileMenu, &DolphinNewFileMenu::deleteLater);
+ connect(newFileMenu, &DolphinNewFileMenu::directoryCreated, newFileMenu, &DolphinNewFileMenu::deleteLater);
- KMenu* menu = newFileMenu->menu();
+ QMenu* menu = newFileMenu->menu();
menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
- menu->setIcon(KIcon("document-new"));
+ menu->setIcon(QIcon::fromTheme("document-new"));
addMenu(menu);
addSeparator();
@@ -217,20 +222,26 @@ void DolphinContextMenu::openItemContextMenu()
// insert 'Add to Places' entry
if (!placeExists(m_fileInfo.url())) {
- addToPlacesAction = addAction(KIcon("bookmark-new"),
+ addToPlacesAction = addAction(QIcon::fromTheme("bookmark-new"),
i18nc("@action:inmenu Add selected folder to places",
"Add to Places"));
}
addSeparator();
- } else if (m_baseUrl.protocol().contains("search")) {
- openParentInNewWindowAction = new QAction(KIcon("window-new"),
+ } else if (m_baseUrl.scheme().contains("search") || m_baseUrl.scheme().contains("timeline")) {
+ openParentAction = new QAction(QIcon::fromTheme("document-open-folder"),
+ i18nc("@action:inmenu",
+ "Open Path"),
+ this);
+ addAction(openParentAction);
+
+ openParentInNewWindowAction = new QAction(QIcon::fromTheme("window-new"),
i18nc("@action:inmenu",
"Open Path in New Window"),
this);
addAction(openParentInNewWindowAction);
- openParentInNewTabAction = new QAction(KIcon("tab-new"),
+ openParentInNewTabAction = new QAction(QIcon::fromTheme("tab-new"),
i18nc("@action:inmenu",
"Open Path in New Tab"),
this);
@@ -247,7 +258,7 @@ void DolphinContextMenu::openItemContextMenu()
} else {
bool selectionHasOnlyDirs = true;
foreach (const KFileItem& item, m_selectedItems) {
- const KUrl& url = DolphinView::openItemAsFolderUrl(item);
+ const QUrl& url = DolphinView::openItemAsFolderUrl(item);
if (url.isEmpty()) {
selectionHasOnlyDirs = false;
break;
@@ -275,8 +286,9 @@ void DolphinContextMenu::openItemContextMenu()
// insert 'Copy To' and 'Move To' sub menus
if (GeneralSettings::showCopyMoveMenu()) {
- m_copyToMenu.setItems(m_selectedItems);
+ m_copyToMenu.setUrls(m_selectedItems.urlList());
m_copyToMenu.setReadOnly(!selectedItemsProps.supportsWriting());
+ m_copyToMenu.setAutoErrorHandlingEnabled(true);
m_copyToMenu.addActionsTo(this);
}
@@ -287,13 +299,15 @@ void DolphinContextMenu::openItemContextMenu()
QAction* activatedAction = exec(m_pos);
if (activatedAction) {
if (activatedAction == addToPlacesAction) {
- const KUrl selectedUrl(m_fileInfo.url());
+ const QUrl selectedUrl(m_fileInfo.url());
if (selectedUrl.isValid()) {
PlacesItemModel model;
const QString text = selectedUrl.fileName();
PlacesItem* item = model.createPlacesItem(text, selectedUrl);
model.appendItemToGroup(item);
}
+ } else if (activatedAction == openParentAction) {
+ m_command = OpenParentFolder;
} else if (activatedAction == openParentInNewWindowAction) {
m_command = OpenParentFolderInNewWindow;
} else if (activatedAction == openParentInNewTabAction) {
@@ -321,7 +335,7 @@ void DolphinContextMenu::openViewportContextMenu()
// Insert 'Add to Places' entry if exactly one item is selected
QAction* addToPlacesAction = 0;
if (!placeExists(m_mainWindow->activeViewContainer()->url())) {
- addToPlacesAction = addAction(KIcon("bookmark-new"),
+ addToPlacesAction = addAction(QIcon::fromTheme("bookmark-new"),
i18nc("@action:inmenu Add current folder to places", "Add to Places"));
}
@@ -377,7 +391,7 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties&
// Insert 'Move to Trash' and/or 'Delete'
if (properties.supportsDeleting()) {
- const bool showDeleteAction = (KGlobal::config()->group("KDE").readEntry("ShowDeleteCommand", false) ||
+ const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) ||
!properties.isLocal());
const bool showMoveToTrashAction = (properties.isLocal() &&
properties.supportsMoving());
@@ -409,14 +423,14 @@ void DolphinContextMenu::addShowMenuBarAction()
}
}
-bool DolphinContextMenu::placeExists(const KUrl& url) const
+bool DolphinContextMenu::placeExists(const QUrl& url) const
{
PlacesItemModel model;
const int count = model.count();
for (int i = 0; i < count; ++i) {
- const KUrl placeUrl = model.placesItem(i)->url();
- if (placeUrl.equals(url, KUrl::CompareWithoutTrailingSlash)) {
+ const QUrl placeUrl = model.placesItem(i)->url();
+ if (placeUrl.matches(url, QUrl::StripTrailingSlash)) {
return true;
}
}
@@ -429,10 +443,12 @@ QAction* DolphinContextMenu::createPasteAction()
QAction* action = 0;
const bool isDir = !m_fileInfo.isNull() && m_fileInfo.isDir();
if (isDir && (m_selectedItems.count() == 1)) {
- const QPair pasteInfo = KonqOperations::pasteInfo(m_fileInfo.url());
- action = new QAction(KIcon("edit-paste"), i18nc("@action:inmenu", "Paste Into Folder"), this);
- action->setEnabled(pasteInfo.first);
- connect(action, SIGNAL(triggered()), m_mainWindow, SLOT(pasteIntoFolder()));
+ const QMimeData *mimeData = QApplication::clipboard()->mimeData();
+ bool canPaste;
+ const QString text = KIO::pasteActionText(mimeData, &canPaste, m_fileInfo);
+ action = new QAction(QIcon::fromTheme("edit-paste"), text, this);
+ action->setEnabled(canPaste);
+ connect(action, &QAction::triggered, m_mainWindow, &DolphinMainWindow::pasteIntoFolder);
} else {
action = m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::Paste));
}
@@ -451,7 +467,7 @@ KFileItemListProperties& DolphinContextMenu::selectedItemsProperties() const
KFileItem DolphinContextMenu::baseFileItem()
{
if (!m_baseFileItem) {
- m_baseFileItem = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, m_baseUrl);
+ m_baseFileItem = new KFileItem(m_baseUrl);
}
return *m_baseFileItem;
}
@@ -489,19 +505,12 @@ void DolphinContextMenu::addFileItemPluginActions()
const KConfig config("kservicemenurc", KConfig::NoGlobals);
const KConfigGroup showGroup = config.group("Show");
- foreach (const KSharedPtr& service, pluginServices) {
+ foreach (const KService::Ptr& service, pluginServices) {
if (!showGroup.readEntry(service->desktopEntryName(), true)) {
// The plugin has been disabled
continue;
}
- // Old API (kdelibs-4.6.0 only)
- KFileItemActionPlugin* plugin = service->createInstance();
- if (plugin) {
- plugin->setParent(this);
- addActions(plugin->actions(props, m_mainWindow));
- }
- // New API (kdelibs >= 4.6.1)
KAbstractFileItemActionPlugin* abstractPlugin = service->createInstance();
if (abstractPlugin) {
abstractPlugin->setParent(this);
@@ -515,18 +524,13 @@ void DolphinContextMenu::addVersionControlPluginActions()
const DolphinView* view = m_mainWindow->activeViewContainer()->view();
const QList versionControlActions = view->versionControlActions(m_selectedItems);
if (!versionControlActions.isEmpty()) {
- foreach (QAction* action, versionControlActions) {
- addAction(action);
- }
+ addActions(versionControlActions);
addSeparator();
}
}
void DolphinContextMenu::addCustomActions()
{
- foreach (QAction* action, m_customActions) {
- addAction(action);
- }
+ addActions(m_customActions);
}
-#include "dolphincontextmenu.moc"
diff --git a/src/dolphincontextmenu.h b/src/dolphincontextmenu.h
index 180f91787c..419d3f9bd4 100644
--- a/src/dolphincontextmenu.h
+++ b/src/dolphincontextmenu.h
@@ -21,16 +21,12 @@
#define DOLPHINCONTEXTMENU_H
#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
-#include
-#include
-#include
class QAction;
class DolphinMainWindow;
@@ -50,7 +46,7 @@ class DolphinRemoveAction;
* - 'Actions': Contains all actions which can be applied to the
* given item.
*/
-class DolphinContextMenu : public KMenu
+class DolphinContextMenu : public QMenu
{
Q_OBJECT
@@ -58,6 +54,7 @@ public:
enum Command
{
None,
+ OpenParentFolder,
OpenParentFolderInNewWindow,
OpenParentFolderInNewTab
};
@@ -75,7 +72,7 @@ public:
DolphinContextMenu(DolphinMainWindow* parent,
const QPoint& pos,
const KFileItem& fileInfo,
- const KUrl& baseUrl);
+ const QUrl& baseUrl);
virtual ~DolphinContextMenu();
@@ -92,8 +89,8 @@ public:
Command open();
protected:
- virtual void keyPressEvent(QKeyEvent *ev);
- virtual void keyReleaseEvent(QKeyEvent *ev);
+ virtual void keyPressEvent(QKeyEvent *ev) Q_DECL_OVERRIDE;
+ virtual void keyReleaseEvent(QKeyEvent *ev) Q_DECL_OVERRIDE;
private:
void openTrashContextMenu();
@@ -109,7 +106,7 @@ private:
*/
void addShowMenuBarAction();
- bool placeExists(const KUrl& url) const;
+ bool placeExists(const QUrl& url) const;
QAction* createPasteAction();
@@ -165,14 +162,14 @@ private:
KFileItem m_fileInfo;
- KUrl m_baseUrl;
+ QUrl m_baseUrl;
KFileItem* m_baseFileItem; /// File item for m_baseUrl
KFileItemList m_selectedItems;
mutable KFileItemListProperties* m_selectedItemsProperties;
int m_context;
- KonqCopyToMenu m_copyToMenu;
+ KFileCopyToMenu m_copyToMenu;
QList m_customActions;
Command m_command;
diff --git a/src/search/filenamesearchprotocol.h b/src/dolphindebug.cpp
similarity index 53%
rename from src/search/filenamesearchprotocol.h
rename to src/dolphindebug.cpp
index 4a854d7294..17f1084272 100644
--- a/src/search/filenamesearchprotocol.h
+++ b/src/dolphindebug.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2010 by Peter Penz *
+ * Copyright (C) 2015 by Emmanuel Pescosta *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -17,44 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef FILENAMESEARCHPROTOCOL_H
-#define FILENAMESEARCHPROTOCOL_H
+#include "dolphindebug.h"
-#include
-
-class KFileItem;
-class KUrl;
-class QRegExp;
-
-/**
- * @brief Lists files where the filename matches do a given query.
- *
- * The query is defined as part of the "search" query item of the URL.
- * The directory where the searching is started is defined in the "url" query
- * item. If the query item "checkContent" is set to "yes", all files with
- * a text MIME type will be checked for the content.
- */
-class FileNameSearchProtocol : public KIO::SlaveBase {
-public:
- FileNameSearchProtocol(const QByteArray& pool, const QByteArray& app);
- virtual ~FileNameSearchProtocol();
-
- virtual void listDir(const KUrl& url);
-
-private:
- void searchDirectory(const KUrl& directory);
-
- /**
- * @return True, if the pattern m_searchPattern is part of
- * the file \a fileName.
- */
- bool contentContainsPattern(const KUrl& fileName) const;
-
- void cleanup();
-
- bool m_checkContent;
- QRegExp* m_regExp;
- QSet m_iteratedDirs;
-};
-
-#endif
+Q_LOGGING_CATEGORY(DolphinDebug, "org.kde.dolphin")
diff --git a/src/dolphinapplication.h b/src/dolphindebug.h
similarity index 71%
rename from src/dolphinapplication.h
rename to src/dolphindebug.h
index 69d07c36e4..9b4554b49f 100644
--- a/src/dolphinapplication.h
+++ b/src/dolphindebug.h
@@ -1,6 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006-2011 by Peter Penz *
- * Copyright (C) 2006 by Holger 'zecke' Freyther *
+ * Copyright (C) 2015 by Emmanuel Pescosta *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -18,27 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef DOLPHIN_APPLICATION_H
-#define DOLPHIN_APPLICATION_H
+#ifndef DOLPHIN_DEBUG_H
+#define DOLPHIN_DEBUG_H
-#include
+#include
-class DolphinMainWindow;
+Q_DECLARE_LOGGING_CATEGORY(DolphinDebug)
-class DolphinApplication : public KApplication
-{
- Q_OBJECT
-
-public:
- DolphinApplication();
- virtual ~DolphinApplication();
-
- static DolphinApplication* app();
-
- void restoreSession();
-
-private:
- DolphinMainWindow* m_mainWindow;
-};
-
-#endif
+#endif // DOLPHIN_DEBUG_H
diff --git a/src/dolphindockwidget.cpp b/src/dolphindockwidget.cpp
index 6495c8da96..1e83ef841b 100644
--- a/src/dolphindockwidget.cpp
+++ b/src/dolphindockwidget.cpp
@@ -91,4 +91,3 @@ bool DolphinDockWidget::isLocked() const
return m_locked;
}
-#include "dolphindockwidget.moc"
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 95b08af96e..1eda03e3c7 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -21,7 +21,6 @@
#include "dolphinmainwindow.h"
-#include "dolphinapplication.h"
#include "dolphindockwidget.h"
#include "dolphincontextmenu.h"
#include "dolphinnewfilemenu.h"
@@ -46,47 +45,38 @@
#include "dolphin_generalsettings.h"
-#include
-#include
#include
#include
#include
-#include
#include
#include
-#include
-#include
-#include
+#include
+#include
#include
-#include
-#include
-#include
#include
-#include
-#include
+#include
#include
-#include
-#include
+#include
#include
#include
-#include
-#include
#include
#include
-#include
-#include
#include
#include
#include
-#include
-#include
#include
+#include
-#include
-#include
-#include
+#include
+#include
#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
namespace {
// Used for GeneralSettings::version() to determine whether
@@ -108,20 +98,20 @@ DolphinMainWindow::DolphinMainWindow() :
{
setObjectName("Dolphin#");
- connect(&DolphinNewFileMenuObserver::instance(), SIGNAL(errorMessage(QString)),
- this, SLOT(showErrorMessage(QString)));
+ connect(&DolphinNewFileMenuObserver::instance(), &DolphinNewFileMenuObserver::errorMessage,
+ this, &DolphinMainWindow::showErrorMessage);
KIO::FileUndoManager* undoManager = KIO::FileUndoManager::self();
undoManager->setUiInterface(new UndoUiInterface());
- connect(undoManager, SIGNAL(undoAvailable(bool)),
- this, SLOT(slotUndoAvailable(bool)));
- connect(undoManager, SIGNAL(undoTextChanged(QString)),
- this, SLOT(slotUndoTextChanged(QString)));
- connect(undoManager, SIGNAL(jobRecordingStarted(CommandType)),
- this, SLOT(clearStatusBar()));
- connect(undoManager, SIGNAL(jobRecordingFinished(CommandType)),
- this, SLOT(showCommand(CommandType)));
+ connect(undoManager, static_cast(&KIO::FileUndoManager::undoAvailable),
+ this, &DolphinMainWindow::slotUndoAvailable);
+ connect(undoManager, &KIO::FileUndoManager::undoTextChanged,
+ this, &DolphinMainWindow::slotUndoTextChanged);
+ connect(undoManager, &KIO::FileUndoManager::jobRecordingStarted,
+ this, &DolphinMainWindow::clearStatusBar);
+ connect(undoManager, &KIO::FileUndoManager::jobRecordingFinished,
+ this, &DolphinMainWindow::showCommand);
GeneralSettings* generalSettings = GeneralSettings::self();
const bool firstRun = (generalSettings->version() < 200);
@@ -136,19 +126,19 @@ DolphinMainWindow::DolphinMainWindow() :
this, SLOT(activeViewChanged(DolphinViewContainer*)));
connect(m_tabWidget, SIGNAL(tabCountChanged(int)),
this, SLOT(tabCountChanged(int)));
- connect(m_tabWidget, SIGNAL(currentUrlChanged(KUrl)),
- this, SLOT(setUrlAsCaption(KUrl)));
+ connect(m_tabWidget, SIGNAL(currentUrlChanged(QUrl)),
+ this, SLOT(setUrlAsCaption(QUrl)));
setCentralWidget(m_tabWidget);
setupActions();
m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
- connect(m_actionHandler, SIGNAL(actionBeingHandled()), SLOT(clearStatusBar()));
- connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory()));
+ connect(m_actionHandler, &DolphinViewActionHandler::actionBeingHandled, this, &DolphinMainWindow::clearStatusBar);
+ connect(m_actionHandler, &DolphinViewActionHandler::createDirectory, this, &DolphinMainWindow::createDirectory);
m_remoteEncoding = new DolphinRemoteEncoding(this, m_actionHandler);
- connect(this, SIGNAL(urlChanged(KUrl)),
- m_remoteEncoding, SLOT(slotAboutToOpenUrl()));
+ connect(this, &DolphinMainWindow::urlChanged,
+ m_remoteEncoding, &DolphinRemoteEncoding::slotAboutToOpenUrl);
setupDockWidgets();
@@ -156,8 +146,8 @@ DolphinMainWindow::DolphinMainWindow() :
stateChanged("new_file");
QClipboard* clipboard = QApplication::clipboard();
- connect(clipboard, SIGNAL(dataChanged()),
- this, SLOT(updatePasteAction()));
+ connect(clipboard, &QClipboard::dataChanged,
+ this, &DolphinMainWindow::updatePasteAction);
QAction* showFilterBarAction = actionCollection()->action("show_filter_bar");
showFilterBarAction->setChecked(generalSettings->filterBar());
@@ -180,12 +170,12 @@ DolphinMainWindow::~DolphinMainWindow()
{
}
-void DolphinMainWindow::openDirectories(const QList& dirs)
+void DolphinMainWindow::openDirectories(const QList& dirs)
{
m_tabWidget->openDirectories(dirs);
}
-void DolphinMainWindow::openFiles(const QList& files)
+void DolphinMainWindow::openFiles(const QList& files)
{
m_tabWidget->openFiles(files);
}
@@ -224,7 +214,7 @@ void DolphinMainWindow::pasteIntoFolder()
m_activeViewContainer->view()->pasteIntoFolder();
}
-void DolphinMainWindow::changeUrl(const KUrl& url)
+void DolphinMainWindow::changeUrl(const QUrl &url)
{
if (!KProtocolManager::supportsListing(url)) {
// The URL navigator only checks for validity, not
@@ -242,7 +232,7 @@ void DolphinMainWindow::changeUrl(const KUrl& url)
emit urlChanged(url);
}
-void DolphinMainWindow::slotTerminalDirectoryChanged(const KUrl& url)
+void DolphinMainWindow::slotTerminalDirectoryChanged(const QUrl& url)
{
m_activeViewContainer->setAutoGrabFocus(false);
changeUrl(url);
@@ -272,11 +262,6 @@ void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
emit selectionChanged(selection);
}
-void DolphinMainWindow::slotRequestItemInfo(const KFileItem& item)
-{
- emit requestItemInfo(item);
-}
-
void DolphinMainWindow::updateHistory()
{
const KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator();
@@ -303,7 +288,7 @@ void DolphinMainWindow::updateFilterBarAction(bool show)
void DolphinMainWindow::openNewMainWindow()
{
- KRun::run("dolphin %u", KUrl::List(), this);
+ KRun::run("dolphin %u", QList(), this);
}
void DolphinMainWindow::openNewActivatedTab()
@@ -311,14 +296,14 @@ void DolphinMainWindow::openNewActivatedTab()
m_tabWidget->openNewActivatedTab();
}
-void DolphinMainWindow::openNewTab(const KUrl& primaryUrl, const KUrl& secondaryUrl)
+void DolphinMainWindow::openNewTab(const QUrl& url)
{
- m_tabWidget->openNewTab(primaryUrl, secondaryUrl);
+ m_tabWidget->openNewTab(url);
}
-void DolphinMainWindow::openNewActivatedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl)
+void DolphinMainWindow::openNewActivatedTab(const QUrl& url)
{
- m_tabWidget->openNewActivatedTab(primaryUrl, secondaryUrl);
+ m_tabWidget->openNewActivatedTab(url);
}
void DolphinMainWindow::openInNewTab()
@@ -328,7 +313,7 @@ void DolphinMainWindow::openInNewTab()
openNewTab(m_activeViewContainer->url());
} else {
foreach (const KFileItem& item, list) {
- const KUrl& url = DolphinView::openItemAsFolderUrl(item);
+ const QUrl& url = DolphinView::openItemAsFolderUrl(item);
if (!url.isEmpty()) {
openNewTab(url);
}
@@ -338,7 +323,7 @@ void DolphinMainWindow::openInNewTab()
void DolphinMainWindow::openInNewWindow()
{
- KUrl newWindowUrl;
+ QUrl newWindowUrl;
const KFileItemList list = m_activeViewContainer->view()->selectedItems();
if (list.isEmpty()) {
@@ -349,7 +334,7 @@ void DolphinMainWindow::openInNewWindow()
}
if (!newWindowUrl.isEmpty()) {
- KRun::run("dolphin %u", KUrl::List() << newWindowUrl, this);
+ KRun::run("dolphin %u", {newWindowUrl}, this);
}
}
@@ -367,29 +352,29 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
// Find out if Dolphin is closed directly by the user or
// by the session manager because the session is closed
bool closedByUser = true;
- DolphinApplication *application = qobject_cast(qApp);
- if (application && application->sessionSaving()) {
+ if (qApp->isSessionRestored()) {
closedByUser = false;
}
if (m_tabWidget->count() > 1 && GeneralSettings::confirmClosingMultipleTabs() && closedByUser) {
// Ask the user if he really wants to quit and close all tabs.
// Open a confirmation dialog with 3 buttons:
- // KDialog::Yes -> Quit
- // KDialog::No -> Close only the current tab
- // KDialog::Cancel -> do nothing
- KDialog *dialog = new KDialog(this, Qt::Dialog);
- dialog->setCaption(i18nc("@title:window", "Confirmation"));
- dialog->setButtons(KDialog::Yes | KDialog::No | KDialog::Cancel);
+ // QDialogButtonBox::Yes -> Quit
+ // QDialogButtonBox::No -> Close only the current tab
+ // QDialogButtonBox::Cancel -> do nothing
+ QDialog *dialog = new QDialog(this, Qt::Dialog);
+ dialog->setWindowTitle(i18nc("@title:window", "Confirmation"));
dialog->setModal(true);
- dialog->setButtonGuiItem(KDialog::Yes, KStandardGuiItem::quit());
- dialog->setButtonGuiItem(KDialog::No, KGuiItem(i18n("C&lose Current Tab"), KIcon("tab-close")));
- dialog->setButtonGuiItem(KDialog::Cancel, KStandardGuiItem::cancel());
- dialog->setDefaultButton(KDialog::Yes);
+ QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel);
+ KGuiItem::assign(buttons->button(QDialogButtonBox::Yes), KStandardGuiItem::quit());
+ KGuiItem::assign(buttons->button(QDialogButtonBox::No), KGuiItem(i18n("C&lose Current Tab"), QIcon::fromTheme("tab-close")));
+ KGuiItem::assign(buttons->button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel());
+ buttons->button(QDialogButtonBox::Yes)->setDefault(true);
bool doNotAskAgainCheckboxResult = false;
const int result = KMessageBox::createKMessageBox(dialog,
+ buttons,
QMessageBox::Warning,
i18n("You have multiple tabs open in this window, are you sure you want to quit?"),
QStringList(),
@@ -402,10 +387,10 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
}
switch (result) {
- case KDialog::Yes:
+ case QDialogButtonBox::Yes:
// Quit
break;
- case KDialog::No:
+ case QDialogButtonBox::No:
// Close only the current tab
m_tabWidget->closeTab();
default:
@@ -415,7 +400,7 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
}
GeneralSettings::setVersion(CurrentDolphinVersion);
- GeneralSettings::self()->writeConfig();
+ GeneralSettings::self()->save();
KXmlGuiWindow::closeEvent(event);
}
@@ -505,6 +490,11 @@ void DolphinMainWindow::updatePasteAction()
pasteAction->setText(pasteInfo.second);
}
+void DolphinMainWindow::slotDirectoryLoadingCompleted()
+{
+ updatePasteAction();
+}
+
void DolphinMainWindow::selectAll()
{
clearStatusBar();
@@ -626,7 +616,7 @@ void DolphinMainWindow::goHome()
void DolphinMainWindow::goBack(Qt::MouseButtons buttons)
{
// The default case (left button pressed) is handled in goBack().
- if (buttons == Qt::MidButton) {
+ if (buttons == Qt::MiddleButton) {
KUrlNavigator* urlNavigator = activeViewContainer()->urlNavigator();
const int index = urlNavigator->historyIndex() + 1;
openNewTab(urlNavigator->locationUrl(index));
@@ -636,7 +626,7 @@ void DolphinMainWindow::goBack(Qt::MouseButtons buttons)
void DolphinMainWindow::goForward(Qt::MouseButtons buttons)
{
// The default case (left button pressed) is handled in goForward().
- if (buttons == Qt::MidButton) {
+ if (buttons == Qt::MiddleButton) {
KUrlNavigator* urlNavigator = activeViewContainer()->urlNavigator();
const int index = urlNavigator->historyIndex() - 1;
openNewTab(urlNavigator->locationUrl(index));
@@ -646,15 +636,15 @@ void DolphinMainWindow::goForward(Qt::MouseButtons buttons)
void DolphinMainWindow::goUp(Qt::MouseButtons buttons)
{
// The default case (left button pressed) is handled in goUp().
- if (buttons == Qt::MidButton) {
- openNewTab(activeViewContainer()->url().upUrl());
+ if (buttons == Qt::MiddleButton) {
+ openNewTab(KIO::upUrl(activeViewContainer()->url()));
}
}
void DolphinMainWindow::goHome(Qt::MouseButtons buttons)
{
// The default case (left button pressed) is handled in goHome().
- if (buttons == Qt::MidButton) {
+ if (buttons == Qt::MiddleButton) {
openNewTab(GeneralSettings::self()->homeUrl());
}
}
@@ -668,13 +658,13 @@ void DolphinMainWindow::compareFiles()
return;
}
- KUrl urlA = items.at(0).url();
- KUrl urlB = items.at(1).url();
+ QUrl urlA = items.at(0).url();
+ QUrl urlB = items.at(1).url();
QString command("kompare -c \"");
- command.append(urlA.pathOrUrl());
+ command.append(urlA.toDisplayString(QUrl::PreferLocalFile));
command.append("\" \"");
- command.append(urlB.pathOrUrl());
+ command.append(urlB.toDisplayString(QUrl::PreferLocalFile));
command.append('\"');
KRun::runCommand(command, "Kompare", "kompare", this);
}
@@ -696,7 +686,10 @@ void DolphinMainWindow::openTerminal()
// If the given directory is not local, it can still be the URL of an
// ioslave using UDS_LOCAL_PATH which to be converted first.
- KUrl url = KIO::NetAccess::mostLocalUrl(m_activeViewContainer->url(), this);
+ KIO::StatJob* statJob = KIO::mostLocalUrl(m_activeViewContainer->url());
+ KJobWidgets::setWindow(statJob, this);
+ statJob->exec();
+ QUrl url = statJob->mostLocalUrl();
//If the URL is local after the above conversion, set the directory.
if (url.isLocalFile()) {
@@ -712,9 +705,9 @@ void DolphinMainWindow::editSettings()
DolphinViewContainer* container = activeViewContainer();
container->view()->writeSettings();
- const KUrl url = container->url();
+ const QUrl url = container->url();
DolphinSettingsDialog* settingsDialog = new DolphinSettingsDialog(url, this);
- connect(settingsDialog, SIGNAL(settingsChanged()), this, SLOT(refreshViews()));
+ connect(settingsDialog, &DolphinSettingsDialog::settingsChanged, this, &DolphinMainWindow::refreshViews);
settingsDialog->setAttribute(Qt::WA_DeleteOnClose);
settingsDialog->show();
m_settingsDialog = settingsDialog;
@@ -723,7 +716,7 @@ void DolphinMainWindow::editSettings()
}
}
-void DolphinMainWindow::handleUrl(const KUrl& url)
+void DolphinMainWindow::handleUrl(const QUrl& url)
{
delete m_lastHandleUrlStatJob;
m_lastHandleUrlStatJob = 0;
@@ -734,10 +727,10 @@ void DolphinMainWindow::handleUrl(const KUrl& url)
// stat the URL to see if it is a dir or not
m_lastHandleUrlStatJob = KIO::stat(url, KIO::HideProgressInfo);
if (m_lastHandleUrlStatJob->ui()) {
- m_lastHandleUrlStatJob->ui()->setWindow(this);
+ KJobWidgets::setWindow(m_lastHandleUrlStatJob, this);
}
- connect(m_lastHandleUrlStatJob, SIGNAL(result(KJob*)),
- this, SLOT(slotHandleUrlStatFinished(KJob*)));
+ connect(m_lastHandleUrlStatJob, &KIO::Job::result,
+ this, &DolphinMainWindow::slotHandleUrlStatFinished);
} else {
new KRun(url, this); // Automatically deletes itself after being finished
@@ -748,7 +741,7 @@ void DolphinMainWindow::slotHandleUrlStatFinished(KJob* job)
{
m_lastHandleUrlStatJob = 0;
const KIO::UDSEntry entry = static_cast(job)->statResult();
- const KUrl url = static_cast(job)->url();
+ const QUrl url = static_cast(job)->url();
if (entry.isDir()) {
activeViewContainer()->setUrl(url);
} else {
@@ -763,21 +756,26 @@ void DolphinMainWindow::slotWriteStateChanged(bool isFolderWritable)
void DolphinMainWindow::openContextMenu(const QPoint& pos,
const KFileItem& item,
- const KUrl& url,
+ const QUrl& url,
const QList& customActions)
{
- QWeakPointer contextMenu = new DolphinContextMenu(this, pos, item, url);
+ QPointer contextMenu = new DolphinContextMenu(this, pos, item, url);
contextMenu.data()->setCustomActions(customActions);
const DolphinContextMenu::Command command = contextMenu.data()->open();
switch (command) {
+ case DolphinContextMenu::OpenParentFolder:
+ changeUrl(KIO::upUrl(item.url()));
+ break;
+
case DolphinContextMenu::OpenParentFolderInNewWindow: {
- KRun::run("dolphin %u", KUrl::List() << item.url().upUrl(), this);
+
+ KRun::run("dolphin %u", {KIO::upUrl(item.url())}, this);
break;
}
case DolphinContextMenu::OpenParentFolderInNewTab:
- openNewTab(item.url().upUrl());
+ openNewTab(KIO::upUrl(item.url()));
break;
case DolphinContextMenu::None:
@@ -785,15 +783,18 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos,
break;
}
- delete contextMenu.data();
+ // Delete the menu, unless it has been deleted in its own nested event loop already.
+ if (contextMenu) {
+ contextMenu->deleteLater();
+ }
}
void DolphinMainWindow::updateControlMenu()
{
- KMenu* menu = qobject_cast(sender());
+ QMenu* menu = qobject_cast(sender());
Q_ASSERT(menu);
- // All actions get cleared by KMenu::clear(). The sub-menus are deleted
+ // All actions get cleared by QMenu::clear(). The sub-menus are deleted
// by connecting to the aboutToHide() signal from the parent-menu.
menu->clear();
@@ -835,7 +836,7 @@ void DolphinMainWindow::updateControlMenu()
}
addActionToMenu(ac->action("panels"), menu);
- KMenu* locationBarMenu = new KMenu(i18nc("@action:inmenu", "Location Bar"), menu);
+ QMenu* locationBarMenu = new QMenu(i18nc("@action:inmenu", "Location Bar"), menu);
locationBarMenu->addAction(ac->action("editable_location"));
locationBarMenu->addAction(ac->action("replace_location"));
menu->addMenu(locationBarMenu);
@@ -843,8 +844,8 @@ void DolphinMainWindow::updateControlMenu()
menu->addSeparator();
// Add "Go" menu
- KMenu* goMenu = new KMenu(i18nc("@action:inmenu", "Go"), menu);
- connect(menu, SIGNAL(aboutToHide()), goMenu, SLOT(deleteLater()));
+ QMenu* goMenu = new QMenu(i18nc("@action:inmenu", "Go"), menu);
+ connect(menu, &QMenu::aboutToHide, goMenu, &QMenu::deleteLater);
goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Back)));
goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Forward)));
goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Up)));
@@ -853,8 +854,8 @@ void DolphinMainWindow::updateControlMenu()
menu->addMenu(goMenu);
// Add "Tool" menu
- KMenu* toolsMenu = new KMenu(i18nc("@action:inmenu", "Tools"), menu);
- connect(menu, SIGNAL(aboutToHide()), toolsMenu, SLOT(deleteLater()));
+ QMenu* toolsMenu = new QMenu(i18nc("@action:inmenu", "Tools"), menu);
+ connect(menu, &QMenu::aboutToHide, toolsMenu, &QMenu::deleteLater);
toolsMenu->addAction(ac->action("show_filter_bar"));
toolsMenu->addAction(ac->action("compare_files"));
toolsMenu->addAction(ac->action("open_terminal"));
@@ -867,8 +868,8 @@ void DolphinMainWindow::updateControlMenu()
addActionToMenu(ac->action(KStandardAction::name(KStandardAction::Preferences)), menu);
// Add "Help" menu
- KMenu* helpMenu = new KMenu(i18nc("@action:inmenu", "Help"), menu);
- connect(menu, SIGNAL(aboutToHide()), helpMenu, SLOT(deleteLater()));
+ QMenu* helpMenu = new QMenu(i18nc("@action:inmenu", "Help"), menu);
+ connect(menu, &QMenu::aboutToHide, helpMenu, &QMenu::deleteLater);
helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::HelpContents)));
helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::WhatsThis)));
helpMenu->addSeparator();
@@ -897,12 +898,7 @@ void DolphinMainWindow::slotControlButtonDeleted()
m_updateToolBarTimer->start();
}
-void DolphinMainWindow::slotPanelErrorMessage(const QString& error)
-{
- activeViewContainer()->showMessage(error, DolphinViewContainer::Error);
-}
-
-void DolphinMainWindow::slotPlaceActivated(const KUrl& url)
+void DolphinMainWindow::slotPlaceActivated(const QUrl& url)
{
DolphinViewContainer* view = activeViewContainer();
@@ -945,7 +941,7 @@ void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer)
updateViewActions();
updateGoActions();
- const KUrl url = viewContainer->url();
+ const QUrl url = viewContainer->url();
emit urlChanged(url);
}
@@ -957,51 +953,55 @@ void DolphinMainWindow::tabCountChanged(int count)
actionCollection()->action("activate_prev_tab")->setEnabled(enableTabActions);
}
-void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
+void DolphinMainWindow::setUrlAsCaption(const QUrl& url)
{
QString caption;
if (!url.isLocalFile()) {
- caption.append(url.protocol() + " - ");
- if (url.hasHost()) {
+ caption.append(url.scheme() + " - ");
+ if (!url.host().isEmpty()) {
caption.append(url.host() + " - ");
}
}
- const QString fileName = url.fileName().isEmpty() ? "/" : url.fileName();
+ QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName();
+ if (fileName.isEmpty()) {
+ fileName = '/';
+ }
+
caption.append(fileName);
- setCaption(caption);
+ setWindowTitle(caption);
}
void DolphinMainWindow::setupActions()
{
// setup 'File' menu
m_newFileMenu = new DolphinNewFileMenu(actionCollection(), this);
- KMenu* menu = m_newFileMenu->menu();
+ QMenu* menu = m_newFileMenu->menu();
menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
- menu->setIcon(KIcon("document-new"));
+ menu->setIcon(QIcon::fromTheme("document-new"));
m_newFileMenu->setDelayed(false);
- connect(menu, SIGNAL(aboutToShow()),
- this, SLOT(updateNewMenu()));
+ connect(menu, &QMenu::aboutToShow,
+ this, &DolphinMainWindow::updateNewMenu);
- KAction* newWindow = actionCollection()->addAction("new_window");
- newWindow->setIcon(KIcon("window-new"));
+ QAction* newWindow = actionCollection()->addAction("new_window");
+ newWindow->setIcon(QIcon::fromTheme("window-new"));
newWindow->setText(i18nc("@action:inmenu File", "New &Window"));
- newWindow->setShortcut(Qt::CTRL | Qt::Key_N);
- connect(newWindow, SIGNAL(triggered()), this, SLOT(openNewMainWindow()));
+ actionCollection()->setDefaultShortcut(newWindow, Qt::CTRL | Qt::Key_N);
+ connect(newWindow, &QAction::triggered, this, &DolphinMainWindow::openNewMainWindow);
- KAction* newTab = actionCollection()->addAction("new_tab");
- newTab->setIcon(KIcon("tab-new"));
+ QAction* newTab = actionCollection()->addAction("new_tab");
+ newTab->setIcon(QIcon::fromTheme("tab-new"));
newTab->setText(i18nc("@action:inmenu File", "New Tab"));
- newTab->setShortcut(KShortcut(Qt::CTRL | Qt::Key_T, Qt::CTRL | Qt::SHIFT | Qt::Key_N));
- connect(newTab, SIGNAL(triggered()), this, SLOT(openNewActivatedTab()));
+ actionCollection()->setDefaultShortcuts(newTab, {Qt::CTRL | Qt::Key_T, Qt::CTRL | Qt::SHIFT | Qt::Key_N});
+ connect(newTab, &QAction::triggered, this, static_cast(&DolphinMainWindow::openNewActivatedTab));
- KAction* closeTab = actionCollection()->addAction("close_tab");
- closeTab->setIcon(KIcon("tab-close"));
+ QAction* closeTab = actionCollection()->addAction("close_tab");
+ closeTab->setIcon(QIcon::fromTheme("tab-close"));
closeTab->setText(i18nc("@action:inmenu File", "Close Tab"));
- closeTab->setShortcut(Qt::CTRL | Qt::Key_W);
+ actionCollection()->setDefaultShortcut(closeTab, Qt::CTRL | Qt::Key_W);
closeTab->setEnabled(false);
- connect(closeTab, SIGNAL(triggered()), m_tabWidget, SLOT(closeTab()));
+ connect(closeTab, &QAction::triggered, m_tabWidget, static_cast(&DolphinTabWidget::closeTab));
KStandardAction::quit(this, SLOT(quit()), actionCollection());
@@ -1012,12 +1012,12 @@ void DolphinMainWindow::setupActions()
// need to remove shift+del from cut action, else the shortcut for deletejob
// doesn't work
- KAction* cut = KStandardAction::cut(this, SLOT(cut()), actionCollection());
- KShortcut cutShortcut = cut->shortcut();
- cutShortcut.remove(Qt::SHIFT | Qt::Key_Delete, KShortcut::KeepEmpty);
- cut->setShortcut(cutShortcut);
+ QAction* cut = KStandardAction::cut(this, SLOT(cut()), actionCollection());
+ auto cutShortcuts = cut->shortcuts();
+ cutShortcuts.removeAll(QKeySequence(Qt::SHIFT | Qt::Key_Delete));
+ actionCollection()->setDefaultShortcuts(cut, cutShortcuts);
KStandardAction::copy(this, SLOT(copy()), actionCollection());
- KAction* paste = KStandardAction::paste(this, SLOT(paste()), actionCollection());
+ QAction* paste = KStandardAction::paste(this, SLOT(paste()), actionCollection());
// The text of the paste-action is modified dynamically by Dolphin
// (e. g. to "Paste One Folder"). To prevent that the size of the toolbar changes
// due to the long text, the text "Paste" is used:
@@ -1025,140 +1025,135 @@ void DolphinMainWindow::setupActions()
KStandardAction::find(this, SLOT(find()), actionCollection());
- KAction* selectAll = actionCollection()->addAction("select_all");
+ QAction* selectAll = actionCollection()->addAction("select_all");
selectAll->setText(i18nc("@action:inmenu Edit", "Select All"));
- selectAll->setShortcut(Qt::CTRL | Qt::Key_A);
- connect(selectAll, SIGNAL(triggered()), this, SLOT(selectAll()));
+ actionCollection()->setDefaultShortcut(selectAll, Qt::CTRL | Qt::Key_A);
+ connect(selectAll, &QAction::triggered, this, &DolphinMainWindow::selectAll);
- KAction* invertSelection = actionCollection()->addAction("invert_selection");
+ QAction* invertSelection = actionCollection()->addAction("invert_selection");
invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection"));
- invertSelection->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A);
- connect(invertSelection, SIGNAL(triggered()), this, SLOT(invertSelection()));
+ actionCollection()->setDefaultShortcut(invertSelection, Qt::CTRL | Qt::SHIFT | Qt::Key_A);
+ connect(invertSelection, &QAction::triggered, this, &DolphinMainWindow::invertSelection);
// setup 'View' menu
// (note that most of it is set up in DolphinViewActionHandler)
- KAction* split = actionCollection()->addAction("split_view");
- split->setShortcut(Qt::Key_F3);
- connect(split, SIGNAL(triggered()), this, SLOT(toggleSplitView()));
+ QAction* split = actionCollection()->addAction("split_view");
+ actionCollection()->setDefaultShortcut(split, Qt::Key_F3);
+ connect(split, &QAction::triggered, this, &DolphinMainWindow::toggleSplitView);
- KAction* reload = actionCollection()->addAction("reload");
+ QAction* reload = actionCollection()->addAction("reload");
reload->setText(i18nc("@action:inmenu View", "Reload"));
- reload->setShortcut(Qt::Key_F5);
- reload->setIcon(KIcon("view-refresh"));
- connect(reload, SIGNAL(triggered()), this, SLOT(reloadView()));
+ actionCollection()->setDefaultShortcut(reload, Qt::Key_F5);
+ reload->setIcon(QIcon::fromTheme("view-refresh"));
+ connect(reload, &QAction::triggered, this, &DolphinMainWindow::reloadView);
- KAction* stop = actionCollection()->addAction("stop");
+ QAction* stop = actionCollection()->addAction("stop");
stop->setText(i18nc("@action:inmenu View", "Stop"));
stop->setToolTip(i18nc("@info", "Stop loading"));
- stop->setIcon(KIcon("process-stop"));
- connect(stop, SIGNAL(triggered()), this, SLOT(stopLoading()));
+ stop->setIcon(QIcon::fromTheme("process-stop"));
+ connect(stop, &QAction::triggered, this, &DolphinMainWindow::stopLoading);
KToggleAction* editableLocation = actionCollection()->add("editable_location");
editableLocation->setText(i18nc("@action:inmenu Navigation Bar", "Editable Location"));
- editableLocation->setShortcut(Qt::Key_F6);
- connect(editableLocation, SIGNAL(triggered()), this, SLOT(toggleEditLocation()));
+ actionCollection()->setDefaultShortcut(editableLocation, Qt::Key_F6);
+ connect(editableLocation, &KToggleAction::triggered, this, &DolphinMainWindow::toggleEditLocation);
- KAction* replaceLocation = actionCollection()->addAction("replace_location");
+ QAction* replaceLocation = actionCollection()->addAction("replace_location");
replaceLocation->setText(i18nc("@action:inmenu Navigation Bar", "Replace Location"));
- replaceLocation->setShortcut(Qt::CTRL | Qt::Key_L);
- connect(replaceLocation, SIGNAL(triggered()), this, SLOT(replaceLocation()));
+ actionCollection()->setDefaultShortcut(replaceLocation, Qt::CTRL | Qt::Key_L);
+ connect(replaceLocation, &QAction::triggered, this, &DolphinMainWindow::replaceLocation);
// setup 'Go' menu
- KAction* backAction = KStandardAction::back(this, SLOT(goBack()), actionCollection());
- connect(backAction, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(goBack(Qt::MouseButtons)));
- KShortcut backShortcut = backAction->shortcut();
- backShortcut.setAlternate(Qt::Key_Backspace);
- backAction->setShortcut(backShortcut);
+ QAction* backAction = KStandardAction::back(this, SLOT(goBack()), actionCollection());
+ auto backShortcuts = backAction->shortcuts();
+ backShortcuts.append(QKeySequence(Qt::Key_Backspace));
+ actionCollection()->setDefaultShortcuts(backAction, backShortcuts);
DolphinRecentTabsMenu* recentTabsMenu = new DolphinRecentTabsMenu(this);
actionCollection()->addAction("closed_tabs", recentTabsMenu);
- connect(m_tabWidget, SIGNAL(rememberClosedTab(KUrl,QByteArray)),
- recentTabsMenu, SLOT(rememberClosedTab(KUrl,QByteArray)));
+ connect(m_tabWidget, SIGNAL(rememberClosedTab(QUrl,QByteArray)),
+ recentTabsMenu, SLOT(rememberClosedTab(QUrl,QByteArray)));
connect(recentTabsMenu, SIGNAL(restoreClosedTab(QByteArray)),
m_tabWidget, SLOT(restoreClosedTab(QByteArray)));
connect(recentTabsMenu, SIGNAL(closedTabsCountChanged(uint)),
this, SLOT(closedTabsCountChanged(uint)));
- KAction* undoCloseTab = actionCollection()->addAction("undo_close_tab");
+ QAction* undoCloseTab = actionCollection()->addAction("undo_close_tab");
undoCloseTab->setText(i18nc("@action:inmenu File", "Undo close tab"));
- undoCloseTab->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_T);
- undoCloseTab->setIcon(KIcon("edit-undo"));
+ actionCollection()->setDefaultShortcut(undoCloseTab, Qt::CTRL | Qt::SHIFT | Qt::Key_T);
+ undoCloseTab->setIcon(QIcon::fromTheme("edit-undo"));
undoCloseTab->setEnabled(false);
connect(undoCloseTab, SIGNAL(triggered()), recentTabsMenu, SLOT(undoCloseTab()));
- KAction* forwardAction = KStandardAction::forward(this, SLOT(goForward()), actionCollection());
- connect(forwardAction, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(goForward(Qt::MouseButtons)));
+ auto undoAction = actionCollection()->action(KStandardAction::name(KStandardAction::Undo));
+ undoAction->setEnabled(false); // undo should be disabled by default
- KAction* upAction = KStandardAction::up(this, SLOT(goUp()), actionCollection());
- connect(upAction, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(goUp(Qt::MouseButtons)));
-
- KAction* homeAction = KStandardAction::home(this, SLOT(goHome()), actionCollection());
- connect(homeAction, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this, SLOT(goHome(Qt::MouseButtons)));
+ KStandardAction::forward(this, SLOT(goForward()), actionCollection());
+ KStandardAction::up(this, SLOT(goUp()), actionCollection());
+ KStandardAction::home(this, SLOT(goHome()), actionCollection());
// setup 'Tools' menu
- KAction* showFilterBar = actionCollection()->addAction("show_filter_bar");
+ QAction* showFilterBar = actionCollection()->addAction("show_filter_bar");
showFilterBar->setText(i18nc("@action:inmenu Tools", "Show Filter Bar"));
- showFilterBar->setIcon(KIcon("view-filter"));
- showFilterBar->setShortcut(Qt::CTRL | Qt::Key_I);
- connect(showFilterBar, SIGNAL(triggered()), this, SLOT(showFilterBar()));
+ showFilterBar->setIcon(QIcon::fromTheme("view-filter"));
+ actionCollection()->setDefaultShortcut(showFilterBar, Qt::CTRL | Qt::Key_I);
+ connect(showFilterBar, &QAction::triggered, this, &DolphinMainWindow::showFilterBar);
- KAction* compareFiles = actionCollection()->addAction("compare_files");
+ QAction* compareFiles = actionCollection()->addAction("compare_files");
compareFiles->setText(i18nc("@action:inmenu Tools", "Compare Files"));
- compareFiles->setIcon(KIcon("kompare"));
+ compareFiles->setIcon(QIcon::fromTheme("kompare"));
compareFiles->setEnabled(false);
- connect(compareFiles, SIGNAL(triggered()), this, SLOT(compareFiles()));
+ connect(compareFiles, &QAction::triggered, this, &DolphinMainWindow::compareFiles);
- KAction* openTerminal = actionCollection()->addAction("open_terminal");
+ QAction* openTerminal = actionCollection()->addAction("open_terminal");
openTerminal->setText(i18nc("@action:inmenu Tools", "Open Terminal"));
- openTerminal->setIcon(KIcon("utilities-terminal"));
- openTerminal->setShortcut(Qt::SHIFT | Qt::Key_F4);
- connect(openTerminal, SIGNAL(triggered()), this, SLOT(openTerminal()));
+ openTerminal->setIcon(QIcon::fromTheme("utilities-terminal"));
+ actionCollection()->setDefaultShortcut(openTerminal, Qt::SHIFT | Qt::Key_F4);
+ connect(openTerminal, &QAction::triggered, this, &DolphinMainWindow::openTerminal);
// setup 'Settings' menu
KToggleAction* showMenuBar = KStandardAction::showMenubar(0, 0, actionCollection());
- connect(showMenuBar, SIGNAL(triggered(bool)), // Fixes #286822
- this, SLOT(toggleShowMenuBar()), Qt::QueuedConnection);
+ connect(showMenuBar, &KToggleAction::triggered, // Fixes #286822
+ this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection);
KStandardAction::preferences(this, SLOT(editSettings()), actionCollection());
// not in menu actions
- QList nextTabKeys;
- nextTabKeys.append(KStandardShortcut::tabNext().primary());
+ QList nextTabKeys = KStandardShortcut::tabNext();
nextTabKeys.append(QKeySequence(Qt::CTRL | Qt::Key_Tab));
- QList prevTabKeys;
- prevTabKeys.append(KStandardShortcut::tabPrev().primary());
+ QList prevTabKeys = KStandardShortcut::tabPrev();
prevTabKeys.append(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_Tab));
- KAction* activateNextTab = actionCollection()->addAction("activate_next_tab");
+ QAction* activateNextTab = actionCollection()->addAction("activate_next_tab");
activateNextTab->setIconText(i18nc("@action:inmenu", "Next Tab"));
activateNextTab->setText(i18nc("@action:inmenu", "Activate Next Tab"));
activateNextTab->setEnabled(false);
- connect(activateNextTab, SIGNAL(triggered()), m_tabWidget, SLOT(activateNextTab()));
- activateNextTab->setShortcuts(QApplication::isRightToLeft() ? prevTabKeys : nextTabKeys);
+ connect(activateNextTab, &QAction::triggered, m_tabWidget, &DolphinTabWidget::activateNextTab);
+ actionCollection()->setDefaultShortcuts(activateNextTab, QApplication::isRightToLeft() ? prevTabKeys : nextTabKeys);
- KAction* activatePrevTab = actionCollection()->addAction("activate_prev_tab");
+ QAction* activatePrevTab = actionCollection()->addAction("activate_prev_tab");
activatePrevTab->setIconText(i18nc("@action:inmenu", "Previous Tab"));
activatePrevTab->setText(i18nc("@action:inmenu", "Activate Previous Tab"));
activatePrevTab->setEnabled(false);
- connect(activatePrevTab, SIGNAL(triggered()), m_tabWidget, SLOT(activatePrevTab()));
- activatePrevTab->setShortcuts(QApplication::isRightToLeft() ? nextTabKeys : prevTabKeys);
+ connect(activatePrevTab, &QAction::triggered, m_tabWidget, &DolphinTabWidget::activatePrevTab);
+ actionCollection()->setDefaultShortcuts(activatePrevTab, QApplication::isRightToLeft() ? nextTabKeys : prevTabKeys);
// for context menu
- KAction* openInNewTab = actionCollection()->addAction("open_in_new_tab");
+ QAction* openInNewTab = actionCollection()->addAction("open_in_new_tab");
openInNewTab->setText(i18nc("@action:inmenu", "Open in New Tab"));
- openInNewTab->setIcon(KIcon("tab-new"));
- connect(openInNewTab, SIGNAL(triggered()), this, SLOT(openInNewTab()));
+ openInNewTab->setIcon(QIcon::fromTheme("tab-new"));
+ connect(openInNewTab, &QAction::triggered, this, &DolphinMainWindow::openInNewTab);
- KAction* openInNewTabs = actionCollection()->addAction("open_in_new_tabs");
+ QAction* openInNewTabs = actionCollection()->addAction("open_in_new_tabs");
openInNewTabs->setText(i18nc("@action:inmenu", "Open in New Tabs"));
- openInNewTabs->setIcon(KIcon("tab-new"));
- connect(openInNewTabs, SIGNAL(triggered()), this, SLOT(openInNewTab()));
+ openInNewTabs->setIcon(QIcon::fromTheme("tab-new"));
+ connect(openInNewTabs, &QAction::triggered, this, &DolphinMainWindow::openInNewTab);
- KAction* openInNewWindow = actionCollection()->addAction("open_in_new_window");
+ QAction* openInNewWindow = actionCollection()->addAction("open_in_new_window");
openInNewWindow->setText(i18nc("@action:inmenu", "Open in New Window"));
- openInNewWindow->setIcon(KIcon("window-new"));
- connect(openInNewWindow, SIGNAL(triggered()), this, SLOT(openInNewWindow()));
+ openInNewWindow->setIcon(QIcon::fromTheme("window-new"));
+ connect(openInNewWindow, &QAction::triggered, this, &DolphinMainWindow::openInNewWindow);
}
void DolphinMainWindow::setupDockWidgets()
@@ -1167,32 +1162,32 @@ void DolphinMainWindow::setupDockWidgets()
KDualAction* lockLayoutAction = actionCollection()->add("lock_panels");
lockLayoutAction->setActiveText(i18nc("@action:inmenu Panels", "Unlock Panels"));
- lockLayoutAction->setActiveIcon(KIcon("object-unlocked"));
+ lockLayoutAction->setActiveIcon(QIcon::fromTheme("object-unlocked"));
lockLayoutAction->setInactiveText(i18nc("@action:inmenu Panels", "Lock Panels"));
- lockLayoutAction->setInactiveIcon(KIcon("object-locked"));
+ lockLayoutAction->setInactiveIcon(QIcon::fromTheme("object-locked"));
lockLayoutAction->setActive(lock);
- connect(lockLayoutAction, SIGNAL(triggered()), this, SLOT(togglePanelLockState()));
+ connect(lockLayoutAction, &KDualAction::triggered, this, &DolphinMainWindow::togglePanelLockState);
// Setup "Information"
DolphinDockWidget* infoDock = new DolphinDockWidget(i18nc("@title:window", "Information"));
infoDock->setLocked(lock);
infoDock->setObjectName("infoDock");
infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
- Panel* infoPanel = new InformationPanel(infoDock);
- infoPanel->setCustomContextMenuActions(QList() << lockLayoutAction);
- connect(infoPanel, SIGNAL(urlActivated(KUrl)), this, SLOT(handleUrl(KUrl)));
+ InformationPanel* infoPanel = new InformationPanel(infoDock);
+ infoPanel->setCustomContextMenuActions({lockLayoutAction});
+ connect(infoPanel, &InformationPanel::urlActivated, this, &DolphinMainWindow::handleUrl);
infoDock->setWidget(infoPanel);
QAction* infoAction = infoDock->toggleViewAction();
- createPanelAction(KIcon("dialog-information"), Qt::Key_F11, infoAction, "show_information_panel");
+ createPanelAction(QIcon::fromTheme("dialog-information"), Qt::Key_F11, infoAction, "show_information_panel");
addDockWidget(Qt::RightDockWidgetArea, infoDock);
- connect(this, SIGNAL(urlChanged(KUrl)),
- infoPanel, SLOT(setUrl(KUrl)));
- connect(this, SIGNAL(selectionChanged(KFileItemList)),
- infoPanel, SLOT(setSelection(KFileItemList)));
- connect(this, SIGNAL(requestItemInfo(KFileItem)),
- infoPanel, SLOT(requestDelayedItemInfo(KFileItem)));
+ connect(this, &DolphinMainWindow::urlChanged,
+ infoPanel, &InformationPanel::setUrl);
+ connect(this, &DolphinMainWindow::selectionChanged,
+ infoPanel, &InformationPanel::setSelection);
+ connect(this, &DolphinMainWindow::requestItemInfo,
+ infoPanel, &InformationPanel::requestDelayedItemInfo);
// Setup "Folders"
DolphinDockWidget* foldersDock = new DolphinDockWidget(i18nc("@title:window", "Folders"));
@@ -1200,21 +1195,21 @@ void DolphinMainWindow::setupDockWidgets()
foldersDock->setObjectName("foldersDock");
foldersDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
FoldersPanel* foldersPanel = new FoldersPanel(foldersDock);
- foldersPanel->setCustomContextMenuActions(QList() << lockLayoutAction);
+ foldersPanel->setCustomContextMenuActions({lockLayoutAction});
foldersDock->setWidget(foldersPanel);
QAction* foldersAction = foldersDock->toggleViewAction();
- createPanelAction(KIcon("folder"), Qt::Key_F7, foldersAction, "show_folders_panel");
+ createPanelAction(QIcon::fromTheme("folder"), Qt::Key_F7, foldersAction, "show_folders_panel");
addDockWidget(Qt::LeftDockWidgetArea, foldersDock);
- connect(this, SIGNAL(urlChanged(KUrl)),
- foldersPanel, SLOT(setUrl(KUrl)));
- connect(foldersPanel, SIGNAL(folderActivated(KUrl)),
- this, SLOT(changeUrl(KUrl)));
- connect(foldersPanel, SIGNAL(folderMiddleClicked(KUrl)),
- this, SLOT(openNewTab(KUrl)));
- connect(foldersPanel, SIGNAL(errorMessage(QString)),
- this, SLOT(slotPanelErrorMessage(QString)));
+ connect(this, &DolphinMainWindow::urlChanged,
+ foldersPanel, &FoldersPanel::setUrl);
+ connect(foldersPanel, &FoldersPanel::folderActivated,
+ this, &DolphinMainWindow::changeUrl);
+ connect(foldersPanel, &FoldersPanel::folderMiddleClicked,
+ this, &DolphinMainWindow::openNewTab);
+ connect(foldersPanel, &FoldersPanel::errorMessage,
+ this, &DolphinMainWindow::showErrorMessage);
// Setup "Terminal"
#ifndef Q_OS_WIN
@@ -1222,21 +1217,21 @@ void DolphinMainWindow::setupDockWidgets()
terminalDock->setLocked(lock);
terminalDock->setObjectName("terminalDock");
terminalDock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
- Panel* terminalPanel = new TerminalPanel(terminalDock);
- terminalPanel->setCustomContextMenuActions(QList() << lockLayoutAction);
+ TerminalPanel* terminalPanel = new TerminalPanel(terminalDock);
+ terminalPanel->setCustomContextMenuActions({lockLayoutAction});
terminalDock->setWidget(terminalPanel);
- connect(terminalPanel, SIGNAL(hideTerminalPanel()), terminalDock, SLOT(hide()));
- connect(terminalPanel, SIGNAL(changeUrl(KUrl)), this, SLOT(slotTerminalDirectoryChanged(KUrl)));
- connect(terminalDock, SIGNAL(visibilityChanged(bool)),
- terminalPanel, SLOT(dockVisibilityChanged()));
+ connect(terminalPanel, &TerminalPanel::hideTerminalPanel, terminalDock, &DolphinDockWidget::hide);
+ connect(terminalPanel, &TerminalPanel::changeUrl, this, &DolphinMainWindow::slotTerminalDirectoryChanged);
+ connect(terminalDock, &DolphinDockWidget::visibilityChanged,
+ terminalPanel, &TerminalPanel::dockVisibilityChanged);
QAction* terminalAction = terminalDock->toggleViewAction();
- createPanelAction(KIcon("utilities-terminal"), Qt::Key_F4, terminalAction, "show_terminal_panel");
+ createPanelAction(QIcon::fromTheme("utilities-terminal"), Qt::Key_F4, terminalAction, "show_terminal_panel");
addDockWidget(Qt::BottomDockWidgetArea, terminalDock);
- connect(this, SIGNAL(urlChanged(KUrl)),
- terminalPanel, SLOT(setUrl(KUrl)));
+ connect(this, &DolphinMainWindow::urlChanged,
+ terminalPanel, &TerminalPanel::setUrl);
#endif
if (GeneralSettings::version() < 200) {
@@ -1254,25 +1249,25 @@ void DolphinMainWindow::setupDockWidgets()
placesDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
PlacesPanel* placesPanel = new PlacesPanel(placesDock);
- placesPanel->setCustomContextMenuActions(QList() << lockLayoutAction);
+ placesPanel->setCustomContextMenuActions({lockLayoutAction});
placesDock->setWidget(placesPanel);
QAction* placesAction = placesDock->toggleViewAction();
- createPanelAction(KIcon("bookmarks"), Qt::Key_F9, placesAction, "show_places_panel");
+ createPanelAction(QIcon::fromTheme("bookmarks"), Qt::Key_F9, placesAction, "show_places_panel");
addDockWidget(Qt::LeftDockWidgetArea, placesDock);
- connect(placesPanel, SIGNAL(placeActivated(KUrl)),
- this, SLOT(slotPlaceActivated(KUrl)));
- connect(placesPanel, SIGNAL(placeMiddleClicked(KUrl)),
- this, SLOT(openNewTab(KUrl)));
- connect(placesPanel, SIGNAL(errorMessage(QString)),
- this, SLOT(slotPanelErrorMessage(QString)));
- connect(this, SIGNAL(urlChanged(KUrl)),
- placesPanel, SLOT(setUrl(KUrl)));
- connect(placesDock, SIGNAL(visibilityChanged(bool)),
- m_tabWidget, SLOT(slotPlacesPanelVisibilityChanged(bool)));
- connect(this, SIGNAL(settingsChanged()),
- placesPanel, SLOT(readSettings()));
+ connect(placesPanel, &PlacesPanel::placeActivated,
+ this, &DolphinMainWindow::slotPlaceActivated);
+ connect(placesPanel, SIGNAL(placeMiddleClicked(QUrl)),
+ this, SLOT(openNewTab(QUrl)));
+ connect(placesPanel, &PlacesPanel::errorMessage,
+ this, &DolphinMainWindow::showErrorMessage);
+ connect(this, &DolphinMainWindow::urlChanged,
+ placesPanel, &PlacesPanel::setUrl);
+ connect(placesDock, &DolphinDockWidget::visibilityChanged,
+ m_tabWidget, &DolphinTabWidget::slotPlacesPanelVisibilityChanged);
+ connect(this, &DolphinMainWindow::settingsChanged,
+ placesPanel, &PlacesPanel::readSettings);
m_tabWidget->slotPlacesPanelVisibilityChanged(placesPanel->isVisible());
@@ -1334,8 +1329,8 @@ void DolphinMainWindow::updateViewActions()
void DolphinMainWindow::updateGoActions()
{
QAction* goUpAction = actionCollection()->action(KStandardAction::name(KStandardAction::Up));
- const KUrl currentUrl = m_activeViewContainer->url();
- goUpAction->setEnabled(currentUrl.upUrl() != currentUrl);
+ const QUrl currentUrl = m_activeViewContainer->url();
+ goUpAction->setEnabled(KIO::upUrl(currentUrl) != currentUrl);
}
void DolphinMainWindow::createControlButton()
@@ -1346,29 +1341,29 @@ void DolphinMainWindow::createControlButton()
Q_ASSERT(!m_controlButton);
m_controlButton = new QToolButton(this);
- m_controlButton->setIcon(KIcon("applications-system"));
+ m_controlButton->setIcon(QIcon::fromTheme("applications-system"));
m_controlButton->setText(i18nc("@action", "Control"));
m_controlButton->setPopupMode(QToolButton::InstantPopup);
m_controlButton->setToolButtonStyle(toolBar()->toolButtonStyle());
- KMenu* controlMenu = new KMenu(m_controlButton);
- connect(controlMenu, SIGNAL(aboutToShow()), this, SLOT(updateControlMenu()));
+ QMenu* controlMenu = new QMenu(m_controlButton);
+ connect(controlMenu, &QMenu::aboutToShow, this, &DolphinMainWindow::updateControlMenu);
m_controlButton->setMenu(controlMenu);
toolBar()->addWidget(m_controlButton);
- connect(toolBar(), SIGNAL(iconSizeChanged(QSize)),
- m_controlButton, SLOT(setIconSize(QSize)));
- connect(toolBar(), SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)),
- m_controlButton, SLOT(setToolButtonStyle(Qt::ToolButtonStyle)));
+ connect(toolBar(), &KToolBar::iconSizeChanged,
+ m_controlButton, &QToolButton::setIconSize);
+ connect(toolBar(), &KToolBar::toolButtonStyleChanged,
+ m_controlButton, &QToolButton::setToolButtonStyle);
// The added widgets are owned by the toolbar and may get deleted when e.g. the toolbar
// gets edited. In this case we must add them again. The adding is done asynchronously by
// m_updateToolBarTimer.
- connect(m_controlButton, SIGNAL(destroyed()), this, SLOT(slotControlButtonDeleted()));
+ connect(m_controlButton, &QToolButton::destroyed, this, &DolphinMainWindow::slotControlButtonDeleted);
m_updateToolBarTimer = new QTimer(this);
m_updateToolBarTimer->setInterval(500);
- connect(m_updateToolBarTimer, SIGNAL(timeout()), this, SLOT(updateToolBar()));
+ connect(m_updateToolBarTimer, &QTimer::timeout, this, &DolphinMainWindow::updateToolBar);
}
void DolphinMainWindow::deleteControlButton()
@@ -1380,7 +1375,7 @@ void DolphinMainWindow::deleteControlButton()
m_updateToolBarTimer = 0;
}
-bool DolphinMainWindow::addActionToMenu(QAction* action, KMenu* menu)
+bool DolphinMainWindow::addActionToMenu(QAction* action, QMenu* menu)
{
Q_ASSERT(action);
Q_ASSERT(menu);
@@ -1418,38 +1413,40 @@ void DolphinMainWindow::clearStatusBar()
void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
{
- connect(container, SIGNAL(showFilterBarChanged(bool)),
- this, SLOT(updateFilterBarAction(bool)));
- connect(container, SIGNAL(writeStateChanged(bool)),
- this, SLOT(slotWriteStateChanged(bool)));
+ connect(container, &DolphinViewContainer::showFilterBarChanged,
+ this, &DolphinMainWindow::updateFilterBarAction);
+ connect(container, &DolphinViewContainer::writeStateChanged,
+ this, &DolphinMainWindow::slotWriteStateChanged);
const DolphinView* view = container->view();
- connect(view, SIGNAL(selectionChanged(KFileItemList)),
- this, SLOT(slotSelectionChanged(KFileItemList)));
- connect(view, SIGNAL(requestItemInfo(KFileItem)),
- this, SLOT(slotRequestItemInfo(KFileItem)));
- connect(view, SIGNAL(tabRequested(KUrl)),
- this, SLOT(openNewTab(KUrl)));
- connect(view, SIGNAL(requestContextMenu(QPoint,KFileItem,KUrl,QList)),
- this, SLOT(openContextMenu(QPoint,KFileItem,KUrl,QList)));
- connect(view, SIGNAL(directoryLoadingStarted()),
- this, SLOT(enableStopAction()));
- connect(view, SIGNAL(directoryLoadingCompleted()),
- this, SLOT(disableStopAction()));
- connect(view, SIGNAL(goBackRequested()),
- this, SLOT(goBack()));
- connect(view, SIGNAL(goForwardRequested()),
- this, SLOT(goForward()));
+ connect(view, &DolphinView::selectionChanged,
+ this, &DolphinMainWindow::slotSelectionChanged);
+ connect(view, &DolphinView::requestItemInfo,
+ this, &DolphinMainWindow::requestItemInfo);
+ connect(view, &DolphinView::tabRequested,
+ this, &DolphinMainWindow::openNewTab);
+ connect(view, &DolphinView::requestContextMenu,
+ this, &DolphinMainWindow::openContextMenu);
+ connect(view, &DolphinView::directoryLoadingStarted,
+ this, &DolphinMainWindow::enableStopAction);
+ connect(view, &DolphinView::directoryLoadingCompleted,
+ this, &DolphinMainWindow::disableStopAction);
+ connect(view, &DolphinView::directoryLoadingCompleted,
+ this, &DolphinMainWindow::slotDirectoryLoadingCompleted);
+ connect(view, &DolphinView::goBackRequested,
+ this, static_cast(&DolphinMainWindow::goBack));
+ connect(view, &DolphinView::goForwardRequested,
+ this, static_cast(&DolphinMainWindow::goForward));
const KUrlNavigator* navigator = container->urlNavigator();
- connect(navigator, SIGNAL(urlChanged(KUrl)),
- this, SLOT(changeUrl(KUrl)));
- connect(navigator, SIGNAL(historyChanged()),
- this, SLOT(updateHistory()));
- connect(navigator, SIGNAL(editableStateChanged(bool)),
- this, SLOT(slotEditableStateChanged(bool)));
- connect(navigator, SIGNAL(tabRequested(KUrl)),
- this, SLOT(openNewTab(KUrl)));
+ connect(navigator, &KUrlNavigator::urlChanged,
+ this, &DolphinMainWindow::changeUrl);
+ connect(navigator, &KUrlNavigator::historyChanged,
+ this, &DolphinMainWindow::updateHistory);
+ connect(navigator, &KUrlNavigator::editableStateChanged,
+ this, &DolphinMainWindow::slotEditableStateChanged);
+ connect(navigator, &KUrlNavigator::tabRequested,
+ this, &DolphinMainWindow::openNewTab);
}
void DolphinMainWindow::updateSplitAction()
@@ -1460,16 +1457,16 @@ void DolphinMainWindow::updateSplitAction()
if (tabPage->primaryViewActive()) {
splitAction->setText(i18nc("@action:intoolbar Close left view", "Close"));
splitAction->setToolTip(i18nc("@info", "Close left view"));
- splitAction->setIcon(KIcon("view-left-close"));
+ splitAction->setIcon(QIcon::fromTheme("view-left-close"));
} else {
splitAction->setText(i18nc("@action:intoolbar Close right view", "Close"));
splitAction->setToolTip(i18nc("@info", "Close right view"));
- splitAction->setIcon(KIcon("view-right-close"));
+ splitAction->setIcon(QIcon::fromTheme("view-right-close"));
}
} else {
splitAction->setText(i18nc("@action:intoolbar Split view", "Split"));
splitAction->setToolTip(i18nc("@info", "Split view"));
- splitAction->setIcon(KIcon("view-right-new"));
+ splitAction->setIcon(QIcon::fromTheme("view-right-new"));
}
}
@@ -1480,26 +1477,26 @@ bool DolphinMainWindow::isKompareInstalled() const
if (!initialized) {
// TODO: maybe replace this approach later by using a menu
// plugin like kdiff3plugin.cpp
- installed = !KGlobal::dirs()->findExe("kompare").isEmpty();
+ installed = !QStandardPaths::findExecutable(QStringLiteral("kompare")).isEmpty();
initialized = true;
}
return installed;
}
-void DolphinMainWindow::createPanelAction(const KIcon& icon,
+void DolphinMainWindow::createPanelAction(const QIcon& icon,
const QKeySequence& shortcut,
QAction* dockAction,
const QString& actionName)
{
- KAction* panelAction = actionCollection()->addAction(actionName);
+ QAction* panelAction = actionCollection()->addAction(actionName);
panelAction->setCheckable(true);
panelAction->setChecked(dockAction->isChecked());
panelAction->setText(dockAction->text());
panelAction->setIcon(icon);
- panelAction->setShortcut(shortcut);
+ actionCollection()->setDefaultShortcut(panelAction, shortcut);
- connect(panelAction, SIGNAL(triggered()), dockAction, SLOT(trigger()));
- connect(dockAction, SIGNAL(toggled(bool)), panelAction, SLOT(setChecked(bool)));
+ connect(panelAction, &QAction::triggered, dockAction, &QAction::trigger);
+ connect(dockAction, &QAction::toggled, panelAction, &QAction::setChecked);
}
DolphinMainWindow::UndoUiInterface::UndoUiInterface() :
@@ -1522,4 +1519,3 @@ void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job)
}
}
-#include "dolphinmainwindow.moc"
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h
index 9d4c003af7..5066657ef8 100644
--- a/src/dolphinmainwindow.h
+++ b/src/dolphinmainwindow.h
@@ -24,30 +24,28 @@
#include
-#include
#include
#include
#include
-#include
+#include
+#include
#include
-#include
+#include
typedef KIO::FileUndoManager::CommandType CommandType;
class DolphinViewActionHandler;
-class DolphinApplication;
class DolphinSettingsDialog;
class DolphinViewContainer;
class DolphinRemoteEncoding;
class DolphinTabWidget;
-class KAction;
class KFileItem;
class KFileItemList;
class KJob;
class KNewFileMenu;
-class KUrl;
class QToolButton;
+class QIcon;
/**
* @short Main window for Dolphin.
@@ -59,7 +57,6 @@ class DolphinMainWindow: public KXmlGuiWindow
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.dolphin.MainWindow")
Q_PROPERTY(int id READ getId SCRIPTABLE true)
- friend class DolphinApplication;
public:
DolphinMainWindow();
@@ -77,14 +74,14 @@ public:
* Opens each directory in \p dirs in a separate tab. If the "split view"
* option is enabled, 2 directories are collected within one tab.
*/
- void openDirectories(const QList& dirs);
+ void openDirectories(const QList &dirs);
/**
* Opens the directory which contains the files \p files
* and selects all files (implements the --select option
* of Dolphin).
*/
- void openFiles(const QList& files);
+ void openFiles(const QList& files);
/**
* Returns the 'Create New...' sub menu which also can be shared
@@ -110,18 +107,23 @@ public slots:
* Inform all affected dolphin components (panels, views) of an URL
* change.
*/
- void changeUrl(const KUrl& url);
+ void changeUrl(const QUrl& url);
/**
* The current directory of the Terminal Panel has changed, probably because
* the user entered a 'cd' command. This slot calls changeUrl(url) and makes
* sure that the panel keeps the keyboard focus.
*/
- void slotTerminalDirectoryChanged(const KUrl& url);
+ void slotTerminalDirectoryChanged(const QUrl& url);
/** Stores all settings and quits Dolphin. */
void quit();
+ /**
+ * Opens a new tab showing the URL \a url and activates the tab.
+ */
+ void openNewActivatedTab(const QUrl& url);
+
signals:
/**
* Is sent if the selection of the currently active view has
@@ -133,7 +135,7 @@ signals:
* Is sent if the url of the currently active view has
* been changed.
*/
- void urlChanged(const KUrl& url);
+ void urlChanged(const QUrl& url);
/**
* Is emitted if information of an item is requested to be shown e. g. in the panel.
@@ -148,16 +150,16 @@ signals:
protected:
/** @see QWidget::showEvent() */
- virtual void showEvent(QShowEvent* event);
+ virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
/** @see QMainWindow::closeEvent() */
- virtual void closeEvent(QCloseEvent* event);
+ virtual void closeEvent(QCloseEvent* event) Q_DECL_OVERRIDE;
/** @see KMainWindow::saveProperties() */
- virtual void saveProperties(KConfigGroup& group);
+ virtual void saveProperties(KConfigGroup& group) Q_DECL_OVERRIDE;
/** @see KMainWindow::readProperties() */
- virtual void readProperties(const KConfigGroup& group);
+ virtual void readProperties(const KConfigGroup& group) Q_DECL_OVERRIDE;
private slots:
/**
@@ -313,9 +315,6 @@ private slots:
*/
void slotSelectionChanged(const KFileItemList& selection);
- /** Emits the signal requestItemInfo(). */
- void slotRequestItemInfo(const KFileItem&);
-
/**
* Updates the state of the 'Back' and 'Forward' menu
* actions corresponding to the current history.
@@ -335,16 +334,9 @@ private slots:
void openNewActivatedTab();
/**
- * Opens a new tab in the background showing the URL \a primaryUrl and the
- * optional URL \a secondaryUrl.
+ * Opens a new tab in the background showing the URL \a url.
*/
- void openNewTab(const KUrl& primaryUrl, const KUrl& secondaryUrl = KUrl());
-
- /**
- * Opens a new tab showing the URL \a primaryUrl and the optional URL
- * \a secondaryUrl and activates the tab.
- */
- void openNewActivatedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl = KUrl());
+ void openNewTab(const QUrl& url);
/**
* Opens the selected folder in a new tab.
@@ -366,7 +358,7 @@ private slots:
* If the URL can be listed, open it in the current view, otherwise
* run it through KRun.
*/
- void handleUrl(const KUrl& url);
+ void handleUrl(const QUrl& url);
/**
* handleUrl() can trigger a stat job to see if the url can actually
@@ -391,25 +383,19 @@ private slots:
*/
void openContextMenu(const QPoint& pos,
const KFileItem& item,
- const KUrl& url,
+ const QUrl& url,
const QList& customActions);
void updateControlMenu();
void updateToolBar();
void slotControlButtonDeleted();
- /**
- * Is called if a panel emits an error-message and shows
- * the error-message in the active view-container.
- */
- void slotPanelErrorMessage(const QString& error);
-
/**
* Is called if the user clicked an item in the Places Panel.
* Reloads the view if \a url is the current URL already, and changes the
* current URL otherwise.
*/
- void slotPlaceActivated(const KUrl& url);
+ void slotPlaceActivated(const QUrl& url);
/**
* Is called if the another view has been activated by changing the current
@@ -433,7 +419,12 @@ private slots:
* Sets the window caption to url.fileName() if this is non-empty,
* "/" if the URL is "file:///", and url.protocol() otherwise.
*/
- void setUrlAsCaption(const KUrl& url);
+ void setUrlAsCaption(const QUrl& url);
+
+ /**
+ * Is called when the view has finished loading the directory.
+ */
+ void slotDirectoryLoadingCompleted();
private:
void setupActions();
@@ -450,7 +441,7 @@ private:
* case if it has not added already to the toolbar.
* @return True if the action has been added to the menu.
*/
- bool addActionToMenu(QAction* action, KMenu* menu);
+ bool addActionToMenu(QAction* action, QMenu* menu);
/**
* Connects the signals from the created DolphinView with
@@ -476,7 +467,7 @@ private:
* as the action for toggling the dock visibility is done by Qt which
* is no KAction instance.
*/
- void createPanelAction(const KIcon& icon,
+ void createPanelAction(const QIcon &icon,
const QKeySequence& shortcut,
QAction* dockAction,
const QString& actionName);
@@ -492,7 +483,7 @@ private:
public:
UndoUiInterface();
virtual ~UndoUiInterface();
- virtual void jobError(KIO::Job* job);
+ virtual void jobError(KIO::Job* job) Q_DECL_OVERRIDE;
};
KNewFileMenu* m_newFileMenu;
@@ -502,7 +493,7 @@ private:
DolphinViewActionHandler* m_actionHandler;
DolphinRemoteEncoding* m_remoteEncoding;
- QWeakPointer m_settingsDialog;
+ QPointer m_settingsDialog;
// Members for the toolbar menu that is shown when the menubar is hidden:
QToolButton* m_controlButton;
diff --git a/src/dolphinnewfilemenu.cpp b/src/dolphinnewfilemenu.cpp
index da57ca946f..87f0932d87 100644
--- a/src/dolphinnewfilemenu.cpp
+++ b/src/dolphinnewfilemenu.cpp
@@ -45,4 +45,3 @@ void DolphinNewFileMenu::slotResult(KJob* job)
}
}
-#include "dolphinnewfilemenu.moc"
diff --git a/src/dolphinnewfilemenu.h b/src/dolphinnewfilemenu.h
index e211dfd881..9f1cb55991 100644
--- a/src/dolphinnewfilemenu.h
+++ b/src/dolphinnewfilemenu.h
@@ -23,7 +23,7 @@
#include
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
class KJob;
@@ -35,7 +35,7 @@ class KJob;
* All errors are shown in the status bar of Dolphin
* instead as modal error dialog with an OK button.
*/
-class LIBDOLPHINPRIVATE_EXPORT DolphinNewFileMenu : public KNewFileMenu
+class DOLPHIN_EXPORT DolphinNewFileMenu : public KNewFileMenu
{
Q_OBJECT
@@ -48,7 +48,7 @@ signals:
protected slots:
/** @see KNewFileMenu::slotResult() */
- virtual void slotResult(KJob* job);
+ virtual void slotResult(KJob* job) Q_DECL_OVERRIDE;
};
#endif
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp
index 9081731933..ea0ffd92c6 100644
--- a/src/dolphinpart.cpp
+++ b/src/dolphinpart.cpp
@@ -21,31 +21,25 @@
#include "dolphinremoveaction.h"
#include
-#include
#include
#include
-#include
-#include
-#include
+#include "dolphindebug.h"
#include
-#include
+#include
#include
#include
#include
-#include
-#include
#include
#include
-#include
-#include
-#include
+#include
#include
+#include
+#include
+#include
+#include
-#if KDE_IS_VERSION(4, 9, 2)
#include "dolphinpart_ext.h"
-#endif
-
#include "dolphinnewfilemenu.h"
#include "views/dolphinview.h"
#include "views/dolphinviewactionhandler.h"
@@ -54,14 +48,16 @@
#include "kitemviews/kfileitemmodel.h"
#include "kitemviews/private/kfileitemmodeldirlister.h"
+#include
#include
+#include
#include
#include
#include
-#include
+#include
+#include
K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin();)
-K_EXPORT_PLUGIN(DolphinPartFactory("dolphinpart", "dolphin"))
DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args)
: KParts::ReadOnlyPart(parent)
@@ -69,83 +65,81 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
,m_removeAction(0)
{
Q_UNUSED(args)
- setComponentData(DolphinPartFactory::componentData(), false);
+ setComponentData(*createAboutData(), false);
m_extension = new DolphinPartBrowserExtension(this);
// make sure that other apps using this part find Dolphin's view-file-columns icons
KIconLoader::global()->addAppDir("dolphin");
- m_view = new DolphinView(KUrl(), parentWidget);
+ m_view = new DolphinView(QUrl(), parentWidget);
m_view->setTabsForFilesEnabled(true);
setWidget(m_view);
- connect(&DolphinNewFileMenuObserver::instance(), SIGNAL(errorMessage(QString)),
- this, SLOT(slotErrorMessage(QString)));
+ connect(&DolphinNewFileMenuObserver::instance(), &DolphinNewFileMenuObserver::errorMessage,
+ this, &DolphinPart::slotErrorMessage);
- connect(m_view, SIGNAL(directoryLoadingCompleted()), this, SIGNAL(completed()));
- connect(m_view, SIGNAL(directoryLoadingProgress(int)), this, SLOT(updateProgress(int)));
- connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(slotErrorMessage(QString)));
+ connect(m_view, &DolphinView::directoryLoadingCompleted, this, static_cast(&DolphinPart::completed));
+ connect(m_view, &DolphinView::directoryLoadingProgress, this, &DolphinPart::updateProgress);
+ connect(m_view, &DolphinView::errorMessage, this, &DolphinPart::slotErrorMessage);
setXMLFile("dolphinpart.rc");
- connect(m_view, SIGNAL(infoMessage(QString)),
- this, SLOT(slotMessage(QString)));
- connect(m_view, SIGNAL(operationCompletedMessage(QString)),
- this, SLOT(slotMessage(QString)));
- connect(m_view, SIGNAL(errorMessage(QString)),
- this, SLOT(slotErrorMessage(QString)));
- connect(m_view, SIGNAL(itemActivated(KFileItem)),
- this, SLOT(slotItemActivated(KFileItem)));
- connect(m_view, SIGNAL(itemsActivated(KFileItemList)),
- this, SLOT(slotItemsActivated(KFileItemList)));
- connect(m_view, SIGNAL(tabRequested(KUrl)),
- this, SLOT(createNewWindow(KUrl)));
- connect(m_view, SIGNAL(requestContextMenu(QPoint,KFileItem,KUrl,QList)),
- this, SLOT(slotOpenContextMenu(QPoint,KFileItem,KUrl,QList)));
- connect(m_view, SIGNAL(selectionChanged(KFileItemList)),
- m_extension, SIGNAL(selectionInfo(KFileItemList)));
- connect(m_view, SIGNAL(selectionChanged(KFileItemList)),
- this, SLOT(slotSelectionChanged(KFileItemList)));
- connect(m_view, SIGNAL(requestItemInfo(KFileItem)),
- this, SLOT(slotRequestItemInfo(KFileItem)));
- connect(m_view, SIGNAL(modeChanged(DolphinView::Mode,DolphinView::Mode)),
- this, SIGNAL(viewModeChanged())); // relay signal
- connect(m_view, SIGNAL(redirection(KUrl,KUrl)),
- this, SLOT(slotDirectoryRedirection(KUrl,KUrl)));
+ connect(m_view, &DolphinView::infoMessage,
+ this, &DolphinPart::slotMessage);
+ connect(m_view, &DolphinView::operationCompletedMessage,
+ this, &DolphinPart::slotMessage);
+ connect(m_view, &DolphinView::errorMessage,
+ this, &DolphinPart::slotErrorMessage);
+ connect(m_view, &DolphinView::itemActivated,
+ this, &DolphinPart::slotItemActivated);
+ connect(m_view, &DolphinView::itemsActivated,
+ this, &DolphinPart::slotItemsActivated);
+ connect(m_view, &DolphinView::tabRequested,
+ this, &DolphinPart::createNewWindow);
+ connect(m_view, &DolphinView::requestContextMenu,
+ this, &DolphinPart::slotOpenContextMenu);
+ connect(m_view, &DolphinView::selectionChanged,
+ m_extension, static_cast(&DolphinPartBrowserExtension::selectionInfo));
+ connect(m_view, &DolphinView::selectionChanged,
+ this, &DolphinPart::slotSelectionChanged);
+ connect(m_view, &DolphinView::requestItemInfo,
+ this, &DolphinPart::slotRequestItemInfo);
+ connect(m_view, &DolphinView::modeChanged,
+ this, &DolphinPart::viewModeChanged); // relay signal
+ connect(m_view, &DolphinView::redirection,
+ this, &DolphinPart::slotDirectoryRedirection);
// Watch for changes that should result in updates to the
// status bar text.
- connect(m_view, SIGNAL(itemCountChanged()), this, SLOT(updateStatusBar()));
- connect(m_view, SIGNAL(selectionChanged(KFileItemList)), this, SLOT(updateStatusBar()));
+ connect(m_view, &DolphinView::itemCountChanged, this, &DolphinPart::updateStatusBar);
+ connect(m_view, &DolphinView::selectionChanged, this, &DolphinPart::updateStatusBar);
m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
m_actionHandler->setCurrentView(m_view);
- connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory()));
+ connect(m_actionHandler, &DolphinViewActionHandler::createDirectory, this, &DolphinPart::createDirectory);
m_remoteEncoding = new DolphinRemoteEncoding(this, m_actionHandler);
- connect(this, SIGNAL(aboutToOpenURL()),
- m_remoteEncoding, SLOT(slotAboutToOpenUrl()));
+ connect(this, &DolphinPart::aboutToOpenURL,
+ m_remoteEncoding, &DolphinRemoteEncoding::slotAboutToOpenUrl);
QClipboard* clipboard = QApplication::clipboard();
- connect(clipboard, SIGNAL(dataChanged()),
- this, SLOT(updatePasteAction()));
+ connect(clipboard, &QClipboard::dataChanged,
+ this, &DolphinPart::updatePasteAction);
// Create file info and listing filter extensions.
// NOTE: Listing filter needs to be instantiated after the creation of the view.
new DolphinPartFileInfoExtension(this);
-#if KDE_IS_VERSION(4, 9, 2)
new DolphinPartListingFilterExtension(this);
KDirLister* lister = m_view->m_model->m_dirLister;
if (lister) {
DolphinPartListingNotificationExtension* notifyExt = new DolphinPartListingNotificationExtension(this);
- connect(lister, SIGNAL(newItems(KFileItemList)), notifyExt, SLOT(slotNewItems(KFileItemList)));
- connect(lister, SIGNAL(itemsDeleted(KFileItemList)), notifyExt, SLOT(slotItemsDeleted(KFileItemList)));
+ connect(lister, &KDirLister::newItems, notifyExt, &DolphinPartListingNotificationExtension::slotNewItems);
+ connect(lister, &KDirLister::itemsDeleted, notifyExt, &DolphinPartListingNotificationExtension::slotItemsDeleted);
} else {
- kWarning() << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported";
+ qCWarning(DolphinDebug) << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported";
}
-#endif
createActions();
m_actionHandler->updateViewActions();
@@ -171,70 +165,70 @@ void DolphinPart::createActions()
m_newFileMenu = new DolphinNewFileMenu(actionCollection(), this);
m_newFileMenu->setParentWidget(widget());
- connect(m_newFileMenu->menu(), SIGNAL(aboutToShow()),
- this, SLOT(updateNewMenu()));
+ connect(m_newFileMenu->menu(), &QMenu::aboutToShow,
+ this, &DolphinPart::updateNewMenu);
- KAction *editMimeTypeAction = actionCollection()->addAction( "editMimeType" );
+ QAction *editMimeTypeAction = actionCollection()->addAction( "editMimeType" );
editMimeTypeAction->setText( i18nc("@action:inmenu Edit", "&Edit File Type..." ) );
- connect(editMimeTypeAction, SIGNAL(triggered()), SLOT(slotEditMimeType()));
+ connect(editMimeTypeAction, &QAction::triggered, this, &DolphinPart::slotEditMimeType);
- KAction* selectItemsMatching = actionCollection()->addAction("select_items_matching");
+ QAction* selectItemsMatching = actionCollection()->addAction("select_items_matching");
selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching..."));
- selectItemsMatching->setShortcut(Qt::CTRL | Qt::Key_S);
- connect(selectItemsMatching, SIGNAL(triggered()), this, SLOT(slotSelectItemsMatchingPattern()));
+ actionCollection()->setDefaultShortcut(selectItemsMatching, Qt::CTRL | Qt::Key_S);
+ connect(selectItemsMatching, &QAction::triggered, this, &DolphinPart::slotSelectItemsMatchingPattern);
- KAction* unselectItemsMatching = actionCollection()->addAction("unselect_items_matching");
+ QAction* unselectItemsMatching = actionCollection()->addAction("unselect_items_matching");
unselectItemsMatching->setText(i18nc("@action:inmenu Edit", "Unselect Items Matching..."));
- connect(unselectItemsMatching, SIGNAL(triggered()), this, SLOT(slotUnselectItemsMatchingPattern()));
+ connect(unselectItemsMatching, &QAction::triggered, this, &DolphinPart::slotUnselectItemsMatchingPattern);
actionCollection()->addAction(KStandardAction::SelectAll, "select_all", m_view, SLOT(selectAll()));
- KAction* unselectAll = actionCollection()->addAction("unselect_all");
+ QAction* unselectAll = actionCollection()->addAction("unselect_all");
unselectAll->setText(i18nc("@action:inmenu Edit", "Unselect All"));
- connect(unselectAll, SIGNAL(triggered()), m_view, SLOT(clearSelection()));
+ connect(unselectAll, &QAction::triggered, m_view, &DolphinView::clearSelection);
- KAction* invertSelection = actionCollection()->addAction("invert_selection");
+ QAction* invertSelection = actionCollection()->addAction("invert_selection");
invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection"));
- invertSelection->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A);
- connect(invertSelection, SIGNAL(triggered()), m_view, SLOT(invertSelection()));
+ actionCollection()->setDefaultShortcut(invertSelection, Qt::CTRL | Qt::SHIFT | Qt::Key_A);
+ connect(invertSelection, &QAction::triggered, m_view, &DolphinView::invertSelection);
// View menu: all done by DolphinViewActionHandler
// Go menu
QActionGroup* goActionGroup = new QActionGroup(this);
- connect(goActionGroup, SIGNAL(triggered(QAction*)),
- this, SLOT(slotGoTriggered(QAction*)));
+ connect(goActionGroup, &QActionGroup::triggered,
+ this, &DolphinPart::slotGoTriggered);
createGoAction("go_applications", "start-here-kde",
- i18nc("@action:inmenu Go", "App&lications"), QString("programs:/"),
+ i18nc("@action:inmenu Go", "App&lications"), QStringLiteral("programs:/"),
goActionGroup);
createGoAction("go_network_folders", "folder-remote",
- i18nc("@action:inmenu Go", "&Network Folders"), QString("remote:/"),
+ i18nc("@action:inmenu Go", "&Network Folders"), QStringLiteral("remote:/"),
goActionGroup);
createGoAction("go_settings", "preferences-system",
- i18nc("@action:inmenu Go", "Sett&ings"), QString("settings:/"),
+ i18nc("@action:inmenu Go", "Sett&ings"), QStringLiteral("settings:/"),
goActionGroup);
createGoAction("go_trash", "user-trash",
- i18nc("@action:inmenu Go", "Trash"), QString("trash:/"),
+ i18nc("@action:inmenu Go", "Trash"), QStringLiteral("trash:/"),
goActionGroup);
createGoAction("go_autostart", "",
- i18nc("@action:inmenu Go", "Autostart"), KGlobalSettings::autostartPath(),
+ i18nc("@action:inmenu Go", "Autostart"), QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/autostart",
goActionGroup);
// Tools menu
m_findFileAction = actionCollection()->addAction("find_file");
m_findFileAction->setText(i18nc("@action:inmenu Tools", "Find File..."));
- m_findFileAction->setShortcut(Qt::CTRL | Qt::Key_F);
- m_findFileAction->setIcon(KIcon("edit-find"));
- connect(m_findFileAction, SIGNAL(triggered()), this, SLOT(slotFindFile()));
+ actionCollection()->setDefaultShortcut(m_findFileAction, Qt::CTRL | Qt::Key_F);
+ m_findFileAction->setIcon(QIcon::fromTheme("edit-find"));
+ connect(m_findFileAction, &QAction::triggered, this, &DolphinPart::slotFindFile);
if (KAuthorized::authorizeKAction("shell_access")) {
m_openTerminalAction = actionCollection()->addAction("open_terminal");
- m_openTerminalAction->setIcon(KIcon("utilities-terminal"));
+ m_openTerminalAction->setIcon(QIcon::fromTheme("utilities-terminal"));
m_openTerminalAction->setText(i18nc("@action:inmenu Tools", "Open &Terminal"));
- connect(m_openTerminalAction, SIGNAL(triggered()), SLOT(slotOpenTerminal()));
- m_openTerminalAction->setShortcut(Qt::Key_F4);
+ connect(m_openTerminalAction, &QAction::triggered, this, &DolphinPart::slotOpenTerminal);
+ actionCollection()->setDefaultShortcut(m_openTerminalAction, Qt::Key_F4);
}
}
@@ -242,8 +236,8 @@ void DolphinPart::createGoAction(const char* name, const char* iconName,
const QString& text, const QString& url,
QActionGroup* actionGroup)
{
- KAction* action = actionCollection()->addAction(name);
- action->setIcon(KIcon(iconName));
+ QAction* action = actionCollection()->addAction(name);
+ action->setIcon(QIcon::fromTheme(iconName));
action->setText(text);
action->setData(url);
action->setActionGroup(actionGroup);
@@ -252,7 +246,7 @@ void DolphinPart::createGoAction(const char* name, const char* iconName,
void DolphinPart::slotGoTriggered(QAction* action)
{
const QString url = action->data().toString();
- emit m_extension->openUrlRequest(KUrl(url));
+ emit m_extension->openUrlRequest(QUrl(url));
}
void DolphinPart::slotSelectionChanged(const KFileItemList& selection)
@@ -301,10 +295,10 @@ void DolphinPart::updatePasteAction()
KAboutData* DolphinPart::createAboutData()
{
- return new KAboutData("dolphinpart", "dolphin", ki18nc("@title", "Dolphin Part"), "0.1");
+ return new KAboutData("dolphinpart", i18nc("@title", "Dolphin Part"), "0.1");
}
-bool DolphinPart::openUrl(const KUrl& url)
+bool DolphinPart::openUrl(const QUrl &url)
{
bool reload = arguments().reload();
// A bit of a workaround so that changing the namefilter works: force reload.
@@ -315,11 +309,11 @@ bool DolphinPart::openUrl(const KUrl& url)
return true;
}
setUrl(url); // remember it at the KParts level
- KUrl visibleUrl(url);
+ QUrl visibleUrl(url);
if (!m_nameFilter.isEmpty()) {
- visibleUrl.addPath(m_nameFilter);
+ visibleUrl.setPath(visibleUrl.path() + '/' + m_nameFilter);
}
- QString prettyUrl = visibleUrl.pathOrUrl();
+ QString prettyUrl = visibleUrl.toDisplayString(QUrl::PreferLocalFile);
emit setWindowCaption(prettyUrl);
emit m_extension->setLocationBarUrl(prettyUrl);
emit started(0); // get the wheel to spin
@@ -346,7 +340,7 @@ void DolphinPart::slotMessage(const QString& msg)
void DolphinPart::slotErrorMessage(const QString& msg)
{
- kDebug() << msg;
+ qCDebug(DolphinDebug) << msg;
emit canceled(msg);
//KMessageBox::error(m_view, msg);
}
@@ -385,7 +379,7 @@ void DolphinPart::slotItemsActivated(const KFileItemList& items)
}
}
-void DolphinPart::createNewWindow(const KUrl& url)
+void DolphinPart::createNewWindow(const QUrl& url)
{
// TODO: Check issue N176832 for the missing QAIV signal; task 177399 - maybe this code
// should be moved into DolphinPart::slotItemActivated()
@@ -394,7 +388,7 @@ void DolphinPart::createNewWindow(const KUrl& url)
void DolphinPart::slotOpenContextMenu(const QPoint& pos,
const KFileItem& _item,
- const KUrl&,
+ const QUrl &,
const QList& customActions)
{
KParts::BrowserExtension::PopupFlags popupFlags = KParts::BrowserExtension::DefaultPopupItems
@@ -407,7 +401,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos,
popupFlags |= KParts::BrowserExtension::ShowNavigationItems | KParts::BrowserExtension::ShowUp;
item = m_view->rootItem();
if (item.isNull())
- item = KFileItem( S_IFDIR, (mode_t)-1, url() );
+ item = KFileItem(url());
else
item.setUrl(url()); // ensure we use the view url, not the canonical path (#213799)
}
@@ -432,7 +426,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos,
const bool supportsMoving = capabilities.supportsMoving();
if (capabilities.supportsDeleting()) {
- const bool showDeleteAction = (KGlobal::config()->group("KDE").readEntry("ShowDeleteCommand", false) ||
+ const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) ||
!item.isLocalFile());
const bool showMoveToTrashAction = capabilities.isLocal() && supportsMoving;
@@ -475,12 +469,12 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos,
actionGroups);
}
-void DolphinPart::slotDirectoryRedirection(const KUrl& oldUrl, const KUrl& newUrl)
+void DolphinPart::slotDirectoryRedirection(const QUrl &oldUrl, const QUrl &newUrl)
{
- //kDebug() << oldUrl << newUrl << "currentUrl=" << url();
- if (oldUrl.equals(url(), KUrl::CompareWithoutTrailingSlash /* #207572 */)) {
+ qCDebug(DolphinDebug) << oldUrl << newUrl << "currentUrl=" << url();
+ if (oldUrl.matches(url(), QUrl::StripTrailingSlash /* #207572 */)) {
KParts::ReadOnlyPart::setUrl(newUrl);
- const QString prettyUrl = newUrl.pathOrUrl();
+ const QString prettyUrl = newUrl.toDisplayString(QUrl::PreferLocalFile);
emit m_extension->setLocationBarUrl(prettyUrl);
}
}
@@ -490,7 +484,7 @@ void DolphinPart::slotEditMimeType()
{
const KFileItemList items = m_view->selectedItems();
if (!items.isEmpty()) {
- KonqOperations::editMimeType(items.first().mimetype(), m_view);
+ KMimeTypeEditor::editMimeType(items.first().mimetype(), m_view);
}
}
@@ -511,7 +505,7 @@ void DolphinPart::slotUnselectItemsMatchingPattern()
void DolphinPart::openSelectionDialog(const QString& title, const QString& text, bool selectItems)
{
bool okClicked;
- QString pattern = KInputDialog::getText(title, text, "*", &okClicked, m_view);
+ const QString pattern = QInputDialog::getText(m_view, title, text, QLineEdit::Normal, "*", &okClicked);
if (okClicked && !pattern.isEmpty()) {
QRegExp patternRegExp(pattern, Qt::CaseSensitive, QRegExp::Wildcard);
@@ -543,11 +537,14 @@ void DolphinPart::slotOpenTerminal()
{
QString dir(QDir::homePath());
- KUrl u(url());
+ QUrl u(url());
// If the given directory is not local, it can still be the URL of an
// ioslave using UDS_LOCAL_PATH which to be converted first.
- u = KIO::NetAccess::mostLocalUrl(u, widget());
+ KIO::StatJob* statJob = KIO::mostLocalUrl(u);
+ KJobWidgets::setWindow(statJob, widget());
+ statJob->exec();
+ u = statJob->mostLocalUrl();
//If the URL is local after the above conversion, set the directory.
if (u.isLocalFile()) {
@@ -559,7 +556,7 @@ void DolphinPart::slotOpenTerminal()
void DolphinPart::slotFindFile()
{
- KRun::run("kfind", url(), widget());
+ KRun::run("kfind", {url()}, widget());
}
void DolphinPart::updateNewMenu()
@@ -589,7 +586,7 @@ void DolphinPart::createDirectory()
m_newFileMenu->createDirectory();
}
-void DolphinPart::setFilesToSelect(const KUrl::List& files)
+void DolphinPart::setFilesToSelect(const QList& files)
{
if (files.isEmpty()) {
return;
diff --git a/src/dolphinpart.h b/src/dolphinpart.h
index 7146b46af3..9f0ed55704 100644
--- a/src/dolphinpart.h
+++ b/src/dolphinpart.h
@@ -20,20 +20,17 @@
#ifndef DOLPHINPART_H
#define DOLPHINPART_H
-#include
+#include
+#include
-#include
class DolphinNewFileMenu;
class DolphinViewActionHandler;
class QActionGroup;
-class KAction;
class KFileItemList;
class KFileItem;
class DolphinPartBrowserExtension;
-class DolphinSortFilterProxyModel;
class DolphinRemoteEncoding;
-class DolphinModel;
class KDirLister;
class DolphinView;
class KAboutData;
@@ -53,7 +50,7 @@ class DolphinPart : public KParts::ReadOnlyPart
Q_PROPERTY( QString nameFilter READ nameFilter WRITE setNameFilter )
// Used by konqueror to implement the --select command-line option
- Q_PROPERTY( KUrl::List filesToSelect READ filesToSelect WRITE setFilesToSelect )
+ Q_PROPERTY( QList filesToSelect READ filesToSelect WRITE setFilesToSelect )
public:
explicit DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args);
@@ -65,7 +62,7 @@ public:
* Standard KParts::ReadOnlyPart openUrl method.
* Called by Konqueror to view a directory in DolphinPart.
*/
- virtual bool openUrl(const KUrl& url);
+ virtual bool openUrl(const QUrl& url) Q_DECL_OVERRIDE;
/// see the supportsUndo property
bool supportsUndo() const { return true; }
@@ -134,7 +131,7 @@ private Q_SLOTS:
/**
* Creates a new window showing the content of \a url.
*/
- void createNewWindow(const KUrl& url);
+ void createNewWindow(const QUrl &url);
/**
* Opens the context menu on the current mouse position.
* @pos Position in screen coordinates.
@@ -146,7 +143,7 @@ private Q_SLOTS:
*/
void slotOpenContextMenu(const QPoint& pos,
const KFileItem& item,
- const KUrl& url,
+ const QUrl& url,
const QList& customActions);
/**
@@ -155,7 +152,7 @@ private Q_SLOTS:
* Testcase 1: fish://localhost
* Testcase 2: showing a directory that is being renamed by another window (#180156)
*/
- void slotDirectoryRedirection(const KUrl& oldUrl, const KUrl& newUrl);
+ void slotDirectoryRedirection(const QUrl& oldUrl, const QUrl& newUrl);
/**
* Updates the state of the 'Edit' menu actions and emits
@@ -223,10 +220,10 @@ private Q_SLOTS:
/**
* Called by konqueror --select
*/
- void setFilesToSelect(const KUrl::List& files);
- KUrl::List filesToSelect() const { return KUrl::List(); } // silence moc
+ void setFilesToSelect(const QList &files);
+ QList filesToSelect() const { return QList(); } // silence moc
- virtual bool eventFilter(QObject*, QEvent*);
+ virtual bool eventFilter(QObject*, QEvent*) Q_DECL_OVERRIDE;
private:
void createActions();
@@ -243,8 +240,8 @@ private:
DolphinRemoteEncoding* m_remoteEncoding;
DolphinPartBrowserExtension* m_extension;
DolphinNewFileMenu* m_newFileMenu;
- KAction* m_findFileAction;
- KAction* m_openTerminalAction;
+ QAction* m_findFileAction;
+ QAction* m_openTerminalAction;
QString m_nameFilter;
DolphinRemoveAction* m_removeAction;
Q_DISABLE_COPY(DolphinPart)
diff --git a/src/dolphinpart.rc b/src/dolphinpart.rc
index 893d6c831a..725320b28a 100644
--- a/src/dolphinpart.rc
+++ b/src/dolphinpart.rc
@@ -1,5 +1,5 @@
-
+