+cmake_minimum_required(VERSION 2.8.12)
+
+project(Dolphin)
+
+# ECM setup
+find_package(ECM 0.0.14 CONFIG REQUIRED)
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
+
+set(DOLPHIN_VERSION "4.97.0")
+
+include(ECMSetupVersion)
+include(GenerateExportHeader)
+include(FeatureSummary)
+include(KDEInstallDirs)
+include(KDECMakeSettings)
+include(KDEFrameworkCompilerSettings)
+
+ecm_setup_version(${DOLPHIN_VERSION} VARIABLE_PREFIX DOLPHINPRIVATE
+ SOVERSION 5
+)
+
+find_package(KF5 REQUIRED COMPONENTS DocTools Init KCMUtils KDELibs4Support NewStuff)
+find_package(KF5 COMPONENTS Activities)
+
+find_package(Phonon4Qt5 CONFIG REQUIRED)
+
+if ("${CMAKE_SOURCE_DIR}" STREQUAL "${Dolphin_SOURCE_DIR}")
+ find_package(KF5Konq CONFIG REQUIRED)
+else()
+ include_directories(${LibKonq_SOURCE_DIR}/src)
+endif()
+
+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)
+ set(HAVE_BALOO TRUE)
+endif()
add_subdirectory(src)
+add_subdirectory(docs)
+
+# TODO Remove the if/endif lines if Dolphin is split.
+if ("${CMAKE_SOURCE_DIR}" STREQUAL "${Dolphin_SOURCE_DIR}")
+ feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
+endif()
--- /dev/null
+
+kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR dolphin)
--- /dev/null
+<?xml version="1.0" ?>
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
+ <!ENTITY dolphin "<application>Dolphin</application>">
+ <!ENTITY kappname "&dolphin;">
+ <!ENTITY package "kde-baseapps">
+ <!ENTITY % addindex "IGNORE">
+ <!ENTITY % English "INCLUDE"><!-- change language only here -->
+]>
+
+<book id="dolphin" lang="&language;">
+
+<bookinfo>
+<title>The &dolphin; Handbook</title>
+
+<authorgroup>
+<author>
+<firstname>Peter</firstname>
+<othername></othername>
+<surname>Penz</surname>
+<affiliation>
+<address><email>peter.penz@gmx.at</email></address>
+</affiliation>
+</author>
+<author>
+<firstname>Orville</firstname>
+<surname>Bennett</surname>
+<affiliation>
+<address>&Orville.Bennett.mail;</address>
+</affiliation>
+</author>
+<author>
+<firstname>Michael</firstname>
+<surname>Austin</surname>
+<affiliation>
+<address><email>tuxedup@users.sourceforge.net</email></address>
+</affiliation>
+</author>
+<author>
+<firstname>David</firstname>
+<surname>Edmundson</surname>
+<affiliation>
+<address><email>kde@davidedmundson.co.uk</email></address>
+</affiliation>
+</author>
+<author>
+<firstname>Alan</firstname>
+<surname>Blanchflower</surname>
+</author>
+<author>
+<firstname>Frank</firstname>
+<surname>Reininghaus</surname>
+<affiliation>
+<address><email>frank78ac@googlemail.com</email></address>
+</affiliation>
+</author>
+
+<!-- TRANS:ROLES_OF_TRANSLATORS -->
+</authorgroup>
+
+<copyright>
+<year>2006</year>
+<holder>Peter Penz</holder>
+</copyright>
+<copyright>
+<year>2006</year>
+<holder>&Orville.Bennett;</holder>
+<holder>Michael Austin</holder>
+</copyright>
+<copyright>
+<year>2009</year>
+<holder>Frank Reininghaus</holder>
+</copyright>
+
+<legalnotice>&FDLNotice;</legalnotice>
+
+<date>2013-06-28</date>
+<releaseinfo>2.3 (&kde; 4.11)</releaseinfo>
+
+<abstract>
+<para>
+&dolphin; is the default file manager for &kde;, designed with usability as a primary focus.
+</para>
+</abstract>
+
+<keywordset>
+<keyword>KDE</keyword>
+<keyword>Dolphin</keyword>
+<keyword>Filemanager</keyword>
+<keyword>file</keyword>
+<keyword>management</keyword>
+</keywordset>
+
+</bookinfo>
+
+<chapter id="introduction">
+<title>Introduction</title>
+
+<para>
+&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.
+</para>
+
+<para>
+This design approach allows the developers to concentrate on optimizing the user
+interface for the specific task of file management.
+</para>
+
+<para>
+Please report any problems or feature requests to the &dolphin; author via the
+bug report dialog. This is accessible either from the <guibutton>Control</guibutton>
+button at the right of the toolbar in the default mode without
+menubar; or from <menuchoice><guimenu>Help</guimenu><guimenuitem>Report Bug...</guimenuitem></menuchoice>
+menu of the application, if the menubar is shown.
+</para>
+
+</chapter>
+
+<chapter id="using-dolphin">
+<title>Using &dolphin;</title>
+
+<sect1 id="dolphin-user-interface">
+<title>&dolphin; User Interface</title>
+
+<para>
+The screenshot below shows &dolphin;'s default user interface:
+</para>
+
+<screenshot>
+<screeninfo>Screenshot of &dolphin;'s default user interface</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="default-ui.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>&dolphin;'s default user interface.</phrase>
+</textobject>
+<caption><para>&dolphin;'s default user interface.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>
+The elements of the default user interface are:
+
+<itemizedlist>
+
+<listitem><para>
+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
+<menuchoice><guimenuitem>Configure Toolbars...</guimenuitem></menuchoice>
+from the context menu, with <guimenuitem>Configure Toolbars...</guimenuitem>
+from the <guibutton>Control</guibutton> button at the
+right of the toolbar or via <menuchoice><guimenu>Settings</guimenu>
+<guimenuitem>Configure Toolbars...</guimenuitem></menuchoice>
+from the main menu.
+</para>
+<screenshot>
+<screeninfo>Screenshot of &dolphin;'s toolbar</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="toolbar.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>The default toolbar.</phrase>
+</textobject>
+<caption>
+<para>
+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 <guilabel>Show Text</guilabel>. The <guibutton>Control</guibutton>
+button at the right side of the toolbar is only displayed if the menubar is hidden.
+</para>
+</caption>
+</mediaobject>
+</screenshot>
+</listitem>
+
+<listitem><para>
+The location bar, which always displays the path to the current folder. It can
+be switched between two different modes, see the
+<link linkend="location-bar">section on the location bar</link> for details.
+</para></listitem>
+
+<listitem><para>
+The <link linkend="dolphin-view">view</link>, which shows all files
+and folders in the current folder.
+</para></listitem>
+
+<listitem><para>
+The <link linkend="places-panel"><guilabel>Places</guilabel> panel</link>, which
+provides quick access to bookmarked locations and disks or other media.
+</para>
+<para>If desktop search and file indexing are enabled in the <guilabel>Desktop Search</guilabel>
+module in the &systemsettings; the panel provides <guilabel>Recently Saved</guilabel>
+items and allows you to search for <guilabel>Documents</guilabel>, <guilabel>Images</guilabel>,
+<guilabel>Audio Files</guilabel> and <guilabel>Video</guilabel>.
+</para></listitem>
+
+<listitem><para>
+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.
+</para></listitem>
+
+<listitem><para>
+The menubar (hidden by default), which provides access to all commands and configuration options.
+See the <link linkend="commands-menubar">Command Reference</link> for a list of
+all menu commands. The menubar can be toggled with
+<guimenuitem>Show Menubar</guimenuitem> (<keycombo action="simul">&Ctrl;<keycap>M</keycap></keycombo>)
+from the <guimenu>Settings</guimenu> menu or the <guibutton>Control</guibutton> button.
+</para>
+<para>If the menubar is hidden, all its actions are available from the
+<guibutton>Control</guibutton> button.
+</para></listitem>
+
+<listitem><para>
+The additional <guilabel>Information</guilabel>, <guilabel>Folders</guilabel>
+and <guilabel>Terminal</guilabel> panels are hidden
+by default, for more information see <link linkend="panels"><guilabel>Panels</guilabel>.</link>
+</para></listitem>
+
+</itemizedlist>
+
+</para>
+
+</sect1>
+
+<sect1 id="dolphin-view">
+<title>The &dolphin; View</title>
+
+<sect2 id="dolphin-view-using">
+<title>Using the View</title>
+
+<para>
+The view displays all files and folders in the current folder. These items
+can be accessed or manipulated in different ways:
+</para>
+<itemizedlist>
+
+<listitem><para>
+A file or folder can be opened by clicking it with the &LMB; (or
+double-clicking, if <guilabel>Double-click to open files and folders</guilabel>
+is enabled in the <link linkend="preferences-dialog-navigation"><quote>Navigation</quote>
+section of the settings</link>).
+</para></listitem>
+
+<listitem><para>
+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.
+</para></listitem>
+
+<listitem><para>
+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.
+</para></listitem>
+
+</itemizedlist>
+<para>
+&dolphin; remembers the history of visited folders. To navigate backward or
+forward in the history, the corresponding buttons in the toolbar can be used:
+</para>
+
+<screenshot>
+<screeninfo>Screenshot of &dolphin;'s toolbar</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="toolbar-navigation.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>The Back and Forward buttons in the toolbar.</phrase>
+</textobject>
+<caption>
+<para>
+The <guibutton>Back</guibutton> and <guibutton>Forward</guibutton> buttons in
+the toolbar can be used to navigate in the history.
+</para>
+</caption>
+</mediaobject>
+</screenshot>
+
+</sect2>
+
+<sect2 id="dolphin-view-appearance">
+<title>&dolphin; View Appearance</title>
+
+<para>
+The toolbar contains buttons to control the appearance of the view:
+</para>
+
+<screenshot>
+<screeninfo>Screenshot of &dolphin;'s toolbar</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="toolbar-view-appearance.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>The buttons in the toolbar which control the appearance of the view.</phrase>
+</textobject>
+<caption><para>
+The buttons in the toolbar which control the appearance of the view.
+</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>
+All the settings discussed below and other options concerning, ⪚ the
+sorting of the files in the current folder, can also be modified in the
+<guimenu>View</guimenu> menu and in the
+<link linkend="view-properties-dialog">View Properties dialog</link>. By
+default, these settings are remembered for each folder separately. This
+behavior can be changed in the
+<link linkend="preferences-dialog-general"><quote>General</quote></link> section of the settings.
+</para>
+
+<sect3 id="dolphin-view-modes">
+<title>View Modes</title>
+
+<para>
+The first three buttons in the above screenshot switch between &dolphin;'s
+view modes.
+<!-- begin copy to konqueror filemanager.docbook -->
+<itemizedlist>
+
+<listitem><para>
+In the <guibutton>Icons</guibutton> 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
+<menuchoice><guimenu>View</guimenu><guisubmenu>Additional Information</guisubmenu></menuchoice>,
+are displayed below the icons.
+</para></listitem>
+
+<listitem><para>
+The <guilabel>Compact</guilabel> view shows the folder contents as icons with
+the name beside it and the items enabled in
+<menuchoice><guimenu>View</guimenu><guisubmenu>Additional Information</guisubmenu></menuchoice>
+below the name. The items are grouped in columns similar to the <guilabel>Short View</guilabel>
+in the &kde; file dialog.
+</para></listitem>
+
+<listitem><para>
+In the <guibutton>Details</guibutton> 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;.
+</para>
+<para>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 <guilabel>Name</guilabel> column where
+the extension is replaced by <quote>...</quote>
+</para>
+<para>The order of columns can be changed by drag and drop of column headers, except for
+the <guilabel>Name</guilabel> header, which is always the first column in this view.
+</para>
+<para>
+The details view allows you to view the current directory
+in a tree-like fashion if <link linkend="preferences-dialog-viewmodes-details">
+<guilabel>Expandable folders</guilabel></link> are enabled:
+Each subfolder of the current folder can be
+<quote>expanded</quote> or <quote>collapsed</quote> by clicking on the <guiicon>></guiicon>
+or <guiicon>v</guiicon> icon next to it.</para></listitem>
+</itemizedlist>
+</para>
+
+<screenshot>
+<screeninfo>Grouped View</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="grouping-view.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Grouped View</phrase>
+</textobject>
+<caption><para>All view modes support grouping by the sort type selected
+in <menuchoice><guimenu>View</guimenu><guisubmenu>Sort by</guisubmenu></menuchoice></para></caption>
+</mediaobject>
+</screenshot>
+<!-- end copy to konqueror filemanager.docbook -->
+
+</sect3>
+
+<sect3 id="dolphin-view-information">
+<title>Information in the View</title>
+<para>
+In all view modes &kappname; shows at least an icon and a name for each item.
+Using <guisubmenu>Additional Information</guisubmenu> in the <guimenu>View</guimenu>
+menu or the context menu of the header in <guilabel>Details</guilabel> mode, you can select
+more information for each item to be shown:
+</para>
+
+<para>
+<guimenuitem>Size</guimenuitem>, <guimenuitem>Date</guimenuitem>,
+<guimenuitem>Type</guimenuitem>, <guimenuitem>Rating</guimenuitem>,
+<guimenuitem>Tags</guimenuitem> or <guimenuitem>Comment</guimenuitem>.
+</para>
+
+<para>Depending on the file type, additionally, sorting criteria can be selected:
+<simplelist>
+ <member><guimenuitem>Document</guimenuitem>: Number of words and lines</member>
+ <member><guimenuitem>Image</guimenuitem>: Size and orientation</member>
+ <member><guimenuitem>Audio</guimenuitem>: Artist, album, duration and track</member>
+</simplelist>
+</para>
+
+<para>The <guisubmenu>Other</guisubmenu> submenu allows you to select
+<guimenuitem>Path</guimenuitem>, <guimenuitem>Link Destination</guimenuitem>,
+<guimenuitem>Copied From</guimenuitem>,
+<guimenuitem>Permissions</guimenuitem>, <guimenuitem>Owner</guimenuitem> or
+<guimenuitem>User Group</guimenuitem>.
+</para>
+
+</sect3>
+
+<sect3 id="preview">
+<title>Preview</title>
+
+<para>
+If <guibutton>Preview</guibutton> is enabled, the icons are based on the actual
+file or folder contents; ⪚ for images a scaled down preview of the image is
+shown.
+</para>
+
+</sect3>
+
+<sect3 id="split-view">
+<title>Split</title>
+
+<para>
+If <guibutton>Split</guibutton> is clicked, two views are shown which can
+display the contents of different folders. This can be convenient for moving or
+copying files.
+</para>
+
+</sect3>
+
+</sect2>
+<!-- begin copy to konqueror filemanager.docbook -->
+<sect2 id="selection">
+<title>Selecting Items in the View</title>
+
+<para>
+There are several ways to select items in the view. Once a group of items
+is selected, all actions, such as
+<menuchoice><guimenuitem>Cut</guimenuitem></menuchoice>,
+<menuchoice><guimenuitem>Copy</guimenuitem></menuchoice>,
+<menuchoice><guimenuitem>Move to Trash</guimenuitem></menuchoice>,
+and drag and drop operations, affect all selected items.
+</para>
+
+<sect3 id="selection-mouse">
+<title>Selecting Items Using the Mouse</title>
+
+<itemizedlist>
+
+<listitem><para>
+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.
+</para></listitem>
+
+<listitem><para>
+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.
+</para></listitem>
+
+<listitem><para>
+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.
+</para></listitem>
+
+<listitem><para>
+If <guilabel>Show selection marker</guilabel> is enabled in the
+<link linkend="preferences-dialog-general-behavior"><quote>Behavior</quote>
+tab of the <guilabel>General</guilabel> section of the settings</link>, a small
+<guiicon>+</guiicon> or <guiicon>-</guiicon> 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.
+</para></listitem>
+
+</itemizedlist>
+
+</sect3>
+
+<sect3 id="selection-keyboard">
+<title>Selecting Items Using the Keyboard</title>
+
+<itemizedlist>
+
+<listitem><para>
+If an arrow key, <keycap>Page Up</keycap>, <keycap>Page Down</keycap>,
+<keycap>Home</keycap>, or <keycap>End</keycap> is pressed, the new current item
+is selected, and the previous selection is cleared.
+</para></listitem>
+
+<listitem><para>
+If the &Ctrl; key is held while one of the above keys is pressed, the selection
+remains unchanged.
+</para></listitem>
+
+<listitem><para>
+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.
+</para></listitem>
+
+<listitem><para>
+If <keycombo action="simul">&Ctrl;<keysym>Space</keysym></keycombo> is pressed,
+the selection state of the current item is toggled.
+</para></listitem>
+
+<listitem><para>
+<keycombo action="simul">&Ctrl;<keycap>A</keycap></keycombo> selects all items
+in the view.
+</para></listitem>
+
+<listitem><para>
+<keycombo action="simul">&Ctrl;&Shift;<keycap>A</keycap></keycombo> toggles the
+selection state of all items in the view.
+</para></listitem>
+
+<listitem><para>
+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.
+</para></listitem>
+</itemizedlist>
+<!-- END copy to konqueror filemanager.docbook -->
+</sect3>
+
+</sect2>
+
+</sect1>
+
+<!--FIXME replace with links to KDE Fundamentals when location bar in file dialog
+has all features from dolphin ?-->
+
+<sect1 id="location-bar">
+<title>Location Bar</title>
+
+<para>
+The location bar, which can be found above &dolphin;'s view, displays
+the path to the current folder. The location bar has two modes.
+</para>
+
+<sect2 id="location-bar-bread-crumb">
+<title>Bread Crumb Mode</title>
+
+<para>
+In the <quote>bread crumb</quote> 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 <quote>></quote> sign to the right of a
+folder opens a menu which allows you to quickly open a subfolder of that folder.
+</para>
+
+<screenshot>
+<screeninfo>Screenshot of the location bar in bread crumb mode</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="locationbar-breadcrumb.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Location bar in bread crumb mode.</phrase>
+</textobject>
+<caption><para>Location bar in bread crumb mode.</para></caption>
+</mediaobject>
+</screenshot>
+
+</sect2>
+
+<sect2 id="location-bar-editable">
+<title>Editable Mode</title>
+
+<para>
+When in bread crumb mode, clicking in the gray area to the right of the path
+with the &LMB; switches the location bar to <quote>editable</quote> 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;.
+</para>
+
+<screenshot>
+<screeninfo>Screenshot of the location bar in editable mode</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="locationbar-editable.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Location bar in editable mode.</phrase>
+</textobject>
+<caption><para>Location bar in editable mode.</para></caption>
+</mediaobject>
+</screenshot>
+
+<sect3 id="location-bar-editable-kioslaves">
+<title>Using Kioslaves</title>
+
+<para>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.</para>
+
+<para>For example with the <quote>fish</quote> kioslave &dolphin; can be
+used to manage files and folders on a remote host that is accessible
+via <acronym>SSH</acronym>. To do this you would type <userinput>fish://username@remotehost</userinput>
+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.</para>
+
+<para>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.
+</para>
+<screenshot>
+<screeninfo>Screenshot of the list of kioslaves</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="locationbar-kioslaves-menu.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Location bar showing list of available kioslaves.</phrase>
+</textobject>
+<caption><para>List of available kioslaves.</para></caption>
+</mediaobject>
+</screenshot>
+
+</sect3>
+</sect2>
+
+<sect2 id="location-place-context">
+<title>Places and Context</title>
+<!--FIXME this is now in file dialog in 4.11-->
+<para>
+If the <guilabel>Places</guilabel> 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 <quote>places</quote> and storage media. See the
+<link linkend="places-panel">section about the Places Panel</link> for details.
+</para>
+
+<screenshot>
+<screeninfo>Location bar with Places icon</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="locationbar-places-icon.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Location bar with Places icon</phrase>
+</textobject>
+</mediaobject>
+</screenshot>
+
+<para>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.
+</para>
+
+<screenshot>
+<screeninfo>Location bar context menu</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="locationbar-context-menu.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Location bar context menu</phrase>
+</textobject>
+</mediaobject>
+</screenshot>
+
+</sect2>
+
+</sect1>
+
+<sect1 id="panels">
+<title>Panels</title>
+
+<para>
+&dolphin; allows a number of panels to be placed next to the view. These can
+be enabled in <menuchoice><guimenu>View</guimenu><guisubmenu>Panels</guisubmenu></menuchoice>.
+By unlocking the panels and clicking and dragging a panel title, the panel can be moved
+to a different position, even outside the window.
+</para>
+
+<sect2 id="places-panel">
+<title>Places</title>
+<!--FIXME difference between places panel in dolphin + kde filedialog + konqueror:
+context menu Icon Size? No different entries ?-->
+<!--Four groups: Places = Folders, Devices, with Baloo Recently Saved and Search For -->
+<para>
+The <guilabel>Places</guilabel> panel is located at the left of the window by
+default. The <guilabel>Places</guilabel> 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.
+</para>
+
+<para>
+The easiest way to add a folder to the <guilabel>Places</guilabel> panel is to
+drag it and drop it in the panel. Moreover, you can click inside the panel with
+the &RMB; and choose <menuchoice><guimenuitem>Add Entry...</guimenuitem></menuchoice>
+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;.
+</para>
+
+<para>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.
+</para>
+<para>The context menu has an action to open the entry in a new tab.
+Devices can be unmounted using the context menu.
+</para>
+</sect2>
+
+<sect2 id="information-panel">
+<title>Information</title>
+
+<para>
+The <guilabel>Information</guilabel> 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.
+</para>
+
+</sect2>
+
+<sect2 id="folders-panel">
+<title>Folders</title>
+
+<para>
+The <guilabel>Folders</guilabel> 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.
+
+</para>
+
+</sect2>
+
+<sect2 id="terminal-panel">
+<title>Terminal</title>
+
+<para>
+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. The terminal only
+works with local media. Note: Changing folder in the terminal will not
+affect the &dolphin; view.
+</para>
+
+</sect2>
+
+</sect1>
+
+<sect1 id="quick-tips">
+<title>Quick Tips</title>
+
+<para>
+The following are a number of tips to save time when using &dolphin;.
+</para>
+
+<sect2 id="quick-bookmarking">
+<title>Quick Bookmarking</title>
+
+<para>
+To quickly create a bookmark in the <guilabel>Places</guilabel> panel for the
+current folder, &RMB; click in the work space and click
+<menuchoice><guimenuitem>Add to Places</guimenuitem></menuchoice> in the context menu.
+</para>
+
+</sect2>
+
+<sect2 id="finding-searching-in-file">
+<title>Finding Files and Searching in Files</title>
+<!-- FIXME search in hidden files + folders View -> Show Hidden Files has to be enabled ? -->
+<para>
+&dolphin; is capable of searching for files and for content in files. If <keycombo action="simul">
+&Ctrl;<keycap>F</keycap></keycombo> is pressed or <menuchoice> <guimenu>Edit</guimenu>
+<guimenuitem>Find...</guimenuitem> </menuchoice> is used, the <guilabel>Find</guilabel>
+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.
+<screenshot>
+<screeninfo>Search files and for content in files</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="nepomuk-search.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Search files and for content in files</phrase>
+</textobject>
+<caption><para>&dolphin; searching files and for content in files.</para></caption>
+</mediaobject>
+</screenshot>
+</para>
+<para>The search is case insensitive, and does not require surrounding wildcards
+(<userinput>*foo*</userinput> and <userinput>foo</userinput> are equivalent),
+but you can use wildcards inside the search term. <userinput>*</userinput> will match
+zero or more characters, <userinput>?</userinput> only one single character.</para>
+<para>This feature can be used with running Baloo services; without these services
+a KIOSlave is launched to provide the search results.</para>
+<para>The option from <guilabel>Everywhere</guilabel> with activated Baloo
+services searches in all indexed folders, without Baloo this option
+starts the search from the user's <replaceable>Home</replaceable> folder.</para>
+
+<screenshot>
+<screeninfo>Search with More Options</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="nepomuk-search-more-options.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Search with More Options</phrase>
+</textobject>
+<caption><para>&dolphin; searching with More Options.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>
+Use the <guilabel>More Options</guilabel> button to extend the <guilabel>Find</guilabel>
+bar. This provides a very comfortable way for
+the user to shrink the number of search results.</para>
+<para>To start a search select one or more file types (<guilabel>Documents</guilabel>,
+<guilabel>Audio</guilabel>, <guilabel>Video</guilabel>, <guilabel>Images</guilabel>),
+ a time period and rating<!--FIXME readd when again implemented: and tag, if you have defined any.--></para>
+
+<para>Alternatively you can use these options in the <guilabel>Places</guilabel> panel
+together with the <guilabel>Filter</guilabel> bar to find files using Baloo or limit
+the search to files matching the filter expression.</para>
+
+</sect2>
+
+<sect2 id="mounting-storage-media">
+<title>Mounting Storage Media</title>
+
+<para>
+A quick way to mount Storage Media is to click on the device in the
+<guilabel>Places</guilabel> panel. This will mount and open the device in &dolphin;.
+</para>
+
+</sect2>
+
+<sect2 id="undo-actions">
+<title>Undo Actions</title>
+
+<para>
+&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 <keycombo action="simul">&Ctrl;<keycap>Z</keycap></keycombo>
+or select <menuchoice> <guimenu>Edit</guimenu> <guimenuitem>Undo: (action name)</guimenuitem> </menuchoice>
+in the menu, ⪚ <guimenuitem>Undo: Rename</guimenuitem>.
+</para>
+
+</sect2>
+
+<sect2 id="batch-rename">
+<title>Renaming A Batch Of Files</title>
+<para>
+&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.
+</para>
+
+<para>
+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 <link linkend="selection">Selecting Items in the View</link>
+for more details on item selection). Then open the batch-rename dialog by pressing
+<keycap>F2</keycap> or via the File menu:
+<menuchoice> <guimenu>File</guimenu> <guimenuitem>Rename...</guimenuitem> </menuchoice>
+</para>
+
+<para>
+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 <userinput>#</userinput>
+character is replaced by a different consecutive number for each file.
+</para>
+
+<para>If all file extensions in your selection are different, the name of all files
+can be changed without using a <userinput>#</userinput> 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.
+</para>
+</sect2>
+
+<sect2 id="compare-files">
+<title>Comparing A Selection Of Files or Folders</title>
+
+<para>
+If the &kompare; application is installed, you can use it to see the differences
+between two files or folders.
+</para>
+
+<para>
+First select the two files or folders to be compared. Then launch the &kompare; application
+via the Tools menu: <menuchoice> <guimenu>Tools</guimenu> <guimenuitem>Compare Files</guimenuitem> </menuchoice>.
+&kompare; will then open showing the differences between the files or folders.
+</para>
+
+</sect2>
+
+<sect2 id="filter-files">
+<title>Filtering Files</title>
+
+<para>
+&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 <acronym>MP3</acronym> files within a folder, you could filter for <quote>.mp3</quote>.
+This would then filter out all files whose name does not contain <quote>.mp3</quote>.
+</para>
+
+<para>
+To filter files, first enable the filter bar, either by pressing <keycombo action="simul">&Ctrl;<keycap>I</keycap></keycombo>
+or via the menu: <menuchoice> <guimenu>Tools</guimenu> <guimenuitem>Show Filter Bar</guimenuitem> </menuchoice>.
+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
+<guiicon>Hide Filter Bar</guiicon> icon.
+</para>
+
+</sect2>
+
+</sect1>
+
+</chapter>
+
+<chapter id="configuring-dolphin">
+<title>Configuring &dolphin;</title>
+
+<para>
+&dolphin; distinguishes two different kinds of settings:
+
+<itemizedlist>
+
+<listitem><para>
+Settings which affect the general behavior of &dolphin;. These can be configured
+using the <link linkend="preferences-dialog">Preferences Dialog</link>.
+</para></listitem>
+
+<listitem><para>
+Settings which determine how the contents of a folder are displayed in &dolphin;.
+These settings are called <link linkend="view-properties">View Properties</link>
+and can be controlled with toolbar buttons, via the <guimenu>View</guimenu> menu,
+and with the <link linkend="view-properties-dialog">View Properties Dialog</link>.
+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 <link linkend="preferences-dialog-general-behavior"><quote>General</quote>
+section of the settings</link>.
+</para></listitem>
+
+</itemizedlist>
+
+</para>
+
+<sect1 id="preferences-dialog">
+<title>The &dolphin; Preferences Dialog</title>
+<para>
+The Preferences Dialog is opened via <menuchoice><guimenu>Settings</guimenu>
+<guimenuitem>Configure &dolphin;...</guimenuitem></menuchoice> 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.
+</para>
+
+<para>All settings except for the <guilabel>Startup</guilabel> page and the <guilabel>Status Bar</guilabel>
+tab on the <guilabel>General</guilabel> page are shared with &konqueror; in filemanager mode.
+</para>
+
+<sect2 id="preferences-dialog-startup">
+<title>Startup</title>
+
+<para>
+This group contains settings which control the appearance of &dolphin; on startup.
+
+<screenshot>
+<screeninfo>Screenshot of the Startup settings in &dolphin;'s preferences dialog</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="preferences-startup.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Startup Settings.</phrase>
+</textobject>
+<caption><para>Startup Settings in &dolphin;'s Preferences Dialog.</para></caption>
+</mediaobject>
+</screenshot>
+
+<itemizedlist>
+
+<listitem><para>
+The <guilabel>Home Folder</guilabel> 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 <quote>folder</quote> 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.
+</para></listitem>
+
+<listitem><para>
+<guilabel>Split View Mode</guilabel> controls if the
+<link linkend="dolphin-view">&dolphin; view</link> is split on startup
+or not.
+</para></listitem>
+
+<listitem><para>
+<guilabel>Editable location bar</guilabel> controls if the location bar is in
+editable mode on startup. The bread crumb mode of the location bar is used
+otherwise. See the <link linkend="location-bar">section about the location bar</link>
+for details about the two modes.
+</para></listitem>
+
+<listitem><para>
+If <guilabel>Show full path inside location bar</guilabel> 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 <guilabel>Places</guilabel> panel.
+</para></listitem>
+
+<listitem><para>
+<guilabel>Show filter bar</guilabel> controls if the filter bar is shown on
+startup or not. See the <link linkend="filter-files">section on the filter bar</link>
+for details.
+</para></listitem>
+
+</itemizedlist>
+
+</para>
+
+</sect2>
+
+<sect2 id="preferences-dialog-viewmodes">
+<title>View Modes</title>
+
+<para>
+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>
+<screeninfo>Screenshot of the Icons View settings in &dolphin;'s preferences dialog</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="preferences-viewmodes-icons.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>View Modes Settings.</phrase>
+</textobject>
+<caption><para>View Modes Settings in &dolphin;'s Preferences Dialog.</para></caption>
+</mediaobject>
+</screenshot>
+
+</para>
+
+<sect3 id="preferences-dialog-viewmodes-common">
+<title>Common settings for all view modes</title>
+
+<para>
+All three view modes have some common settings:
+</para>
+<itemizedlist>
+
+<listitem><para>
+Sliders which control the size of the icons. The <guilabel>Default</guilabel> or
+<guilabel>Preview</guilabel> 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
+<link linkend="preferences-dialog-general-statusbar"><quote>General</quote>
+section of the settings</link>.
+</para></listitem>
+
+<listitem><para>
+A setting for the font used in the view mode: either the system font or a
+custom font can be chosen.
+</para></listitem>
+
+</itemizedlist>
+<para>
+The other settings in the <guilabel>Text</guilabel> section which apply to only
+one of the view modes are discussed below.
+</para>
+
+</sect3>
+
+<sect3 id="preferences-dialog-viewmodes-icons">
+<title>Icons</title>
+<para>
+<itemizedlist>
+<listitem><para>
+<guilabel>Width</guilabel> controls the minimum width that is reserved for
+the text of a file item.
+</para></listitem>
+<listitem><para>
+ <guilabel>Maximum lines</guilabel> means maximum number of text lines below the icon.
+</para></listitem>
+</itemizedlist>
+</para>
+</sect3>
+
+<sect3 id="preferences-dialog-viewmodes-compact">
+<title>Compact</title>
+<para>
+<itemizedlist>
+<listitem><para>
+<guilabel>Maximum width</guilabel> controls the maximum width that is reserved for
+the text of a file item.
+</para></listitem>
+</itemizedlist>
+</para>
+</sect3>
+
+<sect3 id="preferences-dialog-viewmodes-details">
+<title>Details</title>
+<para>
+<itemizedlist>
+<listitem><para>
+<guilabel>Expandable folders</guilabel> determines whether any folders that have subfolders
+are displayed in a tree view, where the sub items can be expanded by &LMB; clicking the
+<guiicon>></guiicon> icon and collapsed by clicking the <guiicon>v</guiicon> icon.
+</para></listitem>
+</itemizedlist>
+</para>
+</sect3>
+
+</sect2>
+
+<sect2 id="preferences-dialog-navigation">
+<title>Navigation</title>
+
+<para>
+This group contains settings which control how navigation in the folder
+structure and in archives works.
+
+<screenshot>
+<screeninfo>Screenshot of the Navigation settings in &dolphin;'s preferences dialog</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="preferences-navigation.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Navigation Settings.</phrase>
+</textobject>
+<caption><para>Navigation Settings in &dolphin;'s Preferences Dialog.</para></caption>
+</mediaobject>
+</screenshot>
+
+<itemizedlist>
+
+<listitem><para>
+&dolphin; can be configured to open items with a single mouse click
+(<guilabel>Single-click to open files and folders</guilabel>) or a double mouse
+click (<guilabel>Double-click to open files and folders</guilabel>). In the
+latter case, a single mouse click will select the file or folder.
+</para>
+<note>
+<para>This is a system wide setting and can be changed in the &systemsettings; in the
+<menuchoice><guimenu>Input Devices</guimenu> <guimenuitem>Mouse</guimenuitem></menuchoice>
+module as well.</para>
+</note>
+</listitem>
+
+<listitem><para>
+Archives will be opened inside &dolphin;, and not in an external application, if
+<guilabel>Open Archives as folder</guilabel> is enabled.
+</para></listitem>
+
+<listitem><para>
+If <guilabel>Open folders during drag operations</guilabel> 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.
+</para></listitem>
+
+</itemizedlist>
+
+</para>
+
+</sect2>
+
+<sect2 id="preferences-dialog-services">
+<title>Services</title>
+
+<para>
+This group offers a selection of services that can be shown in the
+<guisubmenu>Actions</guisubmenu> submenu of &dolphin;'s context menu which
+appears when clicking a file or folder with the &RMB;.
+</para>
+
+<screenshot>
+<screeninfo>Screenshot of the Services settings in &dolphin;'s preferences dialog</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="preferences-services.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Services Settings.</phrase>
+</textobject>
+<caption><para>Services Settings in &dolphin;'s Preferences Dialog.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>
+Using the <guibutton>Download New Services</guibutton> you can fetch additional
+services for the context menu.
+</para>
+<para>
+If you have installed &dolphin;'s plugins for <guilabel>Bazaar</guilabel>,
+<guilabel>Mercurial</guilabel>, <guilabel>Git</guilabel> or
+<guilabel>Subversion</guilabel> 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;
+</para>
+<para>
+In the service list you can also choose if the <guimenuitem>Delete</guimenuitem>,
+<guimenuitem>Copy To</guimenuitem>, and <guimenuitem>Move To</guimenuitem>
+commands are shown in the context menu.
+</para>
+<para>
+&dolphin; has to be restarted to activate the changes for some of these settings.
+<!--FIXME wrong for Copy To + Move To + Delete, what about the other items?-->
+</para>
+
+</sect2>
+
+<sect2 id="preferences-dialog-trash">
+<title>Trash</title>
+
+<para>
+This group contains settings which control the behavior of the trash.
+
+<screenshot>
+<screeninfo>Screenshot of the Trash settings in &dolphin;'s preferences dialog</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="preferences-trash.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>Trash Settings.</phrase>
+</textobject>
+<caption><para>Trash Settings in &dolphin;'s Preferences Dialog.</para></caption>
+</mediaobject>
+</screenshot>
+
+<itemizedlist>
+
+<listitem><para>
+Files which are older than a configurable number of days can be deleted automatically.
+</para></listitem>
+
+<listitem><para>
+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.
+</para></listitem>
+
+</itemizedlist>
+
+</para>
+
+</sect2>
+
+<sect2 id="preferences-dialog-general">
+<title>General</title>
+
+<para>
+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>
+<screeninfo>Screenshot of the General settings in &dolphin;'s preferences dialog</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="preferences-general-behavior.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>General Settings.</phrase>
+</textobject>
+<caption><para>General Settings in &dolphin;'s Preferences Dialog.</para></caption>
+</mediaobject>
+</screenshot>
+
+</para>
+
+<sect3 id="preferences-dialog-general-behavior">
+<title>Behavior Tab</title>
+
+<para>
+
+<itemizedlist>
+
+<listitem><para>
+In the <guilabel>View</guilabel> section, you can configure whether the
+<link linkend="view-properties"> view properties</link> are stored for each
+folder or if common view properties are to be used for all folders.
+</para></listitem>
+<listitem><para>
+When hovering over a file or folder with the mouse, a small window with relevant
+information is shown if <guilabel>Show tooltips</guilabel> is enabled.
+</para></listitem>
+
+<listitem><para>
+<guilabel>Show selection marker</guilabel> shows a small <guibutton>+</guibutton>
+or <guibutton>-</guibutton> 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.
+</para></listitem>
+
+<listitem><para>
+<guilabel>Natural sorting of items</guilabel> controls how items are sorted in
+the view. If this option is enabled, the sort order of three example files
+will be
+<orderedlist>
+<listitem><para>File1,</para></listitem>
+<listitem><para>File2,</para></listitem>
+<listitem><para>File10.</para></listitem>
+</orderedlist>
+If this option is disabled, the normal alphabetical sorting will be used, which
+leads to the sort order
+<orderedlist>
+<listitem><para>File1,</para></listitem>
+<listitem><para>File10,</para></listitem>
+<listitem><para>File2.</para></listitem>
+</orderedlist>
+</para></listitem>
+
+<listitem><para>
+Enable <guilabel>Rename inline</guilabel> 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.
+</para></listitem>
+
+</itemizedlist>
+
+</para>
+
+</sect3>
+
+<sect3 id="preferences-dialog-general-previews">
+<title>Previews Tab</title>
+
+<para>
+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.
+</para>
+<para>
+If previews are enabled for folders, previews of some files in the folder will
+be shown inside a folder's icon.
+</para>
+</sect3>
+
+<sect3 id="preferences-dialog-general-confirmations">
+<title>Confirmations Tab</title>
+<para>
+In the ask for confirmation section, you can enable warning dialogs that
+are shown before potentially harmful actions .
+</para>
+<warning><para>The confirmation settings for <guilabel>Moving files or folders to trash</guilabel> and
+<guilabel>Deleting files or folders</guilabel> affect file operations in &dolphin;, &konqueror;,
+<application>Gwenview</application> and all &kde; applications using the default &kde; file dialog,
+whereas <guilabel>Closing Dolphin windows
+ with multiple tabs</guilabel> is a &dolphin; <!--and &konqueror;--> specific setting.</para></warning>
+</sect3>
+
+<sect3 id="preferences-dialog-general-statusbar">
+<title>Status Bar Tab</title>
+
+<para>
+In this tab, some additional items can be enabled for the status bar, provided
+the status bar is wide enough:
+
+<itemizedlist>
+
+<listitem><para>
+A <guilabel>zoom slider</guilabel> which can be used to change the icon size quickly.
+</para></listitem>
+
+<listitem><para>
+A bar that shows how much space is free on the current drive.
+</para></listitem>
+
+</itemizedlist>
+
+</para>
+<note><para>
+Since &dolphin; 4.9 the <guimenuitem>Delete</guimenuitem>,
+<guimenuitem>Copy To</guimenuitem>, and <guimenuitem>Move To</guimenuitem>
+commands of the context menu have to be enabled on the Services page.
+</para></note>
+
+</sect3>
+
+</sect2>
+
+</sect1>
+<!-- begin copy to konqueror filemanager.docbook -->
+<sect1 id="view-properties">
+<title>Folder View Properties</title>
+
+<para>
+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:
+</para>
+<itemizedlist>
+
+<listitem><para>
+The view mode (Icons, Compact, Details)
+</para></listitem>
+
+<listitem><para>
+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
+</para></listitem>
+
+<listitem><para>
+Sorting of folders and files – are folders shown first or not?
+</para></listitem>
+
+<listitem><para>
+Previews – are they shown instead of icons (based on the settings made in
+<link linkend="preferences-dialog-general-previews"><guilabel>Previews</guilabel>
+tab of &kappname;'s General settings</link>) or not?
+</para></listitem>
+
+<listitem><para>
+Are items shown in groups in the views?
+</para></listitem>
+
+<listitem><para>
+Are hidden files shown?
+</para></listitem>
+
+<listitem><para>
+What additional information (besides the name) is shown in the Icons or Details view?
+</para></listitem>
+
+</itemizedlist>
+<para>
+The view properties can be configured in the
+<menuchoice><guimenu>View</guimenu></menuchoice> menu, some (such as the view
+mode) can also be changed using toolbar buttons.
+</para>
+
+<sect2 id="view-properties-dialog">
+<title>The View Properties Dialog</title>
+
+<para>
+
+<screenshot>
+<screeninfo>Screenshot of the View Properties dialog</screeninfo>
+<mediaobject>
+<imageobject>
+<imagedata fileref="viewproperties-dialog.png" format="PNG"/>
+</imageobject>
+<textobject>
+<phrase>The View Properties dialog.</phrase>
+</textobject>
+<caption><para>The View Properties Dialog.</para></caption>
+</mediaobject>
+</screenshot>
+
+The <guilabel>View Properties</guilabel> 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 <guilabel>Apply View Properties To</guilabel> section.
+</para>
+
+<para>
+If <guilabel>Use these view properties as default</guilabel> is enabled, the chosen view
+properties will also be used for all folders which do not have customized view
+properties yet.
+</para>
+
+</sect2>
+
+</sect1>
+<!-- end copy to konqueror filemanager.docbook -->
+</chapter>
+
+<chapter id="command-reference">
+<title>Command Reference</title>
+<para>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
+<guibutton>Control</guibutton> toolbar button.</para>
+
+<sect1 id="commands-menubar">
+<title>The Menubar in &dolphin;'s Main Window</title>
+
+<sect2>
+<title>The File Menu</title>
+<para>
+<variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guisubmenu>Create New</guisubmenu>
+</menuchoice></term>
+<listitem><para><action>Creates a new object (such as a folder or a text file) in the current
+folder.</action></para>
+<para>You will find an explanation of all available objects in &konqueror;'s handbook in the chapter
+<ulink url="help:/konqueror/making.html">Create New</ulink>.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>N</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>New Window</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Opens a new &dolphin; window.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>T</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>New Tab</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Opens a new tab.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>W</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Close Tab</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Closes the current tab.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F2</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Rename</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Renames one currently selected item inline.
+Opens the <link linkend="batch-rename">batch rename dialog</link> if several
+items are selected.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>Del</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Move to Trash</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Moves the currently selected item(s) to the
+trash.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Shift;<keycap>Del</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Delete</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Permanently deletes the currently selected item(s). The items are not moved
+to the trash and cannot be restored.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;<keycap>Return</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Properties</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Shows the properties dialog for the currently selected
+item(s).</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>Q</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Quit</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Exits &dolphin;.</action></para></listitem>
+</varlistentry>
+</variablelist>
+
+</para>
+</sect2>
+
+<sect2>
+<title>The Edit Menu</title>
+<para>
+
+<variablelist>
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>Z</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Undo</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Undoes the last action performed by &dolphin;.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>X</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Cut</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Cuts the currently selected item(s).</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>C</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Copy</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Copies the currently selected item(s).</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>V</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Paste Clipboard Contents...</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>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.
+</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>F</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Find...</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>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.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>A</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Select All</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Selects all files and folders in the current
+folder.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;&Shift;<keycap>A</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Invert Selection</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>
+Selects all unselected items and deselects all selected items in the current folder.
+</action></para></listitem>
+</varlistentry>
+</variablelist>
+</para>
+</sect2>
+
+<sect2>
+<title>The View Menu</title>
+<para>
+
+<variablelist>
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>+</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Zoom In</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Increases the size of icons in the view.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>-</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Zoom Out</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Decreases the size of icons in the view.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guisubmenu>View Mode</guisubmenu>
+</menuchoice></term>
+<listitem><para><action>Changes the view mode to <guimenuitem>Icons</guimenuitem>
+(<keycombo action="simul">&Ctrl;<keycap>1</keycap></keycombo>), <guimenuitem>Compact</guimenuitem>
+(<keycombo action="simul">&Ctrl;<keycap>2</keycap></keycombo>) or <guimenuitem>Details</guimenuitem>
+(<keycombo action="simul">&Ctrl;<keycap>3</keycap></keycombo>).</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guisubmenu>Sort By</guisubmenu>
+</menuchoice></term>
+<listitem><para><action>Changes whether items are sorted</action> by <guimenuitem>Name</guimenuitem>
+or other criteria described in <link linkend="dolphin-view-information">Information in the View</link>.</para>
+<para><guimenuitem>Descending</guimenuitem> reverses the sort order.
+<guimenuitem>Folders First</guimenuitem> sorts folders before files.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guisubmenu>Additional Information</guisubmenu>
+</menuchoice></term>
+<listitem><para><action>Displays additional information</action>
+described in <link linkend="dolphin-view-information">Information in the View</link>.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Preview</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Displays a symbolic preview of the file contents </action> in the different
+view modes.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Show in Groups</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Displays</action> the content of the
+current folder grouped by the option selected in <guimenuitem>Sort By</guimenuitem>.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;<keycap>.</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Show Hidden Files</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Shows all the hidden files and sub-folders within the current
+folder.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F3</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Split</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Enables and disables the split view mode.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F5</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Reload</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Reloads the current folder.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Stop</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Stops loading/reading the contents of the current
+folder.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guisubmenu>Panels</guisubmenu>
+</menuchoice></term>
+<listitem><para><action>Enables and disables</action> the different <link linkend="panels">panels</link>:
+<guimenuitem>Places</guimenuitem> (<keycap>F9</keycap>), <guimenuitem>Information</guimenuitem>
+(<keycap>F11</keycap>), <guimenuitem>Folders</guimenuitem> (<keycap>F7</keycap>),
+<guimenuitem>Terminal</guimenuitem> (<keycap>F4</keycap>).
+With <guimenuitem>Lock Panels</guimenuitem> the panel header with caption and two buttons is
+hidden to save space and the panels are immutable, with <guimenuitem>Unlock Panels</guimenuitem>
+the header is visible and the panel can be moved to the right or left or even
+outside the main window.
+<!-- FIXME Places header always visible ?-->
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycap>F6</keycap>
+</shortcut>
+<guimenu>View</guimenu>
+<guisubmenu>Location Bar</guisubmenu>
+<guimenuitem>Editable Location</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Changes the location bar between the two modes; the
+<link linkend="location-bar-bread-crumb">bread crumb mode</link> and the
+<link linkend="location-bar-editable">editable mode</link>.
+</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>L</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guisubmenu>Location Bar</guisubmenu>
+<guimenuitem>Replace Location</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Switches the location bar to <link linkend="location-bar-editable">editable mode</link>,
+if necessary, and selects the location such that it can be replaced quickly.
+</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Adjust View Properties...</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Opens the <link linkend="view-properties-dialog">View Properties
+Dialog</link>.</action></para></listitem>
+</varlistentry>
+</variablelist>
+
+</para>
+</sect2>
+
+<sect2>
+<title>The Go Menu</title>
+<para>
+
+<variablelist>
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;<keycap>Up</keycap></keycombo>
+</shortcut>
+<guimenu>Go</guimenu>
+<guimenuitem>Up</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Changes to the folder above the current folder.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;<keycap>Left</keycap></keycombo>
+</shortcut>
+<guimenu>Go</guimenu>
+<guimenuitem>Back</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Changes to the previously viewed folder.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;<keycap>Right</keycap></keycombo>
+</shortcut>
+<guimenu>Go</guimenu>
+<guimenuitem>Forward</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Undoes</action> a <quote>Go Back</quote> action.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;<keycap>Home</keycap></keycombo>
+</shortcut>
+<guimenu>Go</guimenu>
+<guimenuitem>Home</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Changes to the users home folder, ⪚
+/home/Peter/.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Go</guimenu>
+<guisubmenu>Recently Closed Tabs</guisubmenu>
+</menuchoice></term>
+<listitem><para><action>Shows a list of recently closed tabs which can
+be reopened.</action></para></listitem>
+</varlistentry>
+</variablelist>
+</para>
+</sect2>
+
+<sect2>
+<title>The Tools Menu</title>
+<para>
+
+<variablelist>
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>I</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Show Filter Bar</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Enables and disables the <link linkend="filter-files">filter bar</link>.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Shift;<keycap>F4</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Open Terminal</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Opens &konsole; within the current folder.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Compare Files</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Compare the currently selected files or folders with
+&kompare;. This action is only enabled if two files or folders are selected.</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guisubmenu>Select Remote Charset</guisubmenu>
+</menuchoice></term>
+<listitem><para><action>Allows you to choose the charset used by a remote
+connection manually.</action></para></listitem>
+</varlistentry>
+</variablelist>
+</para>
+</sect2>
+
+<sect2>
+<title>The Settings and Help Menu</title>
+<para>
+&dolphin; has the common &kde; <guimenu>Settings</guimenu> and <guimenu>Help</guimenu>
+menu items, for more information read the sections about the <ulink url="help:/fundamentals/ui.html#menus-settings"
+>Settings Menu</ulink> and <ulink url="help:/fundamentals/ui.html#menus-help">Help Menu</ulink>
+of the &kde; Fundamentals.
+</para>
+</sect2>
+
+</sect1>
+</chapter>
+
+<chapter id="misc-questions">
+<title>Miscellaneous Questions</title>
+
+<qandaset id="misclist">
+<qandaentry>
+<question>
+<para>Has &dolphin; replaced &konqueror;?</para>
+</question>
+<answer>
+<para>
+&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.
+</para>
+</answer>
+</qandaentry>
+
+<qandaentry>
+<question>
+<para>How can I get involved with the development of &dolphin;?</para>
+</question>
+<answer>
+<para>
+The easiest way to get involved with &dolphin; is to subscribe to the developer
+mailing list <ulink url="https://mail.kde.org/mailman/listinfo/kfm-devel">kfm-devel</ulink>
+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
+<ulink url="mailto:kde-doc-english@kde.org">&kde; Documentation Team</ulink> list.
+</para>
+</answer>
+</qandaentry>
+
+<qandaentry>
+<question>
+<para>How can I submit bug reports?</para>
+</question>
+<answer>
+<para>
+The official channel for submitting bug reports is via the &kde; bug tracking
+system. The &kde; bug tracker can be found at
+<ulink url="http://bugs.kde.org">http://bugs.kde.org</ulink>.
+</para>
+</answer>
+</qandaentry>
+
+<qandaentry>
+<question>
+<para>How can I submit feature requests?</para>
+</question>
+<answer>
+<para>
+The official channel for submitting feature requests is via the &kde; bug
+tracking system. The &kde; bug tracker can be found at
+<ulink url="http://bugs.kde.org">http://bugs.kde.org</ulink>.
+</para>
+
+</answer>
+
+</qandaentry>
+</qandaset>
+</chapter>
+
+<chapter id="credits">
+
+<title>Credits and License</title>
+
+<para>
+&dolphin;
+</para>
+<para>
+Program copyright 2006–2013 Peter Penz <email>peter.penz@gmx.at</email> and
+Frank Reininghaus <email>frank78ac@googlemail.com</email></para>
+<para>
+Contributors:
+<itemizedlist>
+<listitem><para>Cvetoslav Ludmiloff <email>ludmiloff@gmail.com</email></para></listitem>
+<listitem><para>Stefan Monov <email>logixoul@gmail.com</email></para></listitem>
+<listitem><para>Michael Austin <email>tuxedup@users.sourceforge.net</email></para></listitem>
+<listitem><para>&Orville.Bennett; &Orville.Bennett.mail;</para></listitem>
+</itemizedlist>
+</para>
+
+<para>
+Documentation copyright 2005 Peter Penz <email>peter.penz@gmx.at</email>
+</para>
+<para>
+Documentation copyright 2006 &Orville.Bennett; &Orville.Bennett.mail;
+</para>
+<para>
+Documentation copyright 2006 Michael Austin <email>tuxedup@users.sourceforge.net</email>
+</para>
+<para>
+Documentation copyright 2009 Frank Reininghaus <email>frank78ac@googlemail.com</email>
+</para>
+
+<!-- TRANS:CREDIT_FOR_TRANSLATORS -->
+
+&underFDL; <!-- FDL: do not remove -->
+&underGPL; <!-- GPL License -->
+
+</chapter>
+
+<appendix id="installation">
+<title>How to get &dolphin;</title>
+<para>&dolphin; is part of the &package; package which is an essential part of
+&kde;.</para>
+
+<para>For instructions on acquiring &kde; please see <ulink
+url="http://www.kde.org">http://www.kde.org</ulink> or read the chapter
+<ulink url="help:/fundamentals/install.html">Installing &kde;</ulink>
+in the &kde; Fundamentals.</para>
+
+<para>For further information about &dolphin; you might want to visit
+<ulink url="http://dolphin.kde.org">http://dolphin.kde.org</ulink> or
+<ulink url="http://userbase.kde.org/Dolphin">http://userbase.kde.org/Dolphin</ulink>.</para>
+
+</appendix>
+
+&documentation.index;
+</book>
+
+<!--
+Local Variables:
+mode: sgml
+sgml-minimize-attributes:nil
+sgml-general-insert-case:lower
+sgml-indent-step:0
+sgml-indent-data:nil
+End:
+
+vim:tabstop=2:shiftwidth=2:expandtab
+-->
-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
- )
-
-macro_optional_find_package(KFileMetaData)
-set_package_properties(KFileMetaData PROPERTIES
- URL "https://projects.kde.org/kfilemetadata"
- TYPE OPTIONAL
- PURPOSE "For accessing file metadata labels"
- )
-
-if (Baloo_FOUND AND BalooWidgets_FOUND AND KFileMetaData_FOUND)
- set(HAVE_BALOO TRUE)
-endif()
-configure_file(config-baloo.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-baloo.h )
+configure_file(config-baloo.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-baloo.h)
-macro_bool_to_01(X11_Xrender_FOUND HAVE_XRENDER)
-configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h )
+configure_file(config-dolphin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-dolphin.h)
-include_directories( ${KACTIVITIES_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} )
+add_definitions(-DTRANSLATION_DOMAIN=\"dolphin\")
+add_definitions(-Wno-deprecated-declarations)
+remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_URL_CAST_FROM_STRING)
-if(HAVE_BALOO)
- include_directories(${BALOO_INCLUDE_DIR} ${BALOO_WIDGETS_INCLUDE_DIR} ${KFILEMETADATA_INCLUDE_DIR})
+if(X11_Xrender_FOUND)
+ set(HAVE_XRENDER TRUE)
endif()
-add_subdirectory(tests)
+configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h)
########### next target ###############
)
endif()
-kde4_add_kcfg_files(dolphinprivate_LIB_SRCS
+kconfig_add_kcfg_files(dolphinprivate_LIB_SRCS
settings/dolphin_compactmodesettings.kcfgc
settings/dolphin_directoryviewpropertysettings.kcfgc
settings/dolphin_detailsmodesettings.kcfgc
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
+ KF5::KDELibs4Support
+ KF5::Konq
+ KF5::NewStuff
)
if(HAVE_BALOO)
target_link_libraries(
- dolphinprivate
- ${BALOO_LIBRARIES}
- ${BALOO_WIDGETS_LIBRARY}
- ${KFILEMETADATA_LIBRARY}
+ dolphinprivate PUBLIC
+ KF5::FileMetaData
+ KF5::Baloo
+ KF5::BalooNaturalQueryParser
+ KF5::BalooWidgets
)
endif()
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 ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
##########################################
set(dolphinpart_SRCS
dolphinpart.cpp
+ dolphinpart_ext.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")
-
-kde4_add_plugin(dolphinpart ${dolphinpart_SRCS})
+add_library(dolphinpart MODULE ${dolphinpart_SRCS})
-target_link_libraries(dolphinpart dolphinprivate konq ${KDE4_KPARTS_LIBS} ${KDE4_KFILE_LIBS})
+target_link_libraries(dolphinpart
+ dolphinprivate
+ KF5::Konq
+ KF5::KDELibs4Support
+)
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 dolphinpart.desktop DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES views/versioncontrol/fileviewversioncontrolplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
##########################################
views/zoomlevelinfo.cpp
)
-kde4_add_kcfg_files(dolphin_SRCS
+kconfig_add_kcfg_files(dolphin_SRCS
panels/folders/dolphin_folderspanelsettings.kcfgc
panels/information/dolphin_informationpanelsettings.kcfgc
panels/places/dolphin_placespanelsettings.kcfgc
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
+ KF5::Konq
dolphinprivate
- knewstuff3
- ${KDE4_SOLID_LIBS}
- ${KDE4_PHONON_LIBS}
+ KF5::NewStuff
+ KF5::Parts
+ KF5::KCMUtils
+ KF5::Solid
+ Phonon::phonon4qt5
+ KF5::KDELibs4Support
)
-if(HAVE_BALOO)
- target_link_libraries(kdeinit_dolphin
- ${BALOO_LIBRARIES}
- ${BALOO_WIDGETS_LIBRARY}
- )
-endif()
-
-if (KActivities_FOUND)
+if (KF5Activities_FOUND)
target_link_libraries(
kdeinit_dolphin
- ${KACTIVITIES_LIBRARY}
+ KF5::Activities
)
-endif (KActivities_FOUND)
+endif()
-install(TARGETS kdeinit_dolphin ${INSTALL_TARGETS_DEFAULT_ARGS})
-install(TARGETS dolphin ${INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS kdeinit_dolphin ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS dolphin ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
##########################################
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
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 KF5::KDELibs4Support dolphinprivate)
+target_link_libraries(kcm_dolphinnavigation KF5::KDELibs4Support dolphinprivate)
+target_link_libraries(kcm_dolphinservices KF5::KDELibs4Support dolphinprivate)
+target_link_libraries(kcm_dolphingeneral KF5::KDELibs4Support dolphinprivate)
install(TARGETS kcm_dolphinviewmodes DESTINATION ${PLUGIN_INSTALL_DIR} )
install(TARGETS kcm_dolphinnavigation 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})
+
+add_library(kio_filenamesearch MODULE ${kio_search_PART_SRCS})
+
+target_link_libraries(kio_filenamesearch KF5::KDELibs4Support)
+
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
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
install( PROGRAMS settings/services/servicemenuinstallation DESTINATION ${BIN_INSTALL_DIR} )
install( PROGRAMS settings/services/servicemenudeinstallation DESTINATION ${BIN_INSTALL_DIR} )
+add_subdirectory(tests)
--- /dev/null
+
+/* Define to 1 if you have the KActivities library. */
+#cmakedefine KF5Activities_FOUND 1
+
#include <KDebug>
#include <KRun>
#include <KUrl>
+#include <KGlobal>
DolphinApplication::DolphinApplication() :
m_mainWindow(0)
{
- KGlobal::locale()->insertCatalog("libkonq"); // Needed for applications using libkonq
+ //KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
+//KLocale::global()->insertCatalog("libkonq"); // Needed for applications using libkonq
m_mainWindow = new DolphinMainWindow();
m_mainWindow->setAttribute(Qt::WA_DeleteOnClose);
}
}
-#include "dolphinapplication.moc"
#include <KFileItemListProperties>
#include <KGlobal>
#include <KIconLoader>
-#include <KIO/NetAccess>
-#include <KMenu>
+#include <KIO/RestoreJob>
+#include <KIO/EmptyTrashJob>
+#include <KIO/JobUiDelegate>
+#include <KJobUiDelegate>
+#include <KJobWidgets>
+#include <QMenu>
#include <KMenuBar>
#include <KMessageBox>
#include <KMimeTypeTrader>
+#include <KMimeType>
#include <KNewFileMenu>
-#include <konqmimedata.h>
#include <konq_operations.h>
#include <KService>
#include <KLocale>
#include <KPropertiesDialog>
#include <KStandardAction>
-#include <KStandardDirs>
#include <KToolBar>
#include <panels/places/placesitem.h>
const QPoint& pos,
const KFileItem& fileInfo,
const KUrl& baseUrl) :
- KMenu(parent),
+ QMenu(parent),
m_pos(pos),
m_mainWindow(parent),
m_fileInfo(fileInfo),
if (m_removeAction && ev->key() == Qt::Key_Shift) {
m_removeAction->update();
}
- KMenu::keyPressEvent(ev);
+ QMenu::keyPressEvent(ev);
}
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);
addShowMenuBarAction();
if (exec(m_pos) == emptyTrashAction) {
- KonqOperations::emptyTrash(m_mainWindow);
+ KIO::JobUiDelegate uiDelegate;
+ uiDelegate.setWindow(m_mainWindow);
+ if (uiDelegate.askDeleteConfirmation(QList<QUrl>(), KIO::JobUiDelegate::EmptyTrash, KIO::JobUiDelegate::DefaultConfirmation)) {
+ KIO::Job* job = KIO::emptyTrash();
+ KJobWidgets::setWindow(job, m_mainWindow);
+ job->ui()->setAutoErrorHandlingEnabled(true);
+ }
}
}
selectedUrls.append(item.url());
}
- KonqOperations::restoreTrashedItems(selectedUrls, m_mainWindow);
+ KIO::RestoreJob *job = KIO::restoreFromTrash(selectedUrls);
+ KJobWidgets::setWindow(job, m_mainWindow);
+ job->uiDelegate()->setAutoErrorHandlingEnabled(true);
}
}
{
Q_ASSERT(!m_fileInfo.isNull());
+ QAction* openParentAction = 0;
QAction* openParentInNewWindowAction = 0;
QAction* openParentInNewTabAction = 0;
QAction* addToPlacesAction = 0;
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();
// 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.protocol().contains("search") || m_baseUrl.protocol().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);
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) {
// 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"));
}
// 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());
const bool isDir = !m_fileInfo.isNull() && m_fileInfo.isDir();
if (isDir && (m_selectedItems.count() == 1)) {
const QPair<bool, QString> pasteInfo = KonqOperations::pasteInfo(m_fileInfo.url());
- action = new QAction(KIcon("edit-paste"), i18nc("@action:inmenu", "Paste Into Folder"), this);
+ action = new QAction(QIcon::fromTheme("edit-paste"), i18nc("@action:inmenu", "Paste Into Folder"), this);
action->setEnabled(pasteInfo.first);
- connect(action, SIGNAL(triggered()), m_mainWindow, SLOT(pasteIntoFolder()));
+ connect(action, &QAction::triggered, m_mainWindow, &DolphinMainWindow::pasteIntoFolder);
} else {
action = m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::Paste));
}
const KConfig config("kservicemenurc", KConfig::NoGlobals);
const KConfigGroup showGroup = config.group("Show");
- foreach (const KSharedPtr<KService>& service, pluginServices) {
+ foreach (const KService::Ptr& service, pluginServices) {
if (!showGroup.readEntry(service->desktopEntryName(), true)) {
// The plugin has been disabled
continue;
}
}
-#include "dolphincontextmenu.moc"
#include <KService>
#include <KUrl>
#include <konq_copytomenu.h>
-#include <KMenu>
+#include <QMenu>
#include <QObject>
* - 'Actions': Contains all actions which can be applied to the
* given item.
*/
-class DolphinContextMenu : public KMenu
+class DolphinContextMenu : public QMenu
{
Q_OBJECT
enum Command
{
None,
+ OpenParentFolder,
OpenParentFolderInNewWindow,
OpenParentFolderInNewTab
};
return m_locked;
}
-#include "dolphindockwidget.moc"
#include "dolphin_generalsettings.h"
#include <KAcceleratorManager>
-#include <KAction>
#include <KActionCollection>
#include <KActionMenu>
#include <KConfig>
#include <kdualaction.h>
#include <KFileDialog>
#include <KGlobal>
+#include <KDialog>
+#include <KJobWidgets>
#include <KLineEdit>
#include <KToolBar>
-#include <KIcon>
#include <KIconLoader>
#include <KIO/NetAccess>
#include <KIO/JobUiDelegate>
#include <KInputDialog>
#include <KLocale>
#include <KProtocolManager>
-#include <KMenu>
+#include <QMenu>
#include <KMenuBar>
#include <KMessageBox>
#include <KFileItemListProperties>
-#include <konqmimedata.h>
#include <KProtocolInfo>
#include <KRun>
#include <KShell>
-#include <KStandardDirs>
#include <kstatusbar.h>
#include <KStandardAction>
#include <KToggleAction>
#include <KUrlNavigator>
-#include <KUrl>
#include <KUrlComboBox>
#include <KToolInvocation>
#include <QKeyEvent>
#include <QClipboard>
#include <QToolButton>
+#include <QSplitter>
+#include <QTimer>
+#include <QStandardPaths>
+#include <QPushButton>
namespace {
// Used for GeneralSettings::version() to determine whether
{
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<void(KIO::FileUndoManager::*)(bool)>(&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);
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();
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());
m_tabWidget->openNewActivatedTab();
}
-void DolphinMainWindow::openNewTab(const KUrl& primaryUrl, const KUrl& secondaryUrl)
+void DolphinMainWindow::openNewTab(const KUrl& url)
{
- m_tabWidget->openNewTab(primaryUrl, secondaryUrl);
+ m_tabWidget->openNewTab(url);
}
-void DolphinMainWindow::openNewActivatedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl)
+void DolphinMainWindow::openNewActivatedTab(const KUrl& url)
{
- m_tabWidget->openNewActivatedTab(primaryUrl, secondaryUrl);
+ m_tabWidget->openNewActivatedTab(url);
}
void DolphinMainWindow::openInNewTab()
}
if (!newWindowUrl.isEmpty()) {
- KRun::run("dolphin %u", KUrl::List() << newWindowUrl, this);
+ KRun::run("dolphin %u", QList<QUrl>() << newWindowUrl, this);
}
}
// 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);
+ 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(),
}
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:
}
GeneralSettings::setVersion(CurrentDolphinVersion);
- GeneralSettings::self()->writeConfig();
+ GeneralSettings::self()->save();
KXmlGuiWindow::closeEvent(event);
}
const KUrl 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;
// 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
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", QList<QUrl>() << KIO::upUrl(item.url()), this);
break;
}
case DolphinContextMenu::OpenParentFolderInNewTab:
- openNewTab(item.url().upUrl());
+ openNewTab(KIO::upUrl(item.url()));
break;
case DolphinContextMenu::None:
void DolphinMainWindow::updateControlMenu()
{
- KMenu* menu = qobject_cast<KMenu*>(sender());
+ QMenu* menu = qobject_cast<QMenu*>(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();
}
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);
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)));
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"));
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();
{
// 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, QList<QKeySequence>() << QKeySequence(Qt::CTRL | Qt::Key_T) << QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_N));
+ connect(newTab, &QAction::triggered, this, static_cast<void(DolphinMainWindow::*)()>(&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<void(DolphinTabWidget::*)()>(&DolphinTabWidget::closeTab));
KStandardAction::quit(this, SLOT(quit()), actionCollection());
// 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:
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<KToggleAction>("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(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)));
-
- 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<QKeySequence> nextTabKeys;
- nextTabKeys.append(KStandardShortcut::tabNext().primary());
+ nextTabKeys.append(KStandardShortcut::tabNext().first()); //TODO: is this correct
nextTabKeys.append(QKeySequence(Qt::CTRL | Qt::Key_Tab));
QList<QKeySequence> prevTabKeys;
- prevTabKeys.append(KStandardShortcut::tabPrev().primary());
+ prevTabKeys.append(KStandardShortcut::tabPrev().first()); //TODO: is this correct
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()
KDualAction* lockLayoutAction = actionCollection()->add<KDualAction>("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);
+ InformationPanel* infoPanel = new InformationPanel(infoDock);
infoPanel->setCustomContextMenuActions(QList<QAction*>() << lockLayoutAction);
- connect(infoPanel, SIGNAL(urlActivated(KUrl)), this, SLOT(handleUrl(KUrl)));
+ 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"));
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::slotPanelErrorMessage);
// Setup "Terminal"
#ifndef Q_OS_WIN
terminalDock->setLocked(lock);
terminalDock->setObjectName("terminalDock");
terminalDock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
- Panel* terminalPanel = new TerminalPanel(terminalDock);
+ TerminalPanel* terminalPanel = new TerminalPanel(terminalDock);
terminalPanel->setCustomContextMenuActions(QList<QAction*>() << 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) {
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, &PlacesPanel::placeActivated,
+ this, &DolphinMainWindow::slotPlaceActivated);
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::errorMessage,
+ this, &DolphinMainWindow::slotPanelErrorMessage);
+ 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());
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()
m_updateToolBarTimer = 0;
}
-bool DolphinMainWindow::addActionToMenu(QAction* action, KMenu* menu)
+bool DolphinMainWindow::addActionToMenu(QAction* action, QMenu* menu)
{
Q_ASSERT(action);
Q_ASSERT(menu);
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<QAction*>)),
- this, SLOT(openContextMenu(QPoint,KFileItem,KUrl,QList<QAction*>)));
- 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::slotRequestItemInfo);
+ 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::goBackRequested,
+ this, static_cast<void(DolphinMainWindow::*)()>(&DolphinMainWindow::goBack));
+ connect(view, &DolphinView::goForwardRequested,
+ this, static_cast<void(DolphinMainWindow::*)()>(&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()
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"));
}
}
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() :
}
}
-#include "dolphinmainwindow.moc"
#include <kio/fileundomanager.h>
#include <ksortablelist.h>
#include <kxmlguiwindow.h>
-#include <KIcon>
+#include <QIcon>
+#include <KUrl>
#include <QList>
#include <QWeakPointer>
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.
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());
+ void openNewTab(const KUrl& url);
/**
- * Opens a new tab showing the URL \a primaryUrl and the optional URL
- * \a secondaryUrl and activates the tab.
+ * Opens a new tab showing the URL \a url and activates the tab.
*/
- void openNewActivatedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl = KUrl());
+ void openNewActivatedTab(const KUrl& url);
/**
* Opens the selected folder in a new tab.
* 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
* 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);
}
}
-#include "dolphinnewfilemenu.moc"
#include <KPluginFactory>
#include <KRun>
#include <KToggleAction>
+#include <KGlobal>
#include <KIO/NetAccess>
#include <KToolInvocation>
#include <kauthorized.h>
-#include <KMenu>
+#include <QMenu>
#include <KInputDialog>
#include <KProtocolInfo>
#include <kdeversion.h>
-#if KDE_IS_VERSION(4, 9, 2)
#include "dolphinpart_ext.h"
-#endif
#include "dolphinnewfilemenu.h"
#include "views/dolphinview.h"
,m_removeAction(0)
{
Q_UNUSED(args)
- setComponentData(DolphinPartFactory::componentData(), false);
+#pragma message("TODO: port to KF5")
+ //setComponentData(DolphinPartFactory::componentData(), false);
m_extension = new DolphinPartBrowserExtension(this);
// make sure that other apps using this part find Dolphin's view-file-columns icons
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<void(DolphinPart::*)()>(&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<QAction*>)),
- this, SLOT(slotOpenContextMenu(QPoint,KFileItem,KUrl,QList<QAction*>)));
- 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<void(DolphinPartBrowserExtension::*)(const KFileItemList&)>(&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";
}
-#endif
createActions();
m_actionHandler->updateViewActions();
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", "Trash"), QString("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);
}
}
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);
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.
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;
void DolphinPart::slotFindFile()
{
- KRun::run("kfind", url(), widget());
+ KRun::run("kfind", QList<QUrl>() << url(), widget());
}
void DolphinPart::updateNewMenu()
#ifndef DOLPHINPART_H
#define DOLPHINPART_H
-#include <kparts/part.h>
+#include <KParts/ReadOnlyPart>
+#include <KUrl>
#include <QItemSelectionModel>
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;
* 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; }
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)
emit listingEvent(KParts::ListingNotificationExtension::ItemsDeleted, items);
}
-#include "dolphinpart_ext.moc"
#include <kparts/browserextension.h>
#include <kparts/fileinfoextension.h>
#include <kparts/listingextension.h>
+#include <KUrl>
class DolphinPart;
#include <KLocalizedString>
#include <KAcceleratorManager>
-#include <KMimeType>
-#include <KMenu>
+#include <kio/global.h>
+#include <QMenu>
DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject* parent) :
- KActionMenu(KIcon("edit-undo"), i18n("Recently Closed Tabs"), parent)
+ KActionMenu(QIcon::fromTheme("edit-undo"), i18n("Recently Closed Tabs"), parent)
{
setDelayed(false);
setEnabled(false);
m_clearListAction = new QAction(i18n("Empty Recently Closed Tabs"), this);
- m_clearListAction->setIcon(KIcon("edit-clear-list"));
+ m_clearListAction->setIcon(QIcon::fromTheme("edit-clear-list"));
addAction(m_clearListAction);
addSeparator();
QAction* action = new QAction(menu());
action->setText(url.path());
action->setData(state);
- const QString iconName = KMimeType::iconNameForUrl(url);
- action->setIcon(KIcon(iconName));
+ const QString iconName = KIO::iconNameForUrl(url);
+ action->setIcon(QIcon::fromTheme(iconName));
// Add the closed tab menu entry after the separator and
// "Empty Recently Closed Tabs" entry
#include <KActionMenu>
#include <KUrl>
-class DolphinTabPage;
class QAction;
class DolphinRecentTabsMenu : public KActionMenu
m_collection(collection)
{
update();
- connect(this, SIGNAL(triggered()), this, SLOT(slotRemoveActionTriggered()));
+ connect(this, &DolphinRemoveAction::triggered, this, &DolphinRemoveAction::slotRemoveActionTriggered);
}
void DolphinRemoveAction::slotRemoveActionTriggered()
if (m_action) {
setIcon(m_action->icon());
- setShortcuts(m_action->shortcuts());
+ m_collection->setDefaultShortcuts(this, m_action->shortcuts());
setEnabled(m_action->isEnabled());
}
}
#include <QTimer>
#include <QDragEnterEvent>
#include <KLocalizedString>
-#include <KMenu>
-#include <KIcon>
+#include <QMenu>
+#include <QIcon>
#include <KUrl>
DolphinTabBar::DolphinTabBar(QWidget* parent) :
if (index >= 0) {
// Tab context menu
- KMenu menu(this);
+ QMenu menu(this);
- QAction* newTabAction = menu.addAction(KIcon("tab-new"), i18nc("@action:inmenu", "New Tab"));
- QAction* detachTabAction = menu.addAction(KIcon("tab-detach"), i18nc("@action:inmenu", "Detach Tab"));
- QAction* closeOtherTabsAction = menu.addAction(KIcon("tab-close-other"), i18nc("@action:inmenu", "Close Other Tabs"));
- QAction* closeTabAction = menu.addAction(KIcon("tab-close"), i18nc("@action:inmenu", "Close Tab"));
+ QAction* newTabAction = menu.addAction(QIcon::fromTheme("tab-new"), i18nc("@action:inmenu", "New Tab"));
+ QAction* detachTabAction = menu.addAction(QIcon::fromTheme("tab-detach"), i18nc("@action:inmenu", "Detach Tab"));
+ QAction* closeOtherTabsAction = menu.addAction(QIcon::fromTheme("tab-close-other"), i18nc("@action:inmenu", "Close Other Tabs"));
+ QAction* closeTabAction = menu.addAction(QIcon::fromTheme("tab-close"), i18nc("@action:inmenu", "Close Tab"));
QAction* selectedAction = menu.exec(event->globalPos());
if (selectedAction == newTabAction) {
#include <QApplication>
#include <KConfigGroup>
-#include <KIcon>
+#include <kio/global.h>
#include <KRun>
DolphinTabWidget::DolphinTabWidget(QWidget* parent) :
this, SIGNAL(activeViewChanged(DolphinViewContainer*)));
connect(tabPage, SIGNAL(activeViewUrlChanged(KUrl)),
this, SLOT(tabUrlChanged(KUrl)));
- addTab(tabPage, KIcon(KMimeType::iconNameForUrl(primaryUrl)), tabName(primaryUrl));
+ addTab(tabPage, QIcon::fromTheme(KIO::iconNameForUrl(primaryUrl)), tabName(primaryUrl));
if (focusWidget) {
// The DolphinViewContainer grabbed the keyboard focus. As the tab is opened
const int index = indexOf(qobject_cast<QWidget*>(sender()));
if (index >= 0) {
tabBar()->setTabText(index, tabName(url));
- tabBar()->setTabIcon(index, KIcon(KMimeType::iconNameForUrl(url)));
+ tabBar()->setTabIcon(index, QIcon::fromTheme(KIO::iconNameForUrl(url)));
// Emit the currentUrlChanged signal if the url of the current tab has been changed.
if (index == currentIndex()) {
#include <QBoxLayout>
#include <QTimer>
#include <QScrollBar>
+#include <QMimeData>
#include <KDesktopFile>
#include <KFileItemDelegate>
#include <KIO/PreviewJob>
#include <KMessageWidget>
#include <KNewFileMenu>
-#include <konqmimedata.h>
#include <konq_operations.h>
#include <KShell>
#include <KUrl>
m_topLayout->setMargin(0);
m_urlNavigator = new KUrlNavigator(new KFilePlacesModel(this), url, this);
- connect(m_urlNavigator, SIGNAL(urlsDropped(KUrl,QDropEvent*)),
- this, SLOT(dropUrls(KUrl,QDropEvent*)));
- connect(m_urlNavigator, SIGNAL(activated()),
- this, SLOT(activate()));
- connect(m_urlNavigator->editor(), SIGNAL(completionModeChanged(KGlobalSettings::Completion)),
- this, SLOT(saveUrlCompletionMode(KGlobalSettings::Completion)));
+ connect(m_urlNavigator, &KUrlNavigator::urlsDropped,
+ this, &DolphinViewContainer::dropUrls);
+ connect(m_urlNavigator, &KUrlNavigator::activated,
+ this, &DolphinViewContainer::activate);
+ connect(m_urlNavigator->editor(), &KUrlComboBox::completionModeChanged,
+ this, &DolphinViewContainer::saveUrlCompletionMode);
const GeneralSettings* settings = GeneralSettings::self();
m_urlNavigator->setUrlEditable(settings->editableUrl());
m_urlNavigator->setShowFullPath(settings->showFullPath());
m_urlNavigator->setHomeUrl(KUrl(settings->homeUrl()));
KUrlComboBox* editor = m_urlNavigator->editor();
- editor->setCompletionMode(KGlobalSettings::Completion(settings->urlCompletionMode()));
+ editor->setCompletionMode(KCompletion::CompletionMode(settings->urlCompletionMode()));
m_searchBox = new DolphinSearchBox(this);
m_searchBox->hide();
- connect(m_searchBox, SIGNAL(activated()), this, SLOT(activate()));
- connect(m_searchBox, SIGNAL(closeRequest()), this, SLOT(closeSearchBox()));
- connect(m_searchBox, SIGNAL(searchRequest()), this, SLOT(startSearching()));
- connect(m_searchBox, SIGNAL(returnPressed(QString)), this, SLOT(requestFocus()));
+ connect(m_searchBox, &DolphinSearchBox::activated, this, &DolphinViewContainer::activate);
+ connect(m_searchBox, &DolphinSearchBox::closeRequest, this, &DolphinViewContainer::closeSearchBox);
+ connect(m_searchBox, &DolphinSearchBox::searchRequest, this, &DolphinViewContainer::startSearching);
+ connect(m_searchBox, &DolphinSearchBox::returnPressed, this, &DolphinViewContainer::requestFocus);
m_messageWidget = new KMessageWidget(this);
m_messageWidget->setCloseButtonVisible(true);
m_messageWidget->hide();
m_view = new DolphinView(url, this);
- connect(m_view, SIGNAL(urlChanged(KUrl)), m_urlNavigator, SLOT(setUrl(KUrl)));
- connect(m_view, SIGNAL(urlChanged(KUrl)), m_messageWidget, SLOT(hide()));
- connect(m_view, SIGNAL(directoryLoadingCompleted()), m_messageWidget, SLOT(hide()));
- connect(m_view, SIGNAL(writeStateChanged(bool)), this, SIGNAL(writeStateChanged(bool)));
- connect(m_view, SIGNAL(requestItemInfo(KFileItem)), this, SLOT(showItemInfo(KFileItem)));
- connect(m_view, SIGNAL(itemActivated(KFileItem)), this, SLOT(slotItemActivated(KFileItem)));
- connect(m_view, SIGNAL(itemsActivated(KFileItemList)), this, SLOT(slotItemsActivated(KFileItemList)));
- connect(m_view, SIGNAL(redirection(KUrl,KUrl)), this, SLOT(redirect(KUrl,KUrl)));
- connect(m_view, SIGNAL(directoryLoadingStarted()), this, SLOT(slotDirectoryLoadingStarted()));
- connect(m_view, SIGNAL(directoryLoadingCompleted()), this, SLOT(slotDirectoryLoadingCompleted()));
- connect(m_view, SIGNAL(directoryLoadingCanceled()), this, SLOT(slotDirectoryLoadingCanceled()));
- connect(m_view, SIGNAL(itemCountChanged()), this, SLOT(delayedStatusBarUpdate()));
- connect(m_view, SIGNAL(directoryLoadingProgress(int)), this, SLOT(updateDirectoryLoadingProgress(int)));
- connect(m_view, SIGNAL(directorySortingProgress(int)), this, SLOT(updateDirectorySortingProgress(int)));
- connect(m_view, SIGNAL(selectionChanged(KFileItemList)), this, SLOT(delayedStatusBarUpdate()));
- connect(m_view, SIGNAL(urlAboutToBeChanged(KUrl)), this, SLOT(slotViewUrlAboutToBeChanged(KUrl)));
- connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(showErrorMessage(QString)));
- connect(m_view, SIGNAL(urlIsFileError(KUrl)), this, SLOT(slotUrlIsFileError(KUrl)));
- connect(m_view, SIGNAL(activated()), this, SLOT(activate()));
-
- connect(m_urlNavigator, SIGNAL(urlAboutToBeChanged(KUrl)),
- this, SLOT(slotUrlNavigatorLocationAboutToBeChanged(KUrl)));
- connect(m_urlNavigator, SIGNAL(urlChanged(KUrl)),
- this, SLOT(slotUrlNavigatorLocationChanged(KUrl)));
- connect(m_urlNavigator, SIGNAL(historyChanged()),
- this, SLOT(slotHistoryChanged()));
- connect(m_urlNavigator, SIGNAL(returnPressed()),
- this, SLOT(slotReturnPressed()));
+ connect(m_view, &DolphinView::urlChanged,
+ m_urlNavigator, &KUrlNavigator::setUrl);
+ connect(m_view, &DolphinView::urlChanged,
+ m_messageWidget, &KMessageWidget::hide);
+ connect(m_view, &DolphinView::directoryLoadingCompleted,
+ m_messageWidget, &KMessageWidget::hide);
+ connect(m_view, &DolphinView::writeStateChanged,
+ this, &DolphinViewContainer::writeStateChanged);
+ connect(m_view, &DolphinView::requestItemInfo,
+ this, &DolphinViewContainer::showItemInfo);
+ connect(m_view, &DolphinView::itemActivated,
+ this, &DolphinViewContainer::slotItemActivated);
+ connect(m_view, &DolphinView::itemsActivated,
+ this, &DolphinViewContainer::slotItemsActivated);
+ connect(m_view, &DolphinView::redirection,
+ this, &DolphinViewContainer::redirect);
+ connect(m_view, &DolphinView::directoryLoadingStarted,
+ this, &DolphinViewContainer::slotDirectoryLoadingStarted);
+ connect(m_view, &DolphinView::directoryLoadingCompleted,
+ this, &DolphinViewContainer::slotDirectoryLoadingCompleted);
+ connect(m_view, &DolphinView::directoryLoadingCanceled,
+ this, &DolphinViewContainer::slotDirectoryLoadingCanceled);
+ connect(m_view, &DolphinView::itemCountChanged,
+ this, &DolphinViewContainer::delayedStatusBarUpdate);
+ connect(m_view, &DolphinView::directoryLoadingProgress,
+ this, &DolphinViewContainer::updateDirectoryLoadingProgress);
+ connect(m_view, &DolphinView::directorySortingProgress,
+ this, &DolphinViewContainer::updateDirectorySortingProgress);
+ connect(m_view, &DolphinView::selectionChanged,
+ this, &DolphinViewContainer::delayedStatusBarUpdate);
+ connect(m_view, &DolphinView::urlAboutToBeChanged,
+ this, &DolphinViewContainer::slotViewUrlAboutToBeChanged);
+ connect(m_view, &DolphinView::errorMessage,
+ this, &DolphinViewContainer::showErrorMessage);
+ connect(m_view, &DolphinView::urlIsFileError,
+ this, &DolphinViewContainer::slotUrlIsFileError);
+ connect(m_view, &DolphinView::activated,
+ this, &DolphinViewContainer::activate);
+
+ connect(m_urlNavigator, &KUrlNavigator::urlAboutToBeChanged,
+ this, &DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged);
+ connect(m_urlNavigator, &KUrlNavigator::urlChanged,
+ this, &DolphinViewContainer::slotUrlNavigatorLocationChanged);
+ connect(m_urlNavigator, &KUrlNavigator::historyChanged,
+ this, &DolphinViewContainer::slotHistoryChanged);
+ connect(m_urlNavigator, &KUrlNavigator::returnPressed,
+ this, &DolphinViewContainer::slotReturnPressed);
// Initialize status bar
m_statusBar = new DolphinStatusBar(this);
m_statusBar->setUrl(m_view->url());
m_statusBar->setZoomLevel(m_view->zoomLevel());
- connect(m_view, SIGNAL(urlChanged(KUrl)), m_statusBar, SLOT(setUrl(KUrl)));
- connect(m_view, SIGNAL(zoomLevelChanged(int,int)), m_statusBar, SLOT(setZoomLevel(int)));
- connect(m_view, SIGNAL(infoMessage(QString)), m_statusBar, SLOT(setText(QString)));
- connect(m_view, SIGNAL(operationCompletedMessage(QString)), m_statusBar, SLOT(setText(QString)));
- connect(m_statusBar, SIGNAL(stopPressed()), this, SLOT(stopDirectoryLoading()));
- connect(m_statusBar, SIGNAL(zoomLevelChanged(int)), this, SLOT(slotStatusBarZoomLevelChanged(int)));
+ connect(m_view, &DolphinView::urlChanged,
+ m_statusBar, &DolphinStatusBar::setUrl);
+ connect(m_view, &DolphinView::zoomLevelChanged,
+ m_statusBar, &DolphinStatusBar::setZoomLevel);
+ connect(m_view, &DolphinView::infoMessage,
+ m_statusBar, &DolphinStatusBar::setText);
+ connect(m_view, &DolphinView::operationCompletedMessage,
+ m_statusBar, &DolphinStatusBar::setText);
+ connect(m_statusBar, &DolphinStatusBar::stopPressed,
+ this, &DolphinViewContainer::stopDirectoryLoading);
+ connect(m_statusBar, &DolphinStatusBar::zoomLevelChanged,
+ this, &DolphinViewContainer::slotStatusBarZoomLevelChanged);
m_statusBarTimer = new QTimer(this);
m_statusBarTimer->setSingleShot(true);
m_statusBarTimer->setInterval(300);
- connect(m_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar()));
+ connect(m_statusBarTimer, &QTimer::timeout, this, &DolphinViewContainer::updateStatusBar);
KIO::FileUndoManager* undoManager = KIO::FileUndoManager::self();
- connect(undoManager, SIGNAL(jobRecordingFinished(CommandType)),
- this, SLOT(delayedStatusBarUpdate()));
+ connect(undoManager, &KIO::FileUndoManager::jobRecordingFinished,
+ this, &DolphinViewContainer::delayedStatusBarUpdate);
// Initialize filter bar
m_filterBar = new FilterBar(this);
m_filterBar->setVisible(settings->filterBar());
- connect(m_filterBar, SIGNAL(filterChanged(QString)),
- this, SLOT(setNameFilter(QString)));
- connect(m_filterBar, SIGNAL(closeRequest()),
- this, SLOT(closeFilterBar()));
- connect(m_filterBar, SIGNAL(focusViewRequest()),
- this, SLOT(requestFocus()));
- connect(m_view, SIGNAL(urlChanged(KUrl)),
- m_filterBar, SLOT(slotUrlChanged()));
+ connect(m_filterBar, &FilterBar::filterChanged,
+ this, &DolphinViewContainer::setNameFilter);
+ connect(m_filterBar, &FilterBar::closeRequest,
+ this, &DolphinViewContainer::closeFilterBar);
+ connect(m_filterBar, &FilterBar::focusViewRequest,
+ this, &DolphinViewContainer::requestFocus);
+ connect(m_view, &DolphinView::urlChanged,
+ m_filterBar, &FilterBar::slotUrlChanged);
m_topLayout->addWidget(m_urlNavigator);
m_topLayout->addWidget(m_searchBox);
return;
}
- item.run();
+ new KRun(item.targetUrl(), this);
}
void DolphinViewContainer::slotItemsActivated(const KFileItemList& items)
m_view->setFocus();
}
-void DolphinViewContainer::saveUrlCompletionMode(KGlobalSettings::Completion completion)
+void DolphinViewContainer::saveUrlCompletionMode(KCompletion::CompletionMode completion)
{
GeneralSettings::setUrlCompletionMode(completion);
}
m_urlNavigator->saveLocationState(locationState);
}
-#include "dolphinviewcontainer.moc"
#include <KFileItem>
#include <KFileItemDelegate>
-#include <KGlobalSettings>
+#include <KCompletion>
#include <KIO/Job>
#include <KUrlNavigator>
#include <QWidget>
#include <views/dolphinview.h>
-#include <config-apps.h>
+#include <config-dolphin.h>
-#ifdef KActivities_FOUND
+#ifdef KF5Activities_FOUND
namespace KActivities {
class ResourceInstance;
}
* Saves the currently used URL completion mode of
* the URL navigator.
*/
- void saveUrlCompletionMode(KGlobalSettings::Completion completion);
+ void saveUrlCompletionMode(KCompletion::CompletionMode completion);
void slotHistoryChanged();
KUrl m_dropDestination;
QScopedPointer<QDropEvent> m_dropEvent;
-#ifdef KActivities_FOUND
+#ifdef KF5Activities_FOUND
private:
KActivities::ResourceInstance * m_activityResourceInstance;
#endif
***************************************************************************/
#include "filterbar.h"
-#include <QBoxLayout>
#include <QKeyEvent>
#include <QLabel>
#include <QToolButton>
+#include <QHBoxLayout>
-#include <KIcon>
+#include <QIcon>
#include <KLocale>
#include <KLineEdit>
-#include <KIconLoader>
FilterBar::FilterBar(QWidget* parent) :
QWidget(parent)
// Create close button
QToolButton *closeButton = new QToolButton(this);
closeButton->setAutoRaise(true);
- closeButton->setIcon(KIcon("dialog-close"));
+ closeButton->setIcon(QIcon::fromTheme("dialog-close"));
closeButton->setToolTip(i18nc("@info:tooltip", "Hide Filter Bar"));
- connect(closeButton, SIGNAL(clicked()), this, SIGNAL(closeRequest()));
+ connect(closeButton, &QToolButton::clicked, this, &FilterBar::closeRequest);
// Create button to lock text when changing folders
m_lockButton = new QToolButton(this);
m_lockButton->setAutoRaise(true);
m_lockButton->setCheckable(true);
- m_lockButton->setIcon(KIcon("object-unlocked"));
+ m_lockButton->setIcon(QIcon::fromTheme("object-unlocked"));
m_lockButton->setToolTip(i18nc("@info:tooltip", "Keep Filter When Changing Folders"));
- connect(m_lockButton, SIGNAL(toggled(bool)), this, SLOT(slotToggleLockButton(bool)));
+ connect(m_lockButton, &QToolButton::toggled, this, &FilterBar::slotToggleLockButton);
// Create label
QLabel* filterLabel = new QLabel(i18nc("@label:textbox", "Filter:"), this);
m_filterInput = new KLineEdit(this);
m_filterInput->setLayoutDirection(Qt::LeftToRight);
m_filterInput->setClearButtonShown(true);
- connect(m_filterInput, SIGNAL(textChanged(QString)),
- this, SIGNAL(filterChanged(QString)));
+ connect(m_filterInput, &KLineEdit::textChanged,
+ this, &FilterBar::filterChanged);
setFocusProxy(m_filterInput);
// Apply layout
void FilterBar::slotToggleLockButton(bool checked)
{
if (checked) {
- m_lockButton->setIcon(KIcon("object-locked"));
+ m_lockButton->setIcon(QIcon::fromTheme("object-locked"));
} else {
- m_lockButton->setIcon(KIcon("object-unlocked"));
+ m_lockButton->setIcon(QIcon::fromTheme("object-unlocked"));
clear();
}
}
}
}
-#include "filterbar.moc"
#include "private/kpixmapmodifier.h"
#include <KDebug>
-#include <KIcon>
+#include <QIcon>
#include <KTextEdit>
+#include <KIconLoader>
+#include <KDateTime>
#include <QPainter>
#include <QTextLine>
m_updateVisibleIndexRangeTimer = new QTimer(this);
m_updateVisibleIndexRangeTimer->setSingleShot(true);
m_updateVisibleIndexRangeTimer->setInterval(ShortInterval);
- connect(m_updateVisibleIndexRangeTimer, SIGNAL(timeout()), this, SLOT(updateVisibleIndexRange()));
+ connect(m_updateVisibleIndexRangeTimer, &QTimer::timeout, this, &KFileItemListView::updateVisibleIndexRange);
m_updateIconSizeTimer = new QTimer(this);
m_updateIconSizeTimer->setSingleShot(true);
m_updateIconSizeTimer->setInterval(LongInterval);
- connect(m_updateIconSizeTimer, SIGNAL(timeout()), this, SLOT(updateIconSize()));
+ connect(m_updateIconSizeTimer, &QTimer::timeout, this, &KFileItemListView::updateIconSize);
setVisibleRoles(QList<QByteArray>() << "text");
}
foreach (int index, indexes) {
QPixmap pixmap = model()->data(index).value("iconPixmap").value<QPixmap>();
if (pixmap.isNull()) {
- KIcon icon(model()->data(index).value("iconName").toString());
+ QIcon icon = QIcon::fromTheme(model()->data(index).value("iconName").toString());
pixmap = icon.pixmap(size, size);
} else {
KPixmapModifier::scale(pixmap, QSize(size, size));
return QSize(iconSize, iconSize);
}
-#include "kfileitemlistview.moc"
#include <KLocale>
#include <KIO/MetaData>
#include <QDateTime>
+#include <KFormat>
+#include <QMimeDatabase>
KFileItemListWidgetInformant::KFileItemListWidgetInformant() :
KStandardItemListWidgetInformant()
}
} else {
const KIO::filesize_t size = roleValue.value<KIO::filesize_t>();
- text = KGlobal::locale()->formatByteSize(size);
+ text = KFormat().formatByteSize(size);
}
} else if (role == "date") {
const QDateTime dateTime = roleValue.toDateTime();
- text = KGlobal::locale()->formatDateTime(dateTime);
+ text = KLocale::global()->formatDateTime(dateTime);
} else {
text = KStandardItemListWidgetInformant::roleText(role, values);
}
return selectionLength;
}
- const QString extension = KMimeType::extractKnownExtension(text);
+ QMimeDatabase db;
+ const QString extension = db.suffixForFileName(text);
if (extension.isEmpty()) {
// For an unknown extension just exclude the extension after
// the last point. This does not work for multiple extensions like
return selectionLength;
}
-#include "kfileitemlistwidget.moc"
#include <KLocale>
#include <KStringHandler>
#include <KDebug>
+#include <kstringhandler_deprecated.h> //TODO: port to QCollator
#include "private/kfileitemmodelsortalgorithm.h"
#include "private/kfileitemmodeldirlister.h"
m_dirLister->setMainWindow(parentWidget->window());
}
- connect(m_dirLister, SIGNAL(started(KUrl)), this, SIGNAL(directoryLoadingStarted()));
- connect(m_dirLister, SIGNAL(canceled()), this, SLOT(slotCanceled()));
- connect(m_dirLister, SIGNAL(completed(KUrl)), this, SLOT(slotCompleted()));
- connect(m_dirLister, SIGNAL(itemsAdded(KUrl,KFileItemList)), this, SLOT(slotItemsAdded(KUrl,KFileItemList)));
- connect(m_dirLister, SIGNAL(itemsDeleted(KFileItemList)), this, SLOT(slotItemsDeleted(KFileItemList)));
- connect(m_dirLister, SIGNAL(refreshItems(QList<QPair<KFileItem,KFileItem> >)), this, SLOT(slotRefreshItems(QList<QPair<KFileItem,KFileItem> >)));
- connect(m_dirLister, SIGNAL(clear()), this, SLOT(slotClear()));
- connect(m_dirLister, SIGNAL(infoMessage(QString)), this, SIGNAL(infoMessage(QString)));
- connect(m_dirLister, SIGNAL(errorMessage(QString)), this, SIGNAL(errorMessage(QString)));
- connect(m_dirLister, SIGNAL(redirection(KUrl,KUrl)), this, SIGNAL(directoryRedirection(KUrl,KUrl)));
- connect(m_dirLister, SIGNAL(urlIsFileError(KUrl)), this, SIGNAL(urlIsFileError(KUrl)));
+ connect(m_dirLister, &KFileItemModelDirLister::started, this, &KFileItemModel::directoryLoadingStarted);
+ connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)()>(&KFileItemModelDirLister::canceled), this, &KFileItemModel::slotCanceled);
+ connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)(const QUrl&)>(&KFileItemModelDirLister::completed), this, &KFileItemModel::slotCompleted);
+ connect(m_dirLister, &KFileItemModelDirLister::itemsAdded, this, &KFileItemModel::slotItemsAdded);
+ connect(m_dirLister, &KFileItemModelDirLister::itemsDeleted, this, &KFileItemModel::slotItemsDeleted);
+ connect(m_dirLister, &KFileItemModelDirLister::refreshItems, this, &KFileItemModel::slotRefreshItems);
+ connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)()>(&KFileItemModelDirLister::clear), this, &KFileItemModel::slotClear);
+ connect(m_dirLister, &KFileItemModelDirLister::infoMessage, this, &KFileItemModel::infoMessage);
+ connect(m_dirLister, &KFileItemModelDirLister::errorMessage, this, &KFileItemModel::errorMessage);
+ connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)(const QUrl&, const QUrl&)>(&KFileItemModelDirLister::redirection), this, &KFileItemModel::directoryRedirection);
+ connect(m_dirLister, &KFileItemModelDirLister::urlIsFileError, this, &KFileItemModel::urlIsFileError);
// Apply default roles that should be determined
resetRoles();
m_maximumUpdateIntervalTimer = new QTimer(this);
m_maximumUpdateIntervalTimer->setInterval(2000);
m_maximumUpdateIntervalTimer->setSingleShot(true);
- connect(m_maximumUpdateIntervalTimer, SIGNAL(timeout()), this, SLOT(dispatchPendingItemsToInsert()));
+ connect(m_maximumUpdateIntervalTimer, &QTimer::timeout, this, &KFileItemModel::dispatchPendingItemsToInsert);
// When changing the value of an item which represents the sort-role a resorting must be
// triggered. Especially in combination with KFileItemModelRolesUpdater this might be done
m_resortAllItemsTimer = new QTimer(this);
m_resortAllItemsTimer->setInterval(500);
m_resortAllItemsTimer->setSingleShot(true);
- connect(m_resortAllItemsTimer, SIGNAL(timeout()), this, SLOT(resortAllItems()));
+ connect(m_resortAllItemsTimer, &QTimer::timeout, this, &KFileItemModel::resortAllItems);
- connect(KGlobalSettings::self(), SIGNAL(naturalSortingChanged()), this, SLOT(slotNaturalSortingChanged()));
+ connect(KGlobalSettings::self(), &KGlobalSettings::naturalSortingChanged,
+ this, &KFileItemModel::slotNaturalSortingChanged);
}
KFileItemModel::~KFileItemModel()
int KFileItemModel::index(const KFileItem& item) const
{
- return index(item.url());
+ return index(KUrl(item.url()));
}
int KFileItemModel::index(const KUrl& url) const
// might result in emitting the same items twice due to the Keep-parameter.
// This case happens if an item gets expanded, collapsed and expanded again
// before the items could be loaded for the first expansion.
- if (index(items.first().url()) >= 0) {
+ if (index(KUrl(items.first().url())) >= 0) {
// The items are already part of the model.
return;
}
// Don't use KFileItem::timeString() as this is too expensive when
// having several thousands of items. Instead the formatting of the
// date-time will be done on-demand by the view when the date will be shown.
- const KDateTime dateTime = item.time(KFileItem::ModificationTime);
- data.insert(sharedValue("date"), dateTime.dateTime());
+ const QDateTime dateTime = item.time(KFileItem::ModificationTime);
+ data.insert(sharedValue("date"), dateTime);
}
if (m_requestRole[PermissionsRole]) {
if (m_requestRole[PathRole]) {
QString path;
- if (item.url().protocol() == QLatin1String("trash")) {
+ if (item.url().scheme() == QLatin1String("trash")) {
path = item.entry().stringValue(KIO::UDSEntry::UDS_EXTRA);
} else {
// For performance reasons cache the home-path in a static QString
}
case DateRole: {
- const KDateTime dateTimeA = itemA.time(KFileItem::ModificationTime);
- const KDateTime dateTimeB = itemB.time(KFileItem::ModificationTime);
+ const QDateTime dateTimeA = itemA.time(KFileItem::ModificationTime);
+ const QDateTime dateTimeB = itemB.time(KFileItem::ModificationTime);
if (dateTimeA < dateTimeB) {
result = -1;
} else if (dateTimeA > dateTimeB) {
const int maxIndex = count() - 1;
QList<QPair<int, QVariant> > groups;
- const QDate currentDate = KDateTime::currentLocalDateTime().date();
+ const QDate currentDate = QDate::currentDate();
QDate previousModifiedDate;
QString groupValue;
continue;
}
- const KDateTime modifiedTime = m_itemData.at(i)->item.time(KFileItem::ModificationTime);
+ const QDateTime modifiedTime = m_itemData.at(i)->item.time(KFileItem::ModificationTime);
const QDate modifiedDate = modifiedTime.date();
if (modifiedDate == previousModifiedDate) {
// The current item is in the same group as the previous item
}
permissionsString = newPermissionsString;
- const QFileInfo info(itemData->item.url().pathOrUrl());
+ const QFileInfo info(itemData->item.url().toLocalFile());
// Set user string
QString user;
return true;
}
-#include "kfileitemmodel.moc"
#include <KDebug>
#include <KFileItem>
#include <KGlobal>
+#include <KIconLoader>
+#include <KJobWidgets>
#include <KIO/JobUiDelegate>
#include <KIO/PreviewJob>
#ifdef HAVE_BALOO
#include "private/kbaloorolesprovider.h"
- #include <baloo/file.h>
- #include <baloo/filefetchjob.h>
- #include <baloo/filemonitor.h>
+ #include <Baloo/File>
+ #include <Baloo/FileMonitor>
#endif
// #define KFILEITEMMODELROLESUPDATER_DEBUG
{
Q_ASSERT(model);
- const KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings");
+ const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
m_enabledPlugins = globalConfig.readEntry("Plugins", QStringList()
<< "directorythumbnail"
<< "imagethumbnail"
<< "jpegthumbnail");
- connect(m_model, SIGNAL(itemsInserted(KItemRangeList)),
- this, SLOT(slotItemsInserted(KItemRangeList)));
- connect(m_model, SIGNAL(itemsRemoved(KItemRangeList)),
- this, SLOT(slotItemsRemoved(KItemRangeList)));
- connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
- connect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
- this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
- connect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
- this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
+ connect(m_model, &KFileItemModel::itemsInserted,
+ this, &KFileItemModelRolesUpdater::slotItemsInserted);
+ connect(m_model, &KFileItemModel::itemsRemoved,
+ this, &KFileItemModelRolesUpdater::slotItemsRemoved);
+ connect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
+ connect(m_model, &KFileItemModel::itemsMoved,
+ this, &KFileItemModelRolesUpdater::slotItemsMoved);
+ connect(m_model, &KFileItemModel::sortRoleChanged,
+ this, &KFileItemModelRolesUpdater::slotSortRoleChanged);
// Use a timer to prevent that each call of slotItemsChanged() results in a synchronous
// resolving of the roles. Postpone the resolving until no update has been done for 1 second.
m_recentlyChangedItemsTimer = new QTimer(this);
m_recentlyChangedItemsTimer->setInterval(1000);
m_recentlyChangedItemsTimer->setSingleShot(true);
- connect(m_recentlyChangedItemsTimer, SIGNAL(timeout()), this, SLOT(resolveRecentlyChangedItems()));
+ connect(m_recentlyChangedItemsTimer, &QTimer::timeout, this, &KFileItemModelRolesUpdater::resolveRecentlyChangedItems);
m_resolvableRoles.insert("size");
m_resolvableRoles.insert("type");
#endif
m_directoryContentsCounter = new KDirectoryContentsCounter(m_model, this);
- connect(m_directoryContentsCounter, SIGNAL(result(QString,int)),
- this, SLOT(slotDirectoryContentsCountReceived(QString,int)));
+ connect(m_directoryContentsCounter, &KDirectoryContentsCounter::result,
+ this, &KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived);
}
KFileItemModelRolesUpdater::~KFileItemModelRolesUpdater()
if (hasBalooRole && !m_balooFileMonitor) {
m_balooFileMonitor = new Baloo::FileMonitor(this);
- connect(m_balooFileMonitor, SIGNAL(fileMetaDataChanged(QString)),
- this, SLOT(applyChangedBalooRoles(QString)));
+ connect(m_balooFileMonitor, &Baloo::FileMonitor::fileMetaDataChanged,
+ this, &KFileItemModelRolesUpdater::applyChangedBalooRoles);
} else if (!hasBalooRole && m_balooFileMonitor) {
delete m_balooFileMonitor;
m_balooFileMonitor = 0;
data.insert("iconPixmap", scaledPixmap);
- disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ disconnect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
m_model->setData(index, data);
- connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ connect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
m_finishedItems.insert(item);
}
QHash<QByteArray, QVariant> data;
data.insert("iconPixmap", QPixmap());
- disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ disconnect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
m_model->setData(index, data);
- connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ connect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
applyResolvedRoles(index, ResolveAll);
m_finishedItems.insert(item);
m_state = Idle;
// Prevent that we try to update the items twice.
- disconnect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
- this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
+ disconnect(m_model, &KFileItemModel::itemsMoved,
+ this, &KFileItemModelRolesUpdater::slotItemsMoved);
applySortProgressToModel();
- connect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
- this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
+ connect(m_model, &KFileItemModel::itemsMoved,
+ this, &KFileItemModelRolesUpdater::slotItemsMoved);
startUpdating();
}
}
QHash<QByteArray, QVariant> data;
data.insert("iconPixmap", QPixmap());
- disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ disconnect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
for (int index = 0; index <= m_model->count(); ++index) {
if (m_model->data(index).contains("iconPixmap")) {
m_model->setData(index, data);
}
}
- connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ connect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
}
m_clearPreviews = false;
return;
}
- Baloo::FileFetchJob* job = new Baloo::FileFetchJob(item.localPath());
- connect(job, SIGNAL(finished(KJob*)), this, SLOT(applyChangedBalooRolesJobFinished(KJob*)));
- job->setProperty("item", QVariant::fromValue(item));
- job->start();
-#else
-#ifndef Q_CC_MSVC
- Q_UNUSED(itemUrl);
-#endif
-#endif
-}
-
-void KFileItemModelRolesUpdater::applyChangedBalooRolesJobFinished(KJob* kjob)
-{
-#ifdef HAVE_BALOO
- const KFileItem item = kjob->property("item").value<KFileItem>();
+ Baloo::File file(item.localPath());
+ file.load();
const KBalooRolesProvider& rolesProvider = KBalooRolesProvider::instance();
QHash<QByteArray, QVariant> data;
data.insert(role, QVariant());
}
- Baloo::FileFetchJob* job = static_cast<Baloo::FileFetchJob*>(kjob);
- QHashIterator<QByteArray, QVariant> it(rolesProvider.roleValues(job->file(), m_roles));
+ QHashIterator<QByteArray, QVariant> it(rolesProvider.roleValues(file, m_roles));
while (it.hasNext()) {
it.next();
data.insert(it.key(), it.value());
}
- disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ disconnect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
const int index = m_model->index(item);
m_model->setData(index, data);
- connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ connect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
+#else
+#ifndef Q_CC_MSVC
+ Q_UNUSED(itemUrl);
+#endif
#endif
}
data.insert("isExpandable", count > 0);
}
- disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ disconnect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
m_model->setData(index, data);
- connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ connect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
}
}
}
job->setIgnoreMaximumSize(itemSubSet.first().isLocalFile());
if (job->ui()) {
- job->ui()->setWindow(qApp->activeWindow());
+ KJobWidgets::setWindow(job, qApp->activeWindow());
}
- connect(job, SIGNAL(gotPreview(KFileItem,QPixmap)),
- this, SLOT(slotGotPreview(KFileItem,QPixmap)));
- connect(job, SIGNAL(failed(KFileItem)),
- this, SLOT(slotPreviewFailed(KFileItem)));
- connect(job, SIGNAL(finished(KJob*)),
- this, SLOT(slotPreviewJobFinished()));
+ connect(job, &KIO::PreviewJob::gotPreview,
+ this, &KFileItemModelRolesUpdater::slotGotPreview);
+ connect(job, &KIO::PreviewJob::failed,
+ this, &KFileItemModelRolesUpdater::slotPreviewFailed);
+ connect(job, &KIO::PreviewJob::finished,
+ this, &KFileItemModelRolesUpdater::slotPreviewJobFinished);
m_previewJob = job;
}
data = rolesData(item);
}
- disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ disconnect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
m_model->setData(index, data);
- connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ connect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
}
void KFileItemModelRolesUpdater::applySortProgressToModel()
data.insert("iconPixmap", QPixmap());
}
- disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ disconnect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
m_model->setData(index, data);
- connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
+ connect(m_model, &KFileItemModel::itemsChanged,
+ this, &KFileItemModelRolesUpdater::slotItemsChanged);
return true;
}
void KFileItemModelRolesUpdater::killPreviewJob()
{
if (m_previewJob) {
- disconnect(m_previewJob, SIGNAL(gotPreview(KFileItem,QPixmap)),
- this, SLOT(slotGotPreview(KFileItem,QPixmap)));
- disconnect(m_previewJob, SIGNAL(failed(KFileItem)),
- this, SLOT(slotPreviewFailed(KFileItem)));
- disconnect(m_previewJob, SIGNAL(finished(KJob*)),
- this, SLOT(slotPreviewJobFinished()));
+ disconnect(m_previewJob, &KIO::PreviewJob::gotPreview,
+ this, &KFileItemModelRolesUpdater::slotGotPreview);
+ disconnect(m_previewJob, &KIO::PreviewJob::failed,
+ this, &KFileItemModelRolesUpdater::slotPreviewFailed);
+ disconnect(m_previewJob, &KIO::PreviewJob::finished,
+ this, &KFileItemModelRolesUpdater::slotPreviewJobFinished);
m_previewJob->kill();
m_previewJob = 0;
m_pendingPreviewItems.clear();
return result;
}
-#include "kfileitemmodelrolesupdater.moc"
class QPixmap;
class QTimer;
+namespace KIO {
+ class PreviewJob;
+}
+
#ifdef HAVE_BALOO
namespace Baloo
{
void resolveRecentlyChangedItems();
void applyChangedBalooRoles(const QString& file);
- void applyChangedBalooRolesJobFinished(KJob* job);
void slotDirectoryContentsCountReceived(const QString& path, int count);
// A new preview job will be started from them once the first one finishes.
KFileItemList m_pendingPreviewItems;
- KJob* m_previewJob;
+ KIO::PreviewJob* m_previewJob;
// When downloading or copying large files, the slot slotItemsChanged()
// will be called periodically within a quite short delay. To prevent
slotViewChanged(controller->view(), 0);
}
- connect(controller, SIGNAL(modelChanged(KItemModelBase*,KItemModelBase*)),
- this, SLOT(slotModelChanged(KItemModelBase*,KItemModelBase*)));
- connect(controller, SIGNAL(viewChanged(KItemListView*,KItemListView*)),
- this, SLOT(slotViewChanged(KItemListView*,KItemListView*)));
+ connect(controller, &KItemListController::modelChanged,
+ this, &KItemListContainer::slotModelChanged);
+ connect(controller, &KItemListController::viewChanged,
+ this, &KItemListContainer::slotViewChanged);
}
KItemListContainer::~KItemListContainer()
KItemListSmoothScroller* smoothScroller = scrollHorizontally ?
m_horizontalSmoothScroller : m_verticalSmoothScroller;
- const int numDegrees = event->delta() / 8;
- const int numSteps = numDegrees / 15;
-
const QScrollBar* scrollBar = smoothScroller->scrollBar();
- smoothScroller->scrollTo(scrollBar->value() - numSteps * scrollBar->pageStep() / 4);
+ if (!event->pixelDelta().isNull()) {
+ const int numPixels = event->pixelDelta().y();
+ smoothScroller->scrollTo(scrollBar->value() - numPixels);
+ } else {
+ const int numDegrees = event->angleDelta().y() / 8;
+ const int numSteps = numDegrees / 15;
+ smoothScroller->scrollTo(scrollBar->value() - numSteps * scrollBar->pageStep() / 4);
+ }
event->accept();
}
QGraphicsScene* scene = static_cast<QGraphicsView*>(viewport())->scene();
if (previous) {
scene->removeItem(previous);
- disconnect(previous, SIGNAL(scrollOrientationChanged(Qt::Orientation,Qt::Orientation)), this, SLOT(slotScrollOrientationChanged(Qt::Orientation,Qt::Orientation)));
- disconnect(previous, SIGNAL(scrollOffsetChanged(qreal,qreal)), this, SLOT(updateScrollOffsetScrollBar()));
- disconnect(previous, SIGNAL(maximumScrollOffsetChanged(qreal,qreal)), this, SLOT(updateScrollOffsetScrollBar()));
- disconnect(previous, SIGNAL(itemOffsetChanged(qreal,qreal)), this, SLOT(updateItemOffsetScrollBar()));
- disconnect(previous, SIGNAL(maximumItemOffsetChanged(qreal,qreal)), this, SLOT(updateItemOffsetScrollBar()));
- disconnect(previous, SIGNAL(scrollTo(qreal)), this, SLOT(scrollTo(qreal)));
+ disconnect(previous, &KItemListView::scrollOrientationChanged,
+ this, &KItemListContainer::slotScrollOrientationChanged);
+ disconnect(previous, &KItemListView::scrollOffsetChanged,
+ this, &KItemListContainer::updateScrollOffsetScrollBar);
+ disconnect(previous, &KItemListView::maximumScrollOffsetChanged,
+ this, &KItemListContainer::updateScrollOffsetScrollBar);
+ disconnect(previous, &KItemListView::itemOffsetChanged,
+ this, &KItemListContainer::updateItemOffsetScrollBar);
+ disconnect(previous, &KItemListView::maximumItemOffsetChanged,
+ this, &KItemListContainer::updateItemOffsetScrollBar);
+ disconnect(previous, &KItemListView::scrollTo, this, &KItemListContainer::scrollTo);
m_horizontalSmoothScroller->setTargetObject(0);
m_verticalSmoothScroller->setTargetObject(0);
}
if (current) {
scene->addItem(current);
- connect(current, SIGNAL(scrollOrientationChanged(Qt::Orientation,Qt::Orientation)), this, SLOT(slotScrollOrientationChanged(Qt::Orientation,Qt::Orientation)));
- connect(current, SIGNAL(scrollOffsetChanged(qreal,qreal)), this, SLOT(updateScrollOffsetScrollBar()));
- connect(current, SIGNAL(maximumScrollOffsetChanged(qreal,qreal)), this, SLOT(updateScrollOffsetScrollBar()));
- connect(current, SIGNAL(itemOffsetChanged(qreal,qreal)), this, SLOT(updateItemOffsetScrollBar()));
- connect(current, SIGNAL(maximumItemOffsetChanged(qreal,qreal)), this, SLOT(updateItemOffsetScrollBar()));
- connect(current, SIGNAL(scrollTo(qreal)), this, SLOT(scrollTo(qreal)));
+ connect(current, &KItemListView::scrollOrientationChanged,
+ this, &KItemListContainer::slotScrollOrientationChanged);
+ connect(current, &KItemListView::scrollOffsetChanged,
+ this, &KItemListContainer::updateScrollOffsetScrollBar);
+ connect(current, &KItemListView::maximumScrollOffsetChanged,
+ this, &KItemListContainer::updateScrollOffsetScrollBar);
+ connect(current, &KItemListView::itemOffsetChanged,
+ this, &KItemListContainer::updateItemOffsetScrollBar);
+ connect(current, &KItemListView::maximumItemOffsetChanged,
+ this, &KItemListContainer::updateItemOffsetScrollBar);
+ connect(current, &KItemListView::scrollTo, this, &KItemListContainer::scrollTo);
m_horizontalSmoothScroller->setTargetObject(current);
m_verticalSmoothScroller->setTargetObject(current);
updateSmoothScrollers(current->scrollOrientation());
}
}
-#include "kitemlistcontainer.moc"
class KItemListSmoothScroller;
class KItemListView;
class KItemModelBase;
-class QPropertyAnimation;
/**
* @brief Provides a QWidget based scrolling view for a KItemListController.
m_keyboardAnchorIndex(-1),
m_keyboardAnchorPos(0)
{
- connect(m_keyboardManager, SIGNAL(changeCurrentItem(QString,bool)),
- this, SLOT(slotChangeCurrentItem(QString,bool)));
- connect(m_selectionManager, SIGNAL(currentChanged(int,int)),
- m_keyboardManager, SLOT(slotCurrentChanged(int,int)));
+ connect(m_keyboardManager, &KItemListKeyboardSearchManager::changeCurrentItem,
+ this, &KItemListController::slotChangeCurrentItem);
+ connect(m_selectionManager, &KItemListSelectionManager::currentChanged,
+ m_keyboardManager, &KItemListKeyboardSearchManager::slotCurrentChanged);
m_autoActivationTimer = new QTimer(this);
m_autoActivationTimer->setSingleShot(true);
m_autoActivationTimer->setInterval(-1);
- connect(m_autoActivationTimer, SIGNAL(timeout()), this, SLOT(slotAutoActivationTimeout()));
+ connect(m_autoActivationTimer, &QTimer::timeout, this, &KItemListController::slotAutoActivationTimeout);
setModel(model);
setView(view);
KItemListView* oldView = m_view;
if (oldView) {
- disconnect(oldView, SIGNAL(scrollOffsetChanged(qreal,qreal)), this, SLOT(slotViewScrollOffsetChanged(qreal,qreal)));
+ disconnect(oldView, &KItemListView::scrollOffsetChanged, this, &KItemListController::slotViewScrollOffsetChanged);
oldView->deleteLater();
}
m_view->setParent(this);
m_view->setController(this);
m_view->setModel(m_model);
- connect(m_view, SIGNAL(scrollOffsetChanged(qreal,qreal)), this, SLOT(slotViewScrollOffsetChanged(qreal,qreal)));
+ connect(m_view, &KItemListView::scrollOffsetChanged, this, &KItemListController::slotViewScrollOffsetChanged);
updateExtendedSelectionRegion();
}
m_pressedIndex = m_view->itemAt(m_pressedMousePos);
emit mouseButtonPressed(m_pressedIndex, event->buttons());
- // TODO: Qt5: Replace Qt::XButton1 by Qt::BackButton and Qt::XButton2 by Qt::ForwardButton
- if (event->buttons() & (Qt::XButton1 | Qt::XButton2)) {
+ if (event->buttons() & (Qt::BackButton | Qt::ForwardButton)) {
// Do not select items when clicking the back/forward buttons, see
// https://bugs.kde.org/show_bug.cgi?id=327412.
return true;
rubberBand->setStartPosition(startPos);
rubberBand->setEndPosition(startPos);
rubberBand->setActive(true);
- connect(rubberBand, SIGNAL(endPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandChanged()));
+ connect(rubberBand, &KItemListRubberBand::endPositionChanged, this, &KItemListController::slotRubberBandChanged);
m_view->setAutoScroll(true);
}
KItemListRubberBand* rubberBand = m_view->rubberBand();
if (rubberBand->isActive()) {
- disconnect(rubberBand, SIGNAL(endPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandChanged()));
+ disconnect(rubberBand, &KItemListRubberBand::endPositionChanged, this, &KItemListController::slotRubberBandChanged);
rubberBand->setActive(false);
m_oldSelection.clear();
m_view->setAutoScroll(false);
}
}
-#include "kitemlistcontroller.moc"
class QHideEvent;
class QInputMethodEvent;
class QKeyEvent;
-class QMimeData;
class QShowEvent;
class QTransform;
return styleOption().palette.color(group, normalBaseColorRole());
}
-#include "kitemlistgroupheader.moc"
m_headerWidget = m_view->m_headerWidget;
Q_ASSERT(m_headerWidget);
- connect(m_headerWidget, SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)),
- this, SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)));
+ connect(m_headerWidget, &KItemListHeaderWidget::columnWidthChanged,
+ this, &KItemListHeader::columnWidthChanged);
}
-#include "kitemlistheader.moc"
}
return qBound(-1, index - dec, m_model->count() - 1);
}
-#include "kitemlistselectionmanager.moc"
+
}
#ifndef QT_NO_ACCESSIBILITY
-QAccessibleInterface* accessibleInterfaceFactory(const QString &key, QObject *object)
+QAccessibleInterface* accessibleInterfaceFactory(const QString& key, QObject* object)
{
Q_UNUSED(key)
m_layouter = new KItemListViewLayouter(m_sizeHintResolver, this);
m_animation = new KItemListViewAnimation(this);
- connect(m_animation, SIGNAL(finished(QGraphicsWidget*,KItemListViewAnimation::AnimationType)),
- this, SLOT(slotAnimationFinished(QGraphicsWidget*,KItemListViewAnimation::AnimationType)));
+ connect(m_animation, &KItemListViewAnimation::finished,
+ this, &KItemListView::slotAnimationFinished);
m_layoutTimer = new QTimer(this);
m_layoutTimer->setInterval(300);
m_layoutTimer->setSingleShot(true);
- connect(m_layoutTimer, SIGNAL(timeout()), this, SLOT(slotLayoutTimerFinished()));
+ connect(m_layoutTimer, &QTimer::timeout, this, &KItemListView::slotLayoutTimerFinished);
m_rubberBand = new KItemListRubberBand(this);
- connect(m_rubberBand, SIGNAL(activationChanged(bool)), this, SLOT(slotRubberBandActivationChanged(bool)));
+ connect(m_rubberBand, &KItemListRubberBand::activationChanged, this, &KItemListView::slotRubberBandActivationChanged);
m_headerWidget = new KItemListHeaderWidget(this);
m_headerWidget->setVisible(false);
if (enabled && !m_autoScrollTimer) {
m_autoScrollTimer = new QTimer(this);
m_autoScrollTimer->setSingleShot(true);
- connect(m_autoScrollTimer, SIGNAL(timeout()), this, SLOT(triggerAutoScrolling()));
+ connect(m_autoScrollTimer, &QTimer::timeout, this, &KItemListView::triggerAutoScrolling);
m_autoScrollTimer->start(InitialAutoScrollDelay);
} else if (!enabled && m_autoScrollTimer) {
delete m_autoScrollTimer;
m_headerWidget->setColumns(m_visibleRoles);
m_headerWidget->setZValue(1);
- connect(m_headerWidget, SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)),
- this, SLOT(slotHeaderColumnWidthChanged(QByteArray,qreal,qreal)));
- connect(m_headerWidget, SIGNAL(columnMoved(QByteArray,int,int)),
- this, SLOT(slotHeaderColumnMoved(QByteArray,int,int)));
- connect(m_headerWidget, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
- this, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
- connect(m_headerWidget, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
- this, SIGNAL(sortRoleChanged(QByteArray,QByteArray)));
+ connect(m_headerWidget, &KItemListHeaderWidget::columnWidthChanged,
+ this, &KItemListView::slotHeaderColumnWidthChanged);
+ connect(m_headerWidget, &KItemListHeaderWidget::columnMoved,
+ this, &KItemListView::slotHeaderColumnMoved);
+ connect(m_headerWidget, &KItemListHeaderWidget::sortOrderChanged,
+ this, &KItemListView::sortOrderChanged);
+ connect(m_headerWidget, &KItemListHeaderWidget::sortRoleChanged,
+ this, &KItemListView::sortRoleChanged);
m_layouter->setHeaderHeight(headerSize.height());
m_headerWidget->setVisible(true);
} else if (!visible && m_headerWidget->isVisible()) {
- disconnect(m_headerWidget, SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)),
- this, SLOT(slotHeaderColumnWidthChanged(QByteArray,qreal,qreal)));
- disconnect(m_headerWidget, SIGNAL(columnMoved(QByteArray,int,int)),
- this, SLOT(slotHeaderColumnMoved(QByteArray,int,int)));
- disconnect(m_headerWidget, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
- this, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
- disconnect(m_headerWidget, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
- this, SIGNAL(sortRoleChanged(QByteArray,QByteArray)));
+ disconnect(m_headerWidget, &KItemListHeaderWidget::columnWidthChanged,
+ this, &KItemListView::slotHeaderColumnWidthChanged);
+ disconnect(m_headerWidget, &KItemListHeaderWidget::columnMoved,
+ this, &KItemListView::slotHeaderColumnMoved);
+ disconnect(m_headerWidget, &KItemListHeaderWidget::sortOrderChanged,
+ this, &KItemListView::sortOrderChanged);
+ disconnect(m_headerWidget, &KItemListHeaderWidget::sortRoleChanged,
+ this, &KItemListView::sortRoleChanged);
m_layouter->setHeaderHeight(0);
m_headerWidget->setVisible(false);
m_editingRole = true;
widget->setEditedRole(role);
- connect(widget, SIGNAL(roleEditingCanceled(int,QByteArray,QVariant)),
- this, SLOT(slotRoleEditingCanceled(int,QByteArray,QVariant)));
- connect(widget, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
- this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
+ connect(widget, &KItemListWidget::roleEditingCanceled,
+ this, &KItemListView::slotRoleEditingCanceled);
+ connect(widget, &KItemListWidget::roleEditingFinished,
+ this, &KItemListView::slotRoleEditingFinished);
}
void KItemListView::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
setAutoScroll(true);
}
-void KItemListView::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
+void KItemListView::dragMoveEvent(QGraphicsSceneDragDropEvent* event)
{
QGraphicsWidget::dragMoveEvent(event);
}
}
-void KItemListView::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
+void KItemListView::dragLeaveEvent(QGraphicsSceneDragDropEvent* event)
{
QGraphicsWidget::dragLeaveEvent(event);
setAutoScroll(false);
updateVisibleGroupHeaders();
doLayout(NoAnimation);
}
+
+ QAccessibleTableModelChangeEvent ev(this, QAccessibleTableModelChangeEvent::DataChanged);
+ ev.setFirstRow(itemRange.index);
+ ev.setLastRow(itemRange.index + itemRange.count);
+ QAccessible::updateAccessibility(&ev);
}
- QAccessible::updateAccessibility(this, 0, QAccessible::TableModelChanged);
}
void KItemListView::slotGroupsChanged()
currentWidget->setCurrent(true);
}
}
- QAccessible::updateAccessibility(this, current+1, QAccessible::Focus);
+
+ QAccessibleEvent ev(this, QAccessible::Focus);
+ ev.setChild(current);
+ QAccessible::updateAccessibility(&ev);
}
void KItemListView::slotSelectionChanged(const KItemSet& current, const KItemSet& previous)
void KItemListView::slotRubberBandActivationChanged(bool active)
{
if (active) {
- connect(m_rubberBand, SIGNAL(startPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandPosChanged()));
- connect(m_rubberBand, SIGNAL(endPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandPosChanged()));
+ connect(m_rubberBand, &KItemListRubberBand::startPositionChanged, this, &KItemListView::slotRubberBandPosChanged);
+ connect(m_rubberBand, &KItemListRubberBand::endPositionChanged, this, &KItemListView::slotRubberBandPosChanged);
m_skipAutoScrollForRubberBand = true;
} else {
- disconnect(m_rubberBand, SIGNAL(startPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandPosChanged()));
- disconnect(m_rubberBand, SIGNAL(endPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandPosChanged()));
+ disconnect(m_rubberBand, &KItemListRubberBand::startPositionChanged, this, &KItemListView::slotRubberBandPosChanged);
+ disconnect(m_rubberBand, &KItemListRubberBand::endPositionChanged, this, &KItemListView::slotRubberBandPosChanged);
m_skipAutoScrollForRubberBand = false;
}
KItemListController* previous = m_controller;
if (previous) {
KItemListSelectionManager* selectionManager = previous->selectionManager();
- disconnect(selectionManager, SIGNAL(currentChanged(int,int)), this, SLOT(slotCurrentChanged(int,int)));
- disconnect(selectionManager, SIGNAL(selectionChanged(KItemSet,KItemSet)), this, SLOT(slotSelectionChanged(KItemSet,KItemSet)));
+ disconnect(selectionManager, &KItemListSelectionManager::currentChanged, this, &KItemListView::slotCurrentChanged);
+ disconnect(selectionManager, &KItemListSelectionManager::selectionChanged, this, &KItemListView::slotSelectionChanged);
}
m_controller = controller;
if (controller) {
KItemListSelectionManager* selectionManager = controller->selectionManager();
- connect(selectionManager, SIGNAL(currentChanged(int,int)), this, SLOT(slotCurrentChanged(int,int)));
- connect(selectionManager, SIGNAL(selectionChanged(KItemSet,KItemSet)), this, SLOT(slotSelectionChanged(KItemSet,KItemSet)));
+ connect(selectionManager, &KItemListSelectionManager::currentChanged, this, &KItemListView::slotCurrentChanged);
+ connect(selectionManager, &KItemListSelectionManager::selectionChanged, this, &KItemListView::slotSelectionChanged);
}
onControllerChanged(controller, previous);
KItemModelBase* previous = m_model;
if (m_model) {
- disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
- disconnect(m_model, SIGNAL(itemsInserted(KItemRangeList)),
- this, SLOT(slotItemsInserted(KItemRangeList)));
- disconnect(m_model, SIGNAL(itemsRemoved(KItemRangeList)),
- this, SLOT(slotItemsRemoved(KItemRangeList)));
- disconnect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
- this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
- disconnect(m_model, SIGNAL(groupsChanged()),
- this, SLOT(slotGroupsChanged()));
- disconnect(m_model, SIGNAL(groupedSortingChanged(bool)),
- this, SLOT(slotGroupedSortingChanged(bool)));
- disconnect(m_model, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
- this, SLOT(slotSortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
- disconnect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
- this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
+ disconnect(m_model, &KItemModelBase::itemsChanged,
+ this, &KItemListView::slotItemsChanged);
+ disconnect(m_model, &KItemModelBase::itemsInserted,
+ this, &KItemListView::slotItemsInserted);
+ disconnect(m_model, &KItemModelBase::itemsRemoved,
+ this, &KItemListView::slotItemsRemoved);
+ disconnect(m_model, &KItemModelBase::itemsMoved,
+ this, &KItemListView::slotItemsMoved);
+ disconnect(m_model, &KItemModelBase::groupsChanged,
+ this, &KItemListView::slotGroupsChanged);
+ disconnect(m_model, &KItemModelBase::groupedSortingChanged,
+ this, &KItemListView::slotGroupedSortingChanged);
+ disconnect(m_model, &KItemModelBase::sortOrderChanged,
+ this, &KItemListView::slotSortOrderChanged);
+ disconnect(m_model, &KItemModelBase::sortRoleChanged,
+ this, &KItemListView::slotSortRoleChanged);
m_sizeHintResolver->itemsRemoved(KItemRangeList() << KItemRange(0, m_model->count()));
}
m_grouped = model->groupedSorting();
if (m_model) {
- connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
- connect(m_model, SIGNAL(itemsInserted(KItemRangeList)),
- this, SLOT(slotItemsInserted(KItemRangeList)));
- connect(m_model, SIGNAL(itemsRemoved(KItemRangeList)),
- this, SLOT(slotItemsRemoved(KItemRangeList)));
- connect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
- this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
- connect(m_model, SIGNAL(groupsChanged()),
- this, SLOT(slotGroupsChanged()));
- connect(m_model, SIGNAL(groupedSortingChanged(bool)),
- this, SLOT(slotGroupedSortingChanged(bool)));
- connect(m_model, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
- this, SLOT(slotSortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
- connect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
- this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
+ connect(m_model, &KItemModelBase::itemsChanged,
+ this, &KItemListView::slotItemsChanged);
+ connect(m_model, &KItemModelBase::itemsInserted,
+ this, &KItemListView::slotItemsInserted);
+ connect(m_model, &KItemModelBase::itemsRemoved,
+ this, &KItemListView::slotItemsRemoved);
+ connect(m_model, &KItemModelBase::itemsMoved,
+ this, &KItemListView::slotItemsMoved);
+ connect(m_model, &KItemModelBase::groupsChanged,
+ this, &KItemListView::slotGroupsChanged);
+ connect(m_model, &KItemModelBase::groupedSortingChanged,
+ this, &KItemListView::slotGroupedSortingChanged);
+ connect(m_model, &KItemModelBase::sortOrderChanged,
+ this, &KItemListView::slotSortOrderChanged);
+ connect(m_model, &KItemModelBase::sortRoleChanged,
+ this, &KItemListView::slotSortRoleChanged);
const int itemCount = m_model->count();
if (itemCount > 0) {
groupHeader = groupHeaderCreator()->create(this);
groupHeader->setParentItem(widget);
m_visibleGroups.insert(widget, groupHeader);
- connect(widget, SIGNAL(geometryChanged()), this, SLOT(slotGeometryOfGroupHeaderParentChanged()));
+ connect(widget, &KItemListWidget::geometryChanged, this, &KItemListView::slotGeometryOfGroupHeaderParentChanged);
}
Q_ASSERT(groupHeader->parentItem() == widget);
header->setParentItem(0);
groupHeaderCreator()->recycle(header);
m_visibleGroups.remove(widget);
- disconnect(widget, SIGNAL(geometryChanged()), this, SLOT(slotGeometryOfGroupHeaderParentChanged()));
+ disconnect(widget, &KItemListWidget::geometryChanged, this, &KItemListView::slotGeometryOfGroupHeaderParentChanged);
}
}
return;
}
- widget->disconnect(SIGNAL(roleEditingCanceled(int,QByteArray,QVariant)), this);
- widget->disconnect(SIGNAL(roleEditingFinished(int,QByteArray,QVariant)), this);
+ disconnect(widget, &KItemListWidget::roleEditingCanceled, this, nullptr);
+ disconnect(widget, &KItemListWidget::roleEditingFinished, this, nullptr);
}
int KItemListView::calculateAutoScrollingIncrement(int pos, int range, int oldInc)
pushRecycleableWidget(header);
}
-#include "kitemlistview.moc"
class KItemListWidget;
class KItemListWidgetInformant;
class KItemListWidgetCreatorBase;
-class KItemListViewCreatorBase;
class QTimer;
/**
#include "kitemlistview.h"
#include "private/kitemlistviewlayouter.h"
-#include <QtGui/qaccessible2.h>
+#include <QtGui/qaccessible.h>
#include <qgraphicsscene.h>
#include <qgraphicsview.h>
}
KItemListViewAccessible::KItemListViewAccessible(KItemListView* view_) :
- QAccessibleObjectEx(view_)
+ QAccessibleObject(view_)
{
Q_ASSERT(view());
+ m_cells.resize(childCount());
}
-void KItemListViewAccessible::modelReset()
+KItemListViewAccessible::~KItemListViewAccessible()
{
+ foreach (QAccessibleInterface* child, m_cells) {
+ if (child) {
+ QAccessible::Id childId = QAccessible::uniqueId(child);
+ QAccessible::deleteAccessibleInterface(childId);
+ }
+ }
}
-QAccessible::Role KItemListViewAccessible::cellRole() const
+void* KItemListViewAccessible::interface_cast(QAccessible::InterfaceType type)
{
- return QAccessible::Cell;
+ if (type == QAccessible::TableInterface) {
+ return static_cast<QAccessibleTableInterface*>(this);
+ }
+ return Q_NULLPTR;
}
-QAccessibleTable2CellInterface* KItemListViewAccessible::cell(int index) const
+void KItemListViewAccessible::modelReset()
+{
+}
+
+QAccessibleInterface* KItemListViewAccessible::cell(int index) const
{
if (index < 0 || index >= view()->model()->count()) {
return 0;
- } else {
- return new KItemListAccessibleCell(view(), index);
}
-}
-QVariant KItemListViewAccessible::invokeMethodEx(Method, int, const QVariantList&)
-{
- return QVariant();
+ if (m_cells.size() < index - 1)
+ m_cells.resize(childCount());
+
+ QAccessibleInterface* child = m_cells.at(index);
+ if (!child) {
+ child = new KItemListAccessibleCell(view(), index);
+ QAccessible::registerAccessibleInterface(child);
+ }
+ return child;
}
-QAccessibleTable2CellInterface* KItemListViewAccessible::cellAt(int row, int column) const
+QAccessibleInterface* KItemListViewAccessible::cellAt(int row, int column) const
{
return cell(columnCount() * row + column);
}
return QString();
}
-QList<QAccessibleTable2CellInterface*> KItemListViewAccessible::selectedCells() const
+QList<QAccessibleInterface*> KItemListViewAccessible::selectedCells() const
{
- QList<QAccessibleTable2CellInterface*> cells;
+ QList<QAccessibleInterface*> cells;
Q_FOREACH (int index, view()->controller()->selectionManager()->selectedItems()) {
cells.append(cell(index));
}
return true;
}
-QAccessible2::TableModelChange KItemListViewAccessible::modelChange() const
+void KItemListViewAccessible::modelChange(QAccessibleTableModelChangeEvent* /*event*/)
+{}
+
+QAccessible::Role KItemListViewAccessible::role() const
{
- QAccessible2::TableModelChange change;
- change.lastRow = rowCount();
- change.lastColumn = columnCount();
- return change;
+ return QAccessible::Table;
}
-QAccessible::Role KItemListViewAccessible::role(int child) const
+QAccessible::State KItemListViewAccessible::state() const
{
- Q_ASSERT(child >= 0);
-
- if (child > 0) {
- return QAccessible::Cell;
- } else {
- return QAccessible::Table;
- }
+ QAccessible::State s;
+ return s;
}
-QAccessible::State KItemListViewAccessible::state(int child) const
+QAccessibleInterface* KItemListViewAccessible::childAt(int x, int y) const
{
- if (child) {
- QAccessibleInterface* interface = 0;
- navigate(Child, child, &interface);
- if (interface) {
- return interface->state(0);
- }
- }
-
- return QAccessible::Normal | QAccessible::HasInvokeExtension;
+ const QPointF point = QPointF(x, y);
+ int itemIndex = view()->itemAt(view()->mapFromScene(point));
+ return child(itemIndex);
}
-int KItemListViewAccessible::childAt(int x, int y) const
+QAccessibleInterface* KItemListViewAccessible::parent() const
{
- const QPointF point = QPointF(x,y);
- return view()->itemAt(view()->mapFromScene(point));
+ // FIXME: return KItemListContainerAccessible here
+ return Q_NULLPTR;
}
int KItemListViewAccessible::childCount() const
int KItemListViewAccessible::indexOfChild(const QAccessibleInterface* interface) const
{
const KItemListAccessibleCell* widget = static_cast<const KItemListAccessibleCell*>(interface);
- return widget->index() + 1;
+ return widget->index();
}
-QString KItemListViewAccessible::text(Text, int child) const
+QString KItemListViewAccessible::text(QAccessible::Text) const
{
- Q_ASSERT(child == 0);
return QString();
}
-QRect KItemListViewAccessible::rect(int child) const
+QRect KItemListViewAccessible::rect() const
{
- Q_UNUSED(child)
if (!view()->isVisible()) {
return QRect();
}
}
}
-int KItemListViewAccessible::navigate(RelationFlag relation, int index, QAccessibleInterface** interface) const
+QAccessibleInterface* KItemListViewAccessible::child(int index) const
{
- *interface = 0;
-
- switch (relation) {
- case QAccessible::Child:
- Q_ASSERT(index > 0);
- *interface = cell(index - 1);
- if (*interface) {
- return 0;
- }
- break;
-
- default:
- break;
+ if (index >= 0 && index < childCount()) {
+ return cell(index);
}
-
- return -1;
+ return Q_NULLPTR;
}
-QAccessible::Relation KItemListViewAccessible::relationTo(int, const QAccessibleInterface*, int) const
-{
- return QAccessible::Unrelated;
-}
-
-#ifndef QT_NO_ACTION
-
-int KItemListViewAccessible::userActionCount(int) const
-{
- return 0;
-}
-
-QString KItemListViewAccessible::actionText(int, Text, int) const
-{
- return QString();
-}
-
-bool KItemListViewAccessible::doAction(int, int, const QVariantList&)
-{
- return false;
-}
-
-#endif
-
// Table Cell
KItemListAccessibleCell::KItemListAccessibleCell(KItemListView* view, int index) :
Q_ASSERT(index >= 0 && index < view->model()->count());
}
+void* KItemListAccessibleCell::interface_cast(QAccessible::InterfaceType type)
+{
+ if (type == QAccessible::TableCellInterface) {
+ return static_cast<QAccessibleTableCellInterface*>(this);
+ }
+ return Q_NULLPTR;
+}
+
int KItemListAccessibleCell::columnExtent() const
{
return 1;
return m_view->controller()->selectionManager()->isSelected(m_index);
}
-void KItemListAccessibleCell::rowColumnExtents(int* row, int* column, int* rowExtents, int* columnExtents, bool* selected) const
+QAccessibleInterface* KItemListAccessibleCell::table() const
{
- const KItemListViewLayouter* layouter = m_view->m_layouter;
- *row = layouter->itemRow(m_index);
- *column = layouter->itemColumn(m_index);
- *rowExtents = 1;
- *columnExtents = 1;
- *selected = isSelected();
+ return QAccessible::queryAccessibleInterface(m_view);
}
-QAccessibleTable2Interface* KItemListAccessibleCell::table() const
+QAccessible::Role KItemListAccessibleCell::role() const
{
- return QAccessible::queryAccessibleInterface(m_view)->table2Interface();
-}
-
-QAccessible::Role KItemListAccessibleCell::role(int child) const
-{
- Q_ASSERT(child == 0);
return QAccessible::Cell;
}
-QAccessible::State KItemListAccessibleCell::state(int child) const
+QAccessible::State KItemListAccessibleCell::state() const
{
- Q_ASSERT(child == 0);
- QAccessible::State state = Normal;
+ QAccessible::State state;
+ state.selectable = true;
if (isSelected()) {
- state |= Selected;
+ state.selected = true;
}
+ state.focusable = true;
if (m_view->controller()->selectionManager()->currentItem() == m_index) {
- state |= Focused;
+ state.focused = true;
}
- state |= Selectable;
- state |= Focusable;
-
if (m_view->controller()->selectionBehavior() == KItemListController::MultiSelection) {
- state |= MultiSelectable;
+ state.multiSelectable = true;
}
if (m_view->model()->isExpandable(m_index)) {
if (m_view->model()->isExpanded(m_index)) {
- state |= Expanded;
+ state.expanded = true;
} else {
- state |= Collapsed;
+ state.collapsed = true;
}
}
return m_view->model()->isExpandable(m_index);
}
-QRect KItemListAccessibleCell::rect(int) const
+QRect KItemListAccessibleCell::rect() const
{
QRect rect = m_view->itemRect(m_index).toRect();
return rect;
}
-QString KItemListAccessibleCell::text(QAccessible::Text t, int child) const
+QString KItemListAccessibleCell::text(QAccessible::Text t) const
{
- Q_ASSERT(child == 0);
- Q_UNUSED(child)
-
switch (t) {
- case QAccessible::Value:
case QAccessible::Name: {
const QHash<QByteArray, QVariant> data = m_view->model()->data(m_index);
return data["text"].toString();
return QString();
}
-void KItemListAccessibleCell::setText(QAccessible::Text, int child, const QString&)
+void KItemListAccessibleCell::setText(QAccessible::Text, const QString&)
{
- Q_ASSERT(child == 0);
+}
+
+QAccessibleInterface* KItemListAccessibleCell::child(int) const
+{
+ return Q_NULLPTR;
}
bool KItemListAccessibleCell::isValid() const
return m_view && (m_index >= 0) && (m_index < m_view->model()->count());
}
-int KItemListAccessibleCell::childAt(int, int) const
+QAccessibleInterface* KItemListAccessibleCell::childAt(int, int) const
{
- return 0;
+ return Q_NULLPTR;
}
int KItemListAccessibleCell::childCount() const
return -1;
}
-int KItemListAccessibleCell::navigate(RelationFlag relation, int index, QAccessibleInterface** interface) const
-{
- if (relation == Ancestor && index == 1) {
- *interface = new KItemListViewAccessible(m_view);
- return 0;
- }
-
- *interface = 0;
- return -1;
-}
-
-QAccessible::Relation KItemListAccessibleCell::relationTo(int child, const QAccessibleInterface* , int otherChild) const
-{
- Q_ASSERT(child == 0);
- Q_ASSERT(otherChild == 0);
- return QAccessible::Unrelated;
-}
-
-#ifndef QT_NO_ACTION
-
-int KItemListAccessibleCell::userActionCount(int) const
+QAccessibleInterface* KItemListAccessibleCell::parent() const
{
- return 0;
-}
-
-QString KItemListAccessibleCell::actionText(int, Text, int) const
-{
- return QString();
+ return QAccessible::queryAccessibleInterface(m_view);
}
-bool KItemListAccessibleCell::doAction(int, int, const QVariantList&)
-{
- return false;
-}
-
-#endif
-
int KItemListAccessibleCell::index() const
{
return m_index;
// Container Interface
KItemListContainerAccessible::KItemListContainerAccessible(KItemListContainer* container) :
- QAccessibleWidgetEx(container)
+ QAccessibleWidget(container)
{
}
int KItemListContainerAccessible::indexOfChild(const QAccessibleInterface* child) const
{
if (child->object() == container()->controller()->view()) {
- return 1;
- } else {
- return -1;
+ return 0;
}
+ return -1;
}
-int KItemListContainerAccessible::navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface** target) const
+QAccessibleInterface* KItemListContainerAccessible::child(int index) const
{
- if (relation == QAccessible::Child) {
- *target = new KItemListViewAccessible(container()->controller()->view());
- return 0;
- } else {
- return QAccessibleWidgetEx::navigate(relation, index, target);
+ if (index == 0) {
+ return QAccessible::queryAccessibleInterface(container()->controller()->view());
}
+ return Q_NULLPTR;
}
const KItemListContainer* KItemListContainerAccessible::container() const
#ifndef QT_NO_ACCESSIBILITY
+#include <libdolphin_export.h>
+
#include <QtCore/qpointer.h>
#include <QtGui/qaccessible.h>
-#include <QtGui/qaccessible2.h>
-#include <QtGui/qaccessiblewidget.h>
#include <QtGui/qaccessibleobject.h>
+#include <QtWidgets/qaccessiblewidget.h>
class KItemListView;
class KItemListContainer;
-class KItemListViewAccessible: public QAccessibleTable2Interface, public QAccessibleObjectEx
+class LIBDOLPHINPRIVATE_EXPORT KItemListViewAccessible: public QAccessibleObject, public QAccessibleTableInterface
{
- Q_ACCESSIBLE_OBJECT
-
public:
explicit KItemListViewAccessible(KItemListView* view);
-
- Role role(int child) const;
- State state(int child) const;
- QString text(Text t, int child) const;
- QRect rect(int child) const;
-
- int childAt(int x, int y) const;
- int childCount() const;
- int indexOfChild(const QAccessibleInterface*) const;
-
- int navigate(RelationFlag relation, int index, QAccessibleInterface** interface) const;
- Relation relationTo(int child, const QAccessibleInterface* other, int otherChild) const;
-
-#ifndef QT_NO_ACTION
- int userActionCount(int child) const;
- QString actionText(int action, Text t, int child) const;
- bool doAction(int action, int child, const QVariantList& params);
-#endif
- QVariant invokeMethodEx(Method, int, const QVariantList&);
-
- // Table2 interface
- virtual QAccessibleTable2CellInterface* cellAt(int row, int column) const;
- virtual QAccessibleInterface* caption() const;
- virtual QAccessibleInterface* summary() const;
- virtual QString columnDescription(int column) const;
- virtual QString rowDescription(int row) const;
- virtual int columnCount() const;
- virtual int rowCount() const;
- virtual QAccessible2::TableModelChange modelChange() const;
- virtual void rowsInserted(const QModelIndex&, int, int) {}
- virtual void rowsRemoved(const QModelIndex&, int, int) {}
- virtual void columnsInserted(const QModelIndex&, int, int) {}
- virtual void columnsRemoved(const QModelIndex&, int, int) {}
- virtual void rowsMoved(const QModelIndex&, int, int, const QModelIndex&, int) {}
- virtual void columnsMoved(const QModelIndex&, int, int, const QModelIndex&, int) {}
+ ~KItemListViewAccessible();
+
+ void* interface_cast(QAccessible::InterfaceType type) Q_DECL_OVERRIDE;
+
+ QAccessible::Role role() const Q_DECL_OVERRIDE;
+ QAccessible::State state() const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
+ QRect rect() const Q_DECL_OVERRIDE;
+
+ QAccessibleInterface* child(int index) const Q_DECL_OVERRIDE;
+ int childCount() const Q_DECL_OVERRIDE;
+ int indexOfChild(const QAccessibleInterface*) const Q_DECL_OVERRIDE;
+ QAccessibleInterface* childAt(int x, int y) const Q_DECL_OVERRIDE;
+ QAccessibleInterface* parent() const Q_DECL_OVERRIDE;
+
+ // Table interface
+ virtual QAccessibleInterface* cellAt(int row, int column) const Q_DECL_OVERRIDE;
+ virtual QAccessibleInterface* caption() const Q_DECL_OVERRIDE;
+ virtual QAccessibleInterface* summary() const Q_DECL_OVERRIDE;
+ virtual QString columnDescription(int column) const Q_DECL_OVERRIDE;
+ virtual QString rowDescription(int row) const Q_DECL_OVERRIDE;
+ virtual int columnCount() const Q_DECL_OVERRIDE;
+ virtual int rowCount() const Q_DECL_OVERRIDE;
// Selection
- virtual int selectedCellCount() const;
- virtual int selectedColumnCount() const;
- virtual int selectedRowCount() const;
- virtual QList<QAccessibleTable2CellInterface*> selectedCells() const;
- virtual QList<int> selectedColumns() const;
- virtual QList<int> selectedRows() const;
- virtual bool isColumnSelected(int column) const;
- virtual bool isRowSelected(int row) const;
- virtual bool selectRow(int row);
- virtual bool selectColumn(int column);
- virtual bool unselectRow(int row);
- virtual bool unselectColumn(int column);
+ virtual int selectedCellCount() const Q_DECL_OVERRIDE;
+ virtual int selectedColumnCount() const Q_DECL_OVERRIDE;
+ virtual int selectedRowCount() const Q_DECL_OVERRIDE;
+ virtual QList<QAccessibleInterface*> selectedCells() const Q_DECL_OVERRIDE;
+ virtual QList<int> selectedColumns() const Q_DECL_OVERRIDE;
+ virtual QList<int> selectedRows() const Q_DECL_OVERRIDE;
+ virtual bool isColumnSelected(int column) const Q_DECL_OVERRIDE;
+ virtual bool isRowSelected(int row) const Q_DECL_OVERRIDE;
+ virtual bool selectRow(int row) Q_DECL_OVERRIDE;
+ virtual bool selectColumn(int column) Q_DECL_OVERRIDE;
+ virtual bool unselectRow(int row) Q_DECL_OVERRIDE;
+ virtual bool unselectColumn(int column) Q_DECL_OVERRIDE;
+ virtual void modelChange(QAccessibleTableModelChangeEvent*) Q_DECL_OVERRIDE;
KItemListView* view() const;
protected:
virtual void modelReset();
/**
- * Create an QAccessibleTable2CellInterface representing the table
+ * Create an QAccessibleTableCellInterface representing the table
* cell at the @index. Index is 0-based.
*/
- inline QAccessibleTable2CellInterface* cell(int index) const;
- inline QAccessible::Role cellRole() const;
+ inline QAccessibleInterface* cell(int index) const;
+
+private:
+ mutable QVector<QAccessibleInterface*> m_cells;
};
-class KItemListAccessibleCell: public QAccessibleTable2CellInterface
+class LIBDOLPHINPRIVATE_EXPORT KItemListAccessibleCell: public QAccessibleInterface, public QAccessibleTableCellInterface
{
public:
KItemListAccessibleCell(KItemListView* view, int m_index);
- QObject* object() const;
- Role role(int) const;
- State state(int) const;
- QRect rect(int) const;
- bool isValid() const;
- int childAt(int, int) const;
- int childCount() const;
- int indexOfChild(const QAccessibleInterface*) const;
- QString text(Text t, int child) const;
- void setText(Text t, int child, const QString& text);
- int navigate(RelationFlag relation, int m_index, QAccessibleInterface** interface) const;
- Relation relationTo(int child, const QAccessibleInterface* other, int otherChild) const;
+ void* interface_cast(QAccessible::InterfaceType type) Q_DECL_OVERRIDE;
+ QObject* object() const Q_DECL_OVERRIDE;
+ bool isValid() const Q_DECL_OVERRIDE;
+ QAccessible::Role role() const Q_DECL_OVERRIDE;
+ QAccessible::State state() const Q_DECL_OVERRIDE;
+ QRect rect() const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
+ void setText(QAccessible::Text t, const QString& text) Q_DECL_OVERRIDE;
+
+ QAccessibleInterface* child(int index) const Q_DECL_OVERRIDE;
+ int childCount() const Q_DECL_OVERRIDE;
+ QAccessibleInterface* childAt(int x, int y) const Q_DECL_OVERRIDE;
+ int indexOfChild(const QAccessibleInterface*) const Q_DECL_OVERRIDE;
+
+ QAccessibleInterface* parent() const Q_DECL_OVERRIDE;
bool isExpandable() const;
-#ifndef QT_NO_ACTION
- int userActionCount(int child) const;
- QString actionText(int action, Text t, int child) const;
- bool doAction(int action, int child, const QVariantList& params);
-#endif
-
// Cell Interface
- virtual int columnExtent() const;
- virtual QList<QAccessibleInterface*> columnHeaderCells() const;
- virtual int columnIndex() const;
- virtual int rowExtent() const;
- virtual QList<QAccessibleInterface*> rowHeaderCells() const;
- virtual int rowIndex() const;
- virtual bool isSelected() const;
- virtual void rowColumnExtents(int* row, int* column, int* rowExtents, int* columnExtents, bool* selected) const;
- virtual QAccessibleTable2Interface* table() const;
+ virtual int columnExtent() const Q_DECL_OVERRIDE;
+ virtual QList<QAccessibleInterface*> columnHeaderCells() const Q_DECL_OVERRIDE;
+ virtual int columnIndex() const Q_DECL_OVERRIDE;
+ virtual int rowExtent() const Q_DECL_OVERRIDE;
+ virtual QList<QAccessibleInterface*> rowHeaderCells() const Q_DECL_OVERRIDE;
+ virtual int rowIndex() const Q_DECL_OVERRIDE;
+ virtual bool isSelected() const Q_DECL_OVERRIDE;
+ virtual QAccessibleInterface* table() const Q_DECL_OVERRIDE;
inline int index() const;
int m_index;
};
-class KItemListContainerAccessible : public QAccessibleWidgetEx
+class LIBDOLPHINPRIVATE_EXPORT KItemListContainerAccessible : public QAccessibleWidget
{
- Q_ACCESSIBLE_OBJECT
-
public:
explicit KItemListContainerAccessible(KItemListContainer* container);
virtual ~KItemListContainerAccessible();
- int childCount() const;
- int indexOfChild(const QAccessibleInterface* child) const;
- int navigate(RelationFlag relation, int entry, QAccessibleInterface** target) const;
+ QAccessibleInterface* child(int index) const Q_DECL_OVERRIDE;
+ int childCount() const Q_DECL_OVERRIDE;
+ int indexOfChild(const QAccessibleInterface* child) const Q_DECL_OVERRIDE;
private:
const KItemListContainer* container() const;
m_hoverAnimation = new QPropertyAnimation(this, "hoverOpacity", this);
const int duration = (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) ? 1 : 200;
m_hoverAnimation->setDuration(duration);
- connect(m_hoverAnimation, SIGNAL(finished()), this, SLOT(slotHoverAnimationFinished()));
+ connect(m_hoverAnimation, &QPropertyAnimation::finished, this, &KItemListWidget::slotHoverAnimationFinished);
}
m_hoverAnimation->stop();
widget->style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &viewItemOption, painter, widget);
}
-#include "kitemlistwidget.moc"
Q_UNUSED(previous);
}
-#include "kitemmodelbase.moc"
}
}
-#include "kstandarditemlistgroupheader.moc"
}
}
-#include "kstandarditemlistview.moc"
#include "kfileitemlistview.h"
#include "kfileitemmodel.h"
-#include <KIcon>
+#include <QIcon>
#include <KIconEffect>
#include <KIconLoader>
#include <KLocale>
if (m_roleEditor) {
emit roleEditingCanceled(index(), current, data().value(current));
- disconnect(m_roleEditor, SIGNAL(roleEditingCanceled(QByteArray,QVariant)),
- this, SLOT(slotRoleEditingCanceled(QByteArray,QVariant)));
- disconnect(m_roleEditor, SIGNAL(roleEditingFinished(QByteArray,QVariant)),
- this, SLOT(slotRoleEditingFinished(QByteArray,QVariant)));
+ disconnect(m_roleEditor, &KItemListRoleEditor::roleEditingCanceled,
+ this, &KStandardItemListWidget::slotRoleEditingCanceled);
+ disconnect(m_roleEditor, &KItemListRoleEditor::roleEditingFinished,
+ this, &KStandardItemListWidget::slotRoleEditingFinished);
if (m_oldRoleEditor) {
m_oldRoleEditor->deleteLater();
m_roleEditor->setTextCursor(cursor);
}
- connect(m_roleEditor, SIGNAL(roleEditingCanceled(QByteArray,QVariant)),
- this, SLOT(slotRoleEditingCanceled(QByteArray,QVariant)));
- connect(m_roleEditor, SIGNAL(roleEditingFinished(QByteArray,QVariant)),
- this, SLOT(slotRoleEditingFinished(QByteArray,QVariant)));
+ connect(m_roleEditor, &KItemListRoleEditor::roleEditingCanceled,
+ this, &KStandardItemListWidget::slotRoleEditingCanceled);
+ connect(m_roleEditor, &KItemListRoleEditor::roleEditingFinished,
+ this, &KStandardItemListWidget::slotRoleEditingFinished);
// Adjust the geometry of the editor
QRectF rect = roleEditingRect(current);
const KUrl itemUrl = data().value("url").value<KUrl>();
m_isCut = clipboard->isCut(itemUrl);
- connect(clipboard, SIGNAL(cutItemsChanged()),
- this, SLOT(slotCutItemsChanged()));
+ connect(clipboard, &KFileItemClipboard::cutItemsChanged,
+ this, &KStandardItemListWidget::slotCutItemsChanged);
}
void KStandardItemListWidget::hideEvent(QHideEvent* event)
{
- disconnect(KFileItemClipboard::instance(), SIGNAL(cutItemsChanged()),
- this, SLOT(slotCutItemsChanged()));
+ disconnect(KFileItemClipboard::instance(), &KFileItemClipboard::cutItemsChanged,
+ this, &KStandardItemListWidget::slotCutItemsChanged);
KItemListWidget::hideEvent(event);
}
void KStandardItemListWidget::closeRoleEditor()
{
- disconnect(m_roleEditor, SIGNAL(roleEditingCanceled(QByteArray,QVariant)),
- this, SLOT(slotRoleEditingCanceled(QByteArray,QVariant)));
- disconnect(m_roleEditor, SIGNAL(roleEditingFinished(QByteArray,QVariant)),
- this, SLOT(slotRoleEditingFinished(QByteArray,QVariant)));
+ disconnect(m_roleEditor, &KItemListRoleEditor::roleEditingCanceled,
+ this, &KStandardItemListWidget::slotRoleEditingCanceled);
+ disconnect(m_roleEditor, &KItemListRoleEditor::roleEditingFinished,
+ this, &KStandardItemListWidget::slotRoleEditingFinished);
if (m_roleEditor->hasFocus()) {
// If the editing was not ended by a FocusOut event, we have
QPixmap pixmap;
if (!QPixmapCache::find(key, pixmap)) {
- const KIcon icon(name);
+ const QIcon icon = QIcon::fromTheme(name);
int requestedSize;
if (size <= KIconLoader::SizeSmall) {
return option.padding * 6;
}
-#include "kstandarditemlistwidget.moc"
Q_UNUSED(removedItem);
}
-
-#include "kstandarditemmodel.moc"
#include <KGlobal>
#include <KLocale>
-#include <baloo/file.h>
-#include <kfilemetadata/propertyinfo.h>
+#include <Baloo/File>
+#include <KFileMetaData/PropertyInfo>
+#include <KFileMetaData/UserMetaData>
#include <QTime>
#include <QMap>
}
}
+ KFileMetaData::UserMetaData md(file.path());
if (roles.contains("tags")) {
- values.insert("tags", tagsFromValues(file.tags()));
+ values.insert("tags", tagsFromValues(md.tags()));
}
if (roles.contains("rating")) {
- values.insert("rating", QString::number(file.rating()));
+ values.insert("rating", QString::number(md.rating()));
}
if (roles.contains("comment")) {
- values.insert("comment", file.userComment());
+ values.insert("comment", md.userComment());
}
return values;
m_dirWatcher(0),
m_watchedDirs()
{
- connect(m_model, SIGNAL(itemsRemoved(KItemRangeList)),
- this, SLOT(slotItemsRemoved()));
+ connect(m_model, &KFileItemModel::itemsRemoved,
+ this, &KDirectoryContentsCounter::slotItemsRemoved);
if (!m_workerThread) {
m_workerThread = new QThread();
m_worker->moveToThread(m_workerThread);
++m_workersCount;
- connect(this, SIGNAL(requestDirectoryContentsCount(QString,KDirectoryContentsCounterWorker::Options)),
- m_worker, SLOT(countDirectoryContents(QString,KDirectoryContentsCounterWorker::Options)));
- connect(m_worker, SIGNAL(result(QString,int)),
- this, SLOT(slotResult(QString,int)));
+ connect(this, &KDirectoryContentsCounter::requestDirectoryContentsCount,
+ m_worker, &KDirectoryContentsCounterWorker::countDirectoryContents);
+ connect(m_worker, &KDirectoryContentsCounterWorker::result,
+ this, &KDirectoryContentsCounter::slotResult);
m_dirWatcher = new KDirWatch(this);
- connect(m_dirWatcher, SIGNAL(dirty(QString)), this, SLOT(slotDirWatchDirty(QString)));
+ connect(m_dirWatcher, &KDirWatch::dirty, this, &KDirectoryContentsCounter::slotDirWatchDirty);
}
KDirectoryContentsCounter::~KDirectoryContentsCounter()
{
updateCutItems();
- connect(QApplication::clipboard(), SIGNAL(dataChanged()),
- this, SLOT(updateCutItems()));
+ connect(QApplication::clipboard(), &QClipboard::dataChanged,
+ this, &KFileItemClipboard::updateCutItems);
}
-#include "kfileitemclipboard.moc"
}
}
-#include "kfileitemmodeldirlister.moc"
#include <libdolphin_export.h>
#include <KDirLister>
+#include <KUrl>
/**
* @brief Extends the class KDirLister by emitting a signal when an
#define KFILEITEMMODELSORTALGORITHM_H
#include <QtCore>
+#include <QtConcurrent/QtConcurrent>
#include <algorithm>
#include "kitemlistheaderwidget.h"
-#include <KAction>
-#include <KMenu>
+#include <QMenu>
#include <kitemviews/kitemmodelbase.h>
#include <QApplication>
}
if (m_model) {
- disconnect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
- this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
- disconnect(m_model, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
- this, SLOT(slotSortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
+ disconnect(m_model, &KItemModelBase::sortRoleChanged,
+ this, &KItemListHeaderWidget::slotSortRoleChanged);
+ disconnect(m_model, &KItemModelBase::sortOrderChanged,
+ this, &KItemListHeaderWidget::slotSortOrderChanged);
}
m_model = model;
if (m_model) {
- connect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
- this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
- connect(m_model, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
- this, SLOT(slotSortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
+ connect(m_model, &KItemModelBase::sortRoleChanged,
+ this, &KItemListHeaderWidget::slotSortRoleChanged);
+ connect(m_model, &KItemModelBase::sortOrderChanged,
+ this, &KItemListHeaderWidget::slotSortOrderChanged);
}
}
return -1;
}
-#include "kitemlistheaderwidget.moc"
parent->installEventFilter(this);
}
- connect(this, SIGNAL(textChanged()), this, SLOT(autoAdjustSize()));
+ connect(this, &KItemListRoleEditor::textChanged, this, &KItemListRoleEditor::autoAdjustSize);
}
KItemListRoleEditor::~KItemListRoleEditor()
}
}
-#include "kitemlistroleeditor.moc"
return m_active;
}
-#include "kitemlistrubberband.moc"
return iconSize;
}
-#include "kitemlistselectiontoggle.moc"
#include <QGraphicsWidget>
#include <QPixmap>
-class QPropertyAnimation;
/**
* @brief Allows to toggle between the selected and unselected state of an item.
m_animation = new QPropertyAnimation(this);
const int duration = (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) ? 1 : 100;
m_animation->setDuration(duration);
- connect(m_animation, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)),
- this, SLOT(slotAnimationStateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ connect(m_animation, &QPropertyAnimation::stateChanged,
+ this, &KItemListSmoothScroller::slotAnimationStateChanged);
m_scrollBar->installEventFilter(this);
}
event->accept();
}
-#include "kitemlistsmoothscroller.moc"
}
Q_ASSERT(propertyAnim);
- connect(propertyAnim, SIGNAL(finished()), this, SLOT(slotFinished()));
+ connect(propertyAnim, &QPropertyAnimation::finished, this, &KItemListViewAnimation::slotFinished);
m_animation[type].insert(widget, propertyAnim);
propertyAnim->start();
Q_ASSERT(false);
}
-#include "kitemlistviewanimation.moc"
class KItemListView;
class QGraphicsWidget;
-class QPointF;
class QPropertyAnimation;
/**
return 100;
}
-#include "kitemlistviewlayouter.moc"
#include "dolphinmainwindow.h"
-#include <KAboutData>
+#include <k4aboutdata.h>
#include <KCmdLineArgs>
#include <KLocale>
#include <kmainwindow.h>
+#include <kdemacros.h>
+#include <kdeversion.h>
#include <KDebug>
extern "C"
KDE_EXPORT int kdemain(int argc, char **argv)
{
- KAboutData about("dolphin", 0,
+ K4AboutData about("dolphin", 0,
ki18nc("@title", "Dolphin"),
- KDE_VERSION_STRING,
+ "4.60",
ki18nc("@title", "File Manager"),
- KAboutData::License_GPL,
+ K4AboutData::License_GPL,
ki18nc("@info:credit", "(C) 2006-2014 Peter Penz, Frank Reininghaus, and Emmanuel Pescosta"));
about.setHomepage("http://dolphin.kde.org");
about.addAuthor(ki18nc("@info:credit", "Emmanuel Pescosta"),
Terminal=false
MimeType=inode/directory;
InitialPreference=10
+X-DBUS-ServiceName=org.kde.dolphin
return QPalette::WindowText;
}
-#include "foldersitemlistwidget.moc"
#include <kitemviews/kfileitemmodel.h>
#include <KFileItem>
-#include <konq_operations.h>
+#include <KJobWidgets>
+#include <KJobUiDelegate>
+#include <KIO/CopyJob>
+#include <KIO/FileUndoManager>
#include <QApplication>
#include <QBoxLayout>
FoldersPanel::~FoldersPanel()
{
- FoldersPanelSettings::self()->writeConfig();
+ FoldersPanelSettings::self()->save();
if (m_controller) {
KItemListView* view = m_controller->view();
// opening the folders panel.
view->setOpacity(0);
- connect(view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
- this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
+ connect(view, &KFileItemListView::roleEditingFinished,
+ this, &FoldersPanel::slotRoleEditingFinished);
m_model = new KFileItemModel(this);
m_model->setShowDirectoriesOnly(true);
m_model->setShowHiddenFiles(FoldersPanelSettings::hiddenFilesShown());
// Use a QueuedConnection to give the view the possibility to react first on the
// finished loading.
- connect(m_model, SIGNAL(directoryLoadingCompleted()), this, SLOT(slotLoadingCompleted()), Qt::QueuedConnection);
+ connect(m_model, &KFileItemModel::directoryLoadingCompleted, this, &FoldersPanel::slotLoadingCompleted, Qt::QueuedConnection);
m_controller = new KItemListController(m_model, view, this);
m_controller->setSelectionBehavior(KItemListController::SingleSelection);
m_controller->setAutoActivationDelay(750);
m_controller->setSingleClickActivationEnforced(true);
- connect(m_controller, SIGNAL(itemActivated(int)), this, SLOT(slotItemActivated(int)));
- connect(m_controller, SIGNAL(itemMiddleClicked(int)), this, SLOT(slotItemMiddleClicked(int)));
- connect(m_controller, SIGNAL(itemContextMenuRequested(int,QPointF)), this, SLOT(slotItemContextMenuRequested(int,QPointF)));
- connect(m_controller, SIGNAL(viewContextMenuRequested(QPointF)), this, SLOT(slotViewContextMenuRequested(QPointF)));
- connect(m_controller, SIGNAL(itemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotItemDropEvent(int,QGraphicsSceneDragDropEvent*)));
+ connect(m_controller, &KItemListController::itemActivated, this, &FoldersPanel::slotItemActivated);
+ connect(m_controller, &KItemListController::itemMiddleClicked, this, &FoldersPanel::slotItemMiddleClicked);
+ connect(m_controller, &KItemListController::itemContextMenuRequested, this, &FoldersPanel::slotItemContextMenuRequested);
+ connect(m_controller, &KItemListController::viewContextMenuRequested, this, &FoldersPanel::slotViewContextMenuRequested);
+ connect(m_controller, &KItemListController::itemDropEvent, this, &FoldersPanel::slotItemDropEvent);
KItemListContainer* container = new KItemListContainer(m_controller, this);
container->setEnabledFrame(false);
const KFileItem item = m_model->fileItem(index);
const QString newName = value.toString();
if (!newName.isEmpty() && newName != item.text() && newName != QLatin1String(".") && newName != QLatin1String("..")) {
- KonqOperations::rename(this, item.url(), newName);
+ const QUrl oldUrl = item.url();
+ QUrl newUrl = oldUrl.adjusted(QUrl::RemoveFilename);
+ newUrl.setPath(newUrl.path() + KIO::encodeFileName(newName));
+
+ KIO::Job* job = KIO::moveAs(oldUrl, newUrl);
+ KJobWidgets::setWindow(job, this);
+ KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, QList<QUrl>() << oldUrl, newUrl, job);
+ job->ui()->setAutoErrorHandlingEnabled(true);
}
}
}
m_controller->view()->scrollToItem(index);
}
-#include "folderspanel.moc"
#include <KFileItem>
#include <KIconLoader>
+#include <KIO/CopyJob>
#include <KIO/DeleteJob>
-#include <KMenu>
-#include <konqmimedata.h>
+#include <KIO/JobUiDelegate>
+#include <QMenu>
+#include <QIcon>
+#include <KJobWidgets>
+#include <KSharedConfig>
+#include <KConfigGroup>
+#include <kurlmimedata.h>
#include <KFileItemListProperties>
#include <konq_operations.h>
#include <KLocale>
+#include <KIO/Paste>
+#include <KIO/FileUndoManager>
#include <KPropertiesDialog>
#include "folderspanel.h"
#include <QApplication>
#include <QClipboard>
+#include <QMimeData>
TreeViewContextMenu::TreeViewContextMenu(FoldersPanel* parent,
const KFileItem& fileInfo) :
void TreeViewContextMenu::open()
{
- KMenu* popup = new KMenu(m_parent);
+ QMenu* popup = new QMenu(m_parent);
if (!m_fileItem.isNull()) {
KFileItemListProperties capabilities(KFileItemList() << m_fileItem);
// insert 'Cut', 'Copy' and 'Paste'
- QAction* cutAction = new QAction(KIcon("edit-cut"), i18nc("@action:inmenu", "Cut"), this);
+ QAction* cutAction = new QAction(QIcon::fromTheme("edit-cut"), i18nc("@action:inmenu", "Cut"), this);
cutAction->setEnabled(capabilities.supportsMoving());
- connect(cutAction, SIGNAL(triggered()), this, SLOT(cut()));
+ connect(cutAction, &QAction::triggered, this, &TreeViewContextMenu::cut);
- QAction* copyAction = new QAction(KIcon("edit-copy"), i18nc("@action:inmenu", "Copy"), this);
- connect(copyAction, SIGNAL(triggered()), this, SLOT(copy()));
+ QAction* copyAction = new QAction(QIcon::fromTheme("edit-copy"), i18nc("@action:inmenu", "Copy"), this);
+ connect(copyAction, &QAction::triggered, this, &TreeViewContextMenu::copy);
const QPair<bool, QString> pasteInfo = KonqOperations::pasteInfo(m_fileItem.url());
- QAction* pasteAction = new QAction(KIcon("edit-paste"), pasteInfo.second, this);
- connect(pasteAction, SIGNAL(triggered()), this, SLOT(paste()));
+ QAction* pasteAction = new QAction(QIcon::fromTheme("edit-paste"), pasteInfo.second, this);
+ connect(pasteAction, &QAction::triggered, this, &TreeViewContextMenu::paste);
pasteAction->setEnabled(pasteInfo.first);
popup->addAction(cutAction);
// insert 'Rename'
QAction* renameAction = new QAction(i18nc("@action:inmenu", "Rename..."), this);
renameAction->setEnabled(capabilities.supportsMoving());
- renameAction->setIcon(KIcon("edit-rename"));
- connect(renameAction, SIGNAL(triggered()), this, SLOT(rename()));
+ renameAction->setIcon(QIcon::fromTheme("edit-rename"));
+ connect(renameAction, &QAction::triggered, this, &TreeViewContextMenu::rename);
popup->addAction(renameAction);
// insert 'Move to Trash' and (optionally) 'Delete'
const KUrl url = m_fileItem.url();
if (url.isLocalFile()) {
- QAction* moveToTrashAction = new QAction(KIcon("user-trash"),
+ QAction* moveToTrashAction = new QAction(QIcon::fromTheme("user-trash"),
i18nc("@action:inmenu", "Move to Trash"), this);
const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving();
moveToTrashAction->setEnabled(enableMoveToTrash);
- connect(moveToTrashAction, SIGNAL(triggered()), this, SLOT(moveToTrash()));
+ connect(moveToTrashAction, &QAction::triggered, this, &TreeViewContextMenu::moveToTrash);
popup->addAction(moveToTrashAction);
} else {
showDeleteCommand = true;
}
if (showDeleteCommand) {
- QAction* deleteAction = new QAction(KIcon("edit-delete"), i18nc("@action:inmenu", "Delete"), this);
+ QAction* deleteAction = new QAction(QIcon::fromTheme("edit-delete"), i18nc("@action:inmenu", "Delete"), this);
deleteAction->setEnabled(capabilities.supportsDeleting());
- connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteItem()));
+ connect(deleteAction, &QAction::triggered, this, &TreeViewContextMenu::deleteItem);
popup->addAction(deleteAction);
}
showHiddenFilesAction->setCheckable(true);
showHiddenFilesAction->setChecked(m_parent->showHiddenFiles());
popup->addAction(showHiddenFilesAction);
- connect(showHiddenFilesAction, SIGNAL(toggled(bool)), this, SLOT(setShowHiddenFiles(bool)));
+ connect(showHiddenFilesAction, &QAction::toggled, this, &TreeViewContextMenu::setShowHiddenFiles);
// insert 'Automatic Scrolling'
QAction* autoScrollingAction = new QAction(i18nc("@action:inmenu", "Automatic Scrolling"), this);
// TODO: Temporary disabled. Horizontal autoscrolling will be implemented later either
// in KItemViews or manually as part of the FoldersPanel
//popup->addAction(autoScrollingAction);
- connect(autoScrollingAction, SIGNAL(toggled(bool)), this, SLOT(setAutoScrolling(bool)));
+ connect(autoScrollingAction, &QAction::toggled, this, &TreeViewContextMenu::setAutoScrolling);
if (!m_fileItem.isNull()) {
// insert 'Properties' entry
QAction* propertiesAction = new QAction(i18nc("@action:inmenu", "Properties"), this);
- propertiesAction->setIcon(KIcon("document-properties"));
- connect(propertiesAction, SIGNAL(triggered()), this, SLOT(showProperties()));
+ propertiesAction->setIcon(QIcon::fromTheme("document-properties"));
+ connect(propertiesAction, &QAction::triggered, this, &TreeViewContextMenu::showProperties);
popup->addAction(propertiesAction);
}
}
}
- QWeakPointer<KMenu> popupPtr = popup;
+ QWeakPointer<QMenu> popupPtr = popup;
popup->exec(QCursor::pos());
if (popupPtr.data()) {
popupPtr.data()->deleteLater();
KUrl::List mostLocalUrls;
bool dummy;
mostLocalUrls.append(m_fileItem.mostLocalUrl(dummy));
- KonqMimeData::populateMimeData(mimeData, kdeUrls, mostLocalUrls, cut);
+ KIO::setClipboardDataCut(mimeData, cut);
+ KUrlMimeData::setUrls(kdeUrls, mostLocalUrls, mimeData);
}
void TreeViewContextMenu::cut()
void TreeViewContextMenu::moveToTrash()
{
- KonqOperations::del(m_parent, KonqOperations::TRASH, m_fileItem.url());
+ KUrl::List list = KUrl::List() << m_fileItem.url();
+ KIO::JobUiDelegate uiDelegate;
+ uiDelegate.setWindow(m_parent);
+ if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Trash, KIO::JobUiDelegate::DefaultConfirmation)) {
+ KIO::Job* job = KIO::trash(list);
+ KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, KUrl("trash:/"), job);
+ KJobWidgets::setWindow(job, m_parent);
+ job->ui()->setAutoErrorHandlingEnabled(true);
+ }
}
void TreeViewContextMenu::deleteItem()
{
- KonqOperations::del(m_parent, KonqOperations::DEL, m_fileItem.url());
+ KUrl::List list = KUrl::List() << m_fileItem.url();
+ KIO::JobUiDelegate uiDelegate;
+ uiDelegate.setWindow(m_parent);
+ if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) {
+ KIO::Job* job = KIO::del(list);
+ KJobWidgets::setWindow(job, m_parent);
+ job->ui()->setAutoErrorHandlingEnabled(true);
+ }
}
void TreeViewContextMenu::showProperties()
m_parent->setAutoScrolling(enable);
}
-#include "treeviewcontextmenu.moc"
#include <QObject>
#include <KFileItem>
+class QMimeData;
class FoldersPanel;
/**
#ifndef HAVE_BALOO
#include <kfilemetadataconfigurationwidget.h>
#else
-#include <baloo/filemetadataconfigwidget.h>
+#include <Baloo/FileMetaDataConfigWidget>
#endif
#include <KLocale>
return m_descriptionLabel->text();
}
-#include "filemetadataconfigurationdialog.moc"
#include "informationpanelcontent.h"
#include <KIO/Job>
#include <KIO/JobUiDelegate>
+#include <KJobWidgets>
#include <KDirNotify>
#include <QApplication>
#include <QShowEvent>
#include <QVBoxLayout>
+#include <QTimer>
InformationPanel::InformationPanel(QWidget* parent) :
Panel(parent),
// an item for the currently shown directory.
m_folderStatJob = KIO::stat(url(), KIO::HideProgressInfo);
if (m_folderStatJob->ui()) {
- m_folderStatJob->ui()->setWindow(this);
+ KJobWidgets::setWindow(m_folderStatJob, this);
}
- connect(m_folderStatJob, SIGNAL(result(KJob*)),
- this, SLOT(slotFolderStatFinished(KJob*)));
+ connect(m_folderStatJob, &KIO::Job::result,
+ this, &InformationPanel::slotFolderStatFinished);
} else {
m_content->showItem(item);
}
m_infoTimer = new QTimer(this);
m_infoTimer->setInterval(300);
m_infoTimer->setSingleShot(true);
- connect(m_infoTimer, SIGNAL(timeout()),
- this, SLOT(slotInfoTimeout()));
+ connect(m_infoTimer, &QTimer::timeout,
+ this, &InformationPanel::slotInfoTimeout);
m_urlChangedTimer = new QTimer(this);
m_urlChangedTimer->setInterval(200);
m_urlChangedTimer->setSingleShot(true);
- connect(m_urlChangedTimer, SIGNAL(timeout()),
- this, SLOT(showItemInfo()));
+ connect(m_urlChangedTimer, &QTimer::timeout,
+ this, &InformationPanel::showItemInfo);
m_resetUrlTimer = new QTimer(this);
m_resetUrlTimer->setInterval(1000);
m_resetUrlTimer->setSingleShot(true);
- connect(m_resetUrlTimer, SIGNAL(timeout()),
- this, SLOT(reset()));
+ connect(m_resetUrlTimer, &QTimer::timeout,
+ this, &InformationPanel::reset);
Q_ASSERT(m_urlChangedTimer->interval() < m_infoTimer->interval());
Q_ASSERT(m_urlChangedTimer->interval() < m_resetUrlTimer->interval());
org::kde::KDirNotify* dirNotify = new org::kde::KDirNotify(QString(), QString(),
QDBusConnection::sessionBus(), this);
- connect(dirNotify, SIGNAL(FileRenamed(QString,QString)), SLOT(slotFileRenamed(QString,QString)));
- connect(dirNotify, SIGNAL(FilesAdded(QString)), SLOT(slotFilesAdded(QString)));
- connect(dirNotify, SIGNAL(FilesChanged(QStringList)), SLOT(slotFilesChanged(QStringList)));
- connect(dirNotify, SIGNAL(FilesRemoved(QStringList)), SLOT(slotFilesRemoved(QStringList)));
- connect(dirNotify, SIGNAL(enteredDirectory(QString)), SLOT(slotEnteredDirectory(QString)));
- connect(dirNotify, SIGNAL(leftDirectory(QString)), SLOT(slotLeftDirectory(QString)));
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::FileRenamed, this, &InformationPanel::slotFileRenamed);
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::FilesAdded, this, &InformationPanel::slotFilesAdded);
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::FilesChanged, this, &InformationPanel::slotFilesChanged);
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::FilesRemoved, this, &InformationPanel::slotFilesRemoved);
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::enteredDirectory, this, &InformationPanel::slotEnteredDirectory);
+ connect(dirNotify, &OrgKdeKDirNotifyInterface::leftDirectory, this, &InformationPanel::slotLeftDirectory);
m_content = new InformationPanelContent(this);
- connect(m_content, SIGNAL(urlActivated(KUrl)), this, SIGNAL(urlActivated(KUrl)));
+ connect(m_content, &InformationPanelContent::urlActivated, this, &InformationPanel::urlActivated);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
m_initialized = true;
}
-#include "informationpanel.moc"
#include <KGlobalSettings>
#include <KIO/JobUiDelegate>
#include <KIO/PreviewJob>
+#include <KJobWidgets>
#include <KIconEffect>
#include <KIconLoader>
+#include <QIcon>
#include <KLocale>
-#include <KMenu>
+#include <QMenu>
#include <kseparator.h>
#include <KStringHandler>
#ifndef HAVE_BALOO
#include <KFileMetaDataWidget>
#else
-#include <baloo/filemetadatawidget.h>
+#include <Baloo/FileMetaDataWidget>
#endif
#include <panels/places/placesitem.h>
m_outdatedPreviewTimer = new QTimer(this);
m_outdatedPreviewTimer->setInterval(300);
m_outdatedPreviewTimer->setSingleShot(true);
- connect(m_outdatedPreviewTimer, SIGNAL(timeout()),
- this, SLOT(markOutdatedPreview()));
+ connect(m_outdatedPreviewTimer, &QTimer::timeout,
+ this, &InformationPanelContent::markOutdatedPreview);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setSpacing(KDialog::spacingHint());
m_phononWidget = new PhononWidget(parent);
m_phononWidget->hide();
m_phononWidget->setMinimumWidth(minPreviewWidth);
- connect(m_phononWidget, SIGNAL(hasVideoChanged(bool)),
- this, SLOT(slotHasVideoChanged(bool)));
+ connect(m_phononWidget, &PhononWidget::hasVideoChanged,
+ this, &InformationPanelContent::slotHasVideoChanged);
// name
m_nameLabel = new QLabel(parent);
#ifndef HAVE_BALOO
m_metaDataWidget = new KFileMetaDataWidget(parent);
+ connect(m_metaDataWidget, &KFileMetaDataWidget::urlActivated,
+ this, &InformationPanelContent::urlActivated);
#else
m_metaDataWidget = new Baloo::FileMetaDataWidget(parent);
+ connect(m_metaDataWidget, &Baloo::FileMetaDataWidget::urlActivated,
+ this, &InformationPanelContent::urlActivated);
#endif
m_metaDataWidget->setFont(KGlobalSettings::smallestReadableFont());
m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
- connect(m_metaDataWidget, SIGNAL(urlActivated(KUrl)), this, SIGNAL(urlActivated(KUrl)));
// Encapsulate the MetaDataWidget inside a container that has a dummy widget
// at the bottom. This prevents that the meta data widget gets vertically stretched
InformationPanelContent::~InformationPanelContent()
{
- InformationPanelSettings::self()->writeConfig();
+ InformationPanelSettings::self()->save();
}
void InformationPanelContent::showItem(const KFileItem& item)
m_previewJob->setScaleType(KIO::PreviewJob::Unscaled);
m_previewJob->setIgnoreMaximumSize(item.isLocalFile());
if (m_previewJob->ui()) {
- m_previewJob->ui()->setWindow(this);
+ KJobWidgets::setWindow(m_previewJob, this);
}
- connect(m_previewJob, SIGNAL(gotPreview(KFileItem,QPixmap)),
- this, SLOT(showPreview(KFileItem,QPixmap)));
- connect(m_previewJob, SIGNAL(failed(KFileItem)),
- this, SLOT(showIcon(KFileItem)));
+ connect(m_previewJob.data(), &KIO::PreviewJob::gotPreview,
+ this, &InformationPanelContent::showPreview);
+ connect(m_previewJob.data(), &KIO::PreviewJob::failed,
+ this, &InformationPanelContent::showIcon);
}
}
void InformationPanelContent::configureSettings(const QList<QAction*>& customContextMenuActions)
{
- KMenu popup(this);
+ QMenu popup(this);
QAction* previewAction = popup.addAction(i18nc("@action:inmenu", "Preview"));
- previewAction->setIcon(KIcon("view-preview"));
+ previewAction->setIcon(QIcon::fromTheme("view-preview"));
previewAction->setCheckable(true);
previewAction->setChecked(InformationPanelSettings::previewsShown());
QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure..."));
- configureAction->setIcon(KIcon("configure"));
+ configureAction->setIcon(QIcon::fromTheme("configure"));
popup.addSeparator();
foreach (QAction* action, customContextMenuActions) {
dialog->show();
dialog->raise();
dialog->activateWindow();
- connect(dialog, SIGNAL(destroyed()), this, SLOT(refreshMetaData()));
+ connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData);
}
}
{
m_outdatedPreviewTimer->stop();
if (!applyPlace(item.targetUrl())) {
- KIcon icon(item.iconName(), KIconLoader::global(), item.overlays());
- m_preview->setPixmap(icon.pixmap(KIconLoader::SizeEnormous));
+ const QPixmap icon = KIconLoader::global()->loadIcon(item.iconName(), KIconLoader::Desktop,
+ KIconLoader::SizeEnormous, KIconLoader::DefaultState,
+ item.overlays());
+ m_preview->setPixmap(icon);
}
}
const PlacesItem* item = m_placesItemModel->placesItem(i);
if (item->url().equals(url, KUrl::CompareWithoutTrailingSlash)) {
setNameLabelText(item->text());
- m_preview->setPixmap(KIcon(item->icon()).pixmap(128, 128));
+ m_preview->setPixmap(QIcon::fromTheme(item->icon()).pixmap(128, 128));
return true;
}
}
}
}
-#include "informationpanelcontent.moc"
#include <QToolButton>
#include <KDialog>
-#include <KIcon>
+#include <QIcon>
+#include <KIconLoader>
#include <KUrl>
#include <KLocale>
m_playButton->setToolTip(i18n("play"));
m_playButton->setIconSize(buttonSize);
- m_playButton->setIcon(KIcon("media-playback-start"));
+ m_playButton->setIcon(QIcon::fromTheme("media-playback-start"));
m_playButton->setAutoRaise(true);
- connect(m_playButton, SIGNAL(clicked()), this, SLOT(play()));
+ connect(m_playButton, &QToolButton::clicked, this, &PhononWidget::play);
m_stopButton->setToolTip(i18n("stop"));
m_stopButton->setIconSize(buttonSize);
- m_stopButton->setIcon(KIcon("media-playback-stop"));
+ m_stopButton->setIcon(QIcon::fromTheme("media-playback-stop"));
m_stopButton->setAutoRaise(true);
m_stopButton->hide();
- connect(m_stopButton, SIGNAL(clicked()), this, SLOT(stop()));
+ connect(m_stopButton, &QToolButton::clicked, this, &PhononWidget::stop);
m_seekSlider->setIconVisible(false);
{
if (!m_media) {
m_media = new Phonon::MediaObject(this);
- connect(m_media, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
- this, SLOT(stateChanged(Phonon::State)));
- connect(m_media, SIGNAL(hasVideoChanged(bool)),
- this, SLOT(slotHasVideoChanged(bool)));
+ connect(m_media, &Phonon::MediaObject::stateChanged,
+ this, &PhononWidget::stateChanged);
+ connect(m_media, &Phonon::MediaObject::hasVideoChanged,
+ this, &PhononWidget::slotHasVideoChanged);
m_seekSlider->setMediaObject(m_media);
}
m_animation.setCurveShape(QTimeLine::LinearCurve);
if (m_transition != NoTransition) {
- connect(&m_animation, SIGNAL(valueChanged(qreal)), this, SLOT(update()));
- connect(&m_animation, SIGNAL(finished()), this, SLOT(checkPendingPixmaps()));
+ connect(&m_animation, &QTimeLine::valueChanged, this, static_cast<void(PixmapViewer::*)()>(&PixmapViewer::update));
+ connect(&m_animation, &QTimeLine::finished, this, &PixmapViewer::checkPendingPixmaps);
}
}
}
}
-#include "pixmapviewer.moc"
#include <KBookmarkManager>
#include <KDebug>
#include <KDirLister>
-#include <KIcon>
+#include <QIcon>
#include <KLocale>
#include "placesitemsignalhandler.h"
#include <QDateTime>
m_trashDirLister = new KDirLister();
m_trashDirLister->setAutoErrorHandlingEnabled(false, 0);
m_trashDirLister->setDelayedMimeTypes(true);
- QObject::connect(m_trashDirLister, SIGNAL(completed()),
- m_signalHandler, SLOT(onTrashDirListerCompleted()));
+ QObject::connect(m_trashDirLister.data(), static_cast<void(KDirLister::*)()>(&KDirLister::completed),
+ m_signalHandler.data(), &PlacesItemSignalHandler::onTrashDirListerCompleted);
m_trashDirLister->openUrl(url);
}
if (m_access) {
setUrl(m_access->filePath());
- QObject::connect(m_access, SIGNAL(accessibilityChanged(bool,QString)),
- m_signalHandler, SLOT(onAccessibilityChanged()));
+ QObject::connect(m_access.data(), &Solid::StorageAccess::accessibilityChanged,
+ m_signalHandler.data(), &PlacesItemSignalHandler::onAccessibilityChanged);
} else if (m_disc && (m_disc->availableContent() & Solid::OpticalDisc::Audio) != 0) {
Solid::Block *block = m_device.as<Solid::Block>();
if (block) {
#include "placesitemeditdialog.h"
#include <KAboutData>
+#include <k4aboutdata.h>
#include <KComponentData>
#include <KDebug>
#include <KFile>
+#include <KGlobal>
#include <KIconButton>
#include <KLineEdit>
#include <KLocale>
#include <QEvent>
#include <QFormLayout>
#include <QVBoxLayout>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
PlacesItemEditDialog::PlacesItemEditDialog(QWidget* parent) :
- KDialog(parent),
+ QDialog(parent),
m_icon(),
m_text(),
m_url(),
m_iconButton(0),
m_appLocal(0)
{
- setButtons( Ok | Cancel );
- setModal(true);
- setDefaultButton(Ok);
}
void PlacesItemEditDialog::setIcon(const QString& icon)
void PlacesItemEditDialog::slotUrlChanged(const QString& text)
{
- enableButtonOk(!text.isEmpty());
+ m_okButton->setEnabled(!text.isEmpty());
}
PlacesItemEditDialog::~PlacesItemEditDialog()
void PlacesItemEditDialog::initialize()
{
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ m_okButton = buttonBox->button(QDialogButtonBox::Ok);
+ m_okButton->setDefault(true);
+ m_okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ setModal(true);
+ m_okButton->setDefault(true);
+
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
QWidget* mainWidget = new QWidget(this);
+ mainLayout->addWidget(mainWidget);
+ mainLayout->addWidget(buttonBox);
+
QVBoxLayout* vBox = new QVBoxLayout(mainWidget);
QFormLayout* formLayout = new QFormLayout();
formLayout->addRow(i18nc("@label", "Location:"), m_urlEdit);
// Provide room for at least 40 chars (average char width is half of height)
m_urlEdit->setMinimumWidth(m_urlEdit->fontMetrics().height() * (40 / 2));
- connect(m_urlEdit->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(slotUrlChanged(QString)));
+ connect(m_urlEdit->lineEdit(), &KLineEdit::textChanged, this, &PlacesItemEditDialog::slotUrlChanged);
m_iconButton = new KIconButton(mainWidget);
formLayout->addRow(i18nc("@label", "Choose an icon:"), m_iconButton);
m_textEdit->setFocus();
}
- setMainWidget(mainWidget);
}
-#include "placesitemeditdialog.moc"
#ifndef PLACESITEMEDITDIALOG_H
#define PLACESITEMEDITDIALOG_H
-#include <KDialog>
+#include <QDialog>
#include <KUrl>
class KIconButton;
class KLineEdit;
class KUrlRequester;
class QCheckBox;
+class QPushButton;
-class PlacesItemEditDialog: public KDialog
+class PlacesItemEditDialog: public QDialog
{
Q_OBJECT
KLineEdit* m_textEdit;
KIconButton* m_iconButton;
QCheckBox* m_appLocal;
+ QPushButton *m_okButton;
};
#endif
return QPalette::WindowText;
}
-#include "placesitemlistgroupheader.moc"
return QPalette::WindowText;
}
-#include "placesitemlistwidget.moc"
#include <KBookmarkManager>
#include <KComponentData>
#include <KDebug>
-#include <KIcon>
+#include <QIcon>
#include <kprotocolinfo.h>
#include <KLocale>
-#include <KStandardDirs>
+#include <QStandardPaths>
#include <KUser>
+#include <KGlobal>
#include "placesitem.h"
#include <QAction>
#include <QDate>
#include <views/viewproperties.h>
#ifdef HAVE_BALOO
- #include <baloo/query.h>
- #include <baloo/indexerconfig.h>
+ #include <Baloo/Query>
+ #include <Baloo/IndexerConfig>
#endif
namespace {
// be independent from changes in the Baloo-search-URL-syntax.
// Hence a prefix to the application-name of the stored bookmarks is
// added, which is only read by PlacesItemModel.
- const char* AppNamePrefix = "-places-panel";
+ const char AppNamePrefix[] = "-places-panel";
}
PlacesItemModel::PlacesItemModel(QObject* parent) :
Baloo::IndexerConfig config;
m_fileIndexingEnabled = config.fileIndexingEnabled();
#endif
- const QString file = KStandardDirs::locateLocal("data", "kfileplaces/bookmarks.xml");
+ const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kfileplaces/bookmarks.xml");
m_bookmarkManager = KBookmarkManager::managerForFile(file, "kfilePlaces");
createSystemBookmarks();
m_saveBookmarksTimer = new QTimer(this);
m_saveBookmarksTimer->setInterval(syncBookmarksTimeout);
m_saveBookmarksTimer->setSingleShot(true);
- connect(m_saveBookmarksTimer, SIGNAL(timeout()), this, SLOT(saveBookmarks()));
+ connect(m_saveBookmarksTimer, &QTimer::timeout, this, &PlacesItemModel::saveBookmarks);
m_updateBookmarksTimer = new QTimer(this);
m_updateBookmarksTimer->setInterval(syncBookmarksTimeout);
m_updateBookmarksTimer->setSingleShot(true);
- connect(m_updateBookmarksTimer, SIGNAL(timeout()), this, SLOT(updateBookmarks()));
+ connect(m_updateBookmarksTimer, &QTimer::timeout, this, &PlacesItemModel::updateBookmarks);
- connect(m_bookmarkManager, SIGNAL(changed(QString,QString)),
- m_updateBookmarksTimer, SLOT(start()));
- connect(m_bookmarkManager, SIGNAL(bookmarksChanged(QString)),
- m_updateBookmarksTimer, SLOT(start()));
+ connect(m_bookmarkManager, &KBookmarkManager::changed,
+ m_updateBookmarksTimer, static_cast<void(QTimer::*)()>(&QTimer::start));
+ connect(m_bookmarkManager, &KBookmarkManager::bookmarksChanged,
+ m_updateBookmarksTimer, static_cast<void(QTimer::*)()>(&QTimer::start));
}
PlacesItemModel::~PlacesItemModel()
{
const PlacesItem* item = placesItem(index);
if (item && item->device().is<Solid::OpticalDisc>()) {
- return new QAction(KIcon("media-eject"), i18nc("@item", "Eject '%1'", item->text()), 0);
+ return new QAction(QIcon::fromTheme("media-eject"), i18nc("@item", "Eject '%1'", item->text()), 0);
}
return 0;
return new QAction(text, 0);
}
- return new QAction(KIcon(iconName), text, 0);
+ return new QAction(QIcon::fromTheme(iconName), text, 0);
}
void PlacesItemModel::requestEject(int index)
if (item) {
Solid::OpticalDrive* drive = item->device().parent().as<Solid::OpticalDrive>();
if (drive) {
- connect(drive, SIGNAL(ejectDone(Solid::ErrorType,QVariant,QString)),
- this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant)),
- Qt::UniqueConnection);
+ connect(drive, &Solid::OpticalDrive::ejectDone,
+ this, &PlacesItemModel::slotStorageTeardownDone);
drive->eject();
} else {
const QString label = item->text();
if (item) {
Solid::StorageAccess* access = item->device().as<Solid::StorageAccess>();
if (access) {
- connect(access, SIGNAL(teardownDone(Solid::ErrorType,QVariant,QString)),
- this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant)),
- Qt::UniqueConnection);
+ connect(access, &Solid::StorageAccess::teardownDone,
+ this, &PlacesItemModel::slotStorageTeardownDone);
access->teardown();
}
}
m_storageSetupInProgress[access] = index;
- connect(access, SIGNAL(setupDone(Solid::ErrorType,QVariant,QString)),
- this, SLOT(slotStorageSetupDone(Solid::ErrorType,QVariant,QString)),
- Qt::UniqueConnection);
+ connect(access, &Solid::StorageAccess::setupDone,
+ this, &PlacesItemModel::slotStorageSetupDone);
access->setup();
}
{
Q_UNUSED(udi);
- Q_ASSERT(!m_storageSetupInProgress.isEmpty());
const int index = m_storageSetupInProgress.take(sender());
const PlacesItem* item = placesItem(index);
if (!item) {
Q_ASSERT(m_predicate.isValid());
Solid::DeviceNotifier* notifier = Solid::DeviceNotifier::instance();
- connect(notifier, SIGNAL(deviceAdded(QString)), this, SLOT(slotDeviceAdded(QString)));
- connect(notifier, SIGNAL(deviceRemoved(QString)), this, SLOT(slotDeviceRemoved(QString)));
+ connect(notifier, &Solid::DeviceNotifier::deviceAdded, this, &PlacesItemModel::slotDeviceAdded);
+ connect(notifier, &Solid::DeviceNotifier::deviceRemoved, this, &PlacesItemModel::slotDeviceRemoved);
const QList<Solid::Device>& deviceList = Solid::Device::listFromQuery(m_predicate);
foreach (const Solid::Device& device, deviceList) {
}
#endif
-#include "placesitemmodel.moc"
}
}
-#include "placesitemsignalhandler.moc"
#include <KDebug>
#include <KDirNotify>
-#include <KIcon>
+#include <QIcon>
#include <KIO/Job>
+#include <KIO/EmptyTrashJob>
#include <KIO/JobUiDelegate>
+#include <KJobWidgets>
#include <KLocale>
+#include <KIconLoader>
#include <kitemviews/kitemlistcontainer.h>
#include <kitemviews/kitemlistcontroller.h>
#include <kitemviews/kitemlistselectionmanager.h>
#include <kitemviews/kstandarditem.h>
-#include <KMenu>
+#include <QMenu>
#include <KMessageBox>
#include <KNotification>
#include "placesitem.h"
#include <QGraphicsSceneDragDropEvent>
#include <QVBoxLayout>
#include <QShowEvent>
+#include <QMimeData>
PlacesPanel::PlacesPanel(QWidget* parent) :
Panel(parent),
// used at all and stays invisible.
m_model = new PlacesItemModel(this);
m_model->setGroupedSorting(true);
- connect(m_model, SIGNAL(errorMessage(QString)),
- this, SIGNAL(errorMessage(QString)));
+ connect(m_model, &PlacesItemModel::errorMessage,
+ this, &PlacesPanel::errorMessage);
m_view = new PlacesView();
m_view->setWidgetCreator(new KItemListWidgetCreator<PlacesItemListWidget>());
readSettings();
- connect(m_controller, SIGNAL(itemActivated(int)), this, SLOT(slotItemActivated(int)));
- connect(m_controller, SIGNAL(itemMiddleClicked(int)), this, SLOT(slotItemMiddleClicked(int)));
- connect(m_controller, SIGNAL(itemContextMenuRequested(int,QPointF)), this, SLOT(slotItemContextMenuRequested(int,QPointF)));
- connect(m_controller, SIGNAL(viewContextMenuRequested(QPointF)), this, SLOT(slotViewContextMenuRequested(QPointF)));
- connect(m_controller, SIGNAL(itemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotItemDropEvent(int,QGraphicsSceneDragDropEvent*)));
- connect(m_controller, SIGNAL(aboveItemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotAboveItemDropEvent(int,QGraphicsSceneDragDropEvent*)));
+ connect(m_controller, &KItemListController::itemActivated, this, &PlacesPanel::slotItemActivated);
+ connect(m_controller, &KItemListController::itemMiddleClicked, this, &PlacesPanel::slotItemMiddleClicked);
+ connect(m_controller, &KItemListController::itemContextMenuRequested, this, &PlacesPanel::slotItemContextMenuRequested);
+ connect(m_controller, &KItemListController::viewContextMenuRequested, this, &PlacesPanel::slotViewContextMenuRequested);
+ connect(m_controller, &KItemListController::itemDropEvent, this, &PlacesPanel::slotItemDropEvent);
+ connect(m_controller, &KItemListController::aboveItemDropEvent, this, &PlacesPanel::slotAboveItemDropEvent);
KItemListContainer* container = new KItemListContainer(m_controller, this);
container->setEnabledFrame(false);
return;
}
- KMenu menu(this);
+ QMenu menu(this);
QAction* emptyTrashAction = 0;
QAction* addAction = 0;
}
} else {
if (item->url() == KUrl("trash:/")) {
- emptyTrashAction = menu.addAction(KIcon("trash-empty"), i18nc("@action:inmenu", "Empty Trash"));
+ emptyTrashAction = menu.addAction(QIcon::fromTheme("trash-empty"), i18nc("@action:inmenu", "Empty Trash"));
emptyTrashAction->setEnabled(item->icon() == "user-trash-full");
menu.addSeparator();
}
- addAction = menu.addAction(KIcon("document-new"), i18nc("@item:inmenu", "Add Entry..."));
+ addAction = menu.addAction(QIcon::fromTheme("document-new"), i18nc("@item:inmenu", "Add Entry..."));
mainSeparator = menu.addSeparator();
- editAction = menu.addAction(KIcon("document-properties"), i18nc("@item:inmenu", "Edit '%1'...", label));
+ editAction = menu.addAction(QIcon::fromTheme("document-properties"), i18nc("@item:inmenu", "Edit '%1'...", label));
}
if (!addAction) {
- addAction = menu.addAction(KIcon("document-new"), i18nc("@item:inmenu", "Add Entry..."));
+ addAction = menu.addAction(QIcon::fromTheme("document-new"), i18nc("@item:inmenu", "Add Entry..."));
}
QAction* openInNewTabAction = menu.addAction(i18nc("@item:inmenu", "Open '%1' in New Tab", label));
- openInNewTabAction->setIcon(KIcon("tab-new"));
+ openInNewTabAction->setIcon(QIcon::fromTheme("tab-new"));
QAction* removeAction = 0;
if (!isDevice && !item->isSystemItem()) {
- removeAction = menu.addAction(KIcon("edit-delete"), i18nc("@item:inmenu", "Remove '%1'", label));
+ removeAction = menu.addAction(QIcon::fromTheme("edit-delete"), i18nc("@item:inmenu", "Remove '%1'", label));
}
QAction* hideAction = menu.addAction(i18nc("@item:inmenu", "Hide '%1'", label));
}
menu.addSeparator();
- KMenu* iconSizeSubMenu = new KMenu(i18nc("@item:inmenu", "Icon Size"), &menu);
+ QMenu* iconSizeSubMenu = new QMenu(i18nc("@item:inmenu", "Icon Size"), &menu);
struct IconSizeInfo
{
void PlacesPanel::slotViewContextMenuRequested(const QPointF& pos)
{
- KMenu menu(this);
+ QMenu menu(this);
- QAction* addAction = menu.addAction(KIcon("document-new"), i18nc("@item:inmenu", "Add Entry..."));
+ QAction* addAction = menu.addAction(QIcon::fromTheme("document-new"), i18nc("@item:inmenu", "Add Entry..."));
QAction* showAllAction = 0;
if (m_model->hiddenCount() > 0) {
}
if (m_model->storageSetupNeeded(index)) {
- connect(m_model, SIGNAL(storageSetupDone(int,bool)),
- this, SLOT(slotItemDropEventStorageSetupDone(int,bool)));
+ connect(m_model, &PlacesItemModel::storageSetupDone,
+ this, &PlacesPanel::slotItemDropEventStorageSetupDone);
m_itemDropEventIndex = index;
void PlacesPanel::slotItemDropEventStorageSetupDone(int index, bool success)
{
- disconnect(m_model, SIGNAL(storageSetupDone(int,bool)),
- this, SLOT(slotItemDropEventStorageSetupDone(int,bool)));
+ disconnect(m_model, &PlacesItemModel::storageSetupDone,
+ this, &PlacesPanel::slotItemDropEventStorageSetupDone);
if ((index == m_itemDropEventIndex) && m_itemDropEvent && m_itemDropEventMimeData) {
if (success) {
if (job->error()) {
emit errorMessage(job->errorString());
}
- org::kde::KDirNotify::emitFilesAdded("trash:/");
+ // as long as KIO doesn't do this, do it ourselves
+ KNotification::event("Trash: emptied", QString(), QPixmap(), 0, KNotification::DefaultEvent);
}
void PlacesPanel::slotStorageSetupDone(int index, bool success)
{
- disconnect(m_model, SIGNAL(storageSetupDone(int,bool)),
- this, SLOT(slotStorageSetupDone(int,bool)));
+ disconnect(m_model, &PlacesItemModel::storageSetupDone,
+ this, &PlacesPanel::slotStorageSetupDone);
if (m_triggerStorageSetupButton == Qt::NoButton) {
return;
void PlacesPanel::emptyTrash()
{
- const QString text = i18nc("@info", "Do you really want to empty the Trash? All items will be deleted.");
- const bool del = KMessageBox::warningContinueCancel(window(),
- text,
- QString(),
- KGuiItem(i18nc("@action:button", "Empty Trash"),
- KIcon("user-trash"))
- ) == KMessageBox::Continue;
- if (del) {
- QByteArray packedArgs;
- QDataStream stream(&packedArgs, QIODevice::WriteOnly);
- stream << int(1);
- KIO::Job *job = KIO::special(KUrl("trash:/"), packedArgs);
- KNotification::event("Trash: emptied", QString() , QPixmap() , 0, KNotification::DefaultEvent);
- job->ui()->setWindow(parentWidget());
- connect(job, SIGNAL(result(KJob*)), SLOT(slotTrashUpdated(KJob*)));
+ KIO::JobUiDelegate uiDelegate;
+ uiDelegate.setWindow(window());
+ if (uiDelegate.askDeleteConfirmation(QList<QUrl>(), KIO::JobUiDelegate::EmptyTrash, KIO::JobUiDelegate::DefaultConfirmation)) {
+ KIO::Job* job = KIO::emptyTrash();
+ KJobWidgets::setWindow(job, window());
+ connect(job, &KIO::Job::result, this, &PlacesPanel::slotTrashUpdated);
}
}
const KUrl url = m_model->data(index).value("url").value<KUrl>();
QPointer<PlacesItemEditDialog> dialog = new PlacesItemEditDialog(this);
- dialog->setCaption(i18nc("@title:window", "Add Places Entry"));
+ dialog->setWindowTitle(i18nc("@title:window", "Add Places Entry"));
dialog->setAllowGlobal(true);
dialog->setUrl(url);
if (dialog->exec() == QDialog::Accepted) {
QHash<QByteArray, QVariant> data = m_model->data(index);
QPointer<PlacesItemEditDialog> dialog = new PlacesItemEditDialog(this);
- dialog->setCaption(i18nc("@title:window", "Edit Places Entry"));
+ dialog->setWindowTitle(i18nc("@title:window", "Edit Places Entry"));
dialog->setIcon(data.value("iconName").toString());
dialog->setText(data.value("text").toString());
dialog->setUrl(data.value("url").value<KUrl>());
m_triggerStorageSetupButton = button;
m_storageSetupFailedUrl = url();
- connect(m_model, SIGNAL(storageSetupDone(int,bool)),
- this, SLOT(slotStorageSetupDone(int,bool)));
+ connect(m_model, &PlacesItemModel::storageSetupDone,
+ this, &PlacesPanel::slotStorageSetupDone);
m_model->requestStorageSetup(index);
} else {
}
-#include "placespanel.moc"
#include <panels/panel.h>
class KItemListController;
-class PlacesItemEditDialog;
class PlacesItem;
class PlacesItemModel;
class PlacesView;
return option.iconSize;
}
-#include "placesview.moc"
#include <KPluginLoader>
#include <KPluginFactory>
#include <KService>
-#include <kde_terminal_interface_v2.h>
-#include <KParts/Part>
+#include <kde_terminal_interface.h>
+#include <KParts/ReadOnlyPart>
#include <KShell>
#include <KIO/Job>
#include <KIO/JobUiDelegate>
+#include <KJobWidgets>
#include <QBoxLayout>
#include <QDir>
this, SLOT(slotKonsolePartCurrentDirectoryChanged(QString)));
// Make sure this terminal does not prevent unmounting any removable drives
- changeDir(KUrl::fromPath("/"));
+ changeDir(QUrl::fromLocalFile("/"));
// Because we have disconnected from the part's currentDirectoryChanged()
// signal, we have to update m_konsolePartCurrentDirectory manually. If this
}
m_konsolePart = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : 0;
if (m_konsolePart) {
- connect(m_konsolePart, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited()));
+ connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited);
m_terminalWidget = m_konsolePart->widget();
m_layout->addWidget(m_terminalWidget);
- m_terminal = qobject_cast<TerminalInterfaceV2 *>(m_konsolePart);
+ m_terminal = qobject_cast<TerminalInterface*>(m_konsolePart);
}
}
if (m_terminal) {
} else {
m_mostLocalUrlJob = KIO::mostLocalUrl(url, KIO::HideProgressInfo);
if (m_mostLocalUrlJob->ui()) {
- m_mostLocalUrlJob->ui()->setWindow(this);
+ KJobWidgets::setWindow(m_mostLocalUrlJob, this);
}
- connect(m_mostLocalUrlJob, SIGNAL(result(KJob*)), this, SLOT(slotMostLocalUrlResult(KJob*)));
+ connect(m_mostLocalUrlJob, &KIO::StatJob::result, this, &TerminalPanel::slotMostLocalUrlResult);
}
}
}
}
-#include "terminalpanel.moc"
#include <panels/panel.h>
-class TerminalInterfaceV2;
+class TerminalInterface;
class QVBoxLayout;
class QWidget;
KIO::StatJob* m_mostLocalUrlJob;
QVBoxLayout* m_layout;
- TerminalInterfaceV2* m_terminal;
+ TerminalInterface* m_terminal;
QWidget* m_terminalWidget;
KParts::ReadOnlyPart* m_konsolePart;
QString m_konsolePartCurrentDirectory;
QButtonGroup* group)
{
QRadioButton* button = new QRadioButton(text);
- connect(button, SIGNAL(clicked()), this, SIGNAL(facetChanged()));
+ connect(button, &QRadioButton::clicked, this, &DolphinFacetsWidget::facetChanged);
group->addButton(button);
return button;
}
-#include "dolphinfacetswidget.moc"
#include <config-baloo.h>
#ifdef HAVE_BALOO
- #include <baloo/term.h>
+ #include <Baloo/Term>
#endif
class QButtonGroup;
-class QCheckBox;
class QDate;
class QRadioButton;
#include "dolphin_searchsettings.h"
#include "dolphinfacetswidget.h"
-#include <KIcon>
+#include <QIcon>
#include <KLineEdit>
#include <KLocale>
#include <KSeparator>
+#include <KGlobalSettings>
#include <QButtonGroup>
#include <QDir>
#include <QToolButton>
#include <QVBoxLayout>
-#include <config-baloo.h>
#ifdef HAVE_BALOO
- #include <baloo/query.h>
- #include <baloo/term.h>
- #include <baloo/indexerconfig.h>
+ #include <Baloo/NaturalFileQueryParser>
+ #include <Baloo/QueryBuilder>
+ #include <Baloo/Query>
+ #include <Baloo/Term>
+ #include <Baloo/IndexerConfig>
#endif
+#include <QFontDatabase>
DolphinSearchBox::DolphinSearchBox(QWidget* parent) :
QWidget(parent),
}
}
-void DolphinSearchBox::slotSearchTextChanged(const QString& text)
+void DolphinSearchBox::slotSearchTextChanged()
{
+ const QString text = m_searchInput->text();
+
if (text.isEmpty()) {
m_startSearchTimer->stop();
} else {
emit searchTextChanged(text);
}
-void DolphinSearchBox::slotReturnPressed(const QString& text)
+void DolphinSearchBox::slotReturnPressed()
{
emitSearchRequest();
- emit returnPressed(text);
+ emit returnPressed(m_searchInput->text());
+}
+
+void DolphinSearchBox::updateSearchInputParsing()
+{
+#ifdef HAVE_BALOO
+ m_searchInput->setParsingEnabled(m_contentButton->isChecked());
+#endif
}
void DolphinSearchBox::slotFacetsButtonToggled()
button->setAutoExclusive(true);
button->setAutoRaise(true);
button->setCheckable(true);
- connect(button, SIGNAL(clicked(bool)), this, SLOT(slotConfigurationChanged()));
+ connect(button, &QToolButton::clicked, this, &DolphinSearchBox::slotConfigurationChanged);
}
void DolphinSearchBox::loadSettings()
}
m_facetsWidget->setVisible(SearchSettings::showFacetsWidget());
+ updateSearchInputParsing();
}
void DolphinSearchBox::saveSettings()
SearchSettings::setLocation(m_fromHereButton->isChecked() ? "FromHere" : "Everywhere");
SearchSettings::setWhat(m_fileNameButton->isChecked() ? "FileName" : "Content");
SearchSettings::setShowFacetsWidget(m_facetsToggleButton->isChecked());
- SearchSettings::self()->writeConfig();
+ SearchSettings::self()->save();
}
void DolphinSearchBox::init()
// Create close button
QToolButton* closeButton = new QToolButton(this);
closeButton->setAutoRaise(true);
- closeButton->setIcon(KIcon("dialog-close"));
+ closeButton->setIcon(QIcon::fromTheme("dialog-close"));
closeButton->setToolTip(i18nc("@info:tooltip", "Quit searching"));
- connect(closeButton, SIGNAL(clicked()), this, SLOT(emitCloseRequest()));
+ connect(closeButton, &QToolButton::clicked, this, &DolphinSearchBox::emitCloseRequest);
// Create search label
m_searchLabel = new QLabel(this);
// Create search box
+#ifdef HAVE_BALOO
+ m_queryParser.reset(new Baloo::NaturalFileQueryParser);
+ m_searchInput = new Baloo::QueryBuilder(m_queryParser.data(), this);
+ connect(m_searchInput, &Baloo::QueryBuilder::editingFinished,
+ this, &DolphinSearchBox::slotReturnPressed);
+ connect(m_searchInput, &Baloo::QueryBuilder::textChanged,
+ this, &DolphinSearchBox::slotSearchTextChanged);
+#else
m_searchInput = new KLineEdit(this);
m_searchInput->installEventFilter(this);
m_searchInput->setClearButtonShown(true);
- m_searchInput->setFont(KGlobalSettings::generalFont());
+ m_searchInput->setFont(QFontDatabase::systemFont(QFontDatabase::GeneralFont));
+ connect(m_searchInput, &KLineEdit::returnPressed,
+ this, &DolphinSearchBox::slotReturnPressed);
+ connect(m_searchInput, &KLineEdit::textChanged,
+ this, &DolphinSearchBox::slotSearchTextChanged);
+#endif
setFocusProxy(m_searchInput);
- connect(m_searchInput, SIGNAL(returnPressed(QString)),
- this, SLOT(slotReturnPressed(QString)));
- connect(m_searchInput, SIGNAL(textChanged(QString)),
- this, SLOT(slotSearchTextChanged(QString)));
// Apply layout for the search input
QHBoxLayout* searchInputLayout = new QHBoxLayout();
QButtonGroup* searchWhatGroup = new QButtonGroup(this);
searchWhatGroup->addButton(m_fileNameButton);
searchWhatGroup->addButton(m_contentButton);
+ connect(searchWhatGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),
+ this, &DolphinSearchBox::updateSearchInputParsing);
m_separator = new KSeparator(Qt::Vertical, this);
m_facetsToggleButton = new QToolButton(this);
m_facetsToggleButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
initButton(m_facetsToggleButton);
- connect(m_facetsToggleButton, SIGNAL(clicked()), this, SLOT(slotFacetsButtonToggled()));
+ connect(m_facetsToggleButton, &QToolButton::clicked, this, &DolphinSearchBox::slotFacetsButtonToggled);
m_facetsWidget = new DolphinFacetsWidget(this);
m_facetsWidget->installEventFilter(this);
m_facetsWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
- connect(m_facetsWidget, SIGNAL(facetChanged()), this, SLOT(slotFacetChanged()));
+ connect(m_facetsWidget, &DolphinFacetsWidget::facetChanged, this, &DolphinSearchBox::slotFacetChanged);
// Apply layout for the options
QHBoxLayout* optionsLayout = new QHBoxLayout();
m_startSearchTimer = new QTimer(this);
m_startSearchTimer->setSingleShot(true);
m_startSearchTimer->setInterval(1000);
- connect(m_startSearchTimer, SIGNAL(timeout()), this, SLOT(emitSearchRequest()));
+ connect(m_startSearchTimer, &QTimer::timeout, this, &DolphinSearchBox::emitSearchRequest);
updateFacetsToggleButton();
}
const QString text = m_searchInput->text();
Baloo::Query query;
+
+ if (m_contentButton->isChecked()) {
+ query = m_queryParser->parse(text, Baloo::NaturalQueryParser::DetectFilenamePattern);
+ } else {
+ query.setTerm(Baloo::Term(QLatin1String("filename"), text));
+ }
+
+ // Configure the query so that it returns files and takes the rating into account
query.addType("File");
query.addType(m_facetsWidget->facetType());
Baloo::Term term(Baloo::Term::And);
-
Baloo::Term ratingTerm = m_facetsWidget->ratingTerm();
+
if (ratingTerm.isValid()) {
+ term.addSubTerm(query.term());
term.addSubTerm(ratingTerm);
- }
- if (m_contentButton->isChecked()) {
- query.setSearchString(text);
- } else if (!text.isEmpty()) {
- term.addSubTerm(Baloo::Term(QLatin1String("filename"), text));
+ query.setTerm(term);
}
if (m_fromHereButton->isChecked()) {
- query.addCustomOption("includeFolder", m_searchPath.toLocalFile());
+ query.setIncludeFolder(m_searchPath.toLocalFile());
}
- query.setTerm(term);
-
return query.toSearchUrl(i18nc("@title UDS_DISPLAY_NAME for a KIO directory listing. %1 is the query the user entered.",
"Query Results from '%1'", text));
#else
// while we adjust the search text and the facet widget.
blockSignals(true);
- const QVariantHash customOptions = query.customOptions();
- if (customOptions.contains("includeFolder")) {
- setSearchPath(customOptions.value("includeFolder").toString());
+ const QString customDir = query.includeFolder();
+ if (!customDir.isEmpty()) {
+ setSearchPath(customDir);
} else {
setSearchPath(QDir::homePath());
}
{
const bool facetsIsVisible = SearchSettings::showFacetsWidget();
m_facetsToggleButton->setChecked(facetsIsVisible ? true : false);
- m_facetsToggleButton->setIcon(KIcon(facetsIsVisible ? "arrow-up-double" : "arrow-down-double"));
+ m_facetsToggleButton->setIcon(QIcon::fromTheme(facetsIsVisible ? "arrow-up-double" : "arrow-down-double"));
m_facetsToggleButton->setText(facetsIsVisible ? i18nc("action:button", "Fewer Options") : i18nc("action:button", "More Options"));
}
-#include "dolphinsearchbox.moc"
#include <QList>
#include <QWidget>
+#include <config-baloo.h>
+
class DolphinFacetsWidget;
class KLineEdit;
class KSeparator;
class QLabel;
class QVBoxLayout;
+namespace Baloo {
+ class QueryBuilder;
+ class NaturalQueryParser;
+}
+
/**
* @brief Input box for searching files with or without Baloo.
*
void emitSearchRequest();
void emitCloseRequest();
void slotConfigurationChanged();
- void slotSearchTextChanged(const QString& text);
- void slotReturnPressed(const QString& text);
+ void slotSearchTextChanged();
+ void slotReturnPressed();
void slotFacetsButtonToggled();
void slotFacetChanged();
+ void updateSearchInputParsing();
private:
void initButton(QToolButton* button);
QVBoxLayout* m_topLayout;
QLabel* m_searchLabel;
+#ifdef HAVE_BALOO
+ Baloo::QueryBuilder* m_searchInput;
+ QScopedPointer<Baloo::NaturalQueryParser> m_queryParser;
+#else
KLineEdit* m_searchInput;
+#endif
QScrollArea* m_optionsScrollArea;
QToolButton* m_fileNameButton;
QToolButton* m_contentButton;
#include <KIO/NetAccess>
#include <KIO/Job>
#include <KUrl>
+#include <kdemacros.h>
#include <ktemporaryfile.h>
#include <QCoreApplication>
cleanup();
}
-void FileNameSearchProtocol::listDir(const KUrl& url)
+void FileNameSearchProtocol::listDir(const QUrl& url)
{
cleanup();
- const QString search = url.queryItem("search");
+ const QString search = url.queryItemValue("search");
if (!search.isEmpty()) {
m_regExp = new QRegExp(search, Qt::CaseInsensitive, QRegExp::Wildcard);
}
m_checkContent = false;
- const QString checkContent = url.queryItem("checkContent");
+ const QString checkContent = url.queryItemValue("checkContent");
if (checkContent == QLatin1String("yes")) {
m_checkContent = true;
}
- const QString urlString = url.queryItem("url");
+ const QString urlString = url.queryItemValue("url");
searchDirectory(KUrl(urlString));
cleanup();
dirLister->openUrl(directory);
QEventLoop eventLoop;
- QObject::connect(dirLister, SIGNAL(canceled()), &eventLoop, SLOT(quit()));
- QObject::connect(dirLister, SIGNAL(completed()), &eventLoop, SLOT(quit()));
+ QObject::connect(dirLister, static_cast<void(KDirLister::*)()>(&KDirLister::canceled), &eventLoop, &QEventLoop::quit);
+ QObject::connect(dirLister, static_cast<void(KDirLister::*)()>(&KDirLister::completed), &eventLoop, &QEventLoop::quit);
eventLoop.exec();
// Visualize all items that match the search pattern
bool addItem = false;
if (!m_regExp || item.name().contains(*m_regExp)) {
addItem = true;
- } else if (m_checkContent && item.determineMimeType()->is(QLatin1String("text/plain"))) {
+ } else if (m_checkContent && item.determineMimeType().inherits(QLatin1String("text/plain"))) {
addItem = contentContainsPattern(item.url());
}
#include <kio/slavebase.h>
-class KFileItem;
class KUrl;
class QRegExp;
FileNameSearchProtocol(const QByteArray& pool, const QByteArray& app);
virtual ~FileNameSearchProtocol();
- virtual void listDir(const KUrl& url);
+ virtual void listDir(const QUrl& url) Q_DECL_OVERRIDE;
private:
void searchDirectory(const KUrl& directory);
#include <QVBoxLayout>
#ifdef HAVE_BALOO
- #include <baloo/indexerconfig.h>
+ #include <Baloo/IndexerConfig>
#endif
AdditionalInfoDialog::AdditionalInfoDialog(QWidget* parent,
const KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"), "AdditionalInfoDialog");
restoreDialogSize(dialogConfig);
- connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
+ connect(this, &AdditionalInfoDialog::okClicked, this, &AdditionalInfoDialog::slotOk);
}
AdditionalInfoDialog::~AdditionalInfoDialog()
}
}
-#include "additionalinfodialog.moc"
#include <QList>
#include <QListWidget>
-class QCheckBox;
/**
* @brief Dialog for changing the additional information shown in the view.
m_viewProps->setSortOrder(viewProps.sortOrder());
KIO::ListJob* listJob = KIO::listRecursive(dir, KIO::HideProgressInfo);
- connect(listJob, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)),
- SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList)));
+ connect(listJob, &KIO::ListJob::entries,
+ this, &ApplyViewPropsJob::slotEntries);
addSubjob(listJob);
}
emitResult();
}
-#include "applyviewpropsjob.moc"
#include <KLocale>
#include <KMessageBox>
-#include <KIcon>
+#include <QIcon>
+
+#include <QPushButton>
+#include <QDialogButtonBox>
DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
KPageDialog(parent),
setMinimumSize(QSize(512, minSize.height()));
setFaceType(List);
- setCaption(i18nc("@title:window", "Dolphin Preferences"));
- setButtons(Ok | Apply | Cancel | Default);
- enableButtonApply(false);
- setDefaultButton(Ok);
+ setWindowTitle(i18nc("@title:window", "Dolphin Preferences"));
+ QDialogButtonBox* box = new QDialogButtonBox(QDialogButtonBox::Ok
+ | QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults);
+ box->button(QDialogButtonBox::Apply)->setEnabled(false);
+ box->button(QDialogButtonBox::Ok)->setDefault(true);
+ setButtonBox(box);
+
+ connect(box->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
+ connect(box->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
+ connect(box->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, this, &DolphinSettingsDialog::restoreDefaults);
// Startup
StartupSettingsPage* startupSettingsPage = new StartupSettingsPage(url, this);
KPageWidgetItem* startupSettingsFrame = addPage(startupSettingsPage,
i18nc("@title:group", "Startup"));
- startupSettingsFrame->setIcon(KIcon("go-home"));
- connect(startupSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+ startupSettingsFrame->setIcon(QIcon::fromTheme("go-home"));
+ connect(startupSettingsPage, &StartupSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
// View Modes
ViewSettingsPage* viewSettingsPage = new ViewSettingsPage(this);
KPageWidgetItem* viewSettingsFrame = addPage(viewSettingsPage,
i18nc("@title:group", "View Modes"));
- viewSettingsFrame->setIcon(KIcon("view-choose"));
- connect(viewSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+ viewSettingsFrame->setIcon(QIcon::fromTheme("view-choose"));
+ connect(viewSettingsPage, &ViewSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
// Navigation
NavigationSettingsPage* navigationSettingsPage = new NavigationSettingsPage(this);
KPageWidgetItem* navigationSettingsFrame = addPage(navigationSettingsPage,
i18nc("@title:group", "Navigation"));
- navigationSettingsFrame->setIcon(KIcon("input-mouse"));
- connect(navigationSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+ navigationSettingsFrame->setIcon(QIcon::fromTheme("input-mouse"));
+ connect(navigationSettingsPage, &NavigationSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
// Services
ServicesSettingsPage* servicesSettingsPage = new ServicesSettingsPage(this);
KPageWidgetItem* servicesSettingsFrame = addPage(servicesSettingsPage,
i18nc("@title:group", "Services"));
- servicesSettingsFrame->setIcon(KIcon("services"));
- connect(servicesSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+ servicesSettingsFrame->setIcon(QIcon::fromTheme("services"));
+ connect(servicesSettingsPage, &ServicesSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
// Trash
TrashSettingsPage* trashSettingsPage = new TrashSettingsPage(this);
KPageWidgetItem* trashSettingsFrame = addPage(trashSettingsPage,
i18nc("@title:group", "Trash"));
- trashSettingsFrame->setIcon(KIcon("user-trash"));
- connect(trashSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+ trashSettingsFrame->setIcon(QIcon::fromTheme("user-trash"));
+ connect(trashSettingsPage, &TrashSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
// General
GeneralSettingsPage* generalSettingsPage = new GeneralSettingsPage(url, this);
KPageWidgetItem* generalSettingsFrame = addPage(generalSettingsPage,
i18nc("@title:group General settings", "General"));
- generalSettingsFrame->setIcon(KIcon("system-run"));
- connect(generalSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+ generalSettingsFrame->setIcon(QIcon::fromTheme("system-run"));
+ connect(generalSettingsPage, &GeneralSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
const KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"), "SettingsDialog");
- restoreDialogSize(dialogConfig);
+#pragma message("TODO: port")
+ //restoreDialogSize(dialogConfig);
m_pages.append(startupSettingsPage);
m_pages.append(viewSettingsPage);
DolphinSettingsDialog::~DolphinSettingsDialog()
{
KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"), "SettingsDialog");
- saveDialogSize(dialogConfig);
-}
-
-void DolphinSettingsDialog::slotButtonClicked(int button)
-{
- if ((button == Ok) || (button == Apply)) {
- applySettings();
- } else if (button == Default) {
- restoreDefaults();
- }
-
- KPageDialog::slotButtonClicked(button);
+#pragma message("TODO: port")
+ //saveDialogSize(dialogConfig);
}
void DolphinSettingsDialog::enableApply()
{
- enableButtonApply(true);
+ buttonBox()->button(QDialogButtonBox::Apply)->setEnabled(true);
}
void DolphinSettingsDialog::applySettings()
settings->setModifiedStartupSettings(false);
settings->writeConfig();
}
-
- enableButtonApply(false);
+ buttonBox()->button(QDialogButtonBox::Apply)->setEnabled(false);
}
void DolphinSettingsDialog::restoreDefaults()
}
}
-#include "dolphinsettingsdialog.moc"
signals:
void settingsChanged();
-protected slots:
- /** @see KDialog::slotButtonClicked() */
- virtual void slotButtonClicked(int button);
-
private slots:
/** Enables the Apply button. */
void enableApply();
-
-private:
void applySettings();
void restoreDefaults();
loadSettings();
- connect(m_localViewProps, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
- connect(m_globalViewProps, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
- connect(m_showToolTips, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
- connect(m_showSelectionToggle, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
- connect(m_naturalSorting, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
- connect(m_renameInline, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+ connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
+ connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed);
+ connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
+ connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
+ connect(m_naturalSorting, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
+ connect(m_renameInline, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed);
}
BehaviorSettingsPage::~BehaviorSettingsPage()
const bool naturalSorting = m_naturalSorting->isChecked();
if (KGlobalSettings::naturalSorting() != naturalSorting) {
- KConfigGroup group(KGlobal::config(), "KDE");
+ KConfigGroup group(KSharedConfig::openConfig(), "KDE");
group.writeEntry("NaturalSorting", naturalSorting, KConfig::Persistent | KConfig::Global);
KGlobalSettings::emitChange(KGlobalSettings::NaturalSortingChanged);
}
m_renameInline->setChecked(GeneralSettings::renameInline());
}
-#include "behaviorsettingspage.moc"
#include <settings/settingspagebase.h>
#include <KUrl>
-class KComboBox;
class QCheckBox;
class QLabel;
class QRadioButton;
#include <QApplication>
#include <QDir>
#include <QVBoxLayout>
+#include <QUrl>
ConfigurePreviewPluginDialog::ConfigurePreviewPluginDialog(const QString& pluginName,
const QString& desktopEntryName,
setMainWidget(mainWidget);
- connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
+ connect(this, &ConfigurePreviewPluginDialog::okClicked, this, &ConfigurePreviewPluginDialog::slotOk);
}
ConfigurePreviewPluginDialog::~ConfigurePreviewPluginDialog()
// for a specific MIME-type should be regenerated. As this is not available yet we
// delete the whole thumbnails directory.
QApplication::changeOverrideCursor(Qt::BusyCursor);
- KIO::NetAccess::del(QString(QDir::homePath() + "/.thumbnails/"), this);
+ KIO::NetAccess::del(QUrl::fromLocalFile(QDir::homePath() + "/.thumbnails/"), this);
QApplication::restoreOverrideCursor();
}
-#include "configurepreviewplugindialog.moc"
loadSettings();
- connect(m_confirmMoveToTrash, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
- connect(m_confirmDelete, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
- connect(m_confirmClosingMultipleTabs, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+ connect(m_confirmMoveToTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
+ connect(m_confirmDelete, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
+ connect(m_confirmClosingMultipleTabs, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
}
ConfirmationsSettingsPage::~ConfirmationsSettingsPage()
m_confirmClosingMultipleTabs->setChecked(GeneralSettings::confirmClosingMultipleTabs());
}
-#include "confirmationssettingspage.moc"
// initialize 'Behavior' tab
BehaviorSettingsPage* behaviorPage = new BehaviorSettingsPage(url, tabWidget);
tabWidget->addTab(behaviorPage, i18nc("@title:tab Behavior settings", "Behavior"));
- connect(behaviorPage, SIGNAL(changed()), this, SIGNAL(changed()));
+ connect(behaviorPage, &BehaviorSettingsPage::changed, this, &GeneralSettingsPage::changed);
// initialize 'Previews' tab
PreviewsSettingsPage* previewsPage = new PreviewsSettingsPage(tabWidget);
tabWidget->addTab(previewsPage, i18nc("@title:tab Previews settings", "Previews"));
- connect(previewsPage, SIGNAL(changed()), this, SIGNAL(changed()));
+ connect(previewsPage, &PreviewsSettingsPage::changed, this, &GeneralSettingsPage::changed);
// initialize 'Context Menu' tab
ConfirmationsSettingsPage* confirmationsPage = new ConfirmationsSettingsPage(tabWidget);
tabWidget->addTab(confirmationsPage, i18nc("@title:tab Confirmations settings", "Confirmations"));
- connect(confirmationsPage, SIGNAL(changed()), this, SIGNAL(changed()));
+ connect(confirmationsPage, &ConfirmationsSettingsPage::changed, this, &GeneralSettingsPage::changed);
// initialize 'Status Bar' tab
StatusBarSettingsPage* statusBarPage = new StatusBarSettingsPage(tabWidget);
tabWidget->addTab(statusBarPage, i18nc("@title:tab Status Bar settings", "Status Bar"));
- connect(statusBarPage, SIGNAL(changed()), this, SIGNAL(changed()));
+ connect(statusBarPage, &StatusBarSettingsPage::changed, this, &GeneralSettingsPage::changed);
m_pages.append(behaviorPage);
m_pages.append(previewsPage);
}
}
-#include "generalsettingspage.moc"
m_listView = new QListView(this);
ServiceItemDelegate* delegate = new ServiceItemDelegate(m_listView, m_listView);
- connect(delegate, SIGNAL(requestServiceConfiguration(QModelIndex)),
- this, SLOT(configureService(QModelIndex)));
+ connect(delegate, &ServiceItemDelegate::requestServiceConfiguration,
+ this, &PreviewsSettingsPage::configureService);
ServiceModel* serviceModel = new ServiceModel(this);
QSortFilterProxyModel* proxyModel = new QSortFilterProxyModel(this);
loadSettings();
- connect(m_listView, SIGNAL(clicked(QModelIndex)), this, SIGNAL(changed()));
- connect(m_remoteFileSizeBox, SIGNAL(valueChanged(int)), this, SIGNAL(changed()));
+ connect(m_listView, &QListView::clicked, this, &PreviewsSettingsPage::changed);
+ connect(m_remoteFileSizeBox, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged), this, &PreviewsSettingsPage::changed);
}
PreviewsSettingsPage::~PreviewsSettingsPage()
}
}
- KConfigGroup globalConfig(KGlobal::config(), QLatin1String("PreviewSettings"));
+ KConfigGroup globalConfig(KSharedConfig::openConfig(), QLatin1String("PreviewSettings"));
globalConfig.writeEntry("Plugins", m_enabledPreviewPlugins);
const qulonglong maximumRemoteSize = static_cast<qulonglong>(m_remoteFileSizeBox->value()) * 1024 * 1024;
QAbstractItemModel* model = m_listView->model();
const KService::List plugins = KServiceTypeTrader::self()->query(QLatin1String("ThumbCreator"));
- foreach (const KSharedPtr<KService>& service, plugins) {
+ foreach (const KService::Ptr& service, plugins) {
const bool configurable = service->property("Configurable", QVariant::Bool).toBool();
const bool show = m_enabledPreviewPlugins.contains(service->desktopEntryName());
void PreviewsSettingsPage::loadSettings()
{
- KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings");
+ KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
m_enabledPreviewPlugins = globalConfig.readEntry("Plugins", QStringList()
<< QLatin1String("directorythumbnail")
<< QLatin1String("imagethumbnail")
m_remoteFileSizeBox->setValue(maxRemoteMByteSize);
}
-#include "previewssettingspage.moc"
loadSettings();
- connect(m_showZoomSlider, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
- connect(m_showSpaceInfo, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+ connect(m_showZoomSlider, &QCheckBox::toggled, this, &StatusBarSettingsPage::changed);
+ connect(m_showSpaceInfo, &QCheckBox::toggled, this, &StatusBarSettingsPage::changed);
}
StatusBarSettingsPage::~StatusBarSettingsPage()
m_showSpaceInfo->setChecked(GeneralSettings::showSpaceInfo());
}
-#include "statusbarsettingspage.moc"
#include <KLocale>
#include <KPluginFactory>
#include <KPluginLoader>
+#include <KGlobal>
#include <settings/general/behaviorsettingspage.h>
#include <settings/general/previewssettingspage.h>
K_EXPORT_PLUGIN(KCMDolphinGeneralConfigFactory("kcmdolphingeneral"))
DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget* parent, const QVariantList& args) :
- KCModule(KCMDolphinGeneralConfigFactory::componentData(), parent),
+ KCModule(parent),
m_pages()
{
Q_UNUSED(args);
- KGlobal::locale()->insertCatalog("dolphin");
+ //KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
+//KLocale::global()->insertCatalog("dolphin");
setButtons(KCModule::Default | KCModule::Help);
// initialize 'Behavior' tab
BehaviorSettingsPage* behaviorPage = new BehaviorSettingsPage(QDir::homePath(), tabWidget);
tabWidget->addTab(behaviorPage, i18nc("@title:tab Behavior settings", "Behavior"));
- connect(behaviorPage, SIGNAL(changed()), this, SLOT(changed()));
+ connect(behaviorPage, &BehaviorSettingsPage::changed, this, static_cast<void(DolphinGeneralConfigModule::*)()>(&DolphinGeneralConfigModule::changed));
// initialize 'Previews' tab
PreviewsSettingsPage* previewsPage = new PreviewsSettingsPage(tabWidget);
tabWidget->addTab(previewsPage, i18nc("@title:tab Previews settings", "Previews"));
- connect(previewsPage, SIGNAL(changed()), this, SLOT(changed()));
+ connect(previewsPage, &PreviewsSettingsPage::changed, this, static_cast<void(DolphinGeneralConfigModule::*)()>(&DolphinGeneralConfigModule::changed));
// initialize 'Confirmations' tab
ConfirmationsSettingsPage* confirmationsPage = new ConfirmationsSettingsPage(tabWidget);
tabWidget->addTab(confirmationsPage, i18nc("@title:tab Confirmations settings", "Confirmations"));
- connect(confirmationsPage, SIGNAL(changed()), this, SLOT(changed()));
+ connect(confirmationsPage, &ConfirmationsSettingsPage::changed, this, static_cast<void(DolphinGeneralConfigModule::*)()>(&DolphinGeneralConfigModule::changed));
m_pages.append(behaviorPage);
m_pages.append(previewsPage);
Icon=system-run
Type=Service
X-KDE-ServiceTypes=KCModule
-Exec=kcmshell4 kcmdolphingeneral
+Exec=kcmshell5 kcmdolphingeneral
X-KDE-Library=kcm_dolphingeneral
X-KDE-PluginKeyword=dolphingeneral
#include <KLocale>
#include <KPluginFactory>
#include <KPluginLoader>
+#include <KGlobal>
#include <settings/navigation/navigationsettingspage.h>
K_EXPORT_PLUGIN(KCMDolphinNavigationConfigFactory("kcmdolphinnavigation"))
DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, const QVariantList& args) :
- KCModule(KCMDolphinNavigationConfigFactory::componentData(), parent),
+ KCModule(parent),
m_navigation(0)
{
Q_UNUSED(args);
- KGlobal::locale()->insertCatalog("dolphin");
+ //KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
+//KLocale::global()->insertCatalog("dolphin");
setButtons(KCModule::Default | KCModule::Help);
topLayout->setSpacing(KDialog::spacingHint());
m_navigation = new NavigationSettingsPage(this);
- connect(m_navigation, SIGNAL(changed()), this, SLOT(changed()));
+ connect(m_navigation, &NavigationSettingsPage::changed, this, static_cast<void(DolphinNavigationConfigModule::*)()>(&DolphinNavigationConfigModule::changed));
topLayout->addWidget(m_navigation, 0, 0);
}
Icon=input-mouse
Type=Service
X-KDE-ServiceTypes=KCModule
-Exec=kcmshell4 kcmdolphinnavigation
+Exec=kcmshell5 kcmdolphinnavigation
X-KDE-Library=kcm_dolphinnavigation
X-KDE-PluginKeyword=dolphinnavigation
#include <KLocale>
#include <KPluginFactory>
#include <KPluginLoader>
+#include <KGlobal>
#include <settings/services/servicessettingspage.h>
K_EXPORT_PLUGIN(KCMDolphinServicesConfigFactory("kcmdolphinservices"))
DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const QVariantList& args) :
- KCModule(KCMDolphinServicesConfigFactory::componentData(), parent),
+ KCModule(parent),
m_services(0)
{
Q_UNUSED(args);
- KGlobal::locale()->insertCatalog("dolphin");
+ //KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
+//KLocale::global()->insertCatalog("dolphin");
setButtons(KCModule::Default | KCModule::Help);
topLayout->setSpacing(KDialog::spacingHint());
m_services = new ServicesSettingsPage(this);
- connect(m_services, SIGNAL(changed()), this, SLOT(changed()));
+ connect(m_services, &ServicesSettingsPage::changed, this, static_cast<void(DolphinServicesConfigModule::*)()>(&DolphinServicesConfigModule::changed));
topLayout->addWidget(m_services, 0, 0);
}
Icon=services
Type=Service
X-KDE-ServiceTypes=KCModule
-Exec=kcmshell4 kcmdolphinservices
+Exec=kcmshell5 kcmdolphinservices
X-KDE-Library=kcm_dolphinservices
X-KDE-PluginKeyword=dolphinservices
#include <KLocale>
#include <KPluginFactory>
#include <KPluginLoader>
-#include <KIcon>
+#include <QIcon>
+#include <KGlobal>
#include <settings/viewmodes/viewsettingstab.h>
K_EXPORT_PLUGIN(KCMDolphinViewModesConfigFactory("kcmdolphinviewmodes"))
DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, const QVariantList& args) :
- KCModule(KCMDolphinViewModesConfigFactory::componentData(), parent),
+ KCModule(parent),
m_tabs()
{
Q_UNUSED(args);
- KGlobal::locale()->insertCatalog("dolphin");
+ //KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
+//KLocale::global()->insertCatalog("dolphin");
setButtons(KCModule::Default | KCModule::Help);
// Initialize 'Icons' tab
ViewSettingsTab* iconsTab = new ViewSettingsTab(ViewSettingsTab::IconsMode, tabWidget);
- tabWidget->addTab(iconsTab, KIcon("view-list-icons"), i18nc("@title:tab", "Icons"));
- connect(iconsTab, SIGNAL(changed()), this, SLOT(viewModeChanged()));
+ tabWidget->addTab(iconsTab, QIcon::fromTheme("view-list-icons"), i18nc("@title:tab", "Icons"));
+ connect(iconsTab, &ViewSettingsTab::changed, this, &DolphinViewModesConfigModule::viewModeChanged);
// Initialize 'Compact' tab
ViewSettingsTab* compactTab = new ViewSettingsTab(ViewSettingsTab::CompactMode, tabWidget);
- tabWidget->addTab(compactTab, KIcon("view-list-details"), i18nc("@title:tab", "Compact"));
- connect(compactTab, SIGNAL(changed()), this, SLOT(viewModeChanged()));
+ tabWidget->addTab(compactTab, QIcon::fromTheme("view-list-details"), i18nc("@title:tab", "Compact"));
+ connect(compactTab, &ViewSettingsTab::changed, this, &DolphinViewModesConfigModule::viewModeChanged);
// Initialize 'Details' tab
ViewSettingsTab* detailsTab = new ViewSettingsTab(ViewSettingsTab::DetailsMode, tabWidget);
- tabWidget->addTab(detailsTab, KIcon("view-list-tree"), i18nc("@title:tab", "Details"));
- connect(detailsTab, SIGNAL(changed()), this, SLOT(viewModeChanged()));
+ tabWidget->addTab(detailsTab, QIcon::fromTheme("view-list-tree"), i18nc("@title:tab", "Details"));
+ connect(detailsTab, &ViewSettingsTab::changed, this, &DolphinViewModesConfigModule::viewModeChanged);
m_tabs.append(iconsTab);
m_tabs.append(compactTab);
Icon=view-choose
Type=Service
X-KDE-ServiceTypes=KCModule
-Exec=kcmshell4 kcmdolphinviewmodes
+Exec=kcmshell5 kcmdolphinviewmodes
X-KDE-Library=kcm_dolphinviewmodes
X-KDE-PluginKeyword=dolphinviewmodes
loadSettings();
- connect(m_singleClick, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
- connect(m_doubleClick, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
- connect(m_openArchivesAsFolder, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
- connect(m_autoExpandFolders, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+ connect(m_singleClick, &QRadioButton::toggled, this, &NavigationSettingsPage::changed);
+ connect(m_doubleClick, &QRadioButton::toggled, this, &NavigationSettingsPage::changed);
+ connect(m_openArchivesAsFolder, &QCheckBox::toggled, this, &NavigationSettingsPage::changed);
+ connect(m_autoExpandFolders, &QCheckBox::toggled, this, &NavigationSettingsPage::changed);
}
NavigationSettingsPage::~NavigationSettingsPage()
m_autoExpandFolders->setChecked(GeneralSettings::autoExpandFolders());
}
-#include "navigationsettingspage.moc"
#include <KDebug>
#include <KPushButton>
-#include <KIcon>
+#include <QIcon>
#include "servicemodel.h"
painter->restore();
}
-QList<QWidget*> ServiceItemDelegate::createItemWidgets() const
+QList<QWidget*> ServiceItemDelegate::createItemWidgets(const QModelIndex&) const
{
QCheckBox* checkBox = new QCheckBox();
QPalette palette = checkBox->palette();
palette.setColor(QPalette::WindowText, palette.color(QPalette::Text));
checkBox->setPalette(palette);
- connect(checkBox, SIGNAL(clicked(bool)), this, SLOT(slotCheckBoxClicked(bool)));
+ connect(checkBox, &QCheckBox::clicked, this, &ServiceItemDelegate::slotCheckBoxClicked);
KPushButton* configureButton = new KPushButton();
- connect(configureButton, SIGNAL(clicked()), this, SLOT(slotConfigureButtonClicked()));
+ connect(configureButton, &KPushButton::clicked, this, &ServiceItemDelegate::slotConfigureButtonClicked);
return QList<QWidget*>() << checkBox << configureButton;
}
checkBox->setText(model->data(index).toString());
const QString iconName = model->data(index, Qt::DecorationRole).toString();
if (!iconName.isEmpty()) {
- checkBox->setIcon(KIcon(iconName));
+ checkBox->setIcon(QIcon::fromTheme(iconName));
}
checkBox->setChecked(model->data(index, Qt::CheckStateRole).toBool());
// Update the configuration button
if (configurable) {
configureButton->setEnabled(checkBox->isChecked());
- configureButton->setIcon(KIcon("configure"));
+ configureButton->setIcon(QIcon::fromTheme("configure"));
configureButton->resize(configureButton->sizeHint());
configureButton->move(option.rect.right() - configureButton->width(),
(itemHeight - configureButton->height()) / 2);
emit requestServiceConfiguration(focusedIndex());
}
-#include "serviceitemdelegate.moc"
virtual void paint(QPainter* painter, const QStyleOptionViewItem& option,
const QModelIndex& index) const;
- virtual QList<QWidget*> createItemWidgets() const;
+ virtual QList<QWidget*> createItemWidgets(const QModelIndex&) const Q_DECL_OVERRIDE;
virtual void updateItemWidgets(const QList<QWidget*> widgets,
const QStyleOptionViewItem& option,
return m_items.count();
}
-#include "servicemodel.moc"
#include <KConfigGroup>
#include <KDesktopFile>
#include <kdesktopfileactions.h>
-#include <KIcon>
+#include <QIcon>
#include <KLocale>
#include <KMessageBox>
-#include <knewstuff3/knewstuffbutton.h>
+#include <KNS3/Button>
#include <KService>
#include <KServiceTypeTrader>
-#include <KStandardDirs>
+#include <QStandardPaths>
#include <settings/serviceitemdelegate.h>
#include <settings/servicemodel.h>
namespace
{
const bool ShowDeleteDefault = false;
- const char* VersionControlServicePrefix = "_version_control_";
- const char* DeleteService = "_delete";
- const char* CopyToMoveToService ="_copy_to_move_to";
+ const char VersionControlServicePrefix[] = "_version_control_";
+ const char DeleteService[] = "_delete";
+ const char CopyToMoveToService[] ="_copy_to_move_to";
}
ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) :
m_listView->setModel(m_sortModel);
m_listView->setItemDelegate(delegate);
m_listView->setVerticalScrollMode(QListView::ScrollPerPixel);
- connect(m_listView, SIGNAL(clicked(QModelIndex)), this, SIGNAL(changed()));
+ connect(m_listView, &QListView::clicked, this, &ServicesSettingsPage::changed);
KNS3::Button* downloadButton = new KNS3::Button(i18nc("@action:button", "Download New Services..."),
"servicemenu.knsrc",
this);
- connect(downloadButton, SIGNAL(dialogFinished(KNS3::Entry::List)), this, SLOT(loadServices()));
+ connect(downloadButton, &KNS3::Button::dialogFinished, this, &ServicesSettingsPage::loadServices);
topLayout->addWidget(label);
topLayout->addWidget(m_listView);
configGroup.sync();
} else if (service == QLatin1String(CopyToMoveToService)) {
GeneralSettings::setShowCopyMoveMenu(checked);
- GeneralSettings::self()->writeConfig();
+ GeneralSettings::self()->save();
} else {
showGroup.writeEntry(service, checked);
}
if (m_enabledVcsPlugins != enabledPlugins) {
VersionControlSettings::setEnabledPlugins(enabledPlugins);
- VersionControlSettings::self()->writeConfig();
+ VersionControlSettings::self()->save();
KMessageBox::information(window(),
i18nc("@info", "Dolphin must be restarted to apply the "
// Load generic services
const KService::List entries = KServiceTypeTrader::self()->query("KonqPopupMenu/Plugin");
- foreach (const KSharedPtr<KService>& service, entries) {
- const QString file = KStandardDirs::locate("services", service->entryPath());
+ foreach (const KService::Ptr& service, entries) {
+ const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kservices5/" % service->entryPath());
const QList<KServiceAction> serviceActions =
KDesktopFileActions::userDefinedServices(file, true);
// Load service plugins that implement the KFileItemActionPlugin interface
const KService::List pluginServices = KServiceTypeTrader::self()->query("KFileItemAction/Plugin");
- foreach (const KSharedPtr<KService>& service, pluginServices) {
+ foreach (const KService::Ptr& service, pluginServices) {
const QString desktopEntryName = service->desktopEntryName();
if (!isInServicesList(desktopEntryName)) {
const bool checked = showGroup.readEntry(desktopEntryName, true);
m_serviceModel->setData(index, checked, Qt::CheckStateRole);
}
-#include "servicessettingspage.moc"
#include <QMap>
#include <QString>
-class QCheckBox;
-class QGroupBox;
class QListView;
class QSortFilterProxyModel;
class ServiceModel;
{}
-#include "settingspagebase.moc"
m_homeUrl = new KLineEdit(homeUrlBox);
m_homeUrl->setClearButtonShown(true);
- QPushButton* selectHomeUrlButton = new QPushButton(KIcon("folder-open"), QString(), homeUrlBox);
+ QPushButton* selectHomeUrlButton = new QPushButton(QIcon::fromTheme("folder-open"), QString(), homeUrlBox);
#ifndef QT_NO_ACCESSIBILITY
selectHomeUrlButton->setAccessibleName(i18nc("@action:button", "Select Home Location"));
#endif
- connect(selectHomeUrlButton, SIGNAL(clicked()),
- this, SLOT(selectHomeUrl()));
+ connect(selectHomeUrlButton, &QPushButton::clicked,
+ this, &StartupSettingsPage::selectHomeUrl);
KHBox* buttonBox = new KHBox(homeBox);
buttonBox->setSpacing(spacing);
QPushButton* useCurrentButton = new QPushButton(i18nc("@action:button", "Use Current Location"), buttonBox);
- connect(useCurrentButton, SIGNAL(clicked()),
- this, SLOT(useCurrentLocation()));
+ connect(useCurrentButton, &QPushButton::clicked,
+ this, &StartupSettingsPage::useCurrentLocation);
QPushButton* useDefaultButton = new QPushButton(i18nc("@action:button", "Use Default Location"), buttonBox);
- connect(useDefaultButton, SIGNAL(clicked()),
- this, SLOT(useDefaultLocation()));
+ connect(useDefaultButton, &QPushButton::clicked,
+ this, &StartupSettingsPage::useDefaultLocation);
QVBoxLayout* homeBoxLayout = new QVBoxLayout(homeBox);
homeBoxLayout->addWidget(homeUrlBox);
loadSettings();
- connect(m_homeUrl, SIGNAL(textChanged(QString)), this, SLOT(slotSettingsChanged()));
- connect(m_splitView, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged()));
- connect(m_editableUrl, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged()));
- connect(m_showFullPath, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged()));
- connect(m_filterBar, SIGNAL(toggled(bool)), this, SLOT(slotSettingsChanged()));
+ connect(m_homeUrl, &KLineEdit::textChanged, this, &StartupSettingsPage::slotSettingsChanged);
+ connect(m_splitView, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
+ connect(m_editableUrl, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
+ connect(m_showFullPath, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
+ connect(m_filterBar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged);
}
StartupSettingsPage::~StartupSettingsPage()
m_filterBar->setChecked(GeneralSettings::filterBar());
}
-#include "startupsettingspage.moc"
loadSettings();
- connect(m_proxy, SIGNAL(changed(bool)), this, SIGNAL(changed()));
+ connect(m_proxy, static_cast<void(KCModuleProxy::*)(bool)>(&KCModuleProxy::changed), this, &TrashSettingsPage::changed);
}
TrashSettingsPage::~TrashSettingsPage()
m_proxy->load();
}
-#include "trashsettingspage.moc"
#include <QEvent>
#include <QHBoxLayout>
#include <QPushButton>
+#include <QFontDatabase>
DolphinFontRequester::DolphinFontRequester(QWidget* parent) :
QWidget(parent),
m_modeCombo = new KComboBox(this);
m_modeCombo->addItem(i18nc("@item:inlistbox Font", "System Font"));
m_modeCombo->addItem(i18nc("@item:inlistbox Font", "Custom Font"));
- connect(m_modeCombo, SIGNAL(activated(int)),
- this, SLOT(changeMode(int)));
+ connect(m_modeCombo, static_cast<void(KComboBox::*)(int)>(&KComboBox::activated),
+ this, &DolphinFontRequester::changeMode);
m_chooseFontButton = new QPushButton(i18nc("@action:button Choose font", "Choose..."), this);
- connect(m_chooseFontButton, SIGNAL(clicked()),
- this, SLOT(openFontDialog()));
+ connect(m_chooseFontButton, &QPushButton::clicked,
+ this, &DolphinFontRequester::openFontDialog);
changeMode(m_modeCombo->currentIndex());
QFont DolphinFontRequester::currentFont() const
{
- return (m_mode == CustomFont) ? m_customFont : KGlobalSettings::generalFont();
+ return (m_mode == CustomFont) ? m_customFont : QFontDatabase::systemFont(QFontDatabase::GeneralFont);
}
void DolphinFontRequester::setCustomFont(const QFont& font)
emit changed();
}
-#include "dolphinfontrequester.moc"
void ViewModeSettings::readConfig()
{
switch (m_mode) {
- case ViewModeSettings::IconsMode: IconsModeSettings::self()->readConfig(); break;
- case ViewModeSettings::CompactMode: CompactModeSettings::self()->readConfig(); break;
- case ViewModeSettings::DetailsMode: DetailsModeSettings::self()->readConfig(); break;
+ case ViewModeSettings::IconsMode: IconsModeSettings::self()->load(); break;
+ case ViewModeSettings::CompactMode: CompactModeSettings::self()->load(); break;
+ case ViewModeSettings::DetailsMode: DetailsModeSettings::self()->load(); break;
default: Q_ASSERT(false); break;
}
}
void ViewModeSettings::writeConfig()
{
switch (m_mode) {
- case ViewModeSettings::IconsMode: IconsModeSettings::self()->writeConfig(); break;
- case ViewModeSettings::CompactMode: CompactModeSettings::self()->writeConfig(); break;
- case ViewModeSettings::DetailsMode: DetailsModeSettings::self()->writeConfig(); break;
+ case ViewModeSettings::IconsMode: IconsModeSettings::self()->save(); break;
+ case ViewModeSettings::CompactMode: CompactModeSettings::self()->save(); break;
+ case ViewModeSettings::DetailsMode: DetailsModeSettings::self()->save(); break;
default: Q_ASSERT(false); break;
}
}
// Initialize 'Icons' tab
ViewSettingsTab* iconsTab = new ViewSettingsTab(ViewSettingsTab::IconsMode, tabWidget);
- tabWidget->addTab(iconsTab, KIcon("view-list-icons"), i18nc("@title:tab", "Icons"));
- connect(iconsTab, SIGNAL(changed()), this, SIGNAL(changed()));
+ tabWidget->addTab(iconsTab, QIcon::fromTheme("view-list-icons"), i18nc("@title:tab", "Icons"));
+ connect(iconsTab, &ViewSettingsTab::changed, this, &ViewSettingsPage::changed);
// Initialize 'Compact' tab
ViewSettingsTab* compactTab = new ViewSettingsTab(ViewSettingsTab::CompactMode, tabWidget);
- tabWidget->addTab(compactTab, KIcon("view-list-details"), i18nc("@title:tab", "Compact"));
- connect(compactTab, SIGNAL(changed()), this, SIGNAL(changed()));
+ tabWidget->addTab(compactTab, QIcon::fromTheme("view-list-details"), i18nc("@title:tab", "Compact"));
+ connect(compactTab, &ViewSettingsTab::changed, this, &ViewSettingsPage::changed);
// Initialize 'Details' tab
ViewSettingsTab* detailsTab = new ViewSettingsTab(ViewSettingsTab::DetailsMode, tabWidget);
- tabWidget->addTab(detailsTab, KIcon("view-list-tree"), i18nc("@title:tab", "Details"));
- connect(detailsTab, SIGNAL(changed()), this, SIGNAL(changed()));
+ tabWidget->addTab(detailsTab, QIcon::fromTheme("view-list-tree"), i18nc("@title:tab", "Details"));
+ connect(detailsTab, &ViewSettingsTab::changed, this, &ViewSettingsPage::changed);
m_tabs.append(iconsTab);
m_tabs.append(compactTab);
}
}
-#include "viewsettingspage.moc"
m_defaultSizeSlider->setPageStep(1);
m_defaultSizeSlider->setTickPosition(QSlider::TicksBelow);
m_defaultSizeSlider->setRange(minRange, maxRange);
- connect(m_defaultSizeSlider, SIGNAL(valueChanged(int)),
- this, SLOT(slotDefaultSliderMoved(int)));
+ connect(m_defaultSizeSlider, &QSlider::valueChanged,
+ this, &ViewSettingsTab::slotDefaultSliderMoved);
QLabel* previewLabel = new QLabel(i18nc("@label:listbox", "Preview:"), this);
m_previewSizeSlider = new QSlider(Qt::Horizontal, this);
m_previewSizeSlider->setPageStep(1);
m_previewSizeSlider->setTickPosition(QSlider::TicksBelow);
m_previewSizeSlider->setRange(minRange, maxRange);
- connect(m_previewSizeSlider, SIGNAL(valueChanged(int)),
- this, SLOT(slotPreviewSliderMoved(int)));
+ connect(m_previewSizeSlider, &QSlider::valueChanged,
+ this, &ViewSettingsTab::slotPreviewSliderMoved);
QGridLayout* layout = new QGridLayout(iconSizeGroup);
layout->addWidget(defaultLabel, 0, 0, Qt::AlignRight);
loadSettings();
- connect(m_defaultSizeSlider, SIGNAL(valueChanged(int)), this, SIGNAL(changed()));
- connect(m_previewSizeSlider, SIGNAL(valueChanged(int)), this, SIGNAL(changed()));
- connect(m_fontRequester, SIGNAL(changed()), this, SIGNAL(changed()));
+ connect(m_defaultSizeSlider, &QSlider::valueChanged, this, &ViewSettingsTab::changed);
+ connect(m_previewSizeSlider, &QSlider::valueChanged, this, &ViewSettingsTab::changed);
+ connect(m_fontRequester, &DolphinFontRequester::changed, this, &ViewSettingsTab::changed);
switch (m_mode) {
case IconsMode:
- connect(m_widthBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed()));
- connect(m_maxLinesBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed()));
+ connect(m_widthBox, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &ViewSettingsTab::changed);
+ connect(m_maxLinesBox, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &ViewSettingsTab::changed);
break;
case CompactMode:
- connect(m_widthBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed()));
+ connect(m_widthBox, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &ViewSettingsTab::changed);
break;
case DetailsMode:
- connect(m_expandableFolders, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+ connect(m_expandableFolders, &QCheckBox::toggled, this, &ViewSettingsTab::changed);
break;
default:
break;
QHelpEvent toolTipEvent(QEvent::ToolTip, QPoint(0, 0), slider->mapToGlobal(global));
QApplication::sendEvent(slider, &toolTipEvent);
}
-#include "viewsettingstab.moc"
+
#include <KIconLoader>
#include <KIO/NetAccess>
#include <KMessageBox>
-#include <KStandardDirs>
#include <KUrl>
#include <KComboBox>
QLabel* viewModeLabel = new QLabel(i18nc("@label:listbox", "View mode:"), propsGrid);
m_viewMode = new KComboBox(propsGrid);
- m_viewMode->addItem(KIcon("view-list-icons"), i18nc("@item:inlistbox", "Icons"), DolphinView::IconsView);
- m_viewMode->addItem(KIcon("view-list-details"), i18nc("@item:inlistbox", "Compact"), DolphinView::CompactView);
- m_viewMode->addItem(KIcon("view-list-tree"), i18nc("@item:inlistbox", "Details"), DolphinView::DetailsView);
+ m_viewMode->addItem(QIcon::fromTheme("view-list-icons"), i18nc("@item:inlistbox", "Icons"), DolphinView::IconsView);
+ m_viewMode->addItem(QIcon::fromTheme("view-list-details"), i18nc("@item:inlistbox", "Compact"), DolphinView::CompactView);
+ m_viewMode->addItem(QIcon::fromTheme("view-list-tree"), i18nc("@item:inlistbox", "Details"), DolphinView::DetailsView);
QLabel* sortingLabel = new QLabel(i18nc("@label:listbox", "Sorting:"), propsGrid);
QWidget* sortingBox = new QWidget(propsGrid);
topLayout->addWidget(propsBox);
- connect(m_viewMode, SIGNAL(currentIndexChanged(int)),
- this, SLOT(slotViewModeChanged(int)));
- connect(m_sorting, SIGNAL(currentIndexChanged(int)),
- this, SLOT(slotSortingChanged(int)));
- connect(m_sortOrder, SIGNAL(currentIndexChanged(int)),
- this, SLOT(slotSortOrderChanged(int)));
- connect(m_additionalInfo, SIGNAL(clicked()),
- this, SLOT(configureAdditionalInfo()));
- connect(m_sortFoldersFirst, SIGNAL(clicked()),
- this, SLOT(slotSortFoldersFirstChanged()));
- connect(m_previewsShown, SIGNAL(clicked()),
- this, SLOT(slotShowPreviewChanged()));
- connect(m_showInGroups, SIGNAL(clicked()),
- this, SLOT(slotGroupedSortingChanged()));
- connect(m_showHiddenFiles, SIGNAL(clicked()),
- this, SLOT(slotShowHiddenFilesChanged()));
-
- connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
- connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
+ connect(m_viewMode, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged),
+ this, &ViewPropertiesDialog::slotViewModeChanged);
+ connect(m_sorting, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged),
+ this, &ViewPropertiesDialog::slotSortingChanged);
+ connect(m_sortOrder, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged),
+ this, &ViewPropertiesDialog::slotSortOrderChanged);
+ connect(m_additionalInfo, &QPushButton::clicked,
+ this, &ViewPropertiesDialog::configureAdditionalInfo);
+ connect(m_sortFoldersFirst, &QCheckBox::clicked,
+ this, &ViewPropertiesDialog::slotSortFoldersFirstChanged);
+ connect(m_previewsShown, &QCheckBox::clicked,
+ this, &ViewPropertiesDialog::slotShowPreviewChanged);
+ connect(m_showInGroups, &QCheckBox::clicked,
+ this, &ViewPropertiesDialog::slotGroupedSortingChanged);
+ connect(m_showHiddenFiles, &QCheckBox::clicked,
+ this, &ViewPropertiesDialog::slotShowHiddenFilesChanged);
+
+ connect(this, &ViewPropertiesDialog::okClicked, this, &ViewPropertiesDialog::slotOk);
+ connect(this, &ViewPropertiesDialog::applyClicked, this, &ViewPropertiesDialog::slotApply);
// Only show the following settings if the view properties are remembered
// for each directory:
topLayout->addWidget(applyBox);
topLayout->addWidget(m_useAsDefault);
- connect(m_applyToCurrentFolder, SIGNAL(clicked(bool)),
- this, SLOT(markAsDirty(bool)));
- connect(m_applyToSubFolders, SIGNAL(clicked(bool)),
- this, SLOT(markAsDirty(bool)));
- connect(m_applyToAllFolders, SIGNAL(clicked(bool)),
- this, SLOT(markAsDirty(bool)));
- connect(m_useAsDefault, SIGNAL(clicked(bool)),
- this, SLOT(markAsDirty(bool)));
+ connect(m_applyToCurrentFolder, &QRadioButton::clicked,
+ this, &ViewPropertiesDialog::markAsDirty);
+ connect(m_applyToSubFolders, &QRadioButton::clicked,
+ this, &ViewPropertiesDialog::markAsDirty);
+ connect(m_applyToAllFolders, &QRadioButton::clicked,
+ this, &ViewPropertiesDialog::markAsDirty);
+ connect(m_useAsDefault, &QCheckBox::clicked,
+ this, &ViewPropertiesDialog::markAsDirty);
}
main->setLayout(topLayout);
markAsDirty(false);
}
-#include "viewpropertiesdialog.moc"
// allows to give a progress indication for the user when applying the view
// properties later.
m_dirSizeJob = KIO::directorySize(dir);
- connect(m_dirSizeJob, SIGNAL(result(KJob*)),
- this, SLOT(applyViewProperties()));
+ connect(m_dirSizeJob, &KIO::DirectorySizeJob::result,
+ this, &ViewPropsProgressInfo::applyViewProperties);
// The directory size job cannot emit any progress signal, as it is not aware
// about the total number of directories. Therefor a timer is triggered, which
// periodically updates the current directory count.
m_timer = new QTimer(this);
- connect(m_timer, SIGNAL(timeout()),
- this, SLOT(updateProgress()));
+ connect(m_timer, &QTimer::timeout,
+ this, &ViewPropsProgressInfo::updateProgress);
m_timer->start(300);
- connect(this, SIGNAL(cancelClicked()), this, SLOT(cancelApplying()));
+ connect(this, &ViewPropsProgressInfo::cancelClicked, this, &ViewPropsProgressInfo::cancelApplying);
}
ViewPropsProgressInfo::~ViewPropsProgressInfo()
m_dirSizeJob = 0;
m_applyViewPropsJob = new ApplyViewPropsJob(m_dir, *m_viewProps);
- connect(m_applyViewPropsJob, SIGNAL(result(KJob*)),
- this, SLOT(close()));
+ connect(m_applyViewPropsJob, &ApplyViewPropsJob::result,
+ this, &ViewPropsProgressInfo::close);
}
void ViewPropsProgressInfo::cancelApplying()
}
}
-#include "viewpropsprogressinfo.moc"
#include "dolphin_generalsettings.h"
#include <KIconLoader>
-#include <KIcon>
+#include <QIcon>
#include <KLocale>
-#include <KMenu>
+#include <QMenu>
#include <KVBox>
#include "statusbarspaceinfo.h"
m_zoomSlider->setPageStep(1);
m_zoomSlider->setRange(ZoomLevelInfo::minimumLevel(), ZoomLevelInfo::maximumLevel());
- connect(m_zoomSlider, SIGNAL(valueChanged(int)), this, SIGNAL(zoomLevelChanged(int)));
- connect(m_zoomSlider, SIGNAL(valueChanged(int)), this, SLOT(updateZoomSliderToolTip(int)));
- connect(m_zoomSlider, SIGNAL(sliderMoved(int)), this, SLOT(showZoomSliderToolTip(int)));
+ connect(m_zoomSlider, &QSlider::valueChanged, this, &DolphinStatusBar::zoomLevelChanged);
+ connect(m_zoomSlider, &QSlider::valueChanged, this, &DolphinStatusBar::updateZoomSliderToolTip);
+ connect(m_zoomSlider, &QSlider::sliderMoved, this, &DolphinStatusBar::showZoomSliderToolTip);
// Initialize space information
m_spaceInfo = new StatusBarSpaceInfo(this);
// Initialize progress information
m_stopButton = new QToolButton(this);
- m_stopButton->setIcon(KIcon("process-stop"));
+ m_stopButton->setIcon(QIcon::fromTheme("process-stop"));
m_stopButton->setAccessibleName(i18n("Stop"));
m_stopButton->setAutoRaise(true);
m_stopButton->setToolTip(i18nc("@tooltip", "Stop loading"));
m_stopButton->hide();
- connect(m_stopButton, SIGNAL(clicked()), this, SIGNAL(stopPressed()));
+ connect(m_stopButton, &QToolButton::clicked, this, &DolphinStatusBar::stopPressed);
m_progressTextLabel = new QLabel(this);
m_progressTextLabel->hide();
m_showProgressBarTimer = new QTimer(this);
m_showProgressBarTimer->setInterval(500);
m_showProgressBarTimer->setSingleShot(true);
- connect(m_showProgressBarTimer, SIGNAL(timeout()), this, SLOT(updateProgressInfo()));
+ connect(m_showProgressBarTimer, &QTimer::timeout, this, &DolphinStatusBar::updateProgressInfo);
m_resetToDefaultTextTimer = new QTimer(this);
m_resetToDefaultTextTimer->setInterval(ResetToDefaultTimeout);
m_resetToDefaultTextTimer->setSingleShot(true);
- connect(m_resetToDefaultTextTimer, SIGNAL(timeout()), this, SLOT(slotResetToDefaultText()));
+ connect(m_resetToDefaultTextTimer, &QTimer::timeout, this, &DolphinStatusBar::slotResetToDefaultText);
// Initialize top layout and size policies
const int fontHeight = QFontMetrics(m_label->font()).height();
{
Q_UNUSED(event);
- KMenu menu(this);
+ QMenu menu(this);
QAction* showZoomSliderAction = menu.addAction(i18nc("@action:inmenu", "Show Zoom Slider"));
showZoomSliderAction->setCheckable(true);
m_zoomSlider->setVisible(showZoomSlider);
}
-#include "dolphinstatusbar.moc"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
+#include <KIO/FileSystemFreeSpaceJob>
+
#include "mountpointobserver.h"
#include "mountpointobservercache.h"
-MountPointObserver::MountPointObserver(const QString& mountPoint, QObject* parent) :
+MountPointObserver::MountPointObserver(const QUrl& url, QObject* parent) :
QObject(parent),
- m_mountPoint(mountPoint),
- m_referenceCount(0),
- m_spaceInfo(KDiskFreeSpaceInfo::freeSpaceInfo(mountPoint))
+ m_url(url),
+ m_referenceCount(0)
{
}
-MountPointObserver* MountPointObserver::observerForPath(const QString& path)
+MountPointObserver* MountPointObserver::observerForUrl(const QUrl& url)
{
- MountPointObserver* observer = MountPointObserverCache::instance()->observerForPath(path);
+ MountPointObserver* observer = MountPointObserverCache::instance()->observerForUrl(url);
return observer;
}
if (m_referenceCount == 0) {
delete this;
} else {
- const KDiskFreeSpaceInfo spaceInfo = KDiskFreeSpaceInfo::freeSpaceInfo(m_mountPoint);
- if (spaceInfo.size() != m_spaceInfo.size() || spaceInfo.available() != m_spaceInfo.available()) {
- m_spaceInfo = spaceInfo;
- emit spaceInfoChanged();
- }
+ KIO::FileSystemFreeSpaceJob* job = KIO::fileSystemFreeSpace(m_url);
+ connect(job, &KIO::FileSystemFreeSpaceJob::result, this, &MountPointObserver::freeSpaceResult);
+ }
+}
+
+void MountPointObserver::freeSpaceResult(KIO::Job* job, KIO::filesize_t size, KIO::filesize_t available)
+{
+ if (!job->error()) {
+ emit spaceInfoChanged(size, available);
+ } else {
+ emit spaceInfoChanged(0, 0);
}
}
#ifndef MOUNTPOINTOBSERVER_H
#define MOUNTPOINTOBSERVER_H
-#include <KDiskFreeSpaceInfo>
+#include <KIO/Job>
#include <QObject>
+#include <QUrl>
/**
* A MountPointObserver can be used to determine the free space on a mount
{
Q_OBJECT
- explicit MountPointObserver(const QString& mountPoint, QObject* parent = 0);
+ explicit MountPointObserver(const QUrl& url, QObject* parent = 0);
virtual ~MountPointObserver() {}
public:
- /**
- * Obtains information about the available space on the observed mount point.
- */
- KDiskFreeSpaceInfo spaceInfo() const { return m_spaceInfo; }
-
/**
* Call this function to indicate that the caller intends to continue using this object. An
* internal reference count is increased then. When the observer is not needed any more,
}
/**
- * Returns a MountPointObserver for the given \a path. If the caller intends to continue using
+ * Returns a MountPointObserver for the given \a url. If the caller intends to continue using
* the returned object, it must call its ref() method.
*/
- static MountPointObserver* observerForPath(const QString& path);
+ static MountPointObserver* observerForUrl(const QUrl& url);
signals:
/**
- * This signal is emitted if the information that spaceInfo() will return has changed.
+ * This signal is emitted when the size has been retrieved.
*/
- void spaceInfoChanged();
+ void spaceInfoChanged(quint64 size, quint64 available);
public slots:
/**
- * If this slot is invoked, MountPointObserver checks if the available space on the observed
- * mount point has changed, and emits spaceInfoChanged() if that is the case.
+ * If this slot is invoked, MountPointObserver starts a new driveSize job
+ * to get the drive's size.
*/
void update();
+private slots:
+ void freeSpaceResult(KIO::Job* job, KIO::filesize_t size, KIO::filesize_t available);
+
private:
- const QString m_mountPoint;
+ const QUrl m_url;
int m_referenceCount;
- KDiskFreeSpaceInfo m_spaceInfo;
friend class MountPointObserverCache;
};
return &s_MountPointObserverCache->instance;
}
-MountPointObserver* MountPointObserverCache::observerForPath(const QString& path)
+MountPointObserver* MountPointObserverCache::observerForUrl(const QUrl& url)
{
- // Try to share the observer with other paths that have the same mount point.
- QString mountPointPath;
- KMountPoint::Ptr mountPoint = KMountPoint::currentMountPoints().findByPath(path);
- if (mountPoint) {
- mountPointPath = mountPoint->mountPoint();
+ QUrl cachedObserverUrl;
+ // If the url is a local path we can extract the root dir by checking the mount points.
+ if (url.isLocalFile()) {
+ // Try to share the observer with other paths that have the same mount point.
+ KMountPoint::Ptr mountPoint = KMountPoint::currentMountPoints().findByPath(url.toLocalFile());
+ if (mountPoint) {
+ cachedObserverUrl = QUrl::fromLocalFile(mountPoint->mountPoint());
+ } else {
+ // Even if determining the mount point failed, the observer might still
+ // be able to retrieve information about the url.
+ cachedObserverUrl = url.toLocalFile();
+ }
} else {
- // Even if determining the mount point failed, KDiskFreeSpaceInfo might still
- // be able to retrieve information about the path.
- mountPointPath = path;
+ cachedObserverUrl = url.url();
}
- MountPointObserver* observer = m_observerForMountPoint.value(mountPointPath);
+ MountPointObserver* observer = m_observerForMountPoint.value(cachedObserverUrl);
if (!observer) {
- observer = new MountPointObserver(mountPointPath, this);
- m_observerForMountPoint.insert(mountPointPath, observer);
- m_mountPointForObserver.insert(observer, mountPointPath);
+ observer = new MountPointObserver(cachedObserverUrl, this);
+ m_observerForMountPoint.insert(cachedObserverUrl, observer);
+ m_mountPointForObserver.insert(observer, cachedObserverUrl);
Q_ASSERT(m_observerForMountPoint.count() == m_mountPointForObserver.count());
- connect(observer, SIGNAL(destroyed(QObject*)), this, SLOT(slotObserverDestroyed(QObject*)));
+ connect(observer, &MountPointObserver::destroyed, this, &MountPointObserverCache::slotObserverDestroyed);
if (!m_updateTimer->isActive()) {
m_updateTimer->start(10000);
}
- connect(m_updateTimer, SIGNAL(timeout()), observer, SLOT(update()));
+ connect(m_updateTimer, &QTimer::timeout, observer, &MountPointObserver::update);
}
return observer;
void MountPointObserverCache::slotObserverDestroyed(QObject* observer)
{
Q_ASSERT(m_mountPointForObserver.contains(observer));
- const QString& path = m_mountPointForObserver.value(observer);
- Q_ASSERT(m_observerForMountPoint.contains(path));
- m_observerForMountPoint.remove(path);
+ const QUrl& url = m_mountPointForObserver.value(observer);
+ Q_ASSERT(m_observerForMountPoint.contains(url));
+ m_observerForMountPoint.remove(url);
m_mountPointForObserver.remove(observer);
Q_ASSERT(m_observerForMountPoint.count() == m_mountPointForObserver.count());
static MountPointObserverCache* instance();
/**
- * Returns a MountPointObserver for the given \a path. A new observer is created if necessary.
+ * Returns a MountPointObserver for the given \a url. A new observer is created if necessary.
*/
- MountPointObserver* observerForPath(const QString& path);
+ MountPointObserver* observerForUrl(const QUrl& url);
private slots:
/**
void slotObserverDestroyed(QObject* observer);
private:
- QHash<QString, MountPointObserver*> m_observerForMountPoint;
- QHash<QObject*, QString> m_mountPointForObserver;
+ QHash<QUrl, MountPointObserver*> m_observerForMountPoint;
+ QHash<QObject*, QUrl> m_mountPointForObserver;
QTimer* m_updateTimer;
friend class MountPointObserverCacheSingleton;
SpaceInfoObserver::SpaceInfoObserver(const KUrl& url, QObject* parent) :
QObject(parent),
- m_mountPointObserver(0)
+ m_mountPointObserver(0),
+ m_dataSize(0),
+ m_dataAvailable(0)
{
- if (url.isLocalFile()) {
- m_mountPointObserver = MountPointObserver::observerForPath(url.toLocalFile());
- m_mountPointObserver->ref();
- connect(m_mountPointObserver, SIGNAL(spaceInfoChanged()), this, SIGNAL(valuesChanged()));
- }
+ m_mountPointObserver = MountPointObserver::observerForUrl(url);
+ m_mountPointObserver->ref();
+ connect(m_mountPointObserver, &MountPointObserver::spaceInfoChanged, this, &SpaceInfoObserver::spaceInfoChanged);
+ m_mountPointObserver->update();
}
SpaceInfoObserver::~SpaceInfoObserver()
quint64 SpaceInfoObserver::size() const
{
- if (m_mountPointObserver && m_mountPointObserver->spaceInfo().isValid()) {
- return m_mountPointObserver->spaceInfo().size();
- } else {
- return 0;
- }
+ return m_dataSize;
}
quint64 SpaceInfoObserver::available() const
{
- if (m_mountPointObserver && m_mountPointObserver->spaceInfo().isValid()) {
- return m_mountPointObserver->spaceInfo().available();
- } else {
- return 0;
- }
+ return m_dataAvailable;
}
void SpaceInfoObserver::setUrl(const KUrl& url)
{
- if (url.isLocalFile()) {
- MountPointObserver* newObserver = MountPointObserver::observerForPath(url.toLocalFile());
- if (newObserver != m_mountPointObserver) {
- if (m_mountPointObserver) {
- disconnect(m_mountPointObserver, SIGNAL(spaceInfoChanged()), this, SIGNAL(valuesChanged()));
- m_mountPointObserver->deref();
- m_mountPointObserver = 0;
- }
-
- m_mountPointObserver = newObserver;
- m_mountPointObserver->ref();
- connect(m_mountPointObserver, SIGNAL(spaceInfoChanged()), this, SIGNAL(valuesChanged()));
-
- emit valuesChanged();
- }
- } else {
+ MountPointObserver* newObserver = MountPointObserver::observerForUrl(url);
+ if (newObserver != m_mountPointObserver) {
if (m_mountPointObserver) {
- disconnect(m_mountPointObserver, SIGNAL(spaceInfoChanged()), this, SIGNAL(valuesChanged()));
+ disconnect(m_mountPointObserver, &MountPointObserver::spaceInfoChanged, this, &SpaceInfoObserver::spaceInfoChanged);
m_mountPointObserver->deref();
m_mountPointObserver = 0;
-
- emit valuesChanged();
}
+
+ m_mountPointObserver = newObserver;
+ m_mountPointObserver->ref();
+ connect(m_mountPointObserver, &MountPointObserver::spaceInfoChanged, this, &SpaceInfoObserver::spaceInfoChanged);
+
+ // If newObserver is cached it won't call update until the next timer update,
+ // so update the observer now.
+ m_mountPointObserver->update();
+ }
+}
+
+void SpaceInfoObserver::spaceInfoChanged(quint64 size, quint64 available)
+{
+ // Make sure that the size has actually changed
+ if (m_dataSize != size || m_dataAvailable != available) {
+ m_dataSize = size;
+ m_dataAvailable = available;
+
+ emit valuesChanged();
}
}
#include <QObject>
+#include <KIO/Job>
+
class KUrl;
class MountPointObserver;
signals:
/**
- * This signal is emitted if the information that size() and/or available() will return has changed.
+ * This signal is emitted when the size or available space changes.
*/
void valuesChanged();
+private slots:
+ void spaceInfoChanged(quint64 size, quint64 available);
+
private:
MountPointObserver* m_mountPointObserver;
+
+ quint64 m_dataSize;
+ quint64 m_dataAvailable;
};
#endif
KCapacityBar::showEvent(event);
m_observer.reset(new SpaceInfoObserver(m_url, this));
slotValuesChanged();
- connect(m_observer.data(), SIGNAL(valuesChanged()), this, SLOT(slotValuesChanged()));
+ connect(m_observer.data(), &SpaceInfoObserver::valuesChanged, this, &StatusBarSpaceInfo::slotValuesChanged);
}
void StatusBarSpaceInfo::hideEvent(QHideEvent* event)
}
}
-#include "statusbarspaceinfo.moc"
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
-include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BUILD_DIR}/.. ${KDE4_INCLUDES} )
+
+find_package(Qt5Test CONFIG REQUIRED)
+include(ECMMarkAsTest)
# needed on windows to correctly use the files from dolphinprivate
add_definitions(-DLIBDOLPHINPRIVATE_EXPORT=)
kitemsettest.cpp
../kitemviews/kitemset.cpp
)
-kde4_add_unit_test(kitemsettest TEST ${kitemsettest_SRCS})
-target_link_libraries(kitemsettest dolphinprivate ${KDE4_KIO_LIBS} ${QT_QTTEST_LIBRARY})
+
+add_executable(kitemsettest ${kitemsettest_SRCS})
+add_test(kitemsettest kitemsettest)
+ecm_mark_as_test(kitemsettest)
+target_link_libraries(kitemsettest dolphinprivate Qt5::Test)
# KItemRangeTest
set(kitemrangetest_SRCS
kitemrangetest.cpp
)
-kde4_add_unit_test(kitemrangetest TEST ${kitemrangetest_SRCS})
-target_link_libraries(kitemrangetest dolphinprivate ${KDE4_KIO_LIBS} ${QT_QTTEST_LIBRARY})
+
+add_executable(kitemrangetest ${kitemrangetest_SRCS})
+add_test(kitemrangetest kitemrangetest)
+ecm_mark_as_test(kitemrangetest)
+target_link_libraries(kitemrangetest dolphinprivate Qt5::Test)
+
# KItemListSelectionManagerTest
set(kitemlistselectionmanagertest_SRCS
../kitemviews/kitemmodelbase.cpp
../kitemviews/kitemset.cpp
)
-kde4_add_unit_test(kitemlistselectionmanagertest TEST ${kitemlistselectionmanagertest_SRCS})
-target_link_libraries(kitemlistselectionmanagertest dolphinprivate ${KDE4_KIO_LIBS} ${QT_QTTEST_LIBRARY})
+
+add_executable(kitemlistselectionmanagertest ${kitemlistselectionmanagertest_SRCS})
+add_test(kitemlistselectionmanagertest kitemlistselectionmanagertest)
+ecm_mark_as_test(kitemlistselectionmanagertest)
+target_link_libraries(kitemlistselectionmanagertest dolphinprivate Qt5::Test)
# KItemListControllerTest
set(kitemlistcontrollertest_SRCS
../kitemviews/kitemlistview.cpp
../kitemviews/kitemlistcontainer.cpp
../kitemviews/kitemlistwidget.cpp
- ../kitemviews/kitemlistviewaccessible.cpp
+# ../kitemviews/kitemlistviewaccessible.cpp # TODO: enable once accessibility is ported to Qt5
../kitemviews/kitemset.cpp
../kitemviews/kstandarditemlistview.cpp
../kitemviews/kstandarditemlistwidget.cpp
)
-kde4_add_unit_test(kitemlistcontrollertest TEST ${kitemlistcontrollertest_SRCS})
-target_link_libraries(kitemlistcontrollertest dolphinprivate ${KDE4_KIO_LIBS} ${QT_QTTEST_LIBRARY})
+
+add_executable(kitemlistcontrollertest ${kitemlistcontrollertest_SRCS})
+add_test(kitemlistcontrollertest kitemlistcontrollertest)
+ecm_mark_as_test(kitemlistcontrollertest)
+target_link_libraries(kitemlistcontrollertest dolphinprivate Qt5::Test)
# KFileItemListViewTest
set(kfileitemlistviewtest_SRCS
../kitemviews/kfileitemlistview.cpp
../kitemviews/kitemmodelbase.cpp
../kitemviews/kitemlistview.cpp
- ../kitemviews/kitemlistviewaccessible.cpp
+# ../kitemviews/kitemlistviewaccessible.cpp # TODO: enable once accessibility is ported to Qt5
../kitemviews/kitemlistcontainer.cpp
../kitemviews/kitemlistwidget.cpp
../kitemviews/kitemset.cpp
../kitemviews/kstandarditemlistview.cpp
../kitemviews/kstandarditemlistwidget.cpp
)
-kde4_add_unit_test(kfileitemlistviewtest TEST ${kfileitemlistviewtest_SRCS})
-target_link_libraries(kfileitemlistviewtest dolphinprivate ${KDE4_KIO_LIBS} ${QT_QTTEST_LIBRARY})
+
+add_executable(kfileitemlistviewtest ${kfileitemlistviewtest_SRCS})
+add_test(kfileitemlistviewtest kfileitemlistviewtest)
+ecm_mark_as_test(kfileitemlistviewtest)
+target_link_libraries(kfileitemlistviewtest dolphinprivate Qt5::Test)
# KFileItemModelTest
set(kfileitemmodeltest_SRCS
../kitemviews/kitemmodelbase.cpp
../kitemviews/kitemset.cpp
)
-kde4_add_unit_test(kfileitemmodeltest TEST ${kfileitemmodeltest_SRCS})
-target_link_libraries(kfileitemmodeltest dolphinprivate ${KDE4_KIO_LIBS} ${QT_QTTEST_LIBRARY})
+
+add_executable(kfileitemmodeltest ${kfileitemmodeltest_SRCS})
+add_test(kfileitemmodeltest kfileitemmodeltest)
+ecm_mark_as_test(kfileitemmodeltest)
+target_link_libraries(kfileitemmodeltest dolphinprivate Qt5::Test)
# KFileItemModelBenchmark
set(kfileitemmodelbenchmark_SRCS
../kitemviews/kfileitemmodel.cpp
../kitemviews/kitemmodelbase.cpp
)
-kde4_add_executable(kfileitemmodelbenchmark TEST ${kfileitemmodelbenchmark_SRCS})
-target_link_libraries(kfileitemmodelbenchmark dolphinprivate ${KDE4_KIO_LIBS} ${QT_QTTEST_LIBRARY})
+
+add_executable(kfileitemmodelbenchmark ${kfileitemmodelbenchmark_SRCS})
+ecm_mark_as_test(kfileitemmodelbenchmark)
+target_link_libraries(kfileitemmodelbenchmark dolphinprivate Qt5::Test)
# KItemListKeyboardSearchManagerTest
set(kitemlistkeyboardsearchmanagertest_SRCS
kitemlistkeyboardsearchmanagertest.cpp
../kitemviews/private/kitemlistkeyboardsearchmanager.cpp
)
-kde4_add_unit_test(kitemlistkeyboardsearchmanagertest TEST ${kitemlistkeyboardsearchmanagertest_SRCS})
-target_link_libraries(kitemlistkeyboardsearchmanagertest ${KDE4_KIO_LIBS} ${QT_QTTEST_LIBRARY})
+
+add_executable(kitemlistkeyboardsearchmanagertest ${kitemlistkeyboardsearchmanagertest_SRCS})
+add_test(kitemlistkeyboardsearchmanagertest kitemlistkeyboardsearchmanagertest)
+ecm_mark_as_test(kitemlistkeyboardsearchmanagertest)
+target_link_libraries(kitemlistkeyboardsearchmanagertest dolphinprivate Qt5::Test)
# DolphinSearchBox
-if (Baloo_FOUND)
+if (KF5Baloo_FOUND)
set(dolphinsearchboxtest_SRCS
dolphinsearchboxtest.cpp
../search/dolphinfacetswidget.cpp
../search/dolphinsearchbox.cpp
)
- kde4_add_kcfg_files(dolphinsearchboxtest_SRCS
+ kconfig_add_kcfg_files(dolphinsearchboxtest_SRCS
../search/dolphin_searchsettings.kcfgc
)
- kde4_add_unit_test(dolphinsearchboxtest TEST ${dolphinsearchboxtest_SRCS})
- target_link_libraries(dolphinsearchboxtest ${KDE4_KIO_LIBS} ${BALOO_LIBRARIES} ${QT_QTTEST_LIBRARY})
-endif (Baloo_FOUND)
+
+ add_executable(dolphinsearchboxtest ${dolphinsearchboxtest_SRCS})
+ add_test(dolphinsearchboxtest dolphinsearchboxtest)
+ ecm_mark_as_test(dolphinsearchboxtest)
+ target_link_libraries(dolphinsearchboxtest dolphinprivate Qt5::Test)
+endif()
# KStandardItemModelTest
set(kstandarditemmodeltest_SRCS
../kitemviews/kstandarditemmodel.cpp
../kitemviews/kitemmodelbase.cpp
)
-kde4_add_unit_test(kstandarditemmodeltest TEST ${kstandarditemmodeltest_SRCS})
-target_link_libraries(kstandarditemmodeltest dolphinprivate ${KDE4_KIO_LIBS} ${QT_QTTEST_LIBRARY})
+
+add_executable(kstandarditemmodeltest ${kstandarditemmodeltest_SRCS})
+add_test(kstandarditemmodeltest kstandarditemmodeltest)
+ecm_mark_as_test(kstandarditemmodeltest)
+target_link_libraries(kstandarditemmodeltest dolphinprivate Qt5::Test)
# ViewPropertiesTest
set(viewpropertiestest_SRCS
testdir.cpp
../views/viewproperties.cpp
)
-kde4_add_kcfg_files(viewpropertiestest_SRCS
+kconfig_add_kcfg_files(viewpropertiestest_SRCS
../settings/dolphin_generalsettings.kcfgc
../settings/dolphin_directoryviewpropertysettings.kcfgc
)
-kde4_add_unit_test(viewpropertiestest TEST ${viewpropertiestest_SRCS})
-target_link_libraries(viewpropertiestest dolphinprivate ${KDE4_KIO_LIBS} ${QT_QTTEST_LIBRARY})
+
+add_executable(viewpropertiestest ${viewpropertiestest_SRCS})
+add_test(viewpropertiestest viewpropertiestest)
+ecm_mark_as_test(viewpropertiestest)
+target_link_libraries(viewpropertiestest dolphinprivate Qt5::Test)
#include "dolphinfileitemlistwidget.h"
-#include <KIcon>
+#include <QIcon>
#include <KIconLoader>
#include <kversioncontrolplugin2.h>
#include <QColor>
break;
}
- return KIcon(iconName).pixmap(QSize(overlayHeight, overlayHeight));
+ return QIcon::fromTheme(iconName).pixmap(QSize(overlayHeight, overlayHeight));
}
-#include "dolphinfileitemlistwidget.moc"
#include <kitemviews/kitemliststyleoption.h>
#include <KGlobalSettings>
+#include <KGlobal>
#include <views/viewmodecontroller.h>
updateFont();
updateGridSize();
- const KConfigGroup globalConfig(KGlobal::config(), "PreviewSettings");
+ const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
const QStringList plugins = globalConfig.readEntry("Plugins", QStringList()
<< "directorythumbnail"
<< "imagethumbnail"
void DolphinItemListView::writeSettings()
{
- IconsModeSettings::self()->writeConfig();
- CompactModeSettings::self()->writeConfig();
- DetailsModeSettings::self()->writeConfig();
+ IconsModeSettings::self()->save();
+ CompactModeSettings::self()->save();
+ DetailsModeSettings::self()->save();
}
KItemListWidgetCreatorBase* DolphinItemListView::defaultWidgetCreator() const
return mode;
}
-#include "dolphinitemlistview.moc"
void DolphinNewFileMenuObserver::attach(const DolphinNewFileMenu* menu)
{
- connect(menu, SIGNAL(fileCreated(KUrl)),
- this, SIGNAL(itemCreated(KUrl)));
- connect(menu, SIGNAL(directoryCreated(KUrl)),
- this, SIGNAL(itemCreated(KUrl)));
- connect(menu, SIGNAL(errorMessage(QString)),
- this, SIGNAL(errorMessage(QString)));
+ connect(menu, &DolphinNewFileMenu::fileCreated,
+ this, &DolphinNewFileMenuObserver::itemCreated);
+ connect(menu, &DolphinNewFileMenu::directoryCreated,
+ this, &DolphinNewFileMenuObserver::itemCreated);
+ connect(menu, &DolphinNewFileMenu::errorMessage,
+ this, &DolphinNewFileMenuObserver::errorMessage);
}
void DolphinNewFileMenuObserver::detach(const DolphinNewFileMenu* menu)
{
- disconnect(menu, SIGNAL(fileCreated(KUrl)),
- this, SIGNAL(itemCreated(KUrl)));
- disconnect(menu, SIGNAL(directoryCreated(KUrl)),
- this, SIGNAL(itemCreated(KUrl)));
- disconnect(menu, SIGNAL(errorMessage(QString)),
- this, SIGNAL(errorMessage(QString)));
+ disconnect(menu, &DolphinNewFileMenu::fileCreated,
+ this, &DolphinNewFileMenuObserver::itemCreated);
+ disconnect(menu, &DolphinNewFileMenu::directoryCreated,
+ this, &DolphinNewFileMenuObserver::itemCreated);
+ disconnect(menu, &DolphinNewFileMenu::errorMessage,
+ this, &DolphinNewFileMenuObserver::errorMessage);
}
DolphinNewFileMenuObserver::DolphinNewFileMenuObserver() :
{
}
-#include "dolphinnewfilemenuobserver.moc"
#include "libdolphin_export.h"
class DolphinNewFileMenu;
-class KUrl;
/**
* @brief Allows to observe new file items that have been created
void detach(const DolphinNewFileMenu* menu);
signals:
- void itemCreated(const KUrl& url);
+ void itemCreated(const QUrl& url);
void errorMessage(const QString& error);
private:
#include <KDebug>
#include <KActionMenu>
#include <KActionCollection>
-#include <KIcon>
+#include <QIcon>
#include <KLocale>
#include <KGlobal>
#include <KMimeType>
#include <KConfig>
#include <KCharsets>
-#include <KMenu>
+#include <QMenu>
#include <KProtocolInfo>
#include <KProtocolManager>
#include <KIO/Scheduler>
m_loaded(false),
m_idDefault(0)
{
- m_menu = new KActionMenu(KIcon("character-set"), i18n("Select Remote Charset"), this);
+ m_menu = new KActionMenu(QIcon::fromTheme("character-set"), i18n("Select Remote Charset"), this);
m_actionHandler->actionCollection()->addAction("change_remote_encoding", m_menu);
- connect(m_menu->menu(), SIGNAL(aboutToShow()),
- this, SLOT(slotAboutToShow()));
+ connect(m_menu->menu(), &QMenu::aboutToShow,
+ this, &DolphinRemoteEncoding::slotAboutToShow);
m_menu->setEnabled(false);
m_menu->setDelayed(false);
void DolphinRemoteEncoding::loadSettings()
{
m_loaded = true;
- m_encodingDescriptions = KGlobal::charsets()->descriptiveEncodingNames();
+ m_encodingDescriptions = KCharsets::charsets()->descriptiveEncodingNames();
fillMenu();
}
void DolphinRemoteEncoding::fillMenu()
{
- KMenu* menu = m_menu->menu();
+ QMenu* menu = m_menu->menu();
menu->clear();
menu->addAction(i18n("Default"), this, SLOT(slotDefault()), 0)->setCheckable(true);
m_idDefault = m_encodingDescriptions.size() + 2;
- connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(slotItemSelected(QAction*)));
+ connect(menu, &QMenu::triggered, this, &DolphinRemoteEncoding::slotItemSelected);
}
void DolphinRemoteEncoding::updateMenu()
m_menu->menu()->actions().at(i)->setChecked(false);
}
- const QString charset = KGlobal::charsets()->descriptionForEncoding(KProtocolManager::charsetFor(m_currentURL));
+ const QString charset = KCharsets::charsets()->descriptionForEncoding(KProtocolManager::charsetFor(m_currentURL));
if (!charset.isEmpty()) {
int id = 0;
bool isFound = false;
KConfig config(("kio_" + m_currentURL.protocol() + "rc").toLatin1());
QString host = m_currentURL.host();
if (m_menu->menu()->actions().at(id)->isChecked()) {
- QString charset = KGlobal::charsets()->encodingForName(m_encodingDescriptions.at(id));
+ QString charset = KCharsets::charsets()->encodingForName(m_encodingDescriptions.at(id));
KConfigGroup cg(&config, host);
cg.writeEntry(DATA_KEY, charset);
config.sync();
m_actionHandler->currentView()->reload();
}
-#include "dolphinremoteencoding.moc"
#include <QItemSelection>
#include <QTimer>
#include <QScrollBar>
+#include <QPointer>
+#include <QMenu>
#include <KDesktopFile>
#include <KProtocolManager>
#include <kitemviews/kitemlistselectionmanager.h>
#include <kitemviews/kitemlistview.h>
#include <kitemviews/kitemlistcontroller.h>
+#include <KIO/CopyJob>
#include <KIO/DeleteJob>
#include <KIO/JobUiDelegate>
#include <KIO/NetAccess>
#include <KIO/PreviewJob>
+#include <KIO/Paste>
#include <KJob>
-#include <KMenu>
+#include <QMenu>
+#include <KGlobal>
#include <KMessageBox>
-#include <konq_fileitemcapabilities.h>
+#include <KJobWidgets>
#include <konq_operations.h>
-#include <konqmimedata.h>
#include <KToggleAction>
#include <KUrl>
#include "zoomlevelinfo.h"
#ifdef HAVE_BALOO
- #include <baloo/indexerconfig.h>
+ #include <Baloo/IndexerConfig>
#endif
+#include <KFormat>
namespace {
const int MaxModeEnum = DolphinView::CompactView;
// When a new item has been created by the "Create New..." menu, the item should
// get selected and it must be assured that the item will get visible. As the
// creation is done asynchronously, several signals must be checked:
- connect(&DolphinNewFileMenuObserver::instance(), SIGNAL(itemCreated(KUrl)),
- this, SLOT(observeCreatedItem(KUrl)));
+ connect(&DolphinNewFileMenuObserver::instance(), &DolphinNewFileMenuObserver::itemCreated,
+ this, &DolphinView::observeCreatedItem);
m_selectionChangedTimer = new QTimer(this);
m_selectionChangedTimer->setSingleShot(true);
m_selectionChangedTimer->setInterval(300);
- connect(m_selectionChangedTimer, SIGNAL(timeout()),
- this, SLOT(emitSelectionChangedSignal()));
+ connect(m_selectionChangedTimer, &QTimer::timeout,
+ this, &DolphinView::emitSelectionChangedSignal);
m_model = new KFileItemModel(this);
m_view = new DolphinItemListView();
m_container = new KItemListContainer(controller, this);
m_container->installEventFilter(this);
setFocusProxy(m_container);
- connect(m_container->horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(hideToolTip()));
- connect(m_container->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(hideToolTip()));
+ connect(m_container->horizontalScrollBar(), &QScrollBar::valueChanged, this, &DolphinView::hideToolTip);
+ connect(m_container->verticalScrollBar(), &QScrollBar::valueChanged, this, &DolphinView::hideToolTip);
controller->setSelectionBehavior(KItemListController::MultiSelection);
- connect(controller, SIGNAL(itemActivated(int)), this, SLOT(slotItemActivated(int)));
- connect(controller, SIGNAL(itemsActivated(KItemSet)), this, SLOT(slotItemsActivated(KItemSet)));
- connect(controller, SIGNAL(itemMiddleClicked(int)), this, SLOT(slotItemMiddleClicked(int)));
- connect(controller, SIGNAL(itemContextMenuRequested(int,QPointF)), this, SLOT(slotItemContextMenuRequested(int,QPointF)));
- connect(controller, SIGNAL(viewContextMenuRequested(QPointF)), this, SLOT(slotViewContextMenuRequested(QPointF)));
- connect(controller, SIGNAL(headerContextMenuRequested(QPointF)), this, SLOT(slotHeaderContextMenuRequested(QPointF)));
- connect(controller, SIGNAL(mouseButtonPressed(int,Qt::MouseButtons)), this, SLOT(slotMouseButtonPressed(int,Qt::MouseButtons)));
- connect(controller, SIGNAL(itemHovered(int)), this, SLOT(slotItemHovered(int)));
- connect(controller, SIGNAL(itemUnhovered(int)), this, SLOT(slotItemUnhovered(int)));
- connect(controller, SIGNAL(itemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotItemDropEvent(int,QGraphicsSceneDragDropEvent*)));
- connect(controller, SIGNAL(escapePressed()), this, SLOT(stopLoading()));
- connect(controller, SIGNAL(modelChanged(KItemModelBase*,KItemModelBase*)), this, SLOT(slotModelChanged(KItemModelBase*,KItemModelBase*)));
-
- connect(m_model, SIGNAL(directoryLoadingStarted()), this, SLOT(slotDirectoryLoadingStarted()));
- connect(m_model, SIGNAL(directoryLoadingCompleted()), this, SLOT(slotDirectoryLoadingCompleted()));
- connect(m_model, SIGNAL(directoryLoadingCanceled()), this, SIGNAL(directoryLoadingCanceled()));
- connect(m_model, SIGNAL(directoryLoadingProgress(int)), this, SIGNAL(directoryLoadingProgress(int)));
- connect(m_model, SIGNAL(directorySortingProgress(int)), this, SIGNAL(directorySortingProgress(int)));
- connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(slotItemsChanged()));
- connect(m_model, SIGNAL(itemsRemoved(KItemRangeList)), this, SIGNAL(itemCountChanged()));
- connect(m_model, SIGNAL(itemsInserted(KItemRangeList)), this, SIGNAL(itemCountChanged()));
- connect(m_model, SIGNAL(infoMessage(QString)), this, SIGNAL(infoMessage(QString)));
- connect(m_model, SIGNAL(errorMessage(QString)), this, SIGNAL(errorMessage(QString)));
- connect(m_model, SIGNAL(directoryRedirection(KUrl,KUrl)), this, SLOT(slotDirectoryRedirection(KUrl,KUrl)));
- connect(m_model, SIGNAL(urlIsFileError(KUrl)), this, SIGNAL(urlIsFileError(KUrl)));
+ connect(controller, &KItemListController::itemActivated, this, &DolphinView::slotItemActivated);
+ connect(controller, &KItemListController::itemsActivated, this, &DolphinView::slotItemsActivated);
+ connect(controller, &KItemListController::itemMiddleClicked, this, &DolphinView::slotItemMiddleClicked);
+ connect(controller, &KItemListController::itemContextMenuRequested, this, &DolphinView::slotItemContextMenuRequested);
+ connect(controller, &KItemListController::viewContextMenuRequested, this, &DolphinView::slotViewContextMenuRequested);
+ connect(controller, &KItemListController::headerContextMenuRequested, this, &DolphinView::slotHeaderContextMenuRequested);
+ connect(controller, &KItemListController::mouseButtonPressed, this, &DolphinView::slotMouseButtonPressed);
+ connect(controller, &KItemListController::itemHovered, this, &DolphinView::slotItemHovered);
+ connect(controller, &KItemListController::itemUnhovered, this, &DolphinView::slotItemUnhovered);
+ connect(controller, &KItemListController::itemDropEvent, this, &DolphinView::slotItemDropEvent);
+ connect(controller, &KItemListController::escapePressed, this, &DolphinView::stopLoading);
+ connect(controller, &KItemListController::modelChanged, this, &DolphinView::slotModelChanged);
+
+ connect(m_model, &KFileItemModel::directoryLoadingStarted, this, &DolphinView::slotDirectoryLoadingStarted);
+ connect(m_model, &KFileItemModel::directoryLoadingCompleted, this, &DolphinView::slotDirectoryLoadingCompleted);
+ connect(m_model, &KFileItemModel::directoryLoadingCanceled, this, &DolphinView::directoryLoadingCanceled);
+ connect(m_model, &KFileItemModel::directoryLoadingProgress, this, &DolphinView::directoryLoadingProgress);
+ connect(m_model, &KFileItemModel::directorySortingProgress, this, &DolphinView::directorySortingProgress);
+ connect(m_model, &KFileItemModel::itemsChanged,
+ this, &DolphinView::slotItemsChanged);
+ connect(m_model, &KFileItemModel::itemsRemoved, this, &DolphinView::itemCountChanged);
+ connect(m_model, &KFileItemModel::itemsInserted, this, &DolphinView::itemCountChanged);
+ connect(m_model, &KFileItemModel::infoMessage, this, &DolphinView::infoMessage);
+ connect(m_model, &KFileItemModel::errorMessage, this, &DolphinView::errorMessage);
+ connect(m_model, &KFileItemModel::directoryRedirection, this, &DolphinView::slotDirectoryRedirection);
+ connect(m_model, &KFileItemModel::urlIsFileError, this, &DolphinView::urlIsFileError);
m_view->installEventFilter(this);
- connect(m_view, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
- this, SLOT(slotSortOrderChangedByHeader(Qt::SortOrder,Qt::SortOrder)));
- connect(m_view, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
- this, SLOT(slotSortRoleChangedByHeader(QByteArray,QByteArray)));
- connect(m_view, SIGNAL(visibleRolesChanged(QList<QByteArray>,QList<QByteArray>)),
- this, SLOT(slotVisibleRolesChangedByHeader(QList<QByteArray>,QList<QByteArray>)));
- connect(m_view, SIGNAL(roleEditingCanceled(int,QByteArray,QVariant)),
- this, SLOT(slotRoleEditingCanceled()));
- connect(m_view->header(), SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)),
- this, SLOT(slotHeaderColumnWidthChanged(QByteArray,qreal,qreal)));
+ connect(m_view, &DolphinItemListView::sortOrderChanged,
+ this, &DolphinView::slotSortOrderChangedByHeader);
+ connect(m_view, &DolphinItemListView::sortRoleChanged,
+ this, &DolphinView::slotSortRoleChangedByHeader);
+ connect(m_view, &DolphinItemListView::visibleRolesChanged,
+ this, &DolphinView::slotVisibleRolesChangedByHeader);
+ connect(m_view, &DolphinItemListView::roleEditingCanceled,
+ this, &DolphinView::slotRoleEditingCanceled);
+ connect(m_view->header(), &KItemListHeader::columnWidthChanged,
+ this, &DolphinView::slotHeaderColumnWidthChanged);
KItemListSelectionManager* selectionManager = controller->selectionManager();
- connect(selectionManager, SIGNAL(selectionChanged(KItemSet,KItemSet)),
- this, SLOT(slotSelectionChanged(KItemSet,KItemSet)));
+ connect(selectionManager, &KItemListSelectionManager::selectionChanged,
+ this, &DolphinView::slotSelectionChanged);
m_toolTipManager = new ToolTipManager(this);
m_versionControlObserver = new VersionControlObserver(this);
m_versionControlObserver->setModel(m_model);
- connect(m_versionControlObserver, SIGNAL(infoMessage(QString)), this, SIGNAL(infoMessage(QString)));
- connect(m_versionControlObserver, SIGNAL(errorMessage(QString)), this, SIGNAL(errorMessage(QString)));
- connect(m_versionControlObserver, SIGNAL(operationCompletedMessage(QString)), this, SIGNAL(operationCompletedMessage(QString)));
+ connect(m_versionControlObserver, &VersionControlObserver::infoMessage, this, &DolphinView::infoMessage);
+ connect(m_versionControlObserver, &VersionControlObserver::errorMessage, this, &DolphinView::errorMessage);
+ connect(m_versionControlObserver, &VersionControlObserver::operationCompletedMessage, this, &DolphinView::operationCompletedMessage);
applyViewProperties();
m_topLayout->addWidget(m_container);
const KFileItemList itemList = selectedItems();
m_selectedUrls.clear();
- m_selectedUrls = itemList.urlList();
+ m_selectedUrls = KUrl::List(itemList.urlList());
ViewProperties props(viewPropertiesUrl());
props.setHiddenFilesShown(show);
const KFileItemList itemList = selectedItems();
m_selectedUrls.clear();
- m_selectedUrls = itemList.urlList();
+ m_selectedUrls = KUrl::List(itemList.urlList());
setUrl(url());
loadDirectory(url(), true);
{
const int oldZoomLevel = m_view->zoomLevel();
- GeneralSettings::self()->readConfig();
+ GeneralSettings::self()->load();
m_view->readSettings();
applyViewProperties();
void DolphinView::writeSettings()
{
- GeneralSettings::self()->writeConfig();
+ GeneralSettings::self()->save();
m_view->writeSettings();
}
if (fileCount > 0 && folderCount > 0) {
summary = i18nc("@info:status folders, files (size)", "%1, %2 (%3)",
foldersText, filesText,
- KGlobal::locale()->formatByteSize(totalFileSize));
+ KFormat().formatByteSize(totalFileSize));
} else if (fileCount > 0) {
summary = i18nc("@info:status files (size)", "%1 (%2)",
filesText,
- KGlobal::locale()->formatByteSize(totalFileSize));
+ KFormat().formatByteSize(totalFileSize));
} else if (folderCount > 0) {
summary = foldersText;
} else {
hideToolTip();
- disconnect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
- this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
+ disconnect(m_view, &DolphinItemListView::roleEditingFinished,
+ this, &DolphinView::slotRoleEditingFinished);
// It is important to clear the items from the model before
// applying the view properties, otherwise expensive operations
hideToolTip();
- connect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
- this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
+ connect(m_view, &DolphinItemListView::roleEditingFinished,
+ this, &DolphinView::slotRoleEditingFinished);
} else {
RenameDialog* dialog = new RenameDialog(this, items);
dialog->setAttribute(Qt::WA_DeleteOnClose);
void DolphinView::trashSelectedItems()
{
const KUrl::List list = simplifiedSelectedUrls();
- KonqOperations::del(this, KonqOperations::TRASH, list);
+ KIO::JobUiDelegate uiDelegate;
+ uiDelegate.setWindow(window());
+ if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Trash, KIO::JobUiDelegate::DefaultConfirmation)) {
+ KIO::Job* job = KIO::trash(list);
+ KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, KUrl("trash:/"), job);
+ KJobWidgets::setWindow(job, this);
+ connect(job, &KIO::Job::result,
+ this, &DolphinView::slotTrashFileFinished);
+ }
}
void DolphinView::deleteSelectedItems()
{
const KUrl::List list = simplifiedSelectedUrls();
- const bool del = KonqOperations::askDeleteConfirmation(list,
- KonqOperations::DEL,
- KonqOperations::DEFAULT_CONFIRMATION,
- this);
- if (del) {
+ KIO::JobUiDelegate uiDelegate;
+ uiDelegate.setWindow(window());
+ if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) {
KIO::Job* job = KIO::del(list);
- if (job->ui()) {
- job->ui()->setWindow(this);
- }
- connect(job, SIGNAL(result(KJob*)),
- this, SLOT(slotDeleteFileFinished(KJob*)));
+ KJobWidgets::setWindow(job, this);
+ connect(job, &KIO::Job::result,
+ this, &DolphinView::slotDeleteFileFinished);
}
}
void DolphinView::cutSelectedItems()
{
QMimeData* mimeData = selectionMimeData();
- KonqMimeData::addIsCutSelection(mimeData, true);
+ KIO::setClipboardDataCut(mimeData, true);
QApplication::clipboard()->setMimeData(mimeData);
}
{
ViewProperties props(viewPropertiesUrl());
- QPointer<KMenu> menu = new KMenu(QApplication::activeWindow());
+ QPointer<QMenu> menu = new QMenu(QApplication::activeWindow());
KItemListView* view = m_container->controller()->view();
const QSet<QByteArray> visibleRolesSet = view->visibleRoles().toSet();
// Mark the dropped urls as selected.
m_clearSelectionBeforeSelectingNewItems = true;
m_markFirstNewlySelectedItemAsCurrent = true;
- connect(op, SIGNAL(aboutToCreate(KUrl::List)), this, SLOT(slotAboutToCreate(KUrl::List)));
+ connect(op, static_cast<void(KonqOperations::*)(const KUrl::List&)>(&KonqOperations::aboutToCreate), this, &DolphinView::slotAboutToCreate);
}
setActive(true);
void DolphinView::slotModelChanged(KItemModelBase* current, KItemModelBase* previous)
{
if (previous != 0) {
- disconnect(previous, SIGNAL(directoryLoadingCompleted()), this, SLOT(slotDirectoryLoadingCompleted()));
+ Q_ASSERT(qobject_cast<KFileItemModel*>(previous));
+ KFileItemModel* fileItemModel = static_cast<KFileItemModel*>(previous);
+ disconnect(fileItemModel, &KFileItemModel::directoryLoadingCompleted, this, &DolphinView::slotDirectoryLoadingCompleted);
m_versionControlObserver->setModel(0);
}
if (current) {
Q_ASSERT(qobject_cast<KFileItemModel*>(current));
- connect(current, SIGNAL(loadingCompleted()), this, SLOT(slotDirectoryLoadingCompleted()));
-
KFileItemModel* fileItemModel = static_cast<KFileItemModel*>(current);
+ connect(fileItemModel, &KFileItemModel::directoryLoadingCompleted, this, &DolphinView::slotDirectoryLoadingCompleted);
m_versionControlObserver->setModel(fileItemModel);
}
}
hideToolTip();
- // TODO: Qt5: Replace Qt::XButton1 by Qt::BackButton and Qt::XButton2 by Qt::ForwardButton
- if (buttons & Qt::XButton1) {
+ if (buttons & Qt::BackButton) {
emit goBackRequested();
- } else if (buttons & Qt::XButton2) {
+ } else if (buttons & Qt::ForwardButton) {
emit goForwardRequested();
}
}
markUrlAsCurrent(urls.first());
m_markFirstNewlySelectedItemAsCurrent = false;
}
- m_selectedUrls << KDirModel::simplifiedUrlList(urls);
+ m_selectedUrls << KUrl::List(KDirModel::simplifiedUrlList(urls));
}
}
}
}
+void DolphinView::slotTrashFileFinished(KJob* job)
+{
+ if (job->error() == 0) {
+ emit operationCompletedMessage(i18nc("@info:status", "Trash operation completed."));
+ } else if (job->error() != KIO::ERR_USER_CANCELED) {
+ emit errorMessage(job->errorString());
+ }
+}
+
void DolphinView::slotDeleteFileFinished(KJob* job)
{
if (job->error() == 0) {
}
}
-void DolphinView::slotRenamingFailed(const KUrl& oldUrl, const KUrl& newUrl)
+void DolphinView::slotRenamingResult(KJob* job)
{
- const int index = m_model->index(newUrl);
- if (index >= 0) {
- QHash<QByteArray, QVariant> data;
- data.insert("text", oldUrl.fileName());
- m_model->setData(index, data);
+ if (job->error()) {
+ KIO::CopyJob *copyJob = qobject_cast<KIO::CopyJob *>(job);
+ Q_ASSERT(copyJob);
+ const QUrl newUrl = copyJob->destUrl();
+ const int index = m_model->index(KUrl(newUrl));
+ if (index >= 0) {
+ QHash<QByteArray, QVariant> data;
+ const QUrl oldUrl = copyJob->srcUrls().first();
+ data.insert("text", oldUrl.fileName());
+ m_model->setData(index, data);
+ }
}
}
void DolphinView::slotRoleEditingCanceled()
{
- disconnect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
- this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
+ disconnect(m_view, &DolphinItemListView::roleEditingFinished,
+ this, &DolphinView::slotRoleEditingFinished);
}
void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value)
{
- disconnect(m_view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
- this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
+ disconnect(m_view, &DolphinItemListView::roleEditingFinished,
+ this, &DolphinView::slotRoleEditingFinished);
if (index < 0 || index >= m_model->count()) {
return;
if (!newName.isEmpty() && newName != oldItem.text() && newName != QLatin1String(".") && newName != QLatin1String("..")) {
const KUrl oldUrl = oldItem.url();
- const KUrl newUrl(url().path(KUrl::AddTrailingSlash) + newName);
- const bool newNameExistsAlready = (m_model->index(newUrl) >= 0);
+ QUrl newUrl = oldUrl.adjusted(QUrl::RemoveFilename);
+ newUrl.setPath(newUrl.path() + KIO::encodeFileName(newName));
+
+ const bool newNameExistsAlready = (m_model->index(KUrl(newUrl)) >= 0);
if (!newNameExistsAlready) {
// Only change the data in the model if no item with the new name
// is in the model yet. If there is an item with the new name
- // already, calling KonqOperations::rename() will open a dialog
+ // already, calling KIO::CopyJob will open a dialog
// asking for a new name, and KFileItemModel will update the
// data when the dir lister signals that the file name has changed.
QHash<QByteArray, QVariant> data;
m_model->setData(index, data);
}
- KonqOperations* op = KonqOperations::renameV2(this, oldUrl, newName);
- if (op && !newNameExistsAlready) {
- // Only connect the renamingFailed signal if there is no item with the new name
+ KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
+ KJobWidgets::setWindow(job, this);
+ KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, QList<QUrl>() << oldUrl, newUrl, job);
+ job->ui()->setAutoErrorHandlingEnabled(true);
+
+ if (!newNameExistsAlready) {
+ // Only connect the result signal if there is no item with the new name
// in the model yet, see bug 328262.
- connect(op, SIGNAL(renamingFailed(KUrl,KUrl)), SLOT(slotRenamingFailed(KUrl,KUrl)));
+ connect(job, &KJob::result, this, &DolphinView::slotRenamingResult);
}
}
}
if (op) {
m_clearSelectionBeforeSelectingNewItems = true;
m_markFirstNewlySelectedItemAsCurrent = true;
- connect(op, SIGNAL(aboutToCreate(KUrl::List)), this, SLOT(slotAboutToCreate(KUrl::List)));
+ connect(op, static_cast<void(KonqOperations::*)(const KUrl::List&)>(&KonqOperations::aboutToCreate), this, &DolphinView::slotAboutToCreate);
}
}
return url;
}
-#include "dolphinview.moc"
#include <KFileItemDelegate>
#include <kio/fileundomanager.h>
#include <KIO/Job>
+#include <KUrl>
#include <QBoxLayout>
#include <QKeyEvent>
typedef KIO::FileUndoManager::CommandType CommandType;
class DolphinItemListView;
-class KAction;
-class KActionCollection;
class KFileItemModel;
class KItemListContainer;
class KItemModelBase;
*/
void slotDeleteFileFinished(KJob* job);
- void slotRenamingFailed(const KUrl& oldUrl, const KUrl& newUrl);
+ /**
+ * Indicates in the status bar that the trash operation
+ * of the job \a job has been finished.
+ */
+ void slotTrashFileFinished(KJob* job);
+
+ /**
+ * Invoked when the rename job is done, for error handling.
+ */
+ void slotRenamingResult(KJob* job);
/**
* Invoked when the file item model has started the loading
#include "views/zoomlevelinfo.h"
#include <konq_operations.h>
-#include <KAction>
+#include <QPointer>
+
#include <KActionCollection>
#include <KActionMenu>
#include <kitemviews/kfileitemmodel.h>
#include <KLocale>
-#include <KMenu>
+#include <QMenu>
#include <KNewFileMenu>
#include <KSelectAction>
#include <KToggleAction>
#include <KPropertiesDialog>
-#include <KIcon>
+#include <QIcon>
#include <KDebug>
#ifdef HAVE_BALOO
- #include <baloo/indexerconfig.h>
+ #include <Baloo/IndexerConfig>
#endif
DolphinViewActionHandler::DolphinViewActionHandler(KActionCollection* collection, QObject* parent) :
m_currentView = view;
- connect(view, SIGNAL(modeChanged(DolphinView::Mode,DolphinView::Mode)),
- this, SLOT(updateViewActions()));
- connect(view, SIGNAL(previewsShownChanged(bool)),
- this, SLOT(slotPreviewsShownChanged(bool)));
- connect(view, SIGNAL(sortOrderChanged(Qt::SortOrder)),
- this, SLOT(slotSortOrderChanged(Qt::SortOrder)));
- connect(view, SIGNAL(sortFoldersFirstChanged(bool)),
- this, SLOT(slotSortFoldersFirstChanged(bool)));
- connect(view, SIGNAL(visibleRolesChanged(QList<QByteArray>,QList<QByteArray>)),
- this, SLOT(slotVisibleRolesChanged(QList<QByteArray>,QList<QByteArray>)));
- connect(view, SIGNAL(groupedSortingChanged(bool)),
- this, SLOT(slotGroupedSortingChanged(bool)));
- connect(view, SIGNAL(hiddenFilesShownChanged(bool)),
- this, SLOT(slotHiddenFilesShownChanged(bool)));
- connect(view, SIGNAL(sortRoleChanged(QByteArray)),
- this, SLOT(slotSortRoleChanged(QByteArray)));
- connect(view, SIGNAL(zoomLevelChanged(int,int)),
- this, SLOT(slotZoomLevelChanged(int,int)));
- connect(view, SIGNAL(writeStateChanged(bool)),
- this, SLOT(slotWriteStateChanged(bool)));
+ connect(view, &DolphinView::modeChanged,
+ this, &DolphinViewActionHandler::updateViewActions);
+ connect(view, &DolphinView::previewsShownChanged,
+ this, &DolphinViewActionHandler::slotPreviewsShownChanged);
+ connect(view, &DolphinView::sortOrderChanged,
+ this, &DolphinViewActionHandler::slotSortOrderChanged);
+ connect(view, &DolphinView::sortFoldersFirstChanged,
+ this, &DolphinViewActionHandler::slotSortFoldersFirstChanged);
+ connect(view, &DolphinView::visibleRolesChanged,
+ this, &DolphinViewActionHandler::slotVisibleRolesChanged);
+ connect(view, &DolphinView::groupedSortingChanged,
+ this, &DolphinViewActionHandler::slotGroupedSortingChanged);
+ connect(view, &DolphinView::hiddenFilesShownChanged,
+ this, &DolphinViewActionHandler::slotHiddenFilesShownChanged);
+ connect(view, &DolphinView::sortRoleChanged,
+ this, &DolphinViewActionHandler::slotSortRoleChanged);
+ connect(view, &DolphinView::zoomLevelChanged,
+ this, &DolphinViewActionHandler::slotZoomLevelChanged);
+ connect(view, &DolphinView::writeStateChanged,
+ this, &DolphinViewActionHandler::slotWriteStateChanged);
}
DolphinView* DolphinViewActionHandler::currentView()
{
// This action doesn't appear in the GUI, it's for the shortcut only.
// KNewFileMenu takes care of the GUI stuff.
- KAction* newDirAction = m_actionCollection->addAction("create_dir");
+ QAction* newDirAction = m_actionCollection->addAction("create_dir");
newDirAction->setText(i18nc("@action", "Create Folder..."));
- newDirAction->setShortcut(Qt::Key_F10);
- newDirAction->setIcon(KIcon("folder-new"));
+ m_actionCollection->setDefaultShortcut(newDirAction, Qt::Key_F10);
+ newDirAction->setIcon(QIcon::fromTheme("folder-new"));
newDirAction->setEnabled(false); // Will be enabled in slotWriteStateChanged(bool) if the current URL is writable
- connect(newDirAction, SIGNAL(triggered()), this, SIGNAL(createDirectory()));
+ connect(newDirAction, &QAction::triggered, this, &DolphinViewActionHandler::createDirectory);
// File menu
- KAction* rename = m_actionCollection->addAction("rename");
+ QAction* rename = m_actionCollection->addAction("rename");
rename->setText(i18nc("@action:inmenu File", "Rename..."));
- rename->setShortcut(Qt::Key_F2);
- rename->setIcon(KIcon("edit-rename"));
- connect(rename, SIGNAL(triggered()), this, SLOT(slotRename()));
+ m_actionCollection->setDefaultShortcut(rename, Qt::Key_F2);
+ rename->setIcon(QIcon::fromTheme("edit-rename"));
+ connect(rename, &QAction::triggered, this, &DolphinViewActionHandler::slotRename);
- KAction* moveToTrash = m_actionCollection->addAction("move_to_trash");
+ QAction* moveToTrash = m_actionCollection->addAction("move_to_trash");
moveToTrash->setText(i18nc("@action:inmenu File", "Move to Trash"));
- moveToTrash->setIcon(KIcon("user-trash"));
- moveToTrash->setShortcut(QKeySequence::Delete);
- connect(moveToTrash, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)),
- this, SLOT(slotTrashActivated(Qt::MouseButtons,Qt::KeyboardModifiers)));
+ moveToTrash->setIcon(QIcon::fromTheme("user-trash"));
+ m_actionCollection->setDefaultShortcut(moveToTrash, QKeySequence::Delete);
+ connect(moveToTrash, &QAction::triggered,
+ this, &DolphinViewActionHandler::slotTrashActivated);
- KAction* deleteAction = m_actionCollection->addAction("delete");
- deleteAction->setIcon(KIcon("edit-delete"));
+ QAction* deleteAction = m_actionCollection->addAction("delete");
+ deleteAction->setIcon(QIcon::fromTheme("edit-delete"));
deleteAction->setText(i18nc("@action:inmenu File", "Delete"));
- deleteAction->setShortcut(Qt::SHIFT | Qt::Key_Delete);
- connect(deleteAction, SIGNAL(triggered()), this, SLOT(slotDeleteItems()));
+ m_actionCollection->setDefaultShortcut(deleteAction, Qt::SHIFT | Qt::Key_Delete);
+ connect(deleteAction, &QAction::triggered, this, &DolphinViewActionHandler::slotDeleteItems);
// This action is useful for being enabled when "move_to_trash" should be
// disabled and "delete" is enabled (e.g. non-local files), so that Key_Del
// can be used for deleting the file (#76016). It needs to be a separate action
// so that the Edit menu isn't affected.
- KAction* deleteWithTrashShortcut = m_actionCollection->addAction("delete_shortcut");
+ QAction* deleteWithTrashShortcut = m_actionCollection->addAction("delete_shortcut");
// The descriptive text is just for the shortcuts editor.
deleteWithTrashShortcut->setText(i18nc("@action \"Move to Trash\" for non-local files, etc.", "Delete (using shortcut for Trash)"));
- deleteWithTrashShortcut->setShortcut(QKeySequence::Delete);
+ m_actionCollection->setDefaultShortcut(deleteWithTrashShortcut, QKeySequence::Delete);
deleteWithTrashShortcut->setEnabled(false);
- connect(deleteWithTrashShortcut, SIGNAL(triggered()), this, SLOT(slotDeleteItems()));
+ connect(deleteWithTrashShortcut, &QAction::triggered, this, &DolphinViewActionHandler::slotDeleteItems);
- KAction *propertiesAction = m_actionCollection->addAction( "properties" );
+ QAction *propertiesAction = m_actionCollection->addAction( "properties" );
// Well, it's the File menu in dolphinmainwindow and the Edit menu in dolphinpart... :)
propertiesAction->setText( i18nc("@action:inmenu File", "Properties") );
- propertiesAction->setIcon(KIcon("document-properties"));
- propertiesAction->setShortcuts(QList<QKeySequence>() << Qt::ALT + Qt::Key_Return << Qt::ALT + Qt::Key_Enter);
- connect(propertiesAction, SIGNAL(triggered()), SLOT(slotProperties()));
+ propertiesAction->setIcon(QIcon::fromTheme("document-properties"));
+ m_actionCollection->setDefaultShortcuts(propertiesAction, QList<QKeySequence>() << Qt::ALT + Qt::Key_Return << Qt::ALT + Qt::Key_Enter);
+ connect(propertiesAction, &QAction::triggered, this, &DolphinViewActionHandler::slotProperties);
// View menu
KToggleAction* iconsAction = iconsModeAction();
viewModeActions->addAction(compactAction);
viewModeActions->addAction(detailsAction);
viewModeActions->setToolBarMode(KSelectAction::MenuMode);
- connect(viewModeActions, SIGNAL(triggered(QAction*)), this, SLOT(slotViewModeActionTriggered(QAction*)));
+ connect(viewModeActions, static_cast<void(KSelectAction::*)(QAction*)>(&KSelectAction::triggered), this, &DolphinViewActionHandler::slotViewModeActionTriggered);
KStandardAction::zoomIn(this,
SLOT(zoomIn()),
KToggleAction* showPreview = m_actionCollection->add<KToggleAction>("show_preview");
showPreview->setText(i18nc("@action:intoolbar", "Preview"));
showPreview->setToolTip(i18nc("@info", "Show preview of files and folders"));
- showPreview->setIcon(KIcon("view-preview"));
- connect(showPreview, SIGNAL(triggered(bool)), this, SLOT(togglePreview(bool)));
+ showPreview->setIcon(QIcon::fromTheme("view-preview"));
+ connect(showPreview, &KToggleAction::triggered, this, &DolphinViewActionHandler::togglePreview);
KToggleAction* sortDescending = m_actionCollection->add<KToggleAction>("descending");
sortDescending->setText(i18nc("@action:inmenu Sort", "Descending"));
- connect(sortDescending, SIGNAL(triggered()), this, SLOT(toggleSortOrder()));
+ connect(sortDescending, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleSortOrder);
KToggleAction* sortFoldersFirst = m_actionCollection->add<KToggleAction>("folders_first");
sortFoldersFirst->setText(i18nc("@action:inmenu Sort", "Folders First"));
- connect(sortFoldersFirst, SIGNAL(triggered()), this, SLOT(toggleSortFoldersFirst()));
+ connect(sortFoldersFirst, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleSortFoldersFirst);
// View -> Sort By
QActionGroup* sortByActionGroup = createFileItemRolesActionGroup("sort_by_");
}
KToggleAction* showInGroups = m_actionCollection->add<KToggleAction>("show_in_groups");
- showInGroups->setIcon(KIcon("view-group"));
+ showInGroups->setIcon(QIcon::fromTheme("view-group"));
showInGroups->setText(i18nc("@action:inmenu View", "Show in Groups"));
- connect(showInGroups, SIGNAL(triggered(bool)), this, SLOT(toggleGroupedSorting(bool)));
+ connect(showInGroups, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleGroupedSorting);
KToggleAction* showHiddenFiles = m_actionCollection->add<KToggleAction>("show_hidden_files");
showHiddenFiles->setText(i18nc("@action:inmenu View", "Show Hidden Files"));
- showHiddenFiles->setShortcuts(QList<QKeySequence>() << Qt::ALT + Qt::Key_Period << Qt::Key_F8);
- connect(showHiddenFiles, SIGNAL(triggered(bool)), this, SLOT(toggleShowHiddenFiles(bool)));
+ m_actionCollection->setDefaultShortcuts(showHiddenFiles, QList<QKeySequence>() << Qt::ALT + Qt::Key_Period << Qt::Key_F8);
+ connect(showHiddenFiles, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleShowHiddenFiles);
- KAction* adjustViewProps = m_actionCollection->addAction("view_properties");
+ QAction* adjustViewProps = m_actionCollection->addAction("view_properties");
adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Properties..."));
- connect(adjustViewProps, SIGNAL(triggered()), this, SLOT(slotAdjustViewProperties()));
+ connect(adjustViewProps, &QAction::triggered, this, &DolphinViewActionHandler::slotAdjustViewProperties);
}
QActionGroup* DolphinViewActionHandler::createFileItemRolesActionGroup(const QString& groupPrefix)
QActionGroup* rolesActionGroup = new QActionGroup(m_actionCollection);
rolesActionGroup->setExclusive(isSortGroup);
if (isSortGroup) {
- connect(rolesActionGroup, SIGNAL(triggered(QAction*)),
- this, SLOT(slotSortTriggered(QAction*)));
+ connect(rolesActionGroup, &QActionGroup::triggered,
+ this, &DolphinViewActionHandler::slotSortTriggered);
} else {
- connect(rolesActionGroup, SIGNAL(triggered(QAction*)),
- this, SLOT(toggleVisibleRole(QAction*)));
+ connect(rolesActionGroup, &QActionGroup::triggered,
+ this, &DolphinViewActionHandler::toggleVisibleRole);
}
QString groupName;
groupMenuGroup = new QActionGroup(groupMenu);
groupMenuGroup->setExclusive(isSortGroup);
if (isSortGroup) {
- connect(groupMenuGroup, SIGNAL(triggered(QAction*)),
- this, SLOT(slotSortTriggered(QAction*)));
+ connect(groupMenuGroup, &QActionGroup::triggered,
+ this, &DolphinViewActionHandler::slotSortTriggered);
} else {
- connect(groupMenuGroup, SIGNAL(triggered(QAction*)),
- this, SLOT(toggleVisibleRole(QAction*)));
+ connect(groupMenuGroup, &QActionGroup::triggered,
+ this, &DolphinViewActionHandler::toggleVisibleRole);
}
}
m_currentView->setMode(mode);
QAction* viewModeMenu = m_actionCollection->action("view_mode");
- viewModeMenu->setIcon(KIcon(action->icon()));
+ viewModeMenu->setIcon(action->icon());
}
void DolphinViewActionHandler::slotRename()
m_currentView->renameSelectedItems();
}
-void DolphinViewActionHandler::slotTrashActivated(Qt::MouseButtons, Qt::KeyboardModifiers modifiers)
+void DolphinViewActionHandler::slotTrashActivated()
{
emit actionBeingHandled();
m_currentView->trashSelectedItems();
viewModeAction->setChecked(true);
QAction* viewModeMenu = m_actionCollection->action("view_mode");
- viewModeMenu->setIcon(KIcon(viewModeAction->icon()));
+ viewModeMenu->setIcon(viewModeAction->icon());
}
QAction* showPreviewAction = m_actionCollection->action("show_preview");
KToggleAction* iconsView = m_actionCollection->add<KToggleAction>("icons");
iconsView->setText(i18nc("@action:inmenu View Mode", "Icons"));
iconsView->setToolTip(i18nc("@info", "Icons view mode"));
- iconsView->setShortcut(Qt::CTRL | Qt::Key_1);
- iconsView->setIcon(KIcon("view-list-icons"));
+ m_actionCollection->setDefaultShortcut(iconsView, Qt::CTRL | Qt::Key_1);
+ iconsView->setIcon(QIcon::fromTheme("view-list-icons"));
iconsView->setData(QVariant::fromValue(DolphinView::IconsView));
return iconsView;
}
KToggleAction* iconsView = m_actionCollection->add<KToggleAction>("compact");
iconsView->setText(i18nc("@action:inmenu View Mode", "Compact"));
iconsView->setToolTip(i18nc("@info", "Compact view mode"));
- iconsView->setShortcut(Qt::CTRL | Qt::Key_2);
- iconsView->setIcon(KIcon("view-list-details")); // TODO: discuss with Oxygen-team the wrong (?) name
+ m_actionCollection->setDefaultShortcut(iconsView, Qt::CTRL | Qt::Key_2);
+ iconsView->setIcon(QIcon::fromTheme("view-list-details")); // TODO: discuss with Oxygen-team the wrong (?) name
iconsView->setData(QVariant::fromValue(DolphinView::CompactView));
return iconsView;
}
KToggleAction* detailsView = m_actionCollection->add<KToggleAction>("details");
detailsView->setText(i18nc("@action:inmenu View Mode", "Details"));
detailsView->setToolTip(i18nc("@info", "Details view mode"));
- detailsView->setShortcut(Qt::CTRL | Qt::Key_3);
- detailsView->setIcon(KIcon("view-list-tree"));
+ m_actionCollection->setDefaultShortcut(detailsView, Qt::CTRL | Qt::Key_3);
+ detailsView->setIcon(QIcon::fromTheme("view-list-tree"));
detailsView->setData(QVariant::fromValue(DolphinView::DetailsView));
return detailsView;
}
if (!action->icon().isNull()) {
QAction* sortByMenu = m_actionCollection->action("sort");
- sortByMenu->setIcon(KIcon(action->icon()));
+ sortByMenu->setIcon(action->icon());
}
}
}
* Moves the selected items of the active view to the trash.
* This methods adds "shift means del" handling.
*/
- void slotTrashActivated(Qt::MouseButtons, Qt::KeyboardModifiers);
+ void slotTrashActivated();
/**
* Deletes the selected items of the active view.
error.clear();
if (!destItem.isNull() && !destItem.isWritable()) {
- error = i18nc("@info:status", "Access denied. Could not write to <filename>%1</filename>", destUrl.pathOrUrl());
+ error = xi18nc("@info:status", "Access denied. Could not write to <filename>%1</filename>", destUrl.pathOrUrl());
return 0;
}
class KFileItem;
class KUrl;
class QDropEvent;
-class QWidget;
class KonqOperations;
class LIBDOLPHINPRIVATE_EXPORT DragAndDropHelper
#include <KLineEdit>
#include <KLocale>
-#include <konq_operations.h>
+#include <KJobWidgets>
+#include <KJobUiDelegate>
+#include <KIO/CopyJob>
+#include <KIO/FileUndoManager>
#include <KStringHandler>
+#include <kstringhandler_deprecated.h> //TODO port to QCollator
#include <knuminput.h>
#include <kmimetype.h>
#include <QHBoxLayout>
#include <QLabel>
#include <QVBoxLayout>
+#include <QMimeDatabase>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <KGuiItem>
RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
- KDialog(parent),
+ QDialog(parent),
m_renameOneItem(false),
m_newName(),
m_lineEdit(0),
Q_ASSERT(itemCount >= 1);
m_renameOneItem = (itemCount == 1);
- setCaption(m_renameOneItem ?
+ setWindowTitle(m_renameOneItem ?
i18nc("@title:window", "Rename Item") :
i18nc("@title:window", "Rename Items"));
- setButtons(Ok | Cancel);
- setDefaultButton(Ok);
-
- setButtonGuiItem(Ok, KGuiItem(i18nc("@action:button", "&Rename"), "dialog-ok-apply"));
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ m_okButton = buttonBox->button(QDialogButtonBox::Ok);
+ m_okButton->setDefault(true);
+ m_okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotAccepted()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ m_okButton->setDefault(true);
+
+ KGuiItem::assign(m_okButton, KGuiItem(i18nc("@action:button", "&Rename"), "dialog-ok-apply"));
QWidget* page = new QWidget(this);
- setMainWidget(page);
+ mainLayout->addWidget(page);
+ mainLayout->addWidget(buttonBox);
QVBoxLayout* topLayout = new QVBoxLayout(page);
QLabel* editLabel = 0;
if (m_renameOneItem) {
m_newName = items.first().name();
- editLabel = new QLabel(i18nc("@label:textbox", "Rename the item <filename>%1</filename> to:", m_newName),
+ editLabel = new QLabel(xi18nc("@label:textbox", "Rename the item <filename>%1</filename> to:", m_newName),
page);
editLabel->setTextFormat(Qt::PlainText);
} else {
}
m_lineEdit = new KLineEdit(page);
- connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString)));
+ mainLayout->addWidget(m_lineEdit);
+ connect(m_lineEdit, &KLineEdit::textChanged, this, &RenameDialog::slotTextChanged);
int selectionLength = m_newName.length();
if (m_renameOneItem) {
- const QString fileName = items.first().url().prettyUrl();
- const QString extension = KMimeType::extractKnownExtension(fileName.toLower());
+ const QString fileName = items.first().url().toDisplayString();
+ QMimeDatabase db;
+ const QString extension = db.suffixForFileName(fileName.toLower());
// If the current item is a directory, select the whole file name.
if ((extension.length() > 0) && !items.first().isDir()) {
if (!m_renameOneItem) {
QSet<QString> extensions;
foreach (const KFileItem& item, m_items) {
- const QString extension = KMimeType::extractKnownExtension(item.url().prettyUrl().toLower());
+ QMimeDatabase db;
+ const QString extension = db.suffixForFileName(item.url().toDisplayString().toLower());
if (extensions.contains(extension)) {
m_allExtensionsDifferent = false;
}
QLabel* infoLabel = new QLabel(i18nc("@info", "# will be replaced by ascending numbers starting with:"), page);
+ mainLayout->addWidget(infoLabel);
m_spinBox = new KIntSpinBox(0, 10000, 1, 1, page, 10);
QHBoxLayout* horizontalLayout = new QHBoxLayout(page);
{
}
-void RenameDialog::slotButtonClicked(int button)
+void RenameDialog::renameItem(const KFileItem &item, const QString& newName)
{
- if (button == KDialog::Ok) {
- m_newName = m_lineEdit->text();
-
- if (m_renameOneItem) {
- Q_ASSERT(m_items.count() == 1);
- const KUrl oldUrl = m_items.first().url();
- KUrl newUrl = oldUrl;
- newUrl.setFileName(KIO::encodeFileName(m_newName));
-
- QWidget* widget = parentWidget();
- if (!widget) {
- widget = this;
- }
+ const QUrl oldUrl = item.url();
+ QUrl newUrl = oldUrl.adjusted(QUrl::RemoveFilename);
+ newUrl.setPath(newUrl.path() + KIO::encodeFileName(newName));
- KonqOperations::rename(widget, oldUrl, newUrl);
- } else {
- renameItems();
- }
+ QWidget* widget = parentWidget();
+ if (!widget) {
+ widget = this;
}
- KDialog::slotButtonClicked(button);
+ KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
+ KJobWidgets::setWindow(job, widget);
+ KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, QList<QUrl>() << oldUrl, newUrl, job);
+ job->ui()->setAutoErrorHandlingEnabled(true);
+}
+
+void RenameDialog::slotAccepted()
+{
+ m_newName = m_lineEdit->text();
+
+ if (m_renameOneItem) {
+ Q_ASSERT(m_items.count() == 1);
+ renameItem(m_items.first(), m_newName);
+ } else {
+ renameItems();
+ }
+ accept();
}
void RenameDialog::slotTextChanged(const QString& newName)
enable = (last - first + 1 == count);
}
}
- enableButtonOk(enable);
+ m_okButton->setEnabled(enable);
}
void RenameDialog::renameItems()
QString newName = indexedName(m_newName, index, QLatin1Char('#'));
++index;
- const KUrl oldUrl = item.url();
- const QString extension = KMimeType::extractKnownExtension(oldUrl.prettyUrl().toLower());
+ const QUrl oldUrl = item.url();
+ QMimeDatabase db;
+ const QString extension = db.suffixForFileName(oldUrl.path().toLower());
if (!extension.isEmpty()) {
newName.append(QLatin1Char('.'));
newName.append(extension);
}
if (oldUrl.fileName() != newName) {
- KUrl newUrl = oldUrl;
- newUrl.setFileName(KIO::encodeFileName(newName));
-
- QWidget* widget = parentWidget();
- if (!widget) {
- widget = this;
- }
-
- KonqOperations::rename(widget, oldUrl, newUrl);
+ renameItem(item, newName);
}
}
}
return newName;
}
-#include "renamedialog.moc"
#include "libdolphin_export.h"
-#include <KDialog>
+#include <QDialog>
#include <KFileItem>
class KLineEdit;
class KIntSpinBox;
-
+class QPushButton;
#include <QString>
/**
* @brief Dialog for renaming a variable number of files.
*/
-class LIBDOLPHINPRIVATE_EXPORT RenameDialog : public KDialog
+class LIBDOLPHINPRIVATE_EXPORT RenameDialog : public QDialog
{
Q_OBJECT
explicit RenameDialog(QWidget* parent, const KFileItemList& items);
virtual ~RenameDialog();
-protected slots:
- virtual void slotButtonClicked(int button);
-
private slots:
+ void slotAccepted();
void slotTextChanged(const QString& newName);
private:
void renameItems();
+ void renameItem(const KFileItem &item, const QString& newName);
/**
* @return Returns the string \p name, where the characters represented by
KFileItemList m_items;
bool m_allExtensionsDifferent;
KIntSpinBox* m_spinBox;
+ QPushButton* m_okButton;
};
#endif
#include <KColorScheme>
#include <KSeparator>
#include <KWindowSystem>
+// For the blurred tooltip background
+#include <KWindowEffects>
#include <KStringHandler>
#include <QLabel>
#ifndef HAVE_BALOO
#include <KFileMetaDataWidget>
#else
-#include <baloo/filemetadatawidget.h>
+#include <Baloo/FileMetaDataWidget>
#endif
-// For the blurred tooltip background
-#include <plasma/windoweffects.h>
-
FileMetaDataToolTip::FileMetaDataToolTip(QWidget* parent) :
QWidget(parent),
m_preview(0),
// Create widget for the meta data
#ifndef HAVE_BALOO
m_fileMetaDataWidget = new KFileMetaDataWidget(this);
+ connect(m_fileMetaDataWidget, &KFileMetaDataWidget::metaDataRequestFinished,
+ this, &FileMetaDataToolTip::metaDataRequestFinished);
#else
m_fileMetaDataWidget = new Baloo::FileMetaDataWidget(this);
+ connect(m_fileMetaDataWidget, &Baloo::FileMetaDataWidget::metaDataRequestFinished,
+ this, &FileMetaDataToolTip::metaDataRequestFinished);
#endif
m_fileMetaDataWidget->setForegroundRole(QPalette::ToolTipText);
m_fileMetaDataWidget->setReadOnly(true);
- connect(m_fileMetaDataWidget, SIGNAL(metaDataRequestFinished(KFileItemList)),
- this, SIGNAL(metaDataRequestFinished(KFileItemList)));
QVBoxLayout* textLayout = new QVBoxLayout();
textLayout->addWidget(m_name);
void FileMetaDataToolTip::showEvent(QShowEvent *)
{
- Plasma::WindowEffects::overrideShadow(winId(), true);
- Plasma::WindowEffects::enableBlurBehind(winId(), true, mask());
+#pragma message("TODO: port Plasma::WindowEffects::overrideShadow")
+ //Plasma::WindowEffects::overrideShadow(winId(), true);
+ KWindowEffects::enableBlurBehind(winId(), true, mask());
}
-#include "filemetadatatooltip.moc"
#include "tooltipmanager.h"
#include "filemetadatatooltip.h"
-#include <KIcon>
+#include <QIcon>
#include <KIO/JobUiDelegate>
#include <KIO/PreviewJob>
+#include <KJobWidgets>
#include <QApplication>
#include <QDesktopWidget>
m_showToolTipTimer = new QTimer(this);
m_showToolTipTimer->setSingleShot(true);
m_showToolTipTimer->setInterval(500);
- connect(m_showToolTipTimer, SIGNAL(timeout()), this, SLOT(showToolTip()));
+ connect(m_showToolTipTimer, &QTimer::timeout, this, static_cast<void(ToolTipManager::*)()>(&ToolTipManager::showToolTip));
m_contentRetrievalTimer = new QTimer(this);
m_contentRetrievalTimer->setSingleShot(true);
m_contentRetrievalTimer->setInterval(200);
- connect(m_contentRetrievalTimer, SIGNAL(timeout()), this, SLOT(startContentRetrieval()));
+ connect(m_contentRetrievalTimer, &QTimer::timeout, this, &ToolTipManager::startContentRetrieval);
Q_ASSERT(m_contentRetrievalTimer->interval() < m_showToolTipTimer->interval());
}
// meta data retrieval, when passing rapidly over a lot of items.
Q_ASSERT(!m_fileMetaDataToolTip);
m_fileMetaDataToolTip = new FileMetaDataToolTip();
- connect(m_fileMetaDataToolTip, SIGNAL(metaDataRequestFinished(KFileItemList)),
- this, SLOT(slotMetaDataRequestFinished()));
+ connect(m_fileMetaDataToolTip, &FileMetaDataToolTip::metaDataRequestFinished,
+ this, &ToolTipManager::slotMetaDataRequestFinished);
m_contentRetrievalTimer->start();
m_showToolTipTimer->start();
KIO::PreviewJob* job = new KIO::PreviewJob(KFileItemList() << m_item, QSize(256, 256));
job->setIgnoreMaximumSize(m_item.isLocalFile());
if (job->ui()) {
- job->ui()->setWindow(qApp->activeWindow());
+ KJobWidgets::setWindow(job, qApp->activeWindow());
}
- connect(job, SIGNAL(gotPreview(KFileItem,QPixmap)),
- this, SLOT(setPreviewPix(KFileItem,QPixmap)));
- connect(job, SIGNAL(failed(KFileItem)),
- this, SLOT(previewFailed()));
+ connect(job, &KIO::PreviewJob::gotPreview,
+ this, &ToolTipManager::setPreviewPix);
+ connect(job, &KIO::PreviewJob::failed,
+ this, &ToolTipManager::previewFailed);
}
return;
}
- const QPixmap pixmap = KIcon(m_item.iconName()).pixmap(128, 128);
+ const QPixmap pixmap = QIcon::fromTheme(m_item.iconName()).pixmap(128, 128);
m_fileMetaDataToolTip->setPreview(pixmap);
if (!m_showToolTipTimer->isActive()) {
showToolTip();
m_toolTipRequested = false;
}
-#include "tooltipmanager.moc"
#include <KFileItem>
-class DolphinModel;
-class DolphinSortFilterProxyModel;
class FileMetaDataToolTip;
-class QAbstractItemView;
-class QModelIndex;
class QTimer;
/**
#include "updateitemstatesthread.h"
#include <kversioncontrolplugin2.h>
+#include <QVector>
#include <QMutexLocker>
KVersionControlPlugin2* pluginV2 = qobject_cast<KVersionControlPlugin2*>(m_plugin);
if (pluginV2) {
for (int i = 0; i < count; ++i) {
- items[i].version = pluginV2->itemVersion(items[i].item);
+ const KFileItem& item = items.at(i).first;
+ const KVersionControlPlugin2::ItemVersion version = pluginV2->itemVersion(item);
+ items[i].second = version;
}
} else {
for (int i = 0; i < count; ++i) {
- const KVersionControlPlugin::VersionState state = m_plugin->versionState(items[i].item);
- items[i].version = static_cast<KVersionControlPlugin2::ItemVersion>(state);
+ const KFileItem& item = items.at(i).first;
+ const KVersionControlPlugin::VersionState state = m_plugin->versionState(item);
+ items[i].second = static_cast<KVersionControlPlugin2::ItemVersion>(state);
}
}
}
return m_itemStates;
}
-#include "updateitemstatesthread.moc"
#include <KLocale>
#include <KService>
+#include <KDebug>
#include <KServiceTypeTrader>
#include <kitemviews/kfileitemmodel.h>
#include <kversioncontrolplugin2.h>
m_dirVerificationTimer = new QTimer(this);
m_dirVerificationTimer->setSingleShot(true);
m_dirVerificationTimer->setInterval(500);
- connect(m_dirVerificationTimer, SIGNAL(timeout()),
- this, SLOT(verifyDirectory()));
+ connect(m_dirVerificationTimer, &QTimer::timeout,
+ this, &VersionControlObserver::verifyDirectory);
}
VersionControlObserver::~VersionControlObserver()
void VersionControlObserver::setModel(KFileItemModel* model)
{
if (m_model) {
- disconnect(m_model, SIGNAL(itemsInserted(KItemRangeList)),
- this, SLOT(delayedDirectoryVerification()));
- disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(delayedDirectoryVerification()));
+ disconnect(m_model, &KFileItemModel::itemsInserted,
+ this, &VersionControlObserver::delayedDirectoryVerification);
+ disconnect(m_model, &KFileItemModel::itemsChanged,
+ this, &VersionControlObserver::delayedDirectoryVerification);
}
m_model = model;
if (model) {
- connect(m_model, SIGNAL(itemsInserted(KItemRangeList)),
- this, SLOT(delayedDirectoryVerification()));
- connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
- this, SLOT(delayedDirectoryVerification()));
+ connect(m_model, &KFileItemModel::itemsInserted,
+ this, &VersionControlObserver::delayedDirectoryVerification);
+ connect(m_model, &KFileItemModel::itemsChanged,
+ this, &VersionControlObserver::delayedDirectoryVerification);
}
}
if (items.count() == 1) {
const KFileItem rootItem = m_model->rootItem();
if (!rootItem.isNull() && items.first().url() == rootItem.url()) {
- directory = rootItem.url().path(KUrl::AddTrailingSlash);
+ directory = rootItem.url().path();
}
}
if (m_plugin) {
KVersionControlPlugin2* pluginV2 = qobject_cast<KVersionControlPlugin2*>(m_plugin);
if (pluginV2) {
- connect(pluginV2, SIGNAL(itemVersionsChanged()),
- this, SLOT(silentDirectoryVerification()));
+ connect(pluginV2, &KVersionControlPlugin2::itemVersionsChanged,
+ this, &VersionControlObserver::silentDirectoryVerification);
} else {
- connect(m_plugin, SIGNAL(versionStatesChanged()),
- this, SLOT(silentDirectoryVerification()));
+ connect(m_plugin, &KVersionControlPlugin::versionStatesChanged,
+ this, &VersionControlObserver::silentDirectoryVerification);
}
- connect(m_plugin, SIGNAL(infoMessage(QString)),
- this, SIGNAL(infoMessage(QString)));
- connect(m_plugin, SIGNAL(errorMessage(QString)),
- this, SIGNAL(errorMessage(QString)));
- connect(m_plugin, SIGNAL(operationCompletedMessage(QString)),
- this, SIGNAL(operationCompletedMessage(QString)));
+ connect(m_plugin, &KVersionControlPlugin::infoMessage,
+ this, &VersionControlObserver::infoMessage);
+ connect(m_plugin, &KVersionControlPlugin::errorMessage,
+ this, &VersionControlObserver::errorMessage);
+ connect(m_plugin, &KVersionControlPlugin::operationCompletedMessage,
+ this, &VersionControlObserver::operationCompletedMessage);
if (!m_versionedDirectory) {
m_versionedDirectory = true;
const QVector<ItemState>& items = it.value();
foreach (const ItemState& item, items) {
+ const KFileItem& fileItem = item.first;
+ const KVersionControlPlugin2::ItemVersion version = item.second;
QHash<QByteArray, QVariant> values;
- values.insert("version", QVariant(item.version));
- m_model->setData(m_model->index(item.item), values);
+ values.insert("version", QVariant(version));
+ m_model->setData(m_model->index(fileItem), values);
}
}
emit infoMessage(i18nc("@info:status", "Updating version information..."));
}
m_updateItemStatesThread = new UpdateItemStatesThread(m_plugin, itemStates);
- connect(m_updateItemStatesThread, SIGNAL(finished()),
- this, SLOT(slotThreadFinished()));
- connect(m_updateItemStatesThread, SIGNAL(finished()),
- m_updateItemStatesThread, SLOT(deleteLater()));
+ connect(m_updateItemStatesThread, &UpdateItemStatesThread::finished,
+ this, &VersionControlObserver::slotThreadFinished);
+ connect(m_updateItemStatesThread, &UpdateItemStatesThread::finished,
+ m_updateItemStatesThread, &UpdateItemStatesThread::deleteLater);
m_updateItemStatesThread->start(); // slotThreadFinished() is called when finished
}
if (expansionLevel == currentExpansionLevel) {
ItemState itemState;
- itemState.item = m_model->fileItem(index);
- itemState.version = KVersionControlPlugin2::UnversionedVersion;
+ itemState.first = m_model->fileItem(index);
+ itemState.second = KVersionControlPlugin2::UnversionedVersion;
items.append(itemState);
} else if (expansionLevel > currentExpansionLevel) {
}
if (items.count() > 0) {
- const KUrl& url = items.first().item.url();
+ const KUrl& url = items.first().first.url();
itemStates.insert(url.directory(KUrl::AppendTrailingSlash), items);
}
return m_versionedDirectory && m_plugin;
}
-#include "versioncontrolobserver.moc"
#include <libdolphin_export.h>
#include <KFileItem>
+#include <KUrl>
#include <kversioncontrolplugin2.h>
#include <QList>
#include <QMutex>
void slotThreadFinished();
private:
- struct ItemState
- {
- KFileItem item;
- KVersionControlPlugin2::ItemVersion version;
- };
+ typedef QPair<KFileItem, KVersionControlPlugin2::ItemVersion> ItemState;
void updateItemStates();
}
}
-#include "viewmodecontroller.moc"
#include <KComponentData>
#include <KLocale>
-#include <KStandardDirs>
#include <KUrl>
+#include <KDebug>
+#include <KGlobal>
#include <QCryptographicHash>
#include <QDate>
#include <QFile>
#include <QFileInfo>
+#include <QStandardPaths>
namespace {
const int AdditionalInfoViewPropertiesVersion = 1;
// String representation to mark the additional properties of
// the details view as customized by the user. See
// ViewProperties::visibleRoles() for more information.
- const char* CustomizedDetailsString = "CustomizedDetails";
+ const char CustomizedDetailsString[] = "CustomizedDetails";
// Filename that is used for storing the properties
- const char* ViewPropertiesFileName = ".directory";
+ const char ViewPropertiesFileName[] = ".directory";
}
ViewProperties::ViewProperties(const KUrl& url) :
void ViewProperties::save()
{
kDebug() << "Saving view-properties to" << m_filePath;
- KStandardDirs::makeDir(m_filePath);
+ QDir dir;
+ dir.mkpath(m_filePath);
m_node->setVersion(CurrentViewPropertiesVersion);
m_node->writeConfig();
m_changedProps = false;
QString ViewProperties::destinationDir(const QString& subDir) const
{
- QString basePath = KGlobal::mainComponent().componentName();
- basePath.append("/view_properties/").append(subDir);
- return KStandardDirs::locateLocal("data", basePath);
+ QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
+ path.append(KGlobal::mainComponent().componentName());
+ path.append("/view_properties/").append(subDir);
+ return path;
}
QString ViewProperties::viewModePrefix() const
hashString.replace('/', '-');
return hashString;
}
-
-KUrl ViewProperties::mirroredDirectory()
-{
- QString basePath = KGlobal::mainComponent().componentName();
- basePath.append("/view_properties/");
- return KUrl(KStandardDirs::locateLocal("data", basePath));
-}
*/
static QString directoryHashForUrl(const KUrl& url);
- /**
- * Returns the URL of the directory, where the mirrored view properties
- * are stored into. Mirrored view properties are used if:
- * - there is no write access for storing the view properties into
- * the original directory
- * - for non local directories
- */
- static KUrl mirroredDirectory();
-
Q_DISABLE_COPY(ViewProperties)
private: