├── .reuse └── dep5 ├── .tag ├── AUTHORS.md ├── CMakeLists.txt ├── LICENSE.GPLv3 ├── README.md ├── cmake └── FindTaglib.cmake ├── files.qbs ├── src ├── app │ ├── CMakeLists.txt │ ├── app.qbs │ ├── config.h.in │ ├── files.qrc │ ├── io.liri.Files.appdata.xml │ ├── io.liri.Files.desktop │ ├── io.liri.Files.desktop.in │ ├── main.cpp │ └── qml │ │ ├── FolderPage.qml │ │ ├── SelectionPage.qml │ │ ├── TrashPage.qml │ │ ├── backend │ │ └── FolderModel.qml │ │ ├── components │ │ ├── FileListItem.qml │ │ ├── FolderListView.qml │ │ ├── InfoSidebar.qml │ │ ├── PlacesSidebar.qml │ │ └── SelectionListItem.qml │ │ ├── dialogs │ │ └── SettingsDialog.qml │ │ └── main.qml └── imports │ ├── archives │ ├── CMakeLists.txt │ ├── archives.cpp │ ├── archives.h │ ├── archives.qbs │ ├── plugin.cpp │ └── qmldir │ ├── folderlistmodel │ ├── CMakeLists.txt │ ├── clipboard.cpp │ ├── clipboard.h │ ├── diritemabstractlistmodel.h │ ├── diriteminfo.cpp │ ├── diriteminfo.h │ ├── dirmodel.cpp │ ├── dirmodel.h │ ├── dirselection.cpp │ ├── dirselection.h │ ├── disk │ │ ├── disklocation.cpp │ │ └── disklocation.h │ ├── externalfswatcher.cpp │ ├── externalfswatcher.h │ ├── filecompare.cpp │ ├── filecompare.h │ ├── filesystemaction.cpp │ ├── filesystemaction.h │ ├── fmutil.cpp │ ├── fmutil.h │ ├── folderlistmodel.qbs │ ├── imageprovider.cpp │ ├── imageprovider.h │ ├── iorequest.cpp │ ├── iorequest.h │ ├── iorequestworker.cpp │ ├── iorequestworker.h │ ├── ioworkerthread.cpp │ ├── ioworkerthread.h │ ├── location.cpp │ ├── location.h │ ├── locationsfactory.cpp │ ├── locationsfactory.h │ ├── locationurl.cpp │ ├── locationurl.h │ ├── plugin.cpp │ ├── plugin.h │ ├── qmldir │ └── trash │ │ ├── qtrashdir.cpp │ │ ├── qtrashdir.h │ │ ├── qtrashutilinfo.cpp │ │ ├── qtrashutilinfo.h │ │ ├── trashiteminfo.cpp │ │ ├── trashiteminfo.h │ │ ├── trashlocation.cpp │ │ └── trashlocation.h │ ├── pamauthentication │ ├── pamauthentication.cpp │ ├── pamauthentication.h │ ├── pamauthentication_plugin.cpp │ ├── pamauthentication_plugin.h │ └── qmldir │ ├── placesmodel │ ├── CMakeLists.txt │ ├── placesmodel.cpp │ ├── placesmodel.h │ ├── placesmodel.qbs │ ├── placesmodel_plugin.cpp │ ├── placesmodel_plugin.h │ ├── qmldir │ ├── qmtabparser.cpp │ └── qmtabparser.h │ └── test_folderlistmodel │ ├── regression │ ├── media_asx.h │ ├── media_xspf.h │ ├── regression_folderlilstmodel.pro │ ├── sound_7200_amr.h │ ├── sound_mp3.h │ ├── tempfiles.cpp │ ├── tempfiles.h │ ├── testonly_pdf.h │ ├── tst_folderlistmodel.cpp │ └── ubuntu_touch_run.sh │ ├── results │ ├── DesktopQt4.74.txt │ ├── DesktopQt5.0.txt │ ├── NemoEmulatorQ8.43.txt │ └── openFiles.Readme.txt │ └── simpleUI │ ├── actionprogress.cpp │ ├── actionprogress.h │ ├── main.cpp │ ├── placesmodel.cpp │ ├── placesmodel.h │ ├── res.qrc │ ├── resources │ ├── copy.png │ ├── cut.png │ ├── document_folder.png │ ├── downloads_folder.png │ ├── edit-rename.png │ ├── empty_trash.png │ ├── exit.png │ ├── fileclose.png │ ├── filenew.png │ ├── fileopen.png │ ├── folder-new.png │ ├── go-previous.png │ ├── go-up.png │ ├── home-page.png │ ├── paste.png │ ├── recyclebin_full.png │ ├── red_folder.png │ ├── remove.png │ ├── temp_folder.png │ ├── trash.png │ ├── undo.png │ └── xterm_48x48.xpm │ ├── simplelist.cpp │ ├── simplelist.h │ ├── simplelist.ui │ ├── simpleslots.cpp │ ├── simpleui.pro │ ├── terminalfolderapp.cpp │ └── terminalfolderapp.h └── translations ├── data └── desktop │ ├── ar.po │ ├── da.po │ ├── de.po │ ├── desktop.pot │ ├── fr.po │ ├── it.po │ ├── lt.po │ ├── nl.po │ ├── pl.po │ ├── pt_BR.po │ ├── ru.po │ ├── tr.po │ ├── zh_CN.po │ └── zh_TW.po ├── files.ts ├── files_ar.ts ├── files_da.ts ├── files_de.ts ├── files_fr.ts ├── files_it.ts ├── files_lt.ts ├── files_nl.ts ├── files_pl.ts ├── files_pt_BR.ts ├── files_pt_PT.ts ├── files_ru.ts ├── files_tr.ts ├── files_zh_CN.ts └── files_zh_TW.ts /.reuse/dep5: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: Files 3 | Source: https://github.com/lirios/files 4 | 5 | Files: translations/* 6 | Copyright: 2020 Liri Translators 7 | License: CC0-1.0 8 | -------------------------------------------------------------------------------- /.tag: -------------------------------------------------------------------------------- 1 | a29bea19c45f0cbae3cd3420abeaa4e10d6783ab 2 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | Files 2 | ===== 3 | 4 | # Core Developers 5 | 6 | * Pier Luigi Fiorini 7 | 8 | # Contributors 9 | 10 | You can see the list of contributors to this code base, 11 | and the number of their commits with: 12 | 13 | ```sh 14 | git shortlog -s -e -n 15 | ``` 16 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10.0) 2 | 3 | project("Files" 4 | VERSION "0.2.0" 5 | DESCRIPTION "File manager" 6 | LANGUAGES CXX C 7 | ) 8 | 9 | ## Shared macros and functions: 10 | if(NOT LIRI_LOCAL_ECM) 11 | find_package(LiriCMakeShared "2.0.0" REQUIRED NO_MODULE) 12 | list(APPEND CMAKE_MODULE_PATH "${LCS_MODULE_PATH}") 13 | endif() 14 | 15 | ## Set minimum versions required. 16 | set(QT_MIN_VERSION "5.10.0") 17 | 18 | ## Add some paths to check for CMake modules: 19 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") 20 | 21 | ## Liri specific setup common for all modules: 22 | include(LiriSetup) 23 | 24 | ## Features: 25 | option(FILES_ENABLE_TAGLIB "Extract tags with taglib" ON) 26 | add_feature_info("Files::TagLib" FILES_ENABLE_TAGLIB "Extract tags with taglib") 27 | 28 | ## Find Qt 5. 29 | find_package(Qt5 "${QT_MIN_VERSION}" 30 | CONFIG REQUIRED 31 | COMPONENTS 32 | Core 33 | Gui 34 | Widgets 35 | Qml 36 | Quick 37 | QuickControls2 38 | LinguistTools 39 | ) 40 | 41 | ## Add subdirectories: 42 | add_subdirectory(src/app) 43 | add_subdirectory(src/imports/archives) 44 | add_subdirectory(src/imports/folderlistmodel) 45 | add_subdirectory(src/imports/placesmodel) 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Files 2 | ===== 3 | 4 | [![License](https://img.shields.io/badge/license-GPLv3.0%2B-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html) 5 | [![GitHub release](https://img.shields.io/github/release/lirios/files.svg)](https://github.com/lirios/files) 6 | [![GitHub issues](https://img.shields.io/github/issues/lirios/files.svg)](https://github.com/lirios/files/issues) 7 | [![CI](https://github.com/lirios/files/workflows/CI/badge.svg?branch=develop)](https://github.com/lirios/files/actions?query=workflow%3ACI) 8 | 9 | File manager. 10 | 11 | ## Dependencies 12 | 13 | Qt >= 5.10.0 with at least the following modules is required: 14 | 15 | * [qtbase](http://code.qt.io/cgit/qt/qtbase.git) 16 | * [qtdeclarative](http://code.qt.io/cgit/qt/qtdeclarative.git) 17 | * [qtquickcontrols2](http://code.qt.io/cgit/qt/qtquickcontrols2.git) 18 | * [qttools](http://code.qt.io/cgit/qt/qttools.git/) 19 | 20 | The following modules and their dependencies are required: 21 | 22 | * [cmake](https://gitlab.kitware.com/cmake/cmake) >= 3.10.0 23 | * [cmake-shared](https://github.com/lirios/cmake-shared.git) >= 1.0.0 24 | * [fluid](https://github.com/lirios/fluid.git) >= 1.1.0 25 | 26 | Optional dependencies: 27 | 28 | * [taglib](https://github.com/taglib/taglib) 29 | 30 | ## Installation 31 | 32 | ```sh 33 | mkdir build 34 | cd build 35 | cmake -DCMAKE_INSTALL_PREFIX=/path/to/prefix .. 36 | make 37 | make install # use sudo if necessary 38 | ``` 39 | 40 | Replace `/path/to/prefix` to your installation prefix. 41 | Default is `/usr/local`. 42 | 43 | You can also append the following options to the `cmake` command: 44 | 45 | * `-DFILES_ENABLE_TAGLIB:BOOL=FALSE`: Don-t use taglib to extract tags. 46 | 47 | ## Licensing 48 | 49 | Licensed under the terms of the GNU General Public License version 3 or, 50 | at your option, any later version. 51 | -------------------------------------------------------------------------------- /cmake/FindTaglib.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | 3 | pkg_check_modules(Taglib taglib IMPORTED_TARGET) 4 | -------------------------------------------------------------------------------- /files.qbs: -------------------------------------------------------------------------------- 1 | import qbs 1.0 2 | 3 | Project { 4 | name: "Files" 5 | 6 | readonly property string version: "0.2.0" 7 | 8 | property bool useStaticAnalyzer: false 9 | 10 | property bool enableTaglib: true 11 | 12 | minimumQbsVersion: "1.9.0" 13 | 14 | references: [ 15 | "app/app.qbs", 16 | "imports/archives/archives.qbs", 17 | "imports/folderlistmodel/folderlistmodel.qbs", 18 | "imports/placesmodel/placesmodel.qbs", 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Translations 2 | file(GLOB LiriFiles_TRANSLATIONS "${CMAKE_SOURCE_DIR}/translations/*_*.ts") 3 | qt5_add_translation(LiriFiles_QM_FILES ${LiriFiles_TRANSLATIONS}) 4 | install(FILES ${LiriFiles_QM_FILES} 5 | DESTINATION "${INSTALL_DATADIR}/liri-files/translations") 6 | 7 | liri_add_executable(LiriFiles 8 | OUTPUT_NAME 9 | "liri-files" 10 | SOURCES 11 | main.cpp 12 | ${LiriFiles_QM_FILES} 13 | RESOURCES 14 | files.qrc 15 | DEFINES 16 | QT_NO_CAST_FROM_ASCII 17 | QT_NO_FOREACH 18 | FILES_VERSION="${PROJECT_VERSION}" 19 | APPDATA 20 | "${CMAKE_CURRENT_SOURCE_DIR}/io.liri.Files.appdata.xml" 21 | DESKTOP 22 | "${CMAKE_CURRENT_SOURCE_DIR}/io.liri.Files.desktop" 23 | LIBRARIES 24 | Qt5::Core 25 | Qt5::Gui 26 | Qt5::Qml 27 | Qt5::Quick 28 | Qt5::QuickControls2 29 | GUI 30 | ) 31 | 32 | liri_finalize_executable(LiriFiles) 33 | -------------------------------------------------------------------------------- /src/app/app.qbs: -------------------------------------------------------------------------------- 1 | import qbs 1.0 2 | 3 | QtGuiApplication { 4 | name: "liri-files" 5 | targetName: "liri-files" 6 | 7 | Depends { name: "lirideployment" } 8 | Depends { name: "Qt"; submodules: ["qml", "quick", "quickcontrols2"] } 9 | 10 | cpp.defines: base.concat(['FILES_VERSION="' + project.version + '"']) 11 | 12 | Qt.core.resourcePrefix: "/" 13 | Qt.core.resourceSourceBase: sourceDirectory 14 | 15 | files: ["*.cpp", "*.h"] 16 | 17 | Group { 18 | name: "Resource Data" 19 | files: ["qml/**"] 20 | fileTags: ["qt.core.resource_data"] 21 | } 22 | 23 | Group { 24 | condition: qbs.targetOS.contains("unix") && 25 | !qbs.targetOS.contains("android") && 26 | !qbs.targetOS.contains("macos") 27 | name: "Desktop File" 28 | prefix: "../data/" 29 | files: ["io.liri.Files.desktop"] 30 | qbs.install: true 31 | qbs.installDir: lirideployment.applicationsDir 32 | } 33 | 34 | Group { 35 | condition: qbs.targetOS.contains("unix") && 36 | !qbs.targetOS.contains("android") && 37 | !qbs.targetOS.contains("macos") 38 | name: "AppStream Metadata" 39 | prefix: "../data/" 40 | files: ["io.liri.Files.appdata.xml"] 41 | qbs.install: true 42 | qbs.installDir: lirideployment.appDataDir 43 | } 44 | 45 | Group { 46 | qbs.install: true 47 | qbs.installDir: lirideployment.binDir 48 | fileTagsFilter: product.type 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/app/config.h.in: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This file is part of Files. 3 | * 4 | * Copyright (C) 2016 Pier Luigi Fiorini 5 | * 6 | * $BEGIN_LICENSE:GPL3+$ 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * $END_LICENSE$ 22 | ***************************************************************************/ 23 | 24 | #pragma once 25 | 26 | #define FILES_VERSION_STRING "@PROJECT_VERSION@" 27 | -------------------------------------------------------------------------------- /src/app/files.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | qml/backend/FolderModel.qml 4 | qml/components/FileListItem.qml 5 | qml/components/FolderListView.qml 6 | qml/components/InfoSidebar.qml 7 | qml/components/PlacesSidebar.qml 8 | qml/components/SelectionListItem.qml 9 | qml/dialogs/SettingsDialog.qml 10 | qml/FolderPage.qml 11 | qml/main.qml 12 | qml/SelectionPage.qml 13 | qml/TrashPage.qml 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/app/io.liri.Files.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.liri.Files.desktop 4 | Files 5 | Liri 6 | Access and organize files 7 | CC0-1.0 8 | GPL-3.0+ 9 | 10 |

11 | Liri Files is the default file manager of the Liri desktop. 12 | It provides a simple way to manage your files and browse your file system. 13 |

14 |
15 | 16 | System 17 | 18 | io.liri.Files.desktop 19 | 20 | liri-files 21 | 22 | 23 | 24 | https://liri.io/images/apps/files/screen_home_01.png 25 | 26 | 27 | 28 | ModernToolkit 29 | 30 | 31 | 32 | 33 | 34 | https://liri.io 35 | https://github.com/lirios/files/issues/new 36 | info_at_liri.io 37 |
38 | -------------------------------------------------------------------------------- /src/app/io.liri.Files.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Name=Liri Files 4 | Name[da]=Liri-filer 5 | Name[de]=Liri Dateien 6 | Name[it]=Liri Files 7 | Name[lt]=Liri failai 8 | Name[pt_BR]=Liri Files 9 | Name[ru]=Файлы Liri 10 | Name[tr]=Liri Dosyalar 11 | GenericName=File Manager 12 | GenericName[da]=Filhåndtering 13 | GenericName[de]=Dateiverwaltung 14 | GenericName[it]=Gestore file 15 | GenericName[lt]=Failų tvarkytuvė 16 | GenericName[pt_BR]=Gerenciador de arquivos 17 | GenericName[ru]=Менеджер файлов 18 | GenericName[tr]=Dosya Yönetici 19 | Comment=Access and organize files 20 | Comment[da]=Tilgå og organiser filer 21 | Comment[de]=Auf Dateien zugreifen und diese organisieren 22 | Comment[it]=Gestisci ed organizza i file 23 | Comment[lt]=Gauti prieigą prie failų ir juos tvarkyti 24 | Comment[pt_BR]=Acesse e organize arquivos 25 | Comment[tr]=Dosyalara eriş ve yönet 26 | Keywords=folder;manager;explore;disk;filesystem; 27 | Keywords[da]=mappe;håndtering;udforsk;disk;filsystem; 28 | Keywords[it]=cartella;gestore;esplora;disco;filesystem 29 | Keywords[lt]=aplankas;tvarkytuvė;naršyti;diskas;failų sistema; 30 | Keywords[pt_BR]=pasta;gerenciador;explorar;disco;sistema de arquivos; 31 | Keywords[ru]=folder;manager;explore;disk;filesystem; 32 | Keywords[tr]=klasör;yönetici;keşfet;disk;dosyasistemi; 33 | Exec=liri-files 34 | Icon=system-file-manager 35 | Terminal=false 36 | Type=Application 37 | StartupWMClass=liri-files 38 | Categories=X-Liri;Qt;Utility;Core;FileManager; 39 | -------------------------------------------------------------------------------- /src/app/io.liri.Files.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | _Name=Liri Files 4 | _GenericName=File Manager 5 | _Comment=Access and organize files 6 | _Keywords=folder;manager;explore;disk;filesystem; 7 | Exec=liri-files 8 | Icon=system-file-manager 9 | Terminal=false 10 | Type=Application 11 | StartupWMClass=liri-files 12 | Categories=X-Liri;Qt;Utility;Core;FileManager; 13 | -------------------------------------------------------------------------------- /src/app/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Liri. 3 | * 4 | * Copyright (C) 2015 Michael Spencer 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | 31 | static void loadQtTranslations() 32 | { 33 | #ifndef QT_NO_TRANSLATION 34 | QString locale = QLocale::system().name(); 35 | 36 | // Load Qt translations 37 | QTranslator *qtTranslator = new QTranslator(QCoreApplication::instance()); 38 | if (qtTranslator->load(QStringLiteral("qt_%1").arg(locale), QLibraryInfo::location(QLibraryInfo::TranslationsPath))) { 39 | qApp->installTranslator(qtTranslator); 40 | } else { 41 | delete qtTranslator; 42 | } 43 | #endif 44 | } 45 | 46 | static void loadAppTranslations() 47 | { 48 | #ifndef QT_NO_TRANSLATION 49 | QString locale = QLocale::system().name(); 50 | 51 | // Find the translations directory 52 | const QString path = QLatin1String("liri-files/translations"); 53 | const QString translationsDir = 54 | QStandardPaths::locate(QStandardPaths::GenericDataLocation, 55 | path, 56 | QStandardPaths::LocateDirectory); 57 | 58 | // Load shell translations 59 | QTranslator *appTranslator = new QTranslator(QCoreApplication::instance()); 60 | if (appTranslator->load(QStringLiteral("%1/files_%3").arg(translationsDir, locale))) { 61 | QCoreApplication::installTranslator(appTranslator); 62 | } else if (locale == QLatin1String("C") || 63 | locale.startsWith(QLatin1String("en"))) { 64 | // English is the default, it's translated anyway 65 | delete appTranslator; 66 | } 67 | #endif 68 | } 69 | 70 | int main(int argc, char *argv[]) 71 | { 72 | // HiDPI support 73 | QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 74 | 75 | // Set default style 76 | QQuickStyle::setStyle(QLatin1String("Material")); 77 | 78 | // Set the X11 WML_CLASS so X11 desktops can find the desktop file 79 | qputenv("RESOURCE_NAME", QByteArrayLiteral("io.liri.Files")); 80 | 81 | // Setup application 82 | QGuiApplication app(argc, argv); 83 | app.setApplicationName(QLatin1String("Files")); 84 | app.setApplicationVersion(QLatin1String(FILES_VERSION)); 85 | app.setOrganizationDomain(QLatin1String("liri.io")); 86 | app.setOrganizationName(QLatin1String("Liri")); 87 | app.setDesktopFileName(QLatin1String("io.liri.Files.desktop")); 88 | app.setQuitOnLastWindowClosed(true); 89 | 90 | // Load translations 91 | loadQtTranslations(); 92 | loadAppTranslations(); 93 | 94 | // Setup QML engine and show the main window 95 | QQmlApplicationEngine engine(QUrl(QLatin1String("qrc:/qml/main.qml"))); 96 | 97 | return app.exec(); 98 | } 99 | -------------------------------------------------------------------------------- /src/app/qml/SelectionPage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Liri. 3 | * 4 | * Copyright (C) 2015 Michael Spencer 5 | * 2015 Ricardo Vieira 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | import QtQuick 2.2 22 | import QtQuick.Controls.Material 2.0 23 | import Fluid.Controls 1.1 as FluidControls 24 | import "components" 25 | 26 | FluidControls.Page { 27 | id: folderPage 28 | 29 | title: qsTr("Select files...") 30 | 31 | leftAction: FluidControls.Action { 32 | icon.source: FluidControls.Utils.iconUrl("navigation/arrow_back") 33 | text: qsTr("Back") 34 | 35 | onTriggered: { 36 | selectionManager.clear() 37 | selectionManager.setMultiSelection(false) 38 | folderPage.pop() 39 | } 40 | } 41 | 42 | actions: [ 43 | FluidControls.Action { 44 | icon.source: FluidControls.Utils.iconUrl("content/content_cut") 45 | text: qsTr("Cut") 46 | shortcut: StandardKey.Cut 47 | onTriggered: folderModel.model.cutSelection() 48 | }, 49 | FluidControls.Action { 50 | icon.source: FluidControls.Utils.iconUrl("content/content_copy") 51 | text: qsTr("Copy") 52 | shortcut: StandardKey.Copy 53 | onTriggered: folderModel.model.copySelection() 54 | }, 55 | FluidControls.Action { 56 | icon.source: FluidControls.Utils.iconUrl("content/content_paste") 57 | text: qsTr("Paste") 58 | shortcut: StandardKey.Paste 59 | onTriggered: folderModel.model.paste() 60 | enabled: folderModel.model.clipboardUrlsCounter 61 | }, 62 | FluidControls.Action { 63 | icon.source: FluidControls.Utils.iconUrl("action/delete") 64 | text: qsTr("Move to Trash") 65 | shortcut: StandardKey.Delete 66 | onTriggered: folderModel.model.moveSelectionToTrash() 67 | }, 68 | FluidControls.Action { 69 | icon.source: FluidControls.Utils.iconUrl("content/select_all") 70 | text: qsTr("Select all") 71 | shortcut: StandardKey.SelectAll 72 | onTriggered: selectionManager.selectAll() 73 | }, 74 | FluidControls.Action { 75 | icon.source: FluidControls.Utils.iconUrl("content/clear") 76 | text: qsTr("Clear selection") 77 | shortcut: StandardKey.Deselect 78 | onTriggered: selectionManager.clear() 79 | } 80 | ] 81 | 82 | appBar { 83 | elevation: 0 84 | backgroundColor: Material.color(Material.Grey, Material.Shade700) 85 | decorationColor: Material.color(Material.Grey, Material.Shade800) 86 | } 87 | 88 | FolderListView { 89 | anchors.fill: parent 90 | model: folderModel.model 91 | delegate: SelectionListItem {} 92 | } 93 | 94 | Keys.onEscapePressed: selectionManager.clear() 95 | 96 | Component.onCompleted: selectionManager.setMultiSelection(true); 97 | } 98 | -------------------------------------------------------------------------------- /src/app/qml/TrashPage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Liri. 3 | * 4 | * Copyright (C) 2015 Ricardo Vieira 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | import QtQuick 2.2 21 | import QtQuick.Controls.Material 2.0 22 | import Fluid.Controls 1.1 as FluidControls 23 | import "components" 24 | 25 | FluidControls.Page { 26 | id: folderPage 27 | 28 | title: qsTr("Trash") 29 | 30 | leftAction: FluidControls.Action { 31 | icon.source: FluidControls.Utils.iconUrl("navigation/arrow_back") 32 | text: qsTr("Back") 33 | 34 | onTriggered: { 35 | selectionManager.clear(); 36 | selectionManager.setMultiSelection(false); 37 | folderModel.goBack(); 38 | folderPage.pop(); 39 | } 40 | } 41 | 42 | actions: [ 43 | FluidControls.Action { 44 | icon.source: FluidControls.Utils.iconUrl("content/remove_circle") 45 | text: qsTr("Empty trash") 46 | onTriggered: folderModel.model.emptyTrash() 47 | }, 48 | FluidControls.Action { 49 | icon.source: FluidControls.Utils.iconUrl("action/restore") 50 | text: qsTr("Restore trash") 51 | onTriggered: folderModel.model.restoreTrash() 52 | } 53 | ] 54 | 55 | appBar { 56 | elevation: 0 57 | backgroundColor: Material.color(Material.Green, Material.Shade500) 58 | decorationColor: Material.color(Material.Green, Material.Shade700) 59 | } 60 | 61 | FolderListView { 62 | anchors.fill: parent 63 | model: folderModel.model 64 | delegate: FileListItem {} 65 | } 66 | 67 | Keys.onEscapePressed: selectionManager.clear() 68 | 69 | Component.onCompleted: folderModel.model.goTrash() 70 | } 71 | -------------------------------------------------------------------------------- /src/app/qml/components/FileListItem.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Liri. 3 | * 4 | * Copyright (C) 2015 Michael Spencer 5 | * 2015 Ricardo Vieira 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | import QtQuick 2.2 22 | import QtQuick.Controls 2.0 23 | import QtQuick.Layouts 1.1 24 | import Fluid.Core 1.0 as FluidCore 25 | import Fluid.Controls 1.1 as FluidControls 26 | 27 | FluidControls.ListItem { 28 | id: listItem 29 | 30 | // TODO : select the right icon for file type. 31 | icon.source: FluidControls.Utils.iconUrl(isDir ? "file/folder" : "editor/insert_drive_file") 32 | text: folderModel.pathTitle(filePath) 33 | subText: folderModel.fileType(mimeType, mimeTypeDescription) 34 | valueText: FluidCore.DateUtils.friendlyTime(modifiedDate, true) 35 | highlighted: ListView.isCurrentItem 36 | 37 | MouseArea { 38 | anchors.fill: parent 39 | 40 | acceptedButtons: Qt.LeftButton | Qt.RightButton 41 | 42 | onClicked: { 43 | if (mouse.button === Qt.RightButton) 44 | selectionManager.toggleIndex(index); 45 | else 46 | folderModel.model.openIndex(index); 47 | } 48 | 49 | onPressAndHold: { 50 | pageStack.push(Qt.resolvedUrl("../SelectionPage.qml")); 51 | selectionManager.toggleIndex(index); 52 | } 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/app/qml/components/FolderListView.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Liri. 3 | * 4 | * Copyright (C) 2018 Pier Luigi Fiorini 5 | * Copyright (C) 2015 Michael Spencer 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | import QtQuick 2.2 22 | import QtQuick.Controls 2.3 23 | import QtQuick.Controls.Material 2.3 24 | import QtQuick.Layouts 1.1 25 | import Fluid.Controls 1.1 as FluidControls 26 | 27 | Item { 28 | id: folderListView 29 | 30 | property alias model: listView.model 31 | property alias delegate: listView.delegate 32 | 33 | Keys.forwardTo: listView 34 | 35 | Pane { 36 | id: header 37 | 38 | visible: listView.count > 0 39 | 40 | Material.elevation: 1 41 | 42 | anchors { 43 | left: parent.left 44 | right: parent.right 45 | top: parent.top 46 | } 47 | 48 | height: 48 49 | 50 | RowLayout { 51 | anchors { 52 | left: parent.left 53 | right: parent.right 54 | margins: 16 55 | } 56 | 57 | height: parent.height - 1 58 | spacing: 16 59 | 60 | Label { 61 | Layout.alignment: Qt.AlignVCenter 62 | Layout.fillWidth: true 63 | 64 | text: qsTr("Name") 65 | color: Material.secondaryTextColor 66 | } 67 | 68 | Label { 69 | Layout.alignment: Qt.AlignVCenter 70 | Layout.preferredWidth: 100 71 | 72 | text: qsTr("Type") 73 | color: Material.secondaryTextColor 74 | } 75 | 76 | Label { 77 | Layout.alignment: Qt.AlignVCenter 78 | Layout.preferredWidth: 100 79 | 80 | text: qsTr("Last modified") 81 | color: Material.secondaryTextColor 82 | } 83 | } 84 | } 85 | 86 | ScrollView { 87 | anchors { 88 | left: parent.left 89 | right: parent.right 90 | top: header.bottom 91 | bottom: parent.bottom 92 | } 93 | 94 | clip: true 95 | 96 | ListView { 97 | id: listView 98 | 99 | Keys.onUpPressed: { 100 | var newIndex = currentIndex - 1; 101 | if (newIndex < 0) 102 | newIndex = 0; 103 | if (currentIndex != newIndex) 104 | selectionManager.toggleIndex(newIndex); 105 | } 106 | Keys.onDownPressed: { 107 | var newIndex = currentIndex + 1; 108 | if (newIndex > count - 1) 109 | newIndex = count - 1; 110 | if (currentIndex != newIndex) 111 | selectionManager.toggleIndex(newIndex); 112 | } 113 | Keys.onEnterPressed: folderModel.model.openIndex(currentIndex) 114 | Keys.onReturnPressed: folderModel.model.openIndex(currentIndex) 115 | 116 | currentIndex: -1 117 | 118 | section.property: "isDir" 119 | section.criteria: ViewSection.FullString 120 | section.delegate: FluidControls.Subheader { 121 | text: section === "true" ? qsTr("Directories") 122 | : qsTr("Files") 123 | } 124 | } 125 | 126 | Connections { 127 | target: selectionManager 128 | onSelectionChanged: { 129 | var indexes = selectionManager.selectedIndexes(); 130 | if (indexes.length === 1) 131 | listView.currentIndex = indexes[0]; 132 | } 133 | } 134 | } 135 | 136 | Label { 137 | anchors.centerIn: parent 138 | 139 | text: qsTr("No files") 140 | color: Material.hintTextColor 141 | font.pixelSize: 25 142 | 143 | visible: listView.count == 0 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /src/app/qml/components/PlacesSidebar.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Liri. 3 | * 4 | * Copyright (C) 2015 Michael Spencer 5 | * 2015 Ricardo Vieira 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | import QtQuick 2.2 22 | import Fluid.Controls 1.1 as FluidControls 23 | 24 | FluidControls.Sidebar { 25 | id: placesSidebar 26 | 27 | Column { 28 | anchors { 29 | left: parent.left 30 | right: parent.right 31 | } 32 | 33 | FluidControls.Subheader { 34 | text: qsTr("Places") 35 | } 36 | 37 | Repeater { 38 | model: folderModel.places 39 | 40 | delegate: FluidControls.ListItem { 41 | id: listItem 42 | 43 | icon.source: FluidControls.Utils.iconUrl(folderModel.pathIcon(path)) 44 | text: folderModel.pathTitle(path) 45 | highlighted: folderModel.path == path 46 | 47 | onClicked: folderModel.goTo(path) 48 | } 49 | } 50 | 51 | FluidControls.ListItem { 52 | id: trashItem 53 | 54 | icon.source: FluidControls.Utils.iconUrl("action/delete") 55 | text: qsTr("Trash") 56 | 57 | onClicked: pageStack.push(Qt.resolvedUrl("../TrashPage.qml")); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/app/qml/components/SelectionListItem.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Liri. 3 | * 4 | * Copyright (C) 2018 Pier Luigi Fiorini 5 | * Copyright (C) 2015 Michael Spencer 6 | * 2015 Ricardo Vieira 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | import QtQuick 2.2 23 | import QtQuick.Controls 2.0 24 | import QtQuick.Controls.Material 2.0 25 | import Fluid.Core 1.0 as FluidCore 26 | import Fluid.Controls 1.1 as FluidControls 27 | 28 | FluidControls.ListItem { 29 | id: listItem 30 | 31 | // TODO : select the right icon for file type. 32 | text: folderModel.pathTitle(filePath) 33 | 34 | onClicked: { 35 | selectionManager.toggleIndex(index); 36 | } 37 | 38 | leftItem: CheckBox { 39 | id: checkBox 40 | anchors { 41 | verticalCenter: parent.verticalCenter 42 | left: parent.left 43 | } 44 | checked: isSelected 45 | enabled: false 46 | } 47 | 48 | secondaryItem: Row { 49 | spacing: 16 50 | 51 | Label { 52 | width: 100 53 | text: folderModel.fileType(mimeType, mimeTypeDescription) 54 | elide: Text.ElideRight 55 | color: Material.secondaryTextColor 56 | } 57 | 58 | Label { 59 | width: 100 60 | text: FluidCore.DateUtils.friendlyTime(modifiedDate, true) 61 | elide: Text.ElideRight 62 | color: Material.secondaryTextColor 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/app/qml/dialogs/SettingsDialog.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Liri. 3 | * 4 | * Copyright (C) 2015 Ricardo Vieira 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | import QtQuick 2.2 21 | import QtQuick.Controls 2.1 22 | import Fluid.Controls 1.1 as FluidControls 23 | 24 | Dialog { 25 | title: qsTr("Settings") 26 | modal: true 27 | focus: true 28 | 29 | x: (parent.width - width) / 2 30 | y: (parent.height - height) / 2 31 | 32 | width: 400 33 | 34 | Column { 35 | id: settingsList 36 | anchors.left: parent.left 37 | anchors.right: parent.right 38 | CheckBox { 39 | id: hiddenCheck 40 | text: qsTr("Show hidden files") 41 | checked: folderModel.model.showHiddenFiles 42 | onClicked: folderModel.model.toggleShowHiddenFiles(); 43 | 44 | // If the checkbox is clicked it loses the connection with 45 | // folderModel.model.showHiddenFiles so we need connect to the signal 46 | Connections { 47 | target: folderModel.model 48 | onShowHiddenFilesChanged: 49 | hiddenCheck.checked = folderModel.model.showHiddenFiles 50 | } 51 | } 52 | FluidControls.ListItem { 53 | text: qsTr("Sort by:") 54 | rightItem: ComboBox { 55 | id: sortByMenu 56 | anchors.centerIn: parent 57 | model: [qsTr("Name"), qsTr("Date")] 58 | currentIndex: folderModel.model.sortBy 59 | onCurrentIndexChanged: folderModel.model.sortBy = currentIndex 60 | } 61 | } 62 | FluidControls.ListItem { 63 | text: qsTr("Sort order:") 64 | rightItem: ComboBox { 65 | id: sortOrderMenu 66 | anchors.centerIn: parent 67 | model: [qsTr("Ascending"), qsTr("Descending")] 68 | currentIndex: folderModel.model.sortOrder 69 | onCurrentIndexChanged: folderModel.model.sortOrder = currentIndex 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/app/qml/main.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Liri. 3 | * 4 | * Copyright (C) 2015 Michael Spencer 5 | * 2015 Ricardo Vieira 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | import QtQuick 2.2 22 | import QtQuick.Controls 2.3 23 | import QtQuick.Controls.Material 2.3 24 | import Fluid.Controls 1.1 as FluidControls 25 | import Liri.Files.FolderListModel 1.0 26 | import "backend" 27 | import "dialogs" 28 | 29 | FluidControls.ApplicationWindow { 30 | id: app 31 | 32 | property FolderListSelection selectionManager: folderModel.model.selectionObject() 33 | 34 | title: qsTr("Files") 35 | width: 1000 36 | height: 800 37 | visible: true 38 | 39 | initialPage: FolderPage { 40 | id: folderPage 41 | } 42 | 43 | Material.primary: Material.Blue 44 | Material.accent: Material.LightBlue 45 | 46 | function confirmAction(title, text, primaryButton, callback) { 47 | confirmDialog.title = title; 48 | confirmDialog.text = text; 49 | confirmDialog.standardButton(Dialog.Yes).text = primaryButton; 50 | confirmDialog.callback = callback; 51 | confirmDialog.open(); 52 | } 53 | 54 | FolderModel { 55 | id: folderModel 56 | 57 | path: places.locationHome 58 | } 59 | 60 | SettingsDialog { 61 | id: settings 62 | } 63 | 64 | FluidControls.AlertDialog { 65 | id: confirmDialog 66 | 67 | property var callback 68 | 69 | modal: true 70 | focus: true 71 | standardButtons: Dialog.Yes | Dialog.No 72 | 73 | x: (parent.width - width) / 2 74 | y: (parent.height - height) / 2 75 | 76 | width: 400 77 | 78 | onAccepted: callback() 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/imports/archives/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | liri_add_qml_plugin(FilesArchivesQmlPlugin 2 | MODULE_PATH 3 | "Liri/Files/Archives" 4 | OUTPUT_NAME 5 | archivesplugin 6 | SOURCES 7 | archives.cpp 8 | archives.h 9 | plugin.cpp 10 | QML_FILES 11 | qmldir 12 | DEFINES 13 | #QT_NO_CAST_FROM_ASCII 14 | QT_NO_FOREACH 15 | ) 16 | 17 | liri_finalize_qml_plugin(FilesArchivesQmlPlugin) 18 | -------------------------------------------------------------------------------- /src/imports/archives/archives.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Canonical Ltd 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 3 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Author : Niklas Wenzel 17 | */ 18 | 19 | #include "archives.h" 20 | #include "QDebug" 21 | 22 | void Archives::extractZip(const QString path, const QString destination) 23 | { 24 | QString program = "unzip"; // This programm is available in the images as it is one of the dependencies of the ubuntu-download-manager package. 25 | QStringList arguments; 26 | arguments << path << "-d" << destination; 27 | 28 | extractArchive(program, arguments); 29 | } 30 | 31 | void Archives::extractTar(const QString path, const QString destination) 32 | { 33 | QString program = "tar"; 34 | QStringList arguments; 35 | arguments << "xf" << path << "-C" << destination; 36 | 37 | extractArchive(program, arguments); 38 | } 39 | 40 | void Archives::extractArchive(const QString program, const QStringList arguments) 41 | { 42 | if (_process != nullptr && _process->state() == QProcess::ProcessState::Running) { 43 | return; // Do not allow two extractions running in parallel. Due to the way this is used in QML parallelization is not needed. 44 | } 45 | 46 | _process = new QProcess(this); 47 | 48 | // Connect to internal slots in order to have one unified onFinished slot handling both events for QML. 49 | connect(_process, 50 | static_cast 51 | (&QProcess::finished), this, &Archives::_onFinished); 52 | connect(_process, 53 | static_cast 54 | (&QProcess::error), this, &Archives::_onError); 55 | connect(this, &Archives::killProcess, 56 | _process, &QProcess::kill); 57 | 58 | _process->start(program, arguments); 59 | } 60 | 61 | void Archives::cancelArchiveExtraction() 62 | { 63 | qDebug() << "Cancelling archive extraction"; 64 | emit killProcess(); 65 | } 66 | 67 | void Archives::_onError(QProcess::ProcessError error) 68 | { 69 | qDebug() << "Extraction failed (1) with the following error:" << _process->readAllStandardError(); 70 | emit finished(false, error); 71 | } 72 | 73 | void Archives::_onFinished(int exitCode, QProcess::ExitStatus exitStatus) 74 | { 75 | if ((exitStatus == QProcess::NormalExit || exitCode == 0) && _process->readAllStandardError().trimmed().isEmpty()) { 76 | emit finished(true, -1); 77 | } else { 78 | qDebug() << "Extraction failed (2) with the following error:" << _process->readAllStandardError(); 79 | emit finished(false, -1); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/imports/archives/archives.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Canonical Ltd 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 3 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Author : Niklas Wenzel 17 | */ 18 | 19 | #ifndef ARCHIVES_H 20 | #define ARCHIVES_H 21 | 22 | #include 23 | #include 24 | 25 | class Archives : public QObject 26 | { 27 | Q_OBJECT 28 | 29 | public: 30 | Q_INVOKABLE void extractZip(const QString path, const QString destination); 31 | Q_INVOKABLE void extractTar(const QString path, const QString destination); 32 | Q_INVOKABLE void cancelArchiveExtraction(); 33 | 34 | signals: 35 | void finished(bool success, int errorCode); 36 | void killProcess(); 37 | 38 | private slots: 39 | void _onError(QProcess::ProcessError error); 40 | void _onFinished(int exitCode, QProcess::ExitStatus exitStatus); 41 | 42 | private: 43 | void extractArchive(const QString program, const QStringList arguments); 44 | 45 | QProcess* _process = nullptr; 46 | }; 47 | 48 | 49 | #endif // ARCHIVES_H 50 | -------------------------------------------------------------------------------- /src/imports/archives/archives.qbs: -------------------------------------------------------------------------------- 1 | import qbs 1.0 2 | 3 | LiriQmlPlugin { 4 | name: "archivesplugin" 5 | pluginPath: "Liri/Files/Archives" 6 | 7 | Depends { name: "lirideployment" } 8 | Depends { name: "cpp" } 9 | Depends { name: "Qt"; submodules: ["qml", "quick"] } 10 | 11 | cpp.defines: [] 12 | 13 | files: ["*.cpp", "*.h", "qmldir", "*.qml"] 14 | } 15 | -------------------------------------------------------------------------------- /src/imports/archives/plugin.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * This file is part of Files. 3 | * 4 | * Copyright (C) 2016 Pier Luigi Fiorini 5 | * 6 | * $BEGIN_LICENSE:GPL3+$ 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * $END_LICENSE$ 22 | ***************************************************************************/ 23 | 24 | #include 25 | 26 | #include "archives.h" 27 | 28 | class ArchivesPlugin : public QQmlExtensionPlugin 29 | { 30 | Q_OBJECT 31 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") 32 | public: 33 | void registerTypes(const char *uri); 34 | }; 35 | 36 | void ArchivesPlugin::registerTypes(const char *uri) 37 | { 38 | Q_ASSERT(uri == QLatin1String("Liri.Files.Archives")); 39 | 40 | qmlRegisterType(uri, 0, 1, "Archives"); 41 | } 42 | 43 | #include "plugin.moc" 44 | -------------------------------------------------------------------------------- /src/imports/archives/qmldir: -------------------------------------------------------------------------------- 1 | module Liri.Files.Archives 2 | plugin archivesplugin 3 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(FILES_ENABLE_TAGLIB) 2 | set(Files_DEFINES) 3 | find_package(Taglib) 4 | if(TARGET PkgConfig::Taglib) 5 | set(Files_LIBRARIES PkgConfig::Taglib) 6 | else() 7 | set(Files_DEFINES DO_NOT_USE_TAG_LIB) 8 | endif() 9 | else() 10 | set(Files_DEFINES DO_NOT_USE_TAG_LIB) 11 | endif() 12 | 13 | liri_add_qml_plugin(FilesFolderListModelQmlPlugin 14 | MODULE_PATH 15 | "Liri/Files/FolderListModel" 16 | OUTPUT_NAME 17 | folderlistmodelplugin 18 | SOURCES 19 | clipboard.cpp 20 | clipboard.h 21 | diritemabstractlistmodel.h 22 | diriteminfo.cpp 23 | diriteminfo.h 24 | dirmodel.cpp 25 | dirmodel.h 26 | dirselection.cpp 27 | dirselection.h 28 | disk/disklocation.cpp 29 | disk/disklocation.h 30 | externalfswatcher.cpp 31 | externalfswatcher.h 32 | filecompare.cpp 33 | filecompare.h 34 | filesystemaction.cpp 35 | filesystemaction.h 36 | fmutil.cpp 37 | fmutil.h 38 | folderlistmodel.qbs 39 | imageprovider.cpp 40 | imageprovider.h 41 | iorequest.cpp 42 | iorequest.h 43 | iorequestworker.cpp 44 | iorequestworker.h 45 | ioworkerthread.cpp 46 | ioworkerthread.h 47 | location.cpp 48 | location.h 49 | locationsfactory.cpp 50 | locationsfactory.h 51 | locationurl.cpp 52 | locationurl.h 53 | plugin.cpp 54 | plugin.h 55 | trash/qtrashdir.cpp 56 | trash/qtrashdir.h 57 | trash/qtrashutilinfo.cpp 58 | trash/qtrashutilinfo.h 59 | trash/trashiteminfo.cpp 60 | trash/trashiteminfo.h 61 | trash/trashlocation.cpp 62 | trash/trashlocation.h 63 | QML_FILES 64 | qmldir 65 | DEFINES 66 | #QT_NO_CAST_FROM_ASCII 67 | #QT_NO_FOREACH 68 | ${Files_DEFINES} 69 | INCLUDE_DIRECTORIES 70 | "${CMAKE_CURRENT_SOURCE_DIR}/disk" 71 | "${CMAKE_CURRENT_SOURCE_DIR}/trash" 72 | LIBRARIES 73 | Qt5::Widgets 74 | ${Files_LIBRARIES} 75 | ) 76 | 77 | liri_finalize_qml_plugin(FilesFolderListModelQmlPlugin) 78 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/clipboard.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * You may use this file under the terms of the BSD license as follows: 7 | * 8 | * "Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * * Neither the name of Nemo Mobile nor the names of its contributors 18 | * may be used to endorse or promote products derived from this 19 | * software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 32 | * 33 | * File: clipboard.h 34 | * Date: 1/22/2014 35 | */ 36 | 37 | #ifndef CLIPBOARD_H 38 | #define CLIPBOARD_H 39 | 40 | #include 41 | #include 42 | #include 43 | 44 | class DirModelMimeData; 45 | 46 | enum ClipboardOperation 47 | { 48 | NoClipboard, ClipboardCopy, ClipboardCut 49 | }; 50 | 51 | 52 | 53 | /*! 54 | * \brief The Clipboard class handles global clipboard storage 55 | */ 56 | class Clipboard : public QObject 57 | { 58 | Q_OBJECT 59 | public: 60 | explicit Clipboard(QObject *parent = 0); 61 | ~Clipboard(); 62 | QStringList paste(ClipboardOperation& operation); 63 | int clipboardLocalUrlsCounter(); 64 | inline bool hasClipboardModifiedByOtherApplication() const {return m_clipboardModifiedByOther;} 65 | 66 | public slots: 67 | void cut(const QStringList& names, const QString &path); 68 | void copy(const QStringList& names, const QString &path); 69 | void clear(); 70 | 71 | signals: 72 | void clipboardChanged(); 73 | 74 | private slots: 75 | void onClipboardChanged (); 76 | 77 | private: 78 | void storeOnClipboard(const QStringList &names, 79 | ClipboardOperation op, 80 | const QString &curPath); 81 | private: 82 | DirModelMimeData * m_mimeData; 83 | bool m_clipboardModifiedByOther; 84 | }; 85 | 86 | 87 | 88 | /*! 89 | * \brief The DirModelMimeData class is the storage on Clipboard 90 | */ 91 | class DirModelMimeData : public QMimeData 92 | { 93 | public: 94 | explicit DirModelMimeData(); 95 | ~DirModelMimeData(); 96 | virtual QStringList formats() const { return m_formats; } 97 | virtual bool hasFormat ( const QString & mimeType ) const; 98 | 99 | public: 100 | enum ClipBoardDataOwner 101 | { 102 | Nobody, // might have failed 103 | Application, 104 | MySelf 105 | }; 106 | 107 | ClipBoardDataOwner setIntoClipboard(const QStringList& files, 108 | const QString &path, 109 | ClipboardOperation operation); 110 | const QMimeData * clipboardMimeData(); 111 | QStringList localUrls(ClipboardOperation& operation); 112 | 113 | private: 114 | static QList gnomeUrls(const QMimeData *mime, ClipboardOperation& operation); 115 | ClipboardOperation clipBoardOperation(); 116 | bool fillClipboard(const QStringList& files, const QString &path, ClipboardOperation operation); 117 | QStringList makeFullPath(const QStringList& files, const QString &path); 118 | bool testClipboardContent(const QStringList& files, const QString &path); 119 | 120 | private: 121 | QStringList m_formats; 122 | const QMimeData * m_appMime; 123 | QByteArray m_gnomeData; 124 | QList m_urls; 125 | static DirModelMimeData* m_globalMimeData; //!< some mobile devices do not use X, they may not have clipboard 126 | static int m_instances; 127 | }; 128 | 129 | 130 | 131 | #endif //CLIPBOARD_H 132 | 133 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/diritemabstractlistmodel.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: diritemabstractlistmodel.h 19 | * Date: 30/01/2014 20 | */ 21 | 22 | #ifndef DIRITEMABSTRACTLISTMODEL_H 23 | #define DIRITEMABSTRACTLISTMODEL_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | 30 | class DirItemInfo; 31 | class DirItemModel; 32 | 33 | class DirItemAbstractListModel : public QAbstractListModel 34 | { 35 | Q_OBJECT 36 | public: 37 | virtual int getIndex(const QString& name) = 0; 38 | virtual void notifyItemChanged(int index) = 0; 39 | protected: 40 | explicit DirItemAbstractListModel(QObject *parent = 0) : 41 | QAbstractListModel(parent) 42 | { 43 | } 44 | }; 45 | 46 | #endif // DIRITEMABSTRACTLISTMODEL_H 47 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/dirselection.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: dirselection.h 19 | * Date: 29/01/2014 20 | */ 21 | 22 | #ifndef DIRSELECTION_H 23 | #define DIRSELECTION_H 24 | 25 | #include "diriteminfo.h" 26 | 27 | #include 28 | #include 29 | 30 | 31 | class DirItemAbstractListModel; 32 | 33 | class DirSelection : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit DirSelection(DirItemAbstractListModel *parent, DirItemInfoList *listItems); 38 | explicit DirSelection(QObject *parent = 0); 39 | 40 | public slots: 41 | void selectRange(int indexClicked); 42 | void selectAll(); 43 | void clear(); 44 | void toggleIndex(int index); 45 | void setIndex(int index, bool selected); 46 | void setMultiSelection(bool enable); 47 | 48 | public: 49 | Q_ENUMS(Mode) 50 | enum Mode 51 | { 52 | Single, 53 | Multi 54 | }; 55 | Q_PROPERTY(int counter READ counter NOTIFY selectionChanged) 56 | Q_PROPERTY(Mode mode READ mode WRITE setMode NOTIFY modeChanged) 57 | Q_INVOKABLE QStringList selectedNames() const; 58 | Q_INVOKABLE void setMode(Mode m); 59 | Q_INVOKABLE QStringList selectedAbsFilePaths() const; //full path 60 | Q_INVOKABLE QList selectedIndexes() const; 61 | int counter() const; 62 | Mode mode() const; 63 | 64 | public: 65 | /*! 66 | * It allows to pass Control Modifiers directly to perform the most common selection behaviour. 67 | * 68 | * Usage Example: 69 | * \li 1 When selecting an item with Shit key pressed it selects the rage calling \ref selectRange() 70 | * \li 2 When selecting an item with Crtl key pressed it temporarily forces Multi Selection Mode 71 | * calling \ref toggleIndex() instead of \ref setIndex(); 72 | * 73 | * \param range when true it calls \ref selectRange() and does not consider the \a multiSelection parameter 74 | * 75 | * \param multiSelection when \a false it respects the current selection mode: calls \ref setIndex() 76 | * for \ref Single selection mode or \ref toggleIndex() for \ref Multi selection mode. 77 | * When \a true it calls \ref toggleIndex() 78 | * 79 | * QML example: 80 | * \code 81 | * property FolderListSelection selectionManager: pageModel.selectionObject() 82 | * ... 83 | * 84 | * MouseArea { 85 | * anchors.fill: parent 86 | * onClicked: { 87 | * selectionManager.select(model.index, 88 | * (mouse.modifiers & Qt.ShiftModifier), 89 | * (mouse.modifiers & Qt.ControlModifier) ); 90 | * } 91 | * } 92 | * \endcode 93 | * 94 | */ 95 | Q_INVOKABLE void select(int index, bool range, bool multiSelection ); 96 | 97 | public: 98 | void itemGoingToBeRemoved(const DirItemInfo& item); 99 | void itemGoingToBeReplaced(const DirItemInfo& oldItemInfo, const DirItemInfo& newItemInfo); 100 | 101 | private: 102 | bool priv_clear(); 103 | void notifyChanges(); 104 | bool priv_setIndex(int index, bool selected); 105 | 106 | signals: 107 | void selectionChanged(int); 108 | void modeChanged(int); 109 | 110 | private: 111 | int m_selectedCounter; 112 | DirItemAbstractListModel* m_model; 113 | DirItemInfoList * m_listItems; 114 | Mode m_mode; 115 | int m_lastSelectedItem; 116 | }; 117 | 118 | #endif // DIRSELECTION_H 119 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/disk/disklocation.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: disklocation.h 19 | * Date: 08/03/2014 20 | */ 21 | 22 | #ifndef DISKLOCATION_H 23 | #define DISKLOCATION_H 24 | 25 | #include "location.h" 26 | #include 27 | 28 | /*! 29 | * When the External File System Wathcer is enabled, 30 | * this is the interval used to check if there has been any change in the current path 31 | * 32 | * \sa setEnabledExternalFSWatcher() 33 | */ 34 | #define EX_FS_WATCHER_TIMER_INTERVAL 900 35 | 36 | 37 | class ExternalFSWatcher; 38 | class ExternalFileSystemChangesWorker; 39 | 40 | /*! 41 | * \brief The DiskLocation class extends \ref Location for Local Disk and provides a External File System watcher 42 | */ 43 | class DiskLocation : public Location 44 | { 45 | Q_OBJECT 46 | public: 47 | explicit DiskLocation(int type, QObject *parent=0); 48 | virtual ~DiskLocation(); 49 | 50 | ExternalFSWatcher * getExternalFSWatcher() const; 51 | 52 | virtual void fetchItems(QDir::Filter dirFilter, bool recursive = false) ; 53 | virtual void fetchExternalChanges(const QString& urlPath, 54 | const DirItemInfoList& list, 55 | QDir::Filter dirFilter) ; 56 | virtual bool becomeParent(); 57 | virtual void refreshInfo(); 58 | 59 | virtual void startExternalFsWatcher(); 60 | virtual void stopExternalFsWatcher(); 61 | 62 | virtual void startWorking(); 63 | virtual void stopWorking(); 64 | 65 | virtual DirItemInfo *validateUrlPath(const QString& urlPath); 66 | 67 | protected: 68 | void addExternalFsWorkerRequest(ExternalFileSystemChangesWorker *); 69 | 70 | public slots: 71 | virtual void setUsingExternalWatcher(bool use); 72 | 73 | protected slots: 74 | void onItemsFetched(); 75 | 76 | protected: 77 | ExternalFSWatcher * m_extWatcher ; 78 | 79 | }; 80 | 81 | #endif // DISKLOCATION_H 82 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/externalfswatcher.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2013 Canonical Ltd. 4 | * Copyright 2013 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: externalfswatcher.h 19 | * Date: 9/14/2013 20 | */ 21 | 22 | #ifndef EXTERNALFSWATCHER_H 23 | #define EXTERNALFSWATCHER_H 24 | 25 | #include 26 | #include 27 | 28 | #define DEFAULT_NOTICATION_PERIOD 500 29 | 30 | 31 | /*! 32 | * \brief The ExternalFSWatcher class watches for external changes in Disk emitting pathModified() signal. 33 | * 34 | * The path(s) being watched is/are set by using the slot \ref setCurrentPath() or \ref setCurrentPaths() 35 | * 36 | * The idea of this class is to minimize notifications as the current path in the File Manager can change quickly. 37 | * A notification will occur if it was requested for a path and this path is still the current at the moment 38 | * of the notification. 39 | * 40 | * Once it detects a Disk change it will wait \ref getIntervalToNotifyChanges() milliseconds to notify that change. 41 | * During the time it waits: 42 | * \li the notified path will NOT be watched until pathModified() is emitted 43 | * \li another call to \ref setCurrentPath() or \ref setCurrentPaths() invalidades the current change, 44 | * that mean the signal pathModified() will NOT be emitted. 45 | * 46 | * \note When more than one path is being watched by using \ref setCurrentPaths() and changes happen in 47 | * more than one path before the getIntervalToNotifyChanges() expires, only the LAST path modified 48 | * will be notified as changed. It may possible that it goes to a loop if all the paths were modified, 49 | * but the loop finishes when the last one from the list is modified. 50 | */ 51 | class ExternalFSWatcher : public QFileSystemWatcher 52 | { 53 | Q_OBJECT 54 | public: 55 | explicit ExternalFSWatcher(QObject *parent = 0); 56 | int getIntervalToNotifyChanges() const; 57 | 58 | inline const QStringList& pathsWatched() const { return m_setPaths;} 59 | 60 | signals: 61 | void pathModified(const QString& path); 62 | 63 | public slots: 64 | void setCurrentPath(const QString& curPath); 65 | void setCurrentPaths(const QStringList& paths); 66 | void setIntervalToNotifyChanges(int ms); 67 | 68 | private slots: 69 | void slotDirChanged(const QString&); 70 | void slotFireChanges(); 71 | 72 | private: 73 | void clearPaths(); 74 | 75 | private: 76 | QStringList m_setPaths; 77 | QString m_changedPath; 78 | unsigned m_waitingEmitCounter; 79 | int m_msWaitTime; 80 | int m_lastChangedIndex; 81 | }; 82 | 83 | #endif // EXTERNALFSWATCHER_H 84 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/filecompare.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2013 Canonical Ltd. 4 | * Copyright 2013 Carlos J Mazieri 5 | * 6 | * You may use this file under the terms of the BSD license as follows: 7 | * 8 | * "Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * * Neither the name of Nemo Mobile nor the names of its contributors 18 | * may be used to endorse or promote products derived from this 19 | * software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 32 | * 33 | * File: filecompare.cpp 34 | * Date: 6/25/2013 35 | */ 36 | 37 | #include "filecompare.h" 38 | #include "diriteminfo.h" 39 | #include 40 | #include 41 | #include 42 | 43 | 44 | 45 | bool fileCompareExists(const DirItemInfo &a, const DirItemInfo &b) 46 | { 47 | if (a.isDir() && !b.isDir()) 48 | return true; 49 | 50 | if (b.isDir() && !a.isDir()) 51 | return false; 52 | 53 | bool ret = QString::localeAwareCompare(a.absoluteFilePath(), b.absoluteFilePath()) < 0; 54 | #if DEBUG_MESSAGES 55 | qDebug() << Q_FUNC_INFO << ret << a.absoluteFilePath() << b.absoluteFilePath(); 56 | #endif 57 | return ret; 58 | } 59 | 60 | 61 | bool fileCompareAscending(const DirItemInfo &a, const DirItemInfo &b) 62 | { 63 | if (a.isDir() && !b.isDir()) 64 | return true; 65 | 66 | if (b.isDir() && !a.isDir()) 67 | return false; 68 | 69 | return QString::localeAwareCompare(a.fileName(), b.fileName()) < 0; 70 | } 71 | 72 | 73 | bool fileCompareDescending(const DirItemInfo &a, const DirItemInfo &b) 74 | { 75 | if (a.isDir() && !b.isDir()) 76 | return true; 77 | 78 | if (b.isDir() && !a.isDir()) 79 | return false; 80 | 81 | return QString::localeAwareCompare(a.fileName(), b.fileName()) > 0; 82 | } 83 | 84 | 85 | bool dateCompareDescending(const DirItemInfo &a, const DirItemInfo &b) 86 | { 87 | if (a.isDir() && !b.isDir()) 88 | return true; 89 | 90 | if (b.isDir() && !a.isDir()) 91 | return false; 92 | 93 | return a.lastModified() > b.lastModified(); 94 | } 95 | 96 | 97 | bool dateCompareAscending(const DirItemInfo &a, const DirItemInfo &b) 98 | { 99 | if (a.isDir() && !b.isDir()) 100 | return true; 101 | 102 | if (b.isDir() && !a.isDir()) 103 | return false; 104 | 105 | return a.lastModified() < b.lastModified(); 106 | } 107 | 108 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/filecompare.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2013 Canonical Ltd. 4 | * Copyright 2013 Carlos J Mazieri 5 | * 6 | * You may use this file under the terms of the BSD license as follows: 7 | * 8 | * "Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * * Neither the name of Nemo Mobile nor the names of its contributors 18 | * may be used to endorse or promote products derived from this 19 | * software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 32 | * 33 | * File: filecompare.h 34 | * Date: 6/25/2013 35 | */ 36 | 37 | #ifndef FILECOMPARE_H 38 | #define FILECOMPARE_H 39 | 40 | class DirItemInfo; 41 | 42 | typedef bool (*CompareFunction)(const DirItemInfo &a, const DirItemInfo &b); 43 | 44 | bool fileCompareExists(const DirItemInfo &a, const DirItemInfo &b); 45 | bool fileCompareAscending(const DirItemInfo &a, const DirItemInfo &b); 46 | bool fileCompareDescending(const DirItemInfo &a, const DirItemInfo &b); 47 | 48 | bool dateCompareDescending(const DirItemInfo &a, const DirItemInfo &b); 49 | bool dateCompareAscending(const DirItemInfo &a, const DirItemInfo &b); 50 | 51 | #endif // FILECOMPARE_H 52 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/fmutil.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: fmutil.cpp 19 | * Date: 29/01/2014 20 | */ 21 | 22 | #include "fmutil.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | bool FMUtil::m_triedThemeName = false; 30 | 31 | FMUtil::FMUtil() 32 | { 33 | } 34 | 35 | 36 | /*! 37 | * \brief FMUtil::setThemeName() tries to set a theme name in order to get icons 38 | */ 39 | void FMUtil::setThemeName() 40 | { 41 | QString name; 42 | //set saying we have tried to set ThemeName 43 | m_triedThemeName = true; 44 | QLatin1String ubuntu_mobileTheme("ubuntu-mobile"); 45 | QStringList paths(QIcon::themeSearchPaths()); 46 | #if defined(Q_OS_UNIX) 47 | if (paths.isEmpty()) 48 | { 49 | paths.append(QLatin1String("/usr/share/icons")); 50 | } 51 | #endif 52 | foreach (const QString& dir, paths) 53 | { 54 | QDir D(dir); 55 | if (D.exists()) 56 | { 57 | #if DEBUG_MESSAGES 58 | qDebug() << Q_FUNC_INFO << "trying theme on Dir" << D.path(); 59 | #endif 60 | QFileInfoList inf = D.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::System ); 61 | int counter = inf.count(); 62 | //specific names 63 | while (counter--) 64 | { 65 | if (inf.at(counter).fileName() == ubuntu_mobileTheme) 66 | { 67 | if (testThemeName(ubuntu_mobileTheme)) 68 | { 69 | return; 70 | } 71 | else 72 | { 73 | inf.removeAt(counter); 74 | } 75 | } 76 | } 77 | //try symlinks 78 | counter = inf.count(); 79 | while (counter--) 80 | { 81 | if (inf.at(counter).isSymLink()) 82 | { 83 | if (testThemeName(inf.at(counter).fileName())) 84 | { 85 | return; 86 | } 87 | else 88 | { 89 | inf.removeAt(counter); 90 | } 91 | } 92 | } 93 | //try common directories 94 | counter = inf.count(); 95 | while (counter--) 96 | { 97 | if (testThemeName(inf.at(counter).fileName())) 98 | { 99 | return; 100 | } 101 | } 102 | } 103 | } 104 | name.clear(); 105 | QIcon::setThemeName(name); 106 | } 107 | 108 | 109 | bool FMUtil::testThemeName(const QString& themeName) 110 | { 111 | QMimeDatabase mimeBase; 112 | QStringList mimesToTest = QStringList() 113 | << "text/plain" 114 | << "inode/directory" 115 | << "application/pdf" 116 | << "application/postscript" 117 | << "application/x-gzip"; 118 | 119 | QIcon::setThemeName(themeName); 120 | bool hasTheme = true; 121 | int counter = mimesToTest.count(); 122 | while(hasTheme && counter--) 123 | { 124 | QMimeType mimetype = mimeBase.mimeTypeForName(mimesToTest.at(counter)); 125 | hasTheme = QIcon::hasThemeIcon( mimetype.iconName() ) || 126 | QIcon::hasThemeIcon( mimetype.genericIconName() ) ; 127 | } 128 | #if DEBUG_MESSAGES 129 | qDebug() << Q_FUNC_INFO << "trying theme name" << themeName << "ret=" << hasTheme; 130 | #endif 131 | return hasTheme; 132 | } 133 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/fmutil.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: fmutil.h 19 | * Date: 29/01/2014 20 | */ 21 | 22 | #ifndef FMUTIL_H 23 | #define FMUTIL_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | /*! 30 | * \brief The FMUtil class provides some utitlities 31 | */ 32 | class FMUtil 33 | { 34 | public: 35 | static void setThemeName(); 36 | static inline bool hasTriedThemeName() { return m_triedThemeName; } 37 | 38 | private: 39 | FMUtil(); 40 | static bool testThemeName(const QString& themeName); 41 | 42 | private: 43 | static bool m_triedThemeName; 44 | }; 45 | 46 | #endif // FMUTIL_H 47 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/folderlistmodel.qbs: -------------------------------------------------------------------------------- 1 | import qbs 1.0 2 | 3 | LiriQmlPlugin { 4 | name: "folderlistmodelplugin" 5 | pluginPath: "Liri/Files/FolderListModel" 6 | 7 | Depends { name: "Qt"; submodules: ["widgets"] } 8 | Depends { name: "taglib"; condition: project.enableTaglib; required: false } 9 | 10 | cpp.defines: { 11 | var defines = []; 12 | if (project.enableTaglib && !taglib.found) 13 | defines.push("DO_NOT_USE_TAG_LIB"); 14 | return defines; 15 | } 16 | cpp.includePaths: base.concat(["disk", "trash"]) 17 | 18 | files: ["**/*.cpp", "**/*.h", "qmldir", "*.qml"] 19 | } 20 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/imageprovider.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/ 5 | ** 6 | ** This file is part of the demonstration applications of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor 21 | ** the names of its contributors may be used to endorse or promote 22 | ** products derived from this software without specific prior written 23 | ** permission. 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | 41 | #include "imageprovider.h" 42 | 43 | #ifndef DO_NOT_USE_TAG_LIB 44 | #include 45 | #include 46 | #include 47 | #endif 48 | 49 | #include 50 | #include 51 | #include 52 | 53 | 54 | CoverArtImageProvider::CoverArtImageProvider() : QQuickImageProvider(QQuickImageProvider::Image) {} 55 | 56 | QImage CoverArtImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize) 57 | { 58 | Q_UNUSED(size); 59 | Q_UNUSED(requestedSize); 60 | QImage img; 61 | #ifndef DO_NOT_USE_TAG_LIB 62 | TagLib::MPEG::File mp3(id.toStdString().c_str(), true, TagLib::MPEG::Properties::Fast); 63 | TagLib::ID3v2::FrameList list = mp3.ID3v2Tag()->frameListMap()["APIC"]; 64 | if(!list.isEmpty()) { 65 | TagLib::ID3v2::AttachedPictureFrame *Pic = static_cast(list.front()); 66 | img.loadFromData((const uchar *) Pic->picture().data(), Pic->picture().size()); 67 | img = img.scaled(45,45); 68 | } 69 | #endif 70 | return img; 71 | } 72 | 73 | 74 | CoverArtFullImageProvider::CoverArtFullImageProvider() : QQuickImageProvider(QQuickImageProvider::Image) {} 75 | 76 | QImage CoverArtFullImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize) 77 | { 78 | Q_UNUSED(size); 79 | Q_UNUSED(requestedSize); 80 | QImage img; 81 | #ifndef DO_NOT_USE_TAG_LIB 82 | TagLib::MPEG::File mp3(id.toStdString().c_str(), true, TagLib::MPEG::Properties::Fast); 83 | TagLib::ID3v2::FrameList list = mp3.ID3v2Tag()->frameListMap()["APIC"]; 84 | if(!list.isEmpty()) { 85 | TagLib::ID3v2::AttachedPictureFrame *Pic = static_cast(list.front()); 86 | img.loadFromData((const uchar *) Pic->picture().data(), Pic->picture().size()); 87 | img = img.scaled(300,300); 88 | } 89 | #endif 90 | return img; 91 | } 92 | 93 | 94 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/imageprovider.h: -------------------------------------------------------------------------------- 1 | #ifndef IMAGEPROVIDER_H 2 | #define IMAGEPROVIDER_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | 10 | class CoverArtImageProvider : public QQuickImageProvider 11 | { 12 | public: 13 | explicit CoverArtImageProvider(); 14 | 15 | QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize); 16 | 17 | }; 18 | 19 | class CoverArtFullImageProvider : public QQuickImageProvider 20 | { 21 | public: 22 | explicit CoverArtFullImageProvider(); 23 | 24 | QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize); 25 | 26 | }; 27 | 28 | 29 | #endif // IMAGEPROVIDER_H 30 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/iorequestworker.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Robin Burchell 3 | * 4 | * You may use this file under the terms of the BSD license as follows: 5 | * 6 | * "Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * * Neither the name of Nemo Mobile nor the names of its contributors 16 | * may be used to endorse or promote products derived from this 17 | * software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 30 | */ 31 | 32 | #include "iorequestworker.h" 33 | #include "iorequest.h" 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | /*! 40 | Lives on an IOWorkerThread. 41 | 42 | Responsible for running IORequest jobs on the thread instance, and 43 | disposing of their resources once they are done. 44 | */ 45 | IORequestWorker::IORequestWorker() 46 | : QThread() 47 | , mTimeToQuit(false) 48 | { 49 | } 50 | 51 | void IORequestWorker::addRequest(IORequest *request) 52 | { 53 | #if DEBUG_EXT_FS_WATCHER 54 | qDebug() << "[exfsWatcher]" << QDateTime::currentDateTime().toString("hh:mm:ss.zzz") 55 | << Q_FUNC_INFO; 56 | #endif 57 | 58 | request->moveToThread(this); 59 | 60 | // TODO: queue requests so we run the most important one first 61 | QMutexLocker lock(&mMutex); 62 | mRequests.append(request); 63 | 64 | // wake run() 65 | mWaitCondition.wakeOne(); 66 | } 67 | 68 | void IORequestWorker::run() 69 | { 70 | forever { 71 | QMutexLocker lock(&mMutex); 72 | 73 | if (mTimeToQuit) 74 | return; 75 | 76 | if (mRequests.empty()) 77 | mWaitCondition.wait(&mMutex); 78 | 79 | while (!mRequests.isEmpty()) { 80 | IORequest *request = mRequests.takeFirst(); 81 | 82 | lock.unlock(); 83 | 84 | request->run(); 85 | request->deleteLater(); 86 | lock.relock(); 87 | } 88 | } 89 | } 90 | 91 | 92 | void IORequestWorker::exit() 93 | { 94 | #if DEBUG_MESSAGES 95 | qDebug() << Q_FUNC_INFO << "Quitting"; 96 | #endif 97 | QMutexLocker lock(&mMutex); 98 | mTimeToQuit = true; 99 | mWaitCondition.wakeOne(); 100 | } 101 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/iorequestworker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Robin Burchell 3 | * 4 | * You may use this file under the terms of the BSD license as follows: 5 | * 6 | * "Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * * Neither the name of Nemo Mobile nor the names of its contributors 16 | * may be used to endorse or promote products derived from this 17 | * software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 30 | */ 31 | 32 | #ifndef IOREQUESTWORKER_H 33 | #define IOREQUESTWORKER_H 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include "iorequest.h" 41 | 42 | class IORequestWorker : public QThread 43 | { 44 | Q_OBJECT 45 | public: 46 | explicit IORequestWorker(); 47 | 48 | void addRequest(IORequest *request); 49 | 50 | void run(); 51 | 52 | void exit(); 53 | 54 | private: 55 | QMutex mMutex; 56 | QWaitCondition mWaitCondition; 57 | QList mRequests; 58 | bool mTimeToQuit; 59 | }; 60 | 61 | #endif // IOREQUESTWORKER_H 62 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/ioworkerthread.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Robin Burchell 3 | * 4 | * You may use this file under the terms of the BSD license as follows: 5 | * 6 | * "Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * * Neither the name of Nemo Mobile nor the names of its contributors 16 | * may be used to endorse or promote products derived from this 17 | * software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 30 | */ 31 | 32 | #include "ioworkerthread.h" 33 | 34 | 35 | /*! 36 | Hosts a thread, lives on the main thread. 37 | 38 | Responsible for relaying interaction between the main thread and an IOWorkerThread. 39 | */ 40 | IOWorkerThread::IOWorkerThread(QObject *parent) : 41 | QObject(parent) 42 | { 43 | mWorker.start(QThread::IdlePriority); 44 | } 45 | 46 | /*! 47 | Destroys an IOWorkerThread instance. 48 | */ 49 | IOWorkerThread::~IOWorkerThread() 50 | { 51 | mWorker.exit(); 52 | mWorker.wait(); 53 | } 54 | 55 | /*! 56 | Attempts an asynchronous attempt to start a \a request. 57 | 58 | If the request may be run, it is queued, and true is returned, otherwise, false. 59 | */ 60 | bool IOWorkerThread::addRequest(IORequest *request) 61 | { 62 | mWorker.addRequest(request); 63 | return true; 64 | } 65 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/ioworkerthread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Robin Burchell 3 | * 4 | * You may use this file under the terms of the BSD license as follows: 5 | * 6 | * "Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * * Neither the name of Nemo Mobile nor the names of its contributors 16 | * may be used to endorse or promote products derived from this 17 | * software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 30 | */ 31 | 32 | #ifndef IOWORKERTHREAD_H 33 | #define IOWORKERTHREAD_H 34 | 35 | #include 36 | #include 37 | 38 | #include "iorequestworker.h" 39 | 40 | class IOWorkerThread : public QObject 41 | { 42 | Q_OBJECT 43 | public: 44 | explicit IOWorkerThread(QObject *parent = 0); 45 | virtual ~IOWorkerThread(); 46 | bool addRequest(IORequest *request); 47 | 48 | private: 49 | IORequestWorker mWorker; 50 | }; 51 | 52 | #endif // IOWORKERTHREAD_H 53 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/location.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: location.cpp 19 | * Date: 08/03/2014 20 | */ 21 | /************************************************************************** 22 | * 23 | * Copyright 2014 Canonical Ltd. 24 | * Copyright 2014 Carlos J Mazieri 25 | * 26 | * This program is free software; you can redistribute it and/or modify 27 | * it under the terms of the GNU Lesser General Public License as published by 28 | * the Free Software Foundation; version 3. 29 | * 30 | * This program is distributed in the hope that it will be useful, 31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 33 | * GNU Lesser General Public License for more details. 34 | * 35 | * You should have received a copy of the GNU Lesser General Public License 36 | * along with this program. If not, see . 37 | * 38 | * File: locations.cpp 39 | * Date: 04/03/2014 40 | */ 41 | 42 | #include "location.h" 43 | #include "ioworkerthread.h" 44 | 45 | Q_GLOBAL_STATIC(IOWorkerThread, ioWorkerThread) 46 | 47 | 48 | Location::Location(int type, QObject *parent) 49 | : QObject(parent) 50 | , m_info(0) 51 | , m_type(type) 52 | , m_usingExternalWatcher(false) 53 | { 54 | 55 | } 56 | 57 | Location::~Location() 58 | { 59 | if (m_info) 60 | { 61 | delete m_info; 62 | m_info = 0; 63 | } 64 | } 65 | 66 | 67 | bool Location::isRoot() const 68 | { 69 | return m_info ? m_info->isRoot() : false; 70 | } 71 | 72 | 73 | bool Location::isWritable() const 74 | { 75 | return m_info->isWritable(); 76 | } 77 | 78 | 79 | bool Location::isReadable() const 80 | { 81 | return m_info ? m_info->isContentReadable() : false; 82 | } 83 | 84 | void Location::setInfoItem(const DirItemInfo &itemInfo) 85 | { 86 | setInfoItem (new DirItemInfo(itemInfo)); 87 | } 88 | 89 | void Location::setInfoItem(DirItemInfo *itemInfo) 90 | { 91 | if (m_info) 92 | { 93 | delete m_info; 94 | } 95 | m_info = itemInfo; 96 | } 97 | 98 | 99 | QString Location::urlPath() const 100 | { 101 | return m_info ? m_info->urlPath(): QString(); 102 | } 103 | 104 | 105 | void Location::startWorking() 106 | { 107 | 108 | } 109 | 110 | void Location::stopWorking() 111 | { 112 | 113 | } 114 | 115 | bool Location::becomeParent() 116 | { 117 | return false; 118 | } 119 | 120 | IOWorkerThread * Location::workerThread() const 121 | { 122 | return ioWorkerThread(); 123 | } 124 | 125 | 126 | //providing an empty method 127 | void Location::fetchExternalChanges(const QString &path, 128 | const DirItemInfoList &list, 129 | QDir::Filter dirFilter) 130 | { 131 | Q_UNUSED(path); 132 | Q_UNUSED(list); 133 | Q_UNUSED(dirFilter); 134 | } 135 | 136 | 137 | void Location::setUsingExternalWatcher(bool use) 138 | { 139 | m_usingExternalWatcher = use; 140 | } 141 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/locationsfactory.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: locationsfactory.h 19 | * Date: 05/03/2014 20 | */ 21 | 22 | #ifndef LOCATIONSFACTORY_H 23 | #define LOCATIONSFACTORY_H 24 | 25 | #include 26 | #include 27 | 28 | 29 | class Location; 30 | class DirItemInfo; 31 | 32 | /*! 33 | * \brief The LocationsFactory class represents the set of main 34 | * URL locations the File Manager supports. 35 | * 36 | * It is basically devided into main groups: 37 | * \li Disk: \ref LocalDisk and \ref TrashDisk 38 | * \li Net: \ref NetSambaShare and NetFishShare 39 | * 40 | * smb:// browses workgroup 41 | * 42 | * Location parser: \ref parser() 43 | * \li \\workkgroup becomes smb://workgroup 44 | * \li \\ becomes smb:// 45 | * \li trash:/ and trash:// becomes trash:/// 46 | * \li fish:/ and fish:// becomes fish:/// 47 | * \li file:/ , file:// and file:/// becomes / 48 | * 49 | * \note Due to current File Manager UI typing method both: "file:" and "trash:" are supported 50 | */ 51 | class LocationsFactory : public QObject 52 | { 53 | Q_OBJECT 54 | public: 55 | explicit LocationsFactory(QObject *parent = 0); 56 | ~LocationsFactory(); 57 | 58 | Q_ENUMS(Locations) 59 | enum Locations 60 | { 61 | LocalDisk, //& 102 | availableLocations() const { return m_locations; } 103 | 104 | /*! 105 | * \brief lastValidFileInfo() 106 | * 107 | * When calling setNewPath(file_path) using a path to a File instead of a Directory 108 | * the setNewPath() is not able to set a new path (current location or other), however it uses 109 | * Location::validateUrlPath() which validates the path for files also, then this valid DirItemInfo object 110 | * is saved using \ref storeValidFileInfo() for further use. 111 | * 112 | * \return The last valid DirItemInfo parsed which is not a Directory 113 | */ 114 | const DirItemInfo* lastValidFileInfo() const { return m_lastValidFileInfo; } 115 | 116 | void storeValidFileInfo(DirItemInfo *item); 117 | 118 | signals: 119 | void locationChanged(const Location *old, const Location *current); 120 | 121 | private: 122 | QString stringAfterSlashes(const QString& url, int firstSlashIndex) const; 123 | 124 | private: 125 | Location * m_curLoc; 126 | QList m_locations; 127 | QString m_tmpPath; 128 | DirItemInfo * m_lastValidFileInfo; 129 | 130 | #if defined(REGRESSION_TEST_FOLDERLISTMODEL) 131 | friend class TestDirModel; 132 | #endif 133 | 134 | }; 135 | 136 | #endif // LOCATIONSFACTORY_H 137 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/locationurl.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: locationurl.cpp 19 | * Date: 11/03/2014 20 | */ 21 | 22 | #include "locationurl.h" 23 | 24 | const QString LocationUrl::TrashRootURL("trash:///"); 25 | const QString LocationUrl::DiskRootURL("file:///"); 26 | #if 0 27 | QString LocationURL::SmbURL("smb://"); 28 | QString LocationURL::FishURL("fish:///"); 29 | #endif 30 | 31 | 32 | LocationUrl::LocationUrl() 33 | { 34 | } 35 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/locationurl.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: locationurl.h 19 | * Date: 11/03/2014 20 | */ 21 | 22 | #ifndef LOCATIONURL_H 23 | #define LOCATIONURL_H 24 | 25 | #include 26 | 27 | class LocationUrl 28 | { 29 | public: 30 | static const QString DiskRootURL; 31 | static const QString TrashRootURL; 32 | #if 0 33 | static const QString SmbURL; 34 | static const QString FishURL; 35 | #endif 36 | private: 37 | LocationUrl(); 38 | }; 39 | 40 | #endif // LOCATIONURL_H 41 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Robin Burchell 3 | * 4 | * You may use this file under the terms of the BSD license as follows: 5 | * 6 | * "Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * * Neither the name of Nemo Mobile nor the names of its contributors 16 | * may be used to endorse or promote products derived from this 17 | * software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 30 | */ 31 | 32 | #include "plugin.h" 33 | 34 | NemoFolderListModelPlugin::NemoFolderListModelPlugin() { } 35 | 36 | NemoFolderListModelPlugin::~NemoFolderListModelPlugin() { } 37 | 38 | void NemoFolderListModelPlugin::initializeEngine(QmlEngine *engine, const char *uri) 39 | { 40 | Q_ASSERT(uri == QLatin1String(PLUGIN_URI)); 41 | 42 | #ifndef DO_NOT_USE_TAG_LIB 43 | engine->addImageProvider(QLatin1String("cover-art"), new CoverArtImageProvider); 44 | engine->addImageProvider(QLatin1String("cover-art-full"), new CoverArtFullImageProvider); 45 | #endif //DO_NOT_USE_TAG_LIB 46 | 47 | Q_UNUSED(uri); 48 | Q_UNUSED(engine); 49 | } 50 | 51 | void NemoFolderListModelPlugin::registerTypes(const char *uri) 52 | { 53 | Q_ASSERT(uri == QLatin1String(PLUGIN_URI)); 54 | DirModel::registerMetaTypes(); 55 | qmlRegisterType(uri, 1, 0, "FolderListSelection"); 56 | qmlRegisterType(uri, 1, 0, "FolderListModel"); 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Robin Burchell 3 | * 4 | * You may use this file under the terms of the BSD license as follows: 5 | * 6 | * "Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * * Neither the name of Nemo Mobile nor the names of its contributors 16 | * may be used to endorse or promote products derived from this 17 | * software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 30 | */ 31 | 32 | #ifndef NEMO_QML_PLUGINS_FOLDERLISTMODEL 33 | #define NEMO_QML_PLUGINS_FOLDERLISTMODEL 34 | 35 | #include "dirmodel.h" 36 | #include "dirselection.h" 37 | 38 | #include 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | #define PLUGIN_URI "Liri.Files.FolderListModel" 46 | 47 | #define PLUGIN_CLASS_EXPORT Q_DECL_EXPORT 48 | #define PLUGIN_CLASS_EXTERNAL_EXPORT 49 | #define PLUGIN_CLASS_EXTEND \ 50 | Q_OBJECT \ 51 | Q_PLUGIN_METADATA(IID PLUGIN_URI) 52 | typedef QQmlExtensionPlugin QmlPluginParent; 53 | typedef QQmlEngine QmlEngine; 54 | 55 | 56 | #ifndef DO_NOT_USE_TAG_LIB 57 | # include "imageprovider.h" 58 | #endif 59 | 60 | 61 | class PLUGIN_CLASS_EXPORT NemoFolderListModelPlugin : public QmlPluginParent 62 | { 63 | PLUGIN_CLASS_EXTEND 64 | 65 | public: 66 | NemoFolderListModelPlugin(); 67 | virtual ~NemoFolderListModelPlugin(); 68 | 69 | void initializeEngine(QmlEngine *engine, const char *uri); 70 | void registerTypes(const char *uri); 71 | }; 72 | 73 | PLUGIN_CLASS_EXTERNAL_EXPORT 74 | 75 | #endif // NEMO_QML_PLUGINS_FOLDERLISTMODEL 76 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/qmldir: -------------------------------------------------------------------------------- 1 | module Liri.Files.FolderListModel 2 | plugin folderlistmodelplugin 3 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/trash/qtrashdir.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: qtrashcan.h 19 | * Date: 06/02/2014 20 | */ 21 | 22 | #ifndef QTRASHDIR_H 23 | #define QTRASHDIR_H 24 | 25 | #include 26 | #include 27 | struct QTrashUtilInfo; 28 | 29 | /*! 30 | * \brief The QTrashDir class is a Qt implementation of the Trash Directories specification 31 | * 32 | * It creates/gets only the Trash Directories 33 | * freedesktop.org specification \link http://http://standards.freedesktop.org/trash-spec/trashspec-0.8.html 34 | * 35 | * 1. Trash Dir is a user folder (not symlink) available only to the user, it contains: 36 | * \li \a files folder \see filesTrashDir() 37 | * \li \a info folder \see infoTrashDir() 38 | * \code 39 | * drwx------ 2 devubuntu dev 4096 Fev 6 11:48 files 40 | * drwx------ 2 devubuntu dev 4096 Fev 6 11:48 info 41 | * \endcode 42 | * 43 | * 2. Files under home moved to Trash go to Home Trash Dir, that can be: 44 | * 45 | * 2.1 $XDG_DATA_HOME/Trash (when exists and it is writable) 46 | * 2.2 $HOME/.local/share/Trash (created when it does not exist) 47 | * 48 | * 3. Other files (not under user home) moved to Trash, must try to use/create 49 | * Trash Dir from the its topdir (mount point), in the following order: 50 | * 51 | * 3.1. $topdir/.Trash/$uid (when $topdir/.Trash exists, is writable and has the stick bit set) 52 | * 3.2. $topdir/Trash-$uid (when $topdir is writable) 53 | * 54 | * \ref homeTrash() returns the current Home Trash Dir for the user either 2.1 or 2.2 55 | * \ref allTrashes() returns all existent Trash Dir for the user 2.1, 2.2, 3.1 and 3.2 56 | * \ref suitableTrash() returns a Trash Dir for a file/dir in order to send it the Trash 57 | * 58 | * \note 59 | * Trash Location can be considered a set of available Trashes Dir to the user, 60 | * a File Browser must consider all them, every time a File Browser points to Trsh Location 61 | * \ref allTrashes() must be called to get the current mounted file systems and then browse any 62 | * trashDir/files and check trashDir/info. 63 | * 64 | */ 65 | 66 | class QTrashDir 67 | { 68 | public: 69 | explicit QTrashDir(); 70 | 71 | /*! 72 | * \brief homeTrash() gets/crates the curret Home Trash Dir 73 | * \return the Trash Dir, it can be empty when it cannot be created 74 | */ 75 | QString homeTrash() const; 76 | 77 | /*! 78 | * \brief allTrashes() makes a list of all Trashes avaialable to the user 79 | * 80 | * An application which intends to list all files in the Trash Can must fetch all files 81 | * in the "files" directory for all items in the Trash Dir list. 82 | * 83 | * \note It creates only Home Trash Dir when they do not exist 84 | * 85 | * \return a list of all Trashes for the current user. 86 | */ 87 | QStringList allTrashes() const; 88 | 89 | /*! 90 | * \brief suitableTrash() gets/creates a Trash Dir for a such file/dir 91 | * \param fullPathName a file or dir intended to be sent to Trash 92 | * \return the Trash Dir, it can be empty when it cannot be created 93 | */ 94 | QString suitableTrash(const QString &fullPathName) const; 95 | 96 | bool suitableTrash(const QString &fullPathName, QTrashUtilInfo& fullInfo) const; 97 | 98 | 99 | private: 100 | bool validate(const QString& trashDir, bool create=false) const; 101 | bool isMountPointSharedWithStickBit(const QString& mountPoint) const; 102 | bool checkUserDirPermissions(const QString& dir) const; 103 | bool createUserDir(const QString& dir) const; 104 | QStringList mountedPoints() const; 105 | QString getMountPoint(const QString& fileOrDir) const; 106 | QString getSuitableTopTrashDir(const QString& mountPoint) const; 107 | QString getSharedTopTrashDir(const QString& mountPoint) const; 108 | QString getSingleTopTrashDir(const QString& mountPoint, bool create = false) const; 109 | 110 | private: 111 | uint m_userId; 112 | #if defined(REGRESSION_TEST_FOLDERLISTMODEL) //used in Unit/Regression tests 113 | friend class TestDirModel; 114 | #endif 115 | }; 116 | 117 | #endif // QTRASHDIR_H 118 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/trash/qtrashutilinfo.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: qtrashutilinfo.cpp 19 | * Date: 16/03/2014 20 | */ 21 | 22 | #include "qtrashutilinfo.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | QLatin1String filesDirString("files"); 29 | QLatin1String infoDirString("info"); 30 | 31 | void QTrashUtilInfo::clear() 32 | { 33 | trashRoot.clear(); 34 | filesDir.clear(); 35 | absFile.clear(); 36 | infoDir.clear(); 37 | absInfo.clear(); 38 | valid = false; 39 | } 40 | 41 | 42 | QString QTrashUtilInfo::filesTrashDir(const QString &trashDir) 43 | { 44 | QString filesDir(trashDir + QDir::separator() + filesDirString); 45 | return filesDir; 46 | } 47 | 48 | 49 | QString QTrashUtilInfo::infoTrashDir(const QString &trashDir) 50 | { 51 | QString infoDir(trashDir + QDir::separator() + infoDirString); 52 | return infoDir; 53 | } 54 | 55 | 56 | void QTrashUtilInfo::setInfoFromTrashItem(const QString &absTrashItem) 57 | { 58 | valid = false; 59 | QFileInfo item(absTrashItem); 60 | if (item.absolutePath().endsWith(filesDirString)) 61 | { 62 | QFileInfo filesUnderRoot(item.absolutePath()); 63 | QTrashUtilInfo::setInfo(filesUnderRoot.absolutePath(), absTrashItem); 64 | } 65 | else 66 | { 67 | clear(); 68 | } 69 | } 70 | 71 | 72 | void QTrashUtilInfo::setInfo(const QString& trashRootDir, const QString& filename) 73 | { 74 | valid = !trashRootDir.isEmpty(); 75 | if (valid) 76 | { 77 | QFileInfo f(filename); 78 | trashRoot = trashRootDir; 79 | filesDir = filesTrashDir(trashRootDir); 80 | absFile = filesDir + QDir::separator() + f.fileName(); 81 | infoDir = infoTrashDir(trashRootDir) ; 82 | absInfo = infoDir + QDir::separator() + f.fileName() + 83 | QLatin1String(".trashinfo"); 84 | } 85 | else 86 | { 87 | clear(); 88 | } 89 | } 90 | 91 | 92 | bool QTrashUtilInfo::isValid() 93 | { 94 | return valid; 95 | } 96 | 97 | 98 | bool QTrashUtilInfo::existsFile() 99 | { 100 | return QFileInfo(absFile).exists(); 101 | } 102 | 103 | 104 | bool QTrashUtilInfo::existsInfoFile() 105 | { 106 | return QFileInfo(absInfo).exists(); 107 | } 108 | 109 | 110 | QString QTrashUtilInfo::getOriginalPathName() 111 | { 112 | QString path; 113 | if (isValid()) 114 | { 115 | QSettings inff(absInfo, QSettings::IniFormat); 116 | inff.beginGroup(QLatin1String("Trash Info")); 117 | QFileInfo f (inff.value(QLatin1String("Path")).toString()); 118 | //Path contains the full pathname 119 | path = f.absoluteFilePath(); 120 | } 121 | return path; 122 | } 123 | 124 | 125 | bool QTrashUtilInfo::createTrashInfoFile(const QString& orignalPathname) 126 | { 127 | bool ret = isValid(); 128 | if (ret) 129 | { 130 | QByteArray content("[Trash Info]\nPath="); 131 | content += orignalPathname.toUtf8() + QByteArrayLiteral('\n'); 132 | content += "DeletionDate="; 133 | content += QDateTime::currentDateTime().toString(Qt::ISODate).toUtf8() + QByteArrayLiteral('\n'); 134 | QFile f(absInfo); 135 | ret = f.open(QFile::WriteOnly | QFile::Truncate) && 136 | f.write(content) == content.size(); 137 | f.close(); 138 | } 139 | return ret; 140 | } 141 | 142 | 143 | 144 | bool QTrashUtilInfo::removeTrashInfoFile() 145 | { 146 | QFile infoFile(absInfo); 147 | bool ret = false; 148 | if (valid && infoFile.exists()) 149 | { 150 | ret = infoFile.remove(); 151 | } 152 | return ret; 153 | } 154 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/trash/qtrashutilinfo.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: qtrashutilinfo.h 19 | * Date: 16/03/2014 20 | */ 21 | 22 | #ifndef QTRASHUTILINFO_H 23 | #define QTRASHUTILINFO_H 24 | 25 | #include 26 | 27 | 28 | /*! 29 | * \brief The QTrashUtilInfo struct just provides helper functions and information using a file structure like 30 | * 31 | * Trash/ 32 | * files/ info/ 33 | * item item.trashinfo 34 | */ 35 | struct QTrashUtilInfo 36 | { 37 | public: 38 | /*! 39 | * \brief setInfo() build the whole Trash information 40 | * \param trashRootDir the root Trash Dir usually a folder "Trash" 41 | * \param filename the item, it can be either a relative file name or a full path name 42 | */ 43 | void setInfo(const QString& trashRootDir, const QString& filename); 44 | 45 | /*! 46 | * \brief setInfoFromTrashItem() build the whole Trash information from the absolute path name from a trash item 47 | * \param absTrashItem the full path, something like /files/item 48 | * 49 | * The item pointed by \a absTrashItem does not need to exist 50 | */ 51 | void setInfoFromTrashItem(const QString& absTrashItem); 52 | void clear(); 53 | bool existsInfoFile(); 54 | bool existsFile(); 55 | bool isValid(); 56 | QString getOriginalPathName(); 57 | bool createTrashInfoFile(const QString& orignalPathname); 58 | bool removeTrashInfoFile(); 59 | 60 | /*! 61 | * \brief filesTrashDir() gets the "files" directory under Trash Dir 62 | * \param trashDir 63 | * \return trashDir/files 64 | */ 65 | static QString filesTrashDir(const QString& trashDir); 66 | 67 | /*! 68 | * \brief infoTrashDir() gets gets the "info" directory under Trash Dir 69 | * \param trashDir 70 | * \return trashDir/info 71 | */ 72 | static QString infoTrashDir(const QString& trashDir); 73 | 74 | QString trashRoot; // root 75 | QString filesDir; // root/files 76 | QString absFile; // root/files/item 77 | QString infoDir; // root/info 78 | QString absInfo; // root/info/item.trashinfo 79 | bool valid; 80 | }; 81 | 82 | #endif // QTRASHUTILINFO_H 83 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/trash/trashiteminfo.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: trashiteminfo.cpp 19 | * Date: 05/03/2014 20 | */ 21 | 22 | #include "trashiteminfo.h" 23 | #include "locationurl.h" 24 | 25 | 26 | TrashItemInfo::TrashItemInfo(const QString &urlPath) 27 | : DirItemInfo() 28 | { 29 | d_ptr->_path = urlPath; 30 | d_ptr->_isLocal = true; 31 | d_ptr->_normalizedPath = urlPath; 32 | if (urlPath == LocationUrl::TrashRootURL) 33 | { 34 | setRoot(); 35 | } 36 | } 37 | 38 | 39 | TrashItemInfo::TrashItemInfo(const TrashItemInfo &other) 40 | : DirItemInfo(other) 41 | { 42 | } 43 | 44 | 45 | TrashItemInfo::TrashItemInfo(const QString& trashPath, const QString &urlPath) 46 | : DirItemInfo(urlPath) 47 | { 48 | init(trashPath); 49 | } 50 | 51 | 52 | void TrashItemInfo::setRoot() 53 | { 54 | d_ptr->_isValid = true; 55 | d_ptr->_isRoot = true; 56 | d_ptr->_isDir = true; 57 | d_ptr->_isReadable = true; 58 | d_ptr->_isExecutable = true; 59 | d_ptr->_exists = true; 60 | d_ptr->_fileName.clear(); 61 | } 62 | 63 | 64 | void TrashItemInfo::init(const QString& trashPath) 65 | { 66 | if (trashPath == absoluteFilePath()) 67 | { 68 | d_ptr->_path = trashPath; 69 | setRoot(); 70 | } 71 | else 72 | { 73 | if (!d_ptr->_path.startsWith(trashPath)) 74 | { 75 | d_ptr->_isValid = false; 76 | } 77 | } 78 | QString abs(d_ptr->_path); 79 | d_ptr->_normalizedPath = abs.replace(0,trashPath.length()+1, LocationUrl::TrashRootURL); 80 | } 81 | 82 | 83 | TrashItemInfo& TrashItemInfo::operator=(const DirItemInfo &other) 84 | { 85 | DirItemInfo::operator = (other); 86 | //the following code is disabled because TrashItemInfo does not define any data member 87 | //but it is kept for the case any specific data member be necessary in the future 88 | //and it is also kept to warn that doing so would cause a bug 89 | #if 0 90 | const TrashItemInfo *isTrash = dynamic_cast (&other); 91 | if (isTrash) 92 | { 93 | //copy data specific to this class here, 94 | //do not unnecessarily copy data that is handled by parent's assignment operator 95 | } 96 | #endif 97 | return *this; 98 | } 99 | 100 | 101 | TrashItemInfo& TrashItemInfo::operator=(const TrashItemInfo &other) 102 | { 103 | DirItemInfo::operator = (other); 104 | return *this; 105 | } 106 | 107 | 108 | /*! 109 | * \brief TrashItemInfo::getTrashDir() 110 | * 111 | * Lets suppose a directory in the trash named DIR: 112 | * absFilePath() = /home/user/.local/share/Trash/files/DIR 113 | * normalizedFilePath() = trash:///DIR 114 | * 115 | * The trash dir is /home/user/.local/share/Trash/files 116 | * 117 | * \return The trash dir 118 | */ 119 | QString TrashItemInfo::getTrashDir() const 120 | { 121 | QString trashDir; 122 | QString norm(urlPath()); 123 | if ( norm.length() > LocationUrl::TrashRootURL.length() 124 | && norm.startsWith(LocationUrl::TrashRootURL) 125 | ) 126 | { 127 | QStringRef trashItemRef(norm.midRef(LocationUrl::TrashRootURL.length())); 128 | QString abs(absoluteFilePath()); 129 | int length = abs.lastIndexOf(trashItemRef); 130 | if (length > 0) 131 | { 132 | trashDir = abs.left(length-1); 133 | } 134 | } 135 | return trashDir; 136 | } 137 | 138 | 139 | QString TrashItemInfo::getRootTrashDir() const 140 | { 141 | QString ret = getTrashDir(); 142 | if (!isRoot()) 143 | { 144 | ret = QFileInfo(ret).absolutePath(); 145 | } 146 | return ret; 147 | } 148 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/trash/trashiteminfo.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: trashiteminfo.h 19 | * Date: 05/03/2014 20 | */ 21 | 22 | #ifndef TRASHITEMINFO_H 23 | #define TRASHITEMINFO_H 24 | 25 | #include "diriteminfo.h" 26 | 27 | 28 | /*! 29 | * \brief The TrashItemInfo class provides a QFileInfo like information for files in Trash 30 | * 31 | * Basically it differs from DirItemInfo in the field \a d_ptr->_normalizedPath, it must store the 32 | * url like trash:///Item, while the field d_ptr->_path stores the current path in the file system as usual. 33 | * 34 | * So suppose a Item in the trash: 35 | * \li \ref absoluteFilePath() returns like /home/user/.local/share/Trash/files/Item 36 | * \li \ref urlPath() returns trash:///Item 37 | * \li \ref getTrashDir() does a right-to-left comparing in order to find out the Trash Dir, in this case /home/user/.local/share/Trash/files 38 | * 39 | * The constructor \ref TrashItemInfo(const QString& urlPath) is used only to store the logical root trash folder trash:/// 40 | */ 41 | class TrashItemInfo : public DirItemInfo 42 | { 43 | public: 44 | TrashItemInfo(const QString& urlPath); 45 | TrashItemInfo(const QString& trashPath, const QString& urlPath); 46 | TrashItemInfo(const TrashItemInfo &other); 47 | public: 48 | virtual TrashItemInfo& operator=(const DirItemInfo &other); 49 | virtual TrashItemInfo& operator=(const TrashItemInfo &other); 50 | public: 51 | QString getTrashDir() const; 52 | QString getRootTrashDir() const; 53 | private: 54 | void setRoot(); 55 | void init(const QString& trashPath); 56 | }; 57 | 58 | #endif // TRASHITEMINFO_H 59 | -------------------------------------------------------------------------------- /src/imports/folderlistmodel/trash/trashlocation.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: trashlocation.h 19 | * Date: 08/03/2014 20 | */ 21 | 22 | #ifndef TRASHLOCATION_H 23 | #define TRASHLOCATION_H 24 | 25 | #include "disk/disklocation.h" 26 | #include "trash/qtrashdir.h" 27 | 28 | class TrashListWorker; 29 | 30 | class TrashLocation : public DiskLocation, public QTrashDir 31 | { 32 | Q_OBJECT 33 | public: 34 | explicit TrashLocation(int type, QObject *parent=0); 35 | virtual ~TrashLocation(); 36 | virtual bool becomeParent(); 37 | virtual void refreshInfo(); 38 | virtual void fetchItems(QDir::Filter dirFilter, bool recursive=0); 39 | virtual void fetchExternalChanges(const QString& urlPath, 40 | const DirItemInfoList& list, 41 | QDir::Filter dirFilter) ; 42 | 43 | virtual void startWorking(); 44 | virtual void startExternalFsWatcher(); 45 | 46 | virtual DirItemInfo *validateUrlPath(const QString& urlPath); 47 | 48 | /*! 49 | * \brief getMovePairPaths() Get: original path and destination trash path 50 | * 51 | * 52 | * \param item desired item to be moved into Trash 53 | * 54 | * \return an \ref ActionPaths that contains the source orginal file and 55 | * the suitable Trash path where the source will moved into 56 | */ 57 | ActionPaths getMovePairPaths(const DirItemInfo& item) const; 58 | 59 | /*! 60 | * \brief getRestorePairPaths() Get: Trash path as source and item original path as destination 61 | * 62 | * \param item desired to be restored from Trash 63 | * 64 | * \return n \ref ActionPaths that contains the thash item and 65 | * the original source path as destionation 66 | */ 67 | ActionPaths getRestorePairPaths(const DirItemInfo& item) const; 68 | 69 | private: 70 | void addTrashFetchRequest(TrashListWorker *workerObject); 71 | 72 | private: 73 | ActionPathList m_actionPathList; 74 | QStringList m_currentPaths; //!< also used in the startExternalFsWatcher(), it can br activated any time 75 | }; 76 | 77 | #endif // TRASHLOCATION_H 78 | -------------------------------------------------------------------------------- /src/imports/pamauthentication/pamauthentication.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Canonical Ltd 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 3 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Author : Arto Jalkanen 17 | */ 18 | 19 | #ifndef PAMAUTHENTICATION_H 20 | #define PAMAUTHENTICATION_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | // Forward declarations 28 | struct pam_handle; 29 | struct pam_message; 30 | struct pam_response; 31 | 32 | /** 33 | * QML plugin to query if authentication is required and do authentication. 34 | * 35 | * At the moment the plugin is expected to be used as follows: 36 | * 37 | * - Ask if authentication is required (requireAuthentication() function). This will 38 | * return true if Ubuntu Touch user has selected some unlocking security (PIN code or password). 39 | * - If so, the application should provide a dialog to ask for the PIN code/password and 40 | * call validatePasswordToken(provided password) function. 41 | * - If validatePasswordToken() function returns true for given token, then user was authenticated, 42 | * otherwise failed to authenticate. 43 | * 44 | * Caveats: 45 | * 46 | * - If user failed to authenticate, it doesn't necessarily mean password was invalid. Failure 47 | * can also be because of account being locked or password being expired or because of some other 48 | * reason in the underlying pam library. The exact reason is not currently available to QML, as practically 49 | * for normal users the only reason is password mismatch. If the user has done advanced modifications 50 | * the exact reason for failure can be seen in application's logs. 51 | * - Currently the application using this module will have to provide the dialogs asking for 52 | * for PIN/password and an error dialog. This will most likely change in future, but there's no 53 | * concrete plans yet. Discussion at https://code.launchpad.net/~ubuntu-filemanager-dev/ubuntu-filemanager-app/require-screenlock-password/+merge/230058 54 | * can be seen for some background information. 55 | * 56 | * Simplified skeleton QML code example that asks for authentication if required at start-up of application (specific dialogs omitted): 57 | * 58 | * import com.ubuntu.PamAuthentication 0.1 59 | * 60 | * MainView { 61 | * PamAuthentication { 62 | * id: pamAuthentication 63 | * serviceName: "applicationName" 64 | * } 65 | * 66 | * Component.onCompleted: { 67 | * if (pamAuthentication.requireAuthentication()) { 68 | * var passwordToken = queryPasswordInputDialog() 69 | * if (!pamAuthentication.validatePasswordToken(passwordToken) { 70 | * // Successs... 71 | * } else { 72 | * showAuthenticationFailedDialog() 73 | * } 74 | * } 75 | * } 76 | * } 77 | * 78 | */ 79 | class PamAuthentication : public QObject 80 | { 81 | Q_OBJECT 82 | 83 | public: 84 | explicit PamAuthentication(QObject *parent = 0); 85 | ~PamAuthentication(); 86 | 87 | /** 88 | * \brief returns true if current user has password or PIN code set for unlocking lockscreen 89 | */ 90 | Q_INVOKABLE bool requireAuthentication(); 91 | 92 | /** 93 | * \brief returns true if current user can be authenticated with given password token (be it PIN code or password) 94 | */ 95 | Q_INVOKABLE bool validatePasswordToken(const QString &token); 96 | 97 | /** 98 | * \brief Should be set to the application's name in lowercase. For example, for FileManager it would be "filemanager". 99 | */ 100 | Q_PROPERTY(QString serviceName READ serviceName WRITE setServiceName NOTIFY serviceNameChanged) 101 | inline const QString &serviceName() const { 102 | return m_serviceName; 103 | } 104 | 105 | void setServiceName(const QString &serviceName); 106 | signals: 107 | void serviceNameChanged(); 108 | 109 | public slots: 110 | private: 111 | static int ConversationFunction(int num_msg, 112 | const pam_message** msg, 113 | pam_response** resp, 114 | void* appdata_ptr); 115 | 116 | bool initPam(pam_handle **pamHandle); 117 | int validateAccount(pam_handle *pamHandle); 118 | 119 | QString m_passwordToken; 120 | QString m_serviceName; 121 | QString m_userLogin; 122 | }; 123 | 124 | #endif // PAMAUTHENTICATION_H 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /src/imports/pamauthentication/pamauthentication_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Canonical Ltd 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 3 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Author : Arto Jalkanen 17 | */ 18 | 19 | #include 20 | #include 21 | #include "pamauthentication_plugin.h" 22 | #include "pamauthentication.h" 23 | 24 | void BackendPlugin::registerTypes(const char *uri) 25 | { 26 | Q_ASSERT(uri == QLatin1String("com.ubuntu.PamAuthentication")); 27 | 28 | qmlRegisterType(uri, 0, 1, "PamAuthentication"); 29 | } 30 | 31 | void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri) 32 | { 33 | QQmlExtensionPlugin::initializeEngine(engine, uri); 34 | } 35 | -------------------------------------------------------------------------------- /src/imports/pamauthentication/pamauthentication_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Canonical Ltd 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 3 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Author : Arto Jalkanen 17 | */ 18 | 19 | #ifndef PAMAUTHENTICATION_PLUGIN_H 20 | #define PAMAUTHENTICATION_PLUGIN_H 21 | 22 | #include 23 | #include 24 | 25 | class BackendPlugin : public QQmlExtensionPlugin 26 | { 27 | Q_OBJECT 28 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") 29 | 30 | public: 31 | void registerTypes(const char *uri); 32 | void initializeEngine(QQmlEngine *engine, const char *uri); 33 | }; 34 | #endif // PAMAUTHENTICATION_PLUGIN_H 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/imports/pamauthentication/qmldir: -------------------------------------------------------------------------------- 1 | module com.ubuntu.PamAuthentication 2 | plugin PamAuthentication 3 | -------------------------------------------------------------------------------- /src/imports/placesmodel/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | liri_add_qml_plugin(FilesPlacesModelQmlPlugin 2 | MODULE_PATH 3 | "Liri/Files/PlacesModel" 4 | OUTPUT_NAME 5 | placesmodelplugin 6 | SOURCES 7 | placesmodel.cpp 8 | placesmodel.h 9 | placesmodel_plugin.cpp 10 | placesmodel_plugin.h 11 | placesmodel.qbs 12 | qmtabparser.cpp 13 | qmtabparser.h 14 | QML_FILES 15 | qmldir 16 | #DEFINES 17 | #QT_NO_CAST_FROM_ASCII 18 | #QT_NO_FOREACH 19 | ) 20 | 21 | liri_finalize_qml_plugin(FilesPlacesModelQmlPlugin) 22 | -------------------------------------------------------------------------------- /src/imports/placesmodel/placesmodel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Canonical Ltd 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 3 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Author : David Planella 17 | * Arto Jalkanen 18 | */ 19 | 20 | #ifndef PLACESMODEL_H 21 | #define PLACESMODEL_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include "qmtabparser.h" 32 | 33 | class PlacesModel : public QAbstractListModel 34 | { 35 | Q_OBJECT 36 | 37 | Q_PROPERTY(QString locationHome READ locationHome CONSTANT) 38 | Q_PROPERTY(QString locationDocuments READ locationDocuments CONSTANT) 39 | Q_PROPERTY(QString locationDownloads READ locationDownloads CONSTANT) 40 | Q_PROPERTY(QString locationMusic READ locationMusic CONSTANT) 41 | Q_PROPERTY(QString locationPictures READ locationPictures CONSTANT) 42 | Q_PROPERTY(QString locationVideos READ locationVideos CONSTANT) 43 | 44 | public: 45 | explicit PlacesModel(QObject *parent = 0); 46 | ~PlacesModel(); 47 | QString locationHome() const; 48 | QString locationDocuments() const; 49 | QString locationDownloads() const; 50 | QString locationMusic() const; 51 | QString locationPictures() const; 52 | QString locationVideos() const; 53 | int rowCount(const QModelIndex &parent) const override; 54 | QVariant data(const QModelIndex &index, int role) const override; 55 | QHash roleNames() const override; 56 | 57 | signals: 58 | void userMountAdded(const QString &path); 59 | void userMountRemoved(const QString &paht); 60 | 61 | public slots: 62 | void addLocation(const QString &location); 63 | void removeItem(int indexToRemove); 64 | inline bool isUserMountDirectory(const QString location) { 65 | return m_userMounts.contains(location); 66 | } 67 | 68 | private slots: 69 | void mtabChanged(const QString &path); 70 | void rescanMtab(); 71 | 72 | private: 73 | void initNewUserMountsWatcher(); 74 | // Returns true if location was not known before, and false if it was known 75 | bool addLocationWithoutStoring(const QString &location); 76 | // Returns true if location was not known before, and false if it was known 77 | void removeItemWithoutStoring(int itemToRemove); 78 | 79 | QMtabParser m_mtabParser; 80 | QStringList m_runtimeLocations; 81 | QString m_userMountLocation; 82 | bool isMtabEntryUserMount(const QMtabEntry &entry) const; 83 | bool isSubDirectory(const QString &dir, const QString &path) const; 84 | QString standardLocation(QStandardPaths::StandardLocation location) const; 85 | QStringList m_locations; 86 | QSettings *m_settings; 87 | QFileSystemWatcher *m_newUserMountsWatcher; 88 | QSet m_userMounts; 89 | }; 90 | 91 | #endif // PLACESMODEL_H 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /src/imports/placesmodel/placesmodel.qbs: -------------------------------------------------------------------------------- 1 | import qbs 1.0 2 | 3 | LiriQmlPlugin { 4 | name: "placesmodelplugin" 5 | pluginPath: "Liri/Files/PlacesModel" 6 | 7 | cpp.defines: [] 8 | 9 | files: ["*.cpp", "*.h", "qmldir", "*.qml"] 10 | } 11 | -------------------------------------------------------------------------------- /src/imports/placesmodel/placesmodel_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Canonical Ltd 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 3 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Author : David Planella 17 | */ 18 | 19 | #include 20 | #include 21 | #include "placesmodel_plugin.h" 22 | #include "placesmodel.h" 23 | 24 | void BackendPlugin::registerTypes(const char *uri) 25 | { 26 | Q_ASSERT(uri == QLatin1String("Liri.Files.PlacesModel")); 27 | 28 | qmlRegisterType(uri, 0, 1, "PlacesModel"); 29 | } 30 | 31 | void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri) 32 | { 33 | QQmlExtensionPlugin::initializeEngine(engine, uri); 34 | } 35 | -------------------------------------------------------------------------------- /src/imports/placesmodel/placesmodel_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Canonical Ltd 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 3 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Author : David Planella 17 | */ 18 | 19 | #ifndef PLACESMODEL_PLUGIN_H 20 | #define PLACESMODEL_PLUGIN_H 21 | 22 | #include 23 | #include 24 | 25 | class BackendPlugin : public QQmlExtensionPlugin 26 | { 27 | Q_OBJECT 28 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") 29 | 30 | public: 31 | void registerTypes(const char *uri); 32 | void initializeEngine(QQmlEngine *engine, const char *uri); 33 | }; 34 | #endif // PLACESMODEL_PLUGIN_H 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/imports/placesmodel/qmldir: -------------------------------------------------------------------------------- 1 | module Liri.Files.PlacesModel 2 | plugin placesmodelplugin 3 | -------------------------------------------------------------------------------- /src/imports/placesmodel/qmtabparser.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Canonical Ltd 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 3 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Author : Arto Jalkanen 17 | * Carlos J Mazieri 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | class MtabFileGuard { 28 | FILE *mtabFile; 29 | 30 | public: 31 | MtabFileGuard(FILE *f) { 32 | mtabFile = f; 33 | } 34 | ~MtabFileGuard() { 35 | endmntent(mtabFile); 36 | } 37 | }; 38 | 39 | QMtabParser::QMtabParser(const QString& path, QObject *parent) 40 | : QObject(parent) { 41 | m_path = path.isEmpty() ? _PATH_MOUNTED : path; 42 | } 43 | 44 | QMtabParser::~QMtabParser() {} 45 | 46 | QList 47 | QMtabParser::parseEntries() { 48 | QList entries; 49 | 50 | FILE *f = setmntent(m_path.toLocal8Bit().data(), "r"); 51 | if (f == 0) { 52 | return entries; 53 | } 54 | 55 | MtabFileGuard guard(f); 56 | 57 | struct mntent entStorage; 58 | char buffer[1024]; 59 | while (mntent *ent = getmntent_r(f, &entStorage, buffer, 1024)) { 60 | QMtabEntry entry; 61 | entry.fsName = ent->mnt_fsname; 62 | entry.dir = ent->mnt_dir; 63 | entry.type = ent->mnt_type; 64 | entry.opts = ent->mnt_opts; 65 | entry.freq = ent->mnt_freq; 66 | entry.passno = ent->mnt_passno; 67 | entries << entry; 68 | } 69 | 70 | return entries; 71 | } 72 | -------------------------------------------------------------------------------- /src/imports/placesmodel/qmtabparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Canonical Ltd 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License version 3 as 6 | * published by the Free Software Foundation. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | * 16 | * Author : Arto Jalkanen 17 | * Carlos J Mazieri 18 | */ 19 | 20 | #ifndef QMTABPARSER_H 21 | #define QMTABPARSER_H 22 | 23 | #include 24 | 25 | struct QMtabEntry { 26 | QString fsName; 27 | QString dir; 28 | QString type; 29 | QString opts; 30 | int freq; 31 | int passno; 32 | }; 33 | 34 | class QMtabParser : public QObject 35 | { 36 | Q_OBJECT 37 | QString m_path; 38 | 39 | public: 40 | explicit QMtabParser(const QString& path = QString(), QObject *parent = 0); 41 | ~QMtabParser(); 42 | 43 | QList parseEntries(); 44 | 45 | inline const QString& path() { return m_path; } 46 | }; 47 | 48 | #endif // QMTABPARSER_H 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/regression/media_asx.h: -------------------------------------------------------------------------------- 1 | const unsigned char media_asx[] = { 2 | 0x3c, 0x61, 0x73, 0x78, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 3 | 0x3d, 0x22, 0x33, 0x2e, 0x30, 0x22, 0x3e, 0x0d, 0x0a, 0x3c, 0x65, 0x6e, 4 | 0x74, 0x72, 0x79, 0x3e, 0x0d, 0x0a, 0x3c, 0x72, 0x65, 0x66, 0x20, 0x68, 5 | 0x72, 0x65, 0x66, 0x3d, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 6 | 0x72, 0x65, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x61, 0x63, 0x61, 7 | 0x73, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 8 | 0x61, 0x79, 0x2f, 0x67, 0x65, 0x74, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x2e, 9 | 0x61, 0x73, 0x70, 0x3f, 0x73, 0x63, 0x3d, 0x77, 0x74, 0x72, 0x78, 0x2d, 10 | 0x66, 0x6d, 0x22, 0x20, 0x2f, 0x3e, 0x0d, 0x0a, 0x3c, 0x2f, 0x65, 0x6e, 11 | 0x74, 0x72, 0x79, 0x3e, 0x0d, 0x0a, 0x3c, 0x65, 0x6e, 0x74, 0x72, 0x79, 12 | 0x3e, 0x0d, 0x0a, 0x3c, 0x72, 0x65, 0x66, 0x20, 0x68, 0x72, 0x65, 0x66, 13 | 0x3d, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6d, 0x65, 0x64, 14 | 0x69, 0x61, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x61, 0x64, 0x73, 15 | 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x64, 16 | 0x61, 0x74, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 17 | 0x73, 0x78, 0x2f, 0x57, 0x54, 0x52, 0x58, 0x2e, 0x61, 0x73, 0x78, 0x22, 18 | 0x20, 0x2f, 0x3e, 0x0d, 0x0a, 0x3c, 0x2f, 0x65, 0x6e, 0x74, 0x72, 0x79, 19 | 0x3e, 0x0d, 0x0a, 0x3c, 0x2f, 0x61, 0x73, 0x78, 0x3e, 0x0d, 0x0a 20 | }; 21 | qint64 media_asx_len = 215; 22 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/regression/regression_folderlilstmodel.pro: -------------------------------------------------------------------------------- 1 | QT += testlib 2 | TEMPLATE = app 3 | CONFIG += testcase 4 | 5 | QT += core gui 6 | 7 | greaterThan(QT_MAJOR_VERSION, 4) { 8 | QT += widgets quick 9 | } 10 | 11 | #------------------------------------------------ 12 | 13 | DEFINES += REGRESSION_TEST_FOLDERLISTMODEL 14 | 15 | SOURCES += tst_folderlistmodel.cpp 16 | 17 | include (../../folderlistmodel/folderlistmodel.pri) 18 | 19 | HEADERS += \ 20 | tempfiles.h 21 | 22 | SOURCES += \ 23 | tempfiles.cpp 24 | 25 | INCLUDEPATH += $$PWD 26 | 27 | # DEFINES += DEBUG_REMOVE 28 | 29 | #DEFINES += DEBUG_EXT_FS_WATCHER 30 | 31 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/regression/tempfiles.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2013 Canonical Ltd. 4 | * Copyright 2013 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: tempfiles.h 19 | * Date: 4/2/2013 20 | */ 21 | 22 | #ifndef TEMPFILES_H 23 | #define TEMPFILES_H 24 | 25 | #include 26 | 27 | /*! 28 | * \brief The TempFiles class easily creates some temporary files 29 | * 30 | * The current path starts with QDir::tempPath() 31 | * 32 | * By calling \ref addSubDirLevel() a directory is created under current path 33 | * 34 | * The \ref create() is used to create many files under current path 35 | * 36 | * removeAll() removes all files but not any directory created by addSubDirLevel() 37 | */ 38 | 39 | class TempFiles 40 | { 41 | public: 42 | TempFiles(); 43 | bool addSubDirLevel(const QString&dir); 44 | bool create(int counter =1); 45 | bool create(const QString& name, int counter = 1); 46 | bool touch(int counter =1); 47 | bool touch(const QString& name, int counter = 1); 48 | QString lastFileCreated(); 49 | QString lastNameCreated(); 50 | QStringList createdList() const { return m_filesCreated; } 51 | int created() const { return m_filesCreated.count();} 52 | int howManyExist(); 53 | void removeAll(); 54 | QStringList createdNames(); 55 | QString lastPath() const { return m_dir; } 56 | private: 57 | bool createPrivate(const QString& name, int counter, bool putContent) ; 58 | private: 59 | QString m_dir; 60 | QStringList m_filesCreated; 61 | QByteArray m_content; 62 | }; 63 | 64 | 65 | /*! 66 | * \brief The DeepDir class creates a directory tree under QDir::tempPath() 67 | * 68 | * The constructor receives the name of the first directory and the level of the tree 69 | * each subdirectory will have two files 70 | * 71 | * By calling \ref remove() the whole tree is removed. 72 | */ 73 | class DeepDir 74 | { 75 | public: 76 | DeepDir(const QString& rootDir, int level); 77 | ~ DeepDir() 78 | { 79 | remove(); 80 | } 81 | bool remove(); 82 | QString path() const { return root;} 83 | QString firstLevel() const { return firstDirLevel; } 84 | QString lastLevel() const { return lastDirLevel; } 85 | int filesCreated() const { return totalFiles;} 86 | int itemsCreated() const { return totalItems;} 87 | private: 88 | QString root; 89 | QString firstDirLevel; 90 | QString lastDirLevel; 91 | int totalFiles; 92 | int totalItems; 93 | }; 94 | 95 | #endif // TEMPFILES_H 96 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/regression/ubuntu_touch_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export APP_ID=com.ubuntu.filemanager_filemanager_test 4 | 5 | DESKTOP=`ls /usr/share/applications/*.desktop | tail -1` 6 | 7 | ## any application which uses QApplication crashes without --desktop_file_hint=valid_desktop_file 8 | 9 | ./regression_folderlilstmodel --desktop_file_hint=$DESKTOP $* 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/results/DesktopQt4.74.txt: -------------------------------------------------------------------------------- 1 | ********* Start testing of TestDirModel ********* 2 | Config: Using QTest library 4.7.4, Qt 4.7.4 3 | PASS : TestDirModel::initTestCase() 4 | PASS : TestDirModel::fsActionRemoveSingleFile() 5 | PASS : TestDirModel::fsActionRemoveSingleDir() 6 | PASS : TestDirModel::fsActionRemoveOneFileOneDir() 7 | PASS : TestDirModel::fsActionRemoveTwoFilesTwoDirs() 8 | PASS : TestDirModel::modelRemoveRecursiveDirByIndex() 9 | PASS : TestDirModel::modelRemoveMultiItemsByFullPathname() 10 | PASS : TestDirModel::modelRemoveMultiItemsByName() 11 | PASS : TestDirModel::modelCopyDirPasteIntoAnotherModel() 12 | PASS : TestDirModel::modelCopyManyItemsPasteIntoAnotherModel() 13 | PASS : TestDirModel::modelCutManyItemsPasteIntoAnotherModel() 14 | PASS : TestDirModel::fsActionMoveItemsForcingCopyAndThenRemove() 15 | PASS : TestDirModel::modelCancelRemoveAction() 16 | PASS : TestDirModel::modelTestFileSize() 17 | PASS : TestDirModel::modelRemoveDirWithHiddenFilesAndLinks() 18 | PASS : TestDirModel::modelCancelCopyAction() 19 | PASS : TestDirModel::modelCopyFileAndDirectoryLinks() 20 | PASS : TestDirModel::modelCopyAndPaste3Times() 21 | PASS : TestDirModel::modelCutAndPaste3Times() 22 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type text/plain 23 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type text/x-c++src 24 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type text/x-csrc 25 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type inode/directory 26 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/msword 27 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/octet-stream 28 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/pdf 29 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/postscript 30 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/x-bzip-compressed-tar 31 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/x-executable 32 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/x-gzip 33 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/x-shellscript 34 | PASS : TestDirModel::getThemeIcons() 35 | QWARN : TestDirModel::fileIconProvider() GOOD icon from QFileIconProvide::icon() for /tmp/tst_folderlistmodel_test.mp3 36 | QWARN : TestDirModel::fileIconProvider() GOOD icon from QFileIconProvide::icon() for /tmp/tst_folderlistmodel_test.pdf 37 | QWARN : TestDirModel::fileIconProvider() GOOD icon from QFileIconProvide::icon() for /tmp/tst_folderlistmodel_test.asx 38 | QWARN : TestDirModel::fileIconProvider() GOOD icon from QFileIconProvide::icon() for /tmp/tst_folderlistmodel_test.xspf 39 | PASS : TestDirModel::fileIconProvider() 40 | QWARN : TestDirModel::openMP3() GOOD: QDesktopServices::openUrl() works for MP3 files 41 | PASS : TestDirModel::openMP3() 42 | QWARN : TestDirModel::openTXT() GOOD: QDesktopServices::openUrl() works for TEXT files 43 | PASS : TestDirModel::openTXT() 44 | PASS : TestDirModel::openPDF() 45 | PASS : TestDirModel::cleanupTestCase() 46 | Totals: 25 passed, 0 failed, 0 skipped 47 | ********* Finished testing of TestDirModel ********* 48 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/results/DesktopQt5.0.txt: -------------------------------------------------------------------------------- 1 | ********* Start testing of TestDirModel ********* 2 | Config: Using QTest library 5.0.0, Qt 5.0.0 3 | PASS : TestDirModel::initTestCase() 4 | PASS : TestDirModel::fsActionRemoveSingleFile() 5 | PASS : TestDirModel::fsActionRemoveSingleDir() 6 | PASS : TestDirModel::fsActionRemoveOneFileOneDir() 7 | PASS : TestDirModel::fsActionRemoveTwoFilesTwoDirs() 8 | PASS : TestDirModel::modelRemoveRecursiveDirByIndex() 9 | PASS : TestDirModel::modelRemoveMultiItemsByFullPathname() 10 | PASS : TestDirModel::modelRemoveMultiItemsByName() 11 | PASS : TestDirModel::modelCopyDirPasteIntoAnotherModel() 12 | PASS : TestDirModel::modelCopyManyItemsPasteIntoAnotherModel() 13 | QWARN : TestDirModel::modelCutManyItemsPasteIntoAnotherModel() QXcbClipboard: SelectionRequest too old 14 | QWARN : TestDirModel::modelCutManyItemsPasteIntoAnotherModel() QXcbClipboard: SelectionRequest too old 15 | QWARN : TestDirModel::modelCutManyItemsPasteIntoAnotherModel() QXcbClipboard: SelectionRequest too old 16 | QWARN : TestDirModel::modelCutManyItemsPasteIntoAnotherModel() QXcbClipboard: SelectionRequest too old 17 | PASS : TestDirModel::modelCutManyItemsPasteIntoAnotherModel() 18 | PASS : TestDirModel::fsActionMoveItemsForcingCopyAndThenRemove() 19 | PASS : TestDirModel::modelCancelRemoveAction() 20 | PASS : TestDirModel::modelTestFileSize() 21 | PASS : TestDirModel::modelRemoveDirWithHiddenFilesAndLinks() 22 | PASS : TestDirModel::modelCancelCopyAction() 23 | PASS : TestDirModel::modelCopyFileAndDirectoryLinks() 24 | PASS : TestDirModel::modelCopyAndPaste3Times() 25 | QWARN : TestDirModel::modelCutAndPaste3Times() QXcbClipboard: SelectionRequest too old 26 | QWARN : TestDirModel::modelCutAndPaste3Times() QXcbClipboard: SelectionRequest too old 27 | PASS : TestDirModel::modelCutAndPaste3Times() 28 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type text/plain 29 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type text/x-c++src 30 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type text/x-csrc 31 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type inode/directory 32 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/msword 33 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/octet-stream 34 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/pdf 35 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/postscript 36 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/x-bzip-compressed-tar 37 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/x-executable 38 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/x-gzip 39 | QWARN : TestDirModel::getThemeIcons() GOOD icon using QIcon::fromTheme() for mime type application/x-shellscript 40 | PASS : TestDirModel::getThemeIcons() 41 | QWARN : TestDirModel::fileIconProvider() QFileIconProvider::File or a BAD icon from QFileIconProvide::icon() for /tmp/tst_folderlistmodel_test.mp3 42 | QWARN : TestDirModel::fileIconProvider() QFileIconProvider::File or a BAD icon from QFileIconProvide::icon() for /tmp/tst_folderlistmodel_test.pdf 43 | QWARN : TestDirModel::fileIconProvider() QFileIconProvider::File or a BAD icon from QFileIconProvide::icon() for /tmp/tst_folderlistmodel_test.asx 44 | QWARN : TestDirModel::fileIconProvider() QFileIconProvider::File or a BAD icon from QFileIconProvide::icon() for /tmp/tst_folderlistmodel_test.xspf 45 | PASS : TestDirModel::fileIconProvider() 46 | QWARN : TestDirModel::openMP3() GOOD: QDesktopServices::openUrl() works for MP3 files 47 | PASS : TestDirModel::openMP3() 48 | QWARN : TestDirModel::openTXT() GOOD: QDesktopServices::openUrl() works for TEXT files 49 | PASS : TestDirModel::openTXT() 50 | PASS : TestDirModel::openPDF() 51 | PASS : TestDirModel::cleanupTestCase() 52 | Totals: 25 passed, 0 failed, 0 skipped 53 | ********* Finished testing of TestDirModel ********* 54 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/results/NemoEmulatorQ8.43.txt: -------------------------------------------------------------------------------- 1 | ********* Start testing of TestDirModel ********* 2 | Config: Using QTest library 4.8.3, Qt 4.8.3 3 | PASS : TestDirModel::initTestCase() 4 | PASS : TestDirModel::fsActionRemoveSingleFile() 5 | PASS : TestDirModel::fsActionRemoveSingleDir() 6 | PASS : TestDirModel::fsActionRemoveOneFileOneDir() 7 | PASS : TestDirModel::fsActionRemoveTwoFilesTwoDirs() 8 | PASS : TestDirModel::modelRemoveRecursiveDirByIndex() 9 | PASS : TestDirModel::modelRemoveMultiItemsByFullPathname() 10 | PASS : TestDirModel::modelRemoveMultiItemsByName() 11 | PASS : TestDirModel::modelCopyDirPasteIntoAnotherModel() 12 | PASS : TestDirModel::modelCopyManyItemsPasteIntoAnotherModel() 13 | PASS : TestDirModel::modelCutManyItemsPasteIntoAnotherModel() 14 | PASS : TestDirModel::fsActionMoveItemsForcingCopyAndThenRemove() 15 | PASS : TestDirModel::modelCancelRemoveAction() 16 | PASS : TestDirModel::modelTestFileSize() 17 | PASS : TestDirModel::modelRemoveDirWithHiddenFilesAndLinks() 18 | PASS : TestDirModel::modelCancelCopyAction() 19 | PASS : TestDirModel::modelCopyFileAndDirectoryLinks() 20 | PASS : TestDirModel::modelCopyAndPaste3Times() 21 | PASS : TestDirModel::modelCutAndPaste3Times() 22 | SKIP : TestDirModel::getThemeIcons() invalid QIcon::fromTheme text-plain 23 | Loc: [/mnt/mint14kde/home/carlos/ubuntu_work/bazarrepo/test_folderlistmodel/regression/tst_folderlistmodel.cpp(1006)] 24 | QWARN : TestDirModel::fileIconProvider() QFileIconProvider::File or a BAD icon from QFileIconProvide::icon() for /var/tmp/tst_folderlistmodel_test.mp3 25 | QWARN : TestDirModel::fileIconProvider() QFileIconProvider::File or a BAD icon from QFileIconProvide::icon() for /var/tmp/tst_folderlistmodel_test.pdf 26 | QWARN : TestDirModel::fileIconProvider() QFileIconProvider::File or a BAD icon from QFileIconProvide::icon() for /var/tmp/tst_folderlistmodel_test.asx 27 | QWARN : TestDirModel::fileIconProvider() QFileIconProvider::File or a BAD icon from QFileIconProvide::icon() for /var/tmp/tst_folderlistmodel_test.xspf 28 | PASS : TestDirModel::fileIconProvider() 29 | QWARN : TestDirModel::openMP3() GOOD: QDesktopServices::openUrl() works for MP3 files 30 | PASS : TestDirModel::openMP3() 31 | QWARN : TestDirModel::openTXT() GOOD: QDesktopServices::openUrl() works for TEXT files 32 | PASS : TestDirModel::openTXT() 33 | PASS : TestDirModel::openPDF() 34 | PASS : TestDirModel::cleanupTestCase() 35 | Totals: 24 passed, 0 failed, 1 skipped 36 | ********* Finished testing of TestDirModel ********* 37 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/results/openFiles.Readme.txt: -------------------------------------------------------------------------------- 1 | 2 | On Nemo emulator tried to open files using QDesktopServices::openUrl() 3 | ======================================================= 4 | 5 | mp3 file -> attempted to open in Internet browser and got stuck 6 | txt file -> opened in the browser 7 | pdf file -> attempted to open in Internet browser and got stuck 8 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/actionprogress.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: actionprogress.cpp 19 | * Date: 30/12/2014 20 | */ 21 | 22 | #include "actionprogress.h" 23 | #include 24 | #include 25 | #include 26 | 27 | ActionProgress::ActionProgress(QWidget *parent) :QDialog(parent) 28 | { 29 | m_pbar = new QProgressBar(this); 30 | m_pbar->setMaximum(100); 31 | m_pbar->setMinimum(0); 32 | QPushButton *btn = new QPushButton("Cancel", this); 33 | connect(btn, SIGNAL(clicked()), this, SIGNAL(cancel())); 34 | QVBoxLayout *layout = new QVBoxLayout(this); 35 | layout->addWidget(m_pbar); 36 | layout->addWidget(btn); 37 | } 38 | 39 | 40 | void ActionProgress::setValue(int v ) 41 | { 42 | m_pbar->setValue(v); 43 | } 44 | 45 | void ActionProgress::reset() 46 | { 47 | m_pbar->reset(); 48 | } 49 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/actionprogress.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: actionprogress.h 19 | * Date: 30/12/2014 20 | */ 21 | 22 | #ifndef ACTIONPROGRESS_H 23 | #define ACTIONPROGRESS_H 24 | 25 | #include 26 | 27 | class QProgressBar; 28 | 29 | class ActionProgress : public QDialog 30 | { 31 | Q_OBJECT 32 | public: 33 | ActionProgress(QWidget *parent = 0); 34 | signals: 35 | void cancel(); 36 | public slots: 37 | void setValue(int v); 38 | void reset() ; 39 | private: 40 | QProgressBar * m_pbar; 41 | }; 42 | 43 | #endif // ACTIONPROGRESS_H 44 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/main.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2013 Canonical Ltd. 4 | * Copyright 2013 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: main.cpp 19 | * Date: 3/9/2013 20 | */ 21 | 22 | #include "simplelist.h" 23 | #include 24 | 25 | int main(int argc, char *argv[]) 26 | { 27 | QApplication a(argc, argv); 28 | SimpleList w; 29 | w.show(); 30 | 31 | return a.exec(); 32 | } 33 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/placesmodel.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: placesmodel.cpp 19 | * Date: 21/04/2014 20 | */ 21 | 22 | #include "placesmodel.h" 23 | #include "locationurl.h" 24 | #include 25 | #include 26 | #include 27 | 28 | 29 | PlacesModel::PlacesModel(QObject *parent) : 30 | QAbstractListModel(parent) 31 | { 32 | QLatin1String doc("Documents"); 33 | QLatin1String dow("Downloads"); 34 | 35 | addPlace("Home", ":/resources/resources/home-page.png", QStringList(QDir::homePath())); 36 | 37 | addPlace(doc, ":/resources/resources/document_folder.png", 38 | QStringList() << QStandardPaths::displayName(QStandardPaths::DocumentsLocation) 39 | << QDir::homePath() + QDir::separator() + doc 40 | ); 41 | 42 | addPlace(dow, ":/resources/resources/downloads_folder.png", 43 | QStringList() << QStandardPaths::displayName(QStandardPaths::DownloadLocation) 44 | << QDir::homePath() + QDir::separator() + dow 45 | ); 46 | 47 | addPlace("Temp", ":/resources/resources/temp_folder.png", QStringList(QDir::tempPath())); 48 | 49 | addPlace("Root", ":/resources/resources/red_folder.png", QStringList(QDir::rootPath())); 50 | 51 | addPlace("Trash", ":/resources/resources/recyclebin_full.png", QStringList(LocationUrl::TrashRootURL)); 52 | } 53 | 54 | 55 | QVariant PlacesModel::data(const QModelIndex &index, int role) const 56 | { 57 | if ( role == Qt::DisplayRole) 58 | { 59 | return m_places.at(index.row()).name; 60 | } 61 | if (role == Qt::DecorationRole) 62 | { 63 | return m_places.at(index.row()).icon; 64 | } 65 | return QVariant(); 66 | } 67 | 68 | 69 | QString PlacesModel::pathFrom(int row) const 70 | { 71 | return m_places.at(row).urlPath; 72 | } 73 | 74 | 75 | void PlacesModel::addPlace(const QString &n, const QString &i, const QStringList &u) 76 | { 77 | Place place(n,i); 78 | if (u.count() == 1) 79 | { 80 | place.urlPath = u.at(0); 81 | m_places.append(place); 82 | return; 83 | } 84 | 85 | for (int counter = 0 ; counter < u.count(); ++counter) 86 | { 87 | if (QFileInfo(u.at(counter)).exists()) 88 | { 89 | place.urlPath = u.at(counter); 90 | m_places.append(place); 91 | return; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/placesmodel.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2014 Canonical Ltd. 4 | * Copyright 2014 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: placesmodel.h 19 | * Date: 21/04/2014 20 | */ 21 | 22 | #ifndef PLACESMODEL_H 23 | #define PLACESMODEL_H 24 | 25 | #include 26 | #include 27 | 28 | class PlacesModel : public QAbstractListModel 29 | { 30 | Q_OBJECT 31 | public: 32 | explicit PlacesModel(QObject *parent = 0); 33 | 34 | virtual QVariant data(const QModelIndex &index, int role) const; 35 | virtual int rowCount(const QModelIndex &) const 36 | { return m_places.count(); } 37 | 38 | QString pathFrom(int row) const; 39 | 40 | private: 41 | void addPlace(const QString& n, 42 | const QString& i, 43 | const QStringList& u); 44 | 45 | private: 46 | struct Place 47 | { 48 | public: 49 | Place(const QString&n, const QString& i): 50 | name(n), 51 | icon(i) 52 | { 53 | 54 | } 55 | QString name; 56 | QIcon icon; 57 | QString urlPath; 58 | }; 59 | 60 | QList m_places; 61 | }; 62 | 63 | #endif // PLACESMODEL_H 64 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/res.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/xterm_48x48.xpm 4 | resources/home-page.png 5 | resources/recyclebin_full.png 6 | resources/empty_trash.png 7 | resources/undo.png 8 | resources/go-previous.png 9 | resources/go-up.png 10 | resources/edit-rename.png 11 | resources/folder-new.png 12 | resources/copy.png 13 | resources/cut.png 14 | resources/filenew.png 15 | resources/remove.png 16 | resources/trash.png 17 | resources/paste.png 18 | resources/temp_folder.png 19 | resources/red_folder.png 20 | resources/document_folder.png 21 | resources/downloads_folder.png 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/copy.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/cut.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/document_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/document_folder.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/downloads_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/downloads_folder.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/edit-rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/edit-rename.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/empty_trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/empty_trash.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/exit.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/fileclose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/fileclose.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/filenew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/filenew.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/fileopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/fileopen.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/folder-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/folder-new.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/go-previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/go-previous.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/go-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/go-up.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/home-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/home-page.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/paste.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/recyclebin_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/recyclebin_full.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/red_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/red_folder.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/remove.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/temp_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/temp_folder.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/trash.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lirios/files/a29bea19c45f0cbae3cd3420abeaa4e10d6783ab/src/imports/test_folderlistmodel/simpleUI/resources/undo.png -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/resources/xterm_48x48.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * xterm_48x48_xpm[] = { 3 | "48 48 2 1", 4 | " c #000000", 5 | ". c #FFFFFF", 6 | "................................................", 7 | "...... ........", 8 | "..... .................................. ......", 9 | "..... ... ... . .....", 10 | "..... .. ............................ .. .. ....", 11 | "..... . .............................. . ... ...", 12 | "..... . . .... ................... . .... ..", 13 | "..... . .. .... .................... . .... ..", 14 | "..... . ... .. ..................... . .... ..", 15 | "..... . ... .. ..................... . .... ..", 16 | "..... . .... ...................... . .... ..", 17 | "..... . .... ...................... . .... ..", 18 | "..... . ..... ....................... . .... ..", 19 | "..... . .... ...................... . .... ..", 20 | "..... . .... ...................... . .... ..", 21 | "..... . ... .. ..................... . .... ..", 22 | "..... . ... .. ..................... . .... ..", 23 | "..... . .. .... .................... . .... ..", 24 | "..... . . .... ................... . .... ..", 25 | "..... . .............................. . .... ..", 26 | "..... . .............................. . .... ..", 27 | "..... . . . .. ... ... . . .... ..", 28 | "..... . ... .... ...... ... .. ... . . .... ..", 29 | "..... . ... .... ...... ... .. . . . . . .... ..", 30 | "..... . ... .... ... ... . . . . . .... ..", 31 | "..... . ... .... ...... . .... .. .. . . ... ...", 32 | "..... . ... .... ...... .. ... .. .. . . ... ...", 33 | "..... . ... .... .. ... .. ..... . . .. ....", 34 | "..... . .............................. . .. ....", 35 | "..... . .............................. . . .....", 36 | "..... .. ............................ .. . .....", 37 | "..... ... ... ......", 38 | "..... .................................. ......", 39 | "...... ........", 40 | "................................................", 41 | "................................................", 42 | "...... ......", 43 | "..... .................................. ......", 44 | "..... . . . . . . . . . . . . . . . . .. ......", 45 | ".... .................................. . ......", 46 | ".... . . . . . . . . . . . . . . . . .. . ......", 47 | "... .................................. .. ......", 48 | "... . . . . . . . . . . . . . . . . .. .. ......", 49 | ".. .................................. .. .......", 50 | ".. . . . . . ........", 51 | ". .................................. . .........", 52 | ". ..........", 53 | "................................................"}; 54 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/simplelist.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2013 Canonical Ltd. 4 | * Copyright 2013 Carlos J Mazieri 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; version 3. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * File: simplelist.h 19 | * Date: 3/9/2013 20 | */ 21 | 22 | #ifndef SIMPLELIST_H 23 | #define SIMPLELIST_H 24 | 25 | #include 26 | #include 27 | 28 | class DirModel; 29 | class QProgressBar; 30 | class DirSelection; 31 | class PlacesModel; 32 | class ActionProgress; 33 | 34 | namespace Ui { 35 | class SimpleList; 36 | } 37 | 38 | 39 | class SimpleList : public QMainWindow 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | explicit SimpleList(QWidget *parent = 0); 45 | ~SimpleList(); 46 | 47 | protected: 48 | bool eventFilter(QObject *obj, QEvent *event); 49 | 50 | private: 51 | void allowSelectedActions(int selectedCounter); 52 | void allowTrashActions(bool enable); 53 | void do_connections(); 54 | 55 | private: 56 | Ui::SimpleList *ui; 57 | DirModel *m_model; 58 | ActionProgress * m_pbar; 59 | DirSelection * m_selection; 60 | bool m_holdingCtrlKey; 61 | bool m_holdingShiftKey; 62 | Qt::MouseButton m_button; 63 | PlacesModel * m_placesModel; 64 | 65 | private slots: 66 | void onNewDir(); 67 | void onRename(); 68 | void onRowClicked(QModelIndex); 69 | void onOpenItem(QModelIndex index); 70 | void onSetSort(int col, Qt::SortOrder order); 71 | void onProgress(int, int,int); 72 | void onClipboardChanged(); 73 | void onError(QString title, QString message); 74 | void onPathChanged(QString path); 75 | void onPathChoosedFromList(int); 76 | void onPathComboEdited(); 77 | void onSelectionChanged(int); 78 | void onPlacesClicked(QModelIndex); 79 | void onOpenTerminal(); 80 | void onCancelAction(); 81 | void onStatusChanged(); 82 | }; 83 | 84 | #endif // SIMPLELIST_H 85 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/simpleui.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2013-03-09T12:30:11 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | 10 | greaterThan(QT_MAJOR_VERSION, 4) { 11 | QT += widgets quick 12 | } 13 | 14 | TEMPLATE = app 15 | 16 | DEFINES += REGRESSION_TEST_FOLDERLISTMODEL 17 | 18 | SOURCES += main.cpp simplelist.cpp simpleslots.cpp placesmodel.cpp terminalfolderapp.cpp \ 19 | actionprogress.cpp 20 | 21 | HEADERS += simplelist.h placesmodel.h terminalfolderapp.h \ 22 | actionprogress.h 23 | 24 | FORMS += simplelist.ui 25 | 26 | include (../../folderlistmodel/folderlistmodel.pri) 27 | 28 | #DEFINES += DEBUG_REMOVE 29 | 30 | DEFINES += SIMULATE_LONG_ACTION DEBUG_EXT_FS_WATCHER 31 | 32 | RESOURCES += res.qrc 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/imports/test_folderlistmodel/simpleUI/terminalfolderapp.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright 2013 Canonical Ltd. 4 | * Copyright 2013 Carlos J Mazieri 5 | * 6 | * You may use this file under the terms of the BSD license as follows: 7 | * 8 | * "Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * * Neither the name of Nemo Mobile nor the names of its contributors 18 | * may be used to endorse or promote products derived from this 19 | * software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 32 | * 33 | * 34 | * Filename: terminalfolderapp.h 35 | * Created : 29 Jul 2013 36 | **/ 37 | 38 | 39 | #ifndef TERMINALFOLDERAPP_H 40 | #define TERMINALFOLDERAPP_H 41 | 42 | #include 43 | #include 44 | 45 | 46 | /*! 47 | * Since KDE and GNOME calling "x-terminal-emulator" do not give the real process id, closing a TerminalFolderApp 48 | * is disabled by default. 49 | * 50 | * \ref TerminalFolderApp::closeTerminal() works for: 51 | * \li Ubuntu Touch 52 | * \li Meego, tested on Nemo Mobile and Nokia N9 53 | */ 54 | #ifndef ENABLE_CLOSING 55 | # define ENABLE_CLOSING 0 56 | #endif 57 | 58 | /*! 59 | * \brief The TerminalFolderApp class opens a suitable Terminal application with a working directory 60 | * 61 | * It tries to find and open a terminal application in the sequence: 62 | * \li "meego-terminal" for Nemo Mobile and Nokia N9 63 | * \li "ubuntu-terminal-app" for Ubuntu Touch 64 | * \li "x-terminal-emulator" for any Desktop such as KDE and Gnome 65 | * \li TERM environment variable if defined 66 | */ 67 | class TerminalFolderApp : public QObject 68 | { 69 | Q_OBJECT 70 | public: 71 | explicit TerminalFolderApp(QObject *parent = 0); 72 | ~TerminalFolderApp(); 73 | 74 | public slots: 75 | bool openTerminal(const QString& currentDir); 76 | 77 | private: 78 | void findTerminalApp(); 79 | void findDesktopParameter(); 80 | 81 | 82 | #if ENABLE_CLOSING 83 | signals: 84 | void openCounterChanged(int openedTerminals); 85 | public slots: 86 | bool closeTerminal(int index); 87 | private: 88 | bool killPid(Q_PID pid); 89 | #endif 90 | 91 | #if REGRESSION_TEST_FOLDERLISTMODEL 92 | public: 93 | #else 94 | private: 95 | #endif 96 | QList m_openPids; 97 | QString m_terminalApp; 98 | QStringList m_params; //!< used to pass workdir parameter 99 | }; 100 | #endif // TERMINALFOLDERAPP_H 101 | -------------------------------------------------------------------------------- /translations/data/desktop/ar.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-05-17 11:25+0200\n" 12 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 13 | "Language-Team: Arabic (https://www.transifex.com/lirios/teams/71982/ar/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: ar\n" 18 | "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" 19 | 20 | #. (desktop-to-pot) "Name" entry 21 | #: io.liri.Files.desktop.in:3 22 | msgctxt "Name entry" 23 | msgid "Liri Files" 24 | msgstr "" 25 | 26 | #. (desktop-to-pot) "GenericName" entry 27 | #: io.liri.Files.desktop.in:4 28 | msgctxt "GenericName entry" 29 | msgid "File Manager" 30 | msgstr "" 31 | 32 | #. (desktop-to-pot) "Comment" entry 33 | #: io.liri.Files.desktop.in:5 34 | msgctxt "Comment entry" 35 | msgid "Access and organize files" 36 | msgstr "" 37 | 38 | #. (desktop-to-pot) "Keywords" entry 39 | #: io.liri.Files.desktop.in:6 40 | msgctxt "Keywords entry" 41 | msgid "folder;manager;explore;disk;filesystem;" 42 | msgstr "" 43 | -------------------------------------------------------------------------------- /translations/data/desktop/da.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # scootergrisen, 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: PACKAGE VERSION\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 15 | "Last-Translator: scootergrisen, 2020\n" 16 | "Language-Team: Danish (https://www.transifex.com/lirios/teams/71982/da/)\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=UTF-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Language: da\n" 21 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 22 | 23 | #. (desktop-to-pot) "Name" entry 24 | #: io.liri.Files.desktop.in:3 25 | msgctxt "Name entry" 26 | msgid "Liri Files" 27 | msgstr "Liri-filer" 28 | 29 | #. (desktop-to-pot) "GenericName" entry 30 | #: io.liri.Files.desktop.in:4 31 | msgctxt "GenericName entry" 32 | msgid "File Manager" 33 | msgstr "Filhåndtering" 34 | 35 | #. (desktop-to-pot) "Comment" entry 36 | #: io.liri.Files.desktop.in:5 37 | msgctxt "Comment entry" 38 | msgid "Access and organize files" 39 | msgstr "Tilgå og organiser filer" 40 | 41 | #. (desktop-to-pot) "Keywords" entry 42 | #: io.liri.Files.desktop.in:6 43 | msgctxt "Keywords entry" 44 | msgid "folder;manager;explore;disk;filesystem;" 45 | msgstr "mappe;håndtering;udforsk;disk;filsystem;" 46 | -------------------------------------------------------------------------------- /translations/data/desktop/de.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Ettore Atalan , 2021 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: PACKAGE VERSION\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 15 | "Last-Translator: Ettore Atalan , 2021\n" 16 | "Language-Team: German (https://www.transifex.com/lirios/teams/71982/de/)\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=UTF-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Language: de\n" 21 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 22 | 23 | #. (desktop-to-pot) "Name" entry 24 | #: io.liri.Files.desktop.in:3 25 | msgctxt "Name entry" 26 | msgid "Liri Files" 27 | msgstr "Liri Dateien" 28 | 29 | #. (desktop-to-pot) "GenericName" entry 30 | #: io.liri.Files.desktop.in:4 31 | msgctxt "GenericName entry" 32 | msgid "File Manager" 33 | msgstr "Dateiverwaltung" 34 | 35 | #. (desktop-to-pot) "Comment" entry 36 | #: io.liri.Files.desktop.in:5 37 | msgctxt "Comment entry" 38 | msgid "Access and organize files" 39 | msgstr "Auf Dateien zugreifen und diese organisieren" 40 | 41 | #. (desktop-to-pot) "Keywords" entry 42 | #: io.liri.Files.desktop.in:6 43 | msgctxt "Keywords entry" 44 | msgid "folder;manager;explore;disk;filesystem;" 45 | msgstr "" 46 | -------------------------------------------------------------------------------- /translations/data/desktop/desktop.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 | "Last-Translator: FULL NAME \n" 13 | "Language-Team: LANGUAGE \n" 14 | "Language: \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #. (desktop-to-pot) "Name" entry 20 | #: io.liri.Files.desktop.in:3 21 | msgctxt "Name entry" 22 | msgid "Liri Files" 23 | msgstr "" 24 | 25 | #. (desktop-to-pot) "GenericName" entry 26 | #: io.liri.Files.desktop.in:4 27 | msgctxt "GenericName entry" 28 | msgid "File Manager" 29 | msgstr "" 30 | 31 | #. (desktop-to-pot) "Comment" entry 32 | #: io.liri.Files.desktop.in:5 33 | msgctxt "Comment entry" 34 | msgid "Access and organize files" 35 | msgstr "" 36 | 37 | #. (desktop-to-pot) "Keywords" entry 38 | #: io.liri.Files.desktop.in:6 39 | msgctxt "Keywords entry" 40 | msgid "folder;manager;explore;disk;filesystem;" 41 | msgstr "" 42 | -------------------------------------------------------------------------------- /translations/data/desktop/fr.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-05-17 11:25+0200\n" 12 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 13 | "Language-Team: French (https://www.transifex.com/lirios/teams/71982/fr/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: fr\n" 18 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 19 | 20 | #. (desktop-to-pot) "Name" entry 21 | #: io.liri.Files.desktop.in:3 22 | msgctxt "Name entry" 23 | msgid "Liri Files" 24 | msgstr "" 25 | 26 | #. (desktop-to-pot) "GenericName" entry 27 | #: io.liri.Files.desktop.in:4 28 | msgctxt "GenericName entry" 29 | msgid "File Manager" 30 | msgstr "" 31 | 32 | #. (desktop-to-pot) "Comment" entry 33 | #: io.liri.Files.desktop.in:5 34 | msgctxt "Comment entry" 35 | msgid "Access and organize files" 36 | msgstr "" 37 | 38 | #. (desktop-to-pot) "Keywords" entry 39 | #: io.liri.Files.desktop.in:6 40 | msgctxt "Keywords entry" 41 | msgid "folder;manager;explore;disk;filesystem;" 42 | msgstr "" 43 | -------------------------------------------------------------------------------- /translations/data/desktop/it.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Man from Mars, 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: PACKAGE VERSION\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 15 | "Last-Translator: Man from Mars, 2020\n" 16 | "Language-Team: Italian (https://www.transifex.com/lirios/teams/71982/it/)\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=UTF-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Language: it\n" 21 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 22 | 23 | #. (desktop-to-pot) "Name" entry 24 | #: io.liri.Files.desktop.in:3 25 | msgctxt "Name entry" 26 | msgid "Liri Files" 27 | msgstr "Liri Files" 28 | 29 | #. (desktop-to-pot) "GenericName" entry 30 | #: io.liri.Files.desktop.in:4 31 | msgctxt "GenericName entry" 32 | msgid "File Manager" 33 | msgstr "Gestore file" 34 | 35 | #. (desktop-to-pot) "Comment" entry 36 | #: io.liri.Files.desktop.in:5 37 | msgctxt "Comment entry" 38 | msgid "Access and organize files" 39 | msgstr "Gestisci ed organizza i file" 40 | 41 | #. (desktop-to-pot) "Keywords" entry 42 | #: io.liri.Files.desktop.in:6 43 | msgctxt "Keywords entry" 44 | msgid "folder;manager;explore;disk;filesystem;" 45 | msgstr "cartella;gestore;esplora;disco;filesystem" 46 | -------------------------------------------------------------------------------- /translations/data/desktop/lt.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Moo, 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: PACKAGE VERSION\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 15 | "Last-Translator: Moo, 2020\n" 16 | "Language-Team: Lithuanian (https://www.transifex.com/lirios/teams/71982/lt/)\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=UTF-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Language: lt\n" 21 | "Plural-Forms: nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);\n" 22 | 23 | #. (desktop-to-pot) "Name" entry 24 | #: io.liri.Files.desktop.in:3 25 | msgctxt "Name entry" 26 | msgid "Liri Files" 27 | msgstr "Liri failai" 28 | 29 | #. (desktop-to-pot) "GenericName" entry 30 | #: io.liri.Files.desktop.in:4 31 | msgctxt "GenericName entry" 32 | msgid "File Manager" 33 | msgstr "Failų tvarkytuvė" 34 | 35 | #. (desktop-to-pot) "Comment" entry 36 | #: io.liri.Files.desktop.in:5 37 | msgctxt "Comment entry" 38 | msgid "Access and organize files" 39 | msgstr "Gauti prieigą prie failų ir juos tvarkyti" 40 | 41 | #. (desktop-to-pot) "Keywords" entry 42 | #: io.liri.Files.desktop.in:6 43 | msgctxt "Keywords entry" 44 | msgid "folder;manager;explore;disk;filesystem;" 45 | msgstr "aplankas;tvarkytuvė;naršyti;diskas;failų sistema;" 46 | -------------------------------------------------------------------------------- /translations/data/desktop/nl.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-05-17 11:25+0200\n" 12 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 13 | "Language-Team: Dutch (https://www.transifex.com/lirios/teams/71982/nl/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: nl\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | 20 | #. (desktop-to-pot) "Name" entry 21 | #: io.liri.Files.desktop.in:3 22 | msgctxt "Name entry" 23 | msgid "Liri Files" 24 | msgstr "" 25 | 26 | #. (desktop-to-pot) "GenericName" entry 27 | #: io.liri.Files.desktop.in:4 28 | msgctxt "GenericName entry" 29 | msgid "File Manager" 30 | msgstr "" 31 | 32 | #. (desktop-to-pot) "Comment" entry 33 | #: io.liri.Files.desktop.in:5 34 | msgctxt "Comment entry" 35 | msgid "Access and organize files" 36 | msgstr "" 37 | 38 | #. (desktop-to-pot) "Keywords" entry 39 | #: io.liri.Files.desktop.in:6 40 | msgctxt "Keywords entry" 41 | msgid "folder;manager;explore;disk;filesystem;" 42 | msgstr "" 43 | -------------------------------------------------------------------------------- /translations/data/desktop/pl.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-05-17 11:25+0200\n" 12 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 13 | "Language-Team: Polish (https://www.transifex.com/lirios/teams/71982/pl/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: pl\n" 18 | "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" 19 | 20 | #. (desktop-to-pot) "Name" entry 21 | #: io.liri.Files.desktop.in:3 22 | msgctxt "Name entry" 23 | msgid "Liri Files" 24 | msgstr "" 25 | 26 | #. (desktop-to-pot) "GenericName" entry 27 | #: io.liri.Files.desktop.in:4 28 | msgctxt "GenericName entry" 29 | msgid "File Manager" 30 | msgstr "" 31 | 32 | #. (desktop-to-pot) "Comment" entry 33 | #: io.liri.Files.desktop.in:5 34 | msgctxt "Comment entry" 35 | msgid "Access and organize files" 36 | msgstr "" 37 | 38 | #. (desktop-to-pot) "Keywords" entry 39 | #: io.liri.Files.desktop.in:6 40 | msgctxt "Keywords entry" 41 | msgid "folder;manager;explore;disk;filesystem;" 42 | msgstr "" 43 | -------------------------------------------------------------------------------- /translations/data/desktop/pt_BR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Luiz Fernando Ranghetti , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: PACKAGE VERSION\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 15 | "Last-Translator: Luiz Fernando Ranghetti , 2020\n" 16 | "Language-Team: Portuguese (Brazil) (https://www.transifex.com/lirios/teams/71982/pt_BR/)\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=UTF-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Language: pt_BR\n" 21 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 22 | 23 | #. (desktop-to-pot) "Name" entry 24 | #: io.liri.Files.desktop.in:3 25 | msgctxt "Name entry" 26 | msgid "Liri Files" 27 | msgstr "Liri Files" 28 | 29 | #. (desktop-to-pot) "GenericName" entry 30 | #: io.liri.Files.desktop.in:4 31 | msgctxt "GenericName entry" 32 | msgid "File Manager" 33 | msgstr "Gerenciador de arquivos" 34 | 35 | #. (desktop-to-pot) "Comment" entry 36 | #: io.liri.Files.desktop.in:5 37 | msgctxt "Comment entry" 38 | msgid "Access and organize files" 39 | msgstr "Acesse e organize arquivos" 40 | 41 | #. (desktop-to-pot) "Keywords" entry 42 | #: io.liri.Files.desktop.in:6 43 | msgctxt "Keywords entry" 44 | msgid "folder;manager;explore;disk;filesystem;" 45 | msgstr "pasta;gerenciador;explorar;disco;sistema de arquivos;" 46 | -------------------------------------------------------------------------------- /translations/data/desktop/ru.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Irina Fedulova , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: PACKAGE VERSION\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 15 | "Last-Translator: Irina Fedulova , 2020\n" 16 | "Language-Team: Russian (https://www.transifex.com/lirios/teams/71982/ru/)\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=UTF-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Language: ru\n" 21 | "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" 22 | 23 | #. (desktop-to-pot) "Name" entry 24 | #: io.liri.Files.desktop.in:3 25 | msgctxt "Name entry" 26 | msgid "Liri Files" 27 | msgstr "Файлы Liri" 28 | 29 | #. (desktop-to-pot) "GenericName" entry 30 | #: io.liri.Files.desktop.in:4 31 | msgctxt "GenericName entry" 32 | msgid "File Manager" 33 | msgstr "Менеджер файлов" 34 | 35 | #. (desktop-to-pot) "Comment" entry 36 | #: io.liri.Files.desktop.in:5 37 | msgctxt "Comment entry" 38 | msgid "Access and organize files" 39 | msgstr "" 40 | 41 | #. (desktop-to-pot) "Keywords" entry 42 | #: io.liri.Files.desktop.in:6 43 | msgctxt "Keywords entry" 44 | msgid "folder;manager;explore;disk;filesystem;" 45 | msgstr "folder;manager;explore;disk;filesystem;" 46 | -------------------------------------------------------------------------------- /translations/data/desktop/tr.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | # Translators: 7 | # Emin Tufan Çetin , 2020 8 | # 9 | #, fuzzy 10 | msgid "" 11 | msgstr "" 12 | "Project-Id-Version: PACKAGE VERSION\n" 13 | "Report-Msgid-Bugs-To: \n" 14 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 15 | "Last-Translator: Emin Tufan Çetin , 2020\n" 16 | "Language-Team: Turkish (https://www.transifex.com/lirios/teams/71982/tr/)\n" 17 | "MIME-Version: 1.0\n" 18 | "Content-Type: text/plain; charset=UTF-8\n" 19 | "Content-Transfer-Encoding: 8bit\n" 20 | "Language: tr\n" 21 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 22 | 23 | #. (desktop-to-pot) "Name" entry 24 | #: io.liri.Files.desktop.in:3 25 | msgctxt "Name entry" 26 | msgid "Liri Files" 27 | msgstr "Liri Dosyalar" 28 | 29 | #. (desktop-to-pot) "GenericName" entry 30 | #: io.liri.Files.desktop.in:4 31 | msgctxt "GenericName entry" 32 | msgid "File Manager" 33 | msgstr "Dosya Yönetici" 34 | 35 | #. (desktop-to-pot) "Comment" entry 36 | #: io.liri.Files.desktop.in:5 37 | msgctxt "Comment entry" 38 | msgid "Access and organize files" 39 | msgstr "Dosyalara eriş ve yönet" 40 | 41 | #. (desktop-to-pot) "Keywords" entry 42 | #: io.liri.Files.desktop.in:6 43 | msgctxt "Keywords entry" 44 | msgid "folder;manager;explore;disk;filesystem;" 45 | msgstr "klasör;yönetici;keşfet;disk;dosyasistemi;" 46 | -------------------------------------------------------------------------------- /translations/data/desktop/zh_CN.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-05-17 11:25+0200\n" 12 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 13 | "Language-Team: Chinese (China) (https://www.transifex.com/lirios/teams/71982/zh_CN/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: zh_CN\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | 20 | #. (desktop-to-pot) "Name" entry 21 | #: io.liri.Files.desktop.in:3 22 | msgctxt "Name entry" 23 | msgid "Liri Files" 24 | msgstr "" 25 | 26 | #. (desktop-to-pot) "GenericName" entry 27 | #: io.liri.Files.desktop.in:4 28 | msgctxt "GenericName entry" 29 | msgid "File Manager" 30 | msgstr "" 31 | 32 | #. (desktop-to-pot) "Comment" entry 33 | #: io.liri.Files.desktop.in:5 34 | msgctxt "Comment entry" 35 | msgid "Access and organize files" 36 | msgstr "" 37 | 38 | #. (desktop-to-pot) "Keywords" entry 39 | #: io.liri.Files.desktop.in:6 40 | msgctxt "Keywords entry" 41 | msgid "folder;manager;explore;disk;filesystem;" 42 | msgstr "" 43 | -------------------------------------------------------------------------------- /translations/data/desktop/zh_TW.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2020-05-17 11:25+0200\n" 12 | "PO-Revision-Date: 2020-05-17 09:27+0000\n" 13 | "Language-Team: Chinese (Taiwan) (https://www.transifex.com/lirios/teams/71982/zh_TW/)\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: zh_TW\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | 20 | #. (desktop-to-pot) "Name" entry 21 | #: io.liri.Files.desktop.in:3 22 | msgctxt "Name entry" 23 | msgid "Liri Files" 24 | msgstr "" 25 | 26 | #. (desktop-to-pot) "GenericName" entry 27 | #: io.liri.Files.desktop.in:4 28 | msgctxt "GenericName entry" 29 | msgid "File Manager" 30 | msgstr "" 31 | 32 | #. (desktop-to-pot) "Comment" entry 33 | #: io.liri.Files.desktop.in:5 34 | msgctxt "Comment entry" 35 | msgid "Access and organize files" 36 | msgstr "" 37 | 38 | #. (desktop-to-pot) "Keywords" entry 39 | #: io.liri.Files.desktop.in:6 40 | msgctxt "Keywords entry" 41 | msgid "folder;manager;explore;disk;filesystem;" 42 | msgstr "" 43 | --------------------------------------------------------------------------------