Skip to content

Commit

Permalink
Add daemon to delegate file operations to
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewvogt committed Jul 14, 2016
1 parent 39a6b87 commit 5c3343c
Show file tree
Hide file tree
Showing 10 changed files with 614 additions and 3 deletions.
3 changes: 3 additions & 0 deletions dbus/org.nemomobile.FileOperations.service
@@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.nemomobile.FileOperations
Exec=/usr/bin/invoker -s --type=qt5 /usr/bin/fileoperationsd
64 changes: 64 additions & 0 deletions dbus/org.nemomobile.FileOperations.xml
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<node name="/org/nemomobile/FileOperations">
<interface name="org.nemomobile.FileOperations">
<method name="Copy">
<annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
<arg type="as" name="paths" direction="in" />
<arg type="s" name="destination" direction="in" />
<arg type="u" name="handle" direction="out" />
</method>

<method name="Move">
<annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
<arg type="as" name="paths" direction="in" />
<arg type="s" name="destination" direction="in" />
<arg type="u" name="handle" direction="out" />
</method>

<method name="Delete">
<annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
<arg type="as" name="paths" direction="in" />
<arg type="u" name="handle" direction="out" />
</method>

<method name="Mkdir">
<annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
<arg type="s" name="path" direction="in" />
<arg type="s" name="destination" direction="in" />
<arg type="u" name="handle" direction="out" />
</method>

<method name="Rename">
<annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
<arg type="s" name="oldPath" direction="in" />
<arg type="s" name="newPath" direction="in" />
<arg type="u" name="handle" direction="out" />
</method>

<method name="SetPermissions">
<annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
<arg type="s" name="path" direction="in" />
<arg type="u" name="mask" direction="in" />
<arg type="u" name="handle" direction="out" />
</method>

<method name="Cancel">
<arg type="u" name="handle" direction="in" />
</method>

<signal name="Succeeded">
<arg type="u" name="handle" />
<arg type="as" name="paths" />
</signal>

<signal name="Failed">
<arg type="u" name="handle" />
<arg type="as" name="paths" />
<arg type="u" name="errorCode" />
</signal>

<signal name="Finished">
<arg type="u" name="handle" />
</signal>
</interface>
</node>
5 changes: 5 additions & 0 deletions rpm/nemo-qml-plugin-filemanager.spec
Expand Up @@ -9,8 +9,10 @@ Source0: %{name}-%{version}.tar.bz2
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(contactcache-qt5)
BuildRequires: pkgconfig(qt5-boostable)

%description
%{summary}.
Expand Down Expand Up @@ -42,6 +44,9 @@ chmod o-r -R %{buildroot}/opt/tests/nemo-qml-plugins/filemanager/auto/hiddenfold
%defattr(-,root,root,-)
%{_libdir}/qt5/qml/Nemo/FileManager/libnemofilemanager.so
%{_libdir}/qt5/qml/Nemo/FileManager/qmldir
%{_bindir}/fileoperationsd
%{_datadir}/dbus-1/services/org.nemomobile.FileOperations.service
%{_datadir}/dbus-1/interfaces/org.nemomobile.FileOperations.xml

%files tests
%defattr(-,root,root,-)
Expand Down
41 changes: 41 additions & 0 deletions src/daemon/daemon.pro
@@ -0,0 +1,41 @@
TEMPLATE = app
TARGET = fileoperationsd

QT += dbus
CONFIG += c++11

CONFIG += link_pkgconfig link_prl

packagesExist(qt5-boostable) {
DEFINES += HAS_BOOSTER
PKGCONFIG += qt5-boostable
} else {
warning("qt5-boostable not available; startup times will be slower")
}

system(qdbusxml2cpp -c FileOperationsAdaptor -a fileoperationsadaptor.h:fileoperationsadaptor.cpp ../../dbus/org.nemomobile.FileOperations.xml)

HEADERS =\
fileoperationsadaptor.h \
fileoperationsservice.h

SOURCES =\
fileoperationsadaptor.cpp \
fileoperationsservice.cpp \
main.cpp

INCLUDEPATH += ../plugin

SERVICE_FILE = ../../dbus/org.nemomobile.FileOperations.service
INTERFACE_FILE = ../../dbus/org.nemomobile.FileOperations.xml
OTHER_FILES += $$SERVICE_FILE $$INTERFACE_FILE

service.files = $$SERVICE_FILE
service.path = /usr/share/dbus-1/services/

interface.files = $$INTERFACE_FILE
interface.path = /usr/share/dbus-1/interfaces/

target.path = /usr/bin

INSTALLS += service interface target

0 comments on commit 5c3343c

Please sign in to comment.