ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #10280
[Merge] lp:~renatofilho/ubuntu-filemanager-app/rename_old_click into lp:ubuntu-filemanager-app
Renato Araujo Oliveira Filho has proposed merging lp:~renatofilho/ubuntu-filemanager-app/rename_old_click into lp:ubuntu-filemanager-app with lp:~renatofilho/ubuntu-filemanager-app/new-debian as a prerequisite.
Commit message:
Rename project to ubuntu-filemanager-app
Added missing copyright
Fixed some packages script.
Requested reviews:
Ubuntu File Manager Developers (ubuntu-filemanager-dev)
Related bugs:
Bug #1675055 in Ubuntu File Manager App: "land ubuntu-filemanager-app as deb in the archive"
https://bugs.launchpad.net/ubuntu-filemanager-app/+bug/1675055
For more details, see:
https://code.launchpad.net/~renatofilho/ubuntu-filemanager-app/rename_old_click/+merge/319493
--
The attached diff has been truncated due to its size.
Your team Ubuntu File Manager Developers is requested to review the proposed merge of lp:~renatofilho/ubuntu-filemanager-app/rename_old_click into lp:ubuntu-filemanager-app.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2017-03-22 15:05:53 +0000
+++ CMakeLists.txt 2017-03-22 15:05:54 +0000
@@ -1,4 +1,4 @@
-project(com.ubuntu.filemanager C CXX)
+project(ubuntu-filemanager-app C CXX)
cmake_minimum_required(VERSION 2.8.9)
find_program(INTLTOOL_MERGE intltool-merge)
find_program(INTLTOOL_EXTRACT intltool-extract)
@@ -10,16 +10,14 @@
include(GNUInstallDirs)
option(INSTALL_TESTS "Install the tests on make install" on)
-option(CLICK_MODE "Installs to a contained location" on)
-set(APP_NAME filemanager)
+set(APP_NAME ubuntu-filemanager-app)
set(DESKTOP_FILE "${PROJECT_NAME}.desktop")
set(LP_PROJECT ubuntu-filemanager-app)
set(ICON_FILE filemanager64.png)
-set(AUTOPILOT_DIR ${APP_NAME})
+set(AUTOPILOT_DIR "ubuntu_filemanager_app")
set(EXEC "${APP_NAME}")
set(CONTENT_HUB_JSON content-hub.json)
-set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Relative path to the manifest file")
# global FILE definitions for stat system call, it works for any sub module
add_definitions(-D_LARGEFILE_SOURCE)
@@ -32,93 +30,11 @@
OUTPUT_STRIP_TRAILING_WHITESPACE
)
-if(CLICK_MODE)
- if(NOT DEFINED BZR_SOURCE)
- set(BZR_SOURCE "lp:${LP_PROJECT}")
- message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
- endif(NOT DEFINED BZR_SOURCE)
- # Find out the architecture for package building
- # to determine the plugin's installation path
- execute_process(
- COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
- OUTPUT_VARIABLE ARCH_TRIPLET
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- set(CMAKE_INSTALL_PREFIX /)
- set(CMAKE_INSTALL_BINDIR /)
- set(DATA_DIR /)
- set(ICON ${ICON_FILE})
- set(QT_IMPORTS_DIR "/lib/${ARCH_TRIPLET}")
- set(BIN_DIR /lib/${ARCH_TRIPLET}/bin)
- set(DESKTOP_DIR ${DATA_DIR})
- if(NOT BZR_REVNO)
- set(BZR_REVNO "latest")
- endif(NOT BZR_REVNO)
-
- #query the target architecture
- execute_process(
- COMMAND dpkg-architecture -qDEB_HOST_ARCH
- OUTPUT_VARIABLE CLICK_ARCH
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
-
- # make the click files visible in qtcreator
- file(GLOB CLICK_FILES
- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
- manifest.json.in *.apparmor)
-
- add_custom_target(com_ubuntu_calendar_CLICKFiles ALL SOURCES ${CLICK_FILES})
-
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json filemanager.apparmor ${CONTENT_HUB_JSON} DESTINATION ${CMAKE_INSTALL_PREFIX})
-
- set(UPSTREAM_LIBS_DIR ${CMAKE_BINARY_DIR}/upstream-libs)
-
- #grab dependencies
- set(GET_CLICK_DEPS_TOOL ${CMAKE_SOURCE_DIR}/get-click-deps)
- set(DEPS_MANIFEST ${CMAKE_CURRENT_SOURCE_DIR}/filemanager-libs.json)
- MESSAGE("Grabbing upstream libs to ${UPSTREAM_LIBS_DIR}")
-
- get_filename_component(BLD_CONFIGURATION_NAME ${CMAKE_BINARY_DIR} NAME)
- set(UPSTREAM_CACHE $ENV{HOME}/dev/upstream-libs-filemanager/${BLD_CONFIGURATION_NAME})
- MESSAGE("Upstream libs cache path: ${UPSTREAM_CACHE}")
-
- if(EXISTS "${UPSTREAM_CACHE}")
- MESSAGE("Upstream libs cache exists.")
- file(COPY ${UPSTREAM_CACHE}/upstream-libs/ DESTINATION ${UPSTREAM_LIBS_DIR} PATTERN * )
- else()
- MESSAGE("Cache miss, downloading from network.")
- file(MAKE_DIRECTORY ${UPSTREAM_LIBS_DIR})
- file(MAKE_DIRECTORY ${UPSTREAM_CACHE})
- execute_process(
- COMMAND ${GET_CLICK_DEPS_TOOL} -d ${DEPS_MANIFEST} ${CLICK_ARCH} ${UPSTREAM_LIBS_DIR}
- )
- # Cache for next usage
- file(COPY ${UPSTREAM_LIBS_DIR} DESTINATION ${UPSTREAM_CACHE} )
- endif()
- MESSAGE("Installing upstream libs from ${CMAKE_CURRENT_BINARY_DIR}/upstream-libs/usr/lib/${ARCH_TRIPLET}/ to ${DATA_DIR}lib/${ARCH_TRIPLET}")
- file(GLOB_RECURSE UPSTREAM_LIBS "${CMAKE_CURRENT_BINARY_DIR}/upstream-libs/usr/lib/${ARCH_TRIPLET}/*")
- foreach(ITEM ${UPSTREAM_LIBS})
- IF( IS_DIRECTORY "${ITEM}" )
- LIST( APPEND DIRS_TO_DEPLOY "${ITEM}" )
- ELSE()
- LIST( APPEND FILES_TO_DEPLOY "${ITEM}" )
- ENDIF()
- endforeach()
- MESSAGE("Following files to install:- ${FILES_TO_DEPLOY}")
- INSTALL( FILES ${FILES_TO_DEPLOY} DESTINATION ${DATA_DIR}lib/${ARCH_TRIPLET} )
-else(CLICK_MODE)
- execute_process(
- COMMAND qmake -query QT_INSTALL_QML
- OUTPUT_VARIABLE QT_IMPORTS_DIR
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_NAME})
- set(ICON ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON_FILE})
- set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
- install(FILES ${CONTENT_HUB_JSON} DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/content-hub/peers/ RENAME com.ubuntu.filemanager)
-endif(CLICK_MODE)
+set(DATA_DIR ${CMAKE_INSTALL_FULL_DATADIR}/${APP_NAME})
+set(ICON ${DATA_DIR}/${ICON_FILE})
+set(QT_IMPORTS_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/${APP_NAME}/qml/)
+set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
+install(FILES ${CONTENT_HUB_JSON} DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/content-hub/peers/ RENAME ubuntu-filemanager-app)
file(GLOB_RECURSE I18N_SRC_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po
@@ -141,6 +57,10 @@
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}
DESTINATION ${DESKTOP_DIR})
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/config.h"
+ IMMEDIATE @ONLY)
+
# Tests
enable_testing()
=== added file 'COPYING.BSD'
--- COPYING.BSD 1970-01-01 00:00:00 +0000
+++ COPYING.BSD 2017-03-22 15:05:54 +0000
@@ -0,0 +1,26 @@
+Copyright (c) 2012, Robin Burchell
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those
+of the authors and should not be interpreted as representing official policies,
+either expressed or implied, of the FreeBSD Project.
=== renamed file 'COPYING' => 'COPYING.GPL'
=== added file 'COPYING.LGPL'
--- COPYING.LGPL 1970-01-01 00:00:00 +0000
+++ COPYING.LGPL 2017-03-22 15:05:54 +0000
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
=== added file 'config.h.in'
--- config.h.in 1970-01-01 00:00:00 +0000
+++ config.h.in 2017-03-22 15:05:54 +0000
@@ -0,0 +1,6 @@
+#ifndef __CONFIG_H__
+#define __CONFIG_H__
+
+#define FM_PRIVATE_IMPORT_DIR "@QT_IMPORTS_DIR@"
+
+#endif
=== modified file 'debian/changelog'
--- debian/changelog 2017-03-22 15:05:53 +0000
+++ debian/changelog 2017-03-22 15:05:54 +0000
@@ -1,10 +1,11 @@
-ubuntu-filemanager-app (0.4ubuntu2) UNRELEASED; urgency=medium
+ubuntu-filemanager-app (0.4-0ubuntu1) UNRELEASED; urgency=medium
[ Girish Rawat ]
* Improved READMEs
[ renato ]
- *
+ * Rename binary file to ubuntu-filemanager-app
+ * Join plugin packages into the main package
-- Renato Araujo Oliveira Filho <renato.filho@xxxxxxxxxxxxx> Wed, 08 Mar 2017 16:28:53 -0300
=== modified file 'debian/control'
--- debian/control 2017-03-22 15:05:53 +0000
+++ debian/control 2017-03-22 15:05:54 +0000
@@ -14,20 +14,17 @@
libtag1-dev,
libpam0g-dev,
libsmbclient-dev,
-Standards-Version: 3.9.5
+Standards-Version: 3.9.7
Section: misc
Homepage: https://launchpad.net/ubuntu-filemanager-app
Vcs-Bzr: https://code.launchpad.net/~ubuntu-filemanager-dev/ubuntu-filemanager-app/trunk
Package: ubuntu-filemanager-app
-Section: misc
Architecture: any
+Replaces: qtdeclarative5-placesmodel0.1,
+ qtdeclarative5-archives0.1,
Depends: ${misc:Depends},
${shlibs:Depends},
- qml-module-pamauthentication0.1 | qtdeclarative5-fm-pamauthentication0.1,
- qtdeclarative5-nemo-qml-plugin-folderlistmodel,
- qtdeclarative5-placesmodel0.1,
- qtdeclarative5-archives0.1,
qtdeclarative5-qtquick2-plugin,
qtdeclarative5-u1db1.0,
qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
@@ -36,49 +33,6 @@
Description: File Manager application
Core File Manager application
-Package: qtdeclarative5-nemo-qml-plugin-folderlistmodel
-Architecture: any
-Multi-Arch: same
-Depends: ${misc:Depends},
- ${shlibs:Depends},
- ${misc:Pre-Depends},
-Description: Nemo QML plugin - folder list model
- Qt is a cross-platform C++ application framework. Qt's primary feature
- is its rich set of widgets that provide standard GUI functionality.
- .
- This package contains the Folder List model plugin of the Nemo QML
- plugins collection.
-
-Package: qtdeclarative5-placesmodel0.1
-Architecture: any
-Multi-Arch: same
-Depends: ${misc:Depends},
- ${shlibs:Depends},
- ${misc:Pre-Depends},
-Description: Places model QML plugin
- This package contains a plugin that enables QML apps to list and
- modify a set of places (bookmarks) in the file system.
-
-Package: qtdeclarative5-fm-pamauthentication0.1
-Architecture: any
-Multi-Arch: same
-Depends: ${misc:Depends},
- ${shlibs:Depends},
- ${misc:Pre-Depends},
-Description: PAM authentication QML plugin
- This package contains a plugin that enables QML apps to do
- password authentication via the PAM API.
-
-Package: qtdeclarative5-archives0.1
-Architecture: any
-Multi-Arch: same
-Depends: ${misc:Depends},
- ${shlibs:Depends},
- ${misc:Pre-Depends},
-Description: Archives QML plugin
- This package contains a plugin that enables QML apps to extract
- archive files.
-
Package: ubuntu-filemanager-app-autopilot
Architecture: all
Depends: ${misc:Depends},
=== modified file 'debian/copyright'
--- debian/copyright 2013-07-24 21:34:03 +0000
+++ debian/copyright 2017-03-22 15:05:54 +0000
@@ -13,9 +13,45 @@
2013 Victor Thompson <victor.thompson@xxxxxxxxx>
License: GPL-3
+Files: src/plugin/archives/*
+Copyright: 2014 Canonical Ltd.
+License: GPL-3
+
+Files: src/plugin/folderlistmodel/*
+Copyright: 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
+License: LGPL-3
+
+Files: src/plugin/folderlistmodel/clipboard.*
+Copyright: 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
+License: BSD-3-Clause
+
+Files: src/plugin/folderlistmodel/dirmodel.*
+Copyright: 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
+License: BSD-3-Clause
+
+Files: src/plugin/folderlistmodel/file*
+Copyright: 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
+License: BSD-3-Clause
+
+Files: src/plugin/folderlistmodel/imageprovider.*
+Copyright: 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
+License: BSD-3-Clause
+
+Files: src/plugin/folderlistmodel/io*
+Copyright: 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
+License: BSD-3-Clause
+
+Files: src/plugin/folderlistmodel/plugin.*
+Copyright: 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
+License: BSD-3-Clause
+
+Files: src/plugin/placesmodel/*
+Copyright: 2014 Canonical Ltd.
+License: GPL-3
+
Files: debian/*
Copyright: 2013 Canonical Ltd.
-License: LGPL-3
+License: GPL-3
License: GPL-3
This package is free software; you can redistribute it and/or
@@ -50,3 +86,29 @@
.
On Debian systems, the complete text of the GNU Lesser General
Public License can be found in "/usr/share/common-licenses/LGPL-3".
+
+License: BSD-3-Clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ Neither the name of Nemo Mobile nor the names of its contributors
+ may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=== removed file 'debian/qtdeclarative5-archives0.1.install'
--- debian/qtdeclarative5-archives0.1.install 2014-11-11 13:32:54 +0000
+++ debian/qtdeclarative5-archives0.1.install 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-usr/lib/*/qt5/qml/com/ubuntu/Archives/
=== removed file 'debian/qtdeclarative5-fm-pamauthentication0.1.install'
--- debian/qtdeclarative5-fm-pamauthentication0.1.install 2015-06-26 19:36:32 +0000
+++ debian/qtdeclarative5-fm-pamauthentication0.1.install 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-usr/lib/*/qt5/qml/com/ubuntu/PamAuthentication/
=== removed file 'debian/qtdeclarative5-nemo-qml-plugin-folderlistmodel.install'
--- debian/qtdeclarative5-nemo-qml-plugin-folderlistmodel.install 2014-04-11 05:17:13 +0000
+++ debian/qtdeclarative5-nemo-qml-plugin-folderlistmodel.install 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-usr/lib/*/qt5/qml/org/nemomobile/folderlistmodel/
=== removed file 'debian/qtdeclarative5-placesmodel0.1.install'
--- debian/qtdeclarative5-placesmodel0.1.install 2014-06-21 21:59:52 +0000
+++ debian/qtdeclarative5-placesmodel0.1.install 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-usr/lib/*/qt5/qml/com/ubuntu/PlacesModel/
=== added file 'debian/source.lintian-overrides'
--- debian/source.lintian-overrides 1970-01-01 00:00:00 +0000
+++ debian/source.lintian-overrides 2017-03-22 15:05:54 +0000
@@ -0,0 +1,2 @@
+ubuntu-filemanager-app source: debian-watch-file-is-missing
+ubuntu-filemanager-app source: build-depends-on-metapackage build-depends: qt5-default
=== modified file 'debian/ubuntu-filemanager-app-autopilot.install'
--- debian/ubuntu-filemanager-app-autopilot.install 2014-04-26 06:35:52 +0000
+++ debian/ubuntu-filemanager-app-autopilot.install 2017-03-22 15:05:54 +0000
@@ -1,1 +1,1 @@
-usr/lib/*/dist-packages/filemanager/*
+usr/lib/*/dist-packages/ubuntu_filemanager_app/*
=== added file 'debian/ubuntu-filemanager-app-autopilot.lintian-overrides'
--- debian/ubuntu-filemanager-app-autopilot.lintian-overrides 1970-01-01 00:00:00 +0000
+++ debian/ubuntu-filemanager-app-autopilot.lintian-overrides 2017-03-22 15:05:54 +0000
@@ -0,0 +1,3 @@
+ubuntu-filemanager-app-autopilot: duplicated-compressed-file usr/lib/python3/dist-packages/ubuntu_filemanager_app/content/Test.tar.bz2
+ubuntu-filemanager-app-autopilot: duplicated-compressed-file usr/lib/python3/dist-packages/ubuntu_filemanager_app/content/Test.tar.gz
+
=== modified file 'debian/ubuntu-filemanager-app.install'
--- debian/ubuntu-filemanager-app.install 2017-03-22 15:05:53 +0000
+++ debian/ubuntu-filemanager-app.install 2017-03-22 15:05:54 +0000
@@ -1,3 +1,7 @@
-usr/bin/*
-usr/share/*
+usr/bin/ubuntu-filemanager-app
+usr/share/ubuntu-filemanager-app/*
+usr/lib/*/ubuntu-filemanager-app/*
+usr/share/applications/ubuntu-filemanager-app.desktop
+usr/share/content-hub/peers/ubuntu-filemanager-app
+usr/share/locale/*/LC_MESSAGES/ubuntu-filemanager-app.mo
debian/apparmor/ubuntu-filemanager-app etc/apparmor.d
=== added file 'debian/ubuntu-filemanager-app.lintian-overrides'
--- debian/ubuntu-filemanager-app.lintian-overrides 1970-01-01 00:00:00 +0000
+++ debian/ubuntu-filemanager-app.lintian-overrides 2017-03-22 15:05:54 +0000
@@ -0,0 +1,2 @@
+ubuntu-filemanager-app binary: binary-without-manpage usr/bin/ubuntu-filemanager-app
+
=== removed file 'filemanager-libs.json'
--- filemanager-libs.json 2015-09-07 10:22:51 +0000
+++ filemanager-libs.json 1970-01-01 00:00:00 +0000
@@ -1,50 +0,0 @@
-{
- "armhf": [
- {
- "url": "http://ports.ubuntu.com/ubuntu-ports",
- "dist": "vivid",
- "component": "main",
- "packages": [
- "libsmbclient",
- "samba-libs",
- "libtalloc2",
- "libtevent0",
- "libwbclient0",
- "libldb1",
- "libntdb1"
- ]
- }
- ],
- "amd64": [
- {
- "url": "http://archive.ubuntu.com/ubuntu",
- "dist": "vivid",
- "component": "main",
- "packages": [
- "libsmbclient",
- "samba-libs",
- "libtalloc2",
- "libtevent0",
- "libwbclient0",
- "libldb1",
- "libntdb1"
- ]
- }
- ],
- "i386": [
- {
- "url": "http://archive.ubuntu.com/ubuntu",
- "dist": "vivid",
- "component": "main",
- "packages": [
- "libsmbclient",
- "samba-libs",
- "libtalloc2",
- "libtevent0",
- "libwbclient0",
- "libldb1",
- "libntdb1"
- ]
- }
- ]
-}
=== removed file 'filemanager.apparmor'
--- filemanager.apparmor 2016-04-07 17:27:53 +0000
+++ filemanager.apparmor 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
-{
- "policy_version": 1.3,
- "template": "unconfined",
- "policy_groups": []
-}
=== removed file 'get-click-deps'
--- get-click-deps 2015-11-19 15:45:08 +0000
+++ get-click-deps 1970-01-01 00:00:00 +0000
@@ -1,451 +0,0 @@
-#!/usr/bin/python3
-
-# Copyright (C) 2015 Stefano Verzegnassi <verzegnassi.stefano@xxxxxxxxx>
-# Copyright (C) 2015 Didier Roche <didrocks@xxxxxxxxxx>
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 3, as published
-# by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranties of
-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#
-# Source code at:
-# https://code.launchpad.net/~verzegnassi-stefano/+junk/get-click-deps
-#
-# A script to automate the fetching all the external dependencies of a
-# Click packaged application from internet, and copying them in a given
-# folder, so that the click packaging tool can easily build them in the
-# package.
-#
-# usage: get-click-deps [-h] [-f] [-d] [-e] [-c SCRIPT_PATH]
-# manifest_path {amd64,i386,armhf} target_path
-#
-# A tool for adding external libraries to a Ubuntu SDK application or scope.
-#
-# positional arguments:
-# manifest_path path of json file containing the list of packages to
-# be downloaded.
-# {amd64,i386,armhf} CPU architecture ("amd64", "i386" or "armhf")
-# target_path path to the target (a click package or a folder)
-# where this tool will include the downloaded binaries.
-# If the folder does not exist, it will be created.
-#
-# optional arguments:
-# -h, --help show this help message and exit
-# -f, --force-download force a new download of the packages
-# -d, --delete-temp delete temp files at the end of the process
-# -e, --extract-only only create temp directory and extract the content of
-# downloaded packages
-# -c SCRIPT_PATH, --custom-script SCRIPT_PATH
-# run a custom script after the extraction of Debian
-# packages and before copying their content to the
-# target destination. The tool will execute the script
-# with the path to the packages dump as argument. If
-# the '-e' flag has been specified, the script will be
-# anyway executed. This option is useful when you need
-# to automatically modify the content of temp folder
-# (e.g. when you need to fix some path before including
-# the files in a click package).
-#
-#
-# USAGE EXAMPLE:
-# get-click-deps packages.json armhf <path/to/package.click>
-#
-# package.json is the package manifest, and contains all the references to the
-# .deb packages to be included into the Ubuntu SDK project.
-# If you're familiar to the Debian/Ubuntu world, you'll see that it's pretty
-# similar to therepository management of these distros:
-# see https://wiki.debian.org/SourcesList for further informations.
-#
-# An example of packages.json file is:
-# {
-# "armhf": [
-# {
-# "url": "http://ports.ubuntu.com/ubuntu-ports/",
-# "dist": "vivid",
-# "component": "main",
-# "packages": [
-# "libgl1-mesa-glx",
-# "libxslt1.1",
-# "libxcb-glx0",
-# "libxcb-dri3-0",
-# "libxcb-present0",
-# "libxshmfence1",
-# "libxxf86vm1"
-# ]
-# },
-#
-# {
-# "url": "http://ppa.launchpad.net/canonical-community/ppa/ubuntu",
-# "dist": "vivid",
-# "component": "main",
-# "packages": [
-# "libreoffice-vanilla"
-# ]
-# }
-# ],
-#
-# "amd64": [
-# "url": "http://ppa.launchpad.net/canonical-community/ppa/ubuntu",
-# "dist": "vivid",
-# "component": "main",
-# "packages": [
-# "libreoffice-vanilla"
-# ]
-# }
-# ]
-# }
-#
-# Instead of a click package, you can specify the build folder used by Ubuntu
-# SDK for compiling the sources of your project. This way the binaries
-# downloaded by this tool will be automatically included in the .click package
-# the next time you ask Ubuntu SDK to create a new package.
-#
-
-# TODO: Complete error handling
-# TODO: Make target_path optional if the '-e' flag has been specified.
-
-import sys
-import os
-import stat
-import time
-import argparse
-import json
-import gzip
-import subprocess
-import urllib.request, urllib.error, urllib.parse
-
-def get_timestamp():
- return time.time()
-
-
-def check_internet_connection():
- try:
- urllib.request.urlopen('http://www.launchpad.net', timeout=20)
- return True
- except urllib2.error.URLError as err:
- pass
- return False
-
-
-def get_arch_triplet(arch):
- return subprocess.check_output([
- 'dpkg-architecture',
- '-A',
- arch,
- '-qDEB_TARGET_MULTIARCH'])
-
-
-def download_file(url, dest, verbose=True):
- if verbose:
- print ("\nDownloading:\n{}".format(url))
- # TODO: Switch to subprocess
- os.system('cd %s && { curl -# -O %s ; cd - ; }' % (dest, url))
-
-
-def download_file_and_rename(url, dest, new_filename, verbose=True):
- if verbose:
- print ("\nDownloading:\n{}".format(url))
- new_path = os.path.join(dest, new_filename)
- subprocess.call(['curl', url, '-#', '-o', new_path])
-
- return new_path
-
-
-def get_package_download_url(package_name, packages_list, base_url):
- pkgs_list = packages_list.decode('utf-8').split('\n')
- index = pkgs_list.index('Package: %s' % package_name)
-
- for i in range(index, len(pkgs_list)):
- if pkgs_list[i].find('Filename:') > -1:
- return "%s/%s" % (base_url, pkgs_list[i].replace('Filename: ', ''))
-
-
-def get_URLs_for_arch(manifest_path, arch, destpath):
- urls = []
-
- f = open(manifest_path)
- content = json.load(f)
- f.close()
-
- # Download repository index for each repository in the JSON package
- # manifest.
- try:
- repo_index = 0
- for repo in content[arch]:
- repo_index_url = '%s/dists/%s/%s/binary-%s/Packages.gz' % (
- repo['url'],
- repo['dist'],
- repo['component'],
- arch)
-
- print ("\nDownloading repository index at:\n".format(repo_index_url))
-
- repo_index_zip = download_file_and_rename(
- repo_index_url,
- destpath,
- 'repo-index-%s-%s.gz' % (arch, repo_index),
- False)
-
- with gzip.open(repo_index_zip, 'r') as f:
- repo_index_content = f.read()
- f.close()
-
- # Get the download URL of each package of the repository.
- packages = repo['packages']
- for package in packages:
- urls.append(get_package_download_url(
- package,
- repo_index_content,
- repo['url']))
-
- repo_index += 1
- except KeyError:
- # Arch not found in the manifest. Exit with no error, since there's no
- # need to run the script for this arch.
- print ("\n\nRequested arch has been not specified in the manifest. \
- Exiting...")
- sys.exit(0)
- print ("\nObtained packages informations")
- return urls
-
-
-def check_if_temp_folder_already_exists(path):
- return os.path.isdir(path)
-
-
-def copy_directory_content(sourcepath, destpath):
- subprocess.call(['cp', '-r', '%s/.' % sourcepath, destpath])
-
-
-def delete_folder(path, recursive=False):
- if recursive:
- flag = '-rf'
- else:
- flag = '-f'
- subprocess.call(['rm', flag, path])
-
-
-def extract_deb_package(deb_path, destpath):
- subprocess.call(['dpkg-deb', '-x', deb_path, destpath])
-
-
-def extract_click_package(click_path, destpath):
- extract_deb_package(click_path, destpath)
-
- manifest = subprocess.check_output(['click', 'info', click_path])
-
- # The manifest we get has an 'installed-size' key with the value of the
- # previous package. Anyway this value will be replaced when we'll run
- # 'click build <pkg>', so there's no reason for removing it here.
- f = open(os.path.join(destpath, 'manifest.json'), 'w')
- f.write(manifest)
- f.close()
-
- return destpath
-
-
-def build_click_package(source_dirpath):
- output = subprocess.check_output(['click', 'build', source_dirpath])
-
- for line in output.split(os.linesep):
- if line.find('Successfully built package in ') > -1:
- # FIXME: Very ugly.
- path = line.replace('Successfully built package in \'', '')
- path = path.replace('\'.', '')
- return path
-
-
-def copy_file(sourcepath, destpath, overwrite=False):
- flag = ''
-
- if not overwrite:
- flag = '-n'
-
- subprocess.call(['cp', flag, sourcepath, destpath])
-
-
-# Argument parser
-parser = argparse.ArgumentParser(
- description="A tool for adding external libraries to a Ubuntu SDK \
- application or scope.")
-
-parser.add_argument(
- '-f',
- '--force-download',
- dest='force_download',
- action='store_true',
- help='force a new download of the packages')
-
-parser.add_argument(
- '-d',
- '--delete-temp',
- dest='delete_temp',
- action='store_true',
- help='delete temp files at the end of the process')
-
-parser.add_argument(
- '-e',
- '--extract-only',
- dest='extract_only',
- action='store_true',
- help='only create temp directory and extract the content of downloaded \
- packages')
-
-parser.add_argument(
- '-c',
- '--custom-script',
- dest='script_path',
- type=str,
- help='run a custom script after the extraction of Debian packages and \
- before copying their content to the target destination. The tool will \
- execute the script with the path to the packages dump as argument. If \
- the \'-e\' flag has been specified, the script will be anyway \
- executed. This option is useful when you need to automatically modify \
- the content of temp folder (e.g. when you need to fix some path \
- before including the files in a click package).')
-
-parser.add_argument(
- 'manifest_path',
- type=str,
- help='path of json file containing the list of packages to be downloaded.')
-
-parser.add_argument(
- 'arch',
- type=str,
- choices=['amd64', 'i386', 'armhf'],
- help='CPU architecture ("amd64", "i386" or "armhf")')
-
-parser.add_argument(
- 'target_path',
- type=str,
- help='path to the target (a click package or a folder) where this \
- tool will include the downloaded binaries. If the folder does not \
- exist, it will be created.')
-
-args = parser.parse_args()
-
-# Variables
-manifest_path = args.manifest_path
-target_path = args.target_path
-manifest_stat = os.stat(manifest_path)
-temp_folder = os.path.join(
- '/tmp/',
- 'tmp-click-deps-%s-%s-%s-%s' % (
- manifest_stat.st_dev,
- manifest_stat.st_ino,
- manifest_stat.st_size,
- manifest_stat.st_mtime))
-temp_arch_folder = os.path.join(temp_folder, args.arch)
-is_click_target = os.path.isfile(args.target_path)
-
-# Check command line arguments
-if not os.path.isfile(manifest_path):
- sys.exit("\n\nERROR: Package manifest is not a valid file. Exit...")
-
-if not os.path.isfile(target_path) and target_path.endswith('.click'):
- sys.exit("\n\nERROR: The specified target .click does not exists.")
-elif not os.path.isdir(target_path):
- print ("\n\nCreating dest folder\n{}".format(target_path))
- os.mkdir(target_path)
-
-# Check if the script exist, if specified any.
-if args.script_path and not os.path.exists(args.script_path):
- sys.exit("\n\nERROR: The specified script does not exists.")
-
-# If -f argument has been specified, remove all the existing data before
-# running this script.
-if args.force_download:
- if os.path.isdir(temp_folder):
- print ("\nRemoving temp data of the previous run, as requested")
- delete_folder(temp_folder, True)
-
-# Check if we already have run this script for the same target.
-if not check_if_temp_folder_already_exists(temp_arch_folder):
- # Check internet connection
- if not check_internet_connection():
- sys.exit("\n\nERROR: An internet connection is required in order to \
- download packages from repositories.")
-
- # Create temp folder in /tmp
- print ("\nCreating temp folder in {}".format(temp_folder))
- os.mkdir(temp_folder)
- os.mkdir(temp_arch_folder)
-
- # Parse the JSON package list and get the download URL of the packages.
- debs_url_list = get_URLs_for_arch(
- manifest_path,
- args.arch,
- temp_folder)
-
- # Download packages from web
- for url in debs_url_list:
- download_file(url, temp_folder)
-
- # Extract DEBs packages
- print ("\nExtracting .deb packages to {}".format(temp_arch_folder))
- deb_pkgs_list = []
- for file in os.listdir(temp_folder):
- if file.endswith('.deb'):
- deb_pkgs_list.append(file)
-
- for deb_pkg in deb_pkgs_list:
- extract_deb_package(
- os.path.join(temp_folder, deb_pkg),
- temp_arch_folder)
-
- # If a script has been specified, run it.
- if args.script_path:
- print ("\nRunning the script at: {}\n".format(args.script_path))
-
- # Ensure that we can run the script, otherwise we don't have the
- # permission
- subprocess.call(['chmod', '+x', args.script_path])
- subprocess.call([
- args.script_path,
- temp_arch_folder,
- get_arch_triplet(args.arch)])
-else:
- print ("\nPackages are already downloaded. Use them...")
-
-# If -e or --extract-only flags have been specified, we have completed our work
-if args.extract_only:
- print ("\n\nCompleted successfully.")
- sys.exit(0)
-
-# Copy temp_arch folder content to its destination
-if is_click_target:
- print ("\nExtracting target .click package")
- temp_click_folder = extract_click_package(
- args.target_path,
- os.path.join('/tmp/', str(get_timestamp())))
-
- print ("\nAdding extracted binaries to the package")
- copy_directory_content(temp_arch_folder, temp_click_folder)
-
- new_click_package_path = build_click_package(temp_click_folder)
- print ("\nCreated new .click package at:\n{}".format(new_click_package_path))
-
- print ("\nReplacing older .click package")
- copy_file(new_click_package_path, args.target_path, True)
-
- delete_folder(temp_click_folder, True)
-
-else:
- print ("\nCopying extracted binaries to their destination")
- copy_directory_content(temp_arch_folder, args.target_path)
-
-# Delete temp files
-if args.delete_temp:
- print ("\)nRemoving temp files and directory, as requested")
- delete_folder(temp_folder, True)
-
-# Exit
-print ("\n\nCompleted successfully.")
=== removed file 'manifest.json.in'
--- manifest.json.in 2016-07-14 15:04:49 +0000
+++ manifest.json.in 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
-{
- "description": "File Manager application",
- "framework": "ubuntu-sdk-15.04.4",
- "_comment": "Do not change this. Architecture is automatically replaced by cmake",
- "architecture": "@CLICK_ARCH@",
- "hooks": {
- "filemanager": {
- "apparmor": "filemanager.apparmor",
- "desktop": "com.ubuntu.filemanager.desktop",
- "content-hub": "content-hub.json"
- }
- },
- "icon": "filemanager64.png",
- "maintainer": "Ubuntu App Cats <ubuntu-touch-coreapps@xxxxxxxxxxxxxxxxxxx>",
- "name": "com.ubuntu.filemanager",
- "title": "File Manager",
- "version": "0.4.@BZR_REVNO@",
- "x-source": {
- "vcs-bzr": "lp:ubuntu-filemanager-app",
- "vcs-bzr-revno": "@BZR_REVNO@"
- },
- "x-test": {
- "autopilot": {
- "autopilot_module": "@AUTOPILOT_DIR@",
- "depends": [
- "python3-lxml",
- "python3-fixtures"
- ]
- }
- }
-}
=== renamed file 'po/com.ubuntu.filemanager.pot' => 'po/ubuntu-filemanager-app.pot'
--- po/com.ubuntu.filemanager.pot 2016-07-18 22:55:32 +0000
+++ po/ubuntu-filemanager-app.pot 2017-03-22 15:05:54 +0000
@@ -1,6 +1,6 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Canonical Ltd.
-# This file is distributed under the same license as the PACKAGE package.
+# This file is distributed under the same license as the package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-07-18 19:55-0300\n"
+"POT-Creation-Date: 2017-03-16 16:43-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -18,927 +18,1514 @@
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
-#: ../armhf-build/po/com.ubuntu.filemanager.desktop.in.in.h:1
-#: ../qbuild/po/com.ubuntu.filemanager.desktop.in.in.h:1
-#: ../sbuild/po/com.ubuntu.filemanager.desktop.in.in.h:1
-#: ../ssbuild/po/com.ubuntu.filemanager.desktop.in.in.h:1
-#: com.ubuntu.filemanager.desktop.in.in.h:1
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:138
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:138
+msgid "About Application"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:139
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:139
+msgid ""
+"The <b>Application</b> example demonstrates how to write modern GUI "
+"applications using Qt, with a menu bar, toolbars, and a status bar."
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:157
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:157
+msgid "&New"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:159
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:159
+msgid "Create a new file"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:163
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:163
+msgid "&Open..."
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:165
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:165
+msgid "Open an existing file"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:169
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:169
+msgid "&Save"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:171
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:171
+msgid "Save the document to disk"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:174
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:174
+msgid "Save &As..."
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:176
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:176
+msgid "Save the document under a new name"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:180
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:180
+msgid "E&xit"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:183
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:183
+msgid "Exit the application"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:187
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:187
+msgid "Cu&t"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:190
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:190
+msgid "Cut the current selection's contents to the clipboard"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:194
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:194
+msgid "&Copy"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:196
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:196
+msgid "Copy the current selection's contents to the clipboard"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:200
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:200
+msgid "&Paste"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:202
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:202
+msgid "Paste the clipboard's contents into the current selection"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:206
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:206
+msgid "&About"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:207
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:207
+msgid "Show the application's About box"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:211
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:211
+msgid "About &Qt"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:212
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:212
+msgid "Show the Qt library's About box"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:231
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:231
+msgid "&File"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:242
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:242
+msgid "&Edit"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:249
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:249
+msgid "&Help"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:258
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:258
+msgid "File"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:265
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:265
+msgid "Edit"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:276
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:276
+msgid "Ready"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:308
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:327
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:354
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:308
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:327
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:354
+msgid "Application"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:309
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:309
+msgid ""
+"The document has been modified.\n"
+"Do you want to save your changes?"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:328
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:328
+#, qt-format
+msgid ""
+"Cannot read file %1:\n"
+"%2."
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:344
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:344
+msgid "File loaded"
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:355
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:355
+#, qt-format
+msgid ""
+"Cannot write file %1:\n"
+"%2."
+msgstr ""
+
+#: ../parts/desktop-ubuntu-app-platform/build/demos/qt5/src/mainwindow.cpp:371
+#: ../parts/desktop-ubuntu-app-platform/src/demos/qt5/src/mainwindow.cpp:371
+msgid "File saved"
+msgstr ""
+
+#: ../parts/ubuntu-filemanager-app/build/po/ubuntu-filemanager-app.desktop.in.in.h:1
+#: ../parts/ubuntu-filemanager-app/src/qbuild/po/ubuntu-filemanager-app.desktop.in.in.h:1
+#: ../qbuild/po/ubuntu-filemanager-app.desktop.in.in.h:1
+#: ubuntu-filemanager-app.desktop.in.in.h:1
msgid "File Manager"
msgstr ""
-#: ../sbuild/package/qml/components/FolderIconView.qml:57
-#: ../sbuild/package/qml/components/FolderListView.qml:36
-#: ../sbuild/src/app/qml/components/FolderIconView.qml:57
-#: ../sbuild/src/app/qml/components/FolderListView.qml:36
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/components/FolderIconView.qml:57
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/components/FolderListView.qml:36
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/components/FolderIconView.qml:57
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/components/FolderListView.qml:36
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/components/FolderIconView.qml:57
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/components/FolderListView.qml:36
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/components/FolderIconView.qml:57
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/components/FolderListView.qml:36
+#: ../prime/usr/share/filemanager/qml/components/FolderIconView.qml:57
+#: ../prime/usr/share/filemanager/qml/components/FolderListView.qml:36
+#: ../qbuild/src/app/qml/components/FolderIconView.qml:57
+#: ../qbuild/src/app/qml/components/FolderListView.qml:36
#: ../src/app/qml/components/FolderIconView.qml:57
#: ../src/app/qml/components/FolderListView.qml:36
-#: ../ssbuild/package/qml/components/FolderIconView.qml:57
-#: ../ssbuild/package/qml/components/FolderListView.qml:36
-#: ../ssbuild/src/app/qml/components/FolderIconView.qml:57
-#: ../ssbuild/src/app/qml/components/FolderListView.qml:36
+#: ../stage/usr/share/filemanager/qml/components/FolderIconView.qml:57
+#: ../stage/usr/share/filemanager/qml/components/FolderListView.qml:36
#, qt-format
msgid "%1 (%2 file)"
msgid_plural "%1 (%2 files)"
msgstr[0] ""
msgstr[1] ""
-#: ../sbuild/package/qml/components/PathHistoryRow.qml:89
-#: ../sbuild/package/qml/ui/FolderListPage.qml:872
-#: ../sbuild/src/app/qml/components/PathHistoryRow.qml:89
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:875
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/components/PathHistoryRow.qml:89
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:892
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/components/PathHistoryRow.qml:89
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:892
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/components/PathHistoryRow.qml:89
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:895
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/components/PathHistoryRow.qml:89
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:892
+#: ../prime/usr/share/filemanager/qml/components/PathHistoryRow.qml:89
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:892
+#: ../qbuild/src/app/qml/components/PathHistoryRow.qml:89
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:892
#: ../src/app/qml/components/PathHistoryRow.qml:89
-#: ../src/app/qml/ui/FolderListPage.qml:875
-#: ../ssbuild/package/qml/components/PathHistoryRow.qml:89
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:858
-#: ../ssbuild/src/app/qml/components/PathHistoryRow.qml:89
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:858
+#: ../src/app/qml/ui/FolderListPage.qml:892
+#: ../stage/usr/share/filemanager/qml/components/PathHistoryRow.qml:89
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:892
msgid "Device"
msgstr ""
-#: ../sbuild/package/qml/components/PlacesSidebar.qml:54
-#: ../sbuild/package/qml/ui/FolderListPage.qml:31
-#: ../sbuild/package/qml/ui/PlacesPage.qml:31
-#: ../sbuild/package/qml/ui/PlacesPopover.qml:102
-#: ../sbuild/src/app/qml/components/PlacesSidebar.qml:54
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:31
-#: ../sbuild/src/app/qml/ui/PlacesPage.qml:31
-#: ../sbuild/src/app/qml/ui/PlacesPopover.qml:102
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/components/PlacesSidebar.qml:54
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:31
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/PlacesPage.qml:31
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/PlacesPopover.qml:102
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/components/PlacesSidebar.qml:54
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:31
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/PlacesPage.qml:31
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/PlacesPopover.qml:102
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/components/PlacesSidebar.qml:54
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:31
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/PlacesPage.qml:31
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/PlacesPopover.qml:102
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/components/PlacesSidebar.qml:54
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:31
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/PlacesPage.qml:31
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/PlacesPopover.qml:102
+#: ../prime/usr/share/filemanager/qml/components/PlacesSidebar.qml:54
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:31
+#: ../prime/usr/share/filemanager/qml/ui/PlacesPage.qml:31
+#: ../prime/usr/share/filemanager/qml/ui/PlacesPopover.qml:102
+#: ../qbuild/src/app/qml/components/PlacesSidebar.qml:54
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:31
+#: ../qbuild/src/app/qml/ui/PlacesPage.qml:31
+#: ../qbuild/src/app/qml/ui/PlacesPopover.qml:102
#: ../src/app/qml/components/PlacesSidebar.qml:54
#: ../src/app/qml/ui/FolderListPage.qml:31 ../src/app/qml/ui/PlacesPage.qml:31
#: ../src/app/qml/ui/PlacesPopover.qml:102
-#: ../ssbuild/package/qml/components/PlacesSidebar.qml:54
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:30
-#: ../ssbuild/package/qml/ui/PlacesPage.qml:31
-#: ../ssbuild/package/qml/ui/PlacesPopover.qml:102
-#: ../ssbuild/src/app/qml/components/PlacesSidebar.qml:54
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:30
-#: ../ssbuild/src/app/qml/ui/PlacesPage.qml:31
-#: ../ssbuild/src/app/qml/ui/PlacesPopover.qml:102
+#: ../stage/usr/share/filemanager/qml/components/PlacesSidebar.qml:54
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:31
+#: ../stage/usr/share/filemanager/qml/ui/PlacesPage.qml:31
+#: ../stage/usr/share/filemanager/qml/ui/PlacesPopover.qml:102
msgid "Places"
msgstr ""
-#: ../sbuild/package/qml/content-hub/FileOpener.qml:27
-#: ../sbuild/src/app/qml/content-hub/FileOpener.qml:27
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/content-hub/FileOpener.qml:27
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/content-hub/FileOpener.qml:27
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/content-hub/FileOpener.qml:27
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/content-hub/FileOpener.qml:27
+#: ../prime/usr/share/filemanager/qml/content-hub/FileOpener.qml:27
+#: ../qbuild/src/app/qml/content-hub/FileOpener.qml:27
#: ../src/app/qml/content-hub/FileOpener.qml:27
-#: ../ssbuild/package/qml/content-hub/FileOpener.qml:27
-#: ../ssbuild/src/app/qml/content-hub/FileOpener.qml:27
+#: ../stage/usr/share/filemanager/qml/content-hub/FileOpener.qml:27
msgid "Open with"
msgstr ""
-#: ../sbuild/package/qml/filemanager.qml:83
-#: ../sbuild/package/qml/ui/FolderListPage.qml:114
-#: ../sbuild/package/qml/ui/SettingsSheet.qml:33
-#: ../sbuild/src/app/qml/filemanager.qml:83
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:114
-#: ../sbuild/src/app/qml/ui/SettingsSheet.qml:33
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/filemanager.qml:83
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:114
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/SettingsSheet.qml:33
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/filemanager.qml:83
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:114
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/SettingsSheet.qml:33
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/filemanager.qml:83
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:114
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/SettingsSheet.qml:33
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/filemanager.qml:83
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:114
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/SettingsSheet.qml:33
+#: ../prime/usr/share/filemanager/qml/filemanager.qml:83
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:114
+#: ../prime/usr/share/filemanager/qml/ui/SettingsSheet.qml:33
+#: ../qbuild/src/app/qml/filemanager.qml:83
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:114
+#: ../qbuild/src/app/qml/ui/SettingsSheet.qml:33
#: ../src/app/qml/filemanager.qml:83 ../src/app/qml/ui/FolderListPage.qml:114
#: ../src/app/qml/ui/SettingsSheet.qml:33
-#: ../ssbuild/package/qml/filemanager.qml:81
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:112
-#: ../ssbuild/package/qml/ui/SettingsSheet.qml:33
-#: ../ssbuild/src/app/qml/filemanager.qml:81
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:112
-#: ../ssbuild/src/app/qml/ui/SettingsSheet.qml:33
+#: ../stage/usr/share/filemanager/qml/filemanager.qml:83
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:114
+#: ../stage/usr/share/filemanager/qml/ui/SettingsSheet.qml:33
msgid "Settings"
msgstr ""
-#: ../sbuild/package/qml/filemanager.qml:84
-#: ../sbuild/src/app/qml/filemanager.qml:84 ../src/app/qml/filemanager.qml:84
-#: ../ssbuild/package/qml/filemanager.qml:82
-#: ../ssbuild/src/app/qml/filemanager.qml:82
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/filemanager.qml:84
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/filemanager.qml:84
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/filemanager.qml:84
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/filemanager.qml:84
+#: ../prime/usr/share/filemanager/qml/filemanager.qml:84
+#: ../qbuild/src/app/qml/filemanager.qml:84 ../src/app/qml/filemanager.qml:84
+#: ../stage/usr/share/filemanager/qml/filemanager.qml:84
msgid "Change app settings"
msgstr ""
-#: ../sbuild/package/qml/filemanager.qml:295
-#: ../sbuild/package/qml/ui/FolderListPage.qml:406
-#: ../sbuild/package/qml/ui/ViewPopover.qml:70
-#: ../sbuild/src/app/qml/filemanager.qml:287
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:409
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:70
-#: ../src/app/qml/filemanager.qml:287 ../src/app/qml/ui/FolderListPage.qml:409
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/filemanager.qml:299
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:418
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:70
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/filemanager.qml:299
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:418
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:70
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/filemanager.qml:299
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:430
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:70
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/filemanager.qml:299
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:418
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:70
+#: ../prime/usr/share/filemanager/qml/filemanager.qml:299
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:418
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:70
+#: ../qbuild/src/app/qml/filemanager.qml:299
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:418
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:70
+#: ../src/app/qml/filemanager.qml:299 ../src/app/qml/ui/FolderListPage.qml:418
#: ../src/app/qml/ui/ViewPopover.qml:70
-#: ../ssbuild/package/qml/filemanager.qml:291
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:392
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:70
-#: ../ssbuild/src/app/qml/filemanager.qml:291
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:392
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:70
+#: ../stage/usr/share/filemanager/qml/filemanager.qml:299
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:418
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:70
msgid "Icons"
msgstr ""
-#: ../sbuild/package/qml/filemanager.qml:295
-#: ../sbuild/package/qml/ui/FolderListPage.qml:422
-#: ../sbuild/package/qml/ui/ViewPopover.qml:71
-#: ../sbuild/src/app/qml/filemanager.qml:287
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:425
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:71
-#: ../src/app/qml/filemanager.qml:287 ../src/app/qml/ui/FolderListPage.qml:425
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/filemanager.qml:299
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:434
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:71
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/filemanager.qml:299
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:434
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:71
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/filemanager.qml:299
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:446
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:71
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/filemanager.qml:299
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:434
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:71
+#: ../prime/usr/share/filemanager/qml/filemanager.qml:299
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:434
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:71
+#: ../qbuild/src/app/qml/filemanager.qml:299
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:434
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:71
+#: ../src/app/qml/filemanager.qml:299 ../src/app/qml/ui/FolderListPage.qml:434
#: ../src/app/qml/ui/ViewPopover.qml:71
-#: ../ssbuild/package/qml/filemanager.qml:291
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:408
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:71
-#: ../ssbuild/src/app/qml/filemanager.qml:291
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:408
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:71
+#: ../stage/usr/share/filemanager/qml/filemanager.qml:299
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:434
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:71
msgid "List"
msgstr ""
-#: ../sbuild/package/qml/filemanager.qml:324
-#: ../sbuild/src/app/qml/filemanager.qml:316
-#: ../src/app/qml/filemanager.qml:316
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/filemanager.qml:328
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/filemanager.qml:328
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/filemanager.qml:328
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/filemanager.qml:328
+#: ../prime/usr/share/filemanager/qml/filemanager.qml:328
+#: ../qbuild/src/app/qml/filemanager.qml:328 ../src/app/qml/filemanager.qml:328
+#: ../stage/usr/share/filemanager/qml/filemanager.qml:328
#, qt-format
msgid "File %1"
msgstr ""
-#: ../sbuild/package/qml/filemanager.qml:324
-#: ../sbuild/src/app/qml/filemanager.qml:316
-#: ../src/app/qml/filemanager.qml:316
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/filemanager.qml:328
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/filemanager.qml:328
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/filemanager.qml:328
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/filemanager.qml:328
+#: ../prime/usr/share/filemanager/qml/filemanager.qml:328
+#: ../qbuild/src/app/qml/filemanager.qml:328 ../src/app/qml/filemanager.qml:328
+#: ../stage/usr/share/filemanager/qml/filemanager.qml:328
#, qt-format
msgid "%1 Files"
msgstr ""
-#: ../sbuild/package/qml/filemanager.qml:325
-#: ../sbuild/src/app/qml/filemanager.qml:317
-#: ../src/app/qml/filemanager.qml:317
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/filemanager.qml:329
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/filemanager.qml:329
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/filemanager.qml:329
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/filemanager.qml:329
+#: ../prime/usr/share/filemanager/qml/filemanager.qml:329
+#: ../qbuild/src/app/qml/filemanager.qml:329 ../src/app/qml/filemanager.qml:329
+#: ../stage/usr/share/filemanager/qml/filemanager.qml:329
#, qt-format
msgid "Saved to: %1"
msgstr ""
-#: ../sbuild/package/qml/ui/AuthenticationDialog.qml:25
-#: ../sbuild/package/qml/ui/NetAuthenticationDialog.qml:26
-#: ../sbuild/src/app/qml/ui/AuthenticationDialog.qml:25
-#: ../sbuild/src/app/qml/ui/NetAuthenticationDialog.qml:26
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/AuthenticationDialog.qml:25
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/NetAuthenticationDialog.qml:26
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:25
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:26
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/AuthenticationDialog.qml:25
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:26
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/AuthenticationDialog.qml:25
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/NetAuthenticationDialog.qml:26
+#: ../prime/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:25
+#: ../prime/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:26
+#: ../qbuild/src/app/qml/ui/AuthenticationDialog.qml:25
+#: ../qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:26
#: ../src/app/qml/ui/AuthenticationDialog.qml:25
#: ../src/app/qml/ui/NetAuthenticationDialog.qml:26
-#: ../ssbuild/package/qml/ui/AuthenticationDialog.qml:25
-#: ../ssbuild/package/qml/ui/NetAuthenticationDialog.qml:26
-#: ../ssbuild/src/app/qml/ui/AuthenticationDialog.qml:25
-#: ../ssbuild/src/app/qml/ui/NetAuthenticationDialog.qml:26
+#: ../stage/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:25
+#: ../stage/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:26
msgid "Authentication required"
msgstr ""
-#: ../sbuild/package/qml/ui/AuthenticationDialog.qml:27
-#: ../sbuild/src/app/qml/ui/AuthenticationDialog.qml:27
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/AuthenticationDialog.qml:27
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:27
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/AuthenticationDialog.qml:27
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/AuthenticationDialog.qml:27
+#: ../prime/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:27
+#: ../qbuild/src/app/qml/ui/AuthenticationDialog.qml:27
#: ../src/app/qml/ui/AuthenticationDialog.qml:27
-#: ../ssbuild/package/qml/ui/AuthenticationDialog.qml:27
-#: ../ssbuild/src/app/qml/ui/AuthenticationDialog.qml:27
+#: ../stage/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:27
msgid "Password is required to access all files"
msgstr ""
-#: ../sbuild/package/qml/ui/AuthenticationDialog.qml:39
-#: ../sbuild/src/app/qml/ui/AuthenticationDialog.qml:39
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/AuthenticationDialog.qml:39
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:39
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/AuthenticationDialog.qml:39
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/AuthenticationDialog.qml:39
+#: ../prime/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:39
+#: ../qbuild/src/app/qml/ui/AuthenticationDialog.qml:39
#: ../src/app/qml/ui/AuthenticationDialog.qml:39
-#: ../ssbuild/package/qml/ui/AuthenticationDialog.qml:39
-#: ../ssbuild/src/app/qml/ui/AuthenticationDialog.qml:39
+#: ../stage/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:39
msgid "password"
msgstr ""
-#: ../sbuild/package/qml/ui/AuthenticationDialog.qml:49
-#: ../sbuild/package/qml/ui/ConfirmDialog.qml:31
-#: ../sbuild/package/qml/ui/ConfirmDialogWithInput.qml:49
-#: ../sbuild/package/qml/ui/FolderListPage.qml:706
-#: ../sbuild/package/qml/ui/NotifyDialog.qml:25
-#: ../sbuild/src/app/qml/ui/AuthenticationDialog.qml:49
-#: ../sbuild/src/app/qml/ui/ConfirmDialog.qml:31
-#: ../sbuild/src/app/qml/ui/ConfirmDialogWithInput.qml:49
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:709
-#: ../sbuild/src/app/qml/ui/NotifyDialog.qml:25
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/AuthenticationDialog.qml:49
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ConfirmDialog.qml:31
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ConfirmDialogWithInput.qml:49
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:726
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/NotifyDialog.qml:25
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:49
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ConfirmDialog.qml:31
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ConfirmDialogWithInput.qml:49
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:726
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/NotifyDialog.qml:25
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/AuthenticationDialog.qml:49
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ConfirmDialog.qml:31
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ConfirmDialogWithInput.qml:49
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:729
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/NotifyDialog.qml:25
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/AuthenticationDialog.qml:49
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ConfirmDialog.qml:31
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ConfirmDialogWithInput.qml:49
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:726
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/NotifyDialog.qml:25
+#: ../prime/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:49
+#: ../prime/usr/share/filemanager/qml/ui/ConfirmDialog.qml:31
+#: ../prime/usr/share/filemanager/qml/ui/ConfirmDialogWithInput.qml:49
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:726
+#: ../prime/usr/share/filemanager/qml/ui/NotifyDialog.qml:25
+#: ../qbuild/src/app/qml/ui/AuthenticationDialog.qml:49
+#: ../qbuild/src/app/qml/ui/ConfirmDialog.qml:31
+#: ../qbuild/src/app/qml/ui/ConfirmDialogWithInput.qml:49
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:726
+#: ../qbuild/src/app/qml/ui/NotifyDialog.qml:25
#: ../src/app/qml/ui/AuthenticationDialog.qml:49
#: ../src/app/qml/ui/ConfirmDialog.qml:31
#: ../src/app/qml/ui/ConfirmDialogWithInput.qml:49
-#: ../src/app/qml/ui/FolderListPage.qml:709
+#: ../src/app/qml/ui/FolderListPage.qml:726
#: ../src/app/qml/ui/NotifyDialog.qml:25
-#: ../ssbuild/package/qml/ui/AuthenticationDialog.qml:49
-#: ../ssbuild/package/qml/ui/ConfirmDialog.qml:31
-#: ../ssbuild/package/qml/ui/ConfirmDialogWithInput.qml:47
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:692
-#: ../ssbuild/package/qml/ui/NotifyDialog.qml:25
-#: ../ssbuild/src/app/qml/ui/AuthenticationDialog.qml:49
-#: ../ssbuild/src/app/qml/ui/ConfirmDialog.qml:31
-#: ../ssbuild/src/app/qml/ui/ConfirmDialogWithInput.qml:47
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:692
-#: ../ssbuild/src/app/qml/ui/NotifyDialog.qml:25
+#: ../stage/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:49
+#: ../stage/usr/share/filemanager/qml/ui/ConfirmDialog.qml:31
+#: ../stage/usr/share/filemanager/qml/ui/ConfirmDialogWithInput.qml:49
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:726
+#: ../stage/usr/share/filemanager/qml/ui/NotifyDialog.qml:25
msgid "OK"
msgstr ""
-#: ../sbuild/package/qml/ui/AuthenticationDialog.qml:61
-#: ../sbuild/package/qml/ui/ConfirmDialog.qml:41
-#: ../sbuild/package/qml/ui/ConfirmDialogWithInput.qml:59
-#: ../sbuild/package/qml/ui/FileActionDialog.qml:45
-#: ../sbuild/package/qml/ui/FileOperationProgressDialog.qml:44
-#: ../sbuild/package/qml/ui/FolderListPage.qml:384
-#: ../sbuild/package/qml/ui/FolderListPage.qml:697
-#: ../sbuild/package/qml/ui/FolderListPage.qml:764
-#: ../sbuild/package/qml/ui/GoToDialog.qml:67
-#: ../sbuild/package/qml/ui/NetAuthenticationDialog.qml:108
-#: ../sbuild/src/app/qml/ui/AuthenticationDialog.qml:61
-#: ../sbuild/src/app/qml/ui/ConfirmDialog.qml:41
-#: ../sbuild/src/app/qml/ui/ConfirmDialogWithInput.qml:59
-#: ../sbuild/src/app/qml/ui/FileActionDialog.qml:45
-#: ../sbuild/src/app/qml/ui/FileOperationProgressDialog.qml:44
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:387
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:700
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:767
-#: ../sbuild/src/app/qml/ui/GoToDialog.qml:67
-#: ../sbuild/src/app/qml/ui/NetAuthenticationDialog.qml:108
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/AuthenticationDialog.qml:61
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ConfirmDialog.qml:41
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ConfirmDialogWithInput.qml:59
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileActionDialog.qml:45
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileOperationProgressDialog.qml:44
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:396
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:717
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:784
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/GoToDialog.qml:67
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/NetAuthenticationDialog.qml:108
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:61
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ConfirmDialog.qml:41
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ConfirmDialogWithInput.qml:59
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileActionDialog.qml:45
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileOperationProgressDialog.qml:44
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:396
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:717
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:784
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/GoToDialog.qml:67
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:108
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/AuthenticationDialog.qml:61
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ConfirmDialog.qml:41
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ConfirmDialogWithInput.qml:59
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileActionDialog.qml:45
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileOperationProgressDialog.qml:44
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:408
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:720
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:787
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/GoToDialog.qml:67
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:108
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/AuthenticationDialog.qml:61
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ConfirmDialog.qml:41
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ConfirmDialogWithInput.qml:59
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileActionDialog.qml:45
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileOperationProgressDialog.qml:44
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:396
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:717
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:784
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/GoToDialog.qml:67
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/NetAuthenticationDialog.qml:108
+#: ../prime/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:61
+#: ../prime/usr/share/filemanager/qml/ui/ConfirmDialog.qml:41
+#: ../prime/usr/share/filemanager/qml/ui/ConfirmDialogWithInput.qml:59
+#: ../prime/usr/share/filemanager/qml/ui/FileActionDialog.qml:45
+#: ../prime/usr/share/filemanager/qml/ui/FileOperationProgressDialog.qml:44
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:396
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:717
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:784
+#: ../prime/usr/share/filemanager/qml/ui/GoToDialog.qml:67
+#: ../prime/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:108
+#: ../qbuild/src/app/qml/ui/AuthenticationDialog.qml:61
+#: ../qbuild/src/app/qml/ui/ConfirmDialog.qml:41
+#: ../qbuild/src/app/qml/ui/ConfirmDialogWithInput.qml:59
+#: ../qbuild/src/app/qml/ui/FileActionDialog.qml:45
+#: ../qbuild/src/app/qml/ui/FileOperationProgressDialog.qml:44
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:396
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:717
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:784
+#: ../qbuild/src/app/qml/ui/GoToDialog.qml:67
+#: ../qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:108
#: ../src/app/qml/ui/AuthenticationDialog.qml:61
#: ../src/app/qml/ui/ConfirmDialog.qml:41
#: ../src/app/qml/ui/ConfirmDialogWithInput.qml:59
#: ../src/app/qml/ui/FileActionDialog.qml:45
#: ../src/app/qml/ui/FileOperationProgressDialog.qml:44
-#: ../src/app/qml/ui/FolderListPage.qml:387
-#: ../src/app/qml/ui/FolderListPage.qml:700
-#: ../src/app/qml/ui/FolderListPage.qml:767
-#: ../src/app/qml/ui/GoToDialog.qml:67
+#: ../src/app/qml/ui/FolderListPage.qml:396
+#: ../src/app/qml/ui/FolderListPage.qml:717
+#: ../src/app/qml/ui/FolderListPage.qml:784 ../src/app/qml/ui/GoToDialog.qml:67
#: ../src/app/qml/ui/NetAuthenticationDialog.qml:108
-#: ../ssbuild/package/qml/ui/AuthenticationDialog.qml:61
-#: ../ssbuild/package/qml/ui/ConfirmDialog.qml:41
-#: ../ssbuild/package/qml/ui/ConfirmDialogWithInput.qml:57
-#: ../ssbuild/package/qml/ui/FileActionDialog.qml:45
-#: ../ssbuild/package/qml/ui/FileOperationProgressDialog.qml:44
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:370
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:683
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:750
-#: ../ssbuild/package/qml/ui/GoToDialog.qml:67
-#: ../ssbuild/package/qml/ui/NetAuthenticationDialog.qml:108
-#: ../ssbuild/src/app/qml/ui/AuthenticationDialog.qml:61
-#: ../ssbuild/src/app/qml/ui/ConfirmDialog.qml:41
-#: ../ssbuild/src/app/qml/ui/ConfirmDialogWithInput.qml:57
-#: ../ssbuild/src/app/qml/ui/FileActionDialog.qml:45
-#: ../ssbuild/src/app/qml/ui/FileOperationProgressDialog.qml:44
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:370
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:683
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:750
-#: ../ssbuild/src/app/qml/ui/GoToDialog.qml:67
-#: ../ssbuild/src/app/qml/ui/NetAuthenticationDialog.qml:108
+#: ../stage/usr/share/filemanager/qml/ui/AuthenticationDialog.qml:61
+#: ../stage/usr/share/filemanager/qml/ui/ConfirmDialog.qml:41
+#: ../stage/usr/share/filemanager/qml/ui/ConfirmDialogWithInput.qml:59
+#: ../stage/usr/share/filemanager/qml/ui/FileActionDialog.qml:45
+#: ../stage/usr/share/filemanager/qml/ui/FileOperationProgressDialog.qml:44
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:396
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:717
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:784
+#: ../stage/usr/share/filemanager/qml/ui/GoToDialog.qml:67
+#: ../stage/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:108
msgid "Cancel"
msgstr ""
-#: ../sbuild/package/qml/ui/FileActionDialog.qml:30
-#: ../sbuild/src/app/qml/ui/FileActionDialog.qml:30
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileActionDialog.qml:30
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileActionDialog.qml:30
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileActionDialog.qml:30
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileActionDialog.qml:30
+#: ../prime/usr/share/filemanager/qml/ui/FileActionDialog.qml:30
+#: ../qbuild/src/app/qml/ui/FileActionDialog.qml:30
#: ../src/app/qml/ui/FileActionDialog.qml:30
-#: ../ssbuild/package/qml/ui/FileActionDialog.qml:30
-#: ../ssbuild/src/app/qml/ui/FileActionDialog.qml:30
+#: ../stage/usr/share/filemanager/qml/ui/FileActionDialog.qml:30
msgid "Choose action"
msgstr ""
-#: ../sbuild/package/qml/ui/FileActionDialog.qml:31
-#: ../sbuild/src/app/qml/ui/FileActionDialog.qml:31
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileActionDialog.qml:31
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileActionDialog.qml:31
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileActionDialog.qml:31
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileActionDialog.qml:31
+#: ../prime/usr/share/filemanager/qml/ui/FileActionDialog.qml:31
+#: ../qbuild/src/app/qml/ui/FileActionDialog.qml:31
#: ../src/app/qml/ui/FileActionDialog.qml:31
-#: ../ssbuild/package/qml/ui/FileActionDialog.qml:31
-#: ../ssbuild/src/app/qml/ui/FileActionDialog.qml:31
+#: ../stage/usr/share/filemanager/qml/ui/FileActionDialog.qml:31
#, qt-format
msgid "For file: %1"
msgstr ""
-#: ../sbuild/package/qml/ui/FileActionDialog.qml:35
-#: ../sbuild/src/app/qml/ui/FileActionDialog.qml:35
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileActionDialog.qml:35
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileActionDialog.qml:35
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileActionDialog.qml:35
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileActionDialog.qml:35
+#: ../prime/usr/share/filemanager/qml/ui/FileActionDialog.qml:35
+#: ../qbuild/src/app/qml/ui/FileActionDialog.qml:35
#: ../src/app/qml/ui/FileActionDialog.qml:35
-#: ../ssbuild/package/qml/ui/FileActionDialog.qml:35
-#: ../ssbuild/src/app/qml/ui/FileActionDialog.qml:35
+#: ../stage/usr/share/filemanager/qml/ui/FileActionDialog.qml:35
msgid "Open"
msgstr ""
-#: ../sbuild/package/qml/ui/FileDetailsPopover.qml:37
-#: ../sbuild/src/app/qml/ui/FileDetailsPopover.qml:37
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileDetailsPopover.qml:37
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:37
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileDetailsPopover.qml:37
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileDetailsPopover.qml:37
+#: ../prime/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:37
+#: ../qbuild/src/app/qml/ui/FileDetailsPopover.qml:37
#: ../src/app/qml/ui/FileDetailsPopover.qml:37
-#: ../ssbuild/package/qml/ui/FileDetailsPopover.qml:37
-#: ../ssbuild/src/app/qml/ui/FileDetailsPopover.qml:37
+#: ../stage/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:37
msgid "Readable"
msgstr ""
-#: ../sbuild/package/qml/ui/FileDetailsPopover.qml:40
-#: ../sbuild/src/app/qml/ui/FileDetailsPopover.qml:40
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileDetailsPopover.qml:40
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:40
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileDetailsPopover.qml:40
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileDetailsPopover.qml:40
+#: ../prime/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:40
+#: ../qbuild/src/app/qml/ui/FileDetailsPopover.qml:40
#: ../src/app/qml/ui/FileDetailsPopover.qml:40
-#: ../ssbuild/package/qml/ui/FileDetailsPopover.qml:40
-#: ../ssbuild/src/app/qml/ui/FileDetailsPopover.qml:40
+#: ../stage/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:40
msgid "Writable"
msgstr ""
-#: ../sbuild/package/qml/ui/FileDetailsPopover.qml:43
-#: ../sbuild/src/app/qml/ui/FileDetailsPopover.qml:43
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileDetailsPopover.qml:43
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:43
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileDetailsPopover.qml:43
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileDetailsPopover.qml:43
+#: ../prime/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:43
+#: ../qbuild/src/app/qml/ui/FileDetailsPopover.qml:43
#: ../src/app/qml/ui/FileDetailsPopover.qml:43
-#: ../ssbuild/package/qml/ui/FileDetailsPopover.qml:43
-#: ../ssbuild/src/app/qml/ui/FileDetailsPopover.qml:43
+#: ../stage/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:43
msgid "Executable"
msgstr ""
-#: ../sbuild/package/qml/ui/FileDetailsPopover.qml:91
-#: ../sbuild/src/app/qml/ui/FileDetailsPopover.qml:91
-#: ../src/app/qml/ui/FileDetailsPopover.qml:91
-#: ../ssbuild/package/qml/ui/FileDetailsPopover.qml:91
-#: ../ssbuild/src/app/qml/ui/FileDetailsPopover.qml:91
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileDetailsPopover.qml:95
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:95
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileDetailsPopover.qml:95
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileDetailsPopover.qml:95
+#: ../prime/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:95
+#: ../qbuild/src/app/qml/ui/FileDetailsPopover.qml:95
+#: ../src/app/qml/ui/FileDetailsPopover.qml:95
+#: ../stage/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:95
msgid "Path:"
msgstr ""
-#: ../sbuild/package/qml/ui/FileDetailsPopover.qml:102
-#: ../sbuild/src/app/qml/ui/FileDetailsPopover.qml:102
-#: ../src/app/qml/ui/FileDetailsPopover.qml:102
-#: ../ssbuild/package/qml/ui/FileDetailsPopover.qml:102
-#: ../ssbuild/src/app/qml/ui/FileDetailsPopover.qml:102
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileDetailsPopover.qml:106
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:106
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileDetailsPopover.qml:106
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileDetailsPopover.qml:106
+#: ../prime/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:106
+#: ../qbuild/src/app/qml/ui/FileDetailsPopover.qml:106
+#: ../src/app/qml/ui/FileDetailsPopover.qml:106
+#: ../stage/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:106
msgid "Contents:"
msgstr ""
-#: ../sbuild/package/qml/ui/FileDetailsPopover.qml:103
-#: ../sbuild/src/app/qml/ui/FileDetailsPopover.qml:103
-#: ../src/app/qml/ui/FileDetailsPopover.qml:103
-#: ../ssbuild/package/qml/ui/FileDetailsPopover.qml:103
-#: ../ssbuild/src/app/qml/ui/FileDetailsPopover.qml:103
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileDetailsPopover.qml:107
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:107
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileDetailsPopover.qml:107
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileDetailsPopover.qml:107
+#: ../prime/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:107
+#: ../qbuild/src/app/qml/ui/FileDetailsPopover.qml:107
+#: ../src/app/qml/ui/FileDetailsPopover.qml:107
+#: ../stage/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:107
msgid "Size:"
msgstr ""
-#: ../sbuild/package/qml/ui/FileDetailsPopover.qml:112
-#: ../sbuild/src/app/qml/ui/FileDetailsPopover.qml:112
-#: ../src/app/qml/ui/FileDetailsPopover.qml:112
-#: ../ssbuild/package/qml/ui/FileDetailsPopover.qml:112
-#: ../ssbuild/src/app/qml/ui/FileDetailsPopover.qml:112
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileDetailsPopover.qml:116
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:116
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileDetailsPopover.qml:116
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileDetailsPopover.qml:116
+#: ../prime/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:116
+#: ../qbuild/src/app/qml/ui/FileDetailsPopover.qml:116
+#: ../src/app/qml/ui/FileDetailsPopover.qml:116
+#: ../stage/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:116
msgid "Accessed:"
msgstr ""
-#: ../sbuild/package/qml/ui/FileDetailsPopover.qml:121
-#: ../sbuild/src/app/qml/ui/FileDetailsPopover.qml:121
-#: ../src/app/qml/ui/FileDetailsPopover.qml:121
-#: ../ssbuild/package/qml/ui/FileDetailsPopover.qml:121
-#: ../ssbuild/src/app/qml/ui/FileDetailsPopover.qml:121
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileDetailsPopover.qml:125
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:125
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileDetailsPopover.qml:125
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileDetailsPopover.qml:125
+#: ../prime/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:125
+#: ../qbuild/src/app/qml/ui/FileDetailsPopover.qml:125
+#: ../src/app/qml/ui/FileDetailsPopover.qml:125
+#: ../stage/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:125
msgid "Modified:"
msgstr ""
-#: ../sbuild/package/qml/ui/FileDetailsPopover.qml:130
-#: ../sbuild/src/app/qml/ui/FileDetailsPopover.qml:130
-#: ../src/app/qml/ui/FileDetailsPopover.qml:130
-#: ../ssbuild/package/qml/ui/FileDetailsPopover.qml:130
-#: ../ssbuild/src/app/qml/ui/FileDetailsPopover.qml:130
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileDetailsPopover.qml:134
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:134
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileDetailsPopover.qml:134
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileDetailsPopover.qml:134
+#: ../prime/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:134
+#: ../qbuild/src/app/qml/ui/FileDetailsPopover.qml:134
+#: ../src/app/qml/ui/FileDetailsPopover.qml:134
+#: ../stage/usr/share/filemanager/qml/ui/FileDetailsPopover.qml:134
msgid "Permissions:"
msgstr ""
-#: ../sbuild/package/qml/ui/FileOperationProgressDialog.qml:27
-#: ../sbuild/src/app/qml/ui/FileOperationProgressDialog.qml:27
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileOperationProgressDialog.qml:27
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileOperationProgressDialog.qml:27
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileOperationProgressDialog.qml:27
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileOperationProgressDialog.qml:27
+#: ../prime/usr/share/filemanager/qml/ui/FileOperationProgressDialog.qml:27
+#: ../qbuild/src/app/qml/ui/FileOperationProgressDialog.qml:27
#: ../src/app/qml/ui/FileOperationProgressDialog.qml:27
-#: ../ssbuild/package/qml/ui/FileOperationProgressDialog.qml:27
-#: ../ssbuild/src/app/qml/ui/FileOperationProgressDialog.qml:27
+#: ../stage/usr/share/filemanager/qml/ui/FileOperationProgressDialog.qml:27
msgid "Operation in progress"
msgstr ""
-#: ../sbuild/package/qml/ui/FileOperationProgressDialog.qml:29
-#: ../sbuild/src/app/qml/ui/FileOperationProgressDialog.qml:29
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FileOperationProgressDialog.qml:29
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FileOperationProgressDialog.qml:29
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FileOperationProgressDialog.qml:29
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FileOperationProgressDialog.qml:29
+#: ../prime/usr/share/filemanager/qml/ui/FileOperationProgressDialog.qml:29
+#: ../qbuild/src/app/qml/ui/FileOperationProgressDialog.qml:29
#: ../src/app/qml/ui/FileOperationProgressDialog.qml:29
-#: ../ssbuild/package/qml/ui/FileOperationProgressDialog.qml:29
-#: ../ssbuild/src/app/qml/ui/FileOperationProgressDialog.qml:29
+#: ../stage/usr/share/filemanager/qml/ui/FileOperationProgressDialog.qml:29
msgid "File operation"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:63
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:63
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:63
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:63
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:63
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:63
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:63
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:63
#: ../src/app/qml/ui/FolderListPage.qml:63
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:62
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:62
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:63
#, qt-format
msgid "Paste %1 File"
msgid_plural "Paste %1 Files"
msgstr[0] ""
msgstr[1] ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:67
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:67
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:67
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:67
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:67
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:67
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:67
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:67
#: ../src/app/qml/ui/FolderListPage.qml:67
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:66
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:66
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:67
msgid "Paste files"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:75
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:75
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:75
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:75
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:75
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:75
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:75
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:75
#: ../src/app/qml/ui/FolderListPage.qml:75
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:74
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:74
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:75
msgid "Clear clipboard"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:85
-#: ../sbuild/package/qml/ui/FolderListPage.qml:104
-#: ../sbuild/package/qml/ui/FolderListPage.qml:634
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:85
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:104
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:637
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:85
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:104
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:654
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:85
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:104
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:654
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:85
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:104
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:666
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:85
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:104
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:654
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:85
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:104
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:654
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:85
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:104
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:654
#: ../src/app/qml/ui/FolderListPage.qml:85
#: ../src/app/qml/ui/FolderListPage.qml:104
-#: ../src/app/qml/ui/FolderListPage.qml:637
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:84
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:102
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:620
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:84
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:102
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:620
+#: ../src/app/qml/ui/FolderListPage.qml:654
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:85
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:104
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:654
msgid "Properties"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:94
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:94
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:94
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:94
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:94
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:94
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:94
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:94
#: ../src/app/qml/ui/FolderListPage.qml:94
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:93
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:93
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:94
msgid "New Folder"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:122
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:122
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:122
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:122
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:122
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:122
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:122
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:122
#: ../src/app/qml/ui/FolderListPage.qml:122
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:120
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:120
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:122
msgid "Go To"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:129
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:129
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:129
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:129
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:129
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:129
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:129
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:129
#: ../src/app/qml/ui/FolderListPage.qml:129
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:127
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:127
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:129
msgid "Unlock full access"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:143
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:143
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:143
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:143
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:143
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:143
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:143
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:143
#: ../src/app/qml/ui/FolderListPage.qml:143
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:141
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:141
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:143
msgid "Authentication failed"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:223
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:223
-#: ../src/app/qml/ui/FolderListPage.qml:223
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:219
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:219
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:224
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:224
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:226
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:224
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:224
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:224
+#: ../src/app/qml/ui/FolderListPage.qml:224
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:224
#, qt-format
msgid "%1 file"
msgid_plural "%1 files"
msgstr[0] ""
msgstr[1] ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:277
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:277
-#: ../src/app/qml/ui/FolderListPage.qml:277
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:263
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:263
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:278
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:278
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:290
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:278
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:278
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:278
+#: ../src/app/qml/ui/FolderListPage.qml:278
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:278
msgid "Open in a new tab"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:285
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:285
-#: ../src/app/qml/ui/FolderListPage.qml:285
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:271
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:271
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:286
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:286
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:298
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:286
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:286
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:286
+#: ../src/app/qml/ui/FolderListPage.qml:286
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:286
msgid "Close this tab"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:298
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:298
-#: ../src/app/qml/ui/FolderListPage.qml:298
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:284
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:284
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:299
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:299
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:311
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:299
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:299
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:299
+#: ../src/app/qml/ui/FolderListPage.qml:299
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:299
msgid "Create folder"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:299
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:299
-#: ../src/app/qml/ui/FolderListPage.qml:299
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:285
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:285
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:300
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:300
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:312
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:300
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:300
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:300
+#: ../src/app/qml/ui/FolderListPage.qml:300
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:300
msgid "Enter name for new folder"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:315
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:318
-#: ../src/app/qml/ui/FolderListPage.qml:318
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:301
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:301
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:319
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:319
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:331
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:319
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:319
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:319
+#: ../src/app/qml/ui/FolderListPage.qml:319
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:319
msgid "Create file"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:316
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:319
-#: ../src/app/qml/ui/FolderListPage.qml:319
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:302
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:302
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:320
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:320
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:332
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:320
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:320
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:320
+#: ../src/app/qml/ui/FolderListPage.qml:320
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:320
msgid "Enter name for new file"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:365
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:368
-#: ../src/app/qml/ui/FolderListPage.qml:368
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:351
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:351
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:376
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:376
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:388
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:376
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:376
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:376
+#: ../src/app/qml/ui/FolderListPage.qml:376
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:376
+msgid "Save"
+msgstr ""
+
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:376
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:376
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:388
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:376
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:376
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:376
+#: ../src/app/qml/ui/FolderListPage.qml:376
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:376
msgid "Select"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:466
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:469
-#: ../src/app/qml/ui/FolderListPage.qml:469
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:452
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:452
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:478
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:478
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:490
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:478
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:478
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:478
+#: ../src/app/qml/ui/FolderListPage.qml:478
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:478
msgid "No files"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:486
-#: ../sbuild/package/qml/ui/FolderListPage.qml:595
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:489
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:598
-#: ../src/app/qml/ui/FolderListPage.qml:489
-#: ../src/app/qml/ui/FolderListPage.qml:598
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:472
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:581
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:472
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:581
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:498
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:607
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:498
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:607
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:510
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:619
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:498
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:607
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:498
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:607
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:498
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:607
+#: ../src/app/qml/ui/FolderListPage.qml:498
+#: ../src/app/qml/ui/FolderListPage.qml:607
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:498
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:607
msgid "Delete"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:487
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:490
-#: ../src/app/qml/ui/FolderListPage.qml:490
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:473
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:473
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:499
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:499
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:511
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:499
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:499
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:499
+#: ../src/app/qml/ui/FolderListPage.qml:499
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:499
#, qt-format
msgid "Are you sure you want to permanently delete '%1'?"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:492
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:495
-#: ../src/app/qml/ui/FolderListPage.qml:495
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:478
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:478
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:504
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:504
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:516
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:504
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:504
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:504
+#: ../src/app/qml/ui/FolderListPage.qml:504
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:504
msgid "Deleting files"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:510
-#: ../sbuild/package/qml/ui/FolderListPage.qml:608
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:513
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:611
-#: ../src/app/qml/ui/FolderListPage.qml:513
-#: ../src/app/qml/ui/FolderListPage.qml:611
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:496
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:594
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:496
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:594
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:522
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:620
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:522
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:620
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:534
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:632
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:522
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:620
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:522
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:620
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:522
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:620
+#: ../src/app/qml/ui/FolderListPage.qml:522
+#: ../src/app/qml/ui/FolderListPage.qml:620
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:522
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:620
msgid "Rename"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:511
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:514
-#: ../src/app/qml/ui/FolderListPage.qml:514
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:497
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:497
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:523
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:523
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:535
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:523
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:523
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:523
+#: ../src/app/qml/ui/FolderListPage.qml:523
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:523
msgid "Enter a new name"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:520
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:523
-#: ../src/app/qml/ui/FolderListPage.qml:523
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:506
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:506
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:532
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:532
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:544
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:532
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:532
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:532
+#: ../src/app/qml/ui/FolderListPage.qml:532
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:532
msgid "Could not rename"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:521
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:524
-#: ../src/app/qml/ui/FolderListPage.qml:524
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:507
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:507
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:533
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:533
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:545
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:533
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:533
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:533
+#: ../src/app/qml/ui/FolderListPage.qml:533
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:533
msgid "Insufficient permissions or name already exists?"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:539
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:542
-#: ../src/app/qml/ui/FolderListPage.qml:542
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:525
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:525
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:551
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:551
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:563
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:551
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:551
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:551
+#: ../src/app/qml/ui/FolderListPage.qml:551
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:551
msgid "Extract Archive"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:540
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:543
-#: ../src/app/qml/ui/FolderListPage.qml:543
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:526
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:526
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:552
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:552
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:564
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:552
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:552
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:552
+#: ../src/app/qml/ui/FolderListPage.qml:552
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:552
#, qt-format
msgid "Are you sure you want to extract '%1' here?"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:572
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:575
-#: ../src/app/qml/ui/FolderListPage.qml:575
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:558
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:558
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:584
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:584
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:596
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:584
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:584
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:584
+#: ../src/app/qml/ui/FolderListPage.qml:584
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:584
msgid "Cut"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:583
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:586
-#: ../src/app/qml/ui/FolderListPage.qml:586
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:569
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:569
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:595
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:595
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:607
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:595
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:595
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:595
+#: ../src/app/qml/ui/FolderListPage.qml:595
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:595
msgid "Copy"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:623
-#: ../sbuild/package/qml/ui/FolderListPage.qml:744
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:626
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:747
-#: ../src/app/qml/ui/FolderListPage.qml:626
-#: ../src/app/qml/ui/FolderListPage.qml:747
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:609
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:730
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:609
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:730
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:634
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:634
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:646
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:634
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:634
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:634
+#: ../src/app/qml/ui/FolderListPage.qml:634
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:634
+msgid "Share"
+msgstr ""
+
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:643
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:764
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:643
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:764
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:655
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:767
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:643
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:764
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:643
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:764
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:643
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:764
+#: ../src/app/qml/ui/FolderListPage.qml:643
+#: ../src/app/qml/ui/FolderListPage.qml:764
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:643
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:764
msgid "Extract archive"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:654
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:657
-#: ../src/app/qml/ui/FolderListPage.qml:657
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:640
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:640
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:674
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:674
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:674
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:674
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:674
+#: ../src/app/qml/ui/FolderListPage.qml:674
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:674
msgid "File operation error"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:685
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:688
-#: ../src/app/qml/ui/FolderListPage.qml:688
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:671
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:671
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:705
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:705
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:708
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:705
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:705
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:705
+#: ../src/app/qml/ui/FolderListPage.qml:705
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:705
#, qt-format
msgid "Extracting archive '%1'"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:721
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:724
-#: ../src/app/qml/ui/FolderListPage.qml:724
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:707
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:707
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:741
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:741
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:744
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:741
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:741
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:741
+#: ../src/app/qml/ui/FolderListPage.qml:741
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:741
msgid "Extracting failed"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:722
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:725
-#: ../src/app/qml/ui/FolderListPage.qml:725
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:708
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:708
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:742
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:742
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:745
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:742
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:742
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:742
+#: ../src/app/qml/ui/FolderListPage.qml:742
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:742
#, qt-format
msgid "Extracting the archive '%1' failed."
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:736
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:739
-#: ../src/app/qml/ui/FolderListPage.qml:739
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:722
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:722
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:756
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:756
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:759
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:756
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:756
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:756
+#: ../src/app/qml/ui/FolderListPage.qml:756
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:756
msgid "Archive file"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:737
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:740
-#: ../src/app/qml/ui/FolderListPage.qml:740
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:723
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:723
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:757
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:757
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:760
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:757
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:757
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:757
+#: ../src/app/qml/ui/FolderListPage.qml:757
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:757
msgid "Do you want to extract the archive here?"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:754
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:757
-#: ../src/app/qml/ui/FolderListPage.qml:757
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:740
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:740
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:774
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:774
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:777
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:774
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:774
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:774
+#: ../src/app/qml/ui/FolderListPage.qml:774
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:774
msgid "Open with another app"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:838
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:841
-#: ../src/app/qml/ui/FolderListPage.qml:841
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:824
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:824
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:858
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:858
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:861
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:858
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:858
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:858
+#: ../src/app/qml/ui/FolderListPage.qml:858
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:858
msgid "~/Desktop"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:848
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:851
-#: ../src/app/qml/ui/FolderListPage.qml:851
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:834
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:834
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:868
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:868
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:871
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:868
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:868
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:868
+#: ../src/app/qml/ui/FolderListPage.qml:868
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:868
msgid "~/Public"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:850
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:853
-#: ../src/app/qml/ui/FolderListPage.qml:853
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:836
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:836
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:870
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:870
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:873
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:870
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:870
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:870
+#: ../src/app/qml/ui/FolderListPage.qml:870
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:870
msgid "~/Programs"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:852
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:855
-#: ../src/app/qml/ui/FolderListPage.qml:855
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:838
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:838
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:872
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:872
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:875
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:872
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:872
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:872
+#: ../src/app/qml/ui/FolderListPage.qml:872
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:872
msgid "~/Templates"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:870
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:873
-#: ../src/app/qml/ui/FolderListPage.qml:873
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:856
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:856
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:890
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:890
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:893
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:890
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:890
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:890
+#: ../src/app/qml/ui/FolderListPage.qml:890
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:890
msgid "Home"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:874
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:877
-#: ../src/app/qml/ui/FolderListPage.qml:877
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:860
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:860
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:894
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:894
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:897
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:894
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:894
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:894
+#: ../src/app/qml/ui/FolderListPage.qml:894
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:894
msgid "Network"
msgstr ""
-#: ../sbuild/package/qml/ui/FolderListPage.qml:976
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:979
-#: ../src/app/qml/ui/FolderListPage.qml:979
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:962
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:962
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:996
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:996
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:999
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:996
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:996
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:996
+#: ../src/app/qml/ui/FolderListPage.qml:996
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:996
msgid "Folder not accessible"
msgstr ""
#. TRANSLATORS: this refers to a folder name
-#: ../sbuild/package/qml/ui/FolderListPage.qml:978
-#: ../sbuild/src/app/qml/ui/FolderListPage.qml:981
-#: ../src/app/qml/ui/FolderListPage.qml:981
-#: ../ssbuild/package/qml/ui/FolderListPage.qml:964
-#: ../ssbuild/src/app/qml/ui/FolderListPage.qml:964
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/FolderListPage.qml:998
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/FolderListPage.qml:998
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/FolderListPage.qml:1001
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/FolderListPage.qml:998
+#: ../prime/usr/share/filemanager/qml/ui/FolderListPage.qml:998
+#: ../qbuild/src/app/qml/ui/FolderListPage.qml:998
+#: ../src/app/qml/ui/FolderListPage.qml:998
+#: ../stage/usr/share/filemanager/qml/ui/FolderListPage.qml:998
#, qt-format
msgid "Can not access %1"
msgstr ""
-#: ../sbuild/package/qml/ui/GoToDialog.qml:26
-#: ../sbuild/src/app/qml/ui/GoToDialog.qml:26
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/GoToDialog.qml:26
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/GoToDialog.qml:26
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/GoToDialog.qml:26
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/GoToDialog.qml:26
+#: ../prime/usr/share/filemanager/qml/ui/GoToDialog.qml:26
+#: ../qbuild/src/app/qml/ui/GoToDialog.qml:26
#: ../src/app/qml/ui/GoToDialog.qml:26
-#: ../ssbuild/package/qml/ui/GoToDialog.qml:26
-#: ../ssbuild/src/app/qml/ui/GoToDialog.qml:26
+#: ../stage/usr/share/filemanager/qml/ui/GoToDialog.qml:26
msgid "Go To Location"
msgstr ""
-#: ../sbuild/package/qml/ui/GoToDialog.qml:28
-#: ../sbuild/src/app/qml/ui/GoToDialog.qml:28
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/GoToDialog.qml:28
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/GoToDialog.qml:28
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/GoToDialog.qml:28
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/GoToDialog.qml:28
+#: ../prime/usr/share/filemanager/qml/ui/GoToDialog.qml:28
+#: ../qbuild/src/app/qml/ui/GoToDialog.qml:28
#: ../src/app/qml/ui/GoToDialog.qml:28
-#: ../ssbuild/package/qml/ui/GoToDialog.qml:28
-#: ../ssbuild/src/app/qml/ui/GoToDialog.qml:28
+#: ../stage/usr/share/filemanager/qml/ui/GoToDialog.qml:28
msgid "Enter a location to go to:"
msgstr ""
-#: ../sbuild/package/qml/ui/GoToDialog.qml:45
-#: ../sbuild/package/qml/ui/PlacesPage.qml:65
-#: ../sbuild/package/qml/ui/PlacesPopover.qml:66
-#: ../sbuild/src/app/qml/ui/GoToDialog.qml:45
-#: ../sbuild/src/app/qml/ui/PlacesPage.qml:65
-#: ../sbuild/src/app/qml/ui/PlacesPopover.qml:66
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/GoToDialog.qml:45
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/PlacesPage.qml:65
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/PlacesPopover.qml:66
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/GoToDialog.qml:45
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/PlacesPage.qml:65
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/PlacesPopover.qml:66
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/GoToDialog.qml:45
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/PlacesPage.qml:65
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/PlacesPopover.qml:66
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/GoToDialog.qml:45
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/PlacesPage.qml:65
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/PlacesPopover.qml:66
+#: ../prime/usr/share/filemanager/qml/ui/GoToDialog.qml:45
+#: ../prime/usr/share/filemanager/qml/ui/PlacesPage.qml:65
+#: ../prime/usr/share/filemanager/qml/ui/PlacesPopover.qml:66
+#: ../qbuild/src/app/qml/ui/GoToDialog.qml:45
+#: ../qbuild/src/app/qml/ui/PlacesPage.qml:65
+#: ../qbuild/src/app/qml/ui/PlacesPopover.qml:66
#: ../src/app/qml/ui/GoToDialog.qml:45 ../src/app/qml/ui/PlacesPage.qml:65
#: ../src/app/qml/ui/PlacesPopover.qml:66
-#: ../ssbuild/package/qml/ui/GoToDialog.qml:45
-#: ../ssbuild/package/qml/ui/PlacesPage.qml:65
-#: ../ssbuild/package/qml/ui/PlacesPopover.qml:66
-#: ../ssbuild/src/app/qml/ui/GoToDialog.qml:45
-#: ../ssbuild/src/app/qml/ui/PlacesPage.qml:65
-#: ../ssbuild/src/app/qml/ui/PlacesPopover.qml:66
+#: ../stage/usr/share/filemanager/qml/ui/GoToDialog.qml:45
+#: ../stage/usr/share/filemanager/qml/ui/PlacesPage.qml:65
+#: ../stage/usr/share/filemanager/qml/ui/PlacesPopover.qml:66
msgid "Location..."
msgstr ""
-#: ../sbuild/package/qml/ui/GoToDialog.qml:54
-#: ../sbuild/package/qml/ui/PlacesPage.qml:80
-#: ../sbuild/package/qml/ui/PlacesPopover.qml:81
-#: ../sbuild/src/app/qml/ui/GoToDialog.qml:54
-#: ../sbuild/src/app/qml/ui/PlacesPage.qml:80
-#: ../sbuild/src/app/qml/ui/PlacesPopover.qml:81
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/GoToDialog.qml:54
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/PlacesPage.qml:80
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/PlacesPopover.qml:81
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/GoToDialog.qml:54
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/PlacesPage.qml:80
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/PlacesPopover.qml:81
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/GoToDialog.qml:54
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/PlacesPage.qml:80
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/PlacesPopover.qml:81
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/GoToDialog.qml:54
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/PlacesPage.qml:80
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/PlacesPopover.qml:81
+#: ../prime/usr/share/filemanager/qml/ui/GoToDialog.qml:54
+#: ../prime/usr/share/filemanager/qml/ui/PlacesPage.qml:80
+#: ../prime/usr/share/filemanager/qml/ui/PlacesPopover.qml:81
+#: ../qbuild/src/app/qml/ui/GoToDialog.qml:54
+#: ../qbuild/src/app/qml/ui/PlacesPage.qml:80
+#: ../qbuild/src/app/qml/ui/PlacesPopover.qml:81
#: ../src/app/qml/ui/GoToDialog.qml:54 ../src/app/qml/ui/PlacesPage.qml:80
#: ../src/app/qml/ui/PlacesPopover.qml:81
-#: ../ssbuild/package/qml/ui/GoToDialog.qml:54
-#: ../ssbuild/package/qml/ui/PlacesPage.qml:80
-#: ../ssbuild/package/qml/ui/PlacesPopover.qml:81
-#: ../ssbuild/src/app/qml/ui/GoToDialog.qml:54
-#: ../ssbuild/src/app/qml/ui/PlacesPage.qml:80
-#: ../ssbuild/src/app/qml/ui/PlacesPopover.qml:81
+#: ../stage/usr/share/filemanager/qml/ui/GoToDialog.qml:54
+#: ../stage/usr/share/filemanager/qml/ui/PlacesPage.qml:80
+#: ../stage/usr/share/filemanager/qml/ui/PlacesPopover.qml:81
msgid "Go"
msgstr ""
-#: ../sbuild/package/qml/ui/NetAuthenticationDialog.qml:55
-#: ../sbuild/src/app/qml/ui/NetAuthenticationDialog.qml:55
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/NetAuthenticationDialog.qml:55
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:55
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:55
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/NetAuthenticationDialog.qml:55
+#: ../prime/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:55
+#: ../qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:55
#: ../src/app/qml/ui/NetAuthenticationDialog.qml:55
-#: ../ssbuild/package/qml/ui/NetAuthenticationDialog.qml:55
-#: ../ssbuild/src/app/qml/ui/NetAuthenticationDialog.qml:55
+#: ../stage/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:55
msgid "User"
msgstr ""
-#: ../sbuild/package/qml/ui/NetAuthenticationDialog.qml:66
-#: ../sbuild/src/app/qml/ui/NetAuthenticationDialog.qml:66
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/NetAuthenticationDialog.qml:66
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:66
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:66
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/NetAuthenticationDialog.qml:66
+#: ../prime/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:66
+#: ../qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:66
#: ../src/app/qml/ui/NetAuthenticationDialog.qml:66
-#: ../ssbuild/package/qml/ui/NetAuthenticationDialog.qml:66
-#: ../ssbuild/src/app/qml/ui/NetAuthenticationDialog.qml:66
+#: ../stage/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:66
msgid "Password"
msgstr ""
-#: ../sbuild/package/qml/ui/NetAuthenticationDialog.qml:79
-#: ../sbuild/src/app/qml/ui/NetAuthenticationDialog.qml:79
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/NetAuthenticationDialog.qml:79
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:79
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:79
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/NetAuthenticationDialog.qml:79
+#: ../prime/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:79
+#: ../qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:79
#: ../src/app/qml/ui/NetAuthenticationDialog.qml:79
-#: ../ssbuild/package/qml/ui/NetAuthenticationDialog.qml:79
-#: ../ssbuild/src/app/qml/ui/NetAuthenticationDialog.qml:79
+#: ../stage/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:79
msgid "Save password"
msgstr ""
-#: ../sbuild/package/qml/ui/NetAuthenticationDialog.qml:98
-#: ../sbuild/src/app/qml/ui/NetAuthenticationDialog.qml:98
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/NetAuthenticationDialog.qml:98
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:98
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:98
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/NetAuthenticationDialog.qml:98
+#: ../prime/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:98
+#: ../qbuild/src/app/qml/ui/NetAuthenticationDialog.qml:98
#: ../src/app/qml/ui/NetAuthenticationDialog.qml:98
-#: ../ssbuild/package/qml/ui/NetAuthenticationDialog.qml:98
-#: ../ssbuild/src/app/qml/ui/NetAuthenticationDialog.qml:98
+#: ../stage/usr/share/filemanager/qml/ui/NetAuthenticationDialog.qml:98
msgid "Ok"
msgstr ""
-#: ../sbuild/package/qml/ui/SettingsSheet.qml:45
-#: ../sbuild/src/app/qml/ui/SettingsSheet.qml:45
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/SettingsSheet.qml:45
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/SettingsSheet.qml:45
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/SettingsSheet.qml:45
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/SettingsSheet.qml:45
+#: ../prime/usr/share/filemanager/qml/ui/SettingsSheet.qml:45
+#: ../qbuild/src/app/qml/ui/SettingsSheet.qml:45
#: ../src/app/qml/ui/SettingsSheet.qml:45
-#: ../ssbuild/package/qml/ui/SettingsSheet.qml:45
-#: ../ssbuild/src/app/qml/ui/SettingsSheet.qml:45
+#: ../stage/usr/share/filemanager/qml/ui/SettingsSheet.qml:45
msgid "Show Advanced Features"
msgstr ""
-#: ../sbuild/package/qml/ui/ViewPopover.qml:39
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:39
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:39
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:39
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:39
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:39
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:39
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:39
#: ../src/app/qml/ui/ViewPopover.qml:39
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:39
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:39
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:39
msgid "Show Hidden Files"
msgstr ""
-#: ../sbuild/package/qml/ui/ViewPopover.qml:59
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:59
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:59
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:59
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:59
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:59
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:59
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:59
#: ../src/app/qml/ui/ViewPopover.qml:59
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:59
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:59
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:59
msgid "View As"
msgstr ""
-#: ../sbuild/package/qml/ui/ViewPopover.qml:81
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:81
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:81
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:81
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:81
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:81
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:81
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:81
#: ../src/app/qml/ui/ViewPopover.qml:81
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:81
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:81
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:81
msgid "Sort By"
msgstr ""
-#: ../sbuild/package/qml/ui/ViewPopover.qml:92
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:92
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:92
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:92
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:92
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:92
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:92
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:92
#: ../src/app/qml/ui/ViewPopover.qml:92
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:92
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:92
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:92
msgid "Name"
msgstr ""
-#: ../sbuild/package/qml/ui/ViewPopover.qml:93
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:93
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:93
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:93
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:93
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:93
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:93
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:93
#: ../src/app/qml/ui/ViewPopover.qml:93
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:93
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:93
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:93
msgid "Date"
msgstr ""
-#: ../sbuild/package/qml/ui/ViewPopover.qml:103
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:103
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:103
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:103
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:103
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:103
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:103
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:103
#: ../src/app/qml/ui/ViewPopover.qml:103
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:103
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:103
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:103
msgid "Sort Order"
msgstr ""
-#: ../sbuild/package/qml/ui/ViewPopover.qml:114
-#: ../sbuild/package/qml/ui/ViewPopover.qml:119
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:114
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:119
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:114
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:119
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:114
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:119
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:114
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:119
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:114
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:119
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:114
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:119
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:114
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:119
#: ../src/app/qml/ui/ViewPopover.qml:114 ../src/app/qml/ui/ViewPopover.qml:119
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:114
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:119
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:114
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:119
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:114
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:119
msgid "Ascending"
msgstr ""
-#: ../sbuild/package/qml/ui/ViewPopover.qml:115
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:115
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:115
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:115
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:115
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:115
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:115
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:115
#: ../src/app/qml/ui/ViewPopover.qml:115
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:115
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:115
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:115
msgid "Descending"
msgstr ""
-#: ../sbuild/package/qml/ui/ViewPopover.qml:127
-#: ../sbuild/src/app/qml/ui/ViewPopover.qml:127
+#: ../parts/ubuntu-filemanager-app/build/src/app/qml/ui/ViewPopover.qml:127
+#: ../parts/ubuntu-filemanager-app/install/usr/share/filemanager/qml/ui/ViewPopover.qml:127
+#: ../parts/ubuntu-filemanager-app/src/qbuild/src/app/qml/ui/ViewPopover.qml:127
+#: ../parts/ubuntu-filemanager-app/src/src/app/qml/ui/ViewPopover.qml:127
+#: ../prime/usr/share/filemanager/qml/ui/ViewPopover.qml:127
+#: ../qbuild/src/app/qml/ui/ViewPopover.qml:127
#: ../src/app/qml/ui/ViewPopover.qml:127
-#: ../ssbuild/package/qml/ui/ViewPopover.qml:127
-#: ../ssbuild/src/app/qml/ui/ViewPopover.qml:127
+#: ../stage/usr/share/filemanager/qml/ui/ViewPopover.qml:127
msgid "Filter"
msgstr ""
@@ -1071,13 +1658,3 @@
#: ../src/plugin/folderlistmodel/smb/qsambaclient/src/smbusershare.cpp:80
msgid "cannot write in "
msgstr ""
-
-#: ../ssbuild/package/qml/filemanager.qml:316
-#: ../ssbuild/src/app/qml/filemanager.qml:316
-msgid "Files imported"
-msgstr ""
-
-#: ../ssbuild/package/qml/filemanager.qml:317
-#: ../ssbuild/src/app/qml/filemanager.qml:317
-msgid "Files imported into: "
-msgstr ""
=== modified file 'snapcraft.yaml'
--- snapcraft.yaml 2017-03-07 18:42:37 +0000
+++ snapcraft.yaml 2017-03-22 15:05:54 +0000
@@ -22,6 +22,7 @@
plugin: cmake
configflags: [-DCMAKE_INSTALL_PREFIX=/usr, -DCLICK_MODE=off]
source: .
+ build-attributes: [no-system-libraries]
build-packages:
- cmake
- gcc
@@ -37,7 +38,8 @@
- libsmbclient-dev
stage-packages:
- - libsmbclient
+ - libsmbclient
+ - qml-module-pamauthentication0.1
snap:
- -usr/lib/python3
=== modified file 'src/app/CMakeLists.txt'
--- src/app/CMakeLists.txt 2014-04-01 13:44:24 +0000
+++ src/app/CMakeLists.txt 2017-03-22 15:05:54 +0000
@@ -1,13 +1,16 @@
file(GLOB_RECURSE QML_SRCS *.qml *.js)
+
+include_directories(${CMAKE_BINARY_DIR})
+
set(filemanager_SRCS
main.cpp
${QML_SRCS}
)
-add_executable(filemanager ${filemanager_SRCS})
+add_executable(ubuntu-filemanager-app ${filemanager_SRCS})
-qt5_use_modules(filemanager Gui Qml Quick)
+qt5_use_modules(ubuntu-filemanager-app Gui Qml Quick)
if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
add_custom_target(filemanager-qmlfiles ALL
@@ -17,8 +20,4 @@
endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
install(DIRECTORY qml DESTINATION ${DATA_DIR})
-if(CLICK_MODE)
- install(TARGETS filemanager DESTINATION ${BIN_DIR})
-else()
- install(TARGETS filemanager RUNTIME DESTINATION bin)
-endif()
+install(TARGETS ubuntu-filemanager-app RUNTIME DESTINATION bin)
=== modified file 'src/app/main.cpp'
--- src/app/main.cpp 2017-03-22 15:05:53 +0000
+++ src/app/main.cpp 2017-03-22 15:05:54 +0000
@@ -32,6 +32,8 @@
#include <signal.h>
#include <unistd.h>
+#include "config.h"
+
void catchUnixSignals(const std::vector<int>& quitSignals,
const std::vector<int>& ignoreSignals = std::vector<int>())
{
@@ -129,6 +131,7 @@
view.engine()->rootContext()->setContextProperty("tablet", QVariant(true));
}
+ importPathList << FM_PRIVATE_IMPORT_DIR;
view.engine()->setImportPathList(importPathList);
// load the qml file
=== modified file 'src/app/qml/filemanager.qml'
--- src/app/qml/filemanager.qml 2017-03-22 15:05:53 +0000
+++ src/app/qml/filemanager.qml 2017-03-22 15:05:54 +0000
@@ -31,7 +31,7 @@
id: mainView
// objectName for functional testing purposes (autopilot-qt5)
objectName: "filemanager"
- applicationName: "com.ubuntu.filemanager"
+ applicationName: "ubuntu-filemanager-app"
width: phone ? units.gu(40) : units.gu(100)
height: units.gu(75)
=== modified file 'src/plugin/CMakeLists.txt'
--- src/plugin/CMakeLists.txt 2014-10-26 14:35:23 +0000
+++ src/plugin/CMakeLists.txt 2017-03-22 15:05:54 +0000
@@ -6,5 +6,4 @@
add_subdirectory(folderlistmodel)
add_subdirectory(placesmodel)
-add_subdirectory(pamauthentication)
add_subdirectory(archives)
=== removed directory 'src/plugin/folderlistmodel'
=== removed file 'src/plugin/folderlistmodel/CMakeLists.txt'
--- src/plugin/folderlistmodel/CMakeLists.txt 2015-12-12 14:40:30 +0000
+++ src/plugin/folderlistmodel/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,142 +0,0 @@
-include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
- disk
- trash
- net
- smb
- smb/qsambaclient/src
-)
-
-set(PLUGIN_DIR org/nemomobile/folderlistmodel)
-
-set(folderlistmodel_SRCS
- clipboard.cpp
- clipboard.h
- diritemabstractlistmodel.h
- diriteminfo.cpp
- diriteminfo.h
- dirmodel.cpp
- dirmodel.h
- dirselection.cpp
- dirselection.h
- externalfswatcher.cpp
- externalfswatcher.h
- filecompare.cpp
- filecompare.h
- filesystemaction.cpp
- filesystemaction.h
- fmutil.cpp
- fmutil.h
- imageprovider.cpp
- imageprovider.h
- iorequest.cpp
- iorequest.h
- iorequestworker.cpp
- iorequestworker.h
- ioworkerthread.cpp
- ioworkerthread.h
- networklistworker.cpp
- networklistworker.h
- plugin.cpp
- plugin.h
- location.cpp
- location.h
- locationsfactory.cpp
- locationsfactory.h
- locationurl.cpp
- locationurl.h
- networklocation.cpp
- networklocation.h
- locationitemdir.cpp
- locationitemdir.h
- locationitemdiriterator.cpp
- locationitemdiriterator.h
- locationitemfile.cpp
- locationitemfile.h
- cleanurl.cpp
- cleanurl.h
- urliteminfo.cpp
- urliteminfo.h
- disk/disklocation.cpp
- disk/disklocation.h
- disk/disklocationitemdiriterator.cpp
- disk/disklocationitemdiriterator.h
- disk/disklocationitemfile.cpp
- disk/disklocationitemfile.h
- disk/disklocationitemdir.cpp
- disk/disklocationitemdir.h
- trash/qtrashdir.cpp
- trash/qtrashdir.h
- trash/qtrashutilinfo.cpp
- trash/qtrashutilinfo.h
- trash/trashiteminfo.cpp
- trash/trashiteminfo.h
- trash/trashlocation.cpp
- trash/trashlocation.h
- smb/qsambaclient/src/smbutil.cpp
- smb/qsambaclient/src/smbutil.h
- smb/qsambaclient/src/smbiteminfo.cpp
- smb/qsambaclient/src/smbiteminfo.h
- smb/qsambaclient/src/smblocationdiriterator.cpp
- smb/qsambaclient/src/smblocationdiriterator.h
- smb/qsambaclient/src/smblocationitemfile.cpp
- smb/qsambaclient/src/smblocationitemfile.h
- smb/qsambaclient/src/smblocationitemdir.cpp
- smb/qsambaclient/src/smblocationitemdir.h
- smb/qsambaclient/src/smbobject.cpp
- smb/qsambaclient/src/smbobject.h
- smb/smblocation.h
- smb/smblocation.cpp
- smb/smblocationauthentication.cpp
- smb/smblocationauthentication.h
- smb/qsambaclient/src/smbplaces.cpp
- smb/qsambaclient/src/smbplaces.h
- smb/qsambaclient/src/smbusershare.cpp
- smb/qsambaclient/src/smbusershare.h
- net/netauthenticationdata.cpp
- net/netauthenticationdata.h
- net/netutil.cpp
- net/netutil.h
-)
-
-add_library(nemofolderlistmodel MODULE
- ${folderlistmodel_SRCS}
-)
-
-qt5_use_modules(nemofolderlistmodel Gui Qml Quick Widgets)
-
-## samba requires libsmbclient
-find_path(SAMBA_INCLUDE_DIR
- NAMES libsmbclient.h
- HINTS /usr/include/smbclient /usr/include/samba /usr/include/samba-3.0 /usr/include/samba-4.0
- )
-find_library(SAMBA_LIBRARIES NAMES smbclient )
-message(STATUS "samba include=${SAMBA_INCLUDE_DIR}")
-message(STATUS "samba lib=${SAMBA_LIBRARIES}=${SAMBA_LIBRARIES}")
-
-if(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
- message(STATUS "Found samba: include=${SAMBA_INCLUDE_DIR} library=${SAMBA_LIBRARIES}")
- INCLUDE_DIRECTORIES(${SAMBA_INCLUDE_DIR})
- TARGET_LINK_LIBRARIES(nemofolderlistmodel ${SAMBA_LIBRARIES})
-else(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
- message(FATAL_ERROR "Could not find Samba libsmbclient")
-endif(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
-mark_as_advanced(SAMBA_INCLUDE_DIR SAMBA_LIBRARIES)
-## end samba confiuration
-
-# Copy the plugin, the qmldir file and other assets to the build dir for running in QtCreator
-if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
- add_custom_command(TARGET nemofolderlistmodel POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR}
- COMMENT "Creating plugin directory layout in the build directory"
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/qmldir ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR}
- COMMENT "Copying the qmldir file to the build directory"
- COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:nemofolderlistmodel> ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR}
- COMMENT "Copying the plugin binary to the build directory"
- )
-endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
-
-# Install plugin file
-install(TARGETS nemofolderlistmodel DESTINATION ${QT_IMPORTS_DIR}/org/nemomobile/folderlistmodel/)
-install(FILES qmldir DESTINATION ${QT_IMPORTS_DIR}/org/nemomobile/folderlistmodel/)
-
=== removed file 'src/plugin/folderlistmodel/README'
--- src/plugin/folderlistmodel/README 2013-07-06 14:55:25 +0000
+++ src/plugin/folderlistmodel/README 1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
-Building and installing
-=======================
-
-qmake [available-defines]
-
- where available-debug-messages are:
- DEBUG_MESSAGES -> enable generic debug messages use: qmake "DEINES+=DEBUG_MESSAGES"
- DEBUG_EXT_FS_WATCHER -> enable External File System Watcher messages use: qmake "DEINES+=DEBUG_EXT_FS_WATCHER"
- DEBUG_REMOVE -> enable message about every remove use: qmake "DEINES+=DEBUG_REMOVE"
- DO_NOT_USE_TAG_LIB -> disable using TAGLIB and getting metada use: qmake "DEINES+=DO_NOT_USE_TAG_LIB"
-
-make
-sudo make install
-
=== removed file 'src/plugin/folderlistmodel/cleanurl.cpp'
--- src/plugin/folderlistmodel/cleanurl.cpp 2015-03-01 15:32:42 +0000
+++ src/plugin/folderlistmodel/cleanurl.cpp 1970-01-01 00:00:00 +0000
@@ -1,73 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: cleanurl.cpp
- * Date: 04/02/2015
- */
-
-#include "cleanurl.h"
-
-#include <QUrl>
-
-CleanUrl::CleanUrl(const QString &urlPath) : m_user(0), m_password(0)
-{
- QUrl url(urlPath);
- if (url.isValid())
- {
- QString user = url.userName();
- if (!user.isEmpty())
- {
- m_user = new QString(user);
- m_password = new QString(url.password());
- url.setPassword(QLatin1String(0));
- url.setUserName(QLatin1String(0));
- }
- m_url = url.toString();
- }
- else
- {
- m_url = urlPath;
- }
-}
-
-
-CleanUrl::~CleanUrl()
-{
- if (m_user) { delete m_user; }
- if (m_password) { delete m_password;}
-}
-
-
-bool CleanUrl::hasAuthenticationData() const
-{
- return m_user ? true : false;
-}
-
-QString CleanUrl::user() const
-{
- return m_user ? *m_user : QString();
-}
-
-QString CleanUrl::password() const
-{
- return m_password ? *m_password : QString();
-}
-
-QString CleanUrl::cleanUrl() const
-{
- return m_url;
-}
=== removed file 'src/plugin/folderlistmodel/cleanurl.h'
--- src/plugin/folderlistmodel/cleanurl.h 2015-03-01 15:32:42 +0000
+++ src/plugin/folderlistmodel/cleanurl.h 1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: cleanurl.h
- * Date: 04/02/2015
- */
-
-#ifndef CLEANURL_H
-#define CLEANURL_H
-
-#include <QString>
-
-/*!
- * \brief The CleanUrl class
- *
- * Just returns a URL without user/password if exists
- */
-class CleanUrl
-{
-public:
- CleanUrl(const QString &urlPath);
- ~CleanUrl();
- bool hasAuthenticationData() const;
- QString cleanUrl() const;
- QString user() const;
- QString password() const;
-private:
- QString m_url; //!< keeps the url without user/password
- QString * m_user;
- QString * m_password;
-};
-
-#endif // CLEANURL_H
=== removed file 'src/plugin/folderlistmodel/clipboard.cpp'
--- src/plugin/folderlistmodel/clipboard.cpp 2015-07-11 19:00:45 +0000
+++ src/plugin/folderlistmodel/clipboard.cpp 1970-01-01 00:00:00 +0000
@@ -1,515 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- *
- * File: clipboard.cpp
- * Date: 1/22/2014
- */
-
-#include "clipboard.h"
-#include "locationurl.h"
-
-#include <QClipboard>
-#include <QApplication>
-#include <QDir>
-#include <QFileInfo>
-#include <QDebug>
-
-static QLatin1String GNOME_COPIED_MIME_TYPE ("x-special/gnome-copied-files");
-static QLatin1String KDE_CUT_MIME_TYPE ("application/x-kde-cutselection");
-
-
-int DirModelMimeData::m_instances = 0;
-DirModelMimeData* DirModelMimeData::m_globalMimeData = 0;
-
-
-bool DirModelMimeData::hasFormat ( const QString & mimeType ) const
-{
- bool ret = false;
- if ( mimeType == KDE_CUT_MIME_TYPE )
- {
- ret = true;
- }
- else
- {
- ret = m_formats.contains(mimeType);
- }
- return ret;
-}
-
-//===============================================================================================
-/*!
- * \brief DirModelMimeData::DirModelMimeData
- */
-DirModelMimeData::DirModelMimeData() :
- QMimeData()
- , m_appMime(0)
-{
- m_formats.append("text/uri-list");
- m_formats.append(GNOME_COPIED_MIME_TYPE);
- m_formats.append("text/plain");
- m_formats.append("COMPOUND_TEXT");
- m_formats.append("TARGETS");
- m_formats.append("MULTIPLE");
- m_formats.append("TIMESTAMP");
- m_formats.append("SAVE_TARGETS");
-
- ++m_instances;
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << this << "instances" << m_instances;
-#endif
-}
-
-
-
-
-DirModelMimeData::~DirModelMimeData()
-{
- --m_instances;
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << this << "instances" << m_instances
- << "m_globalMimeData" << m_globalMimeData;
-#endif
- if (m_instances == 1 && m_globalMimeData)
- {
- DirModelMimeData * tmp = m_globalMimeData;
- m_globalMimeData = 0;
- delete tmp;
- }
-}
-
-//===============================================================================================
-/*!
- * \brief DirModelMimeData::gnomeUrls
- * \param mime
- * \param operation
- * \return
- */
-QList<QUrl>
-DirModelMimeData::gnomeUrls(const QMimeData * mime,
- ClipboardOperation& operation)
-{
- QList<QUrl> urls;
- if (mime->hasFormat(GNOME_COPIED_MIME_TYPE))
- {
- QByteArray bytes = mime->data(GNOME_COPIED_MIME_TYPE);
- QList<QString> d = QString(bytes).split(QLatin1String("\n"),
- QString::SkipEmptyParts);
- operation = ClipboardCopy;
- if (d.count() > 0)
- {
- if (d.at(0).trimmed().startsWith(QLatin1String("cut")))
- {
- operation = ClipboardCut;
- }
- for (int counter= 1; counter < d.count(); counter++)
- {
- urls.append(d.at(counter).trimmed());
- }
- }
- }
- return urls;
-}
-
-//===============================================================================================
-/*!
- * \brief DirModelMimeData::clipBoardOperation()
- * \param mime
- * \return
- */
-ClipboardOperation DirModelMimeData::clipBoardOperation()
-{
- ClipboardOperation op = ClipboardCopy;
- m_appMime = clipboardMimeData();
- if (m_appMime)
- {
- //first check for GNOME clipboard format, op comes with Copy/Cut
- if (gnomeUrls(m_appMime, op).count() == 0)
- { // there is no gnome format, tries KDE format
- QStringList formats = m_appMime->formats();
- int f = formats.count();
- while(f--)
- {
- const QString &mi = formats.at(f);
- if(mi.startsWith(QLatin1String("application/x-kde")) )
- {
- if (mi.contains(QLatin1String("cut")))
- {
- op = ClipboardCut;
- break;
- }
- }
- }
- }
- }
- return op;
-}
-
-
-//===============================================================================================
-/*!
- * \brief DirModelMimeData::setIntoClipboard
- *
- * Try to put data in the global cliboard
- *
- * \note:
- * On mobile devices clipboard might not work, in this case a local Clipboard is simulated
- *
- * \param files
- * \param path
- * \param isCut
- * \return who is owner of clipboard data
- */
-DirModelMimeData::ClipBoardDataOwner
-DirModelMimeData::setIntoClipboard(const QStringList &files, const QString& path, ClipboardOperation operation)
-{
- DirModelMimeData::ClipBoardDataOwner ret = Nobody;
- QClipboard *clipboard = QApplication::clipboard();
- if (clipboard)
- {
- ret = Application;
- DirModelMimeData *mime = m_globalMimeData ? m_globalMimeData
- : new DirModelMimeData();
- if (mime->fillClipboard(files, path, operation))
- {
- static bool firstTime = true;
- clipboard->setMimeData(mime);
- //it looks like some mobile devices does not have X or Clipboard does work for other reason
- //in this case we simulate our own clipboard, the QClipboard::dataChanged() signal is also
- //checked in \ref Clipboard::storeOnClipboard()
- if (firstTime)
- {
- firstTime = false;
- if (!m_globalMimeData && !testClipboardContent(files, path))
- {
- qWarning() << "QClipboard does not work, using own QMimeData storage";
- m_globalMimeData = mime;
- }
- }
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "mime" << mime
- << "own Clipboard Mime Data" << m_globalMimeData;
-#endif
- }
- else
- if (m_globalMimeData != mime)
- {
- delete mime;
- }
- //check if it is necessary to send notification about Clipboard changed
- if (m_globalMimeData)
- {
- ret = MySelf;
- }
- }
- return ret;
-}
-
-
-
-bool DirModelMimeData::fillClipboard(const QStringList& files, const QString &path, ClipboardOperation operation)
-{
- int index = m_formats.indexOf(KDE_CUT_MIME_TYPE);
- if (index != -1 && operation != ClipboardCut)
- {
- m_formats.removeAt(index);
- }
- else
- if (operation == ClipboardCut)
- {
- m_formats.append(KDE_CUT_MIME_TYPE);
- }
- m_urls.clear();
- m_gnomeData.clear();
- m_gnomeData += operation == ClipboardCut ?
- QLatin1String("cut") :
- QLatin1String("copy");
- QStringList fullPaths = makeFullPath(files, path);
- for(int counter = 0; counter < fullPaths.count(); counter++)
- {
- QUrl item(fullPaths.at((counter)));
- if (item.scheme().isEmpty() && !item.isLocalFile())
- {
- item = QUrl::fromLocalFile(fullPaths.at((counter)));
- }
- if (LocationUrl::isSupportedUrl(item))
- {
- m_urls.append(item);
- m_gnomeData += QLatin1Char('\n') + item.toEncoded() ;
- }
- }
- bool ret = m_urls.count() > 0;
- if (ret)
- {
- setData(GNOME_COPIED_MIME_TYPE, m_gnomeData);
- setUrls(m_urls);
- }
- return ret;
-}
-
-//===============================================================================================
-/*!
- * \brief DirModelMimeData::clipboardMimeData
- * \return
- */
-const QMimeData *DirModelMimeData::clipboardMimeData()
-{
- const QMimeData *ret = 0;
- QClipboard *clipboard = QApplication::clipboard();
- if (m_globalMimeData)
- {
- ret = m_globalMimeData;
- }
- else
- if (clipboard)
- {
- ret = clipboard->mimeData();
- }
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "clipboard" << clipboard
- << "m_ownClipboardMimeData" << m_globalMimeData
- << "clipboard->mimeData()" << ret;
-#endif
- return ret;
-}
-
-//===============================================================================================
-/*!
- * \brief DirModelMimeData::storedUrls
- * \return the list of Urls stored in the Clipboard
- */
-QStringList
-DirModelMimeData::storedUrls(ClipboardOperation& operation)
-{
- m_appMime = clipboardMimeData();
- QStringList paths;
- //it may have external urls
- if (m_appMime)
- {
- QList<QUrl> urls;
- if (m_appMime->hasUrls())
- {
- urls = m_appMime->urls();
- operation = clipBoardOperation();
- }
- else
- {
- urls = gnomeUrls(m_appMime, operation);
- }
- for (int counter=0; counter < urls.count(); counter++)
- {
- if (LocationUrl::isSupportedUrl(urls.at(counter)))
- {
- if (urls.at(counter).isLocalFile())
- {
- paths.append(urls.at(counter).toLocalFile());
- }
- else
- {
- paths.append(urls.at(counter).toString());
- }
- }
- }
- }
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << paths;
-#endif
- return paths;
-}
-
-
-//===============================================================================================
-/*!
- * \brief DirModelMimeData::testClipboardContent() Gets the clipboard content and compare with data previously stored
- * \param files
- * \param path
- * \return true if clipboard has content and it matches data previously stored
- */
-bool DirModelMimeData::testClipboardContent(const QStringList &files, const QString &path)
-{
- bool ret = false;
- ClipboardOperation tmpOperation;
- QStringList expectedList = makeFullPath(files,path);
- QStringList realList = storedUrls(tmpOperation);
- if (realList == expectedList)
- {
- ret = true;
- }
- else
- {
- qWarning() << Q_FUNC_INFO << "FAILED, Clipboard does not work";
- }
- return ret;
-}
-
-//===============================================================================================
-/*!
- * \brief DirModelMimeData::makeFullPath() Just creates a fulpath file list if files are relative
- * \param files
- * \param path
- * \return the list itself
- */
-QStringList DirModelMimeData::makeFullPath(const QStringList& files, const QString &path)
-{
- QStringList fullPathnameList;
- if (files.count() > 0)
- {
- if (path.length() > 0 && !files.at(0).startsWith(path))
- {
- for(int counter = 0; counter < files.count(); counter++)
- {
- fullPathnameList.append(path + QDir::separator() + files.at(counter));
- }
- }
- else
- {
- //they already have a full path
- fullPathnameList = files;
- }
- }
- return fullPathnameList;
-}
-
-
-//===========================================================================
-//
-//===========================================================================
-Clipboard::Clipboard(QObject *parent):
- QObject(parent)
- , m_mimeData ( new DirModelMimeData() )
- , m_clipboardModifiedByOther(false)
-{
- QClipboard *clipboard = QApplication::clipboard();
-
- connect(clipboard, SIGNAL(dataChanged()), this, SIGNAL(clipboardChanged()));
- connect(clipboard, SIGNAL(dataChanged()), this, SLOT(onClipboardChanged()));
-}
-
-
-Clipboard::~Clipboard()
-{
- delete m_mimeData;
-}
-
-//================================================================================
-/*!
- * \brief Clipboard::clipboardHasChanged() used to identify if the clipboard changed during a Cut operation
- *
- * \sa \ref endCurrentAction()
- */
-void Clipboard::onClipboardChanged()
-{
- m_clipboardModifiedByOther = true;
-}
-
-
-//==================================================================
-/*!
- * \brief Clipboard::storeOnClipboard() store data on Clipboard
- * \param pathnames files list
- * \param op \ref ClipboardOperation as \ref ClipboardCopy or \ref ClipboardCut
- *
- * Stores data on clipboard by calling \ref DirModelMimeData::setIntoClipboard() which uses Qt class QClipboard
- * It is expected that QClipboard class emits the dataChanged() signal when a new content is set into it,
- * if it does we caught that signal in \ref clipboardHasChanged() which sets \ref m_clipboardModifiedByOther to true.
- */
-void Clipboard::storeOnClipboard(const QStringList &names, ClipboardOperation op, const QString& curPath)
-{
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << names << "ClipboardOperation" << op;
-#endif
- DirModelMimeData::ClipBoardDataOwner owner =
- m_mimeData->setIntoClipboard(names, curPath, op);
- if (owner == DirModelMimeData::MySelf || !m_clipboardModifiedByOther)
- {
- emit clipboardChanged();
- }
- m_clipboardModifiedByOther = false;
-}
-
-//===============================================================================================
-/*!
- * \brief Clipboard::copy
- * \param pathnames
- */
-void Clipboard::copy(const QStringList &names, const QString& path)
-{
- storeOnClipboard(names, ClipboardCopy, path);
-}
-
-//===============================================================================================
-/*!
- * \brief Clipboard::cut
- * \param pathnames
- */
-void Clipboard::cut(const QStringList &names, const QString &path)
-{
- storeOnClipboard(names, ClipboardCut, path);
-}
-
-
-//=======================================================
-/*!
- * \brief Clipboard::storedUrlsCounter
- * \return
- */
-int Clipboard::storedUrlsCounter()
-{
- ClipboardOperation operation;
- return m_mimeData->storedUrls(operation).count();
-}
-
-
-//=======================================================
-/*!
- * \brief Clipboard::paste
- * \param operation
- * \return
- */
-QStringList Clipboard::paste(ClipboardOperation &operation)
-{
- QStringList items = m_mimeData->storedUrls(operation);
- if (operation == ClipboardCut)
- {
- //this must still be false when cut finishes to change the clipboard to the target
- m_clipboardModifiedByOther = false;
- }
- return items;
-}
-
-/*!
- * \brief Clears clipboard entries
- */
-void Clipboard::clear()
-{
- qDebug() << Q_FUNC_INFO << "Clearing clipboard";
- storeOnClipboard(QStringList(), ClipboardCopy, "");
-}
=== removed file 'src/plugin/folderlistmodel/clipboard.h'
--- src/plugin/folderlistmodel/clipboard.h 2015-07-11 19:00:45 +0000
+++ src/plugin/folderlistmodel/clipboard.h 1970-01-01 00:00:00 +0000
@@ -1,132 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- *
- * File: clipboard.h
- * Date: 1/22/2014
- */
-
-#ifndef CLIPBOARD_H
-#define CLIPBOARD_H
-
-#include <QMimeData>
-#include <QUrl>
-#include <QStringList>
-
-class DirModelMimeData;
-
-enum ClipboardOperation
-{
- NoClipboard, ClipboardCopy, ClipboardCut
-};
-
-
-
-/*!
- * \brief The Clipboard class handles global clipboard storage
- */
-class Clipboard : public QObject
-{
- Q_OBJECT
-public:
- explicit Clipboard(QObject *parent = 0);
- ~Clipboard();
- QStringList paste(ClipboardOperation& operation);
- int storedUrlsCounter();
- inline bool hasClipboardModifiedByOtherApplication() const {return m_clipboardModifiedByOther;}
-
-public slots:
- void cut(const QStringList& names, const QString &path);
- void copy(const QStringList& names, const QString &path);
- void clear();
-
-signals:
- void clipboardChanged();
-
-private slots:
- void onClipboardChanged ();
-
-private:
- void storeOnClipboard(const QStringList &names,
- ClipboardOperation op,
- const QString &curPath);
-private:
- DirModelMimeData * m_mimeData;
- bool m_clipboardModifiedByOther;
-};
-
-
-
-/*!
- * \brief The DirModelMimeData class is the storage on Clipboard
- */
-class DirModelMimeData : public QMimeData
-{
-public:
- explicit DirModelMimeData();
- ~DirModelMimeData();
- virtual QStringList formats() const { return m_formats; }
- virtual bool hasFormat ( const QString & mimeType ) const;
-
-public:
- enum ClipBoardDataOwner
- {
- Nobody, // might have failed
- Application,
- MySelf
- };
-
- ClipBoardDataOwner setIntoClipboard(const QStringList& files,
- const QString &path,
- ClipboardOperation operation);
- const QMimeData * clipboardMimeData();
- QStringList storedUrls(ClipboardOperation& operation);
-
-private:
- static QList<QUrl> gnomeUrls(const QMimeData *mime, ClipboardOperation& operation);
- ClipboardOperation clipBoardOperation();
- bool fillClipboard(const QStringList& files, const QString &path, ClipboardOperation operation);
- QStringList makeFullPath(const QStringList& files, const QString &path);
- bool testClipboardContent(const QStringList& files, const QString &path);
-
-private:
- QStringList m_formats;
- const QMimeData * m_appMime;
- QByteArray m_gnomeData;
- QList<QUrl> m_urls;
- static DirModelMimeData* m_globalMimeData; //!< some mobile devices do not use X, they may not have clipboard
- static int m_instances;
-};
-
-
-
-#endif //CLIPBOARD_H
-
=== removed file 'src/plugin/folderlistmodel/diritemabstractlistmodel.h'
--- src/plugin/folderlistmodel/diritemabstractlistmodel.h 2014-02-05 15:31:44 +0000
+++ src/plugin/folderlistmodel/diritemabstractlistmodel.h 1970-01-01 00:00:00 +0000
@@ -1,46 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: diritemabstractlistmodel.h
- * Date: 30/01/2014
- */
-
-#ifndef DIRITEMABSTRACTLISTMODEL_H
-#define DIRITEMABSTRACTLISTMODEL_H
-
-#include <QObject>
-
-#include <QAbstractListModel>
-
-
-class DirItemInfo;
-class DirItemModel;
-
-class DirItemAbstractListModel : public QAbstractListModel
-{
- Q_OBJECT
-public:
- virtual int getIndex(const QString& name) = 0;
- virtual void notifyItemChanged(int index) = 0;
-protected:
- explicit DirItemAbstractListModel(QObject *parent = 0) :
- QAbstractListModel(parent)
- {
- }
-};
-
-#endif // DIRITEMABSTRACTLISTMODEL_H
=== removed file 'src/plugin/folderlistmodel/diriteminfo.cpp'
--- src/plugin/folderlistmodel/diriteminfo.cpp 2015-12-12 12:30:47 +0000
+++ src/plugin/folderlistmodel/diriteminfo.cpp 1970-01-01 00:00:00 +0000
@@ -1,604 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd()->
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: diriteminfo.cpp
- * Date: 30/01/2014
- */
-
-#include "diriteminfo.h"
-#include "locationurl.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
-
-QMimeDatabase DirItemInfoPrivate::mimeDatabase;
-
-
-DirItemInfoPrivate::DirItemInfoPrivate() :
- _isValid(false)
- ,_isLocal(false)
- ,_isRemote(false)
- ,_isSelected(false)
- ,_isAbsolute(false)
- ,_exists(false)
- ,_isFile(false)
- ,_isDir(false)
- ,_isSymLink(false)
- ,_isRoot(false)
- ,_isReadable(false)
- ,_isWritable(false)
- ,_isExecutable(false)
- ,_isLocalSharedDir(false)
- ,_isHost(false)
- ,_isWorkGroup(false)
- ,_isNetworkShare(false)
- ,_needsAuthentication(false)
- ,_permissions(0)
- ,_size(0)
-{
-
-}
-
-
-DirItemInfoPrivate::DirItemInfoPrivate(const DirItemInfoPrivate &other):
- QSharedData(other)
- ,_isValid(other._isValid)
- ,_isLocal(other._isLocal)
- ,_isRemote(other._isRemote)
- ,_isSelected(other._isSelected)
- ,_isAbsolute(other._isAbsolute)
- ,_exists(other._exists)
- ,_isFile(other._isFile)
- ,_isDir(other._isDir)
- ,_isSymLink(other._isSymLink)
- ,_isRoot(other._isRoot)
- ,_isReadable(other._isReadable)
- ,_isWritable(other._isWritable)
- ,_isExecutable(other._isExecutable)
- ,_isLocalSharedDir(other._isLocalSharedDir)
- ,_isHost(other._isHost)
- ,_isWorkGroup(other._isWorkGroup)
- ,_isNetworkShare(other._isNetworkShare)
- ,_needsAuthentication(other._needsAuthentication)
- ,_permissions(other._permissions)
- ,_size(other._size)
- ,_created(other._created)
- ,_lastModified(other._lastModified)
- ,_lastRead(other._lastRead)
- ,_path(other._path)
- ,_fileName(other._fileName)
- ,_normalizedPath(other._normalizedPath)
- ,_authenticationPath(other._authenticationPath)
-{
-
-}
-
-
-DirItemInfoPrivate::DirItemInfoPrivate(const QFileInfo &fi):
- _isValid(true)
- ,_isLocal(true)
- ,_isRemote(false)
- ,_isSelected(false)
- ,_isAbsolute(false)
- ,_exists(false)
- ,_isFile(false)
- ,_isDir(false)
- ,_isSymLink(false)
- ,_isRoot(false)
- ,_isReadable(false)
- ,_isWritable(false)
- ,_isExecutable(false)
- ,_isLocalSharedDir(false)
- ,_isHost(false)
- ,_isWorkGroup(false)
- ,_isNetworkShare(false)
- ,_needsAuthentication(false)
- ,_permissions(0)
- ,_size(0)
-{
- setFileInfo(fi);
-}
-
-void DirItemInfoPrivate::setFileInfo(const QFileInfo &fi)
-{
- if (fi.exists() && fi.isRelative())
- {
- QFileInfo abs(fi.absoluteFilePath());
- setFileInfo(abs);
- }
- else
- {
- _path = fi.absolutePath();
- _normalizedPath = _path;
- _fileName = fi.fileName();
- _isAbsolute = fi.isAbsolute();
- _exists = fi.exists();
- _isDir = fi.isDir();
- _isFile = fi.isFile();
- _isSymLink = fi.isSymLink();
- _isRoot = fi.isRoot();
- _isReadable = fi.isReadable();
- _isWritable = fi.isWritable();
- _isExecutable = fi.isExecutable();
- _permissions = fi.permissions();
- _size = fi.size();
- _created = fi.created();
- _lastRead = fi.lastRead();
- _lastModified = fi.lastModified();
- }
-}
-
-//================================================================
-
-DirItemInfo::DirItemInfo(): d_ptr(new DirItemInfoPrivate())
-{
-}
-
-
-DirItemInfo::~DirItemInfo()
-{
-}
-
-
-
-DirItemInfo::DirItemInfo(const QFileInfo &fi):
- d_ptr(new DirItemInfoPrivate(fi))
-{
-
-}
-
-
-
-DirItemInfo::DirItemInfo(const QString& filePath):
- d_ptr( new DirItemInfoPrivate(QFileInfo(filePath)) )
-{
-
-}
-
-
-DirItemInfo::DirItemInfo(const DirItemInfo& other)
-{
- d_ptr = other.d_ptr;
-}
-
-
-bool DirItemInfo::isSelected() const
-{
- return d_ptr->_isSelected;
-}
-
-/*!
- * \brief DirItemInfo::setSelection()
- * \param selected true/false new selection state
- * \return true if a new state was set, false if the selection is already equal to \a selected
- */
-bool DirItemInfo::setSelection(bool selected)
-{
- bool ret = selected != isSelected();
- d_ptr->_isSelected = selected;
- return ret;
-}
-
-
-bool DirItemInfo::isValid() const
-{
- return d_ptr->_isValid;
-}
-
-bool DirItemInfo::isLocal() const
-{
- return d_ptr->_isLocal;
-}
-
-bool DirItemInfo::isRemote() const
-{
- return d_ptr->_isRemote;
-}
-
-bool DirItemInfo::exists() const
-{
- return d_ptr->_exists;
-}
-
-
-
-QString DirItemInfo::filePath() const
-{
- return filePathFrom(d_ptr->_path);
-}
-
-
-QString DirItemInfo::fileName() const
-{
- return d_ptr->_fileName;
-}
-
-QString DirItemInfo::absoluteFilePath() const
-{
- return filePath();
-}
-
-QString DirItemInfo::absolutePath() const
-{
- return d_ptr->_path;
-}
-
-bool DirItemInfo::isReadable() const
-{
- return d_ptr->_isReadable;
-}
-
-/*!
- * \brief DirItemInfo::isContentReadable() Expands the isReadable() idea, when it is a folder says if it is possible to get the content
- * \return true if the file/directory can be read, otherwise false.
- */
-bool DirItemInfo::isContentReadable() const
-{
- bool readable = d_ptr->_isReadable;
- if (isDir() && !isSymLink())
- {
- readable &= isExecutable();
- }
- return readable;
-}
-
-bool DirItemInfo::isWritable() const
-{
- return d_ptr->_isWritable;
-}
-
-bool DirItemInfo::isExecutable() const
-{
- return d_ptr->_isExecutable;
-}
-
-bool DirItemInfo::isRelative() const
-{
- return ! isAbsolute();
-}
-
-bool DirItemInfo::isAbsolute() const
-{
- return d_ptr->_isAbsolute;
-}
-
-bool DirItemInfo::isFile() const
-{
- return d_ptr->_isFile;
-}
-
-bool DirItemInfo::isDir() const
-{
- return d_ptr->_isDir;
-}
-
-bool DirItemInfo::isSymLink() const
-{
- return d_ptr->_isSymLink;
-}
-
-bool DirItemInfo::isRoot() const
-{
- return d_ptr->_isRoot;
-}
-
-QFile::Permissions DirItemInfo::permissions() const
-{
- return d_ptr->_permissions;
-}
-
-qint64 DirItemInfo::size() const
-{
- return d_ptr->_size;
-}
-
-QDateTime DirItemInfo::created() const
-{
- return d_ptr->_created;
-}
-
-QDateTime DirItemInfo::lastModified() const
-{
- return d_ptr->_lastModified;
-}
-
-QDateTime DirItemInfo::lastRead() const
-{
- return d_ptr->_lastRead;
-}
-
-void DirItemInfo::setFile(const QString &dir, const QString &file)
-{
- QFileInfo f;
- f.setFile(dir,file);
- d_ptr->setFileInfo(f);
-}
-
-void DirItemInfo::setFile(const QString &fullname)
-{
- QFileInfo f;
- f.setFile(fullname);
- d_ptr->setFileInfo(f);
-}
-
-QFileInfo DirItemInfo::diskFileInfo() const
-{
- QFileInfo fi(absoluteFilePath());
- return fi;
-}
-
-QString DirItemInfo::path() const
-{
- return d_ptr->_path;
-}
-
-
-QMimeType DirItemInfo::mimeType() const
-{
- return d_ptr->mimeDatabase.mimeTypeForFile(diskFileInfo());
-}
-
-
-QString DirItemInfo::urlPath() const
-{
- return filePathFrom(d_ptr->_normalizedPath);
-}
-
-
-QString DirItemInfo::filePathFrom(const QString& p) const
-{
- QString filepath;
- if (!p.isEmpty())
- {
- filepath = p;
- if (!p.endsWith(QDir::separator()) && !d_ptr->_fileName.isEmpty())
- {
- filepath += QDir::separator();
- }
- }
- filepath += d_ptr->_fileName;
- return filepath;
-}
-
-bool DirItemInfo::permission(QFileDevice::Permissions permissions) const
-{
- return (d_ptr->_permissions & permissions) == permissions;
-}
-
-bool DirItemInfo::isSharedDir() const
-{
- return d_ptr->_isLocalSharedDir;
-}
-
-bool DirItemInfo::isHost() const
-{
- return d_ptr->_isHost;
-}
-
-
-bool DirItemInfo::isWorkGroup() const
-{
- return d_ptr->_isWorkGroup;
-}
-
-bool DirItemInfo::isShare() const
-{
- return d_ptr->_isNetworkShare;
-}
-
-/*!
- * \brief DirItemInfo::isBrowsable() considers browsable items that can hold a list of items
- * \return
- */
-bool DirItemInfo::isBrowsable() const
-{
- return isDir() || isHost() || isShare() || isWorkGroup();
-}
-
-bool DirItemInfo::needsAuthentication() const
-{
- return d_ptr->_needsAuthentication;
-}
-
-QString DirItemInfo::authenticationPath() const
-{
- return d_ptr->_authenticationPath;
-}
-
-
-/*!
- * \brief DirItemInfo::fillFromStatBuf() This was copied from \ref QFileSystemMetaData::fillFromStatBuf()
- * \param statBuffer
- */
-void DirItemInfo::fillFromStatBuf(const struct stat & statBuffer)
-{
-#define LinkType 0x00010000
-#define FileType 0x00020000
-#define DirectoryType 0x00040000
-#define SequentialType 0x00800000
-
- //size
- d_ptr->_size = statBuffer.st_size;
- //times
- d_ptr->_lastModified = statBuffer.st_mtime ?
- QDateTime::fromTime_t(statBuffer.st_mtime) :
- QDateTime(QDate(), QTime());
- d_ptr->_created = statBuffer.st_ctime ?
- QDateTime::fromTime_t(statBuffer.st_ctime) :
- d_ptr->_lastModified ;
- d_ptr->_lastRead = statBuffer.st_atime ?
- QDateTime::fromTime_t(statBuffer.st_atime) :
- d_ptr->_lastModified;
-
- /*
- //user, group
- userId_ = statBuffer.st_uid;
- groupId_ = statBuffer.st_gid;
- */
-
- /*
- * When handling filesystems other than local (e.g. any network)
- * Permissions are relative to the user being used to access the resource
- *
- * So it is necessary to qualify the user accessing the resource as
- * owner / belongs to group or / others
- */
- // quint32 userMatches = 0;
- QFile::Permissions readPermission = 0;
- QFile::Permissions writePermission = 0;
- QFile::Permissions execPermission = 0;
-
-
- //owner permissions
- if (statBuffer.st_mode & S_IRUSR)
- {
- readPermission |= QFile::ReadOwner | QFile::ReadUser;
- }
- if (statBuffer.st_mode & S_IWUSR)
- {
- writePermission |= QFile::WriteOwner | QFile::WriteUser;
- }
- if (statBuffer.st_mode & S_IXUSR)
- {
- execPermission |= QFile::ExeOwner | QFile::ExeUser;
- }
- //group permissions
- if (statBuffer.st_mode & S_IRGRP)
- {
- readPermission |= QFile::ReadGroup;
- }
- if (statBuffer.st_mode & S_IWGRP)
- {
- writePermission |= QFile::WriteGroup;
- }
- if (statBuffer.st_mode & S_IXGRP)
- {
- execPermission |= QFile::ExeGroup;
- }
- //other permissions
- if (statBuffer.st_mode & S_IROTH)
- {
- readPermission |= QFile::ReadOther;
- }
- if (statBuffer.st_mode & S_IWOTH)
- {
- writePermission |= QFile::WriteOther;
- }
- if (statBuffer.st_mode & S_IXOTH)
- {
- execPermission |= QFile::ExeOther;
- }
-
- /*
- * Permissions are relative to a remote user
- * it was necessary to be the user being accessing the file
- */
- if (readPermission)
- {
- d_ptr->_isReadable = true;
- }
- if (writePermission)
- {
- d_ptr->_isWritable = true;
- }
- if (execPermission)
- {
- d_ptr->_isExecutable = true;
- }
-
- //set full permissions flag
- d_ptr->_permissions = readPermission | writePermission | execPermission;
-
- // Type
- if ((statBuffer.st_mode & S_IFMT) == S_IFREG)
- {
- // d_ptr->_permissions |= FileType;
- d_ptr->_isFile = true;
- }
- else if ((statBuffer.st_mode & S_IFMT) == S_IFDIR)
- {
- // d_ptr->_permissions |= DirectoryType;
- d_ptr->_isDir = true;
- }
- else
- {
- // d_ptr->_permissions |= SequentialType;
- }
-}
-
-
-
-QString DirItemInfo::removeExtraSlashes(const QString &url, int firstSlashIndex)
-{
- QString ret;
- if (firstSlashIndex == -1)
- {
- firstSlashIndex = url.indexOf(LocationUrl::UrlIndicator);
- if (firstSlashIndex != -1)
- {
- ++firstSlashIndex;
- }
- else
- {
- firstSlashIndex = -1;
- }
- }
- if (firstSlashIndex >=0)
- {
- while ( firstSlashIndex < url.length() && url.at(firstSlashIndex) == QDir::separator())
- {
- ++firstSlashIndex;
- }
- if (firstSlashIndex < url.length())
- {
- ret = url.mid(firstSlashIndex);
- }
- }
- else
- {
- ret = url;
- firstSlashIndex = -1;
- }
- if (firstSlashIndex >= 0 && ret.endsWith(QDir::separator()))
- {
- ret.chop(1);
- }
- //replace any double slashes by just one
- for(int charCounter = ret.size() -1; charCounter > 0; --charCounter)
- {
- if (ret.at(charCounter) == QDir::separator() &&
- ret.at(charCounter-1) == QDir::separator())
- {
- ret.remove(charCounter,1);
- }
- }
- return ret;
-}
-
-
-void DirItemInfo::setAsHost()
-{
- d_ptr->_isHost = true;
- d_ptr->_exists = true;
- d_ptr->_isReadable = true;
- d_ptr->_isExecutable = true;
-}
-
-void DirItemInfo::setAsShare()
-{
- d_ptr->_isNetworkShare = true;
-}
=== removed file 'src/plugin/folderlistmodel/diriteminfo.h'
--- src/plugin/folderlistmodel/diriteminfo.h 2015-12-12 12:30:47 +0000
+++ src/plugin/folderlistmodel/diriteminfo.h 1970-01-01 00:00:00 +0000
@@ -1,268 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: diriteminfo.h
- * Date: 30/01/2014
- */
-
-#ifndef DIRITEMINFO_H
-#define DIRITEMINFO_H
-
-#include <QtGlobal>
-#include <QVector>
-#include <QFileInfo>
-#include <QSharedData>
-#include <QDateTime>
-#include <QDir>
-#include <QMimeType>
-#include <QMimeDatabase>
-
-class DirItemInfoPrivate;
-
-
-/*!
- * \brief The DirItemInfo class
- *
- * It intends to provide the same information as QFileInfo for Local Files:
- * * selection state
- * * any information about the item type, if it is Local/Remove
- * *
- */
-class DirItemInfo
-{
-public:
- DirItemInfo();
- DirItemInfo(const QString& filePath);
- DirItemInfo(const DirItemInfo& other);
- DirItemInfo(const QFileInfo& fi);
-
-
- virtual ~DirItemInfo();
-
-public:
- bool isSelected() const;
- bool setSelection(bool selected);
- virtual bool isValid() const;
-
- /*!
- * \brief isLocal()
- * \return true if the file is the disk: valid for Trash and any mounted FS
- */
- virtual bool isLocal() const;
-
- /*!
- * \brief isRemote()
- * \return true if the file is in any remote host, mounted File Sharing is considered as Local
- */
- virtual bool isRemote() const;
-
- QFileInfo diskFileInfo() const;
-
- inline void swap(DirItemInfo &other)
- { qSwap(d_ptr, other.d_ptr); }
-
- virtual inline DirItemInfo& operator=(const DirItemInfo &other)
- { swap(*(const_cast<DirItemInfo*>(&other))); return *this; }
-
- virtual bool exists() const;
- virtual QString filePath() const;
- virtual QString fileName() const;
- virtual QString path() const;
- virtual QString absolutePath() const;
- virtual QString absoluteFilePath() const;
- virtual QString urlPath() const;
- virtual bool isReadable() const;
- virtual bool isContentReadable() const;
- virtual bool isWritable() const;
- virtual bool isExecutable() const;
- virtual bool isRelative() const;
- virtual bool isAbsolute() const;
- virtual bool isFile() const;
- virtual bool isDir() const;
- virtual bool isSymLink() const;
- virtual bool isRoot() const;
- virtual QFile::Permissions permissions() const;
- virtual qint64 size() const;
- virtual QDateTime created() const;
- virtual QDateTime lastModified() const;
- virtual QDateTime lastRead() const;
- virtual QMimeType mimeType() const;
- virtual bool isHost() const;
- virtual bool isSharedDir() const;
- virtual bool isWorkGroup() const;
- virtual bool isShare() const;
- virtual bool isBrowsable() const;
- virtual bool needsAuthentication() const;
- virtual QString authenticationPath() const;
- virtual void setFile(const QString &dir, const QString & file);
- virtual void setFile(const QString &fullname);
- virtual bool permission(QFile::Permissions permissions) const;
- void fillFromStatBuf(const struct stat& statBuffer);
- void setAsHost();
- void setAsShare();
-
-public:
- static QString removeExtraSlashes(const QString &url, int firstSlashIndex = -1);
-
-#if 0
- virtual QString path() const;
- virtual QString owner() const;
- virtual uint ownerId() const;
- virtual QString group() const;
- virtual uint groupId() const;
-#endif
-
-protected:
- QString filePathFrom(const QString& path) const;
-
-protected:
- QSharedDataPointer<DirItemInfoPrivate> d_ptr;
-};
-
-typedef QVector<DirItemInfo> DirItemInfoList;
-
-Q_DECLARE_SHARED(DirItemInfo)
-Q_DECLARE_METATYPE(DirItemInfo)
-
-
-
-
-class DirItemInfoPrivate : public QSharedData
-{
-public:
- DirItemInfoPrivate();
- DirItemInfoPrivate(const DirItemInfoPrivate& other);
- DirItemInfoPrivate(const QFileInfo& fi);
- void setFileInfo(const QFileInfo&);
-
-public:
- bool _isValid :1;
- bool _isLocal :1;
- bool _isRemote :1;
- bool _isSelected :1;
- bool _isAbsolute :1;
- bool _exists :1;
- bool _isFile :1;
- bool _isDir :1;
- bool _isSymLink :1;
- bool _isRoot :1;
- bool _isReadable :1;
- bool _isWritable :1;
- bool _isExecutable:1;
- bool _isLocalSharedDir :1; //!< the directory in the local disk is shared folder (perhaps using Samba)
- bool _isHost :1; //!< the item points to a host like fish://localhost, smb://10.10.200.1, etc.
- bool _isWorkGroup :1; //!< specific to Samba
- bool _isNetworkShare :1; //!< samba share (entry point)
- bool _needsAuthentication:1;//!< the url may require authentication do access
-
-
- QFile::Permissions _permissions;
- qint64 _size;
- QDateTime _created;
- QDateTime _lastModified;
- QDateTime _lastRead;
- QString _path;
- QString _fileName;
- QString _normalizedPath;
- QString _authenticationPath;
-
- static QMimeDatabase mimeDatabase;
-};
-
-
-
-/*!
- * \brief The ActionPaths struct contains helper functions to do simple path handling
- *
- * Paths stored here are supposed to NOT be relative.
- *
- * It does not use any QFileInfo method, so it may work for any URL type
- */
-struct ActionPaths
-{
- public:
- ActionPaths() {}
- ActionPaths(const QString& source)
- {
- setSource(source);
- }
- inline void setSource(const QString& source)
- {
- int pathLen = source.lastIndexOf(QDir::separator());
- if (pathLen != -1)
- {
- _source = source;
- _sFile = QStringRef(&_source, pathLen + 1, _source.size() - pathLen - 1);
- _origPath = QStringRef(&_source, 0, pathLen);
- }
- else
- {
- //avoids possible memory corruption using relative paths, QStringRef would be empty/null
- //relative paths currently are not supported
- setSource(QString(".") + QDir::separator() + source);
- }
- }
- inline void setTargetPathOnly(const QString& path)
- {
- _targetPath = path;
- _target = path + QDir::separator();
- _target += _sFile;
- }
- inline void setTargetFullName(const QString& fullPathname)
- {
- _target = fullPathname;
- int lastSeparator = _target.lastIndexOf(QDir::separator());
- if (lastSeparator > 0)
- {
- _targetPath = _target.mid(0, lastSeparator);
- }
- }
- inline ActionPaths& operator=(const ActionPaths& other)
- {
- setSource(other._source);
- setTargetFullName(other._target);
- return *this;
- }
- inline bool areEquals() const {return _source == _target;}
- inline bool arePathsEquals() const
- {
- return QStringRef::compare(_origPath, _targetPath) == 0;
- }
- inline const QString& source() const {return _source;}
- inline const QString& target() const {return _target;}
- inline const QString& targetPath()const {return _targetPath;}
- inline const QStringRef& file() const {return _sFile;}
- inline int baseOrigSize() const {return _origPath.size();}
- inline void toggle()
- {
- QString savedSource(_source);
- setSource(_target);
- setTargetFullName(savedSource);
- }
- private:
- QString _source; //!< source full pathname
- QString _target; //!< target full pathname
- QString _targetPath; //!< target path only
- QStringRef _sFile; //!< source file name only
- QStringRef _origPath; //!< source path only
-};
-
-Q_DECLARE_METATYPE(ActionPaths)
-
-typedef QList<ActionPaths> ActionPathList;
-
-#endif // DIRITEMINFO_H
=== removed file 'src/plugin/folderlistmodel/dirmodel.cpp'
--- src/plugin/folderlistmodel/dirmodel.cpp 2015-12-08 16:55:41 +0000
+++ src/plugin/folderlistmodel/dirmodel.cpp 1970-01-01 00:00:00 +0000
@@ -1,1911 +0,0 @@
-/*
- * Copyright (C) 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- */
-
-#include "dirselection.h"
-#include "dirmodel.h"
-#include "filesystemaction.h"
-#include "clipboard.h"
-#include "fmutil.h"
-#include "locationsfactory.h"
-#include "location.h"
-#include "locationurl.h"
-#include "disklocation.h"
-#include "trashlocation.h"
-#include "netauthenticationdata.h"
-#include "locationitemdir.h"
-
-
-#ifndef DO_NOT_USE_TAG_LIB
-#include <taglib/attachedpictureframe.h>
-#include <taglib/id3v2tag.h>
-#include <taglib/fileref.h>
-#include <taglib/mpegfile.h>
-#include <taglib/tag.h>
-#include <taglib/audioproperties.h>
-#endif
-
-#include <errno.h>
-#include <string.h>
-#include <QDirIterator>
-#include <QDir>
-#include <QDebug>
-#include <QFileIconProvider>
-#include <QUrl>
-#include <QDesktopServices>
-#include <QMetaType>
-#include <QDateTime>
-#include <QMimeType>
-#include <QStandardPaths>
-#include <QList>
-#include <QScopedPointer>
-
-#if defined(REGRESSION_TEST_FOLDERLISTMODEL)
-# include <QColor>
-# include <QBrush>
-#endif
-
-
-#define IS_VALID_ROW(row) (row >=0 && row < mDirectoryContents.count())
-#define WARN_ROW_OUT_OF_RANGE(row) qWarning() << Q_FUNC_INFO << this << "row:" << row << "Out of bounds access"
-
-#define IS_FILE_MANAGER_IDLE() (!mAwaitingResults)
-
-#define IS_BROWSING_TRASH_ROOTDIR() (mCurLocation && mCurLocation->isTrashDisk() && mCurLocation->isRoot())
-
-namespace {
- QHash<QByteArray, int> roleMapping;
-}
-
-/*!
- * Sort was originally done in \ref onItemsAdded() and that code is now in \ref addItem(),
- * the reason to keep doing sort and do not let QDir does it is that when adding new items
- * by \ref mkdir() or \paste() it is not necessary to call refresh() to load the entire directory
- * to organize it items again. New items order/position are organized by \ref addItem()
- *
- */
-static CompareFunction availableCompareFunctions[2][2] =
-{
- {fileCompareAscending, fileCompareDescending}
- ,{dateCompareAscending, dateCompareDescending}
-};
-
-
-DirModel::DirModel(QObject *parent)
- : DirItemAbstractListModel(parent)
- , mFilterDirectories(false)
- , mShowDirectories(true)
- , mAwaitingResults(false)
- , mIsRecursive(false)
- , mReadsMediaMetadata(false)
- , mShowHiddenFiles(false)
- , mOnlyAllowedPaths(false)
- , mSortBy(SortByName)
- , mSortOrder(SortAscending)
- , mCompareFunction(0)
- , mExtFSWatcher(false)
- , mClipboard(new Clipboard(this))
- // create global Authentication Data before mLocationFactory
- , mAuthData(NetAuthenticationDataList::getInstance(this))
- , mLocationFactory(new LocationsFactory(this))
- , mCurLocation(0)
- , m_fsAction(new FileSystemAction(mLocationFactory,this) )
-{
- mNameFilters = QStringList() << "*";
-
- mSelection = new DirSelection(this, &mDirectoryContents);
-
- connect(m_fsAction, SIGNAL(progress(int,int,int)),
- this, SIGNAL(progress(int,int,int)));
-
- connect(m_fsAction, SIGNAL(added(DirItemInfo)),
- this, SLOT(onItemAdded(DirItemInfo)));
-
- connect(m_fsAction, SIGNAL(removed(DirItemInfo)),
- this, SLOT(onItemRemoved(DirItemInfo)));
-
- connect(m_fsAction, SIGNAL(error(QString,QString)),
- this, SIGNAL(error(QString,QString)));
-
- connect(this, SIGNAL(pathChanged(QString)),
- m_fsAction, SLOT(pathChanged(QString)));
-
- connect(mClipboard, SIGNAL(clipboardChanged()),
- this, SIGNAL(clipboardChanged()));
-
- connect(m_fsAction, SIGNAL(changed(DirItemInfo)),
- this, SLOT(onItemChanged(DirItemInfo)));
-
- connect(mClipboard, SIGNAL(clipboardChanged()),
- m_fsAction, SLOT(onClipboardChanged()));
-
- connect(m_fsAction, SIGNAL(recopy(QStringList,QString)),
- mClipboard, SLOT(copy(QStringList,QString)));
-
- connect(m_fsAction, SIGNAL(downloadTemporaryComplete(QString)),
- this, SIGNAL(downloadTemporaryComplete(QString)));
-
- setCompareAndReorder();
-
- if (QIcon::themeName().isEmpty() && !FMUtil::hasTriedThemeName())
- {
- FMUtil::setThemeName();
- }
-
- foreach (const Location* l, mLocationFactory->availableLocations())
- {
- connect(l, SIGNAL(itemsAdded(DirItemInfoList)),
- this, SLOT(onItemsAdded(DirItemInfoList)));
-
- connect(l, SIGNAL(itemsFetched()),
- this, SLOT(onItemsFetched()));
-
- connect(l, SIGNAL(extWatcherItemAdded(DirItemInfo)),
- this, SLOT(onItemAddedOutsideFm(DirItemInfo)));
-
- connect(l, SIGNAL(extWatcherItemRemoved(DirItemInfo)),
- this, SLOT(onItemRemovedOutSideFm(DirItemInfo)));
-
- connect(l, SIGNAL(extWatcherItemChanged(DirItemInfo)),
- this, SLOT(onItemChangedOutSideFm(DirItemInfo)));
-
- connect(l, SIGNAL(extWatcherChangesFetched(int)),
- this, SLOT(onExternalFsWorkerFinished(int)));
-
- connect(l, SIGNAL(extWatcherPathChanged(QString)),
- this, SLOT(onThereAreExternalChanges(QString)));
-
- connect(l, SIGNAL(needsAuthentication(QString,QString)),
- this, SIGNAL(needsAuthentication(QString,QString)), Qt::QueuedConnection);
-
- connect(this, SIGNAL(enabledExternalFSWatcherChanged(bool)),
- l, SLOT(setUsingExternalWatcher(bool)));
- }
-}
-
-
-
-DirModel::~DirModel()
-{
- // release global Authentication Data
- NetAuthenticationDataList::releaseInstance(this);
-}
-
-
-
-QHash<int, QByteArray> DirModel::roleNames() const
-{
- static QHash<int, QByteArray> roles;
- if (roles.isEmpty()) {
- roles = buildRoleNames();
- }
-
- return roles;
-}
-
-
-
-QHash<int, QByteArray> DirModel::buildRoleNames() const
-{
- QHash<int, QByteArray> roles;
- roles.insert(FileNameRole, QByteArray("fileName"));
- roles.insert(AccessedDateRole, QByteArray("accessedDate"));
- roles.insert(CreationDateRole, QByteArray("creationDate"));
- roles.insert(ModifiedDateRole, QByteArray("modifiedDate"));
- roles.insert(FileSizeRole, QByteArray("fileSize"));
- roles.insert(IconSourceRole, QByteArray("iconSource"));
- roles.insert(FilePathRole, QByteArray("filePath"));
- roles.insert(IsDirRole, QByteArray("isDir"));
- roles.insert(IsHostRole, QByteArray("isHost"));
- roles.insert(IsRemoteRole,QByteArray("isRemote"));
- roles.insert(IsLocalRole,QByteArray("isLocal"));
- roles.insert(NeedsAuthenticationRole,QByteArray("needsAuthentication"));
- roles.insert(IsSmbWorkgroupRole, QByteArray("isSmbWorkgroup"));
- roles.insert(IsSmbShareRole, QByteArray("isSmbShare"));
- roles.insert(IsSharedDirRole, QByteArray("isSharedDir"));
- roles.insert(IsSharingAllowedRole, QByteArray("isSharingAllowed"));
- roles.insert(IsBrowsableRole, QByteArray("isBrowsable"));
- roles.insert(IsFileRole, QByteArray("isFile"));
- roles.insert(IsReadableRole, QByteArray("isReadable"));
- roles.insert(IsWritableRole, QByteArray("isWritable"));
- roles.insert(IsExecutableRole, QByteArray("isExecutable"));
- roles.insert(IsSelectedRole, QByteArray("isSelected"));
- roles.insert(TrackTitleRole, QByteArray("trackTitle"));
- roles.insert(TrackArtistRole, QByteArray("trackArtist"));
- roles.insert(TrackAlbumRole, QByteArray("trackAlbum"));
- roles.insert(TrackYearRole, QByteArray("trackYear"));
- roles.insert(TrackNumberRole, QByteArray("trackNumber"));
- roles.insert(TrackGenreRole, QByteArray("trackGenre"));
- roles.insert(TrackLengthRole, QByteArray("trackLength"));
- roles.insert(TrackCoverRole, QByteArray("trackCover"));
-
- // populate reverse mapping
- if (roleMapping.isEmpty()) {
- QHash<int, QByteArray>::ConstIterator it = roles.constBegin();
- for (;it != roles.constEnd(); ++it)
- roleMapping.insert(it.value(), it.key());
-
- // make sure we cover all roles
- // Q_ASSERT(roles.count() == IsFileRole - FileNameRole);
- }
-
- return roles;
-}
-
-QVariant DirModel::data(int row, const QByteArray &stringRole) const
-{
- QHash<QByteArray, int>::ConstIterator it = roleMapping.constFind(stringRole);
-
- if (it == roleMapping.constEnd())
- return QVariant();
-
- return data(index(row, 0), *it);
-}
-
-QVariant DirModel::data(const QModelIndex &index, int role) const
-{
-//its not for QML
-#if defined(REGRESSION_TEST_FOLDERLISTMODEL)
- if (!index.isValid() ||
- (role != Qt::DisplayRole && role != Qt::DecorationRole && role != Qt::BackgroundRole)
- )
- {
- return QVariant();
- }
- if (role == Qt::DecorationRole && index.column() == 0)
- {
- QIcon icon;
- QMimeType mime = mDirectoryContents.at(index.row()).mimeType();
- if (mime.isValid() && mDirectoryContents.at(index.row()).isLocal())
- {
- if (QIcon::hasThemeIcon(mime.iconName()) ) {
- icon = QIcon::fromTheme(mime.iconName());
- }
- else if (QIcon::hasThemeIcon(mime.genericIconName())) {
- icon = QIcon::fromTheme(mime.genericIconName());
- }
- }
- if (icon.isNull())
- {
- if (mDirectoryContents.at(index.row()).isLocal())
- {
- icon = QFileIconProvider().icon(mDirectoryContents.at(index.row()).diskFileInfo());
- }
-#if defined(SIMPLE_UI)
- else
- if (mDirectoryContents.at(index.row()).isHost())
- {
- return QIcon(":/resources/resources/server.png");
- }
- else
- if (mDirectoryContents.at(index.row()).isWorkGroup())
- {
- return QIcon(":/resources/resources/workgroup.png");
- }
- else
- if (mDirectoryContents.at(index.row()).isShare())
- {
- return QIcon(":/resources/resources/samba_folder.png");
- }
-#endif
- else
- if (mDirectoryContents.at(index.row()).isDir())
- {
- icon = QFileIconProvider().icon(QFileIconProvider::Folder);
- }
- else
- {
- icon = QFileIconProvider().icon(QFileIconProvider::File);
- }
- }
- return icon;
- }
- if (role == Qt::BackgroundRole && index.column() == 0)
- {
- if (mDirectoryContents.at(index.row()).isSelected())
- {
- //TODO it'd better to get some style or other default
- // background color
- return QBrush(Qt::lightGray);
- }
- return QVariant();
- }
- role = FileNameRole + index.column();
-#else
- if (role < FileNameRole || role > TrackCoverRole) {
- qWarning() << Q_FUNC_INFO << this << "Got an out of range role: " << role;
- return QVariant();
- }
-
- if (index.row() < 0 || index.row() >= mDirectoryContents.count()) {
- qWarning() << "Attempted to access out of range row: " << index.row();
- return QVariant();
- }
-
- if (index.column() != 0)
- return QVariant();
-#endif
-
- const DirItemInfo &fi = mDirectoryContents.at(index.row());
-
- switch (role) {
- case FileNameRole:
- return fi.fileName();
- case AccessedDateRole:
- return fi.lastRead();
- case CreationDateRole:
- return fi.created();
- case ModifiedDateRole:
- return fi.lastModified();
- case FileSizeRole: {
- if (fi.isBrowsable())
- {
- if (fi.isLocal())
- {
- return dirItems(fi.diskFileInfo());
- }
- //it is possible to browse network folders and get its
- //number of items, but it may take longer
- return tr("Unknown");
- }
- return fileSize(fi.size());
- }
- case IconSourceRole: {
- const QString &fileName = fi.fileName();
-
- if (fi.isDir())
- return QLatin1String("image://theme/icon-m-common-directory");
-
- if (fileName.endsWith(QLatin1String(".jpg"), Qt::CaseInsensitive) ||
- fileName.endsWith(QLatin1String(".png"), Qt::CaseInsensitive)) {
- return QLatin1String("image://nemoThumbnail/") + fi.filePath();
- }
-
- return "image://theme/icon-m-content-document";
- }
- case FilePathRole:
- return fi.filePath();
- case IsDirRole:
- return fi.isDir();
- case IsFileRole:
- return !fi.isBrowsable();
- case IsReadableRole:
- return fi.isReadable();
- case IsWritableRole:
- return fi.isWritable();
- case IsExecutableRole:
- return fi.isExecutable();
- case IsSelectedRole:
- return fi.isSelected();
- case IsHostRole:
- return fi.isHost();
- case IsRemoteRole:
- return fi.isRemote();
- case IsLocalRole:
- return fi.isLocal();
- case NeedsAuthenticationRole:
- return fi.needsAuthentication();
- case IsSmbWorkgroupRole:
- return fi.isWorkGroup();
- case IsSmbShareRole:
- return fi.isShare();
- case IsBrowsableRole:
- return fi.isBrowsable();
- case IsSharingAllowedRole:
- return fi.isDir() && !fi.isSymLink() && !fi.isSharedDir()
- && mCurLocation->isLocalDisk()
- && fi.isWritable() && fi.isExecutable() && fi.isReadable();
- case IsSharedDirRole:
- return fi.isSharedDir();
-#ifndef DO_NOT_USE_TAG_LIB
- case TrackTitleRole:
- case TrackArtistRole:
- case TrackAlbumRole:
- case TrackYearRole:
- case TrackNumberRole:
- case TrackGenreRole:
- case TrackLengthRole:
- case TrackCoverRole:
- if (mReadsMediaMetadata && fi.isLocal())
- {
- return getAudioMetaData(fi.diskFileInfo(), role);
- }
- break;
-#endif
- default:
-#if !defined(REGRESSION_TEST_FOLDERLISTMODEL)
- // this should not happen, ever
- Q_ASSERT(false);
- qWarning() << Q_FUNC_INFO << this << "Got an unknown role: " << role;
-#endif
- break;
- }//switch (role)
-
- return QVariant();
-}
-
-
-/*!
- * \brief DirModel::setPathWithAuthentication() It is just a QML entry point as setPath is a QML property and cannot be called as a function
- * \param path
- * \param user
- * \param password
- * \param savePassword
- */
-void DirModel::setPathWithAuthentication(const QString &path, const QString &user, const QString &password, bool savePassword)
-{
- setPath(path,user,password,savePassword);
-}
-
-
-void DirModel::setPath(const QString &pathName, const QString& user, const QString &password, bool savePassword)
-{
- if (pathName.isEmpty())
- return;
-
- if (mAwaitingResults) {
- // TODO: handle the case where pathName != our current path, cancel old
- // request, start a new one
- qDebug() << Q_FUNC_INFO << this << "Ignoring path change request, request already running in" << pathName;
- return;
- }
-
- Location *location = mLocationFactory->setNewPath(pathName, user, password, savePassword);
- if (location == 0)
- {
- // perhaps a goBack() operation to a folder/location that was removed,
- // in this case we remove that folder/location from the list
- if (mPathList.count() > 0 && mPathList.last() == pathName)
- {
- mPathList.removeLast();
- }
- if (!mLocationFactory->lastUrlNeedsAuthentication())
- {
- emit error(tr("path or url may not exist or cannot be read"), pathName);
- qDebug() << Q_FUNC_INFO << this << "path or url may not exist or cannot be read:" << pathName;
- }
- return;
- }
-
- mCurLocation = location;
- setPathFromCurrentLocation();
-}
-
-/*!
- * \brief DirModel::setPathFromCurrentLocation() changes current Path using current Location
- *
- * Used in \ref cdUp() and \ref cdIntoIndex()
- */
-void DirModel::setPathFromCurrentLocation()
-{
- mAwaitingResults = true;
- emit awaitingResultsChanged();
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << this << "Changing to " << mCurLocation->urlPath();
-#endif
-
- clear();
-
- mCurLocation->fetchItems(currentDirFilter(), mIsRecursive);
-
- mCurrentDir = mCurLocation->urlPath();
- if (mPathList.count() == 0 || mPathList.last() != mCurrentDir)
- {
- mPathList.append(mCurrentDir);
- }
- emit pathChanged(mCurLocation->urlPath());
-}
-
-
-void DirModel::goBack()
-{
- if (mPathList.count() > 1 && !mAwaitingResults)
- {
- mPathList.removeLast();
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << this << "changing to" << mPathList.last();
-#endif
- setPath(mPathList.last());
- }
-}
-
-void DirModel::onItemsFetched() {
- if (mAwaitingResults) {
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << this << "No longer awaiting results";
-#endif
- mAwaitingResults = false;
- emit awaitingResultsChanged();
- }
-}
-
-
-bool DirModel::isAllowedPath(const QString &absolutePath) const {
- // A simple fail check to try protect against most obvious accidental usages.
- // This is a private function and should always get an absolute FilePath from caller,
- // but just in case check if there's relational path in there.
- // Example: absoluteFilePath = /home/$USER/Photos/../shouldNotGetHere => fail
- if (absolutePath.contains("/../")) {
- qWarning() << Q_FUNC_INFO << "Possible relational file path provided, only absolute filepaths allowed. Fix calling of this function.";
- return false;
- }
-
- foreach (const QString &allowedDirectory, m_allowedDirs) {
- if (absolutePath == allowedDirectory) return true;
- // Returns true for any file/folder inside allowed directory
- if (absolutePath.startsWith(allowedDirectory + "/")) return true;
- }
-
- return false;
-}
-
-bool DirModel::allowAccess(const DirItemInfo &fi) const {
- bool allowed = !mOnlyAllowedPaths; // !mOnlyAllowedPaths means any path is allowed
- if (!allowed)
- {
- allowed = fi.isRemote() ? !fi.needsAuthentication() : //remote locations
- isAllowedPath(fi.absoluteFilePath());//local disk locations
- }
- return allowed;
-}
-
-/*!
- * \brief DirModel::allowCurrentPathAccess() Checks the access in the current path \a mCurrentDir
- *
- * As \a mCurrentDir comes from mCurLocation->info()->urlPath() allowAccess(const DirItemInfo &fi) can be used here
- *
- * \sa setPathFromCurrentLocation()
- *
- * \return
- */
-bool DirModel::allowCurrentPathAccess() const {
- const DirItemInfo *currentDirInfo = mCurLocation->info();
- Q_ASSERT(currentDirInfo);
- return allowAccess(*currentDirInfo);
-}
-
-
-void DirModel::onItemsAdded(const DirItemInfoList &newFiles)
-{
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << this << "Got new files: " << newFiles.count();
-#endif
-
- if (newFiles.count() > 0)
- {
- mDirectoryContents.reserve(newFiles.count()) ;
- }
- foreach (const DirItemInfo &fi, newFiles) {
- if (!allowAccess(fi)) continue;
-
- bool doAdd = false;
- foreach (const QString &nameFilter, mNameFilters) {
- // TODO: using QRegExp for wildcard matching is slow
- QRegExp re(nameFilter, Qt::CaseInsensitive, QRegExp::Wildcard);
- if (re.exactMatch(fi.fileName()) || (fi.isDir() && !mFilterDirectories)) {
- doAdd = true;
- break;
- }
- }
-
- if (!doAdd)
- continue;
-
- addItem(fi);
- }
-}
-
-void DirModel::rm(const QStringList &paths)
-{
- if (!allowCurrentPathAccess()) {
- qDebug() << Q_FUNC_INFO << "Access denied in current path" << mCurrentDir;
- return;
- }
-
- //if current location is Trash only in the root is allowed to remove Items
- if (mCurLocation->isTrashDisk())
- {
- if (IS_BROWSING_TRASH_ROOTDIR())
- {
- m_fsAction->removeFromTrash(paths);
- }
- }
- else
- {
- m_fsAction->remove(paths);
- }
-}
-
-
-bool DirModel::rename(const QString& oldName, const QString &newName)
-{
- return rename(getIndex(oldName), newName);
-}
-
-
-bool DirModel::rename(int row, const QString &newName)
-{
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << this << "Renaming " << row << " to " << newName;
-#endif
- if (!IS_VALID_ROW(row)) {
- WARN_ROW_OUT_OF_RANGE(row);
- return false;
- }
-
- if (!allowCurrentPathAccess()) {
- qDebug() << Q_FUNC_INFO << "Access denied in current path" << mCurrentDir;
- return false;
- }
-
- const DirItemInfo &fi = mDirectoryContents.at(row);
- if (!allowAccess(fi)) {
- qDebug() << Q_FUNC_INFO << "Access denied in" << fi.absoluteFilePath();
- return false;
- }
-
- QString newFullFilename(fi.absolutePath() + QDir::separator() + newName);
-
- //QFile::rename() works for File and Dir
- QFile f(fi.absoluteFilePath());
- bool retval = f.rename(newFullFilename);
- if (!retval)
- {
- qDebug() << Q_FUNC_INFO << this << "Rename returned error code: " << f.error() << f.errorString();
- emit(QObject::tr("Rename error"), f.errorString());
- }
- else
- {
- bool isSelected = mDirectoryContents.at(row).isSelected();
- onItemRemoved(mDirectoryContents.at(row));
- int newRow = addItem(DirItemInfo(QFileInfo(newFullFilename)));
- //keep previous selected state, selection takes care of everything
- mSelection->setIndex(newRow,isSelected);
- }
- return retval;
-}
-
-
-bool DirModel::mkdir(const QString &newDir)
-{
- QScopedPointer<LocationItemDir> dir(mCurLocation->newDir(mCurrentDir));
- bool retval = dir->mkdir(newDir);
- if (!retval) {
- const char *errorStr = strerror(errno);
- qDebug() << Q_FUNC_INFO << this << "Error creating new directory: " << errno << " (" << errorStr << ")";
- emit error(QObject::tr("Error creating new folder"), errorStr);
- } else {
- QScopedPointer<DirItemInfo> subItem(mCurLocation->newItemInfo(newDir));
- if (subItem->isRelative())
- {
- subItem->setFile(mCurrentDir, newDir);
- }
- onItemAdded(*subItem);
- }
- return retval;
-}
-
-bool DirModel::showDirectories() const
-{
- return mShowDirectories;
-}
-
-void DirModel::setShowDirectories(bool showDirectories)
-{
- mShowDirectories = showDirectories;
- refresh();
- emit showDirectoriesChanged();
-}
-
-bool DirModel::isRecursive() const
-{
- return mIsRecursive;
-}
-
-void DirModel::setIsRecursive(bool isRecursive)
-{
- mIsRecursive = isRecursive;
- refresh();
- emit isRecursiveChanged();
-}
-
-bool DirModel::readsMediaMetadata() const
-{
- return mReadsMediaMetadata;
-}
-
-void DirModel::setReadsMediaMetadata(bool readsMediaMetadata)
-{
- mReadsMediaMetadata = readsMediaMetadata;
- refresh();
- emit readsMediaMetadataChanged();
-}
-
-bool DirModel::filterDirectories() const
-{
- return mFilterDirectories;
-}
-
-void DirModel::setFilterDirectories(bool filterDirectories)
-{
- mFilterDirectories = filterDirectories;
- refresh();
- emit filterDirectoriesChanged();
-}
-
-QStringList DirModel::nameFilters() const
-{
- return mNameFilters;
-}
-
-void DirModel::setNameFilters(const QStringList &nameFilters)
-{
- mNameFilters = nameFilters;
- refresh();
- emit nameFiltersChanged();
-}
-
-bool DirModel::awaitingResults() const
-{
- return mAwaitingResults;
-}
-
-
-QString DirModel::parentPath() const
-{
- const DirItemInfo *dir = mCurLocation->info();
- if (dir->isRoot()) {
- qDebug() << Q_FUNC_INFO << this << "already at root";
- return mCurrentDir;
- }
-
- if (!canReadDir(dir->absolutePath())) {
- qWarning() << Q_FUNC_INFO << this << "Failed to to go to parent of " << mCurrentDir;
- return mCurrentDir;
- }
- qDebug() << Q_FUNC_INFO << this << "returning" << dir->absolutePath();
- return dir->absolutePath();
-}
-
-QString DirModel::homePath() const
-{
- return QDir::homePath();
-}
-
-QString DirModel::lastFolderVisited() const
-{
- if (mPathList.length() > 1) {
- return mPathList[mPathList.length()-2];
- }
- else {
- return "";
- }
-}
-
-#if defined(REGRESSION_TEST_FOLDERLISTMODEL)
-int DirModel::columnCount(const QModelIndex &parent) const
-{
- Q_UNUSED(parent);
- return TrackCoverRole - FileNameRole + 1;
-}
-QVariant DirModel::headerData(int section, Qt::Orientation orientation, int role) const
-{
- if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
- {
- QVariant ret;
- QHash<int, QByteArray> roles = this->roleNames();
- section += FileNameRole;
- if (roles.contains(section))
- {
- QString header= QString(roles.value(section));
- ret = header;
- }
- return ret;
- }
- return QAbstractItemModel::headerData(section, orientation, role);
-}
-ExternalFSWatcher * DirModel::getExternalFSWatcher() const
-{
- Location *l = mLocationFactory->getDiskLocation();
- DiskLocation *disk = static_cast<DiskLocation*> (l);
- return disk->getExternalFSWatcher();
-}
-#endif
-
-
-void DirModel::goHome()
-{
- setPath(QDir::homePath());
-}
-
-
-void DirModel::goTrash()
-{
- setPath(LocationUrl::TrashRootURL);
-}
-
-
-bool DirModel::cdUp()
-{
- int ret = mCurLocation && mCurLocation->becomeParent();
- if (ret)
- {
- setPathFromCurrentLocation();
- }
- return ret;
-}
-
-
-void DirModel::removeIndex(int row)
-{
- if (IS_VALID_ROW(row))
- {
- const DirItemInfo &fi = mDirectoryContents.at(row);
- QStringList list(fi.absoluteFilePath());
- this->rm(list);
- }
- else
- {
- WARN_ROW_OUT_OF_RANGE(row);
- }
-}
-
-void DirModel::removePaths(const QStringList& items)
-{
- this->rm(items);
-}
-
-void DirModel::copyIndex(int row)
-{
- if (IS_VALID_ROW(row))
- {
- const DirItemInfo &fi = mDirectoryContents.at(row);
- QStringList list(fi.absoluteFilePath());
- this->copyPaths(list);
- }
- else
- {
- WARN_ROW_OUT_OF_RANGE(row);
- }
-}
-
-void DirModel::copyPaths(const QStringList &items)
-{
- mClipboard->copy(items, mCurrentDir);
-}
-
-
-void DirModel::cutIndex(int row)
-{
- if (IS_VALID_ROW(row))
- {
- const DirItemInfo &fi = mDirectoryContents.at(row);
- QStringList list(fi.absoluteFilePath());
- this->cutPaths(list);
- }
- else
- {
- WARN_ROW_OUT_OF_RANGE(row);
- }
-}
-
-
-void DirModel::cutPaths(const QStringList &items)
-{
- if (!allowCurrentPathAccess()) {
- qDebug() << Q_FUNC_INFO << "Access denied in current path" << mCurrentDir;
- return;
- }
-
- mClipboard->cut(items, mCurrentDir);
-}
-
-
-void DirModel::paste()
-{
- // Restrict pasting if in restricted directory when pasting on a local file system
- if (!allowCurrentPathAccess()) {
- qDebug() << Q_FUNC_INFO << "access not allowed, pasting not done" << mCurrentDir;
- return;
- }
-
- ClipboardOperation operation;
- QStringList items = mClipboard->paste(operation);
- if (operation == ClipboardCut)
- {
- m_fsAction->moveIntoCurrentPath(items);
- }
- else
- {
- m_fsAction->copyIntoCurrentPath(items);
- }
-}
-
-void DirModel::clearClipboard()
-{
- mClipboard->clear();
-}
-
-bool DirModel::cdIntoIndex(int row)
-{
- bool ret = false;
- if (IS_VALID_ROW(row))
- {
- ret = cdIntoItem(mDirectoryContents.at(row));
- }
- else
- {
- WARN_ROW_OUT_OF_RANGE(row);
- }
- return ret;
-}
-
-/*!
- * \brief DirModel::cdIntoPath() It is used to go into an item from the current path or to a absolute path
- * \param filename
- * \return
- */
-bool DirModel::cdIntoPath(const QString &filename)
-{
- return openPath(filename);
-}
-
-
-bool DirModel::cdIntoItem(const DirItemInfo &fi)
-{
- bool ret = false;
- const DirItemInfo *item = &fi;
- DirItemInfo *created_itemInfo = 0;
- if (fi.isBrowsable())
- {
- bool needs_authentication = fi.needsAuthentication();
- if (needs_authentication)
- {
- if (mCurLocation->useAuthenticationDataIfExists(fi))
- {
- //there is a password stored to try
- created_itemInfo = mCurLocation->newItemInfo(fi.urlPath());
- item = created_itemInfo;
- needs_authentication = item->needsAuthentication();
- }
- }
- //item needs authentication and there is no user/password to try
- // or there is a user/password already used but failed
- if (needs_authentication)
- {
- mCurLocation->notifyItemNeedsAuthentication(&fi);
- //return true to avoid any error message to appear
- //a dialog must be presented to the user asking for user/password
- ret = true;
- }
- else
- {
- if (item->isContentReadable())
- {
- mCurLocation->setInfoItem(*item);
- setPathFromCurrentLocation();
- ret = true;
- }
- else
- {
- //some other error
- }
- }
- }
- if (created_itemInfo != 0)
- {
- delete created_itemInfo;
- }
- return ret;
-}
-
-
-void DirModel::onItemRemoved(const DirItemInfo &fi)
-{
- int row = rowOfItem(fi);
-#if DEBUG_MESSAGES || DEBUG_EXT_FS_WATCHER
- qDebug() << Q_FUNC_INFO << this
- << "row" << row
- << "name" << fi.absoluteFilePath()
- << "removed[True|False]:" << (row >= 0);
-#endif
- if (row >= 0)
- {
- beginRemoveRows(QModelIndex(), row, row);
- if (mDirectoryContents.at(row).isSelected())
- {
- mSelection->itemGoingToBeRemoved(mDirectoryContents.at(row));
- }
- mDirectoryContents.remove(row,1);
- endRemoveRows();
- }
-}
-
-
-void DirModel::onItemAdded(const DirItemInfo &fi)
-{
- int newRow = addItem(fi);
- emit insertedRow(newRow);
-}
-
-/*!
- * \brief DirModel::addItem() adds an item into the model
- * This code was moved from onItemsAdded(const QVector<QFileInfo> &newFiles),
- * the reason is: this code now is used for \ref mkdir() and for \ref paste() operations
- * that inserts new items
- * \param fi
- * \return the index where it was inserted, it can be used in the view
- * \sa insertedRow()
- */
-int DirModel::addItem(const DirItemInfo &fi)
-{
- if (!allowAccess(fi)) {
- return -1;
- }
- DirItemInfoList::Iterator it = qLowerBound(mDirectoryContents.begin(),
- mDirectoryContents.end(),
- fi,
- mCompareFunction);
- int idx = mDirectoryContents.count();
-
- if (it == mDirectoryContents.end()) {
- beginInsertRows(QModelIndex(), idx, idx);
- mDirectoryContents.append(fi);
- endInsertRows();
- } else {
- idx = it - mDirectoryContents.begin();
- beginInsertRows(QModelIndex(), idx, idx);
- mDirectoryContents.insert(it, fi);
- endInsertRows();
- }
- return idx;
-}
-
-/*!
- * \brief DirModel::onItemChanged() Changes an item data
- *
- * \note If the item does not exist it is inserted
- *
- * \param fi DirItemInfo of the item
- */
-void DirModel::onItemChanged(const DirItemInfo &fi)
-{
- int row = rowOfItem(fi);
- if (row >= 0)
- {
- if (mDirectoryContents.at(row).isSelected())
- {
- mSelection->itemGoingToBeReplaced(mDirectoryContents.at(row), fi);
- DirItemInfo *myFi = const_cast<DirItemInfo*> (&fi);
- myFi->setSelection(true);
- }
- mDirectoryContents[row] = fi;
- notifyItemChanged(row);
- }
- else
- { // it simplifies some logic outside, when removing and adding on the same operation
- onItemAdded(fi);
- }
-}
-
-
-void DirModel::cancelAction()
-{
- m_fsAction->cancel();
-}
-
-
-QString DirModel::fileSize(qint64 size) const
-{
- struct UnitSizes
- {
- qint64 bytes;
- const char *name;
- };
-
- static UnitSizes m_unitBytes[5] =
- {
- { 1, "Bytes" }
- ,{1024, "kB"}
- // got it from http://wiki.answers.com/Q/How_many_bytes_are_in_a_megabyte
- ,{1000 * 1000, "MB"}
- ,{1000 * m_unitBytes[2].bytes, "GB"}
- ,{1000 * m_unitBytes[3].bytes, "TB"}
- };
-
- QString ret;
- int unit = sizeof(m_unitBytes)/sizeof(m_unitBytes[0]);
- while( unit-- > 1 && size < m_unitBytes[unit].bytes );
- if (unit > 0 )
- {
- ret.sprintf("%0.1f %s", (float)size/m_unitBytes[unit].bytes,
- m_unitBytes[unit].name);
- }
- else
- {
- ret.sprintf("%ld %s", (long int)size, m_unitBytes[0].name);
- }
- return ret;
-}
-
-
-
-bool DirModel::getShowHiddenFiles() const
-{
- return mShowHiddenFiles;
-}
-
-
-void DirModel::setShowHiddenFiles(bool show)
-{
- if (show != mShowHiddenFiles)
- {
- mShowHiddenFiles = show;
- refresh();
- emit showHiddenFilesChanged();
- }
-}
-
-bool DirModel::getOnlyAllowedPaths() const
-{
- return mOnlyAllowedPaths;
-}
-
-
-void DirModel::setOnlyAllowedPaths(bool onlyAllowedPaths)
-{
- if (onlyAllowedPaths != mOnlyAllowedPaths)
- {
- mOnlyAllowedPaths = onlyAllowedPaths;
- refresh();
- emit onlyAllowedPathsChanged();
- }
-}
-
-
-void DirModel::toggleShowDirectories()
-{
- setShowDirectories(!mShowDirectories);
-}
-
-
-void DirModel::toggleShowHiddenFiles()
-{
- setShowHiddenFiles(!mShowHiddenFiles);
-}
-
-
-DirModel::SortBy
-DirModel::getSortBy() const
-{
- return mSortBy;
-}
-
-
-void DirModel::setSortBy(SortBy field)
-{
- if (field != mSortBy)
- {
- mSortBy = field;
- setCompareAndReorder();
- emit sortByChanged();
- }
-}
-
-
-DirModel::SortOrder
-DirModel::getSortOrder() const
-{
- return mSortOrder;
-}
-
-void DirModel::setSortOrder(SortOrder order)
-{
- if ( order != mSortOrder )
- {
- mSortOrder = order;
- setCompareAndReorder();
- emit sortOrderChanged();
- }
-}
-
-
-void DirModel::toggleSortOrder()
-{
- SortOrder order = static_cast<SortOrder> (mSortOrder ^ 1);
- setSortOrder(order);
-}
-
-
-void DirModel::toggleSortBy()
-{
- SortBy by = static_cast<SortBy> (mSortBy ^ 1);
- setSortBy(by);
-}
-
-/*!
- * \brief DirModel::setCompareAndReorder() called when SortOrder or SortBy change
- *
- * It does not reload items from disk, just reorganize items from \a mDirectoryContents array
- */
-void DirModel::setCompareAndReorder()
-{
- mCompareFunction = availableCompareFunctions[mSortBy][mSortOrder];
- if (mDirectoryContents.count() > 0 && !mAwaitingResults )
- {
- DirItemInfoList tmpDirectoryContents = mDirectoryContents;
- beginResetModel();
- mDirectoryContents.clear();
- endResetModel();
- for(int counter=0; counter < tmpDirectoryContents.count(); counter++)
- {
- addItem(tmpDirectoryContents.at(counter));
- }
- }
-}
-
-
-int DirModel::getClipboardUrlsCounter() const
-{
- return mClipboard->storedUrlsCounter();
-}
-
-
-int DirModel::rowOfItem(const DirItemInfo& fi)
-{
- int row = -1;
- //to use qBinaryFind() the array needs to be ordered ascending
- if (mCompareFunction == fileCompareAscending)
- {
- DirItemInfoList::Iterator it = qBinaryFind(mDirectoryContents.begin(),
- mDirectoryContents.end(),
- fi,
- fileCompareExists);
- if (it != mDirectoryContents.end())
- {
- row = it - mDirectoryContents.begin();
- }
- }
- else //walk through whole array
- {
- //TODO improve this search
- int counter = mDirectoryContents.count();
- while (counter--)
- {
- if ( 0 == QString::localeAwareCompare(fi.absoluteFilePath(),
- mDirectoryContents.at(counter).absoluteFilePath()) )
- {
- row = counter;
- break;
- }
- }
- }
- return row;
-}
-
-
-QDir::Filters DirModel::currentDirFilter() const
-{
- QDir::Filters filter(QDir::AllEntries | QDir::NoDotAndDotDot) ;
- if (!mShowDirectories)
- {
- filter &= ~QDir::AllDirs;
- filter &= ~QDir::Dirs;
- }
- if (mShowHiddenFiles)
- {
- filter |= QDir::Hidden;
- }
- if (mIsRecursive)
- {
- filter |= QDir::NoSymLinks;
- }
- return filter;
-}
-
-/*!
- * \brief DirModel::dirItems() Gets a Dir number of Items, used only for Local Disk
- *
- * For remote Locations this function is not used
- *
- * \param fi
- * \return A string saying how many items a directory has
- */
-QString DirModel::dirItems(const DirItemInfo& fi) const
-{
- int counter = 0;
- QDir d(fi.absoluteFilePath(), QString(), QDir::NoSort, currentDirFilter());
- counter = d.count();
- if (counter < 0)
- {
- counter = 0;
- }
- QString ret (QString::number(counter) + QLatin1Char(' '));
- ret += QObject::tr("items");
- return ret;
-}
-
-
-bool DirModel::openIndex(int row)
-{
- bool ret = false;
- if (IS_VALID_ROW(row))
- {
- if (mDirectoryContents.at(row).isBrowsable())
- {
- ret = cdIntoIndex(row);
- }
- else
- {
- ret = openItem(mDirectoryContents.at(row));
- }
- }
- else
- {
- WARN_ROW_OUT_OF_RANGE(row);
- }
- return ret;
-}
-
-
-bool DirModel::openPath(const QString &filename)
-{
- bool ret = false;
- QString myFilename(filename.trimmed());
- //first avoid any relative path when is root
- if ( !(mCurLocation && mCurLocation->isRoot() && myFilename.startsWith(QLatin1String(".."))) )
- {
- if (myFilename == QLatin1String("..") || myFilename == QLatin1String("../"))
- {
- ret = cdUp();
- }
- else
- {
- Location *location = mLocationFactory->setNewPath(myFilename);
- if (location)
- {
- mCurLocation = location;
- setPathFromCurrentLocation();
- ret = true;
- }
- else
- {
- const DirItemInfo *item = mLocationFactory->lastValidFileInfo();
- if (item && item->isFile())
- {
- ret = openItem(*item);
- }
- }
- }
- }
- return ret;
-}
-
-/*!
- * \brief DirModel::openItem() opens a directory/file
- * \param fi
- * \return true it could open the item
- */
-bool DirModel::openItem(const DirItemInfo &fi)
-{
- bool ret = false;
- if (fi.isBrowsable())
- {
- ret = cdIntoItem(fi);
- }
- else
- {
- //TODO open executables
- if (fi.isLocal() && fi.isReadable())
- {
- ret = QDesktopServices::openUrl(QUrl::fromLocalFile(fi.absoluteFilePath()));
- }
- }
- return ret;
-}
-
-
-
-
-
-void DirModel::onThereAreExternalChanges(const QString& pathModifiedOutside)
-{
- if ( IS_FILE_MANAGER_IDLE() )
- {
-#if DEBUG_EXT_FS_WATCHER
- qDebug() << "[extFsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz")
- << Q_FUNC_INFO << this << "File System modified in" << pathModifiedOutside;
-#endif
- mCurLocation->fetchExternalChanges(pathModifiedOutside,
- mDirectoryContents,
- currentDirFilter());
- }
-#if DEBUG_EXT_FS_WATCHER
- else
- {
- qDebug() << "[extFsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz")
- << Q_FUNC_INFO << this << "Busy, nothing to do";
- }
-#endif
-}
-
-/*!
- * \brief DirModel::onItemAddedOutsideFm() It receives a signal saying an item was added by other application
- * \param fi
- */
-void DirModel::onItemAddedOutsideFm(const DirItemInfo &fi)
-{
-#if DEBUG_EXT_FS_WATCHER
- int before = rowCount();
-#endif
- if (IS_FILE_MANAGER_IDLE())
- {
- int row = rowOfItem(fi);
- if (row == -1)
- {
- onItemAdded(fi);
- }
- }
-#if DEBUG_EXT_FS_WATCHER
- qDebug() << "[extFsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz")
- << Q_FUNC_INFO << this
- << "counterBefore:" << before
- << "added" << fi.absoluteFilePath()
- << "counterAfter:" << rowCount();
-#endif
-}
-
-/*!
- * \brief DirModel::onItemRemovedOutSideFm() It receives a signal saying an item was removed by other application
- *
- * Just calls \ref onItemRemoved() which already checks if the item exists
- *
- * \param fi
- */
-void DirModel::onItemRemovedOutSideFm(const DirItemInfo &fi)
-{
- if (IS_FILE_MANAGER_IDLE())
- {
-#if DEBUG_EXT_FS_WATCHER
- qDebug() << "[extFsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz")
- << Q_FUNC_INFO << this << "removed" << fi.absoluteFilePath();
-#endif
- onItemRemoved(fi);
- }
-}
-
-/*!
- * \brief DirModel::onItemChangedOutSideFm()
- *
- * A File or a Dir modified by other applications: size,date, permissions
- */
-void DirModel::onItemChangedOutSideFm(const DirItemInfo &fi)
-{
- if (IS_FILE_MANAGER_IDLE())
- {
- onItemChanged(fi);
-#if DEBUG_EXT_FS_WATCHER
- qDebug() << "[extFsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz")
- << Q_FUNC_INFO << this << "changed" << fi.absoluteFilePath()
- << "from row" << rowOfItem(fi);
-#endif
- }
-}
-
-
-/*!
- * \brief DirModel::onExternalFsWatcherFinihed()
- */
-void DirModel::onExternalFsWorkerFinished(int currentDirCounter)
-{
-
-#if DEBUG_EXT_FS_WATCHER
- qDebug() << "[extFsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz")
- << Q_FUNC_INFO << this
- << "currentDirCounter:" << currentDirCounter;
-
-#endif
- if (currentDirCounter == 0 && IS_FILE_MANAGER_IDLE())
- {
- clear();
- }
-}
-
-
-/*!
- * \brief DirModel:getEnabledExternalFSWatcher()
- * \return true if the External File System Watcher is enabled
- */
-bool DirModel::getEnabledExternalFSWatcher() const
-{
- return mExtFSWatcher;
-}
-
-
-/*!
- * \brief DirModel::setEnabledExternalFSWatcher() enable/disable External File Sysmte Watcher
- * \param enable
- */
-void DirModel::setEnabledExternalFSWatcher(bool enable)
-{
- emit enabledExternalFSWatcherChanged(enable);
-}
-
-
-bool DirModel::existsDir(const QString &folderName) const
-{
- DirItemInfo d(setParentIfRelative(folderName));
- return d.exists() && d.isDir();
-}
-
-bool DirModel::canReadDir(const QString &folderName) const
-{
- DirItemInfo d(setParentIfRelative(folderName));
- return d.isDir() && d.isReadable() && d.isExecutable();
-}
-
-
-bool DirModel::existsFile(const QString &fileName) const
-{
- DirItemInfo f(setParentIfRelative(fileName));
- return f.exists() && f.isFile();
-}
-
-bool DirModel::canReadFile(const QString &fileName) const
-{
- DirItemInfo f(setParentIfRelative(fileName));
- return f.isReadable() && f.isFile();
-}
-
-
-QDateTime DirModel::curPathCreatedDate() const
-{
- return mCurLocation->currentInfo()->created();
-}
-
-
-QDateTime DirModel::curPathModifiedDate() const
-{
- return mCurLocation->currentInfo()->lastModified();
-}
-
-
-QDateTime DirModel::curPathAccessedDate() const
-{
- return mCurLocation->currentInfo()->lastRead();
-}
-
-
-bool DirModel::curPathIsWritable() const
-{
- return mCurLocation->currentInfo()->isWritable();
-}
-
-QString DirModel::curPathCreatedDateLocaleShort() const
-{
- QString date;
- QDateTime d(curPathCreatedDate());
- if (!d.isNull())
- {
- date = d.toString(Qt::SystemLocaleShortDate);
- }
- return date;
-}
-
-
-QString DirModel::curPathModifiedDateLocaleShort() const
-{
- QString date;
- QDateTime d(curPathModifiedDate());
- if (!d.isNull())
- {
- date = d.toString(Qt::SystemLocaleShortDate);
- }
- return date;
-}
-
-
-QString DirModel::curPathAccessedDateLocaleShort() const
-{
- QString date;
- QDateTime d(curPathAccessedDate());
- if (!d.isNull())
- {
- date = d.toString(Qt::SystemLocaleShortDate);
- }
- return date;
-}
-
-
-DirItemInfo DirModel::setParentIfRelative(const QString &fileOrDir) const
-{
- QScopedPointer<DirItemInfo> myFi(mCurLocation->newItemInfo(fileOrDir));
- if (!myFi->isAbsolute())
- {
- myFi->setFile(mCurrentDir, fileOrDir);
- }
- return *myFi;
-}
-
-
-int DirModel::getProgressCounter() const
-{
- return m_fsAction->getProgressCounter();
-}
-
-
-void DirModel::clear()
-{
- beginResetModel();
- mDirectoryContents.clear();
- mSelection->clear();
- endResetModel();
-}
-
-
-DirSelection * DirModel::selectionObject() const
-{
- return mSelection;
-}
-
-
-void DirModel::registerMetaTypes()
-{
- qRegisterMetaType<DirItemInfoList>("DirItemInfoList");
- qRegisterMetaType<DirItemInfo>("DirItemInfo");
-}
-
-void DirModel::notifyItemChanged(int row)
-{
- QModelIndex first = index(row,0);
-#if REGRESSION_TEST_FOLDERLISTMODEL
- QModelIndex last = index(row, columnCount()); //Table only when testing
-#else
- QModelIndex last = first; //QML uses Listview, just one column
-#endif
- emit dataChanged(first, last);
-}
-
-
-int DirModel::getIndex(const QString &name)
-{
- QFileInfo i(name);
- return rowOfItem(DirItemInfo(i));
-}
-
-
-void DirModel:: moveIndexesToTrash(const QList<int>& items)
-{
- if (mCurLocation->isLocalDisk())
- {
- const TrashLocation *trashLocation = static_cast<const TrashLocation*>
- (mLocationFactory->getTrashLocation());
- ActionPathList itemsAndTrashPath;
- int index = 0;
- for (int counter=0; counter < items.count(); ++counter)
- {
- index = items.at(counter);
- if (IS_VALID_ROW(index))
- {
- const DirItemInfo &it = mDirectoryContents.at(index);
- itemsAndTrashPath.append(trashLocation->getMovePairPaths(it));
- }
- }
- if (itemsAndTrashPath.count() > 0)
- {
- m_fsAction->moveToTrash(itemsAndTrashPath);
- }
- }
-}
-
-
-void DirModel:: moveIndexToTrash(int index)
-{
- QList<int> list;
- list.append(index);
- return moveIndexesToTrash(list);
-}
-
-
-void DirModel::restoreTrash()
-{
- if ( IS_BROWSING_TRASH_ROOTDIR() )
- {
- QList<int> allItems;
- for (int counter=0; counter < rowCount(); ++counter)
- {
- allItems.append(counter);
- }
- restoreIndexesFromTrash(allItems);
- }
-}
-
-
-void DirModel::emptyTrash()
-{
- if ( IS_BROWSING_TRASH_ROOTDIR() )
- {
- QStringList allItems;
- for (int counter=0; counter < rowCount(); ++counter)
- {
- allItems.append(mDirectoryContents.at(counter).absoluteFilePath());
- }
- if (allItems.count() > 0)
- {
- m_fsAction->removeFromTrash(allItems);
- }
- }
-}
-
-
-void DirModel::restoreIndexFromTrash(int index)
-{
- QList<int> item;
- item.append(index);
- restoreIndexesFromTrash(item);
-}
-
-
-void DirModel::restoreIndexesFromTrash(const QList<int> &items)
-{
- if ( IS_BROWSING_TRASH_ROOTDIR() )
- {
- TrashLocation *trashLocation = static_cast<TrashLocation*> (mCurLocation);
- ActionPathList itemsAndOriginalPaths;
- int index = 0;
- for (int counter=0; counter < items.count(); ++counter)
- {
- index = items.at(counter);
- if (IS_VALID_ROW(index))
- {
- const DirItemInfo &it = mDirectoryContents.at(index);
- itemsAndOriginalPaths.append(trashLocation->getRestorePairPaths(it));
- }
- }
- if (itemsAndOriginalPaths.count() > 0)
- {
- m_fsAction->restoreFromTrash(itemsAndOriginalPaths);
- }
- }
-}
-
-
-void DirModel::copySelection()
-{
- copyPaths(selectionObject()->selectedAbsFilePaths());
-}
-
-
-void DirModel::cutSelection()
-{
- cutPaths(selectionObject()->selectedAbsFilePaths());
-}
-
-
-void DirModel::removeSelection()
-{
- removePaths(selectionObject()->selectedAbsFilePaths());
-}
-
-
-void DirModel::moveSelectionToTrash()
-{
- moveIndexesToTrash(selectionObject()->selectedIndexes());
-}
-
-
-void DirModel::restoreSelectionFromTrash()
-{
- restoreIndexesFromTrash(selectionObject()->selectedIndexes());
-}
-
-
-
-bool DirModel::download(int index)
-{
- bool ret = false;
- if (IS_VALID_ROW(index))
- {
- QString outputFile(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) +
- QDir::separator() + mDirectoryContents.at(index).fileName());
- ret = downloadAndSaveAs(index, outputFile);
- }
- return ret;
-}
-
-
-bool DirModel::downloadAndSaveAs(int index, const QString &filename)
-{
- bool ret = false;
- if (IS_VALID_ROW(index))
- {
- ret = m_fsAction->downloadAndSaveAs(mDirectoryContents.at(index),
- filename);
- }
- return ret;
-}
-
-
-bool DirModel::downloadAsTemporaryFile(int index)
-{
- bool ret = false;
- if (IS_VALID_ROW(index))
- {
- ret = m_fsAction->downloadAsTemporaryFile(mDirectoryContents.at(index));
- }
- return ret;
-}
-
-
-#ifndef DO_NOT_USE_TAG_LIB
-QVariant DirModel::getAudioMetaData(const QFileInfo& fi, int role) const
-{
- QVariant empty;
- if (!fi.isDir()) {
- TagLib::FileRef f(fi.absoluteFilePath().toStdString().c_str(), true, TagLib::AudioProperties::Fast);
- TagLib::MPEG::File mp3(fi.absoluteFilePath().toStdString().c_str(), true, TagLib::MPEG::Properties::Fast);
- TagLib::Tag *tag = f.tag();
- if (tag)
- {
- TagLib::ID3v2::FrameList list = mp3.ID3v2Tag()->frameListMap()["APIC"];
- switch (role) {
- case TrackTitleRole:
- return QString::fromUtf8(tag->title().toCString(true));
- case TrackArtistRole:
- return QString::fromUtf8(tag->artist().toCString(true));
- case TrackAlbumRole:
- return QString::fromUtf8(tag->album().toCString(true));
- case TrackYearRole:
- return QString::number(tag->year());
- case TrackNumberRole:
- return QString::number(tag->track());
- case TrackGenreRole:
- return QString::fromUtf8(tag->genre().toCString(true));
- case TrackLengthRole:
- if (!f.isNull() && f.audioProperties()) {
- return QString::number(f.audioProperties()->length());
- } else {
- return QString::number(0);
- }
- case TrackCoverRole:
- if (!list.isEmpty()) {
- TagLib::ID3v2::AttachedPictureFrame *Pic = static_cast<TagLib::ID3v2::AttachedPictureFrame *>(list.front());
- QImage img;
- img.loadFromData((const uchar *) Pic->picture().data(), Pic->picture().size());
- return img;
- }
- default:
- break;
- } //switch
- }//if (tag)
- }
- return empty;
-}
-#endif
=== removed file 'src/plugin/folderlistmodel/dirmodel.h'
--- src/plugin/folderlistmodel/dirmodel.h 2016-07-18 18:44:13 +0000
+++ src/plugin/folderlistmodel/dirmodel.h 1970-01-01 00:00:00 +0000
@@ -1,570 +0,0 @@
-/*
- * Copyright (C) 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- */
-
-#ifndef DIRMODEL_H
-#define DIRMODEL_H
-
-
-#include <QStringList>
-#include <QDir>
-#include <QSet>
-
-#include "iorequest.h"
-#include "filecompare.h"
-#include "diritemabstractlistmodel.h"
-#include "diriteminfo.h"
-
-class FileSystemAction;
-class Clipboard;
-class DirSelection;
-class LocationsFactory;
-class Location;
-class ExternalFSWatcher;
-class NetAuthenticationDataList;
-
-class DirModel : public DirItemAbstractListModel
-{
- Q_OBJECT
-public:
- enum Roles {
- FileNameRole = Qt::UserRole,
- AccessedDateRole,
- CreationDateRole,
- ModifiedDateRole,
- FileSizeRole,
- IconSourceRole,
- FilePathRole,
- IsDirRole,
- IsHostRole, //!< it can also be used for other protocols than smb/cifs
- IsRemoteRole,
- IsLocalRole,
- NeedsAuthenticationRole,
- IsSmbWorkgroupRole,
- IsSmbShareRole,
- IsSharedDirRole, //!< it can also be used for other protocols than smb/cifs
- IsSharingAllowedRole,//!< true for local directories (not in Trash) and not IsSharedDirRole
- IsBrowsableRole, //!< any Dir, Host, WorkGroup or Share
- IsFileRole,
- IsReadableRole,
- IsWritableRole,
- IsExecutableRole,
- IsSelectedRole,
- TrackTitleRole,
- TrackArtistRole,
- TrackAlbumRole,
- TrackYearRole,
- TrackNumberRole,
- TrackGenreRole,
- TrackLengthRole,
- TrackCoverRole
- };
-
-public:
- explicit DirModel(QObject *parent = 0);
- ~DirModel();
-
- static void registerMetaTypes();
-
- //DirItemAbstractListModel
- virtual int getIndex(const QString& name);
- virtual void notifyItemChanged(int row);
-
- int rowCount(const QModelIndex &index = QModelIndex()) const
- {
- if (index.parent() != QModelIndex())
- return 0;
- return mDirectoryContents.count();
- }
-
- // TODO: this won't be safe if the model can change under the holder of the row
- Q_INVOKABLE QVariant data(int row, const QByteArray &stringRole) const;
-
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-
- Q_INVOKABLE void refresh()
- {
- // just some syntactical sugar really
- setPath(path());
- }
-
- Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
- inline QString path() const { return mCurrentDir; }
- void setPath(const QString &pathName, const QString& user = QString(), const QString& password = QString(), bool savePassword = false);
-
- Q_INVOKABLE QDateTime curPathAccessedDate() const;
- Q_INVOKABLE QDateTime curPathCreatedDate() const;
- Q_INVOKABLE QDateTime curPathModifiedDate() const;
- Q_INVOKABLE QString curPathAccessedDateLocaleShort() const;
- Q_INVOKABLE QString curPathCreatedDateLocaleShort() const;
- Q_INVOKABLE QString curPathModifiedDateLocaleShort() const;
- Q_INVOKABLE bool curPathIsWritable() const;
-
- Q_PROPERTY(bool awaitingResults READ awaitingResults NOTIFY awaitingResultsChanged)
- bool awaitingResults() const;
-
- Q_INVOKABLE void rm(const QStringList &paths);
-
- Q_INVOKABLE bool rename(const QString& oldName, const QString& newName);
- Q_INVOKABLE bool rename(int row, const QString &newName);
-
- Q_INVOKABLE bool mkdir(const QString &newdir);
-
- Q_PROPERTY(bool filterDirectories READ filterDirectories WRITE setFilterDirectories NOTIFY filterDirectoriesChanged)
- bool filterDirectories() const;
-
- Q_PROPERTY(bool isRecursive READ isRecursive WRITE setIsRecursive NOTIFY isRecursiveChanged)
- bool isRecursive() const;
-
- Q_PROPERTY(bool readsMediaMetadata READ readsMediaMetadata WRITE setReadsMediaMetadata NOTIFY readsMediaMetadataChanged)
- bool readsMediaMetadata() const;
-
- Q_PROPERTY(bool showDirectories READ showDirectories WRITE setShowDirectories NOTIFY showDirectoriesChanged)
- bool showDirectories() const;
-
- Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters NOTIFY nameFiltersChanged)
- QStringList nameFilters() const;
- void setNameFilters(const QStringList &nameFilters);
-
-public slots:
- void onItemsAdded(const DirItemInfoList &newFiles);
- void onItemsFetched();
-
-signals:
- void awaitingResultsChanged();
- void nameFiltersChanged();
- void filterDirectoriesChanged();
- void isRecursiveChanged();
- void readsMediaMetadataChanged();
- void showDirectoriesChanged();
- void pathChanged(const QString& newPath);
- void error(const QString &errorTitle, const QString &errorMessage);
-
-private:
- QHash<int, QByteArray> buildRoleNames() const;
- QHash<int, QByteArray> roleNames() const;
- QStringList mNameFilters;
- bool mFilterDirectories;
- bool mShowDirectories;
- bool mAwaitingResults;
- bool mIsRecursive;
- bool mReadsMediaMetadata;
- QString mCurrentDir;
- DirItemInfoList mDirectoryContents;
-
-public:
-
- Q_INVOKABLE DirSelection * selectionObject() const ;
-
- //[0] new stuff Ubuntu File Manager
- Q_PROPERTY(QString parentPath READ parentPath NOTIFY pathChanged)
- QString parentPath() const;
-
- Q_PROPERTY(bool showHiddenFiles READ getShowHiddenFiles WRITE setShowHiddenFiles NOTIFY showHiddenFilesChanged)
- bool getShowHiddenFiles() const;
-
- Q_PROPERTY(bool onlyAllowedPaths READ getOnlyAllowedPaths WRITE setOnlyAllowedPaths NOTIFY onlyAllowedPathsChanged)
- bool getOnlyAllowedPaths() const;
-
- Q_ENUMS(SortBy)
- enum SortBy
- {
- SortByName,
- SortByDate
- };
- Q_PROPERTY(SortBy sortBy READ getSortBy WRITE setSortBy NOTIFY sortByChanged)
- SortBy getSortBy() const;
-
- Q_ENUMS(SortOrder)
- enum SortOrder
- {
- SortAscending = Qt::AscendingOrder,
- SortDescending = Qt::DescendingOrder
- };
- Q_PROPERTY(SortOrder sortOrder READ getSortOrder WRITE setSortOrder NOTIFY sortOrderChanged)
- SortOrder getSortOrder() const;
-
- Q_PROPERTY(int clipboardUrlsCounter READ getClipboardUrlsCounter NOTIFY clipboardChanged)
- int getClipboardUrlsCounter() const;
-
- Q_PROPERTY(bool enableExternalFSWatcher READ getEnabledExternalFSWatcher WRITE setEnabledExternalFSWatcher NOTIFY enabledExternalFSWatcherChanged)
- bool getEnabledExternalFSWatcher() const;
-
- Q_INVOKABLE QString homePath() const;
-
- Q_INVOKABLE QString lastFolderVisited() const;
-
-
- /*!
- * \brief Tries to make the directory pointed by row as the current to be browsed
- * \return true if row points to a directory and the directory is readble, false otherwise
- */
- Q_INVOKABLE bool cdIntoIndex(int row);
- Q_INVOKABLE bool cdIntoPath(const QString& filename);
-
- /*!
- * \brief copyIndex() puts the item pointed by \a row (dir or file) into the clipboard
- * \param row points to the item file or directory
- */
- Q_INVOKABLE void copyIndex(int row);
-
- /*!
- * \brief copyPaths(const QStringList& urls) several items (dirs or files) into the clipboard
- * \param items fullpathnames or names only
- */
- Q_INVOKABLE void copyPaths(const QStringList& items);
-
- /*!
- * \brief cutIndex() puts the item into the clipboard as \ref copy(),
- * mark the item to be removed after \ref paste()
- * \param row points to the item file or directory
- */
- Q_INVOKABLE void cutIndex(int row);
-
- /*!
- * \brief cut() puts several items (dirs or files) into the clipboard as \ref copy(),
- * mark the item to be removed after \ref paste()
- * \param items fullpathnames or names only
- */
- Q_INVOKABLE void cutPaths(const QStringList& items);
-
- /*!
- * \brief removeIndex(); remove a item file or directory
- *
- * I gets the item indicated by \row and calls \ref rm()
- *
- * \param row points to the item to b e removed
- * \return true if it was possible to remove the item
- */
- Q_INVOKABLE void removeIndex(int row);
-
- /*!
- * Just calls \ref rm()
- */
- Q_INVOKABLE void removePaths(const QStringList& items);
-
- /*!
- * Tries to open a file using a suitable application, if the index points to a directory
- * it goes into it using \ref cdIntoIndex() or \ref cdIntoPath()
- *
- * \note Qt uses Qt QDesktopServices::openUrl()
- */
- Q_INVOKABLE bool openIndex(int row);
-
- /*!
- * Same as \ref openIndex() but using a file name instead of index
- *
- * It allows to open directories and files using absoulte paths
- *
- * \sa \ref cdIntoPath()
- */
- Q_INVOKABLE bool openPath(const QString& filename);
-
- /*!
- * \brief getProgressCounter() returns the number of \ref progress() notifications an Action will perform
- *
- * It may be useful to decide about showing or not a progress dialog for Remove/Copy/Cut/Paste Actions
- *
- * This function can be called just after receiving first \ref progress() notification
- *
- * \note In the future this \ref getProgressCounter() and \ref progress() will merge to single signal that
- * will send the Action full information, it will allow to have multi thread Actions.
- * Also \ref cancelAction() needs to change
- */
- Q_INVOKABLE int getProgressCounter() const;
-
- // some helper functions that can be useful to other QML applications than File Manager
- Q_INVOKABLE bool existsDir(const QString& folderName) const;
- Q_INVOKABLE bool canReadDir(const QString& folderName) const;
- Q_INVOKABLE bool existsFile(const QString& fileName) const;
- Q_INVOKABLE bool canReadFile(const QString& fileName) const;
-
- // Trash functions
- Q_INVOKABLE void moveIndexToTrash(int index);
- void moveIndexesToTrash(const QList<int>&);
- Q_INVOKABLE void restoreIndexFromTrash(int index);
- void restoreIndexesFromTrash(const QList<int>&);
-
- Q_INVOKABLE void setPathWithAuthentication(const QString& path,
- const QString& user,
- const QString& password,
- bool savePassword);
-
- //download functions
- //
- /*! \brief download(int index) download file pointed by \a index into standard Download location
- *
- * \return true if the download could be started, othewise false
- */
- Q_INVOKABLE bool download(int index);
-
- /*! \brief downloadAndSaveAs(int index, const QString& filename) download file pointed by \a index and save it as \a filename
- *
- * \return true if the download could be started, othewise false
- *
- */
- Q_INVOKABLE bool downloadAndSaveAs(int index, const QString& filename);
-
- /*! \brief downloadAsTemporaryFile(int index) save download as temporary, useful to open remote files
- *
- * At the end if download is OK the signal downloadTemporaryComplete(const QString& fullpathname) is emitted
- *
- * \return true if the download could be started, othewise false
- *
- */
- Q_INVOKABLE bool downloadAsTemporaryFile(int index);
-
-
-public slots:
- /*!
- * \brief copySelection() copy selected items to the clipboard
- */
- void copySelection();
-
- /*!
- * \brief cutSelection() cut selected items to the clipboard
- */
- void cutSelection();
-
- /*!
- * \brief removeSelection() remove selected items, it handles Trash items
- */
- void removeSelection();
-
- /*!
- * \brief moveSelectionToTrash() move selected items from Local Disk (only) to Local Trash
- */
- void moveSelectionToTrash();
-
- /*!
- * \brief restoreSelectionFromTrash() restore selected trash items to their orginal location
- */
- void restoreSelectionFromTrash();
-
- /*!
- * \brief restoreTrash() restore all items being actually browsed in the Trash
- *
- */
- void restoreTrash();
-
- /*!
- * \brief emptyTrash() remove definitely all items being actually browsed in the Trash
- *
- * \sa \ref removeSelection() and \ref rm()
- *
- */
- void emptyTrash();
-
- /*!
- * \brief goHome() goes to user home dir
- * Go to user home dir, we may have a tab for places or something like that
- */
- void goHome();
-
- /*!
- * \brief goTrash() goes to logical folder trash:///
- */
- void goTrash();
-
- /*!
- * \brief goBack() goes to the previous folder if available
- *
- */
- void goBack();
-
- /*!
- * \brief cdUp() sets the parent directory as current directory
- *
- * It can work as a back function if there is no user input path
- * \return true if it was possible to change to parent dir, otherwise false
- */
- bool cdUp();
-
- /*!
- * \brief paste() copy item(s) from \ref copy() and \ref paste() into the current directory
- *
- * If the operation was \ref cut(), then remove the original item
- */
- void paste();
-
- /*!
- * \brief clears clipboard entries
- */
- void clearClipboard();
-
- /*!
- * \brief cancelAction() any copy/cut/remove can be cancelled
- */
- void cancelAction();
-
- void setIsRecursive(bool isRecursive);
- void setReadsMediaMetadata(bool readsMediaMetadata);
- void setFilterDirectories(bool filterDirectories);
- void setShowDirectories(bool showDirectories);
- void setShowHiddenFiles(bool show);
- /*!
- * \brief if set to true then only Allowed paths are shown or be modified
- */
- void setOnlyAllowedPaths(bool onlyAllowedPaths);
- void setSortBy(SortBy field);
- void setSortOrder(SortOrder order);
- void setEnabledExternalFSWatcher(bool enable);
-
-
- void toggleShowDirectories();
- void toggleShowHiddenFiles();
- void toggleSortOrder();
- void toggleSortBy();
-
- /*!
- * \brief Adds a directory to the set of directories that are accessible when "onlyAllowedPaths" property is set.
- */
- inline void addAllowedDirectory(const QString &allowedDirAbsolutePath) {
- m_allowedDirs << allowedDirAbsolutePath;
- }
-
- inline void removeAllowedDirectory(const QString &allowedDirAbsolutePath) {
- m_allowedDirs.remove(allowedDirAbsolutePath);
- }
- bool isAllowedPath(const QString &absolutePath) const;
-
-signals:
- /*!
- * \brief needsAuthentication()
- * This notifies the UI that the current URL being browsed needs to set
- * user/password to perform an authentication
- *
- * The UI must ask for "user" and "password" for the current URL and then call
- * \ref setAuthentication()
- *
- * \param user current user being used
- * \param urlPath the current URL asked to be browsed
- */
- void needsAuthentication(const QString& user, const QString& urlPath);
-
- /*!
- * \brief insertedRow()
- *
- * It happens when a new file is inserted in an existent view,
- * for example from \ref mkdir() or \ref paste()
- *
- * It can be used to make the new row visible to the user doing a scroll to
- */
- void insertedRow(int row);
-
- /*!
- * \brief progress()
- * Sends status about recursive and multi-items remove/move/copy
- *
- * \param curItem current item being handled
- * \param totalItems total of items including recursive directories content
- * \param percent a percent done
- */
- void progress(int curItem, int totalItems, int percent);
-
- void showHiddenFilesChanged();
- void onlyAllowedPathsChanged();
- void sortByChanged();
- void sortOrderChanged();
- void clipboardChanged();
- void enabledExternalFSWatcherChanged(bool);
-
- /*!
- * \brief downloadTemporaryComplete() says that download has been completed and
- * the \a filename is ready to be used, filename is a full pathname
- */
- void downloadTemporaryComplete(const QString& filename);
-
-private slots:
- void onItemRemoved(const DirItemInfo&);
- void onItemAdded(const DirItemInfo&);
- void onItemChanged(const DirItemInfo&);
-
-private:
- int addItem(const DirItemInfo& fi);
- void setCompareAndReorder();
- int rowOfItem(const DirItemInfo& fi);
- QDir::Filters currentDirFilter() const;
- QString dirItems(const DirItemInfo& fi) const;
- bool cdIntoItem(const DirItemInfo& fi);
- bool openItem(const DirItemInfo& fi);
- DirItemInfo setParentIfRelative(const QString &fileOrDir) const;
- void setPathFromCurrentLocation();
-
-private:
- void startExternalFsWatcher();
- void stoptExternalFsWatcher();
- void clear();
-
-private slots:
- void onItemAddedOutsideFm(const DirItemInfo&fi);
- void onItemRemovedOutSideFm(const DirItemInfo&);
- void onItemChangedOutSideFm(const DirItemInfo&fi);
- void onThereAreExternalChanges(const QString &);
- void onExternalFsWorkerFinished(int);
-
-
-private:
- bool mShowHiddenFiles;
- bool mOnlyAllowedPaths;
- SortBy mSortBy;
- SortOrder mSortOrder;
- CompareFunction mCompareFunction;
- bool mExtFSWatcher;
- Clipboard * mClipboard;
- DirSelection * mSelection;
- NetAuthenticationDataList *mAuthData;
- LocationsFactory * mLocationFactory;
- Location * mCurLocation;
- QStringList mPathList; //!< it will be used for goBack()
-
-private:
- FileSystemAction * m_fsAction; //!< it does file system recursive remove/copy/move
- QString fileSize(qint64 size) const;
-#ifndef DO_NOT_USE_TAG_LIB
- QVariant getAudioMetaData(const QFileInfo& fi, int role) const;
-#endif
- QSet<QString> m_allowedDirs;
-
-//[0]
-
-#if defined(REGRESSION_TEST_FOLDERLISTMODEL)
- ExternalFSWatcher * getExternalFSWatcher() const;
- virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
- virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
- friend class TestDirModel;
-#endif
-
- bool allowAccess(const DirItemInfo &fi) const;
- bool allowCurrentPathAccess() const;
-};
-
-
-#endif // DIRMODEL_H
=== removed file 'src/plugin/folderlistmodel/dirselection.cpp'
--- src/plugin/folderlistmodel/dirselection.cpp 2014-05-17 19:58:54 +0000
+++ src/plugin/folderlistmodel/dirselection.cpp 1970-01-01 00:00:00 +0000
@@ -1,305 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: dirselection.cpp
- * Date: 29/01/2014
- */
-
-#include "dirselection.h"
-#include "diritemabstractlistmodel.h"
-#include <QTimer>
-#include <QDebug>
-
-
-#define VALID_INDEX(index) (index >= 0 && index < m_model->rowCount())
-
-DirSelection::DirSelection(QObject *parent) : QObject(parent)
-{
-}
-
-DirSelection::DirSelection(DirItemAbstractListModel *parent, DirItemInfoList *listItems) :
- QObject(parent)
- ,m_selectedCounter(0)
- ,m_model(parent)
- ,m_listItems(listItems)
- ,m_mode(Single)
- ,m_lastSelectedItem(-1)
-{
-}
-
-
-
-QStringList DirSelection::selectedAbsFilePaths() const
-{
- QStringList ret;
- int counter = m_model->rowCount();
- for(int index = 0 ; index < counter; ++index)
- {
- if (m_listItems->at(index).isSelected())
- {
- ret.append(m_listItems->at(index).absoluteFilePath());
- }
- }
- return ret;
-}
-
-QStringList DirSelection::selectedNames() const
-{
- QStringList ret;
- int counter = m_model->rowCount();
- for(int index = 0 ; index < counter; ++index)
- {
- if (m_listItems->at(index).isSelected())
- {
- ret.append(m_listItems->at(index).fileName());
- }
- }
- return ret;
-}
-
-
-
-QList<int> DirSelection::selectedIndexes() const
-{
- QList<int> ret;
- int counter = m_model->rowCount();
- for(int index = 0 ; index < counter; ++index)
- {
- if (m_listItems->at(index).isSelected())
- {
- ret.append(index);
- }
- }
- return ret;
-}
-
-
-void DirSelection::clear()
-{
- if (priv_clear())
- {
- notifyChanges();
- }
-}
-
-
-bool DirSelection::priv_clear()
-{
- bool notify = m_selectedCounter != 0;
- if (notify)
- {
- int counter = m_model->rowCount();
- DirItemInfo *data = m_listItems->data();
- while (m_selectedCounter > 0 && counter-- )
- {
- if ( data[counter].setSelection(false) )
- {
- --m_selectedCounter;
- m_model->notifyItemChanged(counter);
- }
- }
- }
- //force it to zero, works when cleaning the buffer first
- m_selectedCounter = 0;
- m_lastSelectedItem = -1;
- return notify;
-}
-
-
-void DirSelection::selectAll()
-{
- int counter = m_model->rowCount();
- bool notify = m_selectedCounter != counter;
- if (notify)
- {
- DirItemInfo *data = m_listItems->data();
- while ( counter-- )
- {
- if ( data[counter].setSelection(true) )
- {
- ++m_selectedCounter;
- m_model->notifyItemChanged(counter);
- }
- }
- notifyChanges();
- }
-}
-
-
-int DirSelection::counter() const
-{
- return m_selectedCounter;
-}
-
-
-DirSelection::Mode DirSelection::mode() const
-{
- return m_mode;
-}
-
-
-void DirSelection::itemGoingToBeRemoved(const DirItemInfo &item)
-{
- if (m_selectedCounter > 0 && item.isSelected())
- {
- --m_selectedCounter;
- notifyChanges();
- }
- // item is going to be removed, no QAbstractItemModel::dataChanged() signal is necessary to refresh views
-}
-
-
-void DirSelection::setIndex(int index, bool selected)
-{
- if (VALID_INDEX(index))
- {
- int old_selectedCounter = m_selectedCounter;
- if (selected && m_mode == Single && m_selectedCounter > 0)
- {
- priv_clear();
- }
- if ( priv_setIndex(index, selected)
- || old_selectedCounter != m_selectedCounter
- )
- {
- notifyChanges();
- }
- }
-}
-
-
-void DirSelection::toggleIndex(int index)
-{
- if (VALID_INDEX(index))
- {
- setIndex(index, !m_listItems->at(index).isSelected());
- }
-}
-
-
-void DirSelection::setMode(Mode m)
-{
- if (m != m_mode)
- {
- m_mode = m;
- emit modeChanged(m_mode);
- }
-}
-
-
-void DirSelection::notifyChanges()
-{
- emit selectionChanged(m_selectedCounter);
-}
-
-
-/*!
- * \brief DirSelection::itemGoingToBeReplaced() it is supposed to control selection writable and readabble states
- *
- * So far it does nothing
- *
- * \param oldItemInfo
- * \param newItemInfo
- */
-void DirSelection::itemGoingToBeReplaced(const DirItemInfo &oldItemInfo,
- const DirItemInfo &newItemInfo)
-{
- if (oldItemInfo.isSelected())
- {
- // we may add selection writable state in the future
- Q_UNUSED(newItemInfo);
- }
-}
-
-
-void DirSelection::selectRange(int indexClicked)
-{
- bool changed = false;
- if ( VALID_INDEX(indexClicked)
- && m_selectedCounter > 0
- && indexClicked != m_lastSelectedItem
- && VALID_INDEX(m_lastSelectedItem)
- && !m_listItems->at(indexClicked).isSelected()
- )
- {
- //go from indexClicked to m_lastSelectedItem
- int increment = indexClicked > m_lastSelectedItem? -1 : 1;
- int nextItem = indexClicked;
- int saved_lastSelectedItem = m_lastSelectedItem;
- while (priv_setIndex(nextItem, true) && nextItem != saved_lastSelectedItem)
- {
- nextItem += increment;
- changed = true;
- }
- }
- if (changed)
- {
- notifyChanges();
- }
-}
-
-
-bool DirSelection::priv_setIndex(int index, bool selected)
-{
- DirItemInfo *data = m_listItems->data();
- bool changed = false;
- if ((changed = data[index].setSelection(selected)))
- {
- m_model->notifyItemChanged(index);
- if (selected)
- {
- ++m_selectedCounter;
- m_lastSelectedItem = index;
- }
- else
- {
- --m_selectedCounter;
- }
- }
- return changed;
-}
-
-
-void DirSelection::select(int index, bool range, bool multiSelection )
-{
- if (range && VALID_INDEX(m_lastSelectedItem))
- {
- selectRange(index);
- }
- else
- {
- if (multiSelection || m_mode == Multi)
- {
- Mode saveMode = m_mode;
- //set Multi selection do not call clear()
- m_mode = Multi;
- toggleIndex(index);
- m_mode = saveMode;
- }
- else
- {
- setIndex(index, true);
- }
- }
-}
-
-
-void DirSelection::setMultiSelection(bool enable)
-{
- Mode m = enable ? Multi : Single;
- setMode(m);
-}
=== removed file 'src/plugin/folderlistmodel/dirselection.h'
--- src/plugin/folderlistmodel/dirselection.h 2014-05-17 19:58:54 +0000
+++ src/plugin/folderlistmodel/dirselection.h 1970-01-01 00:00:00 +0000
@@ -1,118 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: dirselection.h
- * Date: 29/01/2014
- */
-
-#ifndef DIRSELECTION_H
-#define DIRSELECTION_H
-
-#include "diriteminfo.h"
-
-#include <QObject>
-#include <QStringList>
-
-
-class DirItemAbstractListModel;
-
-class DirSelection : public QObject
-{
- Q_OBJECT
-public:
- explicit DirSelection(DirItemAbstractListModel *parent, DirItemInfoList *listItems);
- explicit DirSelection(QObject *parent = 0);
-
-public slots:
- void selectRange(int indexClicked);
- void selectAll();
- void clear();
- void toggleIndex(int index);
- void setIndex(int index, bool selected);
- void setMultiSelection(bool enable);
-
-public:
- Q_ENUMS(Mode)
- enum Mode
- {
- Single,
- Multi
- };
- Q_PROPERTY(int counter READ counter NOTIFY selectionChanged)
- Q_PROPERTY(Mode mode READ mode WRITE setMode NOTIFY modeChanged)
- Q_INVOKABLE QStringList selectedNames() const;
- Q_INVOKABLE void setMode(Mode m);
- Q_INVOKABLE QStringList selectedAbsFilePaths() const; //full path
- Q_INVOKABLE QList<int> selectedIndexes() const;
- int counter() const;
- Mode mode() const;
-
-public:
- /*!
- * It allows to pass Control Modifiers directly to perform the most common selection behaviour.
- *
- * Usage Example:
- * \li 1 When selecting an item with Shit key pressed it selects the rage calling \ref selectRange()
- * \li 2 When selecting an item with Crtl key pressed it temporarily forces Multi Selection Mode
- * calling \ref toggleIndex() instead of \ref setIndex();
- *
- * \param range when true it calls \ref selectRange() and does not consider the \a multiSelection parameter
- *
- * \param multiSelection when \a false it respects the current selection mode: calls \ref setIndex()
- * for \ref Single selection mode or \ref toggleIndex() for \ref Multi selection mode.
- * When \a true it calls \ref toggleIndex()
- *
- * QML example:
- * \code
- * property FolderListSelection selectionManager: pageModel.selectionObject()
- * ...
- *
- * MouseArea {
- * anchors.fill: parent
- * onClicked: {
- * selectionManager.select(model.index,
- * (mouse.modifiers & Qt.ShiftModifier),
- * (mouse.modifiers & Qt.ControlModifier) );
- * }
- * }
- * \endcode
- *
- */
- Q_INVOKABLE void select(int index, bool range, bool multiSelection );
-
-public:
- void itemGoingToBeRemoved(const DirItemInfo& item);
- void itemGoingToBeReplaced(const DirItemInfo& oldItemInfo, const DirItemInfo& newItemInfo);
-
-private:
- bool priv_clear();
- void notifyChanges();
- bool priv_setIndex(int index, bool selected);
-
-signals:
- void selectionChanged(int);
- void modeChanged(int);
-
-private:
- int m_selectedCounter;
- DirItemAbstractListModel* m_model;
- DirItemInfoList * m_listItems;
- Mode m_mode;
- int m_lastSelectedItem;
-};
-
-#endif // DIRSELECTION_H
=== removed directory 'src/plugin/folderlistmodel/disk'
=== removed file 'src/plugin/folderlistmodel/disk/disklocation.cpp'
--- src/plugin/folderlistmodel/disk/disklocation.cpp 2015-12-12 13:59:49 +0000
+++ src/plugin/folderlistmodel/disk/disklocation.cpp 1970-01-01 00:00:00 +0000
@@ -1,234 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: disklocation.cpp
- * Date: 08/03/2014
- */
-
-#include "disklocation.h"
-#include "disklocationitemdiriterator.h"
-#include "iorequest.h"
-#include "ioworkerthread.h"
-#include "externalfswatcher.h"
-#include "locationurl.h"
-#include "disklocationitemfile.h"
-#include "disklocationitemdir.h"
-
-
-#if defined(Q_OS_UNIX)
-#include <sys/statvfs.h>
-#endif
-
-#include <QDebug>
-
-#if defined(DEBUG_EXT_FS_WATCHER)
-# define DEBUG_WATCHER() qDebug() << "[extFsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz") \
- << Q_FUNC_INFO << this
-#else
-# define DEBUG_WATCHER() /**/
-#endif
-
-DiskLocation::DiskLocation(int type, QObject *parent)
- : Location(type, parent)
- , m_extWatcher(0)
-{
-}
-
-
-DiskLocation::~ DiskLocation()
-{
- stopExternalFsWatcher();
-}
-
-
-/*!
- * \brief DiskLocation::stopExternalFsWatcher() stops the External File System Watcher
- */
-void DiskLocation::stopExternalFsWatcher()
-{
- if (m_extWatcher)
- {
- DEBUG_WATCHER();
- delete m_extWatcher;
- m_extWatcher = 0;
- }
-}
-
-
-/*!
- * \brief DiskLocation::startExternalFsWatcher() starts the External File System Watcher
- */
-void DiskLocation::startExternalFsWatcher()
-{
- if (m_extWatcher == 0)
- {
- DEBUG_WATCHER();
- m_extWatcher = new ExternalFSWatcher(this);
- m_extWatcher->setIntervalToNotifyChanges(EX_FS_WATCHER_TIMER_INTERVAL);
-
- connect(m_extWatcher, SIGNAL(pathModified(QString)),
- this, SIGNAL(extWatcherPathChanged(QString)));
- }
- if (m_extWatcher && m_info)
- {
- //setCurrentPath() checks for empty paths
- m_extWatcher->setCurrentPath(m_info->absoluteFilePath());
- }
-}
-
-
-void DiskLocation::onItemsFetched()
-{
- if (m_extWatcher)
- {
- m_extWatcher->setCurrentPath(m_info->absoluteFilePath());
- }
- emit itemsFetched();
-}
-
-
-void DiskLocation::startWorking()
-{
- if (m_usingExternalWatcher)
- {
- startExternalFsWatcher();
- }
-}
-
-
-void DiskLocation::stopWorking()
-{
- stopExternalFsWatcher();
-}
-
-
-void DiskLocation::fetchExternalChanges(const QString &path,
- const DirItemInfoList &list,
- QDir::Filters dirFilter)
-{
- ExternalFileSystemChangesWorker *extFsWorker =
- new ExternalFileSystemChangesWorker(list,
- path,
- dirFilter, false);
- addExternalFsWorkerRequest(extFsWorker);
-
-
-}
-
-void DiskLocation::addExternalFsWorkerRequest(ExternalFileSystemChangesWorker *extFsWorker)
-{
- connect(extFsWorker, SIGNAL(added(DirItemInfo)),
- this, SIGNAL(extWatcherItemAdded(DirItemInfo)));
-
- connect(extFsWorker, SIGNAL(removed(DirItemInfo)),
- this, SIGNAL(extWatcherItemRemoved(DirItemInfo)));
-
- connect(extFsWorker, SIGNAL(changed(DirItemInfo)),
- this, SIGNAL(extWatcherItemChanged(DirItemInfo)));
-
- connect(extFsWorker, SIGNAL(finished(int)),
- this, SIGNAL(extWatcherChangesFetched(int)));
-
- workerThread()->addRequest(extFsWorker);
-}
-
-
-ExternalFSWatcher * DiskLocation::getExternalFSWatcher() const
-{
- return m_extWatcher;
-}
-
-
-void DiskLocation::setUsingExternalWatcher(bool use)
-{
- if ((m_usingExternalWatcher = use))
- {
- startExternalFsWatcher();
- }
- else
- {
- stopExternalFsWatcher();
- }
-}
-
-
-DirItemInfo * DiskLocation::newItemInfo(const QString &urlPath)
-{
- return new DirItemInfo(urlPath);
-}
-
-
-DirListWorker * DiskLocation::newListWorker(const QString &urlPath, QDir::Filters filter, const bool isRecursive)
-{
- return new DirListWorker(urlPath,filter,isRecursive);
-}
-
-
-QString DiskLocation::urlBelongsToLocation(const QString &urlPath, int indexOfColonAndSlash)
-{
- QString ret;
- if (urlPath.startsWith(LocationUrl::DiskRootURL.midRef(0,5)))
- {
- ret = QDir::rootPath() + DirItemInfo::removeExtraSlashes(urlPath, indexOfColonAndSlash+1);
- }
- return ret;
-}
-
-
-LocationItemDirIterator *
-DiskLocation::newDirIterator(const QString &path,
- QDir::Filters filters,
- QDirIterator::IteratorFlags flags,
- LocationItemDirIterator::LoadMode loadmode)
-{
- Q_UNUSED(loadmode);
- return new DiskLocationItemDirIterator(path, filters, flags);
-}
-
-
-LocationItemFile *
-DiskLocation::newFile(const QString &path)
-{
- return new DiskLocationItemFile(path, this);
-}
-
-
-LocationItemDir *
-DiskLocation::newDir(const QString &dir)
-{
- return new DiskLocationItemDir(dir);
-}
-
-
-bool DiskLocation::isThereDiskSpace(const QString &pathname, qint64 requiredSize)
-{
- bool ret = true;
-#if defined(Q_OS_UNIX)
- QFileInfo info(pathname);
- while (!info.exists() && info.absoluteFilePath() != QDir::rootPath())
- {
- info.setFile(info.absolutePath());
- }
- struct statvfs vfs;
- if ( ::statvfs( QFile::encodeName(info.absoluteFilePath()).constData(), &vfs) == 0 )
- {
- qint64 free = vfs.f_bsize * vfs.f_bfree;
- ret = free > requiredSize;
- }
-#endif
- return ret;
-}
=== removed file 'src/plugin/folderlistmodel/disk/disklocation.h'
--- src/plugin/folderlistmodel/disk/disklocation.h 2015-12-12 13:59:49 +0000
+++ src/plugin/folderlistmodel/disk/disklocation.h 1970-01-01 00:00:00 +0000
@@ -1,89 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: disklocation.h
- * Date: 08/03/2014
- */
-
-#ifndef DISKLOCATION_H
-#define DISKLOCATION_H
-
-#include "location.h"
-#include <QList>
-
-/*!
- * When the External File System Wathcer is enabled,
- * this is the interval used to check if there has been any change in the current path
- *
- * \sa setEnabledExternalFSWatcher()
- */
-#define EX_FS_WATCHER_TIMER_INTERVAL 900
-
-
-class ExternalFSWatcher;
-class ExternalFileSystemChangesWorker;
-
-/*!
- * \brief The DiskLocation class extends \ref Location for Local Disk and provides a External File System watcher
- */
-class DiskLocation : public Location
-{
- Q_OBJECT
-public:
- explicit DiskLocation(int type, QObject *parent=0);
- virtual ~DiskLocation();
-
- ExternalFSWatcher * getExternalFSWatcher() const;
-
- virtual void fetchExternalChanges(const QString& urlPath,
- const DirItemInfoList& list,
- QDir::Filters dirFilter) ;
-
- virtual void startExternalFsWatcher();
- virtual void stopExternalFsWatcher();
-
- virtual void startWorking();
- virtual void stopWorking();
-
- virtual DirItemInfo * newItemInfo(const QString& urlPath);
- virtual DirListWorker * newListWorker(const QString &urlPath,
- QDir::Filters filter,
- const bool isRecursive);
- virtual LocationItemDirIterator * newDirIterator(const QString & path,
- QDir::Filters filters,
- QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags,
- LocationItemDirIterator::LoadMode loadmode = LocationItemDirIterator::LoadOnConstructor);
- virtual LocationItemFile * newFile(const QString & path);
- virtual LocationItemDir * newDir(const QString & dir = QLatin1String(0));
- virtual bool isThereDiskSpace(const QString& pathname, qint64 requiredSize);
- virtual QString urlBelongsToLocation(const QString& urlPath, int indexOfColonAndSlash);
-
-protected:
- void addExternalFsWorkerRequest(ExternalFileSystemChangesWorker *);
-
-public slots:
- virtual void setUsingExternalWatcher(bool use);
-
-protected slots:
- void onItemsFetched();
-
-protected:
- ExternalFSWatcher * m_extWatcher ;
-
-};
-
-#endif // DISKLOCATION_H
=== removed file 'src/plugin/folderlistmodel/disk/disklocationitemdir.cpp'
--- src/plugin/folderlistmodel/disk/disklocationitemdir.cpp 2015-08-16 14:00:04 +0000
+++ src/plugin/folderlistmodel/disk/disklocationitemdir.cpp 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: disklocationitemdir.cpp
- * Date: 16/05/2015
- */
-
-#include "disklocationitemdir.h"
-#include <QDir>
-
-DiskLocationItemDir::DiskLocationItemDir(const QString &dir) : LocationItemDir(dir), m_qtQDir(new QDir())
-{
- if(!dir.isNull() && !dir.isEmpty())
- {
- m_qtQDir->setPath(dir);
- }
-}
-
-
-DiskLocationItemDir::~DiskLocationItemDir()
-{
- delete m_qtQDir;
-}
-
-bool DiskLocationItemDir::exists() const
-{
- return m_qtQDir->exists();
-}
-
-
-bool DiskLocationItemDir::mkdir(const QString& dir) const
-{
- return m_qtQDir->mkdir(dir);
-}
-
-
-bool DiskLocationItemDir::mkpath(const QString& dir) const
-{
- return m_qtQDir->mkpath(dir);
-}
-
-
-bool DiskLocationItemDir::rmdir(const QString& dir) const
-{
- return m_qtQDir->rmdir(dir);
-}
-
=== removed file 'src/plugin/folderlistmodel/disk/disklocationitemdir.h'
--- src/plugin/folderlistmodel/disk/disklocationitemdir.h 2015-07-15 17:42:37 +0000
+++ src/plugin/folderlistmodel/disk/disklocationitemdir.h 1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: disklocationitemdir.h
- * Date: 16/05/2015
- */
-
-#ifndef DISKLOCATIONITEMDIR_H
-#define DISKLOCATIONITEMDIR_H
-
-#include "locationitemdir.h"
-
-class QDir;
-
-
-class DiskLocationItemDir : public LocationItemDir
-{
-public:
- DiskLocationItemDir(const QString& dir = QLatin1String(0) );
- ~DiskLocationItemDir();
-public:
- virtual bool exists() const;
- virtual bool mkdir(const QString& dir) const;
- virtual bool mkpath(const QString& dir) const;
- virtual bool rmdir(const QString& dir) const;
-private:
- QDir * m_qtQDir;
-
-};
-
-#endif // DISKLOCATIONITEMDIR_H
=== removed file 'src/plugin/folderlistmodel/disk/disklocationitemdiriterator.cpp'
--- src/plugin/folderlistmodel/disk/disklocationitemdiriterator.cpp 2015-07-13 20:41:48 +0000
+++ src/plugin/folderlistmodel/disk/disklocationitemdiriterator.cpp 1970-01-01 00:00:00 +0000
@@ -1,94 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: disklocationitemdiriterator.cpp
- * Date: 29/03/2015
- */
-
-#include "disklocationitemdiriterator.h"
-
-#include <QDirIterator>
-
-DiskLocationItemDirIterator::DiskLocationItemDirIterator(const QString &path,
- const QStringList &nameFilters,
- QDir::Filters filters,
- QDirIterator::IteratorFlags flags)
- : LocationItemDirIterator(path,nameFilters,filters,flags)
- , m_qtDirIterator(new QDirIterator(path, nameFilters, filters, flags))
-{
-
-}
-
-DiskLocationItemDirIterator::DiskLocationItemDirIterator(const QString &path,
- QDir::Filters filters,
- QDirIterator::IteratorFlags flags)
-
- : LocationItemDirIterator(path,filters,flags)
- , m_qtDirIterator(new QDirIterator(path,filters, flags))
-{
-
-}
-
-DiskLocationItemDirIterator::DiskLocationItemDirIterator(const QString &path,
- QDirIterator::IteratorFlags flags)
- : LocationItemDirIterator(path,flags)
- , m_qtDirIterator(new QDirIterator(path, flags))
-{
-
-}
-
-DiskLocationItemDirIterator::~DiskLocationItemDirIterator()
-{
- delete m_qtDirIterator;
-}
-
-
-DirItemInfo DiskLocationItemDirIterator::fileInfo() const
-{
- DirItemInfo itemInfo (m_qtDirIterator->fileInfo());
- return itemInfo;
-}
-
-
-QString DiskLocationItemDirIterator::fileName() const
-{
- return m_qtDirIterator->fileName();
-}
-
-
-QString DiskLocationItemDirIterator::filePath() const
-{
- return m_qtDirIterator->filePath();
-}
-
-
-bool DiskLocationItemDirIterator::hasNext() const
-{
- return m_qtDirIterator->hasNext();
-}
-
-
-QString DiskLocationItemDirIterator::next()
-{
- return m_qtDirIterator->next();
-}
-
-
-QString DiskLocationItemDirIterator::path() const
-{
- return m_qtDirIterator->path();
-}
=== removed file 'src/plugin/folderlistmodel/disk/disklocationitemdiriterator.h'
--- src/plugin/folderlistmodel/disk/disklocationitemdiriterator.h 2015-07-13 20:41:48 +0000
+++ src/plugin/folderlistmodel/disk/disklocationitemdiriterator.h 1970-01-01 00:00:00 +0000
@@ -1,50 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: disklocationitemdiriterator.h
- * Date: 29/03/2015
- */
-
-#ifndef DISKLOCATIONITEMDIRITERATOR_H
-#define DISKLOCATIONITEMDIRITERATOR_H
-
-#include "locationitemdiriterator.h"
-
-class QDirIterator;
-
-class DiskLocationItemDirIterator : public LocationItemDirIterator
-{
-public:
- explicit DiskLocationItemDirIterator(QObject *parent = 0);
- ~DiskLocationItemDirIterator();
-public:
- virtual DirItemInfo fileInfo() const;
- virtual QString fileName() const;
- virtual QString filePath() const;
- virtual bool hasNext() const;
- virtual QString next() ;
- virtual QString path() const;
-public:
- DiskLocationItemDirIterator(const QString & path, QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags);
- DiskLocationItemDirIterator(const QString & path, QDir::Filters filters, QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags);
- DiskLocationItemDirIterator(const QString & path, const QStringList & nameFilters, QDir::Filters filters = QDir::NoFilter, QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags);
-private:
- QDirIterator * m_qtDirIterator;
-
-};
-
-#endif // DISKLOCATIONITEMDIRITERATOR_H
=== removed file 'src/plugin/folderlistmodel/disk/disklocationitemfile.cpp'
--- src/plugin/folderlistmodel/disk/disklocationitemfile.cpp 2015-07-15 16:04:58 +0000
+++ src/plugin/folderlistmodel/disk/disklocationitemfile.cpp 1970-01-01 00:00:00 +0000
@@ -1,138 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: disklocationitemfile.cpp
- * Date: 20/04/2015
- */
-
-#include "disklocationitemfile.h"
-
-DiskLocationItemFile::DiskLocationItemFile(QObject *parent)
- : LocationItemFile(parent)
- , m_qtFile( new QFile() )
-{
-
-}
-
-DiskLocationItemFile::DiskLocationItemFile(const QString &name, QObject *parent)
- : LocationItemFile(parent)
- , m_qtFile( new QFile(name) )
-{
-
-}
-
-
-DiskLocationItemFile::~DiskLocationItemFile()
-{
- delete m_qtFile;
-}
-
-
-QString DiskLocationItemFile::fileName() const
-{
- return m_qtFile->fileName();
-}
-
-
-bool DiskLocationItemFile::rename(const QString& newName)
-{
- return m_qtFile->rename(newName);
-}
-
-
-bool DiskLocationItemFile::rename(const QString& oldname, const QString &newName)
-{
- return QFile::rename(oldname, newName);
-}
-
-
-bool DiskLocationItemFile::remove()
-{
- return m_qtFile->remove();
-}
-
-
-bool DiskLocationItemFile::remove(const QString& name)
-{
- return QFile::remove(name);
-}
-
-
-bool DiskLocationItemFile::link(const QString& linkName)
-{
- return m_qtFile->link(linkName);
-}
-
-
-bool DiskLocationItemFile::open(QIODevice::OpenMode mode)
-{
- return m_qtFile->open(mode);
-}
-
-
-qint64 DiskLocationItemFile::read(char * buffer, qint64 bytes)
-{
- return m_qtFile->read(buffer, bytes);
-}
-
-
-qint64 DiskLocationItemFile::write(const char *buffer, qint64 bytes)
-{
- return m_qtFile->write(buffer, bytes);
-}
-
-
-void DiskLocationItemFile::close()
-{
- m_qtFile->close();
-}
-
-
-bool DiskLocationItemFile::atEnd() const
-{
- return m_qtFile->atEnd();
-}
-
-
-qint64 DiskLocationItemFile::size() const
-{
- return m_qtFile->size();
-}
-
-
-bool DiskLocationItemFile::isOpen() const
-{
- return m_qtFile->isOpen();
-}
-
-
-bool DiskLocationItemFile::setPermissions(QFileDevice::Permissions perm)
-{
- return m_qtFile->setPermissions(perm);
-}
-
-
-bool DiskLocationItemFile::setPermissions(const QString &filename, QFileDevice::Permissions perm)
-{
- return QFile::setPermissions(filename, perm);
-}
-
-
-QFile::Permissions DiskLocationItemFile::permissions() const
-{
- return m_qtFile->permissions();
-}
=== removed file 'src/plugin/folderlistmodel/disk/disklocationitemfile.h'
--- src/plugin/folderlistmodel/disk/disklocationitemfile.h 2015-07-15 16:04:58 +0000
+++ src/plugin/folderlistmodel/disk/disklocationitemfile.h 1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: disklocationitemfile.h
- * Date: 20/04/2015
- */
-
-#ifndef DISKLOCATIONITEMFILE_H
-#define DISKLOCATIONITEMFILE_H
-
-#include "locationitemfile.h"
-
-class DiskLocationItemFile : public LocationItemFile
-{
- Q_OBJECT
-public:
- explicit DiskLocationItemFile(QObject *parent);
- explicit DiskLocationItemFile(const QString& name, QObject *parent);
- ~DiskLocationItemFile();
-public:
- virtual QString fileName() const;
- virtual bool rename(const QString& newName);
- virtual bool rename(const QString& oldname, const QString& newName);
- virtual bool remove();
- virtual bool remove(const QString& name);
- virtual bool link(const QString& linkName);
- virtual bool open(QFile::OpenMode mode) ;
- virtual qint64 read(char*, qint64);
- virtual qint64 write(const char*, qint64);
- virtual void close();
- virtual bool atEnd() const;
- virtual qint64 size() const;
- virtual bool isOpen() const;
- virtual bool setPermissions(const QString& filename, QFile::Permissions perm);
- virtual bool setPermissions(QFile::Permissions perm);
- virtual QFile::Permissions permissions() const;
-private:
- QFile * m_qtFile;
-};
-
-#endif // DISKLOCATIONITEMFILE_H
=== removed file 'src/plugin/folderlistmodel/externalfswatcher.cpp'
--- src/plugin/folderlistmodel/externalfswatcher.cpp 2014-05-17 14:35:33 +0000
+++ src/plugin/folderlistmodel/externalfswatcher.cpp 1970-01-01 00:00:00 +0000
@@ -1,159 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2013 Canonical Ltd.
- * Copyright 2013 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: externalfswatcher.cpp
- * Date: 9/14/2013
- */
-
-#include "externalfswatcher.h"
-
-#include <QTimer>
-#include <QDateTime>
-#include <QDebug>
-
-#if DEBUG_EXT_FS_WATCHER
-# define DEBUG_FSWATCHER() \
- qDebug() << "[extFsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz") \
- << Q_FUNC_INFO << "m_setPath:" << m_setPaths \
- << "m_changedPath:" << m_changedPath \
- << "m_waitingEmit:" << m_waitingEmitCounter
-# define DEBUG_FSWATCHER_MSG(msg) DEBUG_FSWATCHER() << msg
-#else
-# define DEBUG_FSWATCHER() /**/
-# define DEBUG_FSWATCHER_MSG(msg) /* msg */
-#endif //
-
-
-ExternalFSWatcher::ExternalFSWatcher(QObject *parent) :
- QFileSystemWatcher(parent)
- , m_waitingEmitCounter(0)
- , m_msWaitTime(DEFAULT_NOTICATION_PERIOD)
- , m_lastChangedIndex(-1)
-{
- connect(this, SIGNAL(directoryChanged(QString)),
- this, SLOT(slotDirChanged(QString)));
-}
-
-
-void ExternalFSWatcher::setCurrentPath(const QString &curPath)
-{
- if (!curPath.isEmpty() && (m_setPaths.count() != 1 || m_setPaths.at(0) != curPath))
- {
- setCurrentPaths(QStringList(curPath));
- }
-}
-
-
-void ExternalFSWatcher::setCurrentPaths(const QStringList &paths)
-{
- if (paths.count() > 0)
- {
- QStringList myPaths(paths);
- ::qSort(myPaths);
- m_setPaths = myPaths;
- }
- else
- {
- m_setPaths = paths;
- }
- clearPaths();
- //cleaning m_changedPath avoids any notification for a change
- // already scheduled to happen in slotFireChanges()
- m_changedPath.clear();
- QFileSystemWatcher::addPaths(m_setPaths);
- DEBUG_FSWATCHER();
-}
-
-
-void ExternalFSWatcher::clearPaths()
-{
- QStringList existentPaths = QFileSystemWatcher::directories();
- if (existentPaths.count() > 0)
- {
- QFileSystemWatcher::removePaths(existentPaths);
- }
-}
-
-
-/*!
- * \brief ExternalFSWatcher::slotDirChanged() schedules a Disk change to be notified
- *
- * Once path that belongs to \a m_setPaths is modified in the Disk it becomes the \a m_changedPath and
- * its change is scheculed to notified later. This path is taken out from QFileSystemWatcher to avoid
- * lots of continuous notifications from QFileSystemWatcher when having hevy disk io.
- *
- * \param dir directory changed in the File System
- */
-void ExternalFSWatcher::slotDirChanged(const QString &dir)
-{
- DEBUG_FSWATCHER();
- int index = m_setPaths.indexOf(dir);
- if (index != -1 && (m_waitingEmitCounter == 0 || dir != m_changedPath))
- {
- m_lastChangedIndex = index;
- //changed path is taken from the QFileSystemWatcher and it becomes the current changed
- //in this case there will not be slotDirChanged() for this path until slotFireChanges()
- //restores the path in the QFileSystemWatcher
- removePath(m_setPaths.at(m_lastChangedIndex));
- ++m_waitingEmitCounter;
- m_changedPath = dir;
- QTimer::singleShot(m_msWaitTime, this, SLOT(slotFireChanges()));
- }
-}
-
-
-/*!
- * \brief ExternalFSWatcher::slotFireChanges() emits \ref pathModified() only when it is sure
- * that the LAST current path was changed.
- *
- * The notification will be sent out only for the LAST modified path (if more than one) from the \a m_setPaths
- *
- * \sa \ref ExternalFSWatcher class
- */
-void ExternalFSWatcher::slotFireChanges()
-{
- DEBUG_FSWATCHER();
- if ( --m_waitingEmitCounter == 0 ) //no more changes queued (it is the LAST), time to notify
- {
- //the notification will not fired if either setCurrentPath() or setCurrentPaths()
- //was called after the change in the disk be noticed
- if (m_lastChangedIndex != -1 &&
- m_lastChangedIndex < m_setPaths.count() &&
- m_setPaths.at(m_lastChangedIndex) == m_changedPath)
- {
- emit pathModified(m_changedPath);
- DEBUG_FSWATCHER_MSG("emit pathModified()");
- }
- //restore the original m_setPaths list in QFileSystemWatcher anyway
- //it does not matter if the notification was fired or not.
- clearPaths();
- QFileSystemWatcher::addPaths(m_setPaths);
- }
-}
-
-
-
-void ExternalFSWatcher::setIntervalToNotifyChanges(int ms)
-{
- m_msWaitTime = ms;
-}
-
-
-int ExternalFSWatcher::getIntervalToNotifyChanges() const
-{
- return m_msWaitTime;
-}
=== removed file 'src/plugin/folderlistmodel/externalfswatcher.h'
--- src/plugin/folderlistmodel/externalfswatcher.h 2014-05-13 23:28:43 +0000
+++ src/plugin/folderlistmodel/externalfswatcher.h 1970-01-01 00:00:00 +0000
@@ -1,83 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2013 Canonical Ltd.
- * Copyright 2013 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: externalfswatcher.h
- * Date: 9/14/2013
- */
-
-#ifndef EXTERNALFSWATCHER_H
-#define EXTERNALFSWATCHER_H
-
-#include <QFileSystemWatcher>
-#include <QStringList>
-
-#define DEFAULT_NOTICATION_PERIOD 500
-
-
-/*!
- * \brief The ExternalFSWatcher class watches for external changes in Disk emitting pathModified() signal.
- *
- * The path(s) being watched is/are set by using the slot \ref setCurrentPath() or \ref setCurrentPaths()
- *
- * The idea of this class is to minimize notifications as the current path in the File Manager can change quickly.
- * A notification will occur if it was requested for a path and this path is still the current at the moment
- * of the notification.
- *
- * Once it detects a Disk change it will wait \ref getIntervalToNotifyChanges() milliseconds to notify that change.
- * During the time it waits:
- * \li the notified path will NOT be watched until pathModified() is emitted
- * \li another call to \ref setCurrentPath() or \ref setCurrentPaths() invalidades the current change,
- * that mean the signal pathModified() will NOT be emitted.
- *
- * \note When more than one path is being watched by using \ref setCurrentPaths() and changes happen in
- * more than one path before the getIntervalToNotifyChanges() expires, only the LAST path modified
- * will be notified as changed. It may possible that it goes to a loop if all the paths were modified,
- * but the loop finishes when the last one from the list is modified.
- */
-class ExternalFSWatcher : public QFileSystemWatcher
-{
- Q_OBJECT
-public:
- explicit ExternalFSWatcher(QObject *parent = 0);
- int getIntervalToNotifyChanges() const;
-
- inline const QStringList& pathsWatched() const { return m_setPaths;}
-
-signals:
- void pathModified(const QString& path);
-
-public slots:
- void setCurrentPath(const QString& curPath);
- void setCurrentPaths(const QStringList& paths);
- void setIntervalToNotifyChanges(int ms);
-
-private slots:
- void slotDirChanged(const QString&);
- void slotFireChanges();
-
-private:
- void clearPaths();
-
-private:
- QStringList m_setPaths;
- QString m_changedPath;
- unsigned m_waitingEmitCounter;
- int m_msWaitTime;
- int m_lastChangedIndex;
-};
-
-#endif // EXTERNALFSWATCHER_H
=== removed file 'src/plugin/folderlistmodel/filecompare.cpp'
--- src/plugin/folderlistmodel/filecompare.cpp 2014-05-17 12:57:46 +0000
+++ src/plugin/folderlistmodel/filecompare.cpp 1970-01-01 00:00:00 +0000
@@ -1,107 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2013 Canonical Ltd.
- * Copyright 2013 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- *
- * File: filecompare.cpp
- * Date: 6/25/2013
- */
-
-#include "filecompare.h"
-#include "diriteminfo.h"
-#include <QString>
-#include <QDateTime>
-#include <QDebug>
-
-
-
-bool fileCompareExists(const DirItemInfo &a, const DirItemInfo &b)
-{
- if (a.isDir() && !b.isDir())
- return true;
-
- if (b.isDir() && !a.isDir())
- return false;
-
- bool ret = QString::localeAwareCompare(a.absoluteFilePath(), b.absoluteFilePath()) < 0;
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << ret << a.absoluteFilePath() << b.absoluteFilePath();
-#endif
- return ret;
-}
-
-
-bool fileCompareAscending(const DirItemInfo &a, const DirItemInfo &b)
-{
- if (a.isDir() && !b.isDir())
- return true;
-
- if (b.isDir() && !a.isDir())
- return false;
-
- return QString::localeAwareCompare(a.fileName(), b.fileName()) < 0;
-}
-
-
-bool fileCompareDescending(const DirItemInfo &a, const DirItemInfo &b)
-{
- if (a.isDir() && !b.isDir())
- return true;
-
- if (b.isDir() && !a.isDir())
- return false;
-
- return QString::localeAwareCompare(a.fileName(), b.fileName()) > 0;
-}
-
-
-bool dateCompareDescending(const DirItemInfo &a, const DirItemInfo &b)
-{
- if (a.isDir() && !b.isDir())
- return true;
-
- if (b.isDir() && !a.isDir())
- return false;
-
- return a.lastModified() > b.lastModified();
-}
-
-
-bool dateCompareAscending(const DirItemInfo &a, const DirItemInfo &b)
-{
- if (a.isDir() && !b.isDir())
- return true;
-
- if (b.isDir() && !a.isDir())
- return false;
-
- return a.lastModified() < b.lastModified();
-}
-
=== removed file 'src/plugin/folderlistmodel/filecompare.h'
--- src/plugin/folderlistmodel/filecompare.h 2014-02-05 15:31:44 +0000
+++ src/plugin/folderlistmodel/filecompare.h 1970-01-01 00:00:00 +0000
@@ -1,51 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2013 Canonical Ltd.
- * Copyright 2013 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- *
- * File: filecompare.h
- * Date: 6/25/2013
- */
-
-#ifndef FILECOMPARE_H
-#define FILECOMPARE_H
-
-class DirItemInfo;
-
-typedef bool (*CompareFunction)(const DirItemInfo &a, const DirItemInfo &b);
-
-bool fileCompareExists(const DirItemInfo &a, const DirItemInfo &b);
-bool fileCompareAscending(const DirItemInfo &a, const DirItemInfo &b);
-bool fileCompareDescending(const DirItemInfo &a, const DirItemInfo &b);
-
-bool dateCompareDescending(const DirItemInfo &a, const DirItemInfo &b);
-bool dateCompareAscending(const DirItemInfo &a, const DirItemInfo &b);
-
-#endif // FILECOMPARE_H
=== removed file 'src/plugin/folderlistmodel/filesystemaction.cpp'
--- src/plugin/folderlistmodel/filesystemaction.cpp 2015-11-02 15:46:08 +0000
+++ src/plugin/folderlistmodel/filesystemaction.cpp 1970-01-01 00:00:00 +0000
@@ -1,1682 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2013 Canonical Ltd.
- * Copyright 2013 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- *
- * File: filesystemaction.cpp
- * Date: 3/13/2013
- */
-
-#include "filesystemaction.h"
-#include "clipboard.h"
-#include "qtrashutilinfo.h"
-#include "location.h"
-#include "locationsfactory.h"
-#include "locationitemdiriterator.h"
-#include "locationitemfile.h"
-#include "locationitemdir.h"
-
-#if defined(Q_OS_UNIX)
-#include <sys/statvfs.h>
-#endif
-
-#include <errno.h>
-
-#include <QDirIterator>
-#include <QDebug>
-#include <QTimer>
-#include <QFileInfo>
-#include <QDir>
-#include <QThread>
-#include <QTemporaryFile>
-#include <QScopedPointer>
-
-/*!
- * number of the files to work on a step, when this number is reached a signal is emitted
- */
-#define STEP_FILES 5
-
-/*!
- * buffer size to to single read/write operation
- */
-#define COPY_BUFFER_SIZE 4096
-
-/*!
- * Auxiliar Actions do not emit progress() signal
- * \sa moveDirToTempAndRemoveItLater()
- */
-#define SHOULD_EMIT_PROGRESS_SIGNAL(action) (!action->isAux)
-
-#define COMMON_SIZE_ITEM 120
-
-
-//===============================================================================================
-FileSystemAction::CopyFile::CopyFile():
- bytesWritten(0),
- source(0),
- target(0),
- isEntryItem(false) ,
- amountSavedToRefresh(AMOUNT_COPIED_TO_REFRESH_ITEM_INFO)
-{
-
-}
-
-
-FileSystemAction::CopyFile::~CopyFile()
-{
- clear();
-}
-
-
-
-//===============================================================================================
-FileSystemAction::Action::Action()
- : auxAction(0), isAux(false)
-{
- reset();
-}
-
-FileSystemAction::Action::~Action()
-{
- ::qDeleteAll(entries);
- entries.clear();
- copyFile.clear();
- //it is not necessary to delete auxAction, because it should be
- //inside FileSystemAction::m_queuedActions
-}
-
-/*!
- * \brief FileSystemAction::Action::reset() Used for Undo operations
- */
-void FileSystemAction::Action::reset()
-{
- totalItems = 0;
- currItem = 0;
- currEntryIndex = 0;
- totalBytes = 0;
- bytesWritten = 0;
- done = false;
- isAux = false;
- currEntry = 0;
- steps = 1;
- //auxAction should be in FileSystemAction::m_queuedActions
- //it is not necessary to delete
- auxAction = 0;
- copyFile.clear();
- sourceLocation = 0;
- targetLocation = 0;
-
-}
-
-/*!
- * \brief FileSystemAction::Action::toggleLocation()
- *
- * It may be useful if there is a Undo Action to do a inverse Action
- */
-void FileSystemAction::Action::toggleLocation()
-{
- Location * tmp = sourceLocation;
- sourceLocation = targetLocation;
- targetLocation = tmp;
-}
-
-/*!
- * \brief FileSystemAction::Action::matchLocations
- * \return true if sourceLocation is equal targetLocation
- */
-bool FileSystemAction::Action::matchLocations() const
-{
- return sourceLocation == targetLocation;
-}
-
-bool FileSystemAction::Action::isRemote() const
-{
- return sourceLocation->isRemote() || targetLocation->isRemote();
-}
-
-//===============================================================================================
-FileSystemAction::ActionEntry::ActionEntry(): newName(0)
-{
- init();
-}
-
-FileSystemAction::ActionEntry::~ActionEntry()
-{
- reversedOrder.clear();
- if (newName) { delete newName; }
-}
-
-void FileSystemAction::ActionEntry::init()
-{
- currItem = 0 ;
- currStep = 0;
- added = false;
- alreadyExists = false;
- if (newName)
- {
- delete newName;
- newName = 0;
- }
-}
-
-/*!
- * \brief FileSystemAction::Action::reset() Used for Undo operations
- */
-void FileSystemAction::ActionEntry::reset()
-{
- init();
- reversedOrder.clear();
-}
-
-void FileSystemAction::CopyFile::clear()
-{
- bytesWritten = 0;
- if (source) delete source;
- if (target) delete target;
- source = 0;
- target = 0;
-}
-
-
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::FileSystemAction
- * \param LocationsFactory locationsFactory
- * \param parent
- */
-FileSystemAction::FileSystemAction(LocationsFactory *locationsFactory, QObject *parent) :
- QObject(parent)
- , m_curAction(0)
- , m_cancelCurrentAction(false)
- , m_busy(false)
- , m_clipboardChanged(false)
- , m_locationsFactory(locationsFactory)
-#if defined(REGRESSION_TEST_FOLDERLISTMODEL) //used in Unit/Regression tests
- , m_forceUsingOtherFS(false)
-#endif
-{
-
-}
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::~FileSystemAction
- */
-FileSystemAction::~FileSystemAction()
-{
- if (m_curAction)
- {
- delete m_curAction;
- }
- ::qDeleteAll(m_queuedActions);
- m_queuedActions.clear();
-}
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::remove
- * \param paths
- */
-void FileSystemAction::remove(const QStringList &paths)
-{
- createAndProcessAction(ActionRemove, paths);
-}
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::createAction() Creates an Action struture
- * \param type
- * \param pathUrl the source URL (just the first one) to find the location
- * \return
- */
-FileSystemAction::Action* FileSystemAction::createAction(ActionType type, const QString& pathUrl)
-{
- Action * action = new Action();
- action->type = type;
-
- //get Locations, normal case for paste/remove
- action->sourceLocation = m_locationsFactory->parse(pathUrl);
- action->targetLocation = m_locationsFactory->currentLocation();
- switch (type)
- {
- case ActionDownload:
- case ActionDownLoadAsTemporary:
- action->sourceLocation = action->targetLocation;
- action->targetLocation = m_locationsFactory->getDiskLocation();
- break;
- case ActionMoveToTrash:
- action->targetLocation = m_locationsFactory->getTrashLocation();
- break;
- case ActionRestoreFromTrash: // the current location must already be TrashLocation
- action->sourceLocation = m_locationsFactory->getTrashLocation();
- //TODO check the URL from trash
- action->targetLocation = m_locationsFactory->getDiskLocation();
- break;
- default:
- break;
- }
- if (action->sourceLocation == 0)
- {
- action->sourceLocation = m_locationsFactory->getDiskLocation();
- }
- if (action->targetLocation == 0)
- {
- action->targetLocation = m_locationsFactory->getDiskLocation();
- }
- return action;
-}
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::addEntry
- * \param action
- * \param pathname
- */
-void FileSystemAction::addEntry(Action* action, const ActionPaths& pairPaths)
-{
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << pairPaths.source();
-#endif
-
- ActionEntry * entry = new ActionEntry();
- entry->itemPaths = pairPaths;
- if (populateEntry(action, entry))
- {
- //now put the Entry in the Action
- action->entries.append(entry);
- }
- else
- {
- delete entry;
- }
-}
-
-bool FileSystemAction::populateEntry(Action* action, ActionEntry* entry)
-{
- QScopedPointer<DirItemInfo> info(action->sourceLocation->newItemInfo(entry->itemPaths.source()));
- if (!info->exists())
- {
- emit error(QObject::tr("File or Directory does not exist"),
- info->absoluteFilePath() + QObject::tr(" does not exist")
- );
- return false;
- }
- if (info->needsAuthentication())
- {
- emit error(QObject::tr("Cannot access File or Directory"),
- info->absoluteFilePath() + QObject::tr(" it needs Authentication")
- );
- return false;
- }
- //action->type is top level for all items, entry->type drives item behaviour
- switch(action->type)
- {
- case ActionDownload:
- case ActionDownLoadAsTemporary: entry->type = ActionCopy;
- break;
- case ActionMoveToTrash:
- case ActionRestoreFromTrash: entry->type = ActionMove; //needs create .trashinfo file
- break;
- case ActionRemoveFromTrash: entry->type = ActionRemove; //needs remove .trashinfo file
- break;
- default: entry->type = action->type; //normal behaviour
- break;
- }
- //this is the item being handled
- entry->reversedOrder.append(*info);
- // verify if the destination item already exists and it the destination path is in other file system
- if (entry->type == ActionCopy ||
- entry->type == ActionMove
- )
- {
- QScopedPointer<DirItemInfo> destination(action->targetLocation->newItemInfo(entry->itemPaths.target()));
- entry->alreadyExists = destination->exists();
- // if destination folder exists check for write permission
- QScopedPointer<DirItemInfo> parentDestination(action->targetLocation->newItemInfo(entry->itemPaths.targetPath()));
- if (parentDestination->exists() && !parentDestination->isWritable())
- {
- emit error(tr("Cannot copy/move items"),
- tr("no write permission on folder ") + destination->absoluteFilePath() );
- return false;
-
- }
- //check if it is possible to move items,
- //when there is a remote Location it is necessary copy then remove
- if ( entry->type == ActionMove &&
- (action->isRemote() || !moveUsingSameFileSystem(entry->itemPaths))
- )
- {
- entry->type = ActionHardMoveCopy; // first step
- }
- }
- //ActionMove will perform a rename, so no Directory expanding is necessary
- if (entry->type != ActionMove && info->isDir() && !info->isSymLink())
- {
- QScopedPointer<LocationItemDirIterator>
- it (action->sourceLocation->newDirIterator(info->absoluteFilePath(),
- QDir::AllEntries | QDir::System |
- QDir::NoDotAndDotDot | QDir::Hidden,
- QDirIterator::Subdirectories));
- while (it->hasNext() && !it->next().isEmpty())
- {
- entry->reversedOrder.prepend(it->fileInfo());
- }
- }
-#if DEBUG_MESSAGES
- for (int counter = 0; counter < entry->reversedOrder.count(); counter++)
- {
- const DirItemInfo & item = entry->reversedOrder.at(counter);
- qDebug() << Q_FUNC_INFO << "reversedOrder" << counter << item.absoluteFilePath();
- }
-#endif
- //set steps and total bytes considering all items in the Entry
- int counter = entry->reversedOrder.count();
- qint64 size = 0;
- int sizeSteps = 0;
- int bufferSize = (COPY_BUFFER_SIZE * STEP_FILES);
- while (counter--)
- {
- const DirItemInfo & item = entry->reversedOrder.at(counter);
- size = (item.isFile() && !item.isDir() && !item.isSymLink()) ?
- item.size() : COMMON_SIZE_ITEM;
- action->totalBytes += size;
- if (entry->type == ActionCopy || entry->type == ActionHardMoveCopy)
- {
- if ( (sizeSteps = size / bufferSize) )
- {
- if ( !(size % bufferSize) )
- {
- --sizeSteps;
- }
- }
- action->steps += sizeSteps ;
- }
- }
- //set final steps for the Entry based on Items number
- int entrySteps = entry->reversedOrder.count() / STEP_FILES;
- if ( entry->reversedOrder.count() % STEP_FILES) entrySteps++;
- action->steps += entrySteps;
- action->totalItems += entry->reversedOrder.count();
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "entrySteps" << entrySteps << "from entry counter"
- << entry->reversedOrder.count() << "total steps" << action->steps;
-#endif
-
- return true;
-}
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::processAction
- */
-void FileSystemAction::processAction()
-{
- if (m_curAction)
- {
- if (m_curAction->done && m_curAction->type == ActionDownLoadAsTemporary)
- {
- emit downloadTemporaryComplete(m_curAction->copyFile.targetName);
- }
- delete m_curAction;
- m_curAction = 0;
- }
- if (m_queuedActions.count())
- {
- m_curAction = m_queuedActions.at(0);
- m_curAction->currEntry = static_cast<ActionEntry*>
- ( m_curAction->entries.at(0));
- m_queuedActions.remove(0,1);
- }
- if (m_curAction)
- {
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "performing action type" << m_curAction->type;
-#endif
- m_busy = true;
- m_cancelCurrentAction = false;
- m_errorMsg.clear();
- m_errorTitle.clear();
- scheduleSlot(SLOT(processActionEntry()));
- if (SHOULD_EMIT_PROGRESS_SIGNAL(m_curAction))
- {
- emit progress(0,m_curAction->totalItems, 0);
- }
- }
- else
- {
- m_busy = false;
- }
-}
-
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::processActionEntry
- */
-void FileSystemAction::processActionEntry()
-{
- ActionEntry * curEntry = m_curAction->currEntry;
-
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "entry:" << curEntry << "type:" << curEntry->type;
-#endif
-
-#if defined(SIMULATE_LONG_ACTION)
- {
- unsigned int delay = SIMULATE_LONG_ACTION;
- if (delay == 1)
- {
- delay = 100; //each (10 * STEP_FILES) files will waits a second
- QThread::currentThread()->wait(delay);
- }
- }
-#endif
- if (!m_cancelCurrentAction)
- {
- switch(curEntry->type)
- {
- case ActionRemove:
- case ActionHardMoveRemove:
- removeEntry(curEntry);
- endActionEntry();
- break;
- case ActionCopy:
- case ActionHardMoveCopy:
- processCopyEntry(); // specially: this is a slot
- break;
- case ActionMove:
- moveEntry(curEntry);
- endActionEntry();
- break;
- default:
- break;
- }
- }
- else
- {
- //Needed to set m_busy to false. Otherwise, further actions will never be executed.
- endActionEntry();
- }
-}
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::endActionEntry
- */
-void FileSystemAction::endActionEntry()
-{
- ActionEntry * curEntry = m_curAction->currEntry;
-
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "entry:" << curEntry << "type:" << curEntry->type;
-#endif
-
- // first of all check for any error or a cancel issued by the user
- if (m_cancelCurrentAction)
- {
- if (!m_errorTitle.isEmpty())
- {
- emit error(m_errorTitle, m_errorMsg);
- }
- //it may have other actions to do
- scheduleSlot(SLOT(processAction()));
- return;
- }
-
- int percent = notifyProgress();
-
- // check if the current entry has finished
- // if so Views need to receive the notification about that
- if (curEntry->currItem == curEntry->reversedOrder.count())
- {
- const DirItemInfo & mainItem = curEntry->reversedOrder.at(curEntry->currItem -1);
- m_curAction->currEntryIndex++;
-
- //check Trash operations
- if ( (m_curAction->type == ActionMoveToTrash || m_curAction->type == ActionRestoreFromTrash)
- && (curEntry->type == ActionMove || curEntry->type == ActionHardMoveRemove)
- )
- {
- if ( m_curAction->type == ActionMoveToTrash )
- {
- createTrashInfoFileFromEntry(curEntry);
- }
- else
- {
- removeTrashInfoFileFromEntry(curEntry);
- }
- notifyActionOnItem(mainItem, ItemRemoved);
- }
- else
- {
- switch(curEntry->type)
- {
- case ActionRemove:
- if (m_curAction->type == ActionRemoveFromTrash)
- {
- //it is necessary to remove also (file).trashinfo file
- removeTrashInfoFileFromEntry(curEntry);
- }
- notifyActionOnItem(mainItem, ItemRemoved);
- break;
- case ActionHardMoveRemove: // nothing to do
- break;
- case ActionHardMoveCopy:
- case ActionCopy: // ActionHardMoveCopy is lso checked here
- case ActionMove:
- {
- QScopedPointer <DirItemInfo> item(m_curAction->targetLocation->newItemInfo(curEntry->itemPaths.target()));
- if (!curEntry->added && !curEntry->alreadyExists)
- {
- curEntry->added = true;
- notifyActionOnItem(*item, ItemAdded);
- }
- else
- {
- notifyActionOnItem(*item, ItemChanged);
- }
- }
- if (curEntry->type == ActionHardMoveCopy)
- {
- //process same Entry again,
- m_curAction->currEntryIndex--;
- curEntry->type = ActionHardMoveRemove;
- m_curAction->currItem -= curEntry->reversedOrder.count();
- curEntry->init();
- }
- break;
- default:
- break;
- }//switch
- }
- }//end if (curEntry->currItem == curEntry->reversedOrder.count())
-
- if (curEntry->currStep == STEP_FILES)
- {
- curEntry->currStep = 0;
- }
-
- //Check if the current action has finished or cancelled
- if (m_cancelCurrentAction ||
- m_curAction->currEntryIndex == m_curAction->entries.count())
- {
- if (!m_cancelCurrentAction)
- {
- endCurrentAction();
- if (percent < 100)
- {
- notifyProgress(100);
- }
- }
- //it may have other actions to do
- scheduleSlot(SLOT(processAction()));
- }
- else
- {
- m_curAction->currEntry = static_cast<ActionEntry*>
- ( m_curAction->entries.at(m_curAction->currEntryIndex) );
- //keep working on current Action maybe more entries
- scheduleSlot(SLOT(processActionEntry()));
- }
-}
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::cancel
- */
-void FileSystemAction::cancel()
-{
- m_cancelCurrentAction = true;
-}
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::removeEntry
- * \param entry
- */
-void FileSystemAction::removeEntry(ActionEntry *entry)
-{
- //do one step at least
- for(; !m_cancelCurrentAction &&
- entry->currStep < STEP_FILES &&
- m_curAction->currItem < m_curAction->totalItems &&
- entry->currItem < entry->reversedOrder.count()
- ; entry->currStep++, m_curAction->currItem++, entry->currItem++
- )
-
- {
- const DirItemInfo &fi = entry->reversedOrder.at(entry->currItem);
- if (fi.isDir() && !fi.isSymLink())
- {
- QScopedPointer<LocationItemDir> dir(m_curAction->sourceLocation->newDir());
- m_cancelCurrentAction = !dir->rmdir(fi.absoluteFilePath());
- }
- else
- {
- QScopedPointer<LocationItemFile> qFile(m_curAction->sourceLocation->newFile(fi.absoluteFilePath()));
- m_cancelCurrentAction = !qFile->remove();
- }
-#if DEBUG_REMOVE
- qDebug() << Q_FUNC_INFO << "remove ret=" << !m_cancelCurrentAction << fi.absoluteFilePath();
-#endif
- if (m_cancelCurrentAction)
- {
- m_errorTitle = QObject::tr("Could not remove the item ") +
- fi.absoluteFilePath();
- m_errorMsg = ::strerror(errno);
- }
- }
-}
-
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::copyEntry
- * \param entry
- */
-void FileSystemAction::processCopyEntry()
-{
- ActionEntry * entry = m_curAction->currEntry;
-
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "processing"
- << entry->reversedOrder.at(entry->reversedOrder.count() -1).absoluteFilePath();
-#endif
- /*
- * This flag will be true when processCopySingleFile() has put any slot in the execution queue
- * it will work to stop the loop.
- * Later processCopyEntry() will be called again to continue working
- */
- bool scheduleAnySlot = false;
-
- //first item from an Entry,
- if (entry->currItem == 0 && entry->alreadyExists && entry->newName == 0)
- {
- //making backup only if the targetpath == origPath, otherwise the item is overwritten
- if (entry->itemPaths.areEquals())
- {
- //it will check again if the target exists
- //if so, sets the entry->newName
- //then targetFom() will use entry->newName for
- // sub items in the Entry if the Entry is a directory
- if (!makeBackupNameForCurrentItem(entry) )
- {
- m_cancelCurrentAction = true;
- m_errorTitle = QObject::tr("Could not find a suitable name to backup");
- m_errorMsg = entry->reversedOrder.at(
- entry->reversedOrder.count() -1
- ).absoluteFilePath();
- }
- }
-#if DEBUG_MESSAGES
- else
- {
- qDebug() << entry->reversedOrder.at(entry->reversedOrder.count() -1).absoluteFilePath()
- << " already exists and will be overwritten";
- }
-#endif
- }
-
- for(; !m_cancelCurrentAction && !scheduleAnySlot &&
- entry->currStep < STEP_FILES &&
- m_curAction->currItem < m_curAction->totalItems &&
- entry->currItem < entry->reversedOrder.count()
- ; entry->currStep++, entry->currItem++
- )
-
- {
- const DirItemInfo &fi = entry->reversedOrder.at(entry->currItem);
- QString orig = fi.absoluteFilePath();
- QString target = targetFrom(orig, entry);
-#if DEBUG_MESSAGES
- qDebug() << "orig:" << orig << "target:" << target;
-#endif
- QString path(target);
- // do this here to allow progress send right item number, copySingleFile will emit progress()
- m_curAction->currItem++;
- //--
- if (fi.isFile() || fi.isSymLink())
- {
- QScopedPointer <DirItemInfo> t(m_curAction->targetLocation->newItemInfo(target));
- path = t->path();
- }
- //check if the main item in the entry is a directory
- //if so it needs to appear on any attached view
- if ( m_curAction->currItem == 1
- && entry->reversedOrder.last().isDir()
- && !entry->reversedOrder.last().isSymLink()
- )
- {
- QString entryDir = targetFrom(entry->reversedOrder.last().absoluteFilePath(), entry);
- QScopedPointer<LocationItemDir> entryDirObj(m_curAction->targetLocation->newDir(entryDir));
- if (!entryDirObj->exists() && entryDirObj->mkpath(entryDir))
- {
- QScopedPointer <DirItemInfo> item(m_curAction->targetLocation->newItemInfo(entryDir));
- entry->added = true;
- notifyActionOnItem(*item, ItemAdded);
- }
- }
- QScopedPointer<LocationItemDir> d(m_curAction->targetLocation->newDir(path));
- if (!d->exists() && !d->mkpath(path))
- {
- m_cancelCurrentAction = true;
- m_errorTitle = QObject::tr("Could not create the directory");
- m_errorMsg = path;
- }
- else
- if (fi.isSymLink())
- {
- m_cancelCurrentAction = ! copySymLink(target,fi.diskFileInfo());
- if (m_cancelCurrentAction)
- {
- m_errorTitle = QObject::tr("Could not create link to");
- m_errorMsg = target;
- }
- m_curAction->bytesWritten += COMMON_SIZE_ITEM;
- }
- else
- if (fi.isDir())
- {
- QScopedPointer<LocationItemFile> qFile(m_curAction->targetLocation->newFile(target));
- m_cancelCurrentAction = !qFile->setPermissions(fi.permissions());
- if (m_cancelCurrentAction)
- {
- m_errorTitle = QObject::tr("Could not set permissions to dir");
- m_errorMsg = target;
- }
- m_curAction->bytesWritten += COMMON_SIZE_ITEM;
- }
- else
- if (fi.isFile())
- {
- qint64 needsSize = 0;
- m_curAction->copyFile.clear();
- m_curAction->copyFile.source = m_curAction->sourceLocation->newFile(orig);
- m_cancelCurrentAction = !m_curAction->copyFile.source->open(QFile::ReadOnly);
- if (m_cancelCurrentAction)
- {
- m_errorTitle = QObject::tr("Could not open file");
- m_errorMsg = orig;
- }
- else
- {
- needsSize = m_curAction->copyFile.source->size();
- //create destination
- m_curAction->copyFile.target = m_curAction->targetLocation->newFile(target);
- m_curAction->copyFile.targetName = target;
- //first open it read-only to get its size if exists
- if (m_curAction->copyFile.target->open(QFile::ReadOnly))
- {
- needsSize -= m_curAction->copyFile.target->size();
- m_curAction->copyFile.target->close();
- }
- //check if there is disk space to copy source to target
- if (needsSize > 0 && !m_curAction->targetLocation->isThereDiskSpace(entry->itemPaths.targetPath(), needsSize))
- {
- m_cancelCurrentAction = true;
- m_errorTitle = QObject::tr("There is no space to copy");
- m_errorMsg = m_curAction->copyFile.target->fileName();
- }
- }
- if (!m_cancelCurrentAction)
- {
- m_cancelCurrentAction =
- !m_curAction->copyFile.target->open(QFile::WriteOnly | QFile::Truncate);
- if (m_cancelCurrentAction)
- {
- m_errorTitle = QObject::tr("Could not create file");
- m_errorMsg = m_curAction->copyFile.target->fileName();
- }
- }
- if (!m_cancelCurrentAction)
- {
- m_curAction->copyFile.isEntryItem = entry->currItem == (entry->reversedOrder.count() -1);
- scheduleAnySlot = processCopySingleFile();
- //main item from the entry. notify views new item inserted,
- //depending on the file size it may take longer, the view needs to be informed
- if (m_curAction->copyFile.isEntryItem && !m_cancelCurrentAction)
- {
- QScopedPointer <DirItemInfo> item(m_curAction->targetLocation->newItemInfo(target));
- if (!entry->alreadyExists)
- {
- entry->added = true;
- notifyActionOnItem(*item, ItemAdded);
- }
- else
- {
- notifyActionOnItem(*item, ItemChanged);
- }
- }
- }
- }//end isFile
- }//for
-
- //no copy going on
- if (!scheduleAnySlot)
- {
- endActionEntry();
- }
-}
-
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::moveEntry
- * \param entry
- */
-void FileSystemAction::moveEntry(ActionEntry *entry)
-{
- for(; !m_cancelCurrentAction &&
- entry->currStep < STEP_FILES &&
- m_curAction->currItem < m_curAction->totalItems &&
- entry->currItem < entry->reversedOrder.count()
- ; entry->currStep++, m_curAction->currItem++, entry->currItem++
- )
-
- {
- const DirItemInfo &fi = entry->reversedOrder.at(entry->currItem);
- QScopedPointer<LocationItemFile> file(m_curAction->sourceLocation->newFile(fi.absoluteFilePath()));
- QScopedPointer<DirItemInfo> targetInfo(m_curAction->targetLocation->newItemInfo(entry->itemPaths.target()));
- //rename will fail
- if (targetInfo->exists())
- {
- //will not emit removed() neither added()
- entry->added = true;
- if (targetInfo->isFile() || targetInfo->isSymLink())
- {
- QScopedPointer<LocationItemFile>
- targetFile(m_curAction->sourceLocation->newFile(targetInfo->absoluteFilePath()));
- if (!targetFile->remove())
- {
- m_cancelCurrentAction = true;
- m_errorTitle = QObject::tr("Could not remove the directory/file ") +
- targetInfo->absoluteFilePath();
- m_errorMsg = ::strerror(errno);
- }
- }
- else //only for local disk operations
- if (targetInfo->isDir() && !m_curAction->isRemote())
- {
- //move target to /tmp and remove it later by creating an Remove action
- //this will emit removed()
- moveDirToTempAndRemoveItLater(targetInfo->absoluteFilePath());
- }
- }
- if (!m_cancelCurrentAction && !file->rename(entry->itemPaths.target()))
- {
- m_cancelCurrentAction = true;
- m_errorTitle = QObject::tr("Could not move the directory/file ") +
- targetInfo->absoluteFilePath();
- m_errorMsg = ::strerror(errno);
- }
- }//for
-}
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::pathChanged
- * \param path
- */
-void FileSystemAction::pathChanged(const QString &path)
-{
- m_path = path;
-}
-
-
-
-void FileSystemAction::copyIntoCurrentPath(const QStringList& items)
-{
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << items;
-#endif
- m_clipboardChanged = false;
- if (items.count())
- {
- createAndProcessAction(ActionCopy, items);
- }
-}
-
-
-void FileSystemAction::moveIntoCurrentPath(const QStringList& items)
-{
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << items;
-#endif
- m_clipboardChanged = false;
- if (items.count())
- {
- createAndProcessAction(ActionMove, items);
- }
-}
-
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::createAndProcessAction
- * \param actionType
- * \param paths
- *
- */
-void FileSystemAction::createAndProcessAction(ActionType actionType, const QStringList& paths)
-{
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << paths;
-#endif
- Action *myAction = createAction(actionType,paths.at(0));
- //in case of move, verify if it can be performed
- if (actionType == ActionMove && !canMoveItems(myAction, paths))
- {
- delete myAction;
- return;
- }
- //populate the action and put the action in the queue
- bool usingFullPath = myAction->isRemote() || DirItemInfo(paths.at(0)).isAbsolute();
- for (int counter=0; counter < paths.count(); counter++)
- {
- ActionPaths pairPaths;
- //avoid creating a DirItemInfo if the Url/Path is already full
- //remove Locations may take longer to create DirItemInfo object
- if (!usingFullPath)
- {
- QScopedPointer <DirItemInfo> info (myAction->sourceLocation->newItemInfo(paths.at(counter)));
- if (!info->isAbsolute())
- {
- info->setFile(m_path, paths.at(counter));
- }
- pairPaths.setSource(info->absoluteFilePath());
- }
- else
- { //it is already full path/url
- pairPaths.setSource(paths.at(counter));
- }
- pairPaths.setTargetPathOnly(m_path);
- addEntry(myAction, pairPaths);
- }
- queueAction(myAction);
-}
-
-
-void FileSystemAction::queueAction(Action *myAction)
-{
- if (myAction->totalItems > 0)
- {
- /*
- if (actionType == ActionHardMoveCopy || actionType == ActionCopy)
- {
- //if a file size is less than (COPY_BUFFER_SIZE * STEP_FILES) a single step does that
- //and it is already computed
- myAction->steps += myAction->totalBytes / (COPY_BUFFER_SIZE * STEP_FILES);
- }
- */
- m_queuedActions.append(myAction);
- if (!m_busy)
- {
- processAction();
- }
- }
- else
- { // no items were added into the Action, maybe items were removed
- //addEntry() emits error() signal when items do not exist
- delete myAction;
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "Action is empty, no work to do";
-#endif
- }
-}
-
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::targetFom() makes a destination full pathname from \a origItem
- * \param origItem full pathname from a item intended to be copied or moved under entry->itemPaths.target
- * \param entry which the item belongs to (item may be a sub item if the entry is a Directory)
- * \return full pathname of target
- *
- * \sa makeBackupNameForCurrentItem()
- */
-QString FileSystemAction::targetFrom(const QString& origItem, ActionEntry *entry)
-{
- QString destinationUnderTarget(origItem.mid(entry->itemPaths.baseOrigSize()));
- if (entry->newName)
- {
- int len = destinationUnderTarget.indexOf(QDir::separator(), 1);
- if (len == -1) {
- len = destinationUnderTarget.size();
- }
- destinationUnderTarget.replace(1, len -1, *entry->newName);
- }
- QString target(entry->itemPaths.targetPath() + destinationUnderTarget);
-
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "orig" << origItem
- << "target" << target;
-#endif
- return target;
-}
-
-
-//===============================================================================================
-/*!
- * \brief FileSystemAction::moveUsingSameFileSystem() Checks if the item being moved to another path
- * belongs to the same File System as the target path
- *
- * It is used to set ActionHardMoveCopy or ActionMove for cut operations.
- *
- * \param paths
- *
- * \return true if the operation is going to performed in the same file system
- */
-bool FileSystemAction::moveUsingSameFileSystem(const ActionPaths& movedItem)
-{
- unsigned long targetFsId = 0xffff;
- unsigned long originFsId = 0xfffe;
-
-#if defined(REGRESSION_TEST_FOLDERLISTMODEL)
- if (m_forceUsingOtherFS)
- {
- return false;
- }
-#endif
-
-#if defined(Q_OS_UNIX)
- struct statvfs vfs;
- if ( ::statvfs( QFile::encodeName(movedItem.source()).constData(), &vfs) == 0 )
- {
- targetFsId = vfs.f_fsid;
- }
- if ( ::statvfs(QFile::encodeName(movedItem.targetPath()).constData(), &vfs) == 0)
- {
- originFsId = vfs.f_fsid;
- }
-#else
- Q_UNUSED(movedItem);
-#endif
- return targetFsId == originFsId;
-}
-
-
-//================================================================================
-/*!
- * \brief FileSystemAction::endCurrentAction() finishes an Action
- *
- * If a Paste was made from a Cut operation, items pasted become avaialable in the clipboard
- * as from Copy source operation, so items can be now Pasted again, but with no source removal
- *
- * It checks for \a m_clipboardChanged that idenftifies if the clipboard was modified during the
- * operation maybe by another application.
- */
-void FileSystemAction::endCurrentAction()
-{
-
- if ( !m_clipboardChanged && m_curAction->type == ActionMove )
- {
- const ActionEntry *entry = m_curAction->entries.at(0);
- if (!entry->itemPaths.arePathsEquals())
- {
- QString destinationPath = entry->itemPaths.targetPath();
- QStringList items;
- for(int e = 0; e < m_curAction->entries.count(); e++)
- {
- entry = m_curAction->entries.at(e);
- items.append(entry->itemPaths.target());
- }
- if (items.count())
- {
- //it is not necessary to handle own clipboard here
- emit recopy(items, destinationPath);
- }
- }
- }
-}
-
-//================================================================================
-/*!
- * \brief FileSystemAction::copySingleFile() do a single file copy
- *
- * Several write operations are required to copy big files, each operation writes (STEP_FILES * 4k) bytes.
- * After a write operation if more operations are required to copy the whole file,
- * a progress() signal is emitted and a new write operation is scheduled to happen in the next loop interaction.
- *
- * \return true if scheduled to another slot either processCopyEntry() or itself; false if not.
- */
-bool FileSystemAction::processCopySingleFile()
-{
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO;
-#endif
- char block[COPY_BUFFER_SIZE];
- int step = 0;
- bool copySingleFileDone = false;
- bool scheduleAnySlot = true;
- int startBytes = m_curAction->copyFile.bytesWritten;
-
- while( m_curAction->copyFile.source &&
- !m_curAction->copyFile.source->atEnd() &&
- !m_cancelCurrentAction &&
- m_curAction->copyFile.bytesWritten < m_curAction->copyFile.source->size() &&
- step++ < STEP_FILES
- )
- {
- qint64 in = m_curAction->copyFile.source->read(block, sizeof(block));
- if (in > 0)
- {
- if(in != m_curAction->copyFile.target->write(block, in))
- {
- m_curAction->copyFile.source->close();
- m_curAction->copyFile.target->close();
- m_cancelCurrentAction = true;
- m_errorTitle = QObject::tr("Write error in ")
- + m_curAction->copyFile.targetName,
- m_errorMsg = ::strerror(errno);
- break;
- }
- m_curAction->bytesWritten += in;
- m_curAction->copyFile.bytesWritten += in;
- if (m_curAction->copyFile.isEntryItem)
- {
- m_curAction->copyFile.amountSavedToRefresh -= in;
- }
- }
- else
- if (in < 0)
- {
- m_cancelCurrentAction = true;
- m_errorTitle = QObject::tr("Read error in ")
- + m_curAction->copyFile.source->fileName();
- m_errorMsg = ::strerror(errno);
- break;
- }
- }// end write loop
-
- // write loop finished, the copy might be finished
- if (!m_cancelCurrentAction
- && m_curAction->copyFile.source
- && m_curAction->copyFile.bytesWritten == m_curAction->copyFile.source->size()
- && m_curAction->copyFile.source->isOpen()
- )
- {
- copySingleFileDone = endCopySingleFile();
- }
-
- if (m_cancelCurrentAction)
- {
- if (m_curAction->copyFile.target)
- {
- if (m_curAction->copyFile.target->isOpen())
- {
- m_curAction->copyFile.target->close();
- }
- if (m_curAction->copyFile.target->remove())
- {
- QScopedPointer<DirItemInfo> item(m_curAction->targetLocation->newItemInfo(m_curAction->copyFile.targetName));
- notifyActionOnItem(*item, ItemRemoved);
- }
- }
- m_curAction->copyFile.clear();
- endActionEntry();
- }
- else
- {
- if (copySingleFileDone)
- {
- m_curAction->copyFile.clear();
- //whem the whole copy could be done just in one call
- //do not schedule to call copyEntry()
- if (startBytes > 0)
- {
- //the whole took more than one call to copySingleFile()
- scheduleSlot(SLOT(processCopyEntry()));
- }
- else
- { //return normally to entry loop
- scheduleAnySlot = false;
- }
- }
- else
- {
- notifyProgress();
- if (m_curAction->copyFile.isEntryItem && m_curAction->copyFile.amountSavedToRefresh <= 0)
- {
- QScopedPointer <DirItemInfo> item(m_curAction->targetLocation->newItemInfo(m_curAction->copyFile.targetName));
- m_curAction->copyFile.amountSavedToRefresh = AMOUNT_COPIED_TO_REFRESH_ITEM_INFO;
- notifyActionOnItem(*item, ItemChanged);
- }
- scheduleSlot(SLOT(processCopySingleFile()));
- }
- }
-
- return scheduleAnySlot;
-}
-
-
-//================================================================================
-/*!
- * \brief FileSystemAction::percentWorkDone() Compute the percent of work done
- *
- * Copy operations are based on bytes written while remove/move operations are based on items number
- *
- * \return the percent of work done
- */
-int FileSystemAction::percentWorkDone()
-{
- int percent = 0;
-
- //copying empty files will have totalBytes==0
- if ( m_curAction->totalBytes > 0 &&
- (m_curAction->currEntry->type == ActionCopy ||
- m_curAction->currEntry->type == ActionHardMoveCopy
- )
- )
- {
- percent = (m_curAction->bytesWritten * 100) / m_curAction->totalBytes ;
- }
- else
- { //percentage based on number of items performed
- percent = (m_curAction->currItem * 100) / m_curAction->totalItems;
- }
-
- if (percent > 100)
- {
- percent = 100;
- }
- return percent;
-}
-
-
-//================================================================================
-/*!
- * \brief FileSystemAction::notifyProgress() Notify the progress signal
- *
- * \return the percent of work done
- */
-int FileSystemAction::notifyProgress(int forcePercent)
-{
- int percent = forcePercent > 0 ? forcePercent : percentWorkDone();
- if (percent == 0)
- {
- percent = 1;
- }
- if ( SHOULD_EMIT_PROGRESS_SIGNAL(m_curAction) &&
- !m_curAction->done &&
- m_curAction->currEntry->type != ActionHardMoveRemove
- )
- {
- emit progress(m_curAction->currItem, m_curAction->totalItems, percent);
- if (percent == 100 && m_curAction->currItem == m_curAction->totalItems)
- {
- m_curAction->done = true;
- }
- }
- return percent;
-}
-
-//================================================================================
-/*!
- * \brief FileSystemAction::copySymLink() creates the \a target as a link according to \a orig
- * \param target full pathname of the file to be created
- * \param orig original file, it carries the link that \a target will point to
- * \return true if it could create, else if not
- */
-bool FileSystemAction::copySymLink(const QString &target, const QFileInfo &orig)
-{
- QString link(orig.symLinkTarget());
- QFileInfo linkFile(link);
- if (linkFile.isAbsolute() && linkFile.absolutePath() == orig.absolutePath())
- {
- link = linkFile.fileName();
- }
-#if QT_VERSION <= 0x040704
- QString current = QDir::currentPath();
- QDir::setCurrent(linkFile.absolutePath());
- bool ret = QFile::link(link, target);
- QDir::setCurrent(current);
-#else
- bool ret = QFile::link(link, target);
-#endif
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << ret << target << link;
-#endif
- return ret;
-}
-
-//================================================================================
-void FileSystemAction::scheduleSlot(const char *slot)
-{
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << slot;
-#endif
- QTimer::singleShot(0, this, slot);
-}
-
-
-
-//================================================================================
-/*!
- * \brief FileSystemAction::moveDirToTempAndRemoveItLater() moves a directory to temp and shedules it for be removed later
- *
- * When pasting from cut actions, directories will be totally replaced, when they already exist, they need to be removed
- * before moving the new content, so the solution is to move them to temp directory and create another action to remove
- * them later, after that the content is moved to a target that does not exist any more.
- *
- * \param dir directory name which is the target for paste operation and needs get removed first
- */
-void FileSystemAction::moveDirToTempAndRemoveItLater(const QString& dir)
-{
- QString tempDir;
- {
- //create this temporary file just to get a unique name
- QTemporaryFile d;
- d.setAutoRemove(true);
- d.open();
- d.close();
- tempDir = d.fileName();
- }
-#if defined(DEBUG_MESSAGES) || defined(REGRESSION_TEST_FOLDERLISTMODEL)
- qDebug() << Q_FUNC_INFO << dir << "being moved to" << tempDir;
-#endif
- QScopedPointer<LocationItemFile> qFile(m_curAction->targetLocation->newFile(dir));
- bool removed = qFile->rename(tempDir);
- if (removed)
- {
- if (m_curAction->auxAction == 0)
- { // this new action as Remove will remove all dirs
- m_curAction->auxAction = createAction(ActionRemove, tempDir);
- m_curAction->auxAction->isAux = true;
- m_queuedActions.append(m_curAction->auxAction);
- }
- ActionPaths pathToRemove(tempDir);
- addEntry(m_curAction->auxAction, pathToRemove);
- }
-}
-
-//================================================================================
-/*!
- * \brief FileSystemAction::isBusy() just inform if there is any Action going on
- * \return true when there is any Action going on
- */
-bool FileSystemAction::isBusy() const
-{
- return m_busy;
-}
-
-//==================================================================
-/*!
- * \brief FileSystemAction::makeBackupNameForCurrentItem() creates a new name suitable for backup an item
- *
- * The item can be a folder or a single file, but it is an Entry that means it is under the path were Copy happened
- * The newName field from current entry will be set to a suitable name
- * \param action
- */
-bool FileSystemAction::makeBackupNameForCurrentItem(ActionEntry *entry)
-{
- bool ret = false;
- if (entry->alreadyExists)
- {
- const DirItemInfo& fi =
- entry->reversedOrder.at(entry->reversedOrder.count() -1);
- QScopedPointer<DirItemInfo> backuped(m_curAction->targetLocation->newItemInfo(QLatin1String(0)));
- int counter=0;
- QString name;
- do
- {
- QString copy(QObject::tr(" Copy"));
- if(++counter > 0)
- {
- copy += QLatin1Char('(') +
- QString::number(counter) +
- QLatin1Char(')');
- }
- name = fi.fileName();
- int pos = name.size();
- if (!fi.isDir())
- {
- int dot = name.lastIndexOf(QChar('.'));
- if (dot != -1)
- {
- pos = dot;
- }
- }
- name.insert(pos,copy);
- backuped->setFile(fi.absolutePath(), name);
- } while (backuped->exists() && counter < 100);
- if (counter < 100)
- {
- if (entry->newName)
- {
- delete entry->newName; // it no longer will be used
- }
- entry->newName = new QString(backuped->fileName());
- entry->itemPaths.setTargetFullName( backuped->absoluteFilePath() );
- ret = true;
- }
- }
- return ret;
-}
-
-//==================================================================
-/*!
- * \brief FileSystemAction::getProgressCounter
- * \return number of progress notification from current Action
- */
-int FileSystemAction::getProgressCounter() const
-{
- int steps = 0;
- if (m_curAction)
- {
- steps = m_curAction->steps;
- }
- return steps;
-}
-
-
-//==================================================================
-bool FileSystemAction::endCopySingleFile()
-{
- bool ret = true;
- m_curAction->copyFile.source->close();
- m_curAction->copyFile.target->close();
- m_cancelCurrentAction = !m_curAction->copyFile.target->setPermissions(
- m_curAction->copyFile.source->permissions());
- if (m_cancelCurrentAction)
- {
- m_errorTitle = QObject::tr("Set permissions error in ")
- + m_curAction->copyFile.targetName,
- m_errorMsg = ::strerror(errno);
- ret = false;
- }
- return ret;
-}
-
-
-//==================================================================
-/*!
- * \brief FileSystemAction::onClipboardChanged()
- *
- * sets \ref m_clipboardChanged indicating the fhe Clipboard was changed.
- */
-void FileSystemAction::onClipboardChanged()
-{
- m_clipboardChanged = true;
-}
-
-
-//==================================================================
-/*!
- * \brief FileSystemAction::moveToTrash() Move a set of files to Trash
- * \param items files/dirs that belong to the same parent directory
- */
-void FileSystemAction::moveToTrash(const ActionPathList &pairPaths)
-{
- Action *moveAction = createAction(ActionMoveToTrash, pairPaths.at(0).source());
- for (int counter=0; counter < pairPaths.count(); ++counter)
- {
- addEntry(moveAction, pairPaths.at(counter));
- }
- queueAction(moveAction);
-}
-
-//==================================================================
-/*!
- * \brief FileSystemAction::restoreFromTrash() restore a set of Files to
- * their original path
- * \param pairPaths
- */
-void FileSystemAction::restoreFromTrash(const ActionPathList &pairPaths)
-{
- Action *moveAction = createAction(ActionRestoreFromTrash, pairPaths.at(0).source());
- for (int counter=0; counter < pairPaths.count(); ++counter)
- {
- addEntry(moveAction, pairPaths.at(counter));
- }
- queueAction(moveAction);
-}
-
-/*!
- * \brief FileSystemAction::removeFromTrash
- * \param paths
- */
-void FileSystemAction::removeFromTrash(const QStringList &paths)
-{
- createAndProcessAction(ActionRemoveFromTrash, paths);
-}
-
-
-void FileSystemAction::createTrashInfoFileFromEntry(ActionEntry *entry)
-{
- QTrashUtilInfo trashUtil;
- trashUtil.setInfoFromTrashItem(entry->itemPaths.target());
- if (!trashUtil.createTrashInfoFile(entry->itemPaths.source()))
- {
- m_cancelCurrentAction = true;
- m_errorTitle = QObject::tr("Could not create trash info file");
- m_errorMsg = trashUtil.absInfo;
- }
-}
-
-
-void FileSystemAction::removeTrashInfoFileFromEntry(ActionEntry *entry)
-{
- QTrashUtilInfo trashUtil;
- trashUtil.setInfoFromTrashItem(entry->itemPaths.source());
- if (!trashUtil.removeTrashInfoFile())
- {
- m_cancelCurrentAction = true;
- m_errorTitle = QObject::tr("Could not remove the trash info file");
- m_errorMsg = trashUtil.absInfo;
- }
-}
-
-
-void FileSystemAction::notifyActionOnItem(const DirItemInfo& item, ActionNotification action)
-{
- switch(action)
- {
- case ItemAdded: emit added(item); break;
- case ItemRemoved: emit removed(item); break;
- case ItemChanged: emit changed(item); break;
- default: break;
- }
-}
-
-
-bool FileSystemAction::canMoveItems(Action *action, const QStringList& items)
-{
- QScopedPointer<DirItemInfo> item(action->targetLocation->newItemInfo(items.at(0)));
- //check if moving items are being moved to the same placce
- if (action->matchLocations() &&
- action->sourceLocation->info()->absoluteFilePath() == item->absolutePath())
- {
- QString titleError = tr("Cannot move items");
- emit error(titleError,
- tr("origin and destination folders are the same"));
- return false;
- }
- //source items need to be removed, check for write permission
- if (!action->sourceLocation->info()->isWritable())
- {
- QString titleError = tr("Cannot move items");
- QString noWriteError = tr("no write permission on folder ");
- emit error(titleError, noWriteError + action->sourceLocation->info()->absoluteFilePath());
- return false;
- }
- //target permission is checked in populateEntry()
- return true;
-}
-
-
-bool FileSystemAction::downloadAsTemporaryFile(const DirItemInfo &remoteFile)
-{
- QFileInfo f(remoteFile.absoluteFilePath());
- QString templateName(QDir::tempPath() + QDir::separator() + QLatin1String("XXXXXX.") + f.completeSuffix());
- QTemporaryFile temp(templateName);
- temp.setAutoRemove(false);
- temp.open();
- temp.close();
-
- return createAndProcessDownloadAction(ActionDownLoadAsTemporary, remoteFile, temp.fileName());
-}
-
-
-bool FileSystemAction::downloadAndSaveAs(const DirItemInfo &remoteFile, const QString &fileName)
-{
- return createAndProcessDownloadAction(ActionDownload, remoteFile, fileName);
-}
-
-
-bool FileSystemAction::createAndProcessDownloadAction(ActionType a, const DirItemInfo &remoteFile, const QString &fileName)
-{
- bool ret = remoteFile.isRemote() && remoteFile.isFile() && remoteFile.exists();
- if (ret) //it can be empty
- {
- //check if there is enough space to download the file
- if (!m_locationsFactory->getDiskLocation()->isThereDiskSpace(fileName, remoteFile.size()))
- {
- ret = false;
- m_errorTitle = QObject::tr("There is no space to download");
- m_errorMsg = fileName;
- }
- }
- //peform the copy
- if (ret)
- {
- Action * actionCopy = createAction(a, remoteFile.absoluteFilePath());
- ActionPaths pairPaths;
- QFileInfo info(fileName);
- pairPaths.setSource(remoteFile.absoluteFilePath());
- pairPaths.setTargetPathOnly(info.absolutePath());
- addEntry(actionCopy, pairPaths);
- ActionEntry *entry = actionCopy->entries.at(0);
- //it is necessary to se the name, otherwise it copies with same name
- entry->newName = new QString(info.fileName());
- queueAction(actionCopy);
- }
- return ret;
-}
=== removed file 'src/plugin/folderlistmodel/filesystemaction.h'
--- src/plugin/folderlistmodel/filesystemaction.h 2015-11-02 15:46:08 +0000
+++ src/plugin/folderlistmodel/filesystemaction.h 1970-01-01 00:00:00 +0000
@@ -1,266 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2013 Canonical Ltd.
- * Copyright 2013 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- *
- * File: filesystemaction.h
- * Date: 3/13/2013
- */
-
-#ifndef FILESYSTEMACTION_H
-#define FILESYSTEMACTION_H
-
-#include "diriteminfo.h"
-
-#include <QObject>
-#include <QVector>
-
-/*!
- * used to inform any view that an item has been updated under a copy process
- * every amount of bytes saved it emits a signal with the current file information
- */
-#define AMOUNT_COPIED_TO_REFRESH_ITEM_INFO 50000000
-
-class DirModelMimeData;
-class LocationItemFile;
-class QTemporaryFile;
-class Location;
-class LocationsFactory;
-
-/*!
- * \brief The FileSystemAction class does file system operations copy/cut/paste/remove items
- *
- * Implementation:
- * --------------
- * Remove and Paste (from either Copy or Cut) operations are performed by creating a list of items and putting this list
- * inside a \ref Action data structure. Each item is an \ref ActionEntry, if this item is a directory this ActionEntry will
- * will be expanded to have the whole directory content recursively, so before performing an Action the whole list of items
- * are built.
- * After an item be performed (an \ref ActionEntry) the \ref endCurrentAction() emits signals of:
- * \ref progress(), \ref added() and \ref removed() or \ref changed() for cases where an item is overwritten.
- * These signals are also emitted when processing a such number of files inside an entry, in the case an entry is
- * a directory, the define \ref STEP_FILES is used for that.
- *
- * It is a single thread processing, some slots are used to work a little and then they are scheduled to continue
- * working in the next main loop interaction, this flow is controlled by:
- * \li \ref processAction() -> starts an \ref Action
- * \li \ref processActionEntry() -> starts an \ref ActionEntry
- * \li \ref endActionEntry() -> ends an \ref ActionEntry
- * \li \ref processCopyEntry() -> starts an \ref copy from an \ref ActionEntry
- * \li \ref processCopySingleFile() -> perform single file copy, it may have many interactions if the file is big,
- * each interaction it writes (4KB * STEP_FILES) and emit \ref progress() signal
- * and schedules itself for next write or \ref processCopyEntry() if it has already
- * finished.
- *
- * Behavior:
- * ---------
- * \li Paste operations are made as single move using QFile::rename()
- * \li After pasting from a Cut operation, if no other application has changed the clipboard,
- * the destination becomes source in the clipboard as Copy for further paste operations
- * \li Pasting in the same place where Cut was made is not allowed, an \ref error() signal is emitted
- * \li Pasting in the same place where Copy was made causes an automatic rename to identify it as backuped item
- * \li Paste from Copy when the destination already exists: individual files are overwritten
- * and both signals \ref added() and \ref removed() are emitted, directories are not touched.
- * \li Paste from Cut when the destination already exists: existent items (files or directories) are removed first,
- * directories are removed in a special way, they are first moved to a temporary area and then scheduled to be removed later
- * by creating an auxiliary Remove \ref Action, see \ref moveDirToTempAndRemoveItLater().
- */
-class FileSystemAction : public QObject
-{
- Q_OBJECT
-public:
- explicit FileSystemAction(LocationsFactory *locationsFactory, QObject *parent = 0);
- ~FileSystemAction();
-
-public:
- bool isBusy() const;
- int getProgressCounter() const;
-
-public slots:
- void cancel();
- void remove(const QStringList & filePaths);
- void pathChanged(const QString& path);
- void copyIntoCurrentPath(const QStringList& items);
- void moveIntoCurrentPath(const QStringList& items);
- void moveToTrash(const ActionPathList& pairPaths );
- void restoreFromTrash(const ActionPathList& pairPaths);
- void removeFromTrash(const QStringList& paths);
- void onClipboardChanged();
- bool downloadAndSaveAs(const DirItemInfo& remoteFile, const QString& fileName);
- bool downloadAsTemporaryFile(const DirItemInfo& remoteFile);
-
-signals:
- void error(const QString& errorTitle, const QString &errorMessage);
- void removed(const DirItemInfo&);
- void added(const DirItemInfo& );
- void changed(const DirItemInfo&);
- void progress(int curItem, int totalItems, int percent);
- void recopy(const QStringList &names, const QString& path);
- void downloadTemporaryComplete(const QString&);
-
-private slots:
- void processAction();
- void processActionEntry();
- void processCopyEntry();
- bool processCopySingleFile();
-
- private:
- enum ActionNotification
- {
- ItemAdded,
- ItemRemoved,
- ItemChanged
- };
-
- enum ActionType
- {
- ActionRemove,
- ActionCopy,
- ActionMove,
- ActionHardMoveCopy,
- ActionHardMoveRemove,
- ActionMoveToTrash,
- ActionRestoreFromTrash,
- ActionRemoveFromTrash,
- ActionDownload,
- ActionDownLoadAsTemporary
- };
-
- void createAndProcessAction(ActionType actionType, const QStringList& paths);
-
- struct CopyFile
- {
- public:
- CopyFile();
- ~CopyFile();
- void clear();
- qint64 bytesWritten; // set 0 when reach bytesToNotify, notify progress
- LocationItemFile * source;
- LocationItemFile * target;
- QString targetName;
- bool isEntryItem; //true when the file being copied is at toplevel of the copy/cut operation
- qint64 amountSavedToRefresh;
- };
-
- /*!
- An ActionEntry represents a high level item as a File or a Directory which an Action is required
-
- For directories \a reversedOrder keeps all children
- */
- struct ActionEntry
- {
- public:
- ActionEntry();
- ~ActionEntry();
- void init();
- void reset();
- ActionPaths itemPaths; //!< identifies the item being handled source and destination
- ActionType type;
- QList<DirItemInfo> reversedOrder; //!< last item must be the item from the list
- int currStep;
- int currItem;
- QString * newName; //TODO: allow to rename an existent file when it already exists.
- // So far it is possible to backup items when copy/paste in the
- // same place, in this case it is renamed to "<name> Copy (%d).termination"
- bool added :1; //!< signal added() already emitted for the current ActionEntry
- bool alreadyExists :1;
- };
-
- struct Action
- {
- public:
- Action();
- ~Action();
- void reset();
- void toggleLocation();
- bool matchLocations() const;
- bool isRemote() const;
- ActionType type;
- QList<ActionEntry*> entries;
- int totalItems;
- int currItem;
- quint64 totalBytes;
- quint64 bytesWritten;
- int currEntryIndex;
- ActionEntry * currEntry;
- CopyFile copyFile;
- Action * auxAction;
- bool isAux :1;
- bool done :1;
- int steps;
- Location * sourceLocation;
- Location * targetLocation;
-
- };
-
- QVector<Action*> m_queuedActions; //!< work always at item 0, after finishing taking item 0 out
- Action * m_curAction;
- bool m_cancelCurrentAction;
- bool m_busy;
- QString m_path;
-
- QString m_errorTitle;
- QString m_errorMsg;
- bool m_clipboardChanged; //!< this is set to false in \ref moveIntoCurrentPath() and \ref copyIntoCurrentPath();
- LocationsFactory * m_locationsFactory;
-
-
-private:
- Action * createAction(ActionType, const QString& pathUrl);
- void addEntry(Action* action, const ActionPaths& pairPaths);
- bool populateEntry(Action* action, ActionEntry* entry);
- void removeEntry(ActionEntry *);
- void moveEntry(ActionEntry *entry);
- bool moveUsingSameFileSystem(const ActionPaths &movedItem);
- QString targetFrom(const QString& origItem, ActionEntry * entry);
- void endCurrentAction();
- int percentWorkDone();
- int notifyProgress(int forcePercent = 0);
- void endActionEntry();
- bool copySymLink(const QString& target, const QFileInfo& orig);
- void scheduleSlot(const char *slot);
- void moveDirToTempAndRemoveItLater(const QString& dir);
- bool makeBackupNameForCurrentItem(ActionEntry *entry);
- bool endCopySingleFile();
- void queueAction(Action *myAction);
- void createTrashInfoFileFromEntry(ActionEntry *entry);
- void removeTrashInfoFileFromEntry(ActionEntry *entry);
- void notifyActionOnItem(const DirItemInfo& item, ActionNotification action);
- bool canMoveItems(Action *action, const QStringList &items);
- bool createAndProcessDownloadAction(ActionType a, const DirItemInfo& remoteFile, const QString& fileName);
-
-#if defined(REGRESSION_TEST_FOLDERLISTMODEL) //used in Unit/Regression tests
- bool m_forceUsingOtherFS;
- friend class TestDirModel;
-#endif
-};
-
-
-#endif // FILESYSTEMACTION_H
=== removed file 'src/plugin/folderlistmodel/fmutil.cpp'
--- src/plugin/folderlistmodel/fmutil.cpp 2014-01-29 16:31:04 +0000
+++ src/plugin/folderlistmodel/fmutil.cpp 1970-01-01 00:00:00 +0000
@@ -1,132 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: fmutil.cpp
- * Date: 29/01/2014
- */
-
-#include "fmutil.h"
-
-#include <QIcon>
-#include <QFileInfo>
-#include <QDir>
-#include <QDebug>
-
-bool FMUtil::m_triedThemeName = false;
-
-FMUtil::FMUtil()
-{
-}
-
-
-/*!
- * \brief FMUtil::setThemeName() tries to set a theme name in order to get icons
- */
-void FMUtil::setThemeName()
-{
- QString name;
- //set saying we have tried to set ThemeName
- m_triedThemeName = true;
- QLatin1String ubuntu_mobileTheme("ubuntu-mobile");
- QStringList paths(QIcon::themeSearchPaths());
-#if defined(Q_OS_UNIX)
- if (paths.isEmpty())
- {
- paths.append(QLatin1String("/usr/share/icons"));
- }
-#endif
- foreach (const QString& dir, paths)
- {
- QDir D(dir);
- if (D.exists())
- {
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "trying theme on Dir" << D.path();
-#endif
- QFileInfoList inf = D.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::System );
- int counter = inf.count();
- //specific names
- while (counter--)
- {
- if (inf.at(counter).fileName() == ubuntu_mobileTheme)
- {
- if (testThemeName(ubuntu_mobileTheme))
- {
- return;
- }
- else
- {
- inf.removeAt(counter);
- }
- }
- }
- //try symlinks
- counter = inf.count();
- while (counter--)
- {
- if (inf.at(counter).isSymLink())
- {
- if (testThemeName(inf.at(counter).fileName()))
- {
- return;
- }
- else
- {
- inf.removeAt(counter);
- }
- }
- }
- //try common directories
- counter = inf.count();
- while (counter--)
- {
- if (testThemeName(inf.at(counter).fileName()))
- {
- return;
- }
- }
- }
- }
- name.clear();
- QIcon::setThemeName(name);
-}
-
-
-bool FMUtil::testThemeName(const QString& themeName)
-{
- QMimeDatabase mimeBase;
- QStringList mimesToTest = QStringList()
- << "text/plain"
- << "inode/directory"
- << "application/pdf"
- << "application/postscript"
- << "application/x-gzip";
-
- QIcon::setThemeName(themeName);
- bool hasTheme = true;
- int counter = mimesToTest.count();
- while(hasTheme && counter--)
- {
- QMimeType mimetype = mimeBase.mimeTypeForName(mimesToTest.at(counter));
- hasTheme = QIcon::hasThemeIcon( mimetype.iconName() ) ||
- QIcon::hasThemeIcon( mimetype.genericIconName() ) ;
- }
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "trying theme name" << themeName << "ret=" << hasTheme;
-#endif
- return hasTheme;
-}
=== removed file 'src/plugin/folderlistmodel/fmutil.h'
--- src/plugin/folderlistmodel/fmutil.h 2014-01-29 16:31:04 +0000
+++ src/plugin/folderlistmodel/fmutil.h 1970-01-01 00:00:00 +0000
@@ -1,46 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: fmutil.h
- * Date: 29/01/2014
- */
-
-#ifndef FMUTIL_H
-#define FMUTIL_H
-
-#include <QStringList>
-#include <QMimeType>
-#include <QMimeDatabase>
-
-/*!
- * \brief The FMUtil class provides some utitlities
- */
-class FMUtil
-{
-public:
- static void setThemeName();
- static inline bool hasTriedThemeName() { return m_triedThemeName; }
-
-private:
- FMUtil();
- static bool testThemeName(const QString& themeName);
-
-private:
- static bool m_triedThemeName;
-};
-
-#endif // FMUTIL_H
=== removed file 'src/plugin/folderlistmodel/folderlistmodel.pri'
--- src/plugin/folderlistmodel/folderlistmodel.pri 2015-12-12 14:40:30 +0000
+++ src/plugin/folderlistmodel/folderlistmodel.pri 1970-01-01 00:00:00 +0000
@@ -1,99 +0,0 @@
-SOURCES += $$PWD/dirmodel.cpp \
- $$PWD/iorequest.cpp \
- $$PWD/iorequestworker.cpp \
- $$PWD/ioworkerthread.cpp \
- $$PWD/filesystemaction.cpp \
- $$PWD/filecompare.cpp \
- $$PWD/externalfswatcher.cpp \
- $$PWD/clipboard.cpp \
- $$PWD/fmutil.cpp \
- $$PWD/dirselection.cpp \
- $$PWD/diriteminfo.cpp \
- $$PWD/urliteminfo.cpp \
- $$PWD/location.cpp \
- $$PWD/locationsfactory.cpp \
- $$PWD/locationurl.cpp \
- $$PWD/locationitemdiriterator.cpp \
- $$PWD/cleanurl.cpp \
- $$PWD/locationitemfile.cpp \
- $$PWD/locationitemdir.cpp \
- $$PWD/networklocation.cpp \
- $$PWD/networklistworker.cpp
-
-HEADERS += $$PWD/dirmodel.h \
- $$PWD/iorequest.h \
- $$PWD/iorequestworker.h \
- $$PWD/ioworkerthread.h \
- $$PWD/filesystemaction.h \
- $$PWD/filecompare.h \
- $$PWD/externalfswatcher.h \
- $$PWD/clipboard.h \
- $$PWD/fmutil.h \
- $$PWD/dirselection.h \
- $$PWD/diritemabstractlistmodel.h \
- $$PWD/diriteminfo.h \
- $$PWD/urliteminfo.h \
- $$PWD/location.h \
- $$PWD/locationsfactory.h \
- $$PWD/locationurl.h \
- $$PWD/locationitemdiriterator.h \
- $$PWD/cleanurl.h \
- $$PWD/locationitemfile.h \
- $$PWD/locationitemdir.h \
- $$PWD/networklocation.h \
- $$PWD/networklistworker.h
-
-
-SOURCES += $$PWD/disk/disklocation.cpp \
- $$PWD/disk/disklocationitemdiriterator.cpp \
- $$PWD/disk/disklocationitemfile.cpp \
- $$PWD/disk/disklocationitemdir.cpp
-
-HEADERS += $$PWD/disk/disklocation.h \
- $$PWD/disk/disklocationitemdiriterator.h \
- $$PWD/disk/disklocationitemfile.h \
- $$PWD/disk/disklocationitemdir.h
-
-
-SOURCES += $$PWD/trash/qtrashdir.cpp \
- $$PWD/trash/trashiteminfo.cpp \
- $$PWD/trash/qtrashutilinfo.cpp \
- $$PWD/trash/trashlocation.cpp
-
-HEADERS += $$PWD/trash/qtrashdir.h \
- $$PWD/trash/trashiteminfo.h \
- $$PWD/trash/qtrashutilinfo.h \
- $$PWD/trash/trashlocation.h
-
-SOURCES += $$PWD/smb/smblocation.cpp \
- $$PWD/smb/smblocationauthentication.cpp \
-
-
-HEADERS += $$PWD/smb/smblocation.h \
- $$PWD/smb/smblocationauthentication.h \
-
-
-include ($$PWD/smb/qsambaclient/qsambaclient.pri)
-
-SOURCES += $$PWD/net/netutil.cpp \
- $$PWD/net/netauthenticationdata.cpp
-
-HEADERS += $$PWD/net/netutil.h \
- $$PWD/net/netauthenticationdata.h
-
-INCLUDEPATH += $$PWD $$PWD/trash $$PWD/disk $$PWD/smb $$PWD/net
-
-
-greaterThan(QT_MAJOR_VERSION, 4) {
- QT += qml
-}
-else {
- QT += declarative
-}
-
-
-!contains (DEFINES, DO_NOT_USE_TAG_LIB) {
- LIBS += -ltag
- SOURCES += $$PWD/imageprovider.cpp
- HEADERS += $$PWD/imageprovider.h
-}
=== removed file 'src/plugin/folderlistmodel/folderlistmodel.pro'
--- src/plugin/folderlistmodel/folderlistmodel.pro 2014-06-25 21:56:09 +0000
+++ src/plugin/folderlistmodel/folderlistmodel.pro 1970-01-01 00:00:00 +0000
@@ -1,35 +0,0 @@
-TARGET = nemofolderlistmodel
-
-PLUGIN_IMPORT_PATH = org/nemomobile/folderlistmodel
-
-#core: sources + headers, separated here to use in regression test project
-include (folderlistmodel.pri)
-
-# Input
-SOURCES += plugin.cpp
-HEADERS += plugin.h
-
-## QApplication::clipboard() needs gui
-QT += gui
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
-
-exists(../plugin.pri) {
- include(../plugin.pri)
-}
-else {
- TEMPLATE = lib
- CONFIG += qt plugin hide_symbols
- greaterThan(QT_MAJOR_VERSION, 4) {
- QT += qml quick
- }
- else {
- QT += declarative
- }
- target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH
- INSTALLS += target
- qmldir.files += $$PWD/qmldir
- qmldir.path += $$[QT_INSTALL_QML]/$$$$PLUGIN_IMPORT_PATH
- INSTALLS += qmldir
-}
-
-
=== removed file 'src/plugin/folderlistmodel/imageprovider.cpp'
--- src/plugin/folderlistmodel/imageprovider.cpp 2014-02-07 13:22:44 +0000
+++ src/plugin/folderlistmodel/imageprovider.cpp 1970-01-01 00:00:00 +0000
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "imageprovider.h"
-
-#ifndef DO_NOT_USE_TAG_LIB
-#include <taglib/attachedpictureframe.h>
-#include <taglib/id3v2tag.h>
-#include <taglib/mpegfile.h>
-#endif
-
-#include <QQmlEngine>
-#include <QtGlobal>
-#include <QPainter>
-
-
-CoverArtImageProvider::CoverArtImageProvider() : QQuickImageProvider(QQuickImageProvider::Image) {}
-
-QImage CoverArtImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
-{
- Q_UNUSED(size);
- Q_UNUSED(requestedSize);
- QImage img;
-#ifndef DO_NOT_USE_TAG_LIB
- TagLib::MPEG::File mp3(id.toStdString().c_str(), true, TagLib::MPEG::Properties::Fast);
- TagLib::ID3v2::FrameList list = mp3.ID3v2Tag()->frameListMap()["APIC"];
- if(!list.isEmpty()) {
- TagLib::ID3v2::AttachedPictureFrame *Pic = static_cast<TagLib::ID3v2::AttachedPictureFrame *>(list.front());
- img.loadFromData((const uchar *) Pic->picture().data(), Pic->picture().size());
- img = img.scaled(45,45);
- }
-#endif
- return img;
-}
-
-
-CoverArtFullImageProvider::CoverArtFullImageProvider() : QQuickImageProvider(QQuickImageProvider::Image) {}
-
-QImage CoverArtFullImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
-{
- Q_UNUSED(size);
- Q_UNUSED(requestedSize);
- QImage img;
-#ifndef DO_NOT_USE_TAG_LIB
- TagLib::MPEG::File mp3(id.toStdString().c_str(), true, TagLib::MPEG::Properties::Fast);
- TagLib::ID3v2::FrameList list = mp3.ID3v2Tag()->frameListMap()["APIC"];
- if(!list.isEmpty()) {
- TagLib::ID3v2::AttachedPictureFrame *Pic = static_cast<TagLib::ID3v2::AttachedPictureFrame *>(list.front());
- img.loadFromData((const uchar *) Pic->picture().data(), Pic->picture().size());
- img = img.scaled(300,300);
- }
-#endif
- return img;
-}
-
-
=== removed file 'src/plugin/folderlistmodel/imageprovider.h'
--- src/plugin/folderlistmodel/imageprovider.h 2014-02-07 13:22:44 +0000
+++ src/plugin/folderlistmodel/imageprovider.h 1970-01-01 00:00:00 +0000
@@ -1,29 +0,0 @@
-#ifndef IMAGEPROVIDER_H
-#define IMAGEPROVIDER_H
-
-#include <QtGlobal>
-
-#include <QQuickImageProvider>
-#include <QImage>
-
-
-class CoverArtImageProvider : public QQuickImageProvider
-{
-public:
- explicit CoverArtImageProvider();
-
- QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize);
-
-};
-
-class CoverArtFullImageProvider : public QQuickImageProvider
-{
-public:
- explicit CoverArtFullImageProvider();
-
- QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize);
-
-};
-
-
-#endif // IMAGEPROVIDER_H
=== removed file 'src/plugin/folderlistmodel/iorequest.cpp'
--- src/plugin/folderlistmodel/iorequest.cpp 2015-12-08 16:55:41 +0000
+++ src/plugin/folderlistmodel/iorequest.cpp 1970-01-01 00:00:00 +0000
@@ -1,321 +0,0 @@
-/*
- * Copyright (C) 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- */
-
-#include "iorequest.h"
-#include "qtrashutilinfo.h"
-#include "diriteminfo.h"
-#include "trashiteminfo.h"
-
-#include <QDirIterator>
-#include <QDebug>
-
-#ifdef DEBUG_MESSAGES
-#include <QDateTime>
-#include <QThread>
-#endif
-
-IORequest::IORequest() : QObject(), m_type(DirList)
-{
-}
-
-IORequest::~IORequest()
-{
-
-}
-
-IORequest::RequestType IORequest::type() const
-{
- return m_type;
-}
-
-//----------------------------------------------------------------------------------
-IORequestLoader::IORequestLoader(const QString &pathName,
- QDir::Filters filter,
- bool isRecursive)
- : IORequest()
- , mLoaderType(NormalLoader)
- , mPathName(pathName)
- , mFilter(filter)
- , mIsRecursive(isRecursive)
-{
-}
-
-IORequestLoader::IORequestLoader(const QString& trashRootDir,
- const QString &pathName,
- QDir::Filters filter,
- bool isRecursive)
- : IORequest()
- , mLoaderType(TrashLoader)
- , mPathName(pathName)
- , mFilter(filter)
- , mIsRecursive(isRecursive)
- , mTtrashRootDir(trashRootDir)
-{
-
-}
-
-IORequestLoader::~IORequestLoader()
-{
-
-}
-
-DirItemInfoList IORequestLoader::getContents()
-{
- DirItemInfoList list;
- switch(mLoaderType)
- {
- case NormalLoader: list = getNormalContent(); break;
- case TrashLoader: list = getTrashContent(); break;
- case NetworkLoader: list = getNetworkContent(); break;
- }
- return list;
-}
-
-DirItemInfoList IORequestLoader::getNormalContent()
-{
-#if DEBUG_EXT_FS_WATCHER
- qDebug() << "[exfsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz")
- << Q_FUNC_INFO;
-#endif
- DirItemInfoList directoryContents;
- directoryContents = add(mPathName, mFilter, mIsRecursive, directoryContents);
- return directoryContents;
-}
-
-DirItemInfoList IORequestLoader::add(const QString &pathName,
- QDir::Filters filter,
- bool isRecursive,
- DirItemInfoList directoryContents)
-{
- QDir tmpDir = QDir(pathName, QString(), QDir::NoSort, filter);
- QDirIterator it(tmpDir);
- while (it.hasNext()) {
- it.next();
- if(it.fileInfo().isDir() && isRecursive) {
- directoryContents = add(it.fileInfo().filePath(),
- filter, isRecursive, directoryContents);
- } else {
- directoryContents.append(DirItemInfo(it.fileInfo()));
- }
- }
- return directoryContents;
-}
-
-DirItemInfoList IORequestLoader::getTrashContent()
-{
- DirItemInfoList directoryContents;
- QTrashUtilInfo trashInfo;
- QDir tmpDir = QDir(mPathName, QString(), QDir::NoSort, mFilter);
- bool isTopLevel = QFileInfo(mPathName).absolutePath() == mTtrashRootDir;
- QDirIterator it(tmpDir);
- while (it.hasNext())
- {
- it.next();
- trashInfo.setInfo(mTtrashRootDir, it.fileInfo().absoluteFilePath());
- if (!isTopLevel || (isTopLevel && trashInfo.existsInfoFile() && trashInfo.existsFile()) )
- {
- //TODO read the trashinfo file and set it into a display field
- // the display field can be a string the usally points to absoluteFilePath()
- // it would be used only in the DirModel::data()
- TrashItemInfo item(QTrashUtilInfo::filesTrashDir(mTtrashRootDir),
- it.fileInfo().absoluteFilePath());
- directoryContents.append(item);
- }
- }
- return directoryContents;
-}
-
-
-DirItemInfoList IORequestLoader::getNetworkContent()
-{
- DirItemInfoList emptyContent;
- return emptyContent;
-}
-
-
-
-//-----------------------------------------------------------------------------------------------
-DirListWorker::DirListWorker(const QString &pathName,QDir::Filters filter, const bool isRecursive)
- : IORequestLoader(pathName, filter, isRecursive)
-{
-
-}
-
-
-DirListWorker::DirListWorker(const QString& trashRootDir, const QString &pathName,QDir::Filters filter, const bool isRecursive)
- : IORequestLoader(trashRootDir, pathName, filter, isRecursive)
-{
-
-}
-
-DirListWorker::~DirListWorker()
-{
-
-}
-
-void DirListWorker::run()
-{
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "Running on: " << QThread::currentThreadId();
-#endif
-
- DirItemInfoList directoryContents = getContents();
-
- // last batch
- emit itemsAdded(directoryContents);
- emit workerFinished();
-}
-
-
-
-
-//-------------------------------------------------------------------------------------
-TrashListWorker::TrashListWorker(const QString& trashRoot, const QString &path,QDir::Filters filter)
- : DirListWorker(trashRoot, path, filter, false)
-{
- mLoaderType = TrashLoader;
-}
-
-TrashListWorker::~TrashListWorker()
-{
-
-}
-
-//---------------------------------------------------------------------------------------------------------
-ExternalFileSystemChangesWorker::ExternalFileSystemChangesWorker(const DirItemInfoList &content,
- const QString &pathName,
- QDir::Filters filter,
- const bool isRecursive)
- : IORequestLoader(pathName, filter, isRecursive)
-
-{
- m_type = DirListExternalFSChanges;
- int counter = content.count();
- while (counter--)
- {
- m_curContent.insert( content.at(counter).absoluteFilePath(), content.at(counter) );
- }
-}
-
-
-ExternalFileSystemChangesWorker::~ExternalFileSystemChangesWorker()
-{
-
-}
-
-int ExternalFileSystemChangesWorker::compareItems(const DirItemInfoList& contentNew)
-{
- int addedCounter=0;
- int removedCounter=0;
-#if DEBUG_EXT_FS_WATCHER
- qDebug() << "[exfsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz")
- << Q_FUNC_INFO
- << "m_curContent.count():" << m_curContent.count()
- << "contentNew.count():" << contentNew.count();
-#endif
- int counter = contentNew.count();
- if (counter > 0)
- {
- int tmpCounter = counter;
- while (tmpCounter--)
- {
- const DirItemInfo& originalItem = contentNew.at(tmpCounter);
- const DirItemInfo existItem = m_curContent.value(originalItem.absoluteFilePath());
- if ( existItem.exists() )
- {
- //it may have changed
- if ( originalItem.size() != existItem.size()
- || originalItem.lastModified() != existItem.lastModified()
- || originalItem.permissions() != existItem.permissions()
- )
- {
- emit changed(originalItem);
- }
- //remove this item
- m_curContent.remove(originalItem.absoluteFilePath());
- }
- else // originalItem was added
- {
- emit added(originalItem);
- ++addedCounter;
- }
- }
-
- QHash<QString, DirItemInfo>::iterator i = m_curContent.begin();
- for ( ; i != m_curContent.end(); ++removedCounter, ++i )
- {
- emit removed(i.value());
- }
- }
-#if DEBUG_EXT_FS_WATCHER
- qDebug() << "[exfsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz")
- << Q_FUNC_INFO
- << "addedCounter:" << addedCounter
- << "removedCounter:" << removedCounter;
-#endif
-
- return counter;
-}
-
-void ExternalFileSystemChangesWorker::run()
-{
- DirItemInfoList directoryContents = getContents();
- int remainingitemsCounter = compareItems(directoryContents);
- emit finished(remainingitemsCounter);
-}
-
-
-//---------------------------------------------------------------------
-ExternalFileSystemTrashChangesWorker::ExternalFileSystemTrashChangesWorker(const QStringList &pathNames,
- const DirItemInfoList &list,
- QDir::Filters filter)
- : ExternalFileSystemChangesWorker(list, pathNames.at(0), filter, false)
- , m_pathList(pathNames)
-{
- mLoaderType = TrashLoader;
-}
-
-ExternalFileSystemTrashChangesWorker::~ExternalFileSystemTrashChangesWorker()
-{
-
-}
-
-void ExternalFileSystemTrashChangesWorker::run()
-{
- DirItemInfoList directoryContents;
- for(int counter = 0; counter < m_pathList.count(); counter++)
- {
- mPathName = QTrashUtilInfo::filesTrashDir(m_pathList.at(counter));
- directoryContents += getContents();
- }
- int remainingitemsCounter = compareItems(directoryContents);
- emit finished(remainingitemsCounter);
-}
=== removed file 'src/plugin/folderlistmodel/iorequest.h'
--- src/plugin/folderlistmodel/iorequest.h 2015-12-08 16:55:41 +0000
+++ src/plugin/folderlistmodel/iorequest.h 1970-01-01 00:00:00 +0000
@@ -1,178 +0,0 @@
-/*
- * Copyright (C) 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- */
-
-#ifndef IOREQUEST_H
-#define IOREQUEST_H
-
-#include "diriteminfo.h"
-
-#include <QHash>
-#include <QDir>
-
-class IORequest : public QObject
-{
- Q_OBJECT
-public:
- explicit IORequest();
- virtual ~IORequest();
-
-public:
- enum RequestType
- {
- DirList,
- DirListExternalFSChanges,
- SambaList
- };
- virtual void run() = 0;
- RequestType type() const;
-
-private:
- // hide this because IORequest should *NOT* be parented directly
- using QObject::setParent;
-
-protected:
- RequestType m_type;
-};
-
-
-
-class IORequestLoader : public IORequest
-{
- Q_OBJECT
-public:
- enum LoaderType
- {
- NormalLoader,
- TrashLoader,
- NetworkLoader
- };
-
- IORequestLoader( const QString &pathName,
- QDir::Filters filter,
- bool isRecursive
- );
- IORequestLoader( const QString& trashRootDir,
- const QString &pathName,
- QDir::Filters filter,
- bool isRecursive
- );
- virtual ~IORequestLoader();
- DirItemInfoList getContents();
-
-signals:
- void itemsAdded(const DirItemInfoList &files);
-
-private:
- DirItemInfoList getNormalContent();
- DirItemInfoList getTrashContent();
- virtual DirItemInfoList getNetworkContent();
- DirItemInfoList add(const QString &pathName, QDir::Filters filter,
- bool isRecursive, DirItemInfoList directoryContents);
-protected:
- LoaderType mLoaderType;
- QString mPathName;
- QDir::Filters mFilter;
- bool mIsRecursive;
- QString mTtrashRootDir;
-};
-
-
-
-
-class DirListWorker : public IORequestLoader
-{
- Q_OBJECT
-public:
- explicit DirListWorker(const QString &pathName, QDir::Filters filter, const bool isRecursive);
- explicit DirListWorker(const QString& trashRootDir, const QString &pathName, QDir::Filters filter, const bool isRecursive);
- virtual ~DirListWorker();
- void run();
-protected:
-signals:
- void workerFinished();
-
-};
-
-
-
-
-class TrashListWorker : public DirListWorker
-{
- Q_OBJECT
-public:
- explicit TrashListWorker(const QString &trashRoot, const QString& path, QDir::Filters filter);
- virtual ~TrashListWorker();
-};
-
-
-
-class ExternalFileSystemChangesWorker : public IORequestLoader
-{
- Q_OBJECT
-public:
- explicit ExternalFileSystemChangesWorker(const DirItemInfoList& content,
- const QString &pathName,
- QDir::Filters filter,
- const bool isRecursive);
- virtual ~ExternalFileSystemChangesWorker();
- void run();
-
-protected:
- int compareItems(const DirItemInfoList& contentNew);
-
-signals:
- void removed(const DirItemInfo&);
- void changed(const DirItemInfo&);
- void added(const DirItemInfo& );
- void finished(int);
-private:
- QHash<QString, DirItemInfo> m_curContent; //!< using hash because the vector can be in any order
-};
-
-
-
-class ExternalFileSystemTrashChangesWorker : public ExternalFileSystemChangesWorker
-{
- Q_OBJECT
-
-public:
- ExternalFileSystemTrashChangesWorker(const QStringList& pathNames,
- const DirItemInfoList& list,
- QDir::Filters filter);
- virtual ~ExternalFileSystemTrashChangesWorker();
- void run();
-private:
- QStringList m_pathList;
-};
-
-
-
-#endif // IOREQUEST_H
=== removed file 'src/plugin/folderlistmodel/iorequestworker.cpp'
--- src/plugin/folderlistmodel/iorequestworker.cpp 2013-10-12 19:25:17 +0000
+++ src/plugin/folderlistmodel/iorequestworker.cpp 1970-01-01 00:00:00 +0000
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- */
-
-#include "iorequestworker.h"
-#include "iorequest.h"
-
-#include <QMutexLocker>
-#include <QDateTime>
-#include <QDebug>
-
-/*!
- Lives on an IOWorkerThread.
-
- Responsible for running IORequest jobs on the thread instance, and
- disposing of their resources once they are done.
- */
-IORequestWorker::IORequestWorker()
- : QThread()
- , mTimeToQuit(false)
-{
-}
-
-void IORequestWorker::addRequest(IORequest *request)
-{
-#if DEBUG_EXT_FS_WATCHER
- qDebug() << "[exfsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz")
- << Q_FUNC_INFO;
-#endif
-
- request->moveToThread(this);
-
- // TODO: queue requests so we run the most important one first
- QMutexLocker lock(&mMutex);
- mRequests.append(request);
-
- // wake run()
- mWaitCondition.wakeOne();
-}
-
-void IORequestWorker::run()
-{
- forever {
- QMutexLocker lock(&mMutex);
-
- if (mTimeToQuit)
- return;
-
- if (mRequests.empty())
- mWaitCondition.wait(&mMutex);
-
- while (!mRequests.isEmpty()) {
- IORequest *request = mRequests.takeFirst();
-
- lock.unlock();
-
- request->run();
- request->deleteLater();
- lock.relock();
- }
- }
-}
-
-
-void IORequestWorker::exit()
-{
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "Quitting";
-#endif
- QMutexLocker lock(&mMutex);
- mTimeToQuit = true;
- mWaitCondition.wakeOne();
-}
=== removed file 'src/plugin/folderlistmodel/iorequestworker.h'
--- src/plugin/folderlistmodel/iorequestworker.h 2013-10-12 19:25:17 +0000
+++ src/plugin/folderlistmodel/iorequestworker.h 1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- */
-
-#ifndef IOREQUESTWORKER_H
-#define IOREQUESTWORKER_H
-
-#include <QObject>
-#include <QThread>
-#include <QMutex>
-#include <QWaitCondition>
-
-#include "iorequest.h"
-
-class IORequestWorker : public QThread
-{
- Q_OBJECT
-public:
- explicit IORequestWorker();
-
- void addRequest(IORequest *request);
-
- void run();
-
- void exit();
-
-private:
- QMutex mMutex;
- QWaitCondition mWaitCondition;
- QList<IORequest *> mRequests;
- bool mTimeToQuit;
-};
-
-#endif // IOREQUESTWORKER_H
=== removed file 'src/plugin/folderlistmodel/ioworkerthread.cpp'
--- src/plugin/folderlistmodel/ioworkerthread.cpp 2013-03-10 16:05:09 +0000
+++ src/plugin/folderlistmodel/ioworkerthread.cpp 1970-01-01 00:00:00 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- */
-
-#include "ioworkerthread.h"
-
-
-/*!
- Hosts a thread, lives on the main thread.
-
- Responsible for relaying interaction between the main thread and an IOWorkerThread.
- */
-IOWorkerThread::IOWorkerThread(QObject *parent) :
- QObject(parent)
-{
- mWorker.start(QThread::IdlePriority);
-}
-
-/*!
- Destroys an IOWorkerThread instance.
- */
-IOWorkerThread::~IOWorkerThread()
-{
- mWorker.exit();
- mWorker.wait();
-}
-
-/*!
- Attempts an asynchronous attempt to start a \a request.
-
- If the request may be run, it is queued, and true is returned, otherwise, false.
- */
-bool IOWorkerThread::addRequest(IORequest *request)
-{
- mWorker.addRequest(request);
- return true;
-}
=== removed file 'src/plugin/folderlistmodel/ioworkerthread.h'
--- src/plugin/folderlistmodel/ioworkerthread.h 2013-03-10 16:05:09 +0000
+++ src/plugin/folderlistmodel/ioworkerthread.h 1970-01-01 00:00:00 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2012 Robin Burchell <robin+nemo@xxxxxxxxxxxx>
- *
- * You may use this file under the terms of the BSD license as follows:
- *
- * "Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Nemo Mobile nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
- */
-
-#ifndef IOWORKERTHREAD_H
-#define IOWORKERTHREAD_H
-
-#include <QObject>
-#include <QThread>
-
-#include "iorequestworker.h"
-
-class IOWorkerThread : public QObject
-{
- Q_OBJECT
-public:
- explicit IOWorkerThread(QObject *parent = 0);
- virtual ~IOWorkerThread();
- bool addRequest(IORequest *request);
-
-private:
- IORequestWorker mWorker;
-};
-
-#endif // IOWORKERTHREAD_H
=== removed file 'src/plugin/folderlistmodel/location.cpp'
--- src/plugin/folderlistmodel/location.cpp 2015-12-08 16:55:41 +0000
+++ src/plugin/folderlistmodel/location.cpp 1970-01-01 00:00:00 +0000
@@ -1,331 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: location.cpp
- * Date: 08/03/2014
- */
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: locations.cpp
- * Date: 04/03/2014
- */
-
-#include "location.h"
-#include "ioworkerthread.h"
-#include "netauthenticationdata.h"
-
-#include <QDebug>
-
-Q_GLOBAL_STATIC(IOWorkerThread, ioWorkerThread)
-
-
-Location::Location(int type, QObject *parent)
- : QObject(parent)
- , m_info(0)
- , m_type(type)
- , m_usingExternalWatcher(false)
-{
-
-}
-
-Location::~Location()
-{
- if (m_info)
- {
- delete m_info;
- m_info = 0;
- }
-}
-
-
-bool Location::isRoot() const
-{
- return m_info ? m_info->isRoot() : false;
-}
-
-
-bool Location::isWritable() const
-{
- return m_info ? m_info->isWritable() : false;
-}
-
-
-bool Location::isReadable() const
-{
- return m_info ? m_info->isContentReadable() : false;
-}
-
-void Location::setInfoItem(const DirItemInfo &itemInfo)
-{
- setInfoItem (new DirItemInfo(itemInfo));
-}
-
-void Location::setInfoItem(DirItemInfo *itemInfo)
-{
- if (m_info)
- {
- delete m_info;
- }
- m_info = itemInfo;
-}
-
-
-QString Location::urlPath() const
-{
- return m_info ? m_info->urlPath(): QString();
-}
-
-
-void Location::startWorking()
-{
-
-}
-
-void Location::stopWorking()
-{
-
-}
-
-
-IOWorkerThread * Location::workerThread() const
-{
- return ioWorkerThread();
-}
-
-
-//providing an empty method
-void Location::fetchExternalChanges(const QString &path,
- const DirItemInfoList &list,
- QDir::Filters dirFilter)
-{
- Q_UNUSED(path);
- Q_UNUSED(list);
- Q_UNUSED(dirFilter);
-}
-
-//======================================================================================================
-/*!
- * \brief Location::setUsingExternalWatcher() Default implementation sets nothing
- *
- * It considers that there is no external Watcher
- * \param use
- */
-void Location::setUsingExternalWatcher(bool use)
-{
- Q_UNUSED(use)
- m_usingExternalWatcher = false;
-}
-
-
-/*!
- * \brief Location::setAuthentication()
- *
- * Default implementation does nothing as local disk does not need it
- *
- * Network Locations need to reimplement this
- *
- * \param user
- * \param password
- */
-void Location::setAuthentication(const QString &user,
- const QString &password)
-
-{
- Q_UNUSED(user);
- Q_UNUSED(password);
-}
-
-/*!
- * \brief Location::currentAuthenticationUser()
- *
- * Default implementation returns current user
- *
- * \return
- */
-QString Location::currentAuthenticationUser()
-{
- return NetAuthenticationData::currentUser();
-}
-
-/*!
- * \brief Location::currentAuthenticationPassword()
- *
- * Default implementation returns empty string
- *
- * \return
- */
-QString Location::currentAuthenticationPassword()
-{
- return QString();
-}
-
-/*!
- * \brief Location::notifyItemNeedsAuthentication()
- * \param item
- *
- * \note
- * The connection between Location objects and the \class DirModel is Qt::QueuedConnection
- * It allows a UI to continuosly show dialogs asking the user to provide User and Password
- * to authenticate the current URL
- */
-void Location::notifyItemNeedsAuthentication(const DirItemInfo *item)
-{
- if (item == 0)
- {
- item = m_info;
- }
- if (item != 0)
- {
- emit needsAuthentication(currentAuthenticationUser(), item->urlPath());
- }
-}
-
-
-
-bool Location::useAuthenticationDataIfExists(const DirItemInfo& item)
-{
- NetAuthenticationDataList *authData = NetAuthenticationDataList::getInstance(this);
- const NetAuthenticationData *auth = authData->get(item.authenticationPath());
- bool ret = false;
- if (auth && !( auth->user == currentAuthenticationUser()
- && auth->password == currentAuthenticationPassword()
- )
- )
- {
- setAuthentication(auth->user, auth->password);
- ret = true;
- }
- NetAuthenticationDataList::releaseInstance(this);
- return ret;
-}
-
-
-
-void Location::refreshInfo()
-{
- if (m_info)
- {
- DirItemInfo *item = newItemInfo(m_info->absoluteFilePath());
- delete m_info;
- m_info = item;
- }
-}
-
-
-bool Location::becomeParent()
-{
- bool ret = false;
- if (m_info && !m_info->isRoot())
- {
- DirItemInfo *other = newItemInfo(m_info->absolutePath());
- if (other->isValid())
- {
- delete m_info;
- m_info = other;
- ret = true;
- }
- else
- {
- delete other;
- }
- }
- return ret;
-}
-
-
-DirItemInfo * Location::validateUrlPath(const QString & uPath)
-{
- QString myPath(uPath);
- DirItemInfo * item = newItemInfo(myPath);
- if (item->isRelative() && m_info)
- {
- item->setFile(m_info->urlPath(), uPath);
- myPath = item->urlPath();
- }
-
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "path:" << myPath << "needsAuthentication:" << item->needsAuthentication();
-#endif
-
- // the isContentReadable() is not checked here
- // because it will be false when authentication is required
- if (!item->isValid() || !item->exists())
- {
- delete item;
- item = 0;
- }
- return item;
-}
-
-
-void Location::fetchItems(QDir::Filters dirFilter, bool recursive)
-{
- //it should never happen here
- if (m_info->needsAuthentication())
- {
- emit needsAuthentication(currentAuthenticationUser(), m_info->absoluteFilePath());
- }
- else
- {
- DirListWorker *dlw = newListWorker(m_info->absoluteFilePath(), dirFilter, recursive);
- connect(dlw, SIGNAL(itemsAdded(DirItemInfoList)),
- this, SIGNAL(itemsAdded(DirItemInfoList)));
- connect(dlw, SIGNAL(workerFinished()),
- this, SIGNAL(itemsFetched()));
- workerThread()->addRequest(dlw);
- }
-}
-
-/*
- * Each Location should have its implementation if it is possible
- */
-bool Location::isThereDiskSpace(const QString &pathname, qint64 requiredSize)
-{
- Q_UNUSED(pathname);
- Q_UNUSED(requiredSize);
- return true;
-}
-
-
-/*!
- * \brief Location::currentInfo()
- * \return the updated information about the current path
- */
-const DirItemInfo *Location::currentInfo()
-{
- if (m_info == 0)
- {
- m_info = new DirItemInfo();
- }
- refreshInfo(); //update information
- return m_info;
-}
=== removed file 'src/plugin/folderlistmodel/location.h'
--- src/plugin/folderlistmodel/location.h 2015-12-12 13:59:49 +0000
+++ src/plugin/folderlistmodel/location.h 1970-01-01 00:00:00 +0000
@@ -1,267 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: location.h
- * Date: 08/03/2014
- */
-
-#ifndef LOCATION_H
-#define LOCATION_H
-
-#include "diriteminfo.h"
-#include "locationitemdiriterator.h"
-
-#include <QObject>
-#include <QDirIterator>
-
-class IOWorkerThread;
-class DirListWorker;
-class LocationItemDirIterator;
-class LocationItemFile;
-class LocationItemDir;
-
-/*!
- * \brief The Location class represents any location (full path) where there are items to browse: directories, shares, from Disk and from Network.
- *
- * It is an abstract class the must be inherited for specific Location handling as example: \ref DiskLocation and \ref TrashLocation
- *
- * The location must be able to:
- * \li provide the browsing for the location in \ref fetchItems()
- * \li become itself its parent in \ref becomeParent() it will allow easy \ref DirModel::cdUp()
- * \li refresh its information in \ref refreshInfo()
- * \li validate its location (creates a valid DirItemInfo object or any descendent) from a url string
- *
- * The \ref startWorking() is called by \ref LocationsFactory just before this location becomes the current in the File Manager
- * In the same way the \ref stopWorking() is called by \ref LocationsFactory just before this location no longer be the current in the File Manager
- */
-class Location : public QObject
-{
- Q_OBJECT
-public:
-
- Q_ENUMS(Locations)
- /*!
- * \brief The Locations enum defines which Locations are supported
- *
- * \note Items also work as indexes for \a m_locations, they must be 0..(n-1)
- */
- enum Locations
- {
- LocalDisk=0, //<! any mounted file system
- TrashDisk, //<! special trash location in the disk
- NetSambaShare //<! SAMBA or CIFS shares
-#if 0
- NetFishShare //<! FISH protocol over ssh that provides file sharing
-#endif
- };
-
-public:
- virtual ~Location();
-protected:
- explicit Location( int type, QObject *parent=0);
-
- IOWorkerThread * workerThread() const;
-
-signals:
- void itemsAdded(const DirItemInfoList &files);
- void itemsFetched();
- void extWatcherPathChanged(const QString&);
- void extWatcherItemRemoved(const DirItemInfo&);
- void extWatcherItemChanged(const DirItemInfo&);
- void extWatcherItemAdded(const DirItemInfo&);
- void extWatcherChangesFetched(int);
- void needsAuthentication(const QString& user, const QString& urlPath);
-
-public slots:
- virtual void setUsingExternalWatcher(bool use);
- virtual void setAuthentication(const QString& user,
- const QString& password);
-
-
-public: //pure functions
- /*!
- * \brief newItemInfo() returns a Location suitable DirItemInfo object
- *
- * Every Locations must create its own DirItemInfo object with all the information set
- * \param urlPath it can also contain User and Password when in the form of an URL
- * \return the object created
- */
- virtual DirItemInfo * newItemInfo(const QString& urlPath) = 0;
-
- /*!
- * \brief newListWorker() creates a Location suitable DirListWorker object which will create a new \ref DirItemInfoList for browsing items
- *
- * The DirListWorker object will be used in \ref fetchItems()
- *
- * \param urlPath urlPath it can also contain User and Password when in the form of an URL
- * \param filter
- * \param isRecursive
- * \return the object which will fill a new \ref DirItemInfoList for browsing items
- */
- virtual DirListWorker * newListWorker(const QString &urlPath, QDir::Filters filter, const bool isRecursive) = 0;
-
- /*!
- * \brief newDirIterator() creates a LocationItemDirIterator object which is similar to Qt QDirIterator object
- *
- * It will be used to create a recursive list of items in copy/cut/paste/remove Actions
- * It can used in DirListWorker as well
- * \param path
- * \param flags
- * \return
- */
- virtual LocationItemDirIterator * newDirIterator(const QString & path,
- QDir::Filters filters,
- QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags,
- LocationItemDirIterator::LoadMode loadmode = LocationItemDirIterator::LoadOnConstructor) = 0;
- /*!
- * \brief newFile() creates a LocationItemFile object which is similar to Qt QFile object
- *
- * It will be used in copy/paste/remove Actions
- *
- * \param path
- * \return
- */
- virtual LocationItemFile * newFile(const QString & path) = 0;
-
- /*!
- * \brief newDir() creates a LocationItemDir object which is simila to Qt QDir object
- *
- * It will be used in copy/paste/remove Actions
- *
- * \param dir
- * \return
- */
- virtual LocationItemDir * newDir(const QString & dir = QLatin1String(0)) = 0;
-
- /*!
- * \brief urlBelongsToLocation() Returns a good url if the \a urlPath is valid URL that belongs to its location
- *
- * If the URL or Path in \a urlPath is valid and belongs to its location
- *
- * \param urlPath The input URL that is going to be parsed
- * \param indexOfColonAndSlash The index of ":/"
- * \return The good URL (parsed with extra slashes removed)
- * or an empty string if \a urlPath does not belong to its location
- *
- *Example regarding samba where both "cifs://" and "smb://" urls are supported
- * \code"
- * For a urlPath like: "cifs://localhost/share/"
- * The return will be: "smb://localhost/share" -> "cifs" changed by "smb" and last slash removed
- *
- * For a urlPath like: "trash:///"
- * The return will be: an empty string meaning that this URL is not related to Samba
- *\endcode
- */
- virtual QString urlBelongsToLocation(const QString& urlPath, int indexOfColonAndSlash) = 0;
-
-public:
- /*!
- * \brief isThereDiskSpace() Check if the filesystem has enough space to put a file with size \a requiredSize
- *
- *
- * \param pathname is the full pathname of the new file that is going to be created
- *
- * \param requiredSize the size required
- *
- *
- * \note For remote locations if not is possible to get this value this function MUST return true
- *
- * The default implementation just returns true and let the copy fail if there is enough space
- */
- virtual bool isThereDiskSpace(const QString& pathname, qint64 requiredSize);
-
- /*!
- * \brief fetchItems() gets the content of the Location
- *
- * \param dirFilter current Filter
- * \param recursive should get the content all sub dirs or not, (hardly ever it is true)
- */
- virtual void fetchItems(QDir::Filters dirFilter, bool recursive=false);
-
- /*!
- * \brief refreshInfo() It must refresh the DirItemInfo
- *
- * It can be used for example after receiving the signal about external disk file system changes
- * due to the current path permissions might have changed.
- */
- virtual void refreshInfo();
-
- /*!
- * \brief becomeParent() The current path location becomes the parent Location
- *
- * When \ref isRoot() returns false the current path location becomes the parent path location
- * in order to make it the current.
- * It acts like a cdUp, but without fetching items; then calling \ref fetchItems() may get contents.
- *
- * \note It must take care of deleting \ref m_info when creating a new DirItemInfo/TrashItemInfo etc.
- *
- * \return true if it is possible to do like a cdUp.
- */
- virtual bool becomeParent();
-
- /*!
- * \brief validateUrlPath() Validates the urlPath (file or Directory) and creates a new Obeject from this path
- *
- * If urlPath is a valid Directory it can be used later to set a new Location.
- *
- * \param urlPath
- * \return a valid pointer to DirItemInfo object or NULL indicating something wrong with the path
- */
- virtual DirItemInfo * validateUrlPath(const QString& urlPath);
-
- /*!
- * \brief isRemote() It must return TRUE when type() is greater than Location::TrashDisk
- * \return
- */
- inline bool isRemote() const { return m_type > TrashDisk; }
- inline bool isLocalDisk() const { return m_type == LocalDisk;}
- inline bool isTrashDisk() const { return m_type == TrashDisk; }
-
-public: //virtual
- virtual void fetchExternalChanges(const QString& urlPath,
- const DirItemInfoList& list,
- QDir::Filters dirFilter) ;
- virtual void setInfoItem(const DirItemInfo &itemInfo);
- virtual void setInfoItem(DirItemInfo *itemInfo);
- virtual bool isRoot() const;
- virtual bool isWritable() const;
- virtual bool isReadable() const;
- virtual QString urlPath() const;
- virtual void startWorking();
- virtual void stopWorking();
- virtual QString currentAuthenticationUser();
- virtual QString currentAuthenticationPassword();
-
-public: //non virtual
- void notifyItemNeedsAuthentication(const DirItemInfo *item = 0);
- bool useAuthenticationDataIfExists(const DirItemInfo &item);
-
- inline const DirItemInfo* info() const { return m_info; }
- inline int type() const { return m_type; }
- const DirItemInfo* currentInfo(); //updated information about the current path
-
-protected:
- DirItemInfo * m_info;
- int m_type;
- bool m_usingExternalWatcher;
-
-#if defined(REGRESSION_TEST_FOLDERLISTMODEL)
- friend class TestDirModel;
-#endif
-
-};
-#endif // LOCATION_H
=== removed file 'src/plugin/folderlistmodel/locationitemdir.cpp'
--- src/plugin/folderlistmodel/locationitemdir.cpp 2015-07-15 17:42:37 +0000
+++ src/plugin/folderlistmodel/locationitemdir.cpp 1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: locationitemdir.cpp
- * Date: 16/05/2015
- */
-
-#include "locationitemdir.h"
-#include <QString>
-
-LocationItemDir::LocationItemDir(const QString& dir)
-{
- Q_UNUSED(dir);
-}
-
-
-LocationItemDir::~LocationItemDir()
-{
-
-}
=== removed file 'src/plugin/folderlistmodel/locationitemdir.h'
--- src/plugin/folderlistmodel/locationitemdir.h 2015-07-15 17:42:37 +0000
+++ src/plugin/folderlistmodel/locationitemdir.h 1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: locationitemdir.h
- * Date: 16/05/2015
- */
-
-#ifndef LOCATIONITEMDIR_H
-#define LOCATIONITEMDIR_H
-
-#include <QString>
-
-class LocationItemDir
-{
-public:
- virtual ~LocationItemDir();
-public:
- virtual bool exists() const = 0;
- virtual bool mkdir(const QString& dir) const = 0;
- virtual bool mkpath(const QString& dir) const = 0;
- virtual bool rmdir(const QString& dir) const = 0;
-protected:
- LocationItemDir ();
- LocationItemDir (const QString& dir = QLatin1String(0));
-};
-
-#endif // LOCATIONITEMDIR_H
=== removed file 'src/plugin/folderlistmodel/locationitemdiriterator.cpp'
--- src/plugin/folderlistmodel/locationitemdiriterator.cpp 2015-12-12 13:19:40 +0000
+++ src/plugin/folderlistmodel/locationitemdiriterator.cpp 1970-01-01 00:00:00 +0000
@@ -1,84 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: locationitemdiriterator.cpp
- * Date: 10/01/2015
- */
-
-#include "locationitemdiriterator.h"
-
-LocationItemDirIterator::LocationItemDirIterator(const QString &path,
- const QStringList &nameFilters,
- QDir::Filters filters,
- QDirIterator::IteratorFlags flags,
- LocationItemDirIterator::LoadMode loadmode)
- : m_path(path)
- , m_nameFilters(nameFilters)
- , m_filters(filters)
- , m_flags(flags)
-
-{
- Q_UNUSED(loadmode);
-}
-
-
-LocationItemDirIterator::LocationItemDirIterator(const QString &path,
- QDir::Filters filters,
- QDirIterator::IteratorFlags flags,
- LocationItemDirIterator::LoadMode loadmode)
- : m_path(path)
- , m_filters(filters)
- , m_flags(flags)
-{
- Q_UNUSED(loadmode);
-}
-
-LocationItemDirIterator::LocationItemDirIterator(const QString &path,
- QDirIterator::IteratorFlags flags,
- LocationItemDirIterator::LoadMode loadmode)
- : m_path(path)
- , m_filters(QDir::NoFilter)
- , m_flags(flags)
-{
- Q_UNUSED(loadmode);
-}
-
-LocationItemDirIterator::~LocationItemDirIterator()
-{
-
-}
-
-
-QDirIterator::IteratorFlags LocationItemDirIterator::flags() const
-{
- return m_flags;
-}
-
-QDir::Filters LocationItemDirIterator::filters() const
-{
- return m_filters;
-}
-
-QString LocationItemDirIterator::path() const
-{
- return m_path;
-}
-
-void LocationItemDirIterator::load()
-{
- //default implementation does nothing
-}
=== removed file 'src/plugin/folderlistmodel/locationitemdiriterator.h'
--- src/plugin/folderlistmodel/locationitemdiriterator.h 2016-01-11 22:24:23 +0000
+++ src/plugin/folderlistmodel/locationitemdiriterator.h 1970-01-01 00:00:00 +0000
@@ -1,101 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: locationitemdiriterator.h
- * Date: 10/01/2015
- */
-
-#ifndef LOCATIONITEMDIRITERATOR_H
-#define LOCATIONITEMDIRITERATOR_H
-
-#include <QDirIterator>
-#include "diriteminfo.h"
-
-/*!
- * \brief The LocationItemDirIterator class is an abstract similar to Qt QDirIterator
- *
- * Different protocols supported by filemanager (different Locations) must provide a class like that.
- *
- * The \ref LoadLater can used in the constructor to indicate to the constructor to NOT load the path/url, instead \ref load() can called later to do that.
- */
-
-class LocationItemDirIterator
-{
-public:
- enum LoadMode
- {
- LoadOnConstructor, //!< loads the entire directory or url in the constructor as Qt QDirIterator does
- LoadLater //!< do NOT load the entire directory or url, \ref load() method should be responsible to do that.
- };
-
- virtual ~LocationItemDirIterator();
-public:
- virtual bool hasNext() const = 0;
- virtual QString next() = 0;
-
- virtual DirItemInfo fileInfo() const = 0;
- /*!
- * \brief fileName()
- * \return the file name for the current directory entry, without the path prepended.
- */
- virtual QString fileName() const = 0;
-
- /*!
- * \brief filePath()
- * \return the full pathname of the current item
- */
- virtual QString filePath() const = 0;
-
- /*!
- * \brief path()
- * \return the base directory of the iterator path (not the current item)
- */
- virtual QString path() const;
-
- /*!
- * \brief load() responsible to load the entire directory or url when \ref LoadLater is passed to the constructor
- */
- virtual void load() ;
-
- QDir::Filters filters() const;
- QDirIterator::IteratorFlags flags() const;
-
-protected:
- LocationItemDirIterator(const QString & path,
- QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags,
- LocationItemDirIterator::LoadMode loadmode = LocationItemDirIterator::LoadOnConstructor);
-
- LocationItemDirIterator(const QString & path,
- QDir::Filters filters,
- QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags,
- LocationItemDirIterator::LoadMode loadmode = LocationItemDirIterator::LoadOnConstructor);
-
- LocationItemDirIterator(const QString & path,
- const QStringList & nameFilters,
- QDir::Filters filters = QDir::NoFilter,
- QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags,
- LocationItemDirIterator::LoadMode loadmode = LocationItemDirIterator::LoadOnConstructor);
-
-protected:
- QString m_path;
- QStringList m_nameFilters;
- QDir::Filters m_filters;
- QDirIterator::IteratorFlags m_flags;
-};
-
-
-#endif // LOCATIONITEMDIRITERATOR_H
=== removed file 'src/plugin/folderlistmodel/locationitemfile.cpp'
--- src/plugin/folderlistmodel/locationitemfile.cpp 2015-07-15 16:04:58 +0000
+++ src/plugin/folderlistmodel/locationitemfile.cpp 1970-01-01 00:00:00 +0000
@@ -1,97 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: locationitemfile.cpp
- * Date: 20/04/2015
- */
-
-#include "locationitemfile.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-LocationItemFile::LocationItemFile(QObject *parent) :
- QObject(parent)
-{
-}
-
-LocationItemFile::LocationItemFile(const QString&, QObject *parent) :
- QObject(parent)
-{
-}
-
-LocationItemFile::~LocationItemFile()
-{
-
-}
-
-
-mode_t LocationItemFile::getUmask()
-{
- mode_t mask = ::umask(0); //first gets the current umask and sets to 0
- ::umask(mask); //second restores the current umask
- return mask;
-}
-
-/*!
- * \brief LocationItemFile::getUmaskCreationMode() Returns a suitable open creation mode for system calls like open() and mkdir() respecting umask()
- * \param mode
- * \return the open mode in the form: mode & ~umask
- */
-mode_t LocationItemFile::getUmaskCreationMode(mode_t mode)
-{
- mode_t mask = getUmask();
- mode_t umode = mode & ~mask;
- return umode;
-}
-
-/*!
- * \brief LocationItemFile::getUmaskFilesCreation() Returns the default open mode for files
- * \return
- */
-mode_t LocationItemFile::getUmaskFilesCreation()
-{
- return LocationItemFile::getUmaskCreationMode(0666);
-}
-
-
-/*!
- * \brief LocationItemFile::getUmaskFilesCreation() Returns the default open mode for directories
- * \return
- */
-mode_t LocationItemFile::getUmaskDirsCreation()
-{
- return LocationItemFile::getUmaskCreationMode(0777);
-}
-
-
-mode_t LocationItemFile::unixPermissions(QFileDevice::Permissions perm)
-{
-#define SETMODE(qtPerm, Uperm) if (perm & qtPerm) { mode |= Uperm; }
- mode_t mode = 0;
- SETMODE((QFile::ReadOwner | QFile::ReadUser), S_IRUSR);
- SETMODE((QFile::WriteOwner | QFile::WriteUser), S_IWUSR);
- SETMODE((QFile::ExeOwner | QFile::ExeUser), S_IXUSR);
- SETMODE(QFile::ReadGroup, S_IRGRP);
- SETMODE(QFile::WriteGroup, S_IWGRP);
- SETMODE(QFile::ExeGroup, S_IXGRP);
- SETMODE(QFile::ReadOther, S_IROTH);
- SETMODE(QFile::WriteOther, S_IWOTH);
- SETMODE(QFile::ExeOther, S_IXOTH);
- return mode;
-}
=== removed file 'src/plugin/folderlistmodel/locationitemfile.h'
--- src/plugin/folderlistmodel/locationitemfile.h 2015-07-15 16:04:58 +0000
+++ src/plugin/folderlistmodel/locationitemfile.h 1970-01-01 00:00:00 +0000
@@ -1,72 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2015 Canonical Ltd.
- * Copyright 2015 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: locationitemfile.h
- * Date: 20/04/2015
- */
-
-#ifndef LOCATIONITEMFILE_H
-#define LOCATIONITEMFILE_H
-
-#include <QFile>
-#include <sys/types.h>
-
-
-
-/*!
- * \brief The LocationItemFile class is an abstract class similar to Qt QFile
- *
- * It will be used in Actions like copy/paste
- */
-class LocationItemFile : public QObject
-{
- Q_OBJECT
-protected:
- explicit LocationItemFile(QObject *parent = 0);
- explicit LocationItemFile(const QString& name, QObject *parent = 0);
-public:
- virtual ~LocationItemFile();
-public:
- virtual QString fileName() const = 0;
- virtual bool rename(const QString& newName) = 0;
- virtual bool rename(const QString& oldname, const QString& newName) = 0;
- virtual bool remove() = 0;
- virtual bool remove(const QString& name) = 0;
- virtual bool link(const QString& linkName) = 0;
- virtual bool open(QFile::OpenMode mode) = 0 ;
- virtual qint64 read(char*, qint64) = 0;
- virtual qint64 write(const char*, qint64) = 0;
- virtual void close() = 0;
- virtual bool atEnd() const = 0;
- virtual qint64 size() const = 0;
- virtual bool isOpen() const = 0;
- virtual bool setPermissions(const QString& filename, QFile::Permissions perm) = 0;
- virtual bool setPermissions(QFile::Permissions perm) = 0;
- virtual QFile::Permissions permissions() const = 0;
-public: //static functions
- static mode_t getUmask(); //return the current umask
- static mode_t getUmaskCreationMode(mode_t mode); // mode & ~umask;
- static mode_t getUmaskFilesCreation(); // 0666 & ~umask;
- static mode_t getUmaskDirsCreation(); // 0777 & ~umask;
- static mode_t unixPermissions(QFile::Permissions);
-signals:
-
-public slots:
-
-};
-
-#endif // LOCATIONITEMFILE_H
=== removed file 'src/plugin/folderlistmodel/locationsfactory.cpp'
--- src/plugin/folderlistmodel/locationsfactory.cpp 2015-10-04 14:48:37 +0000
+++ src/plugin/folderlistmodel/locationsfactory.cpp 1970-01-01 00:00:00 +0000
@@ -1,253 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: locationsfactory.cpp
- * Date: 05/03/2014
- */
-
-#include "diriteminfo.h"
-#include "locationsfactory.h"
-#include "location.h"
-#include "locationurl.h"
-#include "disklocation.h"
-#include "trashlocation.h"
-#include "trashiteminfo.h"
-#include "smblocation.h"
-#include "cleanurl.h"
-#include "netauthenticationdata.h"
-
-#include <QDir>
-#include <QDebug>
-
-
-/*!
- * \brief LocationsFactory::LocationsFactory()
- * \param parent
- *
- * Locations emit needsAuthentication() signal, the connection
- * with LocationsFactory is Direct, but the connection between
- * the Location and the \ref DirModel is Queued
- * \sa Location::notifyItemNeedsAuthentication()
- */
-LocationsFactory::LocationsFactory(QObject *parent)
- : QObject(parent)
- , m_curLoc(0)
- , m_lastValidFileInfo(0)
- , m_authDataStore(NetAuthenticationDataList::getInstance(this))
- , m_lastUrlNeedsAuthentication(false)
-{
- addLocation(new DiskLocation(Location::LocalDisk));
- addLocation(new TrashLocation(Location::TrashDisk));
- addLocation(new SmbLocation(Location::NetSambaShare));
-}
-
-LocationsFactory::~LocationsFactory()
-{
- ::qDeleteAll(m_locations);
- m_locations.clear();
- if (m_lastValidFileInfo)
- {
- delete m_lastValidFileInfo;
- }
- NetAuthenticationDataList::releaseInstance(this);
-}
-
-
-/*!
- * \brief LocationsFactory::parse() identifies what main location that path/url refers to
- * \param path it is supposed to be always a full path like: file:///myDir /myDir trash:/// trash:///myDir
- * \return
- */
-
-Location * LocationsFactory::parse(const QString& uPath)
-{
- int index = -1;
- int type = -1;
- Location * location = 0;
- if ( (index = uPath.indexOf(LocationUrl::UrlIndicator)) != -1 )
- {
- int counter = m_locations.count();
- while (counter--)
- {
- m_tmpPath = m_locations.at(counter)->urlBelongsToLocation(uPath, index);
- if (!m_tmpPath.isEmpty())
- {
- type = m_locations.at(counter)->type();
- break;
- }
- }
- }
- else
- {
- m_tmpPath = DirItemInfo::removeExtraSlashes(uPath, -1);
- type = Location::LocalDisk;
- if (!m_tmpPath.startsWith(QDir::rootPath()) && m_curLoc)
- {
- //it can be any, check current location
- type = m_curLoc->type();
- }
- }
- if (!m_tmpPath.isEmpty() && type != -1)
- {
- location = m_locations.at(type);
- }
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "input path:" << uPath << "location:" << location << "type:" << type;
-#endif
- return location;
-}
-
-
-Location * LocationsFactory::setNewPath(const QString& uPath, const QString& authUser, const QString& passwd, bool savePassword)
-{
- storeValidFileInfo(0);
- CleanUrl url(uPath);
- m_lastUrlNeedsAuthentication = false;
- NetAuthenticationData authData(authUser, passwd);
- if (authData.isEmpty() && url.hasAuthenticationData())
- {
- authData.user = url.user();
- authData.password = url.password();
- }
- Location *location = parse(url.cleanUrl());
- if (location)
- {
- DirItemInfo *item = validateCurrentUrl(location,authData);
- if (item)
- {
- //now if there is Authentication Data
- //at this point item is ready and authentication if necessary worked
- if (item && !authData.isEmpty())
- {
- m_authDataStore->store(item->authenticationPath(),
- authData.user,
- authData.password,
- savePassword);
- }
- //isContentReadable() must already carry execution permission
- if (item->isValid() && item->isBrowsable() && item->isContentReadable())
- {
- location->setInfoItem(item);
- if (location != m_curLoc)
- {
- if (m_curLoc)
- {
- m_curLoc->stopWorking();
- }
- emit locationChanged(m_curLoc, location);
- location->startWorking();
- m_curLoc = location;
- }
- }
- else
- {
- storeValidFileInfo(item);
- location = 0;
- }
- }
- else
- { // not valid
- location = 0;
- }
- }
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "input path:" << uPath << "location result:" << location;
-#endif
- return location;
-}
-
-
-void LocationsFactory::storeValidFileInfo(DirItemInfo *item)
-{
- if (m_lastValidFileInfo)
- {
- delete m_lastValidFileInfo;
- }
- m_lastValidFileInfo = item;
-}
-
-
-void LocationsFactory::onUrlNeedsAuthentication(QString, QString)
-{
- m_lastUrlNeedsAuthentication = true;
-}
-
-
-bool LocationsFactory::lastUrlNeedsAuthentication() const
-{
- return m_lastUrlNeedsAuthentication;
-}
-
-
-DirItemInfo * LocationsFactory::validateCurrentUrl(Location *location, const NetAuthenticationData &authData)
-{
- //when there is authentication data, set the authentication before validating an item
- if (location->isRemote())
- {
- if (!authData.isEmpty())
- {
- location->setAuthentication(authData.user, authData.password);
- }
- else
- {
- //reset the password even it was set before, it is necessary to browse other items
- location->setAuthentication(NetAuthenticationData::currentUser(),
- NetAuthenticationData::noPassword());
- }
- }
-
- DirItemInfo *item = location->validateUrlPath(m_tmpPath);
-
- //for remote loacations, authentication might have failed
- //if so try to use a stored authentication data and authenticate it again
- if (location->isRemote() && item != 0)
- {
- if ( item->needsAuthentication()
- && location->useAuthenticationDataIfExists(*item))
- {
- delete item;
- item = location->validateUrlPath(m_tmpPath);
- }
- //if failed it is necessary to ask the user to provide user/password
- if ( item != 0 && item->needsAuthentication() )
- {
- location->notifyItemNeedsAuthentication(item);
- delete item;
- item = 0;
- }
- }
- //now just see if the item is readable
- if (item != 0 && !item->isContentReadable())
- {
- delete item;
- item = 0;
- }
- return item;
-}
-
-
-void LocationsFactory::addLocation(Location *location)
-{
- m_locations.append(location);
-
- // Qt::DirectConnection is used here
- // it allows lastUrlNeedsAuthencation() to have the right flag
- connect(location, SIGNAL(needsAuthentication(QString,QString)),
- this, SLOT(onUrlNeedsAuthentication(QString,QString)),
- Qt::DirectConnection);
-}
-
=== removed file 'src/plugin/folderlistmodel/locationsfactory.h'
--- src/plugin/folderlistmodel/locationsfactory.h 2015-07-11 21:21:16 +0000
+++ src/plugin/folderlistmodel/locationsfactory.h 1970-01-01 00:00:00 +0000
@@ -1,174 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: locationsfactory.h
- * Date: 05/03/2014
- */
-
-#ifndef LOCATIONSFACTORY_H
-#define LOCATIONSFACTORY_H
-
-#include "location.h"
-
-#include <QObject>
-#include <QList>
-
-class DirItemInfo;
-class NetAuthenticationDataList;
-class NetAuthenticationData;
-
-/*!
- * \brief The LocationsFactory class represents the set of main
- * URL locations the File Manager supports.
- *
- * It is basically devided into main groups:
- * \li Disk: \ref LocalDisk and \ref TrashDisk
- * \li Net: \ref NetSambaShare and NetFishShare
- *
- * smb:// browses workgroup
- *
- * Location parser: \ref parser()
- * \li \\workkgroup becomes smb://workgroup
- * \li \\ becomes smb://
- * \li trash:/ and trash:// becomes trash:///
- * \li fish:/ and fish:// becomes fish:///
- * \li file:/ , file:// and file:/// becomes /
- *
- * \note Due to current File Manager UI typing method both: "file:" and "trash:" are supported
- */
-class LocationsFactory : public QObject
-{
- Q_OBJECT
-public:
- explicit LocationsFactory(QObject *parent = 0);
- ~LocationsFactory();
-
- inline Location * getLocation(int index) const {return m_locations.at(index);}
- inline Location * getDiskLocation() const { return getLocation(Location::LocalDisk); }
- inline Location * getTrashLocation() const { return getLocation(Location::TrashDisk); }
-
- /*!
- * \brief parse() Just parses (does not set/change the current location) according to \a urlPath
- * \param urlPath urlPath the url like: file:///Item trash:///item /item, it MUST point to a valid Directory
- * \return The location which supports the \a urlPath
- */
- Location * parse(const QString& urlPath);
-
- /*!
- * \brief setNewPath() Sets a new path, it can be in the current location or on another location
- *
- * When the location changes, the signal \ref locationChanged() is fired.
- *
- * \param urlPath the url like: file:///Item trash:///item /item, it MUST point to a valid Directory
- * \param user an user when the URL requires authentication [optional]
- * \param password when the URL requires authentication [optional]
- *
- * \return the location that supports the urlPath or NULL when \a urlPath is NOT a valid url or it is not a valid Directory
- *
- * \sa \ref parse() \ref location()
- */
- Location * setNewPath(const QString& urlPath,
- const QString& user = QString(),
- const QString& password = QString(),
- bool savePassword = false);
-
- /*!
- * \brief location()
- * \return The current location
- */
- Location * currentLocation() const { return m_curLoc; }
-
- /*!
- * \brief availableLocations()
- * \return
- */
- const QList<Location*>&
- availableLocations() const { return m_locations; }
-
- /*!
- * \brief lastValidFileInfo()
- *
- * When calling setNewPath(file_path) using a path to a File instead of a Directory
- * the setNewPath() is not able to set a new path (current location or other), however it uses
- * Location::validateUrlPath() which validates the path for files also, then this valid DirItemInfo object
- * is saved using \ref storeValidFileInfo() for further use.
- *
- * \return The last valid DirItemInfo parsed which is not a Directory
- */
- const DirItemInfo* lastValidFileInfo() const { return m_lastValidFileInfo; }
-
- /*!
- * \brief lastUrlNeedsAuthentication()
- * \return true when last URL used in setNewPath() needs authentication
- *
- * It can be used to show a dialog to the user asking for user/password
- * instead of showing a message saying that url does not exist
- */
- bool lastUrlNeedsAuthentication() const;
-
-private:
- /*!
- * \brief storeValidFileInfo() saves an item created by \ref setNewPath() when
- * the item is not Browsable.
- *
- * It happens for example when the \a urlPath entered
- * in \ref setNewPath() is a file (not a DIR nor other Browsable item)
- *
- * \param item
- */
- void storeValidFileInfo(DirItemInfo *item);
-
- /*!
- * \brief validateCurrentUrl() it attempts to validate the current URL being parsed
- *
- * The validation includes authentication, if a Authentication Data is already avaialable
- * it is set to the location being parsed.
- * When authentication fails the signal Location::needsAuthentication() is emitted
- *
- * \param location current Location for the current urlPath entered in \ref setNewPath()
- *
- * \return new Item validated (authenticated when remote authentication is required), otherwise NULL
- */
- DirItemInfo *validateCurrentUrl(Location *location, const NetAuthenticationData&);
-
- /*!
- * \brief addLocation() just appends the location in the list \ref m_locations and connect signals
- * \param location
- */
- void addLocation(Location * location);
-
-signals:
- void locationChanged(const Location *old, const Location *current);
-
-private slots:
- void onUrlNeedsAuthentication(QString, QString);
-
-private:
- Location * m_curLoc;
- QList<Location*> m_locations;
- QString m_tmpPath;
- DirItemInfo * m_lastValidFileInfo;
- NetAuthenticationDataList * m_authDataStore;
- bool m_lastUrlNeedsAuthentication;
-
-#if defined(REGRESSION_TEST_FOLDERLISTMODEL)
- friend class TestDirModel;
-#endif
-
-};
-
-#endif // LOCATIONSFACTORY_H
=== removed file 'src/plugin/folderlistmodel/locationurl.cpp'
--- src/plugin/folderlistmodel/locationurl.cpp 2015-07-11 19:00:45 +0000
+++ src/plugin/folderlistmodel/locationurl.cpp 1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: locationurl.cpp
- * Date: 11/03/2014
- */
-
-#include "locationurl.h"
-#include <QUrl>
-
-const QString LocationUrl::UrlIndicator("://");
-
-const QString LocationUrl::TrashRootURL("trash:///");
-const QString LocationUrl::DiskRootURL("file:///");
-const QString LocationUrl::SmbURL("smb://");
-const QString LocationUrl::CifsURL("cifs://");
-#if 0
-QString LocationURL::FishURL("fish:///");
-#endif
- // keep this list ordered
-const QStringList LocationUrl::m_supportedURLs = QStringList() << LocationUrl::CifsURL
- << LocationUrl::DiskRootURL
- << LocationUrl::SmbURL
- << LocationUrl::TrashRootURL
- ;
-
-LocationUrl::LocationUrl()
-{
-
-}
-
-
-const QStringList& LocationUrl::supportedURLs()
-{
- return m_supportedURLs;
-}
-
-
-bool LocationUrl::isSupportedUrl(const QUrl &url)
-{
- bool ret = url.isValid() && url.isLocalFile(); // local files does not need to check
- if (!ret && !url.scheme().isEmpty())
- {
- int counter = m_supportedURLs.count();
- while (!ret && counter--)
- {
- ret = m_supportedURLs.at(counter).startsWith(url.scheme(), Qt::CaseSensitive);
- }
- }
- return ret;
-}
=== removed file 'src/plugin/folderlistmodel/locationurl.h'
--- src/plugin/folderlistmodel/locationurl.h 2015-07-11 19:00:45 +0000
+++ src/plugin/folderlistmodel/locationurl.h 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: locationurl.h
- * Date: 11/03/2014
- */
-
-#ifndef LOCATIONURL_H
-#define LOCATIONURL_H
-
-#include <QStringList>
-class QUrl;
-
-class LocationUrl
-{
-public:
- static const QString UrlIndicator;
- static const QString DiskRootURL;
- static const QString TrashRootURL;
- static const QString SmbURL;
- static const QString CifsURL;
-#if 0
- static const QString FishURL;
-#endif
- /*!
- * \brief supportedURLs() Tells which URLs are supported by file manager
- *
- * It may be useful for Clipboard handling
- *
- * \return URLs list
- */
- static const QStringList& supportedURLs();
- static bool isSupportedUrl(const QUrl& url);
-private:
- LocationUrl();
- static const QStringList m_supportedURLs;
-};
-
-#endif // LOCATIONURL_H
=== removed directory 'src/plugin/folderlistmodel/net'
=== removed file 'src/plugin/folderlistmodel/net/netauthenticationdata.cpp'
--- src/plugin/folderlistmodel/net/netauthenticationdata.cpp 2015-10-04 14:48:37 +0000
+++ src/plugin/folderlistmodel/net/netauthenticationdata.cpp 1970-01-01 00:00:00 +0000
@@ -1,238 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: netauthenticationdata.cpp
- * Date: 29/11/2014
- */
-
-#include "netauthenticationdata.h"
-
-#include <QStandardPaths>
-#include <QDir>
-#include <QSettings>
-#include <QCoreApplication>
-#include <QDebug>
-
-#define CHAR_CRYPT_OFFSET 31
-
-NetAuthenticationDataList * NetAuthenticationDataList::m_instance = 0;
-void * NetAuthenticationDataList::m_parent = 0;
-
-
-const QString& NetAuthenticationData::currentUser()
-{
- static QString curUser(::qgetenv("USER"));
- return curUser;
-}
-
-const QString& NetAuthenticationData::noPassword()
-{
- static QString emptyPassword;
- return emptyPassword;
-}
-
-NetAuthenticationDataList::NetAuthenticationDataList(): m_savedAuths(0)
-{
- //settings file does not need to open all the time
- loadSavedAuthenticationData();
-}
-
-
-NetAuthenticationDataList::~NetAuthenticationDataList()
-{
- qDeleteAll(m_urlEntries);
- m_urlEntries.clear();
- m_parent = 0;
- m_instance = 0;
- closeAuthenticationStore();
-}
-
-
-NetAuthenticationDataList * NetAuthenticationDataList::getInstance(void *parent)
-{
- if (m_instance == 0)
- {
- m_instance = new NetAuthenticationDataList();
- m_parent = parent;
- }
- return m_instance;
-}
-
-
-void NetAuthenticationDataList::releaseInstance(void *parent)
-{
- if (parent == m_parent && m_instance != 0)
- {
- delete m_instance;
- m_instance = 0;
- m_parent = 0;
- }
-}
-
-
-const NetAuthenticationData * NetAuthenticationDataList::get(const QString& url) const
-{
- const NetAuthenticationData * ret = 0;
- if (!url.isEmpty())
- {
- ret = m_urlEntries.value(url);
- if (ret == 0)
- {
- //try to match cases where a more complete URL like smb://host/share/directory was entered and smb://host had been saved before
- QUrl hostUrl(url);
- hostUrl.setPath(QLatin1String(0));
- ret = m_urlEntries.value(hostUrl.toString());
- }
- }
- return ret;
-}
-
-bool NetAuthenticationDataList::store(const QString &url, const QString &u, const QString &p, bool save)
-{
- bool ret = false;
- if (!url.isEmpty())
- {
- ret = true;
- NetAuthenticationData * data = 0;
- if ( (data = const_cast<NetAuthenticationData*> (get(url))) == 0)
- {
- data = new NetAuthenticationData();
- m_urlEntries.insert(url, data);
- }
- data->user = u;
- data->password = p;
- if (save )
- {
- ret = saveAuthenticationData(url, data);
- }
- }
- return ret;
-}
-
-
-
-bool NetAuthenticationDataList::store(const QUrl &url, bool save)
-{
- QString user = url.userName();
- QString passwd = url.password();
-
- QUrl url2(url);
- url2.setUserName(QLatin1String(0));
- url2.setPassword(QLatin1String(0));
-
- return store(url2.toString(), user,passwd, save);
-}
-
-
-void NetAuthenticationDataList::loadSavedAuthenticationData()
-{
- QLatin1Char slash('/');
- QLatin1String userKey("user");
- QLatin1String passKey("password");
- openAuthenticationStore();
- QStringList urls = m_savedAuths->childGroups();
- int counter = urls.count();
- while(counter--)
- {
- m_savedAuths->beginGroup(urls.at(counter));
- QString cleanUrl = urls.at(counter);
- cleanUrl.replace(QLatin1Char('}'), slash);
- QString user = m_savedAuths->value(userKey).toString();
- QString pass = m_savedAuths->value(passKey).toString();
- store(cleanUrl, user, decryptPassword(pass));
- m_savedAuths->endGroup();
- }
- closeAuthenticationStore();
-}
-
-bool NetAuthenticationDataList::saveAuthenticationData(const QString& url, const NetAuthenticationData *d)
-{
- QLatin1Char slash('/');
- QLatin1String userKey("user");
- QLatin1String passKey("password");
- QString keyUrl(url);
- keyUrl.replace(slash, QLatin1Char('}'));
-
- openAuthenticationStore();
- m_savedAuths->setValue(keyUrl + slash + userKey, d->user);
- m_savedAuths->setValue(keyUrl + slash + passKey, encryptPassord(d->password));
- m_savedAuths->sync();
- bool ret = m_savedAuths->status() == QSettings::NoError;
- if (!ret)
- {
- qDebug() << Q_FUNC_INFO << "ERROR: could not save settings:" << m_savedAuths->fileName();
- }
- closeAuthenticationStore();
- return ret;
-}
-
-/*!
- * \brief NetAuthenticationDataList::encryptPassord() simple crypt function hide the user password
- *
- * \param p the ascii password
- * \return
- */
-QString NetAuthenticationDataList::encryptPassord(const QString &p)
-{
- QString crypted;
- short unicode = 0;
- for (int counter=0; counter < p.size(); ++counter)
- {
- unicode = p.at(counter).unicode() - CHAR_CRYPT_OFFSET + counter;
- crypted.append( QChar(unicode) );
- }
- return crypted.toLocal8Bit().toHex();
-}
-
-
-QString NetAuthenticationDataList::decryptPassword(const QString &p)
-{
- QString crypted( QByteArray::fromHex(p.toLocal8Bit()) );
- QString decrypted;
- short unicode = 0;
- for (int counter=0; counter < crypted.size(); ++counter)
- {
- unicode = crypted.at(counter).unicode() + CHAR_CRYPT_OFFSET - counter;
- decrypted.append( QChar(unicode) );
- }
- return decrypted;
-}
-
-void NetAuthenticationDataList::openAuthenticationStore()
-{
- if (m_savedAuths == 0)
- {
- QString settingsLocation =
- QStandardPaths::standardLocations(QStandardPaths::ConfigLocation).first()
- + QLatin1Char('/') + QCoreApplication::applicationName()
- + QLatin1Char('/') + QLatin1String("authentication.conf");
- m_savedAuths = new QSettings(settingsLocation, QSettings::IniFormat);
-#if DEBUG_MESSAGES
- qDebug() << Q_FUNC_INFO << "auth file:" << m_savedAuths->fileName();
-#endif
- }
-}
-
-
-void NetAuthenticationDataList::closeAuthenticationStore()
-{
- if (m_savedAuths != 0)
- {
- delete m_savedAuths;
- m_savedAuths = 0;
- }
-}
=== removed file 'src/plugin/folderlistmodel/net/netauthenticationdata.h'
--- src/plugin/folderlistmodel/net/netauthenticationdata.h 2015-10-04 14:48:37 +0000
+++ src/plugin/folderlistmodel/net/netauthenticationdata.h 1970-01-01 00:00:00 +0000
@@ -1,99 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * File: netauthenticationdata.h
- * Date: 29/11/2014
- */
-
-#ifndef NETAUTHENTICATIONDATA_H
-#define NETAUTHENTICATIONDATA_H
-
-#include <QHash>
-#include <QUrl>
-
-class QSettings;
-
-/*!
- * \brief The NetAuthenticationData struct
- *
- * Just keeps data for Network authentication (protocol independent)
- */
-
-struct NetAuthenticationData
-{
-public:
- NetAuthenticationData() {}
- NetAuthenticationData(const QString&u, const QString& p) :
- user(u), password(p) {}
- inline bool isEmpty() const { return user.isEmpty(); }
- QString user;
- QString password;
- static const QString& currentUser();
- static const QString& noPassword();
-};
-
-
-/*!
- * \brief The NetAuthenticationDataList class
- *
- * It keeps a list of the current URLs being used and their Authentication data
- *
- * This information may be required for every connection (e.g. Samba shares).
- *
- * It implements a singleton design pattern to keep a unique Authentication Data list per application
- * \sa \ref getInstance() and \ref releaseInstance()
- *
- * The authentication data can be saved for NOT always asking the user
- *
- * \note It is intended to be used for any protocol.
- * The URL being stored must be the part or prefix which requires authentication
- * Example for Samba: if a user enters with a url like smb://localhost/any_share/folder1/folder2
- * only the share part requires authentication with is smb://localhost/any_share
- * The same authentication data can be used for any smb://localhost/any_share sub-items
- *
- */
-class NetAuthenticationDataList
-{
-public:
- static NetAuthenticationDataList * getInstance(void *parent);
- static void releaseInstance(void *parent);
- ~NetAuthenticationDataList();
-
-public:
- bool store(const QUrl& url, bool save = false);
- bool store(const QString& url, const QString& u, const QString& p, bool save =false);
- const NetAuthenticationData * get(const QString&) const;
-
-private:
- NetAuthenticationDataList();
-
-private:
- void openAuthenticationStore();
- void closeAuthenticationStore();
- QString encryptPassord(const QString& p);
- QString decryptPassword(const QString& p);
- void loadSavedAuthenticationData();
- bool saveAuthenticationData(const QString& url, const NetAuthenticationData * );
-
-private: //url authentication data
- QHash <QString , NetAuthenticationData*> m_urlEntries;
- static NetAuthenticationDataList * m_instance;
- static void * m_parent;
- QSettings * m_savedAuths;
-};
-
-#endif // NETAUTHENTICATIONDATA_H
=== removed file 'src/plugin/folderlistmodel/net/netutil.cpp'
--- src/plugin/folderlistmodel/net/netutil.cpp 2015-03-06 19:52:56 +0000
+++ src/plugin/folderlistmodel/net/netutil.cpp 1970-01-01 00:00:00 +0000
@@ -1,89 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2014 Canonical Ltd.
- * Copyright 2014 Carlos J Mazieri <carlos.mazieri@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy
References