From a14d562b7dbf4ca77661b132cd00a0a55b2fa499 Mon Sep 17 00:00:00 2001 From: aliriza Date: Tue, 14 Mar 2023 14:28:40 +0000 Subject: [PATCH] libfm fixes added --- x11/libs/libfm/libfm-fixes.patch | 10605 +++++++++++++++++++++++++++++ x11/libs/libfm/ympbuild | 10 +- 2 files changed, 10613 insertions(+), 2 deletions(-) create mode 100644 x11/libs/libfm/libfm-fixes.patch diff --git a/x11/libs/libfm/libfm-fixes.patch b/x11/libs/libfm/libfm-fixes.patch new file mode 100644 index 00000000..220b4316 --- /dev/null +++ b/x11/libs/libfm/libfm-fixes.patch @@ -0,0 +1,10605 @@ +diff --git a/NEWS b/NEWS +index 79d6082c..cbdfd8b1 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,3 +1,10 @@ ++Changes on 1.4.0 since 1.3.2: ++ ++* Migrated away from dbus-glib-1 which is deprecated for years. ++ ++* Migrated from Udisks (which is not used anymore anywhere) to Udisks2 DBus API. ++ ++ + Changes on 1.3.2 since 1.3.1: + + * Fixed all/allfiles parse conditions in FmAction, it was inverted. +diff --git a/ar-lib b/ar-lib +new file mode 100755 +index 00000000..c349042c +--- /dev/null ++++ b/ar-lib +@@ -0,0 +1,271 @@ ++#! /bin/sh ++# Wrapper for Microsoft lib.exe ++ ++me=ar-lib ++scriptversion=2019-07-04.01; # UTC ++ ++# Copyright (C) 2010-2021 Free Software Foundation, Inc. ++# Written by Peter Rosin . ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2, or (at your option) ++# any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# As a special exception to the GNU General Public License, if you ++# distribute this file as part of a program that contains a ++# configuration script generated by Autoconf, you may include it under ++# the same distribution terms that you use for the rest of that program. ++ ++# This file is maintained in Automake, please report ++# bugs to or send patches to ++# . ++ ++ ++# func_error message ++func_error () ++{ ++ echo "$me: $1" 1>&2 ++ exit 1 ++} ++ ++file_conv= ++ ++# func_file_conv build_file ++# Convert a $build file to $host form and store it in $file ++# Currently only supports Windows hosts. ++func_file_conv () ++{ ++ file=$1 ++ case $file in ++ / | /[!/]*) # absolute file, and not a UNC file ++ if test -z "$file_conv"; then ++ # lazily determine how to convert abs files ++ case `uname -s` in ++ MINGW*) ++ file_conv=mingw ++ ;; ++ CYGWIN* | MSYS*) ++ file_conv=cygwin ++ ;; ++ *) ++ file_conv=wine ++ ;; ++ esac ++ fi ++ case $file_conv in ++ mingw) ++ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ++ ;; ++ cygwin | msys) ++ file=`cygpath -m "$file" || echo "$file"` ++ ;; ++ wine) ++ file=`winepath -w "$file" || echo "$file"` ++ ;; ++ esac ++ ;; ++ esac ++} ++ ++# func_at_file at_file operation archive ++# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE ++# for each of them. ++# When interpreting the content of the @FILE, do NOT use func_file_conv, ++# since the user would need to supply preconverted file names to ++# binutils ar, at least for MinGW. ++func_at_file () ++{ ++ operation=$2 ++ archive=$3 ++ at_file_contents=`cat "$1"` ++ eval set x "$at_file_contents" ++ shift ++ ++ for member ++ do ++ $AR -NOLOGO $operation:"$member" "$archive" || exit $? ++ done ++} ++ ++case $1 in ++ '') ++ func_error "no command. Try '$0 --help' for more information." ++ ;; ++ -h | --h*) ++ cat <@])], ++ [build libfm with udisks support (Linux only) @<:@default=no@:>@])], + [enable_udisks="${enableval}"], + [enable_udisks=no] + ) +@@ -194,12 +194,6 @@ AM_CONDITIONAL(ENABLE_UDISKS, test x"$enable_udisks" = x"yes") + if test x"$enable_udisks" = x"yes"; then + # turn on udisks support + AC_DEFINE_UNQUOTED(USE_UDISKS, [1], [Enable UDisks support]) +- +- # test for availability of dbus +- dbus_modules="dbus-glib-1" +- PKG_CHECK_MODULES(DBUS, [$dbus_modules]) +- AC_SUBST(DBUS_CFLAGS) +- AC_SUBST(DBUS_LIBS) + fi + + AC_ARG_ENABLE([exif], +diff --git a/data/ui/app-chooser.glade b/data/ui/app-chooser.glade +index 7ac95f7b..9a373937 100644 +--- a/data/ui/app-chooser.glade ++++ b/data/ui/app-chooser.glade +@@ -1,36 +1,83 @@ + ++ + +- +- ++ + + True +- False ++ False + gtk-open + + +- False +- 5 ++ False ++ 5 + Choose Application +- 400 +- 380 +- dialog ++ 400 ++ 380 ++ dialog + +- ++ + True +- False ++ False ++ vertical + 6 ++ ++ ++ True ++ False ++ end ++ ++ ++ gtk-cancel ++ False ++ True ++ True ++ True ++ False ++ True ++ ++ ++ False ++ False ++ 0 ++ ++ ++ ++ ++ gtk-ok ++ False ++ True ++ True ++ True ++ True ++ False ++ True ++ ++ ++ False ++ False ++ 1 ++ ++ ++ ++ ++ False ++ True ++ end ++ 3 ++ ++ + + + True +- False ++ False + 12 + + + True +- False ++ False + 2 + 2 +- True ++ True + + + True +@@ -40,7 +87,7 @@ + + + +- False ++ False + + + False +@@ -58,14 +105,12 @@ + + + True +- True ++ True + + + True +- True +- automatic +- automatic +- in ++ True ++ in + + + +@@ -74,30 +119,30 @@ + + + True +- False +- Use selected application to open files ++ False ++ Use selected application to open files + _Installed Applications +- True ++ True + + +- False ++ False + + + + + True +- False +- 6 ++ False ++ 6 + 6 + + + True +- False +- 0 ++ False + <b>C_ommand line to execute:</b> +- True +- True +- cmdline ++ True ++ True ++ cmdline ++ 0 + + + False +@@ -108,28 +153,26 @@ + + + True +- False +- 12 ++ False ++ 12 + + + True +- False ++ False + 6 + + + True +- False ++ False + 12 + + + True +- True +- ● +- True +- False +- False +- True +- True ++ True ++ ● ++ True ++ False ++ False + + + True +@@ -140,12 +183,12 @@ + + + _Browse... ++ False + True +- True +- True +- False ++ True ++ True + browse_btn_img +- True ++ True + + + +@@ -164,12 +207,12 @@ + + + _Execute in terminal emulator ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + False +@@ -180,18 +223,18 @@ + + + True +- False +- 12 ++ False ++ 12 + + + _Keep terminal window open after command execution ++ False + True + False +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + +@@ -204,15 +247,15 @@ + + + True +- False +- 0 ++ False + <b>These special codes can be used in the command line:</b> + <b>%f</b>: Represents a single file name + <b>%F</b>: Represents multiple file names + <b>%u</b>: Represents a single URI of the file + <b>%U</b>: Represents multiple URIs +- True ++ True + True ++ 0 + + + False +@@ -232,12 +275,12 @@ + + + True +- False +- 0 ++ False + <b>_Application name (optional, set it to keep association)</b> +- True +- True +- app_name ++ True ++ True ++ app_name ++ 0 + + + True +@@ -248,18 +291,16 @@ + + + True +- False +- 12 ++ False ++ 12 + + + True +- True +- ● +- True +- False +- False +- True +- True ++ True ++ ● ++ True ++ False ++ False + + + +@@ -277,14 +318,14 @@ + + + True +- False +- Execute custom command line to open files ++ False ++ Execute custom command line to open files + C_ustom Command Line +- True ++ True + + + 1 +- False ++ False + + + +@@ -294,25 +335,15 @@ + 1 + + +- +- +- False +- +- +- False +- True +- 2 +- +- + + + _Set selected application as default action for this file type ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + False +@@ -320,50 +351,14 @@ + 2 + + +- +- +- True +- False +- end +- +- +- gtk-cancel +- True +- True +- True +- False +- False +- True +- +- +- False +- False +- 0 +- +- +- +- +- gtk-ok +- True +- True +- True +- True +- False +- False +- True +- +- +- False +- False +- 1 +- +- ++ ++ ++ False + + + False + True +- end +- 3 ++ 2 + + + +diff --git a/data/ui/ask-rename.glade b/data/ui/ask-rename.glade +index af65b6c4..e582c1bc 100644 +--- a/data/ui/ask-rename.glade ++++ b/data/ui/ask-rename.glade +@@ -1,30 +1,31 @@ + ++ + +- +- ++ + +- False +- 10 ++ False ++ 10 + Confirm File Replacing +- normal ++ normal + +- ++ + True +- False ++ False ++ vertical + 6 + +- ++ + True +- False +- end ++ False ++ end + + + gtk-cancel ++ False + True +- True +- True +- False +- True ++ True ++ True ++ True + + + False +@@ -35,13 +36,13 @@ + + + _Skip ++ False + True +- True +- True +- True +- True +- False +- True ++ True ++ True ++ True ++ True ++ True + + + False +@@ -52,13 +53,13 @@ + + + _Rename ++ False + True + False +- True +- True +- True +- False +- True ++ True ++ True ++ True ++ True + + + False +@@ -69,11 +70,11 @@ + + + _Overwrite ++ False + True +- True +- True +- False +- True ++ True ++ True ++ True + + + False +@@ -85,22 +86,22 @@ + + False + True +- end ++ end + 0 + + + + + True +- False ++ False + 12 + + + True +- False ++ False + 0 + gtk-dialog-question +- 6 ++ 6 + + + False +@@ -111,17 +112,17 @@ + + + True +- False ++ False + 6 + + + True +- False +- 0 ++ False + <b>There is already a file with the same name in this location.</b> + + Do you want to replace the existing file +- True ++ True ++ 0 + + + False +@@ -132,14 +133,14 @@ Do you want to replace the existing file + + + True +- False ++ False + 12 + + + True +- False ++ False + gtk-missing-image +- 6 ++ 6 + + + False +@@ -150,7 +151,7 @@ Do you want to replace the existing file + + + True +- False ++ False + 0 + + +@@ -169,9 +170,9 @@ Do you want to replace the existing file + + + True +- False +- 0 ++ False + with the following file? ++ 0 + + + False +@@ -182,14 +183,14 @@ Do you want to replace the existing file + + + True +- False ++ False + 12 + + + True +- False ++ False + gtk-missing-image +- 6 ++ 6 + + + False +@@ -200,7 +201,7 @@ Do you want to replace the existing file + + + True +- False ++ False + 0 + + +@@ -219,16 +220,16 @@ Do you want to replace the existing file + + + True +- False ++ False + 12 + + + True +- False +- 0 ++ False + _File name: +- True +- filename ++ True ++ filename ++ 0 + + + False +@@ -239,13 +240,11 @@ Do you want to replace the existing file + + + True +- True +- • +- True +- False +- False +- True +- True ++ True ++ • ++ True ++ False ++ False + + + True +@@ -277,12 +276,12 @@ Do you want to replace the existing file + + + _Apply this option to all existing files ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + False +diff --git a/data/ui/choose-icon.ui b/data/ui/choose-icon.ui +index 18e822d7..ecfc6a66 100644 +--- a/data/ui/choose-icon.ui ++++ b/data/ui/choose-icon.ui +@@ -1,115 +1,106 @@ +- ++ ++ + + ++ + +- 10 ++ False ++ 10 + Choose An Icon... +- GTK_WINDOW_TOPLEVEL +- GTK_WIN_POS_NONE +- False +- True +- False +- True +- False +- False +- GDK_WINDOW_TYPE_HINT_NORMAL +- GDK_GRAVITY_NORTH_WEST +- True +- False ++ normal + +- ++ + True +- False ++ False ++ vertical + 6 + +- ++ + True +- GTK_BUTTONBOX_END ++ False ++ end + + +- True +- True + gtk-cancel +- True +- GTK_RELIEF_NORMAL +- True ++ True ++ True ++ False ++ True + ++ ++ True ++ True ++ 0 ++ + + + +- True +- True + gtk-ok +- True +- GTK_RELIEF_NORMAL +- True ++ True ++ True ++ False ++ True + ++ ++ True ++ True ++ 1 ++ + + + +- 0 + False + True +- GTK_PACK_END ++ end ++ 0 + + + + + True +- 0 +- 0.5 +- GTK_SHADOW_NONE ++ False ++ 0 ++ none + + + True +- 0.5 +- 0.5 +- 1 +- 1 +- 0 +- 0 +- 12 +- 0 ++ False ++ 12 + + + True +- False ++ False + 12 + + +- True +- True + system icon theme +- True +- GTK_RELIEF_NORMAL +- True ++ True ++ True ++ False ++ True + True +- False +- True ++ True + + +- 0 + False + True ++ 0 + + + + +- True +- True + image files +- True +- GTK_RELIEF_NORMAL +- True +- False +- False +- True ++ True ++ True ++ False ++ True ++ True + theme + + +- 0 + False + True ++ 1 + + + +@@ -119,58 +110,41 @@ + + + True ++ False ++ 0 ++ 0 + <b>Choose icon from:</b> +- False +- True +- GTK_JUSTIFY_LEFT +- False +- False ++ True + 0.5 + 0.5 +- 0 +- 0 +- PANGO_ELLIPSIZE_NONE +- -1 +- False +- 0 + + + + +- 0 + False + True ++ 1 + + + + + True +- False +- False +- GTK_POS_TOP +- False +- False ++ False ++ False ++ False + + + True +- True +- GTK_POLICY_NEVER +- GTK_POLICY_AUTOMATIC +- GTK_SHADOW_NONE +- GTK_CORNER_TOP_LEFT ++ True ++ never + + + True +- True +- GTK_SELECTION_SINGLE +- False ++ True ++ 0 + + + +- +- False +- True +- + + + +@@ -178,14 +152,10 @@ + + + True +- GTK_FILE_CHOOSER_ACTION_OPEN +- True +- False +- False ++ False + + +- False +- True ++ 2 + + + +@@ -193,9 +163,9 @@ + + + +- 0 + True + True ++ 2 + + + +diff --git a/data/ui/file-prop.glade b/data/ui/file-prop.glade +index b24713a2..94bc286a 100644 +--- a/data/ui/file-prop.glade ++++ b/data/ui/file-prop.glade +@@ -1,36 +1,126 @@ + ++ + +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ --- ++ ++ ++ None ++ ++ ++ Sticky ++ ++ ++ Set GID ++ ++ ++ Sticky & set GID ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ --- ++ ++ ++ None ++ ++ ++ Set UID ++ ++ ++ Set GID ++ ++ ++ Set UID & GID ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ --- ++ ++ ++ Only owner ++ ++ ++ Only owner and group ++ ++ ++ Anyone ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ --- ++ ++ ++ Nobody ++ ++ ++ Only owner ++ ++ ++ Only owner and group ++ ++ ++ Anyone ++ ++ ++ + +- False +- 6 ++ False ++ 6 + File Properties + False +- center-on-parent +- 360 +- dialog ++ center-on-parent ++ 360 ++ dialog + center + + +- ++ + True +- False ++ False ++ vertical + 12 + +- ++ + True +- False +- end ++ False ++ end + + + gtk-cancel ++ False + True +- True +- True +- False +- False +- True ++ True ++ True ++ False ++ True + + + +@@ -42,13 +132,13 @@ + + + gtk-ok ++ False + True +- True +- True +- True +- False +- False +- True ++ True ++ True ++ True ++ False ++ True + + + +@@ -61,448 +151,446 @@ + + False + True +- end ++ end + 0 + + + + + True +- True +- 6 ++ True ++ 6 + + + True +- False +- 6 +- 6 +- 12 ++ False ++ 6 ++ 6 ++ 12 + + + True +- False +- 4 +- 12 +- 3 +- 12 +- 6 ++ False ++ 4 ++ 12 ++ 3 ++ 12 ++ 6 + + + True +- False ++ False + + + True +- False ++ False + GDK_BUTTON_PRESS_MASK | GDK_STRUCTURE_MASK +- True +- Icon of the file in folder view ++ True ++ Icon of the file in folder view + gtk-missing-image +- 6 ++ 6 + + + + +- 2 +- GTK_FILL +- +- 12 ++ 2 ++ GTK_FILL ++ ++ 12 + + + + +- False ++ False ++ True + 1 +- True + + +- 1 +- 2 +- GTK_FILL +- ++ 1 ++ 2 ++ GTK_FILL ++ + + + + +- True +- 0 ++ True + True ++ 0 + + +- 2 +- 3 +- ++ 2 ++ 3 ++ + + + + + True +- False +- 1 ++ False + <b>_Name:</b> +- True +- True +- name ++ True ++ True ++ name ++ 1 + + +- 1 +- 2 +- 1 +- 2 +- GTK_FILL +- ++ 1 ++ 2 ++ 1 ++ 2 ++ GTK_FILL ++ + + + + + True +- True +- False +- False +- True +- True ++ True ++ False ++ False + + +- 2 +- 3 +- 1 +- 2 +- ++ 2 ++ 3 ++ 1 ++ 2 ++ + + + + + True +- False +- 0 ++ False + <b>Location:</b> +- True +- True +- dir ++ True ++ True ++ dir ++ 0 + + +- 2 +- 2 +- 3 +- GTK_FILL +- ++ 2 ++ 2 ++ 3 ++ GTK_FILL ++ + + + + + True +- True +- 0 ++ True + True + middle ++ 0 + + +- 2 +- 3 +- 2 +- 3 +- ++ 2 ++ 3 ++ 2 ++ 3 ++ + + + + + True +- False +- 0 ++ False + <b>Target file:</b> +- True +- True +- target ++ True ++ True ++ target ++ 0 + + +- 2 +- 3 +- 4 +- GTK_FILL +- ++ 2 ++ 3 ++ 4 ++ GTK_FILL ++ + + + + + True +- True +- 0 ++ True + True + middle ++ 0 + + +- 2 +- 3 +- 3 +- 4 +- GTK_FILL +- ++ 2 ++ 3 ++ 3 ++ 4 ++ GTK_FILL ++ + + + + + True +- False +- 0 ++ False + <b>File type:</b> +- True +- True +- type ++ True ++ True ++ type ++ 0 + + +- 2 +- 4 +- 5 +- GTK_FILL +- ++ 2 ++ 4 ++ 5 ++ GTK_FILL ++ + + + + + True +- True +- 0 ++ True + True + True + end ++ 0 + + +- 2 +- 3 +- 4 +- 5 +- GTK_FILL +- ++ 2 ++ 3 ++ 4 ++ 5 ++ GTK_FILL ++ + + + + + True +- False +- 0 ++ False + <b>Open _with:</b> +- True +- True +- open_with ++ True ++ True ++ open_with ++ 0 + + +- 2 +- 5 +- 6 +- GTK_FILL +- ++ 2 ++ 5 ++ 6 ++ GTK_FILL ++ + + + + + True +- True +- Select the application used to open files of this type ++ True ++ Select the application used to open files of this type + + +- 2 +- 3 +- 5 +- 6 +- GTK_FILL +- ++ 2 ++ 3 ++ 5 ++ 6 ++ GTK_FILL ++ + + + + +- False +- 0 ++ False + <b>Total count of files:</b> +- True +- True +- total_files ++ True ++ True ++ total_files ++ 0 + + +- 2 +- 6 +- 7 +- GTK_FILL +- ++ 2 ++ 6 ++ 7 ++ GTK_FILL ++ + + + + +- True +- 0 ++ True + True ++ 0 + + +- 2 +- 3 +- 6 +- 7 +- ++ 2 ++ 3 ++ 6 ++ 7 ++ + + + + + True +- False +- 0 ++ False + <b>Total size of files:</b> +- True +- True +- total_size ++ True ++ True ++ total_size ++ 0 + + +- 2 +- 7 +- 8 +- GTK_FILL +- ++ 2 ++ 7 ++ 8 ++ GTK_FILL ++ + + + + + True +- True +- 0 ++ True + True ++ 0 + + +- 2 +- 3 +- 7 +- 8 +- GTK_FILL +- ++ 2 ++ 3 ++ 7 ++ 8 ++ GTK_FILL ++ + + + + + True +- False +- 0 ++ False + <b>Size on disk:</b> +- True +- True +- size_on_disk ++ True ++ True ++ size_on_disk ++ 0 + + +- 2 +- 8 +- 9 +- GTK_FILL +- ++ 2 ++ 8 ++ 9 ++ GTK_FILL ++ + + + + + True +- True +- 0 ++ True + True ++ 0 + + +- 2 +- 3 +- 8 +- 9 +- GTK_FILL +- ++ 2 ++ 3 ++ 8 ++ 9 ++ GTK_FILL ++ + + + + + True +- False +- 0 ++ False + <b>Last modification:</b> +- True +- True +- mtime ++ True ++ True ++ mtime ++ 0 + + +- 2 +- 9 +- 10 +- GTK_FILL +- ++ 2 ++ 9 ++ 10 ++ GTK_FILL ++ + + + + + True +- True +- 0 ++ True + True ++ 0 + + +- 2 +- 3 +- 9 +- 10 +- GTK_FILL +- ++ 2 ++ 3 ++ 9 ++ 10 ++ GTK_FILL ++ + + + + + True +- False +- 0 ++ False + <b>Last access:</b> +- True +- True +- atime ++ True ++ True ++ atime ++ 0 + + +- 2 +- 10 +- 11 +- GTK_FILL +- ++ 2 ++ 10 ++ 11 ++ GTK_FILL ++ + + + + + True +- True +- 0 ++ True + True ++ 0 + + +- 2 +- 3 +- 10 +- 11 +- ++ 2 ++ 3 ++ 10 ++ 11 ++ + + + + +- False +- 0 ++ False + <b>Last permissions change:</b> +- True +- True +- ctime ++ True ++ True ++ ctime ++ 0 + + +- 2 +- 11 +- 12 +- GTK_FILL +- ++ 2 ++ 11 ++ 12 ++ GTK_FILL ++ + + + + +- True +- 0 ++ True + True ++ 0 + + +- 2 +- 3 +- 11 +- 12 +- ++ 2 ++ 3 ++ 11 ++ 12 ++ + + + +@@ -512,99 +600,95 @@ + + + True +- False ++ False + _General +- True ++ True + + +- False ++ False + + + + + True +- False +- 6 +- 6 +- 12 ++ False ++ 6 ++ 6 ++ 12 + + + True +- False ++ False + 6 + + + True +- False +- 2 +- 2 +- 2 +- 12 +- 4 ++ False ++ 2 ++ 2 ++ 2 ++ 12 ++ 4 + + + True +- False +- 0 ++ False + <b>O_wner:</b> +- True +- True +- owner ++ True ++ True ++ owner ++ 0 + + +- GTK_FILL +- ++ GTK_FILL ++ + + + + + True +- False +- 0 ++ False + <b>G_roup:</b> +- True +- True +- group ++ True ++ True ++ group ++ 0 + + +- 1 +- 2 +- GTK_FILL +- ++ 1 ++ 2 ++ GTK_FILL ++ + + + + + True +- True +- • +- False +- False +- True +- True ++ True ++ • ++ False ++ False + + +- 1 +- 2 +- GTK_FILL ++ 1 ++ 2 ++ GTK_FILL + + + + + True +- True +- • +- False +- False +- True +- True ++ True ++ • ++ False ++ False + + +- 1 +- 2 +- 1 +- 2 +- GTK_FILL ++ 1 ++ 2 ++ 1 ++ 2 ++ GTK_FILL + + + +@@ -617,92 +701,92 @@ + + + True +- False +- 0 +- none ++ False ++ 0 ++ none + + + True +- False +- 12 ++ False ++ 12 + + + True +- False +- 6 +- 4 +- 2 +- 12 +- 4 ++ False ++ 6 ++ 4 ++ 2 ++ 12 ++ 4 + + + True +- False +- 0 ++ False + <b>_View content:</b> +- True +- True +- read_perm ++ True ++ True ++ read_perm ++ 0 + + +- GTK_FILL +- GTK_FILL ++ GTK_FILL ++ GTK_FILL + + + + + True +- False +- 0 ++ False + <b>C_hange content:</b> +- True +- True +- write_perm ++ True ++ True ++ write_perm ++ 0 + + +- 1 +- 2 +- GTK_FILL +- GTK_FILL ++ 1 ++ 2 ++ GTK_FILL ++ GTK_FILL + + + + + True +- False +- 0 ++ False + <b>_Execute:</b> +- True +- True +- exec_perm ++ True ++ True ++ exec_perm ++ 0 + + +- 2 +- 3 +- GTK_FILL +- GTK_FILL ++ 2 ++ 3 ++ GTK_FILL ++ GTK_FILL + + + + + True +- False +- 0 ++ False + <b>Special bits:</b> +- True ++ True ++ 0 + + +- 3 +- 4 +- GTK_FILL +- GTK_FILL ++ 3 ++ 4 ++ GTK_FILL ++ GTK_FILL + + + + + True +- False +- Who can read content of the file/directory ++ False ++ Who can read content of the file/directory + read_access_model + + +@@ -712,16 +796,16 @@ + + + +- 1 +- 2 +- GTK_FILL ++ 1 ++ 2 ++ GTK_FILL + + + + + True +- False +- Who can change content of the file/directory ++ False ++ Who can change content of the file/directory + user_access_model + + +@@ -731,18 +815,18 @@ + + + +- 1 +- 2 +- 1 +- 2 +- GTK_FILL ++ 1 ++ 2 ++ 1 ++ 2 ++ GTK_FILL + + + + + True +- False +- Who can execute the file or enter the directory ++ False ++ Who can execute the file or enter the directory + user_access_model + + +@@ -752,18 +836,18 @@ + + + +- 1 +- 2 +- 2 +- 3 +- GTK_FILL ++ 1 ++ 2 ++ 2 ++ 3 ++ GTK_FILL + + + + + True +- False +- Special flags for file execution ++ False ++ Special flags for file execution + flags_set_file_model + + +@@ -773,18 +857,18 @@ + + + +- 1 +- 2 +- 3 +- 4 +- GTK_FILL ++ 1 ++ 2 ++ 3 ++ 4 ++ GTK_FILL + + + + + True +- False +- Special flags for directory access ++ False ++ Special flags for directory access + flags_set_dir_model + + +@@ -794,11 +878,11 @@ + + + +- 1 +- 2 +- 3 +- 4 +- GTK_FILL ++ 1 ++ 2 ++ 3 ++ 4 ++ GTK_FILL + + + +@@ -808,9 +892,9 @@ + + + True +- False ++ False + <b>Access Control</b> +- True ++ True + + + +@@ -823,11 +907,11 @@ + + + Hidden file ++ False + False +- False +- False +- False +- True ++ False ++ False ++ True + + + False +@@ -845,21 +929,21 @@ + + + True +- False ++ False + _Permissions +- True ++ True + + + 1 +- False ++ False + + + + +- False +- 6 +- 6 +- 12 ++ False ++ 6 ++ 6 ++ 12 + + + +@@ -871,12 +955,12 @@ + + + True +- False +- True ++ False ++ True + + + 2 +- False ++ False + + + +@@ -893,93 +977,4 @@ + ok + + +- +- +- +- +- +- +- +- --- +- +- +- None +- +- +- Sticky +- +- +- Set GID +- +- +- Sticky & set GID +- +- +- +- +- +- +- +- +- +- +- --- +- +- +- None +- +- +- Set UID +- +- +- Set GID +- +- +- Set UID & GID +- +- +- +- +- +- +- +- +- +- +- --- +- +- +- Only owner +- +- +- Only owner and group +- +- +- Anyone +- +- +- +- +- +- +- +- +- +- +- --- +- +- +- Nobody +- +- +- Only owner +- +- +- Only owner and group +- +- +- Anyone +- +- +- + +diff --git a/data/ui/filesearch.glade b/data/ui/filesearch.glade +index caf9e98b..c3fe367b 100644 +--- a/data/ui/filesearch.glade ++++ b/data/ui/filesearch.glade +@@ -1,11 +1,11 @@ + ++ + +- +- ++ + + 2147483647 +- 1 +- 10 ++ 1 ++ 10 + + + +@@ -27,143 +27,88 @@ + + + +- +- False +- 12 +- Choose Date +- dialog +- dlg +- +- +- True +- False +- 6 +- +- +- True +- False +- end +- +- +- gtk-cancel +- True +- True +- True +- False +- True +- +- +- False +- False +- 0 +- +- +- +- +- gtk-ok +- True +- True +- True +- True +- False +- False +- True +- +- +- False +- False +- 1 +- +- +- +- +- False +- True +- end +- 0 +- +- +- +- +- True +- False +- 0 +- Choose a date from the following calendar +- +- +- False +- True +- 1 +- +- +- +- +- True +- True +- +- +- True +- True +- 2 +- +- +- +- +- +- button2 +- button1 +- ++ ++ ++ ++ ++ ++ ++ ++ 2147483647 ++ 1 ++ 10 ++ ++ ++ ++ ++ ++ ++ ++ ++ Bytes ++ ++ ++ KB ++ ++ ++ MB ++ ++ ++ GB ++ ++ + + +- False +- 5 ++ False ++ 5 + Search Files +- 512 +- 384 +- edit-find +- dialog ++ 512 ++ 384 ++ edit-find ++ dialog + + +- ++ + True +- False ++ False ++ vertical + 2 + +- ++ + True +- False +- end ++ False ++ end + + + gtk-cancel ++ False + True +- True +- True +- False +- True ++ True ++ True ++ True + + + False + False +- end ++ end + 0 + + + + + gtk-find ++ False + True +- True +- True +- True +- False +- False +- True ++ True ++ True ++ True ++ False ++ True + + + False + True +- end ++ end + 1 + + +@@ -171,30 +116,30 @@ + + False + True +- end ++ end + 0 + + + + + True +- True ++ True + True + + + True +- False +- 6 ++ False ++ 6 + 6 + + + True +- False +- 0 ++ False + <b>File _Name Patterns:</b> +- True +- True +- name_entry ++ True ++ True ++ name_entry ++ 0 + + + False +@@ -205,27 +150,24 @@ + + + True +- False +- 12 +- 12 ++ False ++ 12 ++ 12 + + + True +- False ++ False + 6 + + + True +- True +- True +- Pattern may be either POSIX shell pattern list (with ',' as separator) or POSIX regular expression. +- True ++ True ++ True ++ Pattern may be either POSIX shell pattern list (with ',' as separator) or POSIX regular expression. ++ True + * +- True +- False +- False +- True +- True ++ False ++ False + + + False +@@ -236,14 +178,14 @@ + + + Case insensiti_ve ++ False + True +- True +- False +- False ++ True ++ False + none +- True ++ True + True +- True ++ True + + + False +@@ -254,12 +196,12 @@ + + + _Use regular expression ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + False +@@ -279,12 +221,12 @@ + + + True +- False +- 0 ++ False + <b>Plac_es to Search:</b> +- True +- True +- path_tree_view ++ True ++ True ++ path_tree_view ++ 0 + + + False +@@ -295,32 +237,33 @@ + + + True +- False +- 12 +- 12 ++ False ++ 12 ++ 12 + + + True +- False ++ False + 6 + + + True +- False ++ False + 6 + + + True +- True +- automatic +- automatic +- etched-in ++ True ++ etched-in + + + True +- True ++ True + path_list_store +- False ++ False ++ ++ ++ + + + path +@@ -344,16 +287,16 @@ + + + True +- False ++ False + 6 + + + gtk-add ++ False + True +- True +- True +- False +- True ++ True ++ True ++ True + + + +@@ -365,11 +308,11 @@ + + + gtk-remove ++ False + True +- True +- True +- False +- True ++ True ++ True ++ True + + + +@@ -395,13 +338,13 @@ + + + _Search in sub directories ++ False + True +- True +- False +- False +- True ++ True ++ False ++ True + True +- True ++ True + + + False +@@ -412,12 +355,12 @@ + + + Search _hidden files ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + False +@@ -439,27 +382,27 @@ + + + True +- False ++ False + Name/_Location +- True ++ True + + +- False ++ False + + + + + True +- False +- 6 ++ False ++ 6 + 6 + + + True +- False +- 0 ++ False + <b>File Type</b> +- True ++ True ++ 0 + + + False +@@ -470,20 +413,20 @@ + + + True +- False +- 12 +- 12 ++ False ++ 12 ++ 12 + + + True +- False ++ False + 6 + + + True +- False +- 0 ++ False + Only search for files of following types: ++ 0 + + + True +@@ -494,12 +437,12 @@ + + + Te_xt files ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + True +@@ -510,12 +453,12 @@ + + + _Image files ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + True +@@ -526,12 +469,12 @@ + + + _Audio files ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + True +@@ -542,12 +485,12 @@ + + + _Video files ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + True +@@ -558,12 +501,12 @@ + + + _Documents ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + True +@@ -574,11 +517,11 @@ + + + Folde_rs +- True +- False +- False +- True +- True ++ False ++ True ++ False ++ True ++ True + + + True +@@ -589,16 +532,16 @@ + + + True +- False ++ False + 12 + + + Ot_her: +- True +- False +- False +- True +- True ++ False ++ True ++ False ++ True ++ True + + + False +@@ -608,12 +551,10 @@ + + + +- True +- Any valid content type can be entered here. Wildcard '*' is allowed at end of the type. Multiple types should be separated with ';'. +- False +- False +- True +- True ++ True ++ Any valid content type can be entered here. Wildcard '*' is allowed at end of the type. Multiple types should be separated with ';'. ++ False ++ False + + + True +@@ -645,30 +586,30 @@ + + + True +- False ++ False + File _Type +- True ++ True + + + 1 +- False ++ False + + + + + True +- False +- 6 ++ False ++ 6 + 6 + + + True +- False +- 0 ++ False + <b>File Contain_s:</b> +- True +- True +- content_entry ++ True ++ True ++ content_entry ++ 0 + + + False +@@ -679,25 +620,22 @@ + + + True +- False +- 12 +- 12 ++ False ++ 12 ++ 12 + + + True +- False ++ False + 6 + + + True +- True +- • +- True +- True +- False +- False +- True +- True ++ True ++ • ++ True ++ False ++ False + + + False +@@ -708,13 +646,13 @@ + + + Case insensiti_ve ++ False + True +- True +- False +- False +- True ++ True ++ False ++ True + True +- True ++ True + + + False +@@ -725,12 +663,12 @@ + + + _Use regular expression ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + False +@@ -755,28 +693,28 @@ + + + True +- False ++ False + C_ontent +- True ++ True + + + 2 +- False ++ False + + + + + True +- False +- 6 ++ False ++ 6 + 6 + + + True +- False +- 0 ++ False + <b>File Size</b> +- True ++ True ++ 0 + + + False +@@ -787,95 +725,89 @@ + + + True +- False +- 12 +- 12 ++ False ++ 12 ++ 12 + + + True +- False +- 2 +- 3 +- 12 +- 6 ++ False ++ 2 ++ 3 ++ 12 ++ 6 + + + True + False +- True +- ● +- True +- False +- False +- True +- True ++ True ++ ● ++ False ++ False + bigger_adjustment + + +- 1 +- 2 +- 2 ++ 1 ++ 2 ++ 2 + + + + + True + False +- True +- ● +- True +- False +- False +- True +- True ++ True ++ ● ++ False ++ False + smaller_adjustment + + +- 1 +- 2 +- 1 +- 2 +- 2 +- 2 ++ 1 ++ 2 ++ 1 ++ 2 ++ 2 ++ 2 + + + + + _Smaller than: ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + +- 1 +- 2 +- GTK_FILL ++ 1 ++ 2 ++ GTK_FILL + + + + + _Bigger than: ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + +- GTK_FILL ++ GTK_FILL + + + + + True + False +- True ++ True + bigger_liststore + 1 + +@@ -886,16 +818,16 @@ + + + +- 2 +- 3 +- ++ 2 ++ 3 ++ + + + + + True + False +- True ++ True + smaller_liststore + 2 + +@@ -906,12 +838,12 @@ + + + +- 2 +- 3 +- 1 +- 2 +- +- GTK_EXPAND ++ 2 ++ 3 ++ 1 ++ 2 ++ ++ GTK_EXPAND + + + +@@ -926,10 +858,10 @@ + + + True +- False +- 0 ++ False + <b>Last Modified Time</b> +- True ++ True ++ 0 + + + False +@@ -940,81 +872,81 @@ + + + True +- False +- 12 +- 12 ++ False ++ 12 ++ 12 + + + True +- False +- 2 +- 2 +- 12 +- 6 ++ False ++ 2 ++ 2 ++ 12 ++ 6 + + + (None) ++ False + True + False +- True +- True +- False ++ True ++ True + + + +- 1 +- 2 ++ 1 ++ 2 + + + + + (None) ++ False + True + False +- True +- True +- False ++ True ++ True + + + +- 1 +- 2 +- 1 +- 2 ++ 1 ++ 2 ++ 1 ++ 2 + + + + + _Earlier than: ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + +- GTK_FILL +- GTK_FILL ++ GTK_FILL ++ GTK_FILL + + + + + L_ater than: ++ False + True +- True +- False +- False +- True +- True ++ True ++ False ++ True ++ True + + + +- 1 +- 2 +- GTK_FILL +- GTK_FILL ++ 1 ++ 2 ++ GTK_FILL ++ GTK_FILL + + + +@@ -1034,13 +966,13 @@ + + + True +- False ++ False + _Properties +- True ++ True + + + 3 +- False ++ False + + + +@@ -1053,39 +985,96 @@ + + + +- find_button + cancel_button ++ find_button + + +- +- +- +- +- +- +- +- 2147483647 +- 1 +- 10 +- +- +- +- +- +- +- +- +- Bytes +- +- +- KB +- +- +- MB +- +- +- GB +- +- ++ ++ False ++ 12 ++ Choose Date ++ dialog ++ dlg ++ ++ ++ True ++ False ++ vertical ++ 6 ++ ++ ++ True ++ False ++ end ++ ++ ++ gtk-cancel ++ False ++ True ++ True ++ True ++ True ++ ++ ++ False ++ False ++ 0 ++ ++ ++ ++ ++ gtk-ok ++ False ++ True ++ True ++ True ++ True ++ False ++ True ++ ++ ++ False ++ False ++ 1 ++ ++ ++ ++ ++ False ++ True ++ end ++ 0 ++ ++ ++ ++ ++ True ++ False ++ Choose a date from the following calendar ++ 0 ++ ++ ++ False ++ True ++ 1 ++ ++ ++ ++ ++ True ++ True ++ ++ ++ True ++ True ++ 2 ++ ++ ++ ++ ++ ++ button2 ++ button1 ++ + + +diff --git a/data/ui/preferred-apps.glade b/data/ui/preferred-apps.glade +index 327cb63a..aa282470 100644 +--- a/data/ui/preferred-apps.glade ++++ b/data/ui/preferred-apps.glade +@@ -1,70 +1,122 @@ +- ++ ++ + +- +- ++ + +- 5 ++ False ++ 5 + Preferred Applications +- center +- normal ++ center ++ normal + +- ++ + True ++ False + vertical + 2 ++ ++ ++ True ++ False ++ end ++ ++ ++ gtk-cancel ++ True ++ True ++ True ++ True ++ ++ ++ False ++ False ++ 0 ++ ++ ++ ++ ++ gtk-ok ++ True ++ True ++ True ++ True ++ ++ ++ False ++ False ++ 1 ++ ++ ++ ++ ++ False ++ False ++ end ++ 0 ++ ++ + + + True +- True ++ True + + + True +- 12 +- vertical ++ False ++ 12 + 18 + + + True +- vertical ++ False + 6 + + + True +- 0 ++ False + <b>Web Browser</b> +- True ++ True ++ 0 + + + False ++ True + 0 + + + + + True +- 12 ++ False ++ 12 + + + True +- vertical ++ False + 6 + + +- 360 ++ 360 + True +- 0 ++ False + The preferred Web Browser will be used to open hyperlinks. + True ++ 0 + + ++ True ++ True + 0 + + + + + True ++ False + + ++ True ++ True + 1 + + +@@ -73,59 +125,70 @@ + + + False ++ True + 1 + + + + + False ++ True + 0 + + + + + True +- vertical ++ False + 6 + + + True +- 0 ++ False + <b>Mail Client</b> +- True ++ True ++ 0 + + + False ++ True + 0 + + + + + True +- 12 ++ False ++ 12 + + + True +- vertical ++ False + 6 + + +- 360 ++ 360 + True +- 0 ++ False + The preferred Mail Client will be used to compose emails when you click on e-mail addresses. + True +- 60 ++ 60 ++ 0 + + ++ True ++ True + 0 + + + + + True ++ False + + ++ True ++ True + 1 + + +@@ -134,56 +197,66 @@ + + + False ++ True + 1 + + + + + False ++ True + 1 + + + + +- vertical ++ False + 6 + + + True +- 0 ++ False + <b>Terminal Emulator</b> +- True ++ True ++ 0 + + + False ++ True + 0 + + + + + True +- 12 ++ False ++ 12 + + + True ++ False + 6 + + + True ++ False + Command line: + + + False ++ True + 0 + + + + + True +- True +- • ++ True ++ • + + ++ True ++ True + 1 + + +@@ -192,12 +265,14 @@ + + + False ++ True + 1 + + + + + False ++ True + 2 + + +@@ -206,15 +281,16 @@ + + + True ++ False + System Applications + + +- False ++ False + + + + +- vertical ++ False + + + +@@ -226,55 +302,19 @@ + + + True ++ False + File Associations + + + 1 +- False +- +- +- +- +- 1 +- +- +- +- +- True +- end +- +- +- gtk-cancel +- True +- True +- True +- True +- +- +- False +- False +- 0 +- +- +- +- +- gtk-ok +- True +- True +- True +- True +- +- +- False +- False +- 1 ++ False + + + + + False +- end +- 0 ++ True ++ 1 + + + +diff --git a/data/ui/progress.glade b/data/ui/progress.glade +index cae3df04..a12f2d9d 100644 +--- a/data/ui/progress.glade ++++ b/data/ui/progress.glade +@@ -1,33 +1,34 @@ + ++ + +- +- ++ + + True +- False +- 5 +- 480 +- dialog ++ False ++ 5 ++ 480 ++ dialog + north-east + +- ++ + True +- False ++ False ++ vertical + 6 + +- ++ + True +- False +- end ++ False ++ end + + + gtk-stop ++ False + True +- True +- True +- False +- False +- True ++ True ++ True ++ False ++ True + + + False +@@ -39,26 +40,26 @@ + + False + True +- end ++ end + 0 + + + + + True +- False +- 6 ++ False ++ 6 + 6 + + + True +- False ++ False + 12 + + +- False ++ False + gtk-file +- 6 ++ 6 + + + False +@@ -68,9 +69,9 @@ + + + +- False +- 0 ++ False + True ++ 0 + + + True +@@ -88,159 +89,159 @@ + + + True +- False +- 6 +- 5 +- 2 +- 12 +- 6 ++ False ++ 6 ++ 5 ++ 2 ++ 12 ++ 6 + + + True +- False ++ False ++ True ++ True ++ src + 0 +- True +- True +- src + + +- GTK_FILL +- ++ GTK_FILL ++ + + + + + True +- True +- 0 ++ True + end ++ 0 + + +- 1 +- 2 +- ++ 1 ++ 2 ++ + + + + + True +- False +- 0 ++ False + <b>To:</b> +- True +- True +- dest ++ True ++ True ++ dest ++ 0 + + +- 1 +- 2 +- GTK_FILL +- ++ 1 ++ 2 ++ GTK_FILL ++ + + + + + True +- True +- 0 ++ True + middle ++ 0 + + +- 1 +- 2 +- 1 +- 2 +- ++ 1 ++ 2 ++ 1 ++ 2 ++ + + + + + True +- False +- 0.10000000149 ++ False ++ 0.10000000149 + + +- 2 +- 2 +- 3 +- ++ 2 ++ 2 ++ 3 ++ + + + + + True +- True +- 0 ++ True + Preparing... + middle ++ 0 + + +- 2 +- 3 +- 4 +- ++ 2 ++ 3 ++ 4 ++ + + + + + True +- False +- 0 ++ False + <b>Data transferred:</b> +- True +- True +- data_transferred ++ True ++ True ++ data_transferred ++ 0 + + +- 4 +- 5 +- GTK_FILL +- ++ 4 ++ 5 ++ GTK_FILL ++ + + + + + True +- True ++ True + 0 + + +- 1 +- 2 +- 4 +- 5 +- ++ 1 ++ 2 ++ 4 ++ 5 ++ + + + + + True +- False +- 0 ++ False + <b>Time remaining:</b> +- True +- True +- remaining_time ++ True ++ True ++ remaining_time ++ 0 + + +- 5 +- 6 +- GTK_FILL +- ++ 5 ++ 6 ++ GTK_FILL ++ + + + + + True +- True ++ True + 0 + + +- 1 +- 2 +- 5 +- 6 +- ++ 1 ++ 2 ++ 5 ++ 6 ++ + + + +@@ -252,17 +253,17 @@ + + + +- False ++ False + 6 + + + True +- False +- 0 ++ False + <b>Errors occurred:</b> +- True +- True +- error_msg ++ True ++ True ++ error_msg ++ 0 + + + False +@@ -273,21 +274,19 @@ + + + True +- False +- 12 ++ False ++ 12 + + + True +- True +- automatic +- automatic +- etched-in ++ True ++ etched-in + + +- 120 ++ 120 + True +- True +- False ++ True ++ False + + + +diff --git a/po/POTFILES.in b/po/POTFILES.in +index f7d3fa5e..44c271e1 100644 +--- a/po/POTFILES.in ++++ b/po/POTFILES.in +@@ -48,4 +48,6 @@ src/modules/gtk-fileprop-x-desktop.c + src/modules/gtk-menu-trash.c + src/tools/libfm-pref-apps.c + src/tools/lxshortcut.c +-src/udisks/g-udisks-device.c ++src/udisks/g-udisks-drive.c ++src/udisks/g-udisks-mount.c ++src/udisks/g-udisks-volume.c +diff --git a/src/Makefile.am b/src/Makefile.am +index 8864b122..ebb5dfd1 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -260,7 +260,6 @@ libfm_la_SOURCES = \ + libfm_la_CFLAGS = \ + $(GIO_CFLAGS) \ + $(MENU_CACHE_CFLAGS) \ +- $(DBUS_CFLAGS) \ + $(EXIF_CFLAGS) \ + -DPACKAGE_DATA_DIR=\""$(datadir)/libfm"\" \ + -DPACKAGE_MODULES_DIR=\""$(libdir)/@PACKAGE@/modules"\" \ +@@ -269,7 +268,6 @@ libfm_la_CFLAGS = \ + libfm_la_LIBADD = \ + $(GIO_LIBS) \ + $(MENU_CACHE_LIBS) \ +- $(DBUS_LIBS) \ + $(EXIF_LIBS) \ + $(INTLLIBS) \ + $(NULL) +diff --git a/src/base/fm-action.c b/src/base/fm-action.c +index a4ec7d20..39e8bf23 100644 +--- a/src/base/fm-action.c ++++ b/src/base/fm-action.c +@@ -1729,6 +1729,10 @@ static gboolean _matches_cond(FmFileInfoList *files, FmFileInfo *location, + gsize len; + int num; + gboolean match = TRUE, found, match_num; ++#if GLIB_CHECK_VERSION(2, 24, 0) ++ GDBusConnection *conn; ++ GVariant *result; ++#endif + + if (files != NULL) + flist = fm_file_info_list_peek_head_link(files); +@@ -1832,8 +1836,8 @@ static gboolean _matches_cond(FmFileInfoList *files, FmFileInfo *location, + g_string_free(str, TRUE); + break; + case CONDITION_TYPE_DBUS: /* ShowIfRegistered */ +-#if defined(ENABLE_DBUS) && GLIB_CHECK_VERSION(2, 24, 0) +- str = g_string_size_new(64); ++#if GLIB_CHECK_VERSION(2, 24, 0) ++ str = g_string_sized_new(64); + _expand_params(str, cond->str, root, TRUE, NULL); + /* DBus call is taken from GLib sources: gio/tests/gdbus-names.c */ + conn = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL); +@@ -1852,6 +1856,7 @@ static gboolean _matches_cond(FmFileInfoList *files, FmFileInfo *location, + g_variant_unref(result); + } + g_string_free(str, TRUE); ++ g_object_unref(conn); + #endif + break; + case CONDITION_TYPE_OUT_TRUE: /* ShowIfTrue */ +diff --git a/src/base/fm-file-info.c b/src/base/fm-file-info.c +index 3ddbef9a..3b8b5ae8 100644 +--- a/src/base/fm-file-info.c ++++ b/src/base/fm-file-info.c +@@ -70,6 +70,10 @@ static FmIcon* icon_locked_folder = NULL; + /* all of the user special dirs are direct child of home directory */ + static gboolean special_dirs_all_in_home = TRUE; + ++/* some functions may be called after FmFileInfo and FmMimeType ++ are finalized, so we need to make them return immediately */ ++static gboolean is_initialized = FALSE; ++ + typedef struct _SpecialDirInfo + { + const char* path_str; +@@ -170,8 +174,11 @@ void _fm_file_info_init(void) + special_dir_info[i].path_str = path_str; + } + } ++ is_initialized = TRUE; + } + ++ ++ + void _fm_file_info_finalize() + { + g_object_unref(icon_locked_folder); +@@ -244,7 +251,7 @@ gboolean _fm_file_info_set_from_native_file(FmFileInfo* fi, const char* path, + char *dname; + + g_return_val_if_fail(fi && fi->path, FALSE); +- if(lstat(path, &st) == 0) ++ if(is_initialized && lstat(path, &st) == 0) + { + GFile* gfile; + GFileInfo* inf; +@@ -550,6 +557,7 @@ void fm_file_info_set_from_gfileinfo(FmFileInfo* fi, GFileInfo* inf) + */ + void fm_file_info_set_from_g_file_data(FmFileInfo *fi, GFile *gf, GFileInfo *inf) + { ++ if (!is_initialized) return; + const char *tmp, *uri; + GIcon* gicon; + GFile *_gf = NULL; +@@ -791,6 +799,7 @@ FmFileInfo* fm_file_info_new_from_g_file_data(GFile *gf, GFileInfo *inf, FmPath + */ + void fm_file_info_set_from_menu_cache_item(FmFileInfo* fi, MenuCacheItem* item) + { ++ if (!is_initialized) return; + const char* icon_name; + icon_name = menu_cache_item_get_icon(item); + _fm_path_set_display_name(fi->path, menu_cache_item_get_name(item)); +@@ -945,6 +954,7 @@ void fm_file_info_unref(FmFileInfo* fi) + */ + void fm_file_info_update(FmFileInfo* fi, FmFileInfo* src) + { ++ if (!is_initialized) return; + FmPath* tmp_path = fm_path_ref(src->path); + FmMimeType* tmp_type = fm_mime_type_ref(src->mime_type); + FmIcon* tmp_icon = g_object_ref(src->icon); +@@ -1363,6 +1373,7 @@ gboolean fm_file_info_is_unknown_type(FmFileInfo* fi) + /* full path of the file is required by this function */ + gboolean fm_file_info_is_executable_type(FmFileInfo* fi) + { ++ if (!is_initialized) return FALSE; + const char* type = fm_mime_type_get_type(fi->mime_type); + if(strncmp(type, "text/", 5) == 0) + { /* g_content_type_can_be_executable reports text files as executables too */ +diff --git a/src/gtk/exo/exo-icon-view.c b/src/gtk/exo/exo-icon-view.c +index 3ce98099..9a432620 100644 +--- a/src/gtk/exo/exo-icon-view.c ++++ b/src/gtk/exo/exo-icon-view.c +@@ -1601,6 +1601,9 @@ exo_icon_view_realize (GtkWidget *widget) + attributes.height = MAX (priv->height, allocation.height); + attributes.event_mask = GDK_EXPOSURE_MASK + | GDK_SCROLL_MASK ++#if GTK_CHECK_VERSION(3, 4, 0) ++ | GDK_SMOOTH_SCROLL_MASK ++#endif + | GDK_POINTER_MOTION_MASK + | GDK_BUTTON_PRESS_MASK + | GDK_BUTTON_RELEASE_MASK +@@ -3413,8 +3416,6 @@ exo_icon_view_adjustment_changed (GtkAdjustment *adjustment, + + if (G_UNLIKELY (icon_view->priv->doing_rubberband)) + exo_icon_view_update_rubberband (GTK_WIDGET (icon_view)); +- +- gdk_window_process_updates (icon_view->priv->bin_window, TRUE); + } + } + +diff --git a/src/gtk/fm-file-menu.c b/src/gtk/fm-file-menu.c +index b7782a96..daf842aa 100644 +--- a/src/gtk/fm-file-menu.c ++++ b/src/gtk/fm-file-menu.c +@@ -166,6 +166,13 @@ GtkActionEntry base_menu_actions[]= + {"Prop", GTK_STOCK_PROPERTIES, N_("Prop_erties"), NULL, NULL, G_CALLBACK(on_prop)} + }; + ++ ++GtkActionEntry open_menu_actions[]= ++{ ++ {"Open", GTK_STOCK_OPEN, N_("_Open"), NULL, NULL, G_CALLBACK(on_open)}, ++ {"OpenWith", NULL, N_("Open _With..."), NULL, NULL, G_CALLBACK(on_open_with)}, ++}; ++ + /* plugins for MIME type */ + typedef struct { + FmMimeType *mime_type; +@@ -537,6 +544,168 @@ _disable_open: + return data; + } + ++/** ++ * fm_app_menu_new_for_files ++ * @parent: window to place menu over ++ * @files: target files ++ * @cwd: working directory ++ * @auto_destroy: %TRUE if menu should be destroyed after some action was activated ++ * ++ * Creates new application menu for some files list. ++ * ++ * Returns: a new #FmFileMenu object. ++ * ++ */ ++FmFileMenu* fm_app_menu_new_for_files(GtkWindow* parent, FmFileInfoList* files, FmPath* cwd, gboolean auto_destroy) ++{ ++ GtkUIManager* ui; ++ GtkActionGroup* act_grp; ++ GtkAction* act; ++ FmFileInfo* fi; ++ FmFileMenu* data = g_slice_new0(FmFileMenu); ++ GString* xml; ++ GList* mime_types = NULL; ++ GList* l; ++ GList* apps = NULL; ++ gboolean all_native = TRUE; ++ unsigned items_num = fm_file_info_list_get_length(files); ++ ++ data->file_infos = fm_file_info_list_ref(files); ++ ++ /* create list of mime types */ ++ for(l = fm_file_info_list_peek_head_link(files); l; l = l->next) ++ { ++ FmMimeType* mime_type; ++ GList* l2; ++ ++ fi = l->data; ++ if (!fm_file_info_is_native(fi)) ++ all_native = FALSE; ++ else if (all_native && fm_file_info_is_shortcut(fi)) ++ { ++ /* this takes some time but it's inevitable */ ++ FmPath *tp = fm_path_new_for_str(fm_file_info_get_target(fi)); ++ if (!fm_path_is_native(tp)) ++ all_native = FALSE; ++ fm_path_unref(tp); ++ } ++ mime_type = fm_file_info_get_mime_type(fi); ++ if(mime_type == NULL) ++ continue; ++ for(l2 = mime_types; l2; l2 = l2->next) ++ if(l2->data == mime_type) ++ break; ++ if(l2) /* already added */ ++ continue; ++ mime_types = g_list_prepend(mime_types, fm_mime_type_ref(mime_type)); ++ } ++ fi = fm_file_info_list_peek_head(files); /* we'll test it below */ ++ /* create apps list */ ++ if(mime_types) ++ { ++ data->same_type = (mime_types->next == NULL); ++ apps = g_app_info_get_all_for_type(fm_mime_type_get_type(mime_types->data)); ++ for(l = mime_types->next; l; l = l->next) ++ { ++ GList *apps2, *l2, *l3; ++ apps2 = g_app_info_get_all_for_type(fm_mime_type_get_type(l->data)); ++ for(l2 = apps; l2; ) ++ { ++ for(l3 = apps2; l3; l3 = l3->next) ++ if(g_app_info_equal(l2->data, l3->data)) ++ break; ++ if(l3) /* this app supports all files */ ++ { ++ /* g_debug("%s supports %s", g_app_info_get_id(l2->data), fm_mime_type_get_type(l->data)); */ ++ l2 = l2->next; ++ continue; ++ } ++ /* g_debug("%s invalid for %s", g_app_info_get_id(l2->data), fm_mime_type_get_type(l->data)); */ ++ g_object_unref(l2->data); ++ l3 = l2->next; /* save for next iter */ ++ apps = g_list_delete_link(apps, l2); ++ l2 = l3; /* continue with next item */ ++ } ++ g_list_foreach(apps2, (GFunc)g_object_unref, NULL); ++ g_list_free(apps2); ++ } ++ } ++ ++ data->ui = ui = gtk_ui_manager_new(); ++ data->act_grp = act_grp = gtk_action_group_new("Popup"); ++ gtk_action_group_set_translation_domain(act_grp, GETTEXT_PACKAGE); ++ ++ if(cwd) ++ data->cwd = fm_path_ref(cwd); ++ ++ gtk_action_group_add_actions(act_grp, open_menu_actions, G_N_ELEMENTS(open_menu_actions), data); ++ gtk_ui_manager_add_ui_from_string(ui, base_menu_xml, -1, NULL); ++ gtk_ui_manager_insert_action_group(ui, act_grp, 0); ++ ++ xml = g_string_new(""); ++ if(apps) /* add specific menu items for those files */ ++ { ++ gboolean use_sub = g_list_length(apps) > 50; ++ gboolean found_app = FALSE; ++ ++ for(l=apps;l;l=l->next) ++ { ++ GAppInfo* app = l->data; ++ ++ /*g_debug("app %s, executable %s, command %s\n", ++ g_app_info_get_name(app), ++ g_app_info_get_executable(app), ++ g_app_info_get_commandline(app));*/ ++ ++ gchar * program_path = g_find_program_in_path(g_app_info_get_executable(app)); ++ if (!program_path) ++ goto _next_app; ++ g_free(program_path); ++ if (!all_native && !g_app_info_supports_uris(app)) ++ { ++_next_app: ++ g_object_unref(app); ++ continue; ++ } ++ found_app = TRUE; ++ ++ act = gtk_action_new(g_app_info_get_id(app), ++ g_app_info_get_name(app), ++ g_app_info_get_description(app), ++ NULL); ++ g_signal_connect(act, "activate", G_CALLBACK(on_open_with_app), data); ++ gtk_action_set_gicon(act, g_app_info_get_icon(app)); ++ gtk_action_group_add_action(act_grp, act); ++ /* associate the app info object with the action */ ++ g_object_set_qdata_full(G_OBJECT(act), fm_qdata_id, app, g_object_unref); ++ g_string_append_printf(xml, "", g_app_info_get_id(app)); ++ } ++ ++ g_list_free(apps); /* don't unref GAppInfos now */ ++ } ++ act = gtk_ui_manager_get_action(ui, "/popup/Open"); ++ gtk_action_set_visible(act, FALSE); ++ g_string_append(xml, ""); ++ g_string_append(xml, ""); ++ ++ ++ gtk_ui_manager_add_ui_from_string(ui, xml->str, xml->len, NULL); ++ ++ data->menu = GTK_MENU(gtk_ui_manager_get_widget(data->ui, "/popup")); ++ gtk_menu_attach_to_widget(data->menu, GTK_WIDGET(parent), NULL); ++ g_object_weak_ref(G_OBJECT(parent), (GWeakNotify)gtk_menu_detach, data->menu); ++ fm_widget_menu_fix_tooltips(data->menu); ++ ++ if(auto_destroy) ++ { ++ g_signal_connect_swapped(data->menu, "selection-done", ++ G_CALLBACK(fm_file_menu_destroy), data); ++ } ++ ++ g_string_free(xml, TRUE); ++ return data; ++} ++ + /** + * fm_file_menu_get_ui + * @menu: a menu +diff --git a/src/gtk/fm-file-menu.h b/src/gtk/fm-file-menu.h +index 8c4f376c..bde6a1e8 100644 +--- a/src/gtk/fm-file-menu.h ++++ b/src/gtk/fm-file-menu.h +@@ -33,6 +33,7 @@ G_BEGIN_DECLS + typedef struct _FmFileMenu FmFileMenu; + + FmFileMenu* fm_file_menu_new_for_file(GtkWindow* parent, FmFileInfo* fi, FmPath* cwd, gboolean auto_destroy); ++FmFileMenu* fm_app_menu_new_for_files(GtkWindow* parent, FmFileInfoList* files, FmPath* cwd, gboolean auto_destroy); + FmFileMenu* fm_file_menu_new_for_files(GtkWindow* parent, FmFileInfoList* files, FmPath* cwd, gboolean auto_destroy); + void fm_file_menu_destroy(FmFileMenu* menu); + +diff --git a/src/gtk/fm-folder-view.c b/src/gtk/fm-folder-view.c +index d35dff0d..7a950792 100644 +--- a/src/gtk/fm-folder-view.c ++++ b/src/gtk/fm-folder-view.c +@@ -1378,6 +1378,20 @@ static inline GtkMenu *_make_file_menu(FmFolderView* fv, GtkWindow *win, + return fm_file_menu_get_menu(menu); + } + ++static inline GtkMenu *_make_app_menu(FmFolderView* fv, GtkWindow *win, ++ FmFolderViewUpdatePopup update_popup, ++ FmLaunchFolderFunc open_folders, ++ FmFileInfoList* files) ++{ ++ FmFileMenu* menu; ++ ++ menu = fm_app_menu_new_for_files(win, files, fm_folder_view_get_cwd(fv), TRUE); ++ fm_file_menu_set_folder_func(menu, open_folders, win); ++ ++ gtk_ui_manager_ensure_update(fm_file_menu_get_ui(menu)); ++ return fm_file_menu_get_menu(menu); ++} ++ + static void on_file_menu(GtkAction* act, FmFolderView* fv) + { + FmFolderViewInterface *iface = FM_FOLDER_VIEW_GET_IFACE(fv); +@@ -1770,6 +1784,24 @@ void fm_folder_view_item_clicked(FmFolderView* fv, GtkTreePath* path, + open_folders, win); + fm_file_info_list_unref(files); + break; ++ case FM_FV_MIDDLE_CLICK: /* middle click */ ++ files = iface->dup_selected_files(fv); ++ if(fi && fm_file_info_is_dir(fi)) ++ { ++ /* handled by PCManFm */ ++ } ++ else ++ { ++ if(fi) ++ { ++ files = iface->dup_selected_files(fv); ++ popup = _make_app_menu(fv, win, update_popup, open_folders, files); ++ fm_file_info_list_unref(files); ++ gtk_menu_popup(popup, NULL, NULL, popup_position_func, fv, 3, ++ gtk_get_current_event_time()); ++ } ++ } ++ break; + case FM_FV_CONTEXT_MENU: + if(fi && iface->count_selected_files(fv) > 0) + /* workaround on ExoTreeView bug */ +diff --git a/src/gtk/fm-progress-dlg.c b/src/gtk/fm-progress-dlg.c +index fac3a3eb..6a54172e 100644 +--- a/src/gtk/fm-progress-dlg.c ++++ b/src/gtk/fm-progress-dlg.c +@@ -174,6 +174,8 @@ static gint on_ask_rename(FmFileOpsJob* job, FmFileInfo* src, FmFileInfo* dest, + GtkLabel *src_fi, *dest_fi; + GtkEntry *filename; + GtkToggleButton *apply_all; ++ char* comparedate; ++ char* comparesize; + char* tmp; + const char* disp_size; + FmPath* path; +@@ -208,18 +210,34 @@ static gint on_ask_rename(FmFileOpsJob* job, FmFileInfo* src, FmFileInfo* dest, + gtk_window_set_transient_for(GTK_WINDOW(dlg), GTK_WINDOW(data->dlg)); + + gtk_image_set_from_gicon(src_icon, G_ICON(icon), GTK_ICON_SIZE_DIALOG); ++ if (fm_file_info_get_mtime(src) > fm_file_info_get_mtime(dest)) ++ comparedate = _("newer"); ++ else ++ if (fm_file_info_get_mtime(src) < fm_file_info_get_mtime(dest)) ++ comparedate = _("older"); ++ else ++ if (fm_file_info_get_mtime(src) == fm_file_info_get_mtime(dest)) ++ comparedate = _("same date/time"); + disp_size = fm_file_info_get_disp_size(src); + if(disp_size) + { +- tmp = g_strdup_printf(_("Type: %s\nSize: %s\nModified: %s"), +- fm_file_info_get_desc(src), disp_size, +- fm_file_info_get_disp_mtime(src)); ++ if (fm_file_info_get_size(src) > fm_file_info_get_size(dest)) ++ comparesize = _("larger"); ++ else ++ if (fm_file_info_get_size(src) < fm_file_info_get_size(dest)) ++ comparesize = _("less"); ++ else ++ if (fm_file_info_get_size(src) == fm_file_info_get_size(dest)) ++ comparesize = _("same size"); ++ tmp = g_strdup_printf(_("Type: %s\nSize: %s (%s)\nModified: %s (%s)"), ++ fm_file_info_get_desc(src), disp_size, comparesize, ++ fm_file_info_get_disp_mtime(src), comparedate); + } + else + { +- tmp = g_strdup_printf(_("Type: %s\nModified: %s"), ++ tmp = g_strdup_printf(_("Type: %s\nModified: %s (%s)"), + fm_file_info_get_desc(src), +- fm_file_info_get_disp_mtime(src)); ++ fm_file_info_get_disp_mtime(src), comparedate); + } + + gtk_label_set_text(src_fi, tmp); +@@ -457,6 +475,8 @@ static gboolean on_update_dlg(gpointer user_data) + g_string_printf(data->str, "%d %%", data->percent); + gtk_progress_bar_set_fraction(data->progress, (gdouble)data->percent/100); + gtk_progress_bar_set_text(data->progress, data->str->str); ++ g_string_printf(data->str, _("%d%% %s"), data->percent, data->op_text); ++ gtk_window_set_title(GTK_WINDOW(data->dlg), data->str->str); + + /* display the amount of data transferred */ + fm_file_size_to_str(trans_size_str, sizeof(trans_size_str), +@@ -658,7 +678,7 @@ static gboolean _on_show_dlg(gpointer user_data) + else + { + /* note to translators: resulting string is such as "Deleting files" */ +- g_string_printf(data->str, _("%s files"), data->op_text); ++ g_string_printf(data->str, _("%d%% %s"), data->percent, data->op_text); + gtk_window_set_title(GTK_WINDOW(data->dlg), data->str->str); + } + gtk_label_set_markup(data->msg, _("File operation is in progress...")); +diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am +index e61f4e01..01c15bd4 100644 +--- a/src/modules/Makefile.am ++++ b/src/modules/Makefile.am +@@ -11,7 +11,6 @@ AM_CPPFLAGS = \ + # tell libtool we compile module not library + AM_LDFLAGS = \ + -no-undefined -module -avoid-version -shared -export-dynamic \ +- -L$(libdir) \ + $(GIO_LIBS) + + # the module should be linked only with libfm, not libfm-gtk or whatever +diff --git a/src/udisks/dbus-utils.c b/src/udisks/dbus-utils.c +index aa235a6f..6122edb6 100644 +--- a/src/udisks/dbus-utils.c ++++ b/src/udisks/dbus-utils.c +@@ -26,24 +26,13 @@ + #include "dbus-utils.h" + #include + +-GHashTable* dbus_get_all_props(DBusGProxy* proxy, const char* iface, GError** err) +-{ +- GHashTable* props = NULL; +- dbus_g_proxy_call(proxy, "GetAll", err, +- G_TYPE_STRING, iface, G_TYPE_INVALID, +- dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &props, G_TYPE_INVALID); +- return props; +-} +- +- + GError* g_udisks_error_to_gio_error(GError* error) + { + if(error) + { + int code = G_IO_ERROR_FAILED; + error = g_error_new_literal(G_IO_ERROR, code, error->message); +- return error; + } +- return NULL; ++ return error; + } + +diff --git a/src/udisks/dbus-utils.h b/src/udisks/dbus-utils.h +index d2128223..5fb2dd4d 100644 +--- a/src/udisks/dbus-utils.h ++++ b/src/udisks/dbus-utils.h +@@ -2,6 +2,7 @@ + * dbus-utils.h + * + * Copyright 2010 PCMan ++ * Copyright 2021 Andriy Grytsenko (LStranger) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -22,83 +23,42 @@ + #ifndef __DBUS_UTILS_H__ + #define __DBUS_UTILS_H__ + +-#include +-#include ++#include + + G_BEGIN_DECLS + +-// char* dbus_get_prop(DBusGProxy* proxy, const char* iface, const char* prop); +-GHashTable* dbus_get_all_props(DBusGProxy* proxy, const char* iface, GError** err); +- +-static inline const char* dbus_prop_str(GHashTable* props, const char* name) +-{ +- GValue* val = (GValue*)g_hash_table_lookup(props, name); +- return val ? g_value_get_string(val) : NULL; +-} +- +-static inline const char* dbus_prop_obj_path(GHashTable* props, const char* name) +-{ +- GValue* val = (GValue*)g_hash_table_lookup(props, name); +- return val ? (char*)g_value_get_boxed(val) : NULL; +-} +- +-static inline const char** dbus_prop_strv(GHashTable* props, const char* name) +-{ +- GValue* val = (GValue*)g_hash_table_lookup(props, name); +- return val ? (const char**)g_value_get_boxed(val) : NULL; +-} +- +-static inline char* dbus_prop_dup_str(GHashTable* props, const char* name) ++static inline char* dbus_prop_dup_str(GDBusProxy* proxy, const char* name) + { +- GValue* val = (GValue*)g_hash_table_lookup(props, name); +- return val ? g_value_dup_string(val) : NULL; ++ GVariant *var = g_dbus_proxy_get_cached_property(proxy, name); ++ char *str = var ? g_variant_dup_string(var, NULL) : NULL; ++ if (var) g_variant_unref(var); ++ return str; + } + +-static inline char* dbus_prop_dup_obj_path(GHashTable* props, const char* name) ++static inline char** dbus_prop_dup_strv(GDBusProxy* proxy, const char* name) + { +- GValue* val = (GValue*)g_hash_table_lookup(props, name); +- return val ? g_strdup((char*)g_value_get_boxed(val)) : NULL; ++ GVariant *var = g_dbus_proxy_get_cached_property(proxy, name); ++ char **strv = var ? g_variant_dup_bytestring_array(var, NULL) : NULL; ++ if (var) g_variant_unref(var); ++ return strv; + } + +-static inline char** dbus_prop_dup_strv(GHashTable* props, const char* name) ++static inline gboolean dbus_prop_bool(GDBusProxy* proxy, const char* name) + { +- GValue* val = (GValue*)g_hash_table_lookup(props, name); +- return val ? g_value_dup_boxed(val) : NULL; ++ GVariant *var = g_dbus_proxy_get_cached_property(proxy, name); ++ gboolean val = var ? g_variant_get_boolean(var) : FALSE; ++ if (var) g_variant_unref(var); ++ return val; + } + +-static inline gboolean dbus_prop_bool(GHashTable* props, const char* name) ++static inline guint dbus_prop_uint(GDBusProxy* proxy, const char* name) + { +- GValue* val = (GValue*)g_hash_table_lookup(props, name); +- return val ? g_value_get_boolean(val) : FALSE; ++ GVariant *var = g_dbus_proxy_get_cached_property(proxy, name); ++ guint val = var ? g_variant_get_uint32(var) : 0; ++ if (var) g_variant_unref(var); ++ return val; + } + +-static inline gint dbus_prop_int(GHashTable* props, const char* name) +-{ +- GValue* val = (GValue*)g_hash_table_lookup(props, name); +- return val ? g_value_get_int(val) : 0; +-} +- +-static inline guint dbus_prop_uint(GHashTable* props, const char* name) +-{ +- GValue* val = (GValue*)g_hash_table_lookup(props, name); +- return val ? g_value_get_uint(val) : 0; +-} +- +-static inline gint64 dbus_prop_int64(GHashTable* props, const char* name) +-{ +- GValue* val = (GValue*)g_hash_table_lookup(props, name); +- return val ? g_value_get_int64(val) : 0; +-} +- +-static inline guint64 dbus_prop_uint64(GHashTable* props, const char* name) +-{ +- GValue* val = (GValue*)g_hash_table_lookup(props, name); +- return val ? g_value_get_uint64(val) : 0; +-} +- +-// GHashTable* dbus_get_prop_async(); +-// GHashTable* dbus_get_all_props_async(); +- + GError* g_udisks_error_to_gio_error(GError* error); + + G_END_DECLS +diff --git a/src/udisks/g-udisks-device.c b/src/udisks/g-udisks-device.c +index 773525ec..9d60e4f6 100644 +--- a/src/udisks/g-udisks-device.c ++++ b/src/udisks/g-udisks-device.c +@@ -1,6 +1,7 @@ + // g-udisks-device.c + // + // Copyright 2010 Hong Jen Yee (PCMan) ++// Copyright 2021 Andriy Grytsenko (LStranger) + // + // This program is free software; you can redistribute it and/or modify + // it under the terms of the GNU General Public License as published by +@@ -21,46 +22,30 @@ + #include + #endif + +-#include "g-udisks-device.h" ++#include "g-udisks-mount.h" ++#include "g-udisks-drive.h" + #include "dbus-utils.h" +-#include "udisks-device.h" ++ + #include +-#include + +-/* This array is taken from gnome-disk-utility: gdu-volume.c +- * Copyright (C) 2007 David Zeuthen, licensed under GNU LGPL +- */ +-static const struct ++struct _GUDisksDevice ++{ ++ GObject parent; ++ char* obj_path; /* dbus object path */ ++ GDBusProxy *proxy; /* dbus proxy for org.freedesktop.UDisks2.Block */ ++ GDBusProxy *fsproxy; /* dbus proxy for org.freedesktop.UDisks2.Filesystem */ ++}; ++ ++struct _GUDisksDeviceClass + { +- const char *disc_type; +- const char *icon_name; +- const char *ui_name; +- const char *ui_name_blank; +-} disc_data[] = { +- /* Translator: The word "blank" is used as an adjective, e.g. we are decsribing discs that are already blank */ +- {"optical_cd", "media-optical-cd-rom", N_("CD-ROM Disc"), N_("Blank CD-ROM Disc")}, +- {"optical_cd_r", "media-optical-cd-r", N_("CD-R Disc"), N_("Blank CD-R Disc")}, +- {"optical_cd_rw", "media-optical-cd-rw", N_("CD-RW Disc"), N_("Blank CD-RW Disc")}, +- {"optical_dvd", "media-optical-dvd-rom", N_("DVD-ROM Disc"), N_("Blank DVD-ROM Disc")}, +- {"optical_dvd_r", "media-optical-dvd-r", N_("DVD-ROM Disc"), N_("Blank DVD-ROM Disc")}, +- {"optical_dvd_rw", "media-optical-dvd-rw", N_("DVD-RW Disc"), N_("Blank DVD-RW Disc")}, +- {"optical_dvd_ram", "media-optical-dvd-ram", N_("DVD-RAM Disc"), N_("Blank DVD-RAM Disc")}, +- {"optical_dvd_plus_r", "media-optical-dvd-r-plus", N_("DVD+R Disc"), N_("Blank DVD+R Disc")}, +- {"optical_dvd_plus_rw", "media-optical-dvd-rw-plus", N_("DVD+RW Disc"), N_("Blank DVD+RW Disc")}, +- {"optical_dvd_plus_r_dl", "media-optical-dvd-dl-r-plus", N_("DVD+R DL Disc"), N_("Blank DVD+R DL Disc")}, +- {"optical_dvd_plus_rw_dl", "media-optical-dvd-dl-r-plus", N_("DVD+RW DL Disc"), N_("Blank DVD+RW DL Disc")}, +- {"optical_bd", "media-optical-bd-rom", N_("Blu-Ray Disc"), N_("Blank Blu-Ray Disc")}, +- {"optical_bd_r", "media-optical-bd-r", N_("Blu-Ray R Disc"), N_("Blank Blu-Ray R Disc")}, +- {"optical_bd_re", "media-optical-bd-re", N_("Blu-Ray RW Disc"), N_("Blank Blu-Ray RW Disc")}, +- {"optical_hddvd", "media-optical-hddvd-rom", N_("HD DVD Disc"), N_("Blank HD DVD Disc")}, +- {"optical_hddvd_r", "media-optical-hddvd-r", N_("HD DVD-R Disc"), N_("Blank HD DVD-R Disc")}, +- {"optical_hddvd_rw", "media-optical-hddvd-rw", N_("HD DVD-RW Disc"), N_("Blank HD DVD-RW Disc")}, +- {"optical_mo", "media-optical-mo", N_("MO Disc"), N_("Blank MO Disc")}, +- {"optical_mrw", "media-optical-mrw", N_("MRW Disc"), N_("Blank MRW Disc")}, +- {"optical_mrw_w", "media-optical-mrw-w", N_("MRW/W Disc"), N_("Blank MRW/W Disc")}, +- {NULL, NULL, NULL, NULL} ++ GObjectClass parent_class; ++ void (*changed)(GUDisksDevice* dev); + }; + ++static guint sig_changed; ++ ++static GHashTable *dev_hash; ++ + static void g_udisks_device_finalize (GObject *object); + + G_DEFINE_TYPE(GUDisksDevice, g_udisks_device, G_TYPE_OBJECT) +@@ -72,83 +57,24 @@ static void g_udisks_device_class_init(GUDisksDeviceClass *klass) + + g_object_class = G_OBJECT_CLASS(klass); + g_object_class->finalize = g_udisks_device_finalize; +-} + +-static void clear_props(GUDisksDevice* dev) +-{ +- g_free(dev->dev_file); +- g_free(dev->dev_file_presentation); +- g_free(dev->name); +- g_free(dev->icon_name); +- g_free(dev->usage); +- g_free(dev->type); +- g_free(dev->uuid); +- g_free(dev->label); +- g_free(dev->vender); +- g_free(dev->model); +- g_free(dev->conn_iface); +- g_free(dev->media); +- g_free(dev->partition_slave); +- +- g_strfreev(dev->mount_paths); ++ dev_hash = g_hash_table_new(g_str_hash, g_str_equal); ++ ++ sig_changed = g_signal_new("changed", G_TYPE_FROM_CLASS(klass), ++ G_SIGNAL_RUN_FIRST, ++ G_STRUCT_OFFSET (GUDisksDeviceClass, changed), ++ NULL, NULL, ++ g_cclosure_marshal_VOID__VOID, ++ G_TYPE_NONE, 0); + } + +-static void set_props(GUDisksDevice* dev, GHashTable* props) ++static void g_udisks_device_changed(GDBusProxy *proxy, GVariant *changed_properties, ++ GStrv invalidated_properties, gpointer user_data) + { +- dev->dev_file = dbus_prop_dup_str(props, "DeviceFile"); +- dev->dev_file_presentation = dbus_prop_dup_str(props, "DeviceFilePresentation"); +- dev->is_sys_internal = dbus_prop_bool(props, "DeviceIsSystemInternal"); +- dev->is_removable = dbus_prop_bool(props, "DeviceIsRemovable"); +- dev->is_read_only = dbus_prop_bool(props, "DeviceIsReadOnly"); +- dev->is_drive = dbus_prop_bool(props, "DeviceIsDrive"); +- dev->is_optic_disc = dbus_prop_bool(props, "DeviceIsOpticalDisc"); +- dev->is_mounted = dbus_prop_bool(props, "DeviceIsMounted"); +- dev->is_media_available = dbus_prop_bool(props, "DeviceIsMediaAvailable"); +- dev->is_media_change_notification_polling = dbus_prop_bool(props, "DeviceIsMediaChangeDetectionPolling"); +- dev->is_luks = dbus_prop_bool(props, "DeviceIsLuks"); +- dev->is_luks_clear_text = dbus_prop_bool(props, "DeviceIsLuksCleartext"); +- dev->is_linux_md_component = dbus_prop_bool(props, "DeviceIsLinuxMdComponent"); +- dev->is_linux_md = dbus_prop_bool(props, "DeviceIsLinuxMd"); +- dev->is_linux_lvm2lv = dbus_prop_bool(props, "DeviceIsLinuxLvm2LV"); +- dev->is_linux_lvm2pv = dbus_prop_bool(props, "DeviceIsLinuxLvm2PV"); +- dev->is_linux_dmmp_component = dbus_prop_bool(props, "DeviceIsLinuxDmmpComponent"); +- dev->is_linux_dmmp = dbus_prop_bool(props, "DeviceIsLinuxDmmp"); +- +- dev->is_ejectable = dbus_prop_bool(props, "DriveIsMediaEjectable"); +- dev->is_disc_blank = dbus_prop_bool(props, "OpticalDiscIsBlank"); +- +- dev->is_hidden = dbus_prop_bool(props, "DevicePresentationHide"); +- dev->auto_mount = !dbus_prop_bool(props, "DevicePresentationNopolicy"); +- +- dev->mounted_by_uid = dbus_prop_uint(props, "DeviceMountedByUid"); +- dev->mount_paths = dbus_prop_dup_strv(props, "DeviceMountPaths"); +- +- dev->dev_size = dbus_prop_uint64(props, "DeviceSize"); +- dev->partition_size = dbus_prop_uint64(props, "PartitionSize"); +- +- dev->luks_unlocked_by_uid = dbus_prop_uint(props, "LuksCleartextUnlockedByUid"); +- dev->num_audio_tracks = dbus_prop_uint(props, "OpticalDiscNumAudioTracks"); +- +- dev->name = dbus_prop_dup_str(props, "DevicePresentationName"); +- dev->icon_name = dbus_prop_dup_str(props, "DevicePresentationIconName"); +- +- dev->usage = dbus_prop_dup_str(props, "IdUsage"); +- dev->type = dbus_prop_dup_str(props, "IdType"); +- dev->uuid = dbus_prop_dup_str(props, "IdUuid"); +- dev->label = dbus_prop_dup_str(props, "IdLabel"); +- dev->vender = dbus_prop_dup_str(props, "DriveVendor"); +- dev->model = dbus_prop_dup_str(props, "DriveModel"); +- dev->conn_iface = dbus_prop_dup_str(props, "DriveConnectionInterface"); +- dev->media = dbus_prop_dup_str(props, "DriveMedia"); +- +- dev->partition_slave = dbus_prop_dup_obj_path(props, "PartitionSlave"); +- +- /* how to support LUKS? */ +-/* +- 'LuksHolder' read 'o' +- 'LuksCleartextSlave' read 'o' +-*/ ++ g_return_if_fail(G_IS_UDISKS_DEVICE(user_data)); ++ GUDisksDevice* dev = G_UDISKS_DEVICE(user_data); + ++ g_signal_emit(dev, sig_changed, 0); + } + + static void g_udisks_device_finalize(GObject *object) +@@ -160,8 +86,20 @@ static void g_udisks_device_finalize(GObject *object) + + self = G_UDISKS_DEVICE(object); + ++ g_hash_table_remove(dev_hash, self->obj_path); ++ ++ if (self->proxy) ++ { ++ g_signal_handlers_disconnect_by_func(self->proxy, G_CALLBACK(g_udisks_device_changed), self); ++ g_object_unref(self->proxy); ++ } ++ if (self->fsproxy) ++ { ++ g_signal_handlers_disconnect_by_func(self->fsproxy, G_CALLBACK(g_udisks_device_changed), self); ++ g_object_unref(self->fsproxy); ++ } ++ + g_free(self->obj_path); +- clear_props(self); + + G_OBJECT_CLASS(g_udisks_device_parent_class)->finalize(object); + } +@@ -172,142 +110,101 @@ static void g_udisks_device_init(GUDisksDevice *self) + } + + +-GUDisksDevice *g_udisks_device_new(const char* obj_path, GHashTable* props) ++/** ++ * ++ * Returns: (transfer full): either new or existing GUDisksDevice instance. ++ */ ++GUDisksDevice *g_udisks_device_get(const char* obj_path, GDBusConnection* con, ++ GCancellable* cancellable, GError** error) + { +- GUDisksDevice* dev = (GUDisksDevice*)g_object_new(G_TYPE_UDISKS_DEVICE, NULL); ++ GUDisksDevice* dev = dev_hash ? g_hash_table_lookup(dev_hash, obj_path) : NULL; ++ ++ if (dev) ++ return g_object_ref(dev); ++ ++ dev = (GUDisksDevice*)g_object_new(G_TYPE_UDISKS_DEVICE, NULL); + dev->obj_path = g_strdup(obj_path); +- set_props(dev, props); ++ g_hash_table_insert(dev_hash, dev->obj_path, dev); ++ dev->proxy = g_dbus_proxy_new_sync(con, G_DBUS_PROXY_FLAGS_NONE, NULL, ++ "org.freedesktop.UDisks2", obj_path, ++ "org.freedesktop.UDisks2.Block", ++ cancellable, error); ++ if (dev->proxy) ++ { ++ dev->fsproxy = g_dbus_proxy_new_sync(con, G_DBUS_PROXY_FLAGS_NONE, NULL, ++ "org.freedesktop.UDisks2", obj_path, ++ "org.freedesktop.UDisks2.Filesystem", ++ cancellable, error); ++ g_signal_connect(dev->proxy, "g-properties-changed", ++ G_CALLBACK(g_udisks_device_changed), dev); ++ if (dev->fsproxy) ++ g_signal_connect(dev->fsproxy, "g-properties-changed", ++ G_CALLBACK(g_udisks_device_changed), dev); ++ } + return dev; + } + +-void g_udisks_device_update(GUDisksDevice* dev, GHashTable* props) ++GVariant *g_udisks_device_get_fstype(GUDisksDevice* dev) + { +- clear_props(dev); +- set_props(dev, props); ++ GVariant *var = g_dbus_proxy_get_cached_property(dev->proxy, "IdType"); ++ return var ? var : g_variant_ref_sink(g_variant_new_string("auto")); + } + +-DBusGProxy* g_udisks_device_get_proxy(GUDisksDevice* dev, DBusGConnection* con) ++char *g_udisks_device_get_uuid(GUDisksDevice* dev) + { +- DBusGProxy* proxy = dbus_g_proxy_new_for_name(con, +- "org.freedesktop.UDisks", +- dev->obj_path, +- "org.freedesktop.UDisks.Device"); +- return proxy; ++ return dbus_prop_dup_str(dev->proxy, "IdUUID"); + } + +-const char* g_udisks_device_get_icon_name(GUDisksDevice* dev) ++char *g_udisks_device_get_label(GUDisksDevice* dev) + { +- const char* icon_name = NULL; +- if(dev->icon_name && *dev->icon_name) +- icon_name = dev->icon_name; +- else if(dev->media && *dev->media) /* by media type */ +- { +- if(dev->is_optic_disc) +- { +- if(dev->num_audio_tracks > 0) +- icon_name = "media-optical-audio"; +- else +- { +- guint i; +- icon_name = "media-optical"; +- for( i = 0; i < G_N_ELEMENTS(disc_data); ++i) +- { +- if(strcmp(dev->media, disc_data[i].disc_type) == 0) +- { +- if(dev->is_disc_blank) +- icon_name = disc_data[i].icon_name; +- break; +- } +- } +- } +- } +- else +- { +- if(strcmp (dev->media, "flash_cf") == 0) +- icon_name = "media-flash-cf"; +- else if(strcmp (dev->media, "flash_ms") == 0) +- icon_name = "media-flash-ms"; +- else if(strcmp (dev->media, "flash_sm") == 0) +- icon_name = "media-flash-sm"; +- else if(strcmp (dev->media, "flash_sd") == 0) +- icon_name = "media-flash-sd"; +- else if(strcmp (dev->media, "flash_sdhc") == 0) +- icon_name = "media-flash-sd"; +- else if(strcmp (dev->media, "flash_mmc") == 0) +- icon_name = "media-flash-sd"; +- else if(strcmp (dev->media, "floppy") == 0) +- icon_name = "media-floppy"; +- else if(strcmp (dev->media, "floppy_zip") == 0) +- icon_name = "media-floppy-zip"; +- else if(strcmp (dev->media, "floppy_jaz") == 0) +- icon_name = "media-floppy-jaz"; +- else if(g_str_has_prefix (dev->media, "flash")) +- icon_name = "media-flash"; +- } +- } +- else if(dev->conn_iface && *dev->conn_iface) /* by connection interface */ +- { +- if(g_str_has_prefix(dev->conn_iface, "ata")) +- icon_name = dev->is_removable ? "drive-removable-media-ata" : "drive-harddisk-ata"; +- else if(g_str_has_prefix (dev->conn_iface, "scsi")) +- icon_name = dev->is_removable ? "drive-removable-media-scsi" : "drive-harddisk-scsi"; +- else if(strcmp (dev->conn_iface, "usb") == 0) +- icon_name = dev->is_removable ? "drive-removable-media-usb" : "drive-harddisk-usb"; +- else if (strcmp (dev->conn_iface, "firewire") == 0) +- icon_name = dev->is_removable ? "drive-removable-media-ieee1394" : "drive-harddisk-ieee1394"; +- } ++ return dbus_prop_dup_str(dev->proxy, "IdLabel"); ++} + +- if(!icon_name) +- { +- if(dev->is_removable) +- icon_name = "drive-removable-media"; +- else +- icon_name = "drive-harddisk"; +- } +- return icon_name; ++char *g_udisks_device_get_dev_file(GUDisksDevice* dev) ++{ ++ return dbus_prop_dup_str(dev->proxy, "Device"); + } + +-const char* g_udisks_device_get_disc_name(GUDisksDevice* dev) ++char *g_udisks_device_get_dev_basename(GUDisksDevice* dev) + { +- const char* name = NULL; +- if(!dev->is_optic_disc) +- return NULL; +- if(dev->media && *dev->media) +- { +- if(dev->num_audio_tracks > 0 && g_str_has_prefix(dev->media, "optical_cd")) +- name = "Audio CD"; +- else +- { +- guint i; +- for( i = 0; i < G_N_ELEMENTS(disc_data); ++i) +- { +- if(strcmp(dev->media, disc_data[i].disc_type) == 0) +- { +- if(dev->is_disc_blank) +- name = disc_data[i].ui_name_blank; +- else +- name = disc_data[i].ui_name; +- break; +- } +- } +- } +- } ++ GVariant *var = g_dbus_proxy_get_cached_property(dev->proxy, "PreferredDevice"); ++ char *basename; + +- if(!name) ++ if (!var) ++ var = g_dbus_proxy_get_cached_property(dev->proxy, "Device"); ++ if (var) + { +- if(dev->is_disc_blank) +- name = _("Blank Optical Disc"); +- else +- name = _("Optical Disc"); ++ basename = g_path_get_basename(g_variant_get_bytestring(var)); ++ g_variant_unref(var); + } +- return name; ++ else ++ basename = g_path_get_basename(dev->obj_path); ++ ++ return basename; + } + +-gboolean g_udisks_device_is_volume(GUDisksDevice* dev) ++char *g_udisks_device_get_icon_name(GUDisksDevice* dev) + { +- /* also treat blank optical discs as volumes here to be compatible with gvfs. +- * FIXME: this is useless unless we support burn:/// +- * So, should we support this? Personally I think it's a bad idea. */ +- return (g_strcmp0(dev->usage, "filesystem") == 0 || dev->is_disc_blank); ++ // FIXME: check for HintSymbolicIconName if it's not blank ++ return dbus_prop_dup_str(dev->proxy, "HintIconName"); + } + ++gboolean g_udisks_device_can_auto_mount(GUDisksDevice* dev) ++{ ++ return dbus_prop_bool(dev->proxy, "HintAuto"); ++} ++ ++char **g_udisks_device_get_mount_paths(GUDisksDevice* dev) ++{ ++ return dev->fsproxy ? dbus_prop_dup_strv(dev->fsproxy, "MountPoints") : NULL; ++} ++ ++const char *g_udisks_device_get_obj_path(GUDisksDevice* dev) ++{ ++ return dev->obj_path; ++} ++ ++GDBusProxy *g_udisks_device_get_fs_proxy(GUDisksDevice* dev) ++{ ++ return dev->fsproxy ? g_object_ref(dev->fsproxy) : NULL; ++} +diff --git a/src/udisks/g-udisks-device.h b/src/udisks/g-udisks-device.h +index d5f736a1..b58887ce 100644 +--- a/src/udisks/g-udisks-device.h ++++ b/src/udisks/g-udisks-device.h +@@ -1,6 +1,7 @@ + // g-udisks-device.h + // + // Copyright 2010 Hong Jen Yee (PCMan) ++// Copyright 2021 Andriy Grytsenko (LStranger) + // + // This program is free software; you can redistribute it and/or modify + // it under the terms of the GNU General Public License as published by +@@ -22,7 +23,7 @@ + #define __G_UDISKS_DEVICE_H__ + + #include +-#include ++#include + + G_BEGIN_DECLS + +@@ -41,77 +42,23 @@ G_BEGIN_DECLS + + typedef struct _GUDisksDevice GUDisksDevice; + typedef struct _GUDisksDeviceClass GUDisksDeviceClass; +-typedef struct _GUDisksDevicePrivate GUDisksDevicePrivate; +- +-struct _GUDisksDevice +-{ +- GObject parent; +- char* obj_path; /* dbus object path */ +- +- char* dev_file; +- char* dev_file_presentation; +- gboolean is_sys_internal : 1; +- gboolean is_removable : 1; +- gboolean is_read_only : 1; +- gboolean is_drive : 1; +- gboolean is_optic_disc : 1; +- gboolean is_mounted : 1; +- gboolean is_media_available : 1; +- gboolean is_media_change_notification_polling : 1; +- gboolean is_luks : 1; +- gboolean is_luks_clear_text : 1; +- gboolean is_linux_md_component : 1; +- gboolean is_linux_md : 1; +- gboolean is_linux_lvm2lv : 1; +- gboolean is_linux_lvm2pv : 1; +- gboolean is_linux_dmmp_component : 1; +- gboolean is_linux_dmmp : 1; +- gboolean is_ejectable : 1; +- gboolean is_disc_blank : 1; +- gboolean is_hidden : 1; +- gboolean auto_mount : 1; +- +- guint mounted_by_uid; +- char** mount_paths; +- guint64 dev_size; +- guint64 partition_size; +- +- guint num_audio_tracks; +- guint luks_unlocked_by_uid; +- +- char* name; +- char* icon_name; +- +- char* usage; +- char* type; +- char* uuid; +- char* label; +- char* vender; +- char* model; +- char* conn_iface; +- char* media; +- char* partition_slave; +-}; +- +-struct _GUDisksDeviceClass +-{ +- GObjectClass parent_class; +-}; + + + GType g_udisks_device_get_type (void); +-GUDisksDevice* g_udisks_device_new (const char* obj_path, GHashTable* props); +- +-void g_udisks_device_update(GUDisksDevice* dev, GHashTable* props); +- +-DBusGProxy* g_udisks_device_get_proxy(GUDisksDevice* dev, DBusGConnection* con); +- +-const char* g_udisks_device_get_icon_name(GUDisksDevice* dev); +- +-/* this is only valid if the device contains a optic disc */ +-const char* g_udisks_device_get_disc_name(GUDisksDevice* dev); + +-gboolean g_udisks_device_is_volume(GUDisksDevice* dev); ++GUDisksDevice* g_udisks_device_get(const char* obj_path, GDBusConnection* con, ++ GCancellable* cancellable, GError** error); ++ ++GVariant *g_udisks_device_get_fstype(GUDisksDevice* dev); ++char *g_udisks_device_get_uuid(GUDisksDevice* dev); ++char *g_udisks_device_get_label(GUDisksDevice* dev); ++char *g_udisks_device_get_dev_file(GUDisksDevice* dev); ++char *g_udisks_device_get_dev_basename(GUDisksDevice* dev); ++char *g_udisks_device_get_icon_name(GUDisksDevice* dev); ++char **g_udisks_device_get_mount_paths(GUDisksDevice* dev); ++gboolean g_udisks_device_can_auto_mount(GUDisksDevice* dev); ++const char *g_udisks_device_get_obj_path(GUDisksDevice* dev); ++GDBusProxy *g_udisks_device_get_fs_proxy(GUDisksDevice* dev); + + G_END_DECLS + +diff --git a/src/udisks/g-udisks-drive.c b/src/udisks/g-udisks-drive.c +index 7633ae27..ff638738 100644 +--- a/src/udisks/g-udisks-drive.c ++++ b/src/udisks/g-udisks-drive.c +@@ -1,6 +1,7 @@ + // g-udisks-drive.c + // + // Copyright 2010 Hong Jen Yee (PCMan) ++// Copyright 2021 Andriy Grytsenko (LStranger) + // + // This program is free software; you can redistribute it and/or modify + // it under the terms of the GNU General Public License as published by +@@ -22,12 +23,93 @@ + #endif + + #include "g-udisks-drive.h" +-#include "g-udisks-device.h" + #include "g-udisks-volume.h" +-#include +-#include "udisks-device.h" + #include "dbus-utils.h" + ++#include ++#include ++ ++/* This array is taken from gnome-disk-utility: gdu-volume.c ++ * Copyright (C) 2007 David Zeuthen, licensed under GNU LGPL ++ */ ++static const struct ++{ ++ const char *disc_type; ++ const char *icon_name; ++ const char *ui_name; ++ const char *ui_name_blank; ++} disc_data[] = { ++ /* Translator: The word "blank" is used as an adjective, e.g. we are decsribing discs that are already blank */ ++ {"optical_cd", "media-optical-cd-rom", N_("CD-ROM Disc"), N_("Blank CD-ROM Disc")}, ++ {"optical_cd_r", "media-optical-cd-r", N_("CD-R Disc"), N_("Blank CD-R Disc")}, ++ {"optical_cd_rw", "media-optical-cd-rw", N_("CD-RW Disc"), N_("Blank CD-RW Disc")}, ++ {"optical_dvd", "media-optical-dvd-rom", N_("DVD-ROM Disc"), N_("Blank DVD-ROM Disc")}, ++ {"optical_dvd_r", "media-optical-dvd-r", N_("DVD-ROM Disc"), N_("Blank DVD-ROM Disc")}, ++ {"optical_dvd_rw", "media-optical-dvd-rw", N_("DVD-RW Disc"), N_("Blank DVD-RW Disc")}, ++ {"optical_dvd_ram", "media-optical-dvd-ram", N_("DVD-RAM Disc"), N_("Blank DVD-RAM Disc")}, ++ {"optical_dvd_plus_r", "media-optical-dvd-r-plus", N_("DVD+R Disc"), N_("Blank DVD+R Disc")}, ++ {"optical_dvd_plus_rw", "media-optical-dvd-rw-plus", N_("DVD+RW Disc"), N_("Blank DVD+RW Disc")}, ++ {"optical_dvd_plus_r_dl", "media-optical-dvd-dl-r-plus", N_("DVD+R DL Disc"), N_("Blank DVD+R DL Disc")}, ++ {"optical_dvd_plus_rw_dl", "media-optical-dvd-dl-r-plus", N_("DVD+RW DL Disc"), N_("Blank DVD+RW DL Disc")}, ++ {"optical_bd", "media-optical-bd-rom", N_("Blu-Ray Disc"), N_("Blank Blu-Ray Disc")}, ++ {"optical_bd_r", "media-optical-bd-r", N_("Blu-Ray R Disc"), N_("Blank Blu-Ray R Disc")}, ++ {"optical_bd_re", "media-optical-bd-re", N_("Blu-Ray RW Disc"), N_("Blank Blu-Ray RW Disc")}, ++ {"optical_hddvd", "media-optical-hddvd-rom", N_("HD DVD Disc"), N_("Blank HD DVD Disc")}, ++ {"optical_hddvd_r", "media-optical-hddvd-r", N_("HD DVD-R Disc"), N_("Blank HD DVD-R Disc")}, ++ {"optical_hddvd_rw", "media-optical-hddvd-rw", N_("HD DVD-RW Disc"), N_("Blank HD DVD-RW Disc")}, ++ {"optical_mo", "media-optical-mo", N_("MO Disc"), N_("Blank MO Disc")}, ++ {"optical_mrw", "media-optical-mrw", N_("MRW Disc"), N_("Blank MRW Disc")}, ++ {"optical_mrw_w", "media-optical-mrw-w", N_("MRW/W Disc"), N_("Blank MRW/W Disc")}, ++ {NULL, NULL, NULL, NULL} ++}; ++ ++struct _GUDisksDrive ++{ ++ GObject parent; ++ char* obj_path; /* dbus object path */ ++ GUDisksDevice* dev; ++ GList* vols; /* weak_ref */ ++ GIcon* icon; ++ gboolean is_removable : 1; ++ gboolean is_optic_disc : 1; ++ gboolean is_media_available : 1; ++ gboolean is_media_change_notification_polling : 1; ++ gboolean is_ejectable : 1; ++ gboolean is_disc_blank : 1; ++ guint num_audio_tracks; ++ //char* vender; ++ //char* model; ++ char* conn_iface; ++ char* media; ++ GDBusProxy *proxy; /* dbus proxy */ ++}; ++ ++static void g_udisks_clear_props(GUDisksDrive* drv) ++{ ++ //g_free(drv->vender); ++ //g_free(drv->model); ++ g_free(drv->conn_iface); ++ g_free(drv->media); ++ if(drv->icon) ++ g_object_unref(drv->icon); ++ drv->icon = NULL; ++} ++ ++static void g_udisks_fill_props(GUDisksDrive* drv) ++{ ++ drv->conn_iface = dbus_prop_dup_str(drv->proxy, "ConnectionBus"); ++ drv->is_removable = dbus_prop_bool(drv->proxy, "MediaRemovable"); ++ drv->is_optic_disc = dbus_prop_bool(drv->proxy, "Optical"); ++ drv->is_media_available = dbus_prop_bool(drv->proxy, "MediaAvailable"); ++ drv->is_media_change_notification_polling = dbus_prop_bool(drv->proxy, "MediaChangeDetected"); ++ drv->is_ejectable = dbus_prop_bool(drv->proxy, "Ejectable"); ++ drv->is_disc_blank = dbus_prop_bool(drv->proxy, "OpticalBlank"); ++ drv->num_audio_tracks = dbus_prop_uint(drv->proxy, "OpticalNumAudioTracks"); ++ //drv->vender = dbus_prop_dup_str(drv->proxy, "Vendor"); ++ //drv->model = dbus_prop_dup_str(drv->proxy, "Model"); ++ drv->media = dbus_prop_dup_str(drv->proxy, "Media"); ++} ++ + typedef struct + { + GUDisksDrive* drv; +@@ -36,8 +118,6 @@ typedef struct + GMountOperation* op; + GCancellable* cancellable; + gpointer user_data; +- DBusGProxy* proxy; +- DBusGProxyCall* call; + GList* mounts; + }EjectData; + +@@ -66,13 +146,13 @@ static void g_udisks_drive_class_init(GUDisksDriveClass *klass) + static gboolean g_udisks_drive_can_eject (GDrive* base) + { + GUDisksDrive* drv = G_UDISKS_DRIVE(base); +- return drv->dev->is_ejectable; ++ return drv->is_ejectable; + } + + static gboolean g_udisks_drive_can_poll_for_media (GDrive* base) + { + GUDisksDrive* drv = G_UDISKS_DRIVE(base); +- return drv->dev->is_media_change_notification_polling; ++ return drv->is_media_change_notification_polling; + } + + static gboolean g_udisks_drive_can_start (GDrive* base) +@@ -98,48 +178,44 @@ static gboolean g_udisks_drive_can_stop (GDrive* base) + + static GList* g_udisks_drive_get_volumes (GDrive* base) + { +- /* FIXME: is it a better idea to save all volumes in GUDisksDrive instead? */ + GUDisksDrive* drv = G_UDISKS_DRIVE(base); +- GList* vols = g_volume_monitor_get_volumes(G_VOLUME_MONITOR(drv->mon)); +- GList* l; +- GList* ret = NULL; +- for(l = vols;l;l=l->next) +- { +- GUDisksVolume* vol = G_UDISKS_VOLUME(l->data); +- if(vol->drive == drv) +- ret = g_list_prepend(ret, vol); +- else +- g_object_unref(vol); +- } +- g_list_free(vols); +- return ret; ++ GList* vols = g_list_copy(drv->vols); ++ g_list_foreach(vols, (GFunc)g_object_ref, NULL); ++ return vols; + } + +-static void on_eject_cancelled(GCancellable* cancellable, gpointer user_data); +- + static void finish_eject(GSimpleAsyncResult* res, EjectData* data) + { + g_simple_async_result_complete(res); + g_object_unref(res); + + g_object_unref(data->drv); +- if(data->cancellable) +- { +- g_signal_handlers_disconnect_by_func(data->cancellable, on_eject_cancelled, data); ++ if (data->op) ++ g_object_unref(data->op); ++ if (data->cancellable) + g_object_unref(data->cancellable); ++ while (data->mounts) ++ { ++ g_object_unref(data->mounts->data); ++ data->mounts = g_list_delete_link(data->mounts, data->mounts); + } +- if(data->proxy) +- g_object_unref(data->proxy); ++ + g_slice_free(EjectData, data); + } + +-static void on_ejected(DBusGProxy *proxy, GError *error, gpointer user_data) ++static void on_ejected(GObject *source_object, GAsyncResult *result, gpointer user_data) + { + EjectData* data = (EjectData*)user_data; +- GSimpleAsyncResult* res; +- if(error) ++ GDBusProxy *proxy = (GDBusProxy *)source_object; ++ GError *err = NULL; ++ GSimpleAsyncResult *res; ++ GVariant *val = g_dbus_proxy_call_finish(proxy, result, &err); ++ ++ if(err) + { +- error = g_udisks_error_to_gio_error(error); ++ //TODO: use data->op to handle errors? ++ GError *error = g_udisks_error_to_gio_error(err); ++ g_error_free(err); + res = g_simple_async_result_new_from_error(G_OBJECT(data->drv), + data->callback, + data->user_data, +@@ -152,19 +228,22 @@ static void on_ejected(DBusGProxy *proxy, GError *error, gpointer user_data) + data->callback, + data->user_data, + NULL); +- g_simple_async_result_set_op_res_gboolean(res, TRUE); ++ g_simple_async_result_set_op_res_gboolean(res, TRUE); // FIXME ++ if (val) ++ g_variant_unref(val); + } + finish_eject(res, data); + } + + static void do_eject(EjectData* data) + { +- data->proxy = g_udisks_device_get_proxy(data->drv->dev, data->drv->mon->con); +- data->call = org_freedesktop_UDisks_Device_drive_eject_async( +- data->proxy, +- NULL, +- on_ejected, +- data); ++ GVariantBuilder b; ++ g_debug("%s: sending DBus request", __func__); ++ g_variant_builder_init(&b, G_VARIANT_TYPE("(a{sv})")); ++ g_variant_builder_open(&b, G_VARIANT_TYPE ("a{sv}")); ++ g_variant_builder_close(&b); ++ g_dbus_proxy_call(data->drv->proxy, "Eject", g_variant_builder_end(&b), ++ G_DBUS_CALL_FLAGS_NONE, -1, data->cancellable, on_ejected, data); + } + + static void unmount_before_eject(EjectData* data); +@@ -178,6 +257,9 @@ static void on_unmounted(GObject* mnt, GAsyncResult* res, gpointer input_data) + gboolean success = g_mount_unmount_with_operation_finish(G_MOUNT(mnt), res, &err); + if(success) + { ++ /* we did picked first one from list */ ++ data->mounts = g_list_delete_link(data->mounts, data->mounts); ++ g_object_unref(mnt); + if(data->mounts) /* we still have some volumes on this drive mounted */ + unmount_before_eject(data); + else /* all unmounted, do the eject. */ +@@ -186,14 +268,12 @@ static void on_unmounted(GObject* mnt, GAsyncResult* res, gpointer input_data) + else + { + GSimpleAsyncResult* res; +- GError* error = g_udisks_error_to_gio_error(err); +- g_error_free(err); + res = g_simple_async_result_new_from_error(G_OBJECT(data->drv), + data->callback, + data->user_data, + err); + finish_eject(res, data); +- g_error_free(error); ++ g_error_free(err); + } + #undef data + } +@@ -201,21 +281,10 @@ static void on_unmounted(GObject* mnt, GAsyncResult* res, gpointer input_data) + static void unmount_before_eject(EjectData* data) + { + GMount* mnt = G_MOUNT(data->mounts->data); +- data->mounts = g_list_delete_link(data->mounts, data->mounts); + /* pop the first GMount in the list. */ + g_mount_unmount_with_operation(mnt, data->flags, data->op, + data->cancellable, + on_unmounted, data); +- /* FIXME: Notify volume monitor!! */ +- g_object_unref(mnt); +-} +- +-static void on_eject_cancelled(GCancellable* cancellable, gpointer user_data) +-{ +- EjectData* data = (EjectData*)user_data; +- /* cancel the dbus call if needed */ +- if(data->call) +- dbus_g_proxy_cancel_call(data->proxy, data->call); + } + + static void g_udisks_drive_eject_with_operation (GDrive* base, GMountUnmountFlags flags, GMountOperation* mount_operation, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) +@@ -231,13 +300,12 @@ static void g_udisks_drive_eject_with_operation (GDrive* base, GMountUnmountFlag + GList* l; + for(l = vols; l; l=l->next) + { +- GVolume* vol = G_VOLUME(l->data); +- GMount* mnt = g_volume_get_mount(vol); +- if(mnt) +- mounts = g_list_prepend(mounts, mnt); ++ GUDisksVolume* vol = G_UDISKS_VOLUME(l->data); ++ mounts = g_list_concat(g_udisks_volume_get_mounts(vol), mounts); + g_object_unref(vol); + } + g_list_free(vols); ++ g_list_foreach(mounts, (GFunc)g_object_ref, NULL); + } + + data = g_slice_new0(EjectData); +@@ -248,9 +316,6 @@ static void g_udisks_drive_eject_with_operation (GDrive* base, GMountUnmountFlag + data->op = mount_operation ? g_object_ref(mount_operation) : NULL; + data->user_data = user_data; + +- if(cancellable) +- g_signal_connect(cancellable, "cancelled", G_CALLBACK(on_eject_cancelled), data); +- + if(mounts) /* unmount all GMounts first, and do eject in ready callback */ + { + /* NOTE: is this really needed? +@@ -294,13 +359,128 @@ static char** g_udisks_drive_enumerate_identifiers (GDrive* base) + return kinds; + } + ++const char* g_udisks_drive_get_obj_path(GUDisksDrive* drv) ++{ ++ return drv->obj_path; ++} ++ ++static const char* g_udisks_drive_get_icon_name(GUDisksDrive* drv) ++{ ++ const char* icon_name = NULL; ++ ++ if(drv->media && *drv->media) /* by media type */ ++ { ++ if(drv->is_optic_disc) ++ { ++ if(drv->num_audio_tracks > 0) ++ icon_name = "media-optical-audio"; ++ else ++ { ++ guint i; ++ icon_name = "media-optical"; ++ for( i = 0; i < G_N_ELEMENTS(disc_data); ++i) ++ { ++ if(strcmp(drv->media, disc_data[i].disc_type) == 0) ++ { ++ if(drv->is_disc_blank) ++ icon_name = disc_data[i].icon_name; ++ break; ++ } ++ } ++ } ++ } ++ else ++ { ++ if(strcmp (drv->media, "flash_cf") == 0) ++ icon_name = "media-flash-cf"; ++ else if(strcmp (drv->media, "flash_ms") == 0) ++ icon_name = "media-flash-ms"; ++ else if(strcmp (drv->media, "flash_sm") == 0) ++ icon_name = "media-flash-sm"; ++ else if(g_str_has_prefix (drv->media, "flash_sd")) ++ icon_name = "media-flash-sd"; ++ else if(strcmp (drv->media, "flash_mmc") == 0) ++ icon_name = "media-flash-sd"; ++ else if(strcmp (drv->media, "floppy") == 0) ++ icon_name = "media-floppy"; ++ else if(strcmp (drv->media, "floppy_zip") == 0) ++ icon_name = "media-floppy-zip"; ++ else if(strcmp (drv->media, "floppy_jaz") == 0) ++ icon_name = "media-floppy-jaz"; ++ else if(g_str_has_prefix (drv->media, "flash")) ++ icon_name = "media-flash"; ++ else if(strcmp (drv->media, "thumb") == 0) ++ icon_name = "drive-harddisk-usb"; ++ } ++ } ++ else if(drv->conn_iface && *drv->conn_iface) /* by connection interface */ ++ { ++/* if(g_str_has_prefix(drv->conn_iface, "ata")) ++ icon_name = drv->is_removable ? "drive-removable-media-ata" : "drive-harddisk-ata"; ++ else if(g_str_has_prefix (drv->conn_iface, "scsi")) ++ icon_name = drv->is_removable ? "drive-removable-media-scsi" : "drive-harddisk-scsi"; ++ else */ ++ if(strcmp (drv->conn_iface, "usb") == 0) ++ icon_name = drv->is_removable ? "drive-removable-media-usb" : "drive-harddisk-usb"; ++ else if (strcmp (drv->conn_iface, "ieee1394") == 0) ++ icon_name = drv->is_removable ? "drive-removable-media-ieee1394" : "drive-harddisk-ieee1394"; ++ } ++ ++ if(!icon_name) ++ { ++ if(drv->is_removable) ++ icon_name = "drive-removable-media"; ++ else ++ icon_name = "drive-harddisk"; ++ } ++ return icon_name; ++} ++ ++const char* g_udisks_drive_get_disc_name(GUDisksDrive* drv) ++{ ++ const char* name = NULL; ++ if(!drv || !drv->is_optic_disc) ++ return NULL; ++ if(drv->media && *drv->media) ++ { ++ if(drv->num_audio_tracks > 0 && g_str_has_prefix(drv->media, "optical_cd")) ++ name = _("Audio CD"); ++ else ++ { ++ guint i; ++ for( i = 0; i < G_N_ELEMENTS(disc_data); ++i) ++ { ++ if(strcmp(drv->media, disc_data[i].disc_type) == 0) ++ { ++ if(drv->is_disc_blank) ++ name = gettext(disc_data[i].ui_name_blank); ++ else ++ name = gettext(disc_data[i].ui_name); ++ break; ++ } ++ } ++ } ++ } ++ ++ if(!name) ++ { ++ if(drv->is_disc_blank) ++ name = _("Blank Optical Disc"); ++ else ++ name = _("Optical Disc"); ++ } ++ return name; ++} ++ + static GIcon* g_udisks_drive_get_icon (GDrive* base) + { + GUDisksDrive* drv = G_UDISKS_DRIVE(base); + if(!drv->icon) + { +- const char* icon_name = g_udisks_device_get_icon_name(drv->dev); ++ char* drv_icon_name = drv->dev ? g_udisks_device_get_icon_name(drv->dev) : NULL; ++ const char* icon_name = drv_icon_name ? drv_icon_name : g_udisks_drive_get_icon_name(drv); + drv->icon = g_themed_icon_new_with_default_fallbacks(icon_name); ++ g_free(drv_icon_name); + } + return (GIcon*)g_object_ref(drv->icon); + } +@@ -308,14 +488,14 @@ static GIcon* g_udisks_drive_get_icon (GDrive* base) + static char* g_udisks_drive_get_identifier (GDrive* base, const char* kind) + { + GUDisksDrive* drv = G_UDISKS_DRIVE(base); +- if(kind) ++ if(kind && drv->dev) + { + if(strcmp(kind, G_VOLUME_IDENTIFIER_KIND_LABEL) == 0) +- return g_strdup(drv->dev->label); ++ return g_udisks_device_get_label(drv->dev); + else if(strcmp(kind, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE) == 0) +- return g_strdup(drv->dev->dev_file); ++ return g_udisks_device_get_dev_file(drv->dev); + else if(strcmp(kind, G_VOLUME_IDENTIFIER_KIND_UUID) == 0) +- return g_strdup(drv->dev->uuid); ++ return g_udisks_device_get_uuid(drv->dev); + } + return NULL; + } +@@ -337,7 +517,7 @@ static GDriveStartStopType g_udisks_drive_get_start_stop_type (GDrive* base) + static gboolean g_udisks_drive_has_media (GDrive* base) + { + GUDisksDrive* drv = G_UDISKS_DRIVE(base); +- return drv->dev->is_media_available; ++ return drv->is_media_available; + } + + static gboolean g_udisks_drive_has_volumes (GDrive* base) +@@ -350,13 +530,13 @@ static gboolean g_udisks_drive_is_media_check_automatic (GDrive* base) + { + GUDisksDrive* drv = G_UDISKS_DRIVE(base); + /* FIXME: is this correct? */ +- return drv->dev->is_media_change_notification_polling; ++ return drv->is_media_change_notification_polling; + } + + static gboolean g_udisks_drive_is_media_removable (GDrive* base) + { + GUDisksDrive* drv = G_UDISKS_DRIVE(base); +- return drv->dev->is_removable; ++ return drv->is_removable; + } + + static void g_udisks_drive_poll_for_media (GDrive* base, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) +@@ -397,6 +577,17 @@ static gboolean g_udisks_drive_stop_finish (GDrive* base, GAsyncResult* res, GEr + return FALSE; + } + ++static void g_udisks_drive_changed(GDBusProxy *proxy, GVariant *changed_properties, ++ GStrv invalidated_properties, gpointer user_data) ++{ ++ g_return_if_fail(G_IS_UDISKS_DRIVE(user_data)); ++ GUDisksDrive* drv = G_UDISKS_DRIVE(user_data); ++ ++ g_udisks_clear_props(drv); ++ g_udisks_fill_props(drv); ++ g_signal_emit(drv, sig_changed, 0); ++} ++ + + void g_udisks_drive_drive_iface_init (GDriveIface * iface) + { +@@ -442,9 +633,26 @@ static void g_udisks_drive_finalize(GObject *object) + g_return_if_fail(G_IS_UDISKS_DRIVE(object)); + + self = G_UDISKS_DRIVE(object); ++ + if(self->dev) + g_object_unref(self->dev); + ++ if(self->proxy) ++ { ++ g_signal_handlers_disconnect_by_func(self->proxy, G_CALLBACK(g_udisks_drive_changed), self); ++ g_object_unref(self->proxy); ++ } ++ ++ if(self->vols) ++ { ++ g_warning("GUDisksDrive: volumes list isn't empty on exit!"); ++ g_list_free(self->vols); ++ } ++ ++ g_udisks_clear_props(self); ++ ++ g_free(self->obj_path); ++ + G_OBJECT_CLASS(g_udisks_drive_parent_class)->finalize(object); + } + +@@ -454,18 +662,51 @@ static void g_udisks_drive_init(GUDisksDrive *self) + + } + +-GUDisksDrive *g_udisks_drive_new(GUDisksVolumeMonitor* mon, GUDisksDevice* dev) ++GUDisksDrive *g_udisks_drive_new(GDBusConnection* con, const char *obj_path, ++ GCancellable* cancellable, GError** error) + { + GUDisksDrive* drv = (GUDisksDrive*)g_object_new(G_TYPE_UDISKS_DRIVE, NULL); +- drv->dev = g_object_ref(dev); +- drv->mon = mon; ++ drv->obj_path = g_strdup(obj_path); ++ drv->proxy = g_dbus_proxy_new_sync(con, G_DBUS_PROXY_FLAGS_NONE, NULL, ++ "org.freedesktop.UDisks2", obj_path, ++ "org.freedesktop.UDisks2.Drive", ++ cancellable, error); ++ if (drv->proxy) ++ { ++ g_udisks_fill_props(drv); ++ g_signal_connect(drv->proxy, "g-properties-changed", ++ G_CALLBACK(g_udisks_drive_changed), drv); ++ } + return drv; + } + ++void g_udisks_drive_set_device_path(GUDisksDrive* drv, const char* obj_path, ++ GDBusConnection* con, GCancellable* cancellable, ++ GError** error) ++{ ++ g_return_if_fail(G_IS_UDISKS_DRIVE(drv)); ++ if(drv->dev) ++ g_object_unref(drv->dev); ++ drv->dev = g_udisks_device_get(obj_path, con, cancellable, error); ++} + +-void g_udisks_drive_changed(GUDisksDrive* drv) ++void g_udisks_drive_add_volume(GUDisksDrive* drv, GUDisksVolume* vol) + { +- g_signal_emit(drv, sig_changed, 0); ++ GList *l = g_list_find(drv->vols, vol); ++ if(l) ++ g_warning("Volume is already in list on drive!"); ++ else ++ drv->vols = g_list_append(drv->vols, vol); ++} ++ ++void g_udisks_drive_del_volume(GUDisksDrive* drv, GUDisksVolume* vol) ++{ ++ drv->vols = g_list_remove(drv->vols, vol); ++} ++ ++gboolean g_udisks_drive_is_disc_blank(GUDisksDrive* drv) ++{ ++ return drv->is_disc_blank; + } + + void g_udisks_drive_disconnected(GUDisksDrive* drv) +diff --git a/src/udisks/g-udisks-drive.h b/src/udisks/g-udisks-drive.h +index 5c0c3661..341fc080 100644 +--- a/src/udisks/g-udisks-drive.h ++++ b/src/udisks/g-udisks-drive.h +@@ -1,6 +1,7 @@ + // g-udisks-drive.h + // + // Copyright 2010 Hong Jen Yee (PCMan) ++// Copyright 2021 Andriy Grytsenko (LStranger) + // + // This program is free software; you can redistribute it and/or modify + // it under the terms of the GNU General Public License as published by +@@ -22,8 +23,6 @@ + #define __G_UDISKS_DRIVE_H__ + + #include +-#include "g-udisks-device.h" +-#include "g-udisks-volume-monitor.h" + + G_BEGIN_DECLS + +@@ -43,15 +42,6 @@ G_BEGIN_DECLS + typedef struct _GUDisksDrive GUDisksDrive; + typedef struct _GUDisksDriveClass GUDisksDriveClass; + +-struct _GUDisksDrive +-{ +- GObject parent; +- GUDisksDevice* dev; +- GIcon* icon; +- char* name; +- GUDisksVolumeMonitor* mon; +-}; +- + struct _GUDisksDriveClass + { + GObjectClass parent_class; +@@ -59,11 +49,22 @@ struct _GUDisksDriveClass + + + GType g_udisks_drive_get_type(void); +-GUDisksDrive* g_udisks_drive_new(GUDisksVolumeMonitor* mon, GUDisksDevice* dev); ++GUDisksDrive* g_udisks_drive_new(GDBusConnection* con, const char *obj_path, ++ GCancellable* cancellable, GError** error); ++ ++void g_udisks_drive_set_device_path(GUDisksDrive* drv, const char* obj_path, ++ GDBusConnection* con, GCancellable* cancellable, ++ GError** error); + +-void g_udisks_drive_changed(GUDisksDrive* drv); + void g_udisks_drive_disconnected(GUDisksDrive* drv); + ++const char* g_udisks_drive_get_obj_path(GUDisksDrive* drv); ++ ++/* this is only valid if the device contains a optic disc */ ++const char* g_udisks_drive_get_disc_name(GUDisksDrive* drv); ++ ++gboolean g_udisks_drive_is_disc_blank(GUDisksDrive* drv); ++ + G_END_DECLS + + #endif /* __G_UDISKS_DRIVE_H__ */ +diff --git a/src/udisks/g-udisks-mount.c b/src/udisks/g-udisks-mount.c +index ba5cf79a..d28aed5a 100644 +--- a/src/udisks/g-udisks-mount.c ++++ b/src/udisks/g-udisks-mount.c +@@ -1,6 +1,7 @@ + // g-udisks-mount.c + // + // Copyright 2010 Hong Jen Yee (PCMan) ++// Copyright 2021 Andriy Grytsenko (LStranger) + // + // This program is free software; you can redistribute it and/or modify + // it under the terms of the GNU General Public License as published by +@@ -21,19 +22,28 @@ + #include + #endif + +-#include "g-udisks-volume.h" +-#include "udisks-device.h" +-#include "dbus-utils.h" ++#include "g-udisks-mount.h" ++ ++#include ++ ++struct _GUDisksMount ++{ ++ GObject parent; ++ GUDisksVolume* vol; /* weak */ ++ GFile* root; ++}; + + typedef struct + { + GUDisksMount* mnt; + GAsyncReadyCallback callback; ++ GMountOperation* mount_operation; + gpointer user_data; +- DBusGProxy* proxy; +- DBusGProxyCall* call; + }AsyncData; + ++static guint sig_pre_unmount; ++static guint sig_unmounted; ++ + static void g_udisks_mount_mount_iface_init(GMountIface *iface); + static void g_udisks_mount_finalize (GObject *object); + +@@ -72,24 +82,27 @@ static void g_udisks_mount_init(GUDisksMount *self) + } + + +-GUDisksMount *g_udisks_mount_new(GUDisksVolume* vol) ++GUDisksMount *g_udisks_mount_new(GUDisksVolume* vol, GFile* root) + { ++ g_return_val_if_fail(vol, NULL); ++ g_return_val_if_fail(root, NULL); + GUDisksMount* mnt = g_object_new(G_TYPE_UDISKS_MOUNT, NULL); + /* we don't do g_object_ref here to prevent circular reference. */ + mnt->vol = vol; ++ mnt->root = g_object_ref_sink(root); + return mnt; + } + + static gboolean g_udisks_mount_can_eject (GMount* base) + { + GUDisksMount* mnt = G_UDISKS_MOUNT(base); +- return mnt->vol ? mnt->vol->dev->is_ejectable : FALSE; ++ return mnt->vol ? g_volume_can_eject(G_VOLUME(mnt->vol)) : FALSE; + } + + static gboolean g_udisks_mount_can_unmount (GMount* base) + { + GUDisksMount* mnt = G_UDISKS_MOUNT(base); +- return mnt->vol ? mnt->vol->dev->is_mounted : FALSE; ++ return mnt->root != NULL; + } + + typedef struct +@@ -163,11 +176,6 @@ static char* g_udisks_mount_get_name (GMount* base) + static GFile* g_udisks_mount_get_root (GMount* base) + { + GUDisksMount* mnt = G_UDISKS_MOUNT(base); +- if(!mnt->root && mnt->vol->dev->is_mounted && mnt->vol->dev->mount_paths) +- { +- /* TODO */ +- mnt->root = g_file_new_for_path(mnt->vol->dev->mount_paths[0]); +- } + return mnt->root ? (GFile*)g_object_ref(mnt->root) : NULL; + } + +@@ -180,7 +188,7 @@ static char* g_udisks_mount_get_uuid (GMount* base) + static GVolume* g_udisks_mount_get_volume (GMount* base) + { + GUDisksMount* mnt = G_UDISKS_MOUNT(base); +- return (GVolume*)mnt->vol; ++ return (GVolume*)g_object_ref(mnt->vol); + } + + typedef struct +@@ -265,13 +273,16 @@ static gchar** g_udisks_mount_guess_content_type_sync (GMount* base, gboolean fo + /* TODO */ + //} + +-static void unmount_callback(DBusGProxy *proxy, GError *error, gpointer user_data) ++static void unmount_callback(GObject *source, GAsyncResult *result, gpointer user_data) + { ++ GDBusProxy *proxy = G_DBUS_PROXY(source); + AsyncData* data = (AsyncData*)user_data; + GSimpleAsyncResult* res; ++ GError *error = NULL; ++ GVariant *val = g_dbus_proxy_call_finish(proxy, result, &error); + if(error) + { +- error = g_udisks_error_to_gio_error(error); ++ // FIXME: use data->mount_operation to decide what to do + res = g_simple_async_result_new_from_error(G_OBJECT(data->mnt), + data->callback, + data->user_data, +@@ -285,42 +296,57 @@ static void unmount_callback(DBusGProxy *proxy, GError *error, gpointer user_dat + data->user_data, + NULL); + g_simple_async_result_set_op_res_gboolean(res, TRUE); ++ if (val) g_variant_unref(val); + } + g_simple_async_result_complete(res); + g_object_unref(res); + + g_object_unref(data->mnt); +- g_object_unref(data->proxy); ++ if(data->mount_operation) ++ g_object_unref(data->mount_operation); + g_slice_free(AsyncData, data); + } + +-static void on_unmount_cancelled(GCancellable* cancellable, gpointer user_data) +-{ +- AsyncData* data = (AsyncData*)user_data; +- dbus_g_proxy_cancel_call(data->proxy, data->call); +-} +- + static void g_udisks_mount_unmount_with_operation (GMount* base, GMountUnmountFlags flags, GMountOperation* mount_operation, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) + { + GUDisksMount* mnt = G_UDISKS_MOUNT(base); + if(mnt->vol) + { +- GUDisksDevice* dev = mnt->vol->dev; +- GUDisksVolumeMonitor* mon = mnt->vol->mon; +- AsyncData* data = g_slice_new(AsyncData); +- DBusGProxy* proxy = g_udisks_device_get_proxy(dev, mon->con); +- data->mnt = g_object_ref(mnt); +- data->callback = callback; +- data->user_data = user_data; +- data->proxy = proxy; +- +- g_signal_emit_by_name(mon, "mount-pre-unmount", mnt); +- g_signal_emit_by_name(mnt, "pre-unmount"); +- +- data->call = org_freedesktop_UDisks_Device_filesystem_unmount_async( +- proxy, NULL, unmount_callback, data); +- if(cancellable) +- g_signal_connect(cancellable, "cancelled", G_CALLBACK(on_unmount_cancelled), data); ++ GUDisksDevice* dev = g_udisks_volume_get_device(mnt->vol); ++ GDBusProxy* proxy = dev ? g_udisks_device_get_fs_proxy(dev) : NULL; ++ if(proxy) ++ { ++ AsyncData* data = g_slice_new(AsyncData); ++ GVariantBuilder b; ++ data->mnt = g_object_ref(mnt); ++ data->callback = callback; ++ data->user_data = user_data; ++ data->mount_operation = mount_operation ? g_object_ref(mount_operation) : NULL; ++ ++ g_debug("send DBus request to unmount %s", g_udisks_device_get_obj_path(dev)); ++ g_signal_emit(mnt, sig_pre_unmount, 0); ++ ++ g_variant_builder_init(&b, G_VARIANT_TYPE("(a{sv})")); ++ g_variant_builder_open(&b, G_VARIANT_TYPE ("a{sv}")); ++ g_variant_builder_close(&b); ++ g_dbus_proxy_call(proxy, "Unmount", g_variant_builder_end(&b), ++ G_DBUS_CALL_FLAGS_NONE, -1, cancellable, ++ unmount_callback, data); ++ g_object_unref(proxy); ++ } ++ else ++ { ++ GSimpleAsyncResult* res; ++ char *dev_file = dev ? g_udisks_device_get_dev_file(dev) : NULL; ++ ++ res = g_simple_async_result_new_error(G_OBJECT(mnt), callback, user_data, ++ G_IO_ERROR, G_IO_ERROR_FAILED, ++ _("No filesystem proxy for '%s'"), ++ dev_file); ++ g_simple_async_result_complete(res); ++ g_object_unref(res); ++ g_free(dev_file); ++ } + } + } + +@@ -362,4 +388,13 @@ void g_udisks_mount_mount_iface_init(GMountIface *iface) + iface->guess_content_type = g_udisks_mount_guess_content_type; + iface->guess_content_type_finish = g_udisks_mount_guess_content_type_finish; + iface->guess_content_type_sync = g_udisks_mount_guess_content_type_sync; ++ ++ sig_pre_unmount = g_signal_lookup("pre-unmount", G_TYPE_MOUNT); ++ sig_unmounted = g_signal_lookup("unmounted", G_TYPE_MOUNT); ++} ++ ++void g_udisks_mount_unmounted(GUDisksMount* mnt) ++{ ++ g_signal_emit(mnt, sig_unmounted, 0); ++ mnt->vol = NULL; /* disowned by the volume now */ + } +diff --git a/src/udisks/g-udisks-mount.h b/src/udisks/g-udisks-mount.h +index 09ea443b..ee2a13d6 100644 +--- a/src/udisks/g-udisks-mount.h ++++ b/src/udisks/g-udisks-mount.h +@@ -1,6 +1,7 @@ + // g-udisks-mount.h + // + // Copyright 2010 Hong Jen Yee (PCMan) ++// Copyright 2021 Andriy Grytsenko (LStranger) + // + // This program is free software; you can redistribute it and/or modify + // it under the terms of the GNU General Public License as published by +@@ -22,6 +23,7 @@ + #define __G_UDISKS_MOUNT_H__ + + #include ++#include "g-udisks-volume.h" + + G_BEGIN_DECLS + +@@ -40,14 +42,6 @@ G_BEGIN_DECLS + + typedef struct _GUDisksMount GUDisksMount; + typedef struct _GUDisksMountClass GUDisksMountClass; +-typedef struct _GUDisksMountPrivate GUDisksMountPrivate; +- +-struct _GUDisksMount +-{ +- GObject parent; +- struct _GUDisksVolume* vol; +- GFile* root; +-}; + + struct _GUDisksMountClass + { +@@ -56,8 +50,9 @@ struct _GUDisksMountClass + + + GType g_udisks_mount_get_type(void); +-GUDisksMount* g_udisks_mount_new(struct _GUDisksVolume* vol); ++GUDisksMount* g_udisks_mount_new(GUDisksVolume* vol, GFile *path); + ++void g_udisks_mount_unmounted(GUDisksMount* mnt); + + G_END_DECLS + +diff --git a/src/udisks/g-udisks-volume-monitor.c b/src/udisks/g-udisks-volume-monitor.c +index 0c2975ef..df9df294 100644 +--- a/src/udisks/g-udisks-volume-monitor.c ++++ b/src/udisks/g-udisks-volume-monitor.c +@@ -2,6 +2,7 @@ + * g-udisks-volume-monitor.c + * + * Copyright 2010 PCMan ++ * Copyright 2021 Andriy Grytsenko (LStranger) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -23,41 +24,53 @@ + #include + #endif + +-#include "dbus-utils.h" +-#include "udisks.h" +- + #include "g-udisks-volume-monitor.h" +-#include "g-udisks-device.h" + #include "g-udisks-drive.h" +-#include "g-udisks-volume.h" ++#include "g-udisks-mount.h" ++ ++#include + + /* FIXME: later we need to remove this when gio-udisks becomes an + * independent gio module. */ + #include "fm-config.h" + ++/* ++ * Relations: ++ * Monitor => Volume => Device ++ * => Mount[] ++ * <= (weak) ++ * => Drive ++ * => Drive => (man)Volume[] ++ * => Device(*) ++ */ ++ ++struct _GUDisksVolumeMonitor ++{ ++ GNativeVolumeMonitor parent; ++ GDBusConnection* con; ++ GDBusProxy* udisks_proxy; ++ GCancellable *cancellable; ++ ++ GList* volumes; ++ GList* drives; ++}; ++ + static guint sig_drive_changed; + static guint sig_drive_connected; + static guint sig_drive_disconnected; + static guint sig_drive_eject_button; ++static guint sig_drive_stop_button; + static guint sig_mount_added; + static guint sig_mount_changed; +-static guint sig_mount_premount; ++static guint sig_mount_preunmount; + static guint sig_mount_removed; + static guint sig_volume_added; + static guint sig_volume_changed; + static guint sig_volume_removed; + +-static void g_udisks_device_added(GUDisksDevice* dev, GUDisksVolumeMonitor* mon); +-static void g_udisks_device_changed(GUDisksDevice* dev, GUDisksVolumeMonitor* mon); +-static void g_udisks_device_removed(GUDisksDevice* dev, GUDisksVolumeMonitor* mon); +- +-typedef void (*GUDisksDeviceEventHandler)(GUDisksDevice*, GUDisksVolumeMonitor*); +- +-typedef struct +-{ +- GUDisksDevice* dev; +- GUDisksDeviceEventHandler func; +-}QueuedEvent; ++static GUDisksDrive *add_drive(GUDisksVolumeMonitor* mon, const char *obj_path, ++ gboolean emit_signal); ++static void remove_drive(GUDisksVolumeMonitor* mon, const char* obj_path); + + static void g_udisks_volume_monitor_finalize (GObject *object); + static GMount* get_mount_for_mount_path(const char *mount_path, GCancellable *cancellable); +@@ -70,31 +83,112 @@ static GVolume *get_volume_for_uuid(GVolumeMonitor *mon, const char *uuid); + static GMount *get_mount_for_uuid(GVolumeMonitor *mon, const char *uuid); + static void drive_eject_button(GVolumeMonitor *mon, GDrive *drive); + +-static void add_device(GUDisksVolumeMonitor* mon, DBusGProxy* proxy, const char* obj_path, gboolean emit_signal); +-static void on_device_added(DBusGProxy* proxy, const char* obj_path, gpointer user_data); +-static void on_device_removed(DBusGProxy* proxy, const char* obj_path, gpointer user_data); +-static void on_device_changed(DBusGProxy* proxy, const char* obj_path, gpointer user_data); ++static GUDisksVolume* add_volume(GUDisksVolumeMonitor* mon, const char* obj_path, ++ GUDisksDrive* drv, gboolean emit_signal); ++static void remove_volume(GUDisksVolumeMonitor* mon, const char* obj_path); ++ ++static void on_volume_changed(GUDisksVolume* vol, GUDisksVolumeMonitor* mon); ++static void on_mount_preunmount(GUDisksMount* mnt, GUDisksVolumeMonitor* mon); ++static void on_mount_removed(GUDisksMount* mnt, GUDisksVolumeMonitor* mon); ++static void on_drive_changed(GUDisksDrive* drv, GUDisksVolumeMonitor* mon); + +-static GList* find_device_l(GUDisksVolumeMonitor* mon, const char* obj_path); +-static GList* find_drive_l(GUDisksVolumeMonitor* mon, GUDisksDevice* dev); +-static GList* find_volume_l(GUDisksVolumeMonitor* mon, GUDisksDevice* dev); ++static GList* find_volume_l(GUDisksVolumeMonitor* mon, const char* obj_path); ++static GList* find_drive_l(GUDisksVolumeMonitor* mon, const char* obj_path); + +-static inline GUDisksDevice* find_device(GUDisksVolumeMonitor* mon, const char* obj_path) ++static inline GUDisksVolume* find_volume(GUDisksVolumeMonitor* mon, const char* obj_path) + { +- GList* l = find_device_l(mon, obj_path); +- return l ? G_UDISKS_DEVICE(l->data) : NULL; ++ GList* l = find_volume_l(mon, obj_path); ++ return l ? G_UDISKS_VOLUME(l->data) : NULL; + } + +-static inline GUDisksDrive* find_drive(GUDisksVolumeMonitor* mon, GUDisksDevice* dev) ++static inline GUDisksDrive* find_drive(GUDisksVolumeMonitor* mon, const char* obj_path) + { +- GList* l = find_drive_l(mon, dev); ++ GList* l = find_drive_l(mon, obj_path); + return l ? G_UDISKS_DRIVE(l->data) : NULL; + } + +-static inline GUDisksVolume* find_volume(GUDisksVolumeMonitor* mon, GUDisksDevice* dev) ++/* callback when new device or drive added or removed */ ++static void on_g_signal(GDBusProxy *proxy, char *sender_name, char *signal_name, ++ GVariant *parameters, gpointer user_data) + { +- GList* l = find_volume_l(mon, dev); +- return l ? G_UDISKS_VOLUME(l->data) : NULL; ++ GUDisksVolumeMonitor* mon = G_UDISKS_VOLUME_MONITOR(user_data); ++ ++ if (!g_variant_is_container(parameters) || g_variant_n_children(parameters) < 2) ++ { ++ // error, should be either '(oas)' or '(oa{sa{sv}})' ++ return; ++ } ++ ++ GVariant *target = g_variant_get_child_value(parameters, 0); ++ GVariant *ifaces = g_variant_get_child_value(parameters, 1); ++ ++ if (!g_variant_is_container(ifaces) || !g_variant_is_of_type(target, G_VARIANT_TYPE_OBJECT_PATH)) ++ { ++ // should never happen ++ } ++ else if (strcmp(signal_name, "InterfacesAdded") == 0) ++ { ++ const char* obj_path = g_variant_get_string(target, NULL); ++ GVariant *test = g_variant_lookup_value(ifaces, ++ "org.freedesktop.UDisks2.Drive", NULL); ++ if (test) ++ { ++ /* appears to be a drive itself */ ++ add_drive(mon, obj_path, TRUE); ++ g_variant_unref(test); ++ } ++ else if ((test = g_variant_lookup_value(ifaces, ++ "org.freedesktop.UDisks2.Block", NULL))) ++ { ++ GVariant* drv_obj_var = g_variant_lookup_value(test, "Drive", NULL); ++ GUDisksDrive *drv = find_drive(mon, g_variant_get_string(drv_obj_var, NULL)); ++ g_variant_unref(test); ++ test = g_variant_lookup_value(ifaces, ++ "org.freedesktop.UDisks2.PartitionTable", NULL); ++ if (test) ++ { ++ /* it's a drive, search for it and set this device for it */ ++ g_variant_unref(test); ++ if (drv) ++ { ++ g_udisks_drive_set_device_path(drv, obj_path, mon->con, ++ mon->cancellable, NULL); ++ /* FIXME: this is useless unless we support burn:/// */ ++ if (g_udisks_drive_is_disc_blank(drv)) ++ add_volume(mon, obj_path, drv, TRUE); ++ } ++ } ++ test = g_variant_lookup_value(ifaces, ++ "org.freedesktop.UDisks2.Filesystem", NULL); ++ if (test) ++ { ++ /* it's a volume, just add it, it will update itself */ ++ g_variant_unref(test); ++ add_volume(mon, obj_path, drv, TRUE); ++ } ++ g_variant_unref(drv_obj_var); ++ } ++ } ++ else if (strcmp(signal_name, "InterfacesRemoved") == 0) ++ { ++ GVariantIter iter; ++ char *val; ++ g_variant_iter_init(&iter, ifaces); ++ while (g_variant_iter_next(&iter, "s", &val)) ++ { ++ if (strcmp(val, "org.freedesktop.UDisks2.Drive") == 0) ++ remove_drive(mon, g_variant_get_string(target, NULL)); ++ else if (strcmp(val, "org.freedesktop.UDisks2.Block") == 0) ++ remove_volume(mon, g_variant_get_string(target, NULL)); ++ g_free(val); ++ } ++ } ++ else ++ { ++ // shoudl never happen! ++ } ++ g_variant_unref(target); ++ g_variant_unref(ifaces); + } + + +@@ -122,16 +216,16 @@ static void g_udisks_volume_monitor_class_init(GUDisksVolumeMonitorClass *klass) + sig_drive_connected = g_signal_lookup("drive-connected", G_TYPE_VOLUME_MONITOR); + sig_drive_disconnected = g_signal_lookup("drive-disconnected", G_TYPE_VOLUME_MONITOR); + sig_drive_eject_button = g_signal_lookup("drive-eject-button", G_TYPE_VOLUME_MONITOR); ++ sig_drive_stop_button = g_signal_lookup("drive-stop-button", G_TYPE_VOLUME_MONITOR); + sig_mount_added = g_signal_lookup("mount-added", G_TYPE_VOLUME_MONITOR); + sig_mount_changed = g_signal_lookup("mount-changed", G_TYPE_VOLUME_MONITOR); +- sig_mount_premount = g_signal_lookup("mount-premount", G_TYPE_VOLUME_MONITOR); ++ sig_mount_preunmount = g_signal_lookup("mount-pre-unmount", G_TYPE_VOLUME_MONITOR); + sig_mount_removed = g_signal_lookup("mount-removed", G_TYPE_VOLUME_MONITOR); + sig_volume_added = g_signal_lookup("volume-added", G_TYPE_VOLUME_MONITOR); + sig_volume_changed = g_signal_lookup("volume-changed", G_TYPE_VOLUME_MONITOR); + sig_volume_removed = g_signal_lookup("volume-removed", G_TYPE_VOLUME_MONITOR); + } + +- + static void g_udisks_volume_monitor_finalize(GObject *object) + { + GUDisksVolumeMonitor *self; +@@ -141,99 +235,247 @@ static void g_udisks_volume_monitor_finalize(GObject *object) + + self = G_UDISKS_VOLUME_MONITOR(object); + +- if(self->idle_handler) ++ if(self->cancellable) + { +- GList* l; +- g_source_remove(self->idle_handler); +- for(l = self->queued_events; l; l=l->next) +- { +- QueuedEvent* q = (QueuedEvent*)l->data; +- g_object_unref(q->dev); +- g_slice_free(QueuedEvent, q); +- } +- g_list_free(self->queued_events); ++ g_cancellable_cancel(self->cancellable); ++ g_object_unref(self->cancellable); + } + + if(self->udisks_proxy) + { +- dbus_g_proxy_disconnect_signal(self->udisks_proxy, "DeviceAdded", G_CALLBACK(on_device_added), self); +- dbus_g_proxy_disconnect_signal(self->udisks_proxy, "DeviceRemoved", G_CALLBACK(on_device_removed), self); +- dbus_g_proxy_disconnect_signal(self->udisks_proxy, "DeviceChanged", G_CALLBACK(on_device_changed), self); ++ g_signal_handlers_disconnect_by_func(self->udisks_proxy, ++ G_CALLBACK(on_g_signal), self); + g_object_unref(self->udisks_proxy); + } + +- if(self->devices) ++ while(self->volumes) + { +- g_list_foreach(self->devices, (GFunc)g_object_unref, NULL); +- g_list_free(self->devices); +- } +- +- if(self->drives) +- { +- g_list_foreach(self->drives, (GFunc)g_object_unref, NULL); +- g_list_free(self->drives); ++ GList *mnts; ++ GUDisksVolume *vol = self->volumes->data; ++ g_signal_handlers_disconnect_by_func(vol, G_CALLBACK(on_volume_changed), self); ++ mnts = g_udisks_volume_get_mounts(vol); ++ while(mnts) ++ { ++ /* is that ever possible? disconnect all its mounts handlers */ ++ g_signal_handlers_disconnect_by_func(mnts->data, G_CALLBACK(on_mount_preunmount), self); ++ g_signal_handlers_disconnect_by_func(mnts->data, G_CALLBACK(on_mount_removed), self); ++ mnts = g_list_delete_link(mnts, mnts); ++ } ++ g_object_unref(self->volumes->data); ++ self->volumes = g_list_delete_link(self->volumes, self->volumes); + } + +- if(self->volumes) ++ while(self->drives) + { +- g_list_foreach(self->volumes, (GFunc)g_object_unref, NULL); +- g_list_free(self->volumes); ++ g_signal_handlers_disconnect_by_func(self->drives->data, ++ G_CALLBACK(on_drive_changed), self); ++ g_udisks_drive_disconnected(self->drives->data); ++ g_object_unref(self->drives->data); ++ self->drives = g_list_delete_link(self->drives, self->drives); + } + + G_OBJECT_CLASS(g_udisks_volume_monitor_parent_class)->finalize(object); + } + +-static void update_volume_drive(GUDisksVolume* vol, GUDisksVolumeMonitor* mon) ++/* second phase of initialization: block devices scanned, add them and start monitoring */ ++static void do_introspection(GUDisksVolumeMonitor *mon, const char *obj_path, ++ void (*process)(GDBusNodeInfo *, const char *, GUDisksVolumeMonitor *, gpointer), ++ gpointer pdata) + { +- /* set association between drive and volumes here */ +- GUDisksDevice* dev; +- if(vol->dev->is_drive) /* it's a drive itself (cdrom is an example) */ +- dev = vol->dev; +- else if(vol->dev->partition_slave) +- dev = find_device(mon, vol->dev->partition_slave); +- else +- dev = NULL; ++ GVariant *res; ++ GError *error = NULL; ++ ++ res = g_dbus_connection_call_sync(mon->con, "org.freedesktop.UDisks2", ++ obj_path, ++ "org.freedesktop.DBus.Introspectable", ++ "Introspect", NULL, G_VARIANT_TYPE("(s)"), ++ G_DBUS_CALL_FLAGS_NONE, -1, ++ mon->cancellable, &error); + +- /* no ref_count handling is needed. volume manager owns all the objects. */ +- if(dev) ++ /* parse result */ ++ if (!error) + { +- GUDisksDrive* drv = find_drive(mon, dev); +- vol->drive = drv; ++ GVariant *xml = g_variant_get_child_value(res, 0); ++ GDBusNodeInfo *info = g_dbus_node_info_new_for_xml(g_variant_get_string(xml, NULL), ++ &error); ++ ++ if (error) ++ { ++ g_warning("Udisks2 introspection bad result: %s", error->message); ++ g_error_free(error); ++ } ++ else ++ { ++ process(info, obj_path, mon, pdata); ++ g_dbus_node_info_unref(info); ++ } ++ g_variant_unref(xml); ++ g_variant_unref(res); + } + else +- vol->drive = NULL; ++ { ++ g_warning("Udisks2 introspection failed: %s", error->message); ++ g_error_free(error); ++ } + } + +-static void g_udisks_volume_monitor_init(GUDisksVolumeMonitor *self) ++static void process_drives_introspect(GDBusNodeInfo *info, const char *obj_path, ++ GUDisksVolumeMonitor *mon, gpointer pdata) + { +- self->con = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL); +- if(self->con) ++ GDBusNodeInfo **sub; ++ GString *str = g_string_new(obj_path); ++ gsize len; ++ ++ g_string_append_c(str, '/'); ++ len = str->len; ++ for (sub = info->nodes; sub && sub[0]; sub++) + { +- GPtrArray* ret; +- /* FIXME: handle disconnecting from dbus */ +- self->udisks_proxy = dbus_g_proxy_new_for_name(self->con, "org.freedesktop.UDisks", "/org/freedesktop/UDisks", "org.freedesktop.UDisks"); ++ g_string_append(str, sub[0]->path); ++ add_drive(mon, str->str, FALSE); ++ g_string_truncate(str, len); ++ } ++ g_string_free(str, TRUE); ++} ++ ++static void process_a_device_introspect(GDBusNodeInfo *info, const char *obj_path, ++ GUDisksVolumeMonitor *mon, gpointer unused) ++{ ++ GDBusInterfaceInfo **interfaces = info->interfaces; ++ gboolean has_fs = FALSE, has_pt = FALSE; ++ char *drv_obj_path = NULL; ++ gboolean is_sys_internal = FALSE, is_hidden = FALSE; ++ GUDisksDrive *drv = NULL; ++ GVariant *res, *sub; ++ GError *err = NULL; ++ ++ //call org.freedesktop.DBus.Properties for "Drive" to get drive obj_path ++ res = g_dbus_connection_call_sync(mon->con, "org.freedesktop.UDisks2", ++ obj_path, ++ "org.freedesktop.DBus.Properties", "GetAll", ++ g_variant_new ("(s)", "org.freedesktop.UDisks2.Block"), ++ G_VARIANT_TYPE("(a{sv})"), ++ G_DBUS_CALL_FLAGS_NONE, -1, ++ mon->cancellable, &err); ++ ++ if (err) ++ { ++ g_debug("GetAll for %s failed: %s",obj_path,err->message); ++ g_error_free(err); ++ return; // Failure; ++ } + +- if(org_freedesktop_UDisks_enumerate_devices(self->udisks_proxy, &ret, NULL)) +- { +- guint i; +- char** paths = (char**)ret->pdata; +- for(i=0; ilen;++i) +- add_device(self, self->udisks_proxy, paths[i], FALSE); +- g_ptr_array_free(ret, TRUE); +- } ++ sub = g_variant_get_child_value(res, 0); ++ g_variant_unref(res); ++ ++ if (!sub || !g_variant_is_container(sub)) ++ { ++ g_debug("%p is not a container",sub); ++ return; // Failure; ++ } + +- dbus_g_proxy_add_signal(self->udisks_proxy, "DeviceAdded", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); +- dbus_g_proxy_add_signal(self->udisks_proxy, "DeviceRemoved", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); +- dbus_g_proxy_add_signal(self->udisks_proxy, "DeviceChanged", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); ++ g_variant_lookup(sub, "Drive", "o", &drv_obj_path); ++ g_variant_lookup(sub, "HintIgnore", "b", &is_hidden); ++ g_variant_lookup(sub, "HintSystem", "b", &is_sys_internal); + +- dbus_g_proxy_connect_signal(self->udisks_proxy, "DeviceAdded", G_CALLBACK(on_device_added), self, NULL); +- dbus_g_proxy_connect_signal(self->udisks_proxy, "DeviceRemoved", G_CALLBACK(on_device_removed), self, NULL); +- dbus_g_proxy_connect_signal(self->udisks_proxy, "DeviceChanged", G_CALLBACK(on_device_changed), self, NULL); ++ /* FIXME: how should we treat sys internal devices? ++ * make this optional */ ++ if(is_hidden || (is_sys_internal && !fm_config->show_internal_volumes)) ++ goto out; + +- /* find drives for volumes */ +- if(self->volumes && self->drives) +- g_list_foreach(self->volumes, (GFunc)update_volume_drive, self); ++ drv = find_drive(mon, drv_obj_path); ++ if(!drv) ++ goto out; ++ while (*interfaces) ++ { ++ if (g_strcmp0((*interfaces)->name, "org.freedesktop.UDisks2.Filesystem") == 0) ++ has_fs = TRUE; ++ else if (drv && g_strcmp0((*interfaces)->name, "org.freedesktop.UDisks2.PartitionTable") == 0) ++ has_pt = TRUE; ++ interfaces++; + } ++ ++ if (has_fs) ++ { ++ add_volume(mon, obj_path, drv, TRUE); ++ } ++ if (has_pt) ++ { ++ g_udisks_drive_set_device_path(drv, obj_path, mon->con, mon->cancellable, NULL); ++ /* also treat blank optical discs as volumes here to be compatible with gvfs. ++ * FIXME: this is useless unless we support burn:/// ++ * [PCMan] So, should we support this? Personally I think it's a bad idea. */ ++ if (g_udisks_drive_is_disc_blank(drv)) ++ add_volume(mon, obj_path, drv, FALSE); ++ } ++out: ++ g_variant_unref(sub); ++ g_free(drv_obj_path); ++} ++ ++static void process_devices_introspect(GDBusNodeInfo *info, const char *obj_path, ++ GUDisksVolumeMonitor *mon, gpointer pdata) ++{ ++ GDBusNodeInfo **sub; ++ GString *str = g_string_new(obj_path); ++ gsize len; ++ ++ g_string_append_c(str, '/'); ++ len = str->len; ++ for (sub = info->nodes; sub && sub[0]; sub++) ++ { ++ g_string_append(str, sub[0]->path); ++ do_introspection(mon, str->str, &process_a_device_introspect, NULL); ++ g_string_truncate(str, len); ++ } ++ g_string_free(str, TRUE); ++} ++ ++/* first phase of initialization: DBus connected */ ++static void on_dbus_connected(GObject *source_object, GAsyncResult *result, ++ gpointer user_data) ++{ ++ GUDisksVolumeMonitor *mon = G_UDISKS_VOLUME_MONITOR(user_data); ++ GError *error = NULL; ++ ++ mon->con = g_bus_get_finish(result, &error); ++ if (!error) ++ { ++ /* collect drives */ ++ const char *path = "/org/freedesktop/UDisks2/drives"; ++ do_introspection(mon, path, &process_drives_introspect, NULL); ++ ++ /* collect devices */ ++ path = "/org/freedesktop/UDisks2/block_devices"; ++ do_introspection(mon, path, &process_devices_introspect, NULL); ++ ++ /* add a monitor */ ++ mon->udisks_proxy = g_dbus_proxy_new_sync(mon->con, ++ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, ++ NULL, "org.freedesktop.UDisks2", ++ "/org/freedesktop/UDisks2", ++ "org.freedesktop.DBus.ObjectManager", ++ mon->cancellable, &error); ++ if (!error) ++ { ++ g_signal_connect(mon->udisks_proxy, "g-signal", G_CALLBACK(on_g_signal), mon); ++ } ++ else ++ { ++ g_warning("Udisks2 ObjectManager proxy failed: %s", error->message); ++ g_error_free(error); ++ } ++ } ++ else ++ { ++ g_warning("Cannot connect DBus: %s", error->message); ++ g_error_free(error); ++ } ++} ++ ++static void g_udisks_volume_monitor_init(GUDisksVolumeMonitor *self) ++{ ++ self->cancellable = g_cancellable_new(); ++ g_bus_get(G_BUS_TYPE_SYSTEM, self->cancellable, on_dbus_connected, self); + } + + +@@ -276,12 +518,12 @@ GList* get_mounts(GVolumeMonitor *mon) + GUDisksVolumeMonitor* umon = G_UDISKS_VOLUME_MONITOR(mon); + GList* l; + GList* mnts = NULL; +- for(l = umon->volumes; l; l=l->next) ++ ++ for (l = umon->volumes; l; l = l->next) + { +- GUDisksVolume* vol = G_UDISKS_VOLUME(l->data); +- if(vol->mount) +- mnts = g_list_prepend(mnts, g_object_ref(vol->mount)); ++ mnts = g_list_concat(g_udisks_volume_get_mounts(l->data), mnts); + } ++ g_list_foreach(mnts, (GFunc)g_object_ref, NULL); + return mnts; + } + +@@ -291,9 +533,12 @@ GVolume *get_volume_for_uuid(GVolumeMonitor *mon, const char *uuid) + GList* l; + for(l = umon->volumes; l; l=l->next) + { +- GUDisksVolume* vol = G_UDISKS_VOLUME(l->data); +- if(g_strcmp0(vol->dev->uuid, uuid) == 0) +- return (GVolume*)g_object_ref(vol); ++ GVolume *vol = l->data; ++ char *dev_uuid = g_volume_get_uuid(vol); ++ int res = g_strcmp0(dev_uuid, uuid); ++ g_free(dev_uuid); ++ if (res == 0) ++ return g_object_ref(vol); + } + return NULL; + } +@@ -304,9 +549,12 @@ GMount *get_mount_for_uuid(GVolumeMonitor *mon, const char *uuid) + GList* l; + for(l = umon->volumes; l; l=l->next) + { +- GUDisksVolume* vol = G_UDISKS_VOLUME(l->data); +- if(g_strcmp0(vol->dev->uuid, uuid) == 0) +- return g_volume_get_mount(G_VOLUME(vol)); ++ GVolume *vol = l->data; ++ char *dev_uuid = g_volume_get_uuid(vol); ++ int res = g_strcmp0(dev_uuid, uuid); ++ g_free(dev_uuid); ++ if (res == 0) ++ return g_volume_get_mount(vol); + } + return NULL; + } +@@ -319,278 +567,145 @@ void drive_eject_button(GVolumeMonitor *mon, GDrive *drive) + + } + +-GList* find_device_l(GUDisksVolumeMonitor* mon, const char* obj_path) ++GList* find_volume_l(GUDisksVolumeMonitor* mon, const char* obj_path) + { + GList* l; +- for(l = mon->devices; l; l=l->next) ++ for(l = mon->volumes; l; l=l->next) + { +- GUDisksDevice* dev = G_UDISKS_DEVICE(l->data); +- if(g_strcmp0(dev->obj_path, obj_path) == 0) ++ if(g_strcmp0(g_udisks_volume_get_obj_path(l->data), obj_path) == 0) + return l; + } + return NULL; + } + +-GList* find_drive_l(GUDisksVolumeMonitor* mon, GUDisksDevice* dev) ++GList* find_drive_l(GUDisksVolumeMonitor* mon, const char* obj_path) + { + GList* l; + for(l = mon->drives; l; l=l->next) + { +- GUDisksDrive* drv = G_UDISKS_DRIVE(l->data); +- if(G_UNLIKELY(drv->dev == dev)) +- return l; +- } +- return NULL; +-} +- +-GList* find_volume_l(GUDisksVolumeMonitor* mon, GUDisksDevice* dev) +-{ +- GList* l; +- for(l = mon->volumes; l; l=l->next) +- { +- GUDisksVolume* vol = G_UDISKS_VOLUME(l->data); +- if(G_UNLIKELY(vol->dev == dev)) ++ if(g_strcmp0(g_udisks_drive_get_obj_path(l->data), obj_path) == 0) + return l; + } + return NULL; + } + +-static void add_drive(GUDisksVolumeMonitor* mon, GUDisksDevice* dev, gboolean emit_signal) ++static GUDisksDrive *add_drive(GUDisksVolumeMonitor* mon, const char *obj_path, ++ gboolean emit_signal) + { +- if(!find_drive(mon, dev)) ++ GUDisksDrive *drv = find_drive(mon, obj_path); ++ if (!drv) + { +- GUDisksDrive* drv = g_udisks_drive_new(mon, dev); ++ drv = g_udisks_drive_new(mon->con, obj_path, mon->cancellable, NULL); // FIXME ++ g_signal_connect(drv, "changed", G_CALLBACK(on_drive_changed), mon); + mon->drives = g_list_prepend(mon->drives, drv); + if(emit_signal) + g_signal_emit(mon, sig_drive_connected, 0, drv); + } ++ return drv; + } + +-static void add_volume(GUDisksVolumeMonitor* mon, GUDisksDevice* dev, gboolean emit_signal) ++static void remove_drive(GUDisksVolumeMonitor* mon, const char *obj_path) + { +- if(!find_volume(mon, dev)) +- { +- GUDisksVolume* vol = g_udisks_volume_new(mon, dev); +- mon->volumes = g_list_prepend(mon->volumes, vol); +- if(emit_signal) +- g_signal_emit(mon, sig_volume_added, 0, vol); +- } +-} +- +-static void remove_drive(GUDisksVolumeMonitor* mon, GUDisksDevice* dev) +-{ +- GList* l = find_drive_l(mon, dev); ++ GList* l = find_drive_l(mon, obj_path); ++ g_debug("remove_drive: %s", obj_path); + if(l) + { + GUDisksDrive* drv = G_UDISKS_DRIVE(l->data); + mon->drives = g_list_delete_link(mon->drives, l); ++ g_signal_handlers_disconnect_by_func(drv, G_CALLBACK(on_drive_changed), mon); + g_signal_emit(mon, sig_drive_disconnected, 0, drv); + g_udisks_drive_disconnected(drv); +- drv->mon = NULL; +- for(l = mon->volumes; l; l=l->next) +- { +- GUDisksVolume* vol = G_UDISKS_VOLUME(l->data); +- if(vol->drive == drv) +- { +- vol->drive = NULL; +- /* FIXME: emit sigal for volume change */ +- } +- } + g_object_unref(drv); + } + } + +-static void remove_volume(GUDisksVolumeMonitor* mon, GUDisksDevice* dev) ++static void on_mount_preunmount(GUDisksMount* mnt, GUDisksVolumeMonitor* mon) + { +- GList* l = find_volume_l(mon, dev); +- if(l) +- { +- GUDisksVolume* vol = G_UDISKS_VOLUME(l->data); +- mon->volumes = g_list_delete_link(mon->volumes, l); +- g_signal_emit(mon, sig_volume_removed, 0, vol); +- g_udisks_volume_removed(vol); +- vol->mon = NULL; +- vol->drive = NULL; +- g_object_unref(vol); +- } ++ g_debug("%s",__func__); ++ g_signal_emit(mon, sig_mount_preunmount, 0, mnt); + } + +-static void _g_udisks_device_added(GUDisksDevice* dev, GUDisksVolumeMonitor* mon, gboolean emit_signal) ++static void on_mount_removed(GUDisksMount* mnt, GUDisksVolumeMonitor* mon) + { +- /* FIXME: how should we treat sys internal devices? +- * make this optional */ +- if(!dev->is_hidden && (!dev->is_sys_internal || fm_config->show_internal_volumes) ) +- { +- if(dev->is_drive) +- add_drive(mon, dev, emit_signal); +- +- if(g_udisks_device_is_volume(dev)) +- add_volume(mon, dev, emit_signal); +- } ++ g_debug("%s",__func__); ++ /* remove handlers */ ++ g_signal_handlers_disconnect_by_func(mnt, G_CALLBACK(on_mount_preunmount), mon); ++ g_signal_handlers_disconnect_by_func(mnt, G_CALLBACK(on_mount_removed), mon); ++ g_signal_emit(mon, sig_mount_removed, 0, mnt); + } + +-static void g_udisks_device_added(GUDisksDevice* dev, GUDisksVolumeMonitor* mon) ++static void on_mount_added(GUDisksVolume* vol, GUDisksMount* mnt, GUDisksVolumeMonitor* mon) + { +- g_debug("g_udisks_device_added"); +- _g_udisks_device_added(dev, mon, TRUE); ++ g_debug("%s",__func__); ++ /* add handlers */ ++ g_signal_connect(mnt, "pre-unmount", G_CALLBACK(on_mount_preunmount), mon); ++ g_signal_connect(mnt, "unmounted", G_CALLBACK(on_mount_removed), mon); ++ g_signal_emit(mon, sig_mount_added, 0, mnt); + } + +-static void g_udisks_device_changed(GUDisksDevice* dev, GUDisksVolumeMonitor* mon) ++static void on_drive_changed(GUDisksDrive* drv, GUDisksVolumeMonitor* mon) + { +- GUDisksDrive* drv = find_drive(mon, dev); +- GUDisksVolume* vol = find_volume(mon, dev); +- /* +- gboolean is_drive = dev->is_drive; +- char* usage = g_strdup(dev->usage); +- */ +- g_debug("g_udisks_device_changed"); +- if(drv) +- { +- g_signal_emit(mon, sig_drive_changed, 0, drv); +- g_udisks_drive_changed(drv); +- /* it's no longer a drive */ +- if(!dev->is_drive) +- remove_drive(mon, dev); +- } +- else +- { +- if(dev->is_drive) +- add_drive(mon, dev, TRUE); +- } ++ g_debug("on_drive_changed: %s",g_udisks_drive_get_obj_path(drv)); + +- if(vol) +- { +- update_volume_drive(vol, mon); +- g_signal_emit(mon, sig_volume_changed, 0, vol); +- g_udisks_volume_changed(vol); +- +- /* it's no longer a volume */ +- if(!g_udisks_device_is_volume(dev)) +- remove_volume(mon, dev); +- } +- else +- { +- /* we got a usable volume now */ +- if(g_udisks_device_is_volume(dev)) +- add_volume(mon, dev, TRUE); +- } ++ g_signal_emit(mon, sig_drive_changed, 0, drv); + } + +-static void g_udisks_device_removed(GUDisksDevice* dev, GUDisksVolumeMonitor* mon) ++static void on_volume_changed(GUDisksVolume* vol, GUDisksVolumeMonitor* mon) + { +- g_debug("g_udisks_device_removed"); +- +- if(dev->is_drive) +- remove_drive(mon, dev); +- +- remove_volume(mon, dev); ++ g_debug("%s", __func__); ++ g_signal_emit(mon, sig_volume_changed, 0, vol); + } + +-static gboolean on_idle(GUDisksVolumeMonitor* mon) ++static GUDisksVolume* add_volume(GUDisksVolumeMonitor* mon, const char* obj_path, ++ GUDisksDrive* drv, gboolean emit_signal) + { +- GList* l; +- g_debug("on_idle: %d", g_list_length(mon->queued_events)); +- for(l = mon->queued_events; l; l=l->next) ++ if(mon && obj_path && drv && !find_volume(mon, obj_path)) + { +- QueuedEvent* q = (QueuedEvent*)l->data; +- q->func(q->dev, mon); +- g_object_unref(q->dev); +- g_slice_free(QueuedEvent, q); +- } +- g_list_free(mon->queued_events); +- mon->queued_events = NULL; +- mon->idle_handler = 0; +- return FALSE; +-} +- +-static void g_udisks_device_queue_event(GUDisksDevice* dev, GUDisksDeviceEventHandler func, GUDisksVolumeMonitor* mon) +-{ +- QueuedEvent* q = g_slice_new(QueuedEvent); +- q->dev = g_object_ref(dev); +- q->func = func; +- mon->queued_events = g_list_append(mon->queued_events, q); +- +- if(0 == mon->idle_handler) +- mon->idle_handler = g_idle_add_full(G_PRIORITY_HIGH, (GSourceFunc)on_idle, mon, NULL); +-} +- +-static void add_device(GUDisksVolumeMonitor* mon, DBusGProxy* proxy, const char* obj_path, gboolean emit_signal) +-{ +- if(!find_device(mon, obj_path)) +- { +- DBusGProxy *dev_proxy = dbus_g_proxy_new_for_name(mon->con, +- "org.freedesktop.UDisks", +- obj_path, +- "org.freedesktop.DBus.Properties"); + GError* err = NULL; +- GHashTable* props = dbus_get_all_props(dev_proxy, "org.freedesktop.UDisks.Device", &err); +- if(props) ++ GUDisksVolume* vol = g_udisks_volume_new(obj_path, mon->con, NULL, drv, ++ mon->cancellable, &err); ++ ++ if (!err) + { +- GUDisksDevice* dev = g_udisks_device_new(obj_path, props); +- g_hash_table_destroy(props); +- +- mon->devices = g_list_prepend(mon->devices, dev); +- if(emit_signal) +- g_udisks_device_queue_event(dev, g_udisks_device_added, mon); +- else +- _g_udisks_device_added(dev, mon, FALSE); ++ g_debug("added new volume for %s", obj_path); ++ mon->volumes = g_list_prepend(mon->volumes, vol); ++ g_signal_connect(vol, "changed", G_CALLBACK(on_volume_changed), mon); ++ g_signal_connect(vol, "mount-added", G_CALLBACK(on_mount_added), mon); ++ if (emit_signal) ++ g_signal_emit(mon, sig_volume_added, 0, vol); ++ return vol; + } + else + { + g_debug("%s", err->message); + g_error_free(err); + } +- g_object_unref(dev_proxy); + } +- g_debug("device_added: %s", obj_path); +-} +- +-void on_device_added(DBusGProxy* proxy, const char* obj_path, gpointer user_data) +-{ +- GUDisksVolumeMonitor* mon = G_UDISKS_VOLUME_MONITOR(user_data); +- add_device(mon, proxy, obj_path, TRUE); ++ return NULL; + } + +- +-void on_device_removed(DBusGProxy* proxy, const char* obj_path, gpointer user_data) ++static void remove_volume(GUDisksVolumeMonitor* mon, const char* obj_path) + { +- GUDisksVolumeMonitor* mon = G_UDISKS_VOLUME_MONITOR(user_data); +- GList* l; +- l = find_device_l(mon, obj_path); ++ GList *l, *mnts; ++ l = find_volume_l(mon, obj_path); + if(l) + { +- GUDisksDevice* dev = G_UDISKS_DEVICE(l->data); +- mon->devices = g_list_delete_link(mon->devices, l); +- +- g_udisks_device_queue_event(dev, g_udisks_device_removed, mon); +- g_object_unref(dev); +- } +- g_debug("device_removed: %s", obj_path); +- +-} +- +-void on_device_changed(DBusGProxy* proxy, const char* obj_path, gpointer user_data) +-{ +- GUDisksVolumeMonitor* mon = G_UDISKS_VOLUME_MONITOR(user_data); +- GUDisksDevice* dev = find_device(mon, obj_path); +- if(dev) +- { +- DBusGProxy *dev_proxy = dbus_g_proxy_new_for_name(mon->con, +- "org.freedesktop.UDisks", +- obj_path, +- "org.freedesktop.DBus.Properties"); ++ GUDisksVolume* vol = G_UDISKS_VOLUME(l->data); + +- GError* err = NULL; +- GHashTable* props = dbus_get_all_props(dev_proxy, "org.freedesktop.UDisks.Device", &err); +- if(props) ++ g_signal_handlers_disconnect_by_func(vol, G_CALLBACK(on_volume_changed), mon); ++ g_signal_handlers_disconnect_by_func(vol, G_CALLBACK(on_mount_added), mon); ++ mon->volumes = g_list_delete_link(mon->volumes, l); ++ mnts = g_udisks_volume_get_mounts(vol); ++ while(mnts) + { +- g_udisks_device_update(dev, props); +- g_hash_table_destroy(props); +- +- g_udisks_device_queue_event(dev, g_udisks_device_changed, mon); ++ /* is that ever possible? disconnect all its mounts handlers */ ++ g_signal_handlers_disconnect_by_func(mnts->data, G_CALLBACK(on_mount_preunmount), mon); ++ g_signal_handlers_disconnect_by_func(mnts->data, G_CALLBACK(on_mount_removed), mon); ++ mnts = g_list_delete_link(mnts, mnts); + } +- g_object_unref(dev_proxy); ++ g_signal_emit(mon, sig_volume_removed, 0, vol); ++ g_udisks_volume_removed(vol); ++ g_object_unref(vol); + } +- g_debug("device_changed: %s", obj_path); ++ g_debug("volume_removed: %s", obj_path); + } +- +diff --git a/src/udisks/g-udisks-volume-monitor.h b/src/udisks/g-udisks-volume-monitor.h +index a64f35b7..035914cf 100644 +--- a/src/udisks/g-udisks-volume-monitor.h ++++ b/src/udisks/g-udisks-volume-monitor.h +@@ -24,7 +24,6 @@ + #define __G_UDISKS_VOLUME_MONITOR_H__ + + #include +-#include + + G_BEGIN_DECLS + +@@ -41,19 +40,6 @@ G_BEGIN_DECLS + typedef struct _GUDisksVolumeMonitor GUDisksVolumeMonitor; + typedef struct _GUDisksVolumeMonitorClass GUDisksVolumeMonitorClass; + +-struct _GUDisksVolumeMonitor +-{ +- GNativeVolumeMonitor parent; +- DBusGConnection* con; +- DBusGProxy* udisks_proxy; +- +- GList* devices; +- GList* drives; +- GList* volumes; +- guint idle_handler; +- GList* queued_events; +-}; +- + struct _GUDisksVolumeMonitorClass + { + GNativeVolumeMonitorClass parent_class; +diff --git a/src/udisks/g-udisks-volume.c b/src/udisks/g-udisks-volume.c +index a1a4a98f..38500579 100644 +--- a/src/udisks/g-udisks-volume.c ++++ b/src/udisks/g-udisks-volume.c +@@ -1,6 +1,7 @@ + // g-udisks-volume.c + // + // Copyright 2010 Hong Jen Yee (PCMan) ++// Copyright 2021 Andriy Grytsenko (LStranger) + // + // This program is free software; you can redistribute it and/or modify + // it under the terms of the GNU General Public License as published by +@@ -21,34 +22,53 @@ + #include + #endif + +-#include "g-udisks-volume.h" + #include +-#include +-#include "udisks.h" +-#include "udisks-device.h" + #include "g-udisks-mount.h" ++#include "g-udisks-drive.h" + #include "dbus-utils.h" + ++#include ++ ++struct _GUDisksVolume ++{ ++ GObject parent; ++ GUDisksDevice* dev; ++ GUDisksDrive* drv; ++ char* name; ++ GList* mounts; /* of GUDisksMount */ ++ GFile* activation_root; ++}; ++ ++struct _GUDisksVolumeClass ++{ ++ GObjectClass parent_class; ++ void (*mount_added)(GUDisksDevice* dev, GUDisksMount* mnt); ++}; ++ + typedef struct + { + GUDisksVolume* vol; + GAsyncReadyCallback callback; + gpointer user_data; +- DBusGProxy* proxy; +- DBusGProxyCall* call; +- GCancellable* cancellable; + }AsyncData; + + static guint sig_changed; + static guint sig_removed; ++static guint sig_mount_added; + + static void g_udisks_volume_volume_iface_init (GVolumeIface * iface); + static void g_udisks_volume_finalize (GObject *object); + + static void g_udisks_volume_eject_with_operation (GVolume* base, GMountUnmountFlags flags, GMountOperation* mount_operation, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); ++static gboolean g_udisks_volume_set_mounts(GUDisksVolume* vol, GUDisksDevice* dev); + +-// static gboolean g_udisks_volume_eject_co (UdisksVolumeEjectData* data); +-// static gboolean g_udisks_volume_eject_with_operation_co (UdisksVolumeEjectWithOperationData* data); ++static void on_device_changed(GUDisksDevice* dev, GUDisksVolume* vol) ++{ ++ g_free(vol->name); ++ vol->name = NULL; ++ g_udisks_volume_set_mounts(vol, dev); ++ g_signal_emit(vol, sig_changed, 0); ++} + + G_DEFINE_TYPE_EXTENDED (GUDisksVolume, g_udisks_volume, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (G_TYPE_VOLUME, +@@ -61,27 +81,13 @@ static void g_udisks_volume_class_init(GUDisksVolumeClass *klass) + + g_object_class = G_OBJECT_CLASS(klass); + g_object_class->finalize = g_udisks_volume_finalize; +-} + +-static void g_udisks_volume_clear(GUDisksVolume* vol) +-{ +- if(vol->mount) +- { +- g_object_unref(vol->mount); +- vol->mount = NULL; +- } +- +- if(vol->icon) +- { +- g_object_unref(vol->icon); +- vol->icon = NULL; +- } +- +- if(vol->name) +- { +- g_free(vol->name); +- vol->name = NULL; +- } ++ sig_mount_added = g_signal_new("mount-added", G_TYPE_FROM_CLASS(klass), ++ G_SIGNAL_RUN_FIRST, ++ G_STRUCT_OFFSET (GUDisksVolumeClass, mount_added), ++ NULL, NULL, ++ g_cclosure_marshal_VOID__OBJECT, ++ G_TYPE_NONE, 1, G_TYPE_OBJECT); + } + + static void g_udisks_volume_finalize(GObject *object) +@@ -92,10 +98,26 @@ static void g_udisks_volume_finalize(GObject *object) + g_return_if_fail(G_IS_UDISKS_VOLUME(object)); + + self = G_UDISKS_VOLUME(object); +- if(self->dev) +- g_object_unref(self->dev); + +- g_udisks_volume_clear(self); ++ g_signal_handlers_disconnect_by_func(self->dev, G_CALLBACK(on_device_changed), self); ++ g_object_unref(self->dev); ++ ++ /* it should be already removed from drive at this point but let ensure that */ ++ g_udisks_drive_del_volume(self->drv, self); ++ g_object_unref(self->drv); ++ ++ while(self->mounts) ++ { ++ g_udisks_mount_unmounted(self->mounts->data); ++ g_object_unref(self->mounts->data); ++ self->mounts = g_list_delete_link(self->mounts, self->mounts); ++ } ++ ++ if(self->activation_root) ++ g_object_unref(self->activation_root); ++ ++ g_free(self->name); ++ + G_OBJECT_CLASS(g_udisks_volume_parent_class)->finalize(object); + } + +@@ -104,31 +126,45 @@ static void g_udisks_volume_init(GUDisksVolume *self) + + } + ++static gboolean on_idle_start(gpointer data) ++{ ++ GUDisksVolume* vol = (GUDisksVolume*)data; ++ g_udisks_volume_set_mounts(vol, vol->dev); ++ g_object_unref(data); ++ return FALSE; ++} + +-GUDisksVolume *g_udisks_volume_new(GUDisksVolumeMonitor* mon, GUDisksDevice* dev) ++GUDisksVolume *g_udisks_volume_new(const char* obj_path, GDBusConnection* con, ++ GFile* activation_root, GUDisksDrive* drv, ++ GCancellable* cancellable, GError** error) + { + GUDisksVolume* vol = (GUDisksVolume*)g_object_new(G_TYPE_UDISKS_VOLUME, NULL); +- vol->dev = g_object_ref(dev); +- vol->mon = mon; ++ ++ vol->dev = g_udisks_device_get(obj_path, con, cancellable, error); ++ g_signal_connect(vol->dev, "changed", G_CALLBACK(on_device_changed), vol); ++ vol->drv = g_object_ref(drv); ++ g_udisks_drive_add_volume(drv, vol); ++ if (activation_root) ++ vol->activation_root = g_object_ref_sink(activation_root); ++ g_idle_add(on_idle_start, g_object_ref(vol)); + return vol; + } + + static gboolean g_udisks_volume_can_eject (GVolume* base) + { + GUDisksVolume* vol = G_UDISKS_VOLUME(base); +- return vol->dev->is_ejectable; ++ return g_drive_can_eject(G_DRIVE(vol->drv)); + } + + static gboolean g_udisks_volume_can_mount (GVolume* base) + { + /* FIXME, is this correct? */ +- GUDisksVolume* vol = G_UDISKS_VOLUME(base); +- return !vol->dev->is_mounted; ++ //GUDisksVolume* vol = G_UDISKS_VOLUME(base); ++ return TRUE; + } + + static void g_udisks_volume_eject (GVolume* base, GMountUnmountFlags flags, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) + { +- //GUDisksVolume* vol = G_UDISKS_VOLUME(base); + g_udisks_volume_eject_with_operation(base, flags, NULL, cancellable, callback, user_data); + } + +@@ -151,20 +187,19 @@ static void on_drive_ejected(GObject* drive, GAsyncResult* res, gpointer user_da + static void g_udisks_volume_eject_with_operation (GVolume* base, GMountUnmountFlags flags, GMountOperation* mount_operation, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) + { + GUDisksVolume* vol = G_UDISKS_VOLUME(base); +- if(vol->drive && g_drive_can_eject(G_DRIVE(vol->drive))) ++ if(g_drive_can_eject(G_DRIVE(vol->drv))) + { + EjectData* data = g_slice_new(EjectData); + data->vol = g_object_ref(vol); + data->callback = callback; + data->user_data = user_data; +- g_drive_eject_with_operation(G_DRIVE(vol->drive), flags, mount_operation, ++ g_drive_eject_with_operation(G_DRIVE(vol->drv), flags, mount_operation, + cancellable, on_drive_ejected, data); + } + } + + static char** g_udisks_volume_enumerate_identifiers (GVolume* base) + { +- //GUDisksVolume* vol = G_UDISKS_VOLUME(base); + char** kinds = g_new0(char*, 4); + kinds[0] = g_strdup(G_VOLUME_IDENTIFIER_KIND_LABEL); + kinds[1] = g_strdup(G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE); +@@ -177,24 +212,21 @@ static GFile* g_udisks_volume_get_activation_root (GVolume* base) + { + GUDisksVolume* vol = G_UDISKS_VOLUME(base); + /* FIXME: is this corrcet? */ +- return vol->mount ? g_mount_get_root((GMount*)vol->mount) : NULL; ++ if(vol->mounts) ++ return g_mount_get_root((GMount*)vol->mounts->data); ++ return vol->activation_root ? g_object_ref(vol->activation_root) : NULL; + } + + static GDrive* g_udisks_volume_get_drive (GVolume* base) + { + GUDisksVolume* vol = G_UDISKS_VOLUME(base); +- return vol->drive ? (GDrive*)g_object_ref(vol->drive) : NULL; ++ return g_object_ref(vol->drv); + } + + static GIcon* g_udisks_volume_get_icon (GVolume* base) + { + GUDisksVolume* vol = G_UDISKS_VOLUME(base); +- if(!vol->icon) +- { +- const char* icon_name = g_udisks_device_get_icon_name(vol->dev); +- vol->icon = g_themed_icon_new_with_default_fallbacks(icon_name); +- } +- return (GIcon*)g_object_ref(vol->icon); ++ return g_drive_get_icon(G_DRIVE(vol->drv)); + } + + static char* g_udisks_volume_get_identifier (GVolume* base, const char* kind) +@@ -203,11 +235,11 @@ static char* g_udisks_volume_get_identifier (GVolume* base, const char* kind) + if(kind) + { + if(strcmp(kind, G_VOLUME_IDENTIFIER_KIND_LABEL) == 0) +- return g_strdup(vol->dev->label); ++ return g_udisks_device_get_label(vol->dev); + else if(strcmp(kind, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE) == 0) +- return g_strdup(vol->dev->dev_file); ++ return g_udisks_device_get_dev_file(vol->dev); + else if(strcmp(kind, G_VOLUME_IDENTIFIER_KIND_UUID) == 0) +- return g_strdup(vol->dev->uuid); ++ return g_udisks_device_get_uuid(vol->dev); + } + return NULL; + } +@@ -215,26 +247,23 @@ static char* g_udisks_volume_get_identifier (GVolume* base, const char* kind) + static GMount* g_udisks_volume_get_mount (GVolume* base) + { + GUDisksVolume* vol = G_UDISKS_VOLUME(base); +- if(vol->dev->is_mounted && !vol->mount) +- { +- /* FIXME: will this work? */ +- vol->mount = g_udisks_mount_new(vol); +- } +- return vol->mount ? (GMount*)g_object_ref(vol->mount) : NULL; ++ return vol->mounts ? (GMount*)g_object_ref(vol->mounts->data) : NULL; + } + + static char* g_udisks_volume_get_name (GVolume* base) + { +- /* TODO */ + GUDisksVolume* vol = G_UDISKS_VOLUME(base); + if(!vol->name) + { +- GUDisksDevice* dev = vol->dev; + /* build a human readable name */ + + /* FIXME: find a better way to build a nicer volume name */ +- if(dev->label && *dev->label) +- vol->name = g_strdup(dev->label); ++ vol->name = g_udisks_device_get_label(vol->dev); ++ if(vol->name && !vol->name[0]) ++ { ++ g_free(vol->name); ++ vol->name = NULL; ++ } + /* + else if(vol->dev->partition_size > 0) + { +@@ -243,14 +272,10 @@ static char* g_udisks_volume_get_name (GVolume* base) + g_free(size_str); + } + */ +- else if(dev->is_optic_disc) +- vol->name = g_strdup(g_udisks_device_get_disc_name(dev)); +- else if(dev->dev_file_presentation && *dev->dev_file_presentation) +- vol->name = g_path_get_basename(dev->dev_file_presentation); +- else if(dev->dev_file && *dev->dev_file) +- vol->name = g_path_get_basename(vol->dev->dev_file); +- else +- vol->name = g_path_get_basename(vol->dev->obj_path); ++ if(!vol->name) ++ vol->name = g_strdup(g_udisks_drive_get_disc_name(vol->drv)); ++ if(!vol->name) ++ vol->name = g_udisks_device_get_dev_basename(vol->dev); + } + return g_strdup(vol->name); + } +@@ -258,23 +283,20 @@ static char* g_udisks_volume_get_name (GVolume* base) + static char* g_udisks_volume_get_uuid (GVolume* base) + { + GUDisksVolume* vol = G_UDISKS_VOLUME(base); +- return g_strdup(vol->dev->uuid); ++ return g_udisks_device_get_uuid(vol->dev); + } + +-static void on_mount_cancelled(GCancellable* cancellable, gpointer user_data) +-{ +- AsyncData* data = (AsyncData*)user_data; +- dbus_g_proxy_cancel_call(data->proxy, data->call); +-} +- +-static void mount_callback(DBusGProxy *proxy, char * OUT_mount_path, GError *error, gpointer user_data) ++static void mount_callback(GObject *source, GAsyncResult *result, gpointer user_data) + { ++ GDBusProxy* proxy = (GDBusProxy *)source; + AsyncData* data = (AsyncData*)user_data; + GSimpleAsyncResult* res; ++ GError *error = NULL; ++ GVariant *val = g_dbus_proxy_call_finish(proxy, result, &error); ++ + g_debug("mount callback!!"); + if(error) + { +- error = g_udisks_error_to_gio_error(error); + res = g_simple_async_result_new_from_error(G_OBJECT(data->vol), + data->callback, + data->user_data, +@@ -288,90 +310,82 @@ static void mount_callback(DBusGProxy *proxy, char * OUT_mount_path, GError *err + data->user_data, + NULL); + g_simple_async_result_set_op_res_gboolean(res, TRUE); +- +- /* FIXME: ensure we have working mount paths to generate GMount object. */ +- if(data->vol->dev->mount_paths) +- { +- char** p = data->vol->dev->mount_paths; +- for(; *p; ++p) +- if(strcmp(*p, OUT_mount_path) == 0) +- break; +- if(!*p) /* OUT_mount_path is not in mount_paths */ +- { +- int len = g_strv_length(data->vol->dev->mount_paths); +- data->vol->dev->mount_paths = g_realloc(data->vol->dev->mount_paths, + 2); +- memcpy(data->vol->dev->mount_paths, data->vol->dev->mount_paths + sizeof(char*), len * sizeof(char*)); +- data->vol->dev->mount_paths[0] = g_strdup(OUT_mount_path); +- } +- } +- else +- { +- data->vol->dev->mount_paths = g_new0(char*, 2); +- data->vol->dev->mount_paths[0] = g_strdup(OUT_mount_path); +- data->vol->dev->mount_paths[1] = NULL; +- } +- ++ g_variant_unref(val); + } + g_simple_async_result_complete(res); + g_object_unref(res); + +- if(data->cancellable) +- { +- g_signal_handlers_disconnect_by_func(data->cancellable, on_mount_cancelled, data); +- g_object_unref(data->cancellable); +- } + g_object_unref(data->vol); +- g_object_unref(data->proxy); + g_slice_free(AsyncData, data); + + } + +-static void g_udisks_volume_mount_fn(GVolume* base, GMountMountFlags flags, GMountOperation* mount_operation, GCancellable* cancellable, GAsyncReadyCallback callback, void* user_data) ++static void g_udisks_volume_mount_fn(GVolume* base, GMountMountFlags flags, ++ GMountOperation* mount_operation, ++ GCancellable* cancellable, ++ GAsyncReadyCallback callback, void* user_data) + { + /* FIXME: need to make sure this works correctly */ + GUDisksVolume* vol = G_UDISKS_VOLUME(base); + GUDisksDevice* dev = vol->dev; +- GUDisksVolumeMonitor* mon = vol->mon; +- AsyncData* data = g_slice_new(AsyncData); +- DBusGProxy* proxy = g_udisks_device_get_proxy(dev, mon->con); +- data->vol = g_object_ref(vol); +- data->callback = callback; +- data->user_data = user_data; +- data->proxy = proxy; +- +- g_debug("mount_fn"); +- +- data->call = org_freedesktop_UDisks_Device_filesystem_mount_async( +- proxy, dev->type ? dev->type : "auto", NULL, mount_callback, data); +- if(cancellable) ++ GDBusProxy* proxy = g_udisks_device_get_fs_proxy(dev); ++ ++ if (proxy) ++ { ++ AsyncData* data = g_slice_new(AsyncData); ++ GVariant* fstype = g_udisks_device_get_fstype(dev); ++ GVariantBuilder b; ++ ++ g_debug("send DBus request to mount %s", g_udisks_device_get_obj_path(dev)); ++ data->vol = g_object_ref(vol); ++ data->callback = callback; ++ data->user_data = user_data; ++ ++ g_variant_builder_init(&b, G_VARIANT_TYPE("(a{sv})")); ++ g_variant_builder_open(&b, G_VARIANT_TYPE ("a{sv}")); ++ g_variant_builder_add(&b, "{sv}", "fstype", fstype); ++ g_variant_builder_close(&b); ++ g_dbus_proxy_call(proxy, "Mount", g_variant_builder_end(&b), ++ G_DBUS_CALL_FLAGS_NONE, -1, cancellable, ++ mount_callback, data); ++ g_object_unref(proxy); ++ g_variant_unref(fstype); ++ } ++ else + { +- data->cancellable = g_object_ref(cancellable); +- g_signal_connect(cancellable, "cancelled", G_CALLBACK(on_mount_cancelled), data); ++ GSimpleAsyncResult* res; ++ char *dev_file = g_udisks_device_get_dev_file(dev); ++ ++ res = g_simple_async_result_new_error(G_OBJECT(vol), callback, user_data, ++ G_IO_ERROR, G_IO_ERROR_FAILED, ++ _("No filesystem proxy for '%s'"), ++ dev_file); ++ g_simple_async_result_complete(res); ++ g_object_unref(res); ++ g_free(dev_file); + } + } + + static gboolean g_udisks_volume_mount_finish(GVolume* base, GAsyncResult* res, GError** error) + { +- //GUDisksVolume* vol = G_UDISKS_VOLUME(base); + return !g_simple_async_result_propagate_error(G_SIMPLE_ASYNC_RESULT(res), error); + } + + static gboolean g_udisks_volume_should_automount (GVolume* base) + { + GUDisksVolume* vol = G_UDISKS_VOLUME(base); +- return vol->dev->auto_mount; ++ return g_udisks_device_can_auto_mount(vol->dev); + } + + static gboolean g_udisks_volume_eject_with_operation_finish (GVolume* base, GAsyncResult* res, GError** error) + { + GUDisksVolume* vol = G_UDISKS_VOLUME(base); + /* FIXME: is this correct? */ +- return g_drive_eject_with_operation_finish(G_DRIVE(vol->drive), res, error); ++ return g_drive_eject_with_operation_finish(G_DRIVE(vol->drv), res, error); + } + + static gboolean g_udisks_volume_eject_finish (GVolume* base, GAsyncResult* res, GError** error) + { +- //GUDisksVolume* vol = G_UDISKS_VOLUME(base); + return g_udisks_volume_eject_with_operation_finish(base, res, error); + } + +@@ -400,14 +414,111 @@ static void g_udisks_volume_volume_iface_init (GVolumeIface * iface) + sig_removed = g_signal_lookup("removed", G_TYPE_VOLUME); + } + +-void g_udisks_volume_changed(GUDisksVolume* vol) ++/** ++ * g_udisks_volume_set_mounts ++ * @vol: volume instance ++ * @dev: associated device ++ * ++ * Updates mounts list to actual one. Allocates and releases GUDisksMount ++ * objects as needed. ++ * ++ * Returns: %TRUE if list was changed since last call. ++ */ ++static gboolean g_udisks_volume_set_mounts(GUDisksVolume* vol, GUDisksDevice* dev) + { +- g_udisks_volume_clear(vol); +- g_signal_emit(vol, sig_changed, 0); ++ char **mount_points = g_udisks_device_get_mount_paths(dev); ++ GList *new_list = NULL, *list; ++ char **point; ++ gboolean changed = FALSE; ++ ++ g_return_val_if_fail(G_IS_UDISKS_VOLUME(vol), FALSE); ++ ++ for (point = mount_points; point && *point; point++) ++ { ++ GFile *new_root = g_file_new_for_path(*point), *mount_root; ++ ++ for (list = vol->mounts; list; list = list->next) ++ { ++ mount_root = g_mount_get_root(list->data); ++ if (g_file_equal(new_root, mount_root)) ++ { ++ g_object_unref(mount_root); ++ vol->mounts = g_list_remove_link(vol->mounts, list); ++ new_list = g_list_concat(list, new_list); ++ break; ++ } ++ g_object_unref(mount_root); ++ } ++ if (!list) ++ { ++ GUDisksMount *mnt = g_udisks_mount_new(vol, new_root); ++ new_list = g_list_prepend(new_list, mnt); ++ g_debug("adding new mount for '%s' at '%s'", ++ strrchr(g_udisks_device_get_obj_path(vol->dev), '/'), ++ *point); ++ /* emit "mount-added" signal */ ++ g_signal_emit(vol, sig_mount_added, 0, mnt); ++ changed = TRUE; ++ } ++ g_object_unref(new_root); ++ } ++ while(vol->mounts) ++ { ++ GUDisksMount *mnt = vol->mounts->data; ++ GFile *f_root = g_mount_get_root(vol->mounts->data); ++ char *c_root = g_file_get_path(f_root); ++ g_debug("removing gone mount '%s'", c_root); ++ g_free(c_root); ++ g_object_unref(f_root); ++ vol->mounts = g_list_delete_link(vol->mounts, vol->mounts); ++ /* emit "mount-unmounted" signal */ ++ g_udisks_mount_unmounted(mnt); ++ g_object_unref(mnt); ++ changed = TRUE; ++ } ++ vol->mounts = g_list_reverse(new_list); ++ ++ g_strfreev(mount_points); ++ return changed; ++} ++ ++/** ++ * g_udisks_volume_get_mounts ++ * @vol: volume instance ++ * ++ * Retrieves currently mounted points. ++ * ++ * Returns: (element-type GUDisksMount)(transfer container): list of mounts. ++ */ ++GList *g_udisks_volume_get_mounts(GUDisksVolume* vol) ++{ ++ g_return_val_if_fail(G_IS_UDISKS_VOLUME(vol), NULL); ++ return g_list_copy(vol->mounts); ++} ++ ++/** ++ * g_udisks_volume_get_device ++ * @vol: volume instance ++ * ++ * Retrieves device which volume belongs to. ++ * ++ * Returns: (transfer none): GUDisksDevice instance. ++ */ ++GUDisksDevice *g_udisks_volume_get_device(GUDisksVolume* vol) ++{ ++ g_return_val_if_fail(G_IS_UDISKS_VOLUME(vol), NULL); ++ return vol->dev; ++} ++ ++const char *g_udisks_volume_get_obj_path(GUDisksVolume* vol) ++{ ++ g_return_val_if_fail(G_IS_UDISKS_VOLUME(vol), NULL); ++ return g_udisks_device_get_obj_path(vol->dev); + } + + void g_udisks_volume_removed(GUDisksVolume* vol) + { +- vol->drive = NULL; ++ g_return_if_fail(G_IS_UDISKS_VOLUME(vol)); ++ g_udisks_drive_del_volume(vol->drv, vol); + g_signal_emit(vol, sig_removed, 0); + } +diff --git a/src/udisks/g-udisks-volume.h b/src/udisks/g-udisks-volume.h +index 650a1c33..183ba758 100644 +--- a/src/udisks/g-udisks-volume.h ++++ b/src/udisks/g-udisks-volume.h +@@ -1,6 +1,7 @@ + // g-udisks-volume.h + // + // Copyright 2010 Hong Jen Yee (PCMan) ++// Copyright 2021 Andriy Grytsenko (LStranger) + // + // This program is free software; you can redistribute it and/or modify + // it under the terms of the GNU General Public License as published by +@@ -24,12 +25,9 @@ + #include + #include "g-udisks-device.h" + #include "g-udisks-drive.h" +-#include "g-udisks-mount.h" +-#include "g-udisks-volume-monitor.h" + + G_BEGIN_DECLS + +- + #define G_TYPE_UDISKS_VOLUME (g_udisks_volume_get_type()) + #define G_UDISKS_VOLUME(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),\ + G_TYPE_UDISKS_VOLUME, GUDisksVolume)) +@@ -45,29 +43,23 @@ G_BEGIN_DECLS + typedef struct _GUDisksVolume GUDisksVolume; + typedef struct _GUDisksVolumeClass GUDisksVolumeClass; + +-struct _GUDisksVolume +-{ +- GObject parent; +- GUDisksDevice* dev; +- GIcon* icon; +- char* name; +- GUDisksDrive* drive; +- GUDisksMount* mount; +- GUDisksVolumeMonitor* mon; +-}; + +-struct _GUDisksVolumeClass +-{ +- GObjectClass parent_class; +-}; ++GType g_udisks_volume_get_type(void); ++GUDisksVolume* g_udisks_volume_new(const char* obj_path, GDBusConnection* con, ++ GFile* activation_root, GUDisksDrive* drv, ++ GCancellable* cancellable, GError** error); + ++GList *g_udisks_volume_get_mounts(GUDisksVolume* vol); + +-GType g_udisks_volume_get_type(void); +-GUDisksVolume* g_udisks_volume_new(GUDisksVolumeMonitor* mon, GUDisksDevice* dev); ++GUDisksDevice *g_udisks_volume_get_device(GUDisksVolume* vol); ++const char *g_udisks_volume_get_obj_path(GUDisksVolume* vol); + +-void g_udisks_volume_changed(GUDisksVolume* vol); + void g_udisks_volume_removed(GUDisksVolume* vol); + ++/* these functions belongs to g-udisks-drive.h but are here for header sake */ ++void g_udisks_drive_add_volume(GUDisksDrive* drv, GUDisksVolume* vol); ++void g_udisks_drive_del_volume(GUDisksDrive* drv, GUDisksVolume* vol); ++ + G_END_DECLS + + #endif /* __G_UDISKS_VOLUME_H__ */ +diff --git a/src/udisks/gen-binding b/src/udisks/gen-binding +deleted file mode 100755 +index 08ac5004..00000000 +--- a/src/udisks/gen-binding ++++ /dev/null +@@ -1,3 +0,0 @@ +-#!/bin/sh +-dbus-binding-tool --mode=glib-client /usr/share/dbus-1/interfaces/org.freedesktop.UDisks.xml > udisks.h +-dbus-binding-tool --mode=glib-client /usr/share/dbus-1/interfaces/org.freedesktop.UDisks.Device.xml > udisks-device.h +diff --git a/src/udisks/udisks-device.h b/src/udisks/udisks-device.h +deleted file mode 100644 +index 7b3e2aef..00000000 +--- a/src/udisks/udisks-device.h ++++ /dev/null +@@ -1,1147 +0,0 @@ +-/* Generated by dbus-binding-tool; do not edit! */ +- +-#include +-#include +- +-G_BEGIN_DECLS +- +-#ifndef _DBUS_GLIB_ASYNC_DATA_FREE +-#define _DBUS_GLIB_ASYNC_DATA_FREE +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-void +-_dbus_glib_async_data_free (gpointer stuff) +-{ +- g_slice_free (DBusGAsyncData, stuff); +-} +-#endif +- +-#ifndef DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_UDisks_Device +-#define DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_UDisks_Device +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_job_cancel (DBusGProxy *proxy, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "JobCancel", error, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_job_cancel_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_job_cancel_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_job_cancel_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_job_cancel_async (DBusGProxy *proxy, org_freedesktop_UDisks_Device_job_cancel_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "JobCancel", org_freedesktop_UDisks_Device_job_cancel_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_partition_table_create (DBusGProxy *proxy, const char * IN_scheme, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "PartitionTableCreate", error, G_TYPE_STRING, IN_scheme, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_partition_table_create_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_partition_table_create_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_partition_table_create_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_partition_table_create_async (DBusGProxy *proxy, const char * IN_scheme, const char ** IN_options, org_freedesktop_UDisks_Device_partition_table_create_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "PartitionTableCreate", org_freedesktop_UDisks_Device_partition_table_create_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_scheme, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_partition_delete (DBusGProxy *proxy, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "PartitionDelete", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_partition_delete_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_partition_delete_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_partition_delete_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_partition_delete_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_Device_partition_delete_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "PartitionDelete", org_freedesktop_UDisks_Device_partition_delete_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_partition_create (DBusGProxy *proxy, const guint64 IN_offset, const guint64 IN_size, const char * IN_type, const char * IN_label, const char ** IN_flags, const char ** IN_options, const char * IN_fstype, const char ** IN_fsoptions, char** OUT_created_device, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "PartitionCreate", error, G_TYPE_UINT64, IN_offset, G_TYPE_UINT64, IN_size, G_TYPE_STRING, IN_type, G_TYPE_STRING, IN_label, G_TYPE_STRV, IN_flags, G_TYPE_STRV, IN_options, G_TYPE_STRING, IN_fstype, G_TYPE_STRV, IN_fsoptions, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, OUT_created_device, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_partition_create_reply) (DBusGProxy *proxy, char *OUT_created_device, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_partition_create_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char* OUT_created_device; +- dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_OBJECT_PATH, &OUT_created_device, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_partition_create_reply)data->cb) (proxy, OUT_created_device, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_partition_create_async (DBusGProxy *proxy, const guint64 IN_offset, const guint64 IN_size, const char * IN_type, const char * IN_label, const char ** IN_flags, const char ** IN_options, const char * IN_fstype, const char ** IN_fsoptions, org_freedesktop_UDisks_Device_partition_create_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "PartitionCreate", org_freedesktop_UDisks_Device_partition_create_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_UINT64, IN_offset, G_TYPE_UINT64, IN_size, G_TYPE_STRING, IN_type, G_TYPE_STRING, IN_label, G_TYPE_STRV, IN_flags, G_TYPE_STRV, IN_options, G_TYPE_STRING, IN_fstype, G_TYPE_STRV, IN_fsoptions, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_partition_modify (DBusGProxy *proxy, const char * IN_type, const char * IN_label, const char ** IN_flags, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "PartitionModify", error, G_TYPE_STRING, IN_type, G_TYPE_STRING, IN_label, G_TYPE_STRV, IN_flags, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_partition_modify_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_partition_modify_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_partition_modify_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_partition_modify_async (DBusGProxy *proxy, const char * IN_type, const char * IN_label, const char ** IN_flags, org_freedesktop_UDisks_Device_partition_modify_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "PartitionModify", org_freedesktop_UDisks_Device_partition_modify_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_type, G_TYPE_STRING, IN_label, G_TYPE_STRV, IN_flags, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_filesystem_create (DBusGProxy *proxy, const char * IN_fstype, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "FilesystemCreate", error, G_TYPE_STRING, IN_fstype, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_filesystem_create_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_filesystem_create_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_filesystem_create_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_filesystem_create_async (DBusGProxy *proxy, const char * IN_fstype, const char ** IN_options, org_freedesktop_UDisks_Device_filesystem_create_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "FilesystemCreate", org_freedesktop_UDisks_Device_filesystem_create_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_fstype, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_filesystem_set_label (DBusGProxy *proxy, const char * IN_new_label, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "FilesystemSetLabel", error, G_TYPE_STRING, IN_new_label, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_filesystem_set_label_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_filesystem_set_label_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_filesystem_set_label_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_filesystem_set_label_async (DBusGProxy *proxy, const char * IN_new_label, org_freedesktop_UDisks_Device_filesystem_set_label_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "FilesystemSetLabel", org_freedesktop_UDisks_Device_filesystem_set_label_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_new_label, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_filesystem_mount (DBusGProxy *proxy, const char * IN_filesystem_type, const char ** IN_options, char ** OUT_mount_path, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "FilesystemMount", error, G_TYPE_STRING, IN_filesystem_type, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_STRING, OUT_mount_path, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_filesystem_mount_reply) (DBusGProxy *proxy, char * OUT_mount_path, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_filesystem_mount_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char * OUT_mount_path; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_mount_path, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_filesystem_mount_reply)data->cb) (proxy, OUT_mount_path, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_filesystem_mount_async (DBusGProxy *proxy, const char * IN_filesystem_type, const char ** IN_options, org_freedesktop_UDisks_Device_filesystem_mount_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "FilesystemMount", org_freedesktop_UDisks_Device_filesystem_mount_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_filesystem_type, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_filesystem_unmount (DBusGProxy *proxy, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "FilesystemUnmount", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_filesystem_unmount_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_filesystem_unmount_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_filesystem_unmount_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_filesystem_unmount_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_Device_filesystem_unmount_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "FilesystemUnmount", org_freedesktop_UDisks_Device_filesystem_unmount_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_filesystem_check (DBusGProxy *proxy, const char ** IN_options, gboolean* OUT_is_clean, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "FilesystemCheck", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_BOOLEAN, OUT_is_clean, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_filesystem_check_reply) (DBusGProxy *proxy, gboolean OUT_is_clean, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_filesystem_check_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- gboolean OUT_is_clean; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_BOOLEAN, &OUT_is_clean, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_filesystem_check_reply)data->cb) (proxy, OUT_is_clean, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_filesystem_check_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_Device_filesystem_check_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "FilesystemCheck", org_freedesktop_UDisks_Device_filesystem_check_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_filesystem_list_open_files (DBusGProxy *proxy, GPtrArray** OUT_processes, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "FilesystemListOpenFiles", error, G_TYPE_INVALID, dbus_g_type_get_collection ("GPtrArray", dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_INVALID)), OUT_processes, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_filesystem_list_open_files_reply) (DBusGProxy *proxy, GPtrArray *OUT_processes, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_filesystem_list_open_files_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- GPtrArray* OUT_processes; +- dbus_g_proxy_end_call (proxy, call, &error, dbus_g_type_get_collection ("GPtrArray", dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_INVALID)), &OUT_processes, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_filesystem_list_open_files_reply)data->cb) (proxy, OUT_processes, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_filesystem_list_open_files_async (DBusGProxy *proxy, org_freedesktop_UDisks_Device_filesystem_list_open_files_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "FilesystemListOpenFiles", org_freedesktop_UDisks_Device_filesystem_list_open_files_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_luks_unlock (DBusGProxy *proxy, const char * IN_passphrase, const char ** IN_options, char** OUT_cleartext_device, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LuksUnlock", error, G_TYPE_STRING, IN_passphrase, G_TYPE_STRV, IN_options, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, OUT_cleartext_device, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_luks_unlock_reply) (DBusGProxy *proxy, char *OUT_cleartext_device, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_luks_unlock_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char* OUT_cleartext_device; +- dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_OBJECT_PATH, &OUT_cleartext_device, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_luks_unlock_reply)data->cb) (proxy, OUT_cleartext_device, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_luks_unlock_async (DBusGProxy *proxy, const char * IN_passphrase, const char ** IN_options, org_freedesktop_UDisks_Device_luks_unlock_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LuksUnlock", org_freedesktop_UDisks_Device_luks_unlock_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_passphrase, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_luks_lock (DBusGProxy *proxy, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LuksLock", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_luks_lock_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_luks_lock_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_luks_lock_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_luks_lock_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_Device_luks_lock_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LuksLock", org_freedesktop_UDisks_Device_luks_lock_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_luks_change_passphrase (DBusGProxy *proxy, const char * IN_current_passphrase, const char * IN_new_passphrase, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LuksChangePassphrase", error, G_TYPE_STRING, IN_current_passphrase, G_TYPE_STRING, IN_new_passphrase, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_luks_change_passphrase_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_luks_change_passphrase_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_luks_change_passphrase_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_luks_change_passphrase_async (DBusGProxy *proxy, const char * IN_current_passphrase, const char * IN_new_passphrase, org_freedesktop_UDisks_Device_luks_change_passphrase_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LuksChangePassphrase", org_freedesktop_UDisks_Device_luks_change_passphrase_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_current_passphrase, G_TYPE_STRING, IN_new_passphrase, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_linux_md_add_spare (DBusGProxy *proxy, const char* IN_component, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxMdAddSpare", error, DBUS_TYPE_G_OBJECT_PATH, IN_component, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_linux_md_add_spare_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_linux_md_add_spare_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_linux_md_add_spare_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_linux_md_add_spare_async (DBusGProxy *proxy, const char* IN_component, const char ** IN_options, org_freedesktop_UDisks_Device_linux_md_add_spare_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxMdAddSpare", org_freedesktop_UDisks_Device_linux_md_add_spare_async_callback, stuff, _dbus_glib_async_data_free, DBUS_TYPE_G_OBJECT_PATH, IN_component, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_linux_md_expand (DBusGProxy *proxy, const GPtrArray* IN_components, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxMdExpand", error, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), IN_components, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_linux_md_expand_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_linux_md_expand_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_linux_md_expand_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_linux_md_expand_async (DBusGProxy *proxy, const GPtrArray* IN_components, const char ** IN_options, org_freedesktop_UDisks_Device_linux_md_expand_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxMdExpand", org_freedesktop_UDisks_Device_linux_md_expand_async_callback, stuff, _dbus_glib_async_data_free, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), IN_components, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_linux_md_remove_component (DBusGProxy *proxy, const char* IN_component, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxMdRemoveComponent", error, DBUS_TYPE_G_OBJECT_PATH, IN_component, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_linux_md_remove_component_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_linux_md_remove_component_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_linux_md_remove_component_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_linux_md_remove_component_async (DBusGProxy *proxy, const char* IN_component, const char ** IN_options, org_freedesktop_UDisks_Device_linux_md_remove_component_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxMdRemoveComponent", org_freedesktop_UDisks_Device_linux_md_remove_component_async_callback, stuff, _dbus_glib_async_data_free, DBUS_TYPE_G_OBJECT_PATH, IN_component, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_linux_md_stop (DBusGProxy *proxy, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxMdStop", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_linux_md_stop_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_linux_md_stop_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_linux_md_stop_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_linux_md_stop_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_Device_linux_md_stop_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxMdStop", org_freedesktop_UDisks_Device_linux_md_stop_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_linux_lvm2_lv_stop (DBusGProxy *proxy, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxLvm2LVStop", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_linux_lvm2_lv_stop_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_linux_lvm2_lv_stop_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_linux_lvm2_lv_stop_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_linux_lvm2_lv_stop_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_Device_linux_lvm2_lv_stop_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxLvm2LVStop", org_freedesktop_UDisks_Device_linux_lvm2_lv_stop_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_linux_md_check (DBusGProxy *proxy, const char ** IN_options, guint64* OUT_number_of_errors, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxMdCheck", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_UINT64, OUT_number_of_errors, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_linux_md_check_reply) (DBusGProxy *proxy, guint64 OUT_number_of_errors, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_linux_md_check_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- guint64 OUT_number_of_errors; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT64, &OUT_number_of_errors, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_linux_md_check_reply)data->cb) (proxy, OUT_number_of_errors, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_linux_md_check_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_Device_linux_md_check_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxMdCheck", org_freedesktop_UDisks_Device_linux_md_check_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_drive_inhibit_polling (DBusGProxy *proxy, const char ** IN_options, char ** OUT_cookie, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveInhibitPolling", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_STRING, OUT_cookie, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_drive_inhibit_polling_reply) (DBusGProxy *proxy, char * OUT_cookie, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_drive_inhibit_polling_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char * OUT_cookie; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_cookie, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_drive_inhibit_polling_reply)data->cb) (proxy, OUT_cookie, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_drive_inhibit_polling_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_Device_drive_inhibit_polling_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveInhibitPolling", org_freedesktop_UDisks_Device_drive_inhibit_polling_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_drive_uninhibit_polling (DBusGProxy *proxy, const char * IN_cookie, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveUninhibitPolling", error, G_TYPE_STRING, IN_cookie, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_drive_uninhibit_polling_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_drive_uninhibit_polling_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_drive_uninhibit_polling_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_drive_uninhibit_polling_async (DBusGProxy *proxy, const char * IN_cookie, org_freedesktop_UDisks_Device_drive_uninhibit_polling_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveUninhibitPolling", org_freedesktop_UDisks_Device_drive_uninhibit_polling_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_cookie, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_drive_poll_media (DBusGProxy *proxy, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DrivePollMedia", error, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_drive_poll_media_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_drive_poll_media_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_drive_poll_media_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_drive_poll_media_async (DBusGProxy *proxy, org_freedesktop_UDisks_Device_drive_poll_media_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DrivePollMedia", org_freedesktop_UDisks_Device_drive_poll_media_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_drive_eject (DBusGProxy *proxy, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveEject", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_drive_eject_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_drive_eject_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_drive_eject_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_drive_eject_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_Device_drive_eject_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveEject", org_freedesktop_UDisks_Device_drive_eject_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_drive_detach (DBusGProxy *proxy, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveDetach", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_drive_detach_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_drive_detach_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_drive_detach_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_drive_detach_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_Device_drive_detach_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveDetach", org_freedesktop_UDisks_Device_drive_detach_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_drive_set_spindown_timeout (DBusGProxy *proxy, const gint IN_timeout_seconds, const char ** IN_options, char ** OUT_cookie, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveSetSpindownTimeout", error, G_TYPE_INT, IN_timeout_seconds, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_STRING, OUT_cookie, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_drive_set_spindown_timeout_reply) (DBusGProxy *proxy, char * OUT_cookie, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_drive_set_spindown_timeout_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char * OUT_cookie; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_cookie, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_drive_set_spindown_timeout_reply)data->cb) (proxy, OUT_cookie, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_drive_set_spindown_timeout_async (DBusGProxy *proxy, const gint IN_timeout_seconds, const char ** IN_options, org_freedesktop_UDisks_Device_drive_set_spindown_timeout_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveSetSpindownTimeout", org_freedesktop_UDisks_Device_drive_set_spindown_timeout_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INT, IN_timeout_seconds, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_drive_unset_spindown_timeout (DBusGProxy *proxy, const char * IN_cookie, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveUnsetSpindownTimeout", error, G_TYPE_STRING, IN_cookie, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_drive_unset_spindown_timeout_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_drive_unset_spindown_timeout_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_drive_unset_spindown_timeout_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_drive_unset_spindown_timeout_async (DBusGProxy *proxy, const char * IN_cookie, org_freedesktop_UDisks_Device_drive_unset_spindown_timeout_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveUnsetSpindownTimeout", org_freedesktop_UDisks_Device_drive_unset_spindown_timeout_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_cookie, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_drive_ata_smart_refresh_data (DBusGProxy *proxy, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveAtaSmartRefreshData", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_drive_ata_smart_refresh_data_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_drive_ata_smart_refresh_data_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_drive_ata_smart_refresh_data_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_drive_ata_smart_refresh_data_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_Device_drive_ata_smart_refresh_data_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveAtaSmartRefreshData", org_freedesktop_UDisks_Device_drive_ata_smart_refresh_data_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_drive_ata_smart_initiate_selftest (DBusGProxy *proxy, const char * IN_test, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveAtaSmartInitiateSelftest", error, G_TYPE_STRING, IN_test, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_drive_ata_smart_initiate_selftest_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_drive_ata_smart_initiate_selftest_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_drive_ata_smart_initiate_selftest_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_drive_ata_smart_initiate_selftest_async (DBusGProxy *proxy, const char * IN_test, const char ** IN_options, org_freedesktop_UDisks_Device_drive_ata_smart_initiate_selftest_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveAtaSmartInitiateSelftest", org_freedesktop_UDisks_Device_drive_ata_smart_initiate_selftest_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_test, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_Device_drive_benchmark (DBusGProxy *proxy, const gboolean IN_do_write_benchmark, const char ** IN_options, GPtrArray** OUT_read_transfer_rate_results, GPtrArray** OUT_write_transfer_rate_results, GPtrArray** OUT_access_time_results, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveBenchmark", error, G_TYPE_BOOLEAN, IN_do_write_benchmark, G_TYPE_STRV, IN_options, G_TYPE_INVALID, dbus_g_type_get_collection ("GPtrArray", dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT64, G_TYPE_DOUBLE, G_TYPE_INVALID)), OUT_read_transfer_rate_results, dbus_g_type_get_collection ("GPtrArray", dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT64, G_TYPE_DOUBLE, G_TYPE_INVALID)), OUT_write_transfer_rate_results, dbus_g_type_get_collection ("GPtrArray", dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT64, G_TYPE_DOUBLE, G_TYPE_INVALID)), OUT_access_time_results, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_Device_drive_benchmark_reply) (DBusGProxy *proxy, GPtrArray *OUT_read_transfer_rate_results, GPtrArray *OUT_write_transfer_rate_results, GPtrArray *OUT_access_time_results, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_Device_drive_benchmark_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- GPtrArray* OUT_read_transfer_rate_results; +- GPtrArray* OUT_write_transfer_rate_results; +- GPtrArray* OUT_access_time_results; +- dbus_g_proxy_end_call (proxy, call, &error, dbus_g_type_get_collection ("GPtrArray", dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT64, G_TYPE_DOUBLE, G_TYPE_INVALID)), &OUT_read_transfer_rate_results, dbus_g_type_get_collection ("GPtrArray", dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT64, G_TYPE_DOUBLE, G_TYPE_INVALID)), &OUT_write_transfer_rate_results, dbus_g_type_get_collection ("GPtrArray", dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT64, G_TYPE_DOUBLE, G_TYPE_INVALID)), &OUT_access_time_results, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_Device_drive_benchmark_reply)data->cb) (proxy, OUT_read_transfer_rate_results, OUT_write_transfer_rate_results, OUT_access_time_results, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_Device_drive_benchmark_async (DBusGProxy *proxy, const gboolean IN_do_write_benchmark, const char ** IN_options, org_freedesktop_UDisks_Device_drive_benchmark_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveBenchmark", org_freedesktop_UDisks_Device_drive_benchmark_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_BOOLEAN, IN_do_write_benchmark, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-#endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_UDisks_Device */ +- +-G_END_DECLS +diff --git a/src/udisks/udisks.h b/src/udisks/udisks.h +deleted file mode 100644 +index 9bf0baae..00000000 +--- a/src/udisks/udisks.h ++++ /dev/null +@@ -1,927 +0,0 @@ +-/* Generated by dbus-binding-tool; do not edit! */ +- +-#include +-#include +- +-G_BEGIN_DECLS +- +-#ifndef _DBUS_GLIB_ASYNC_DATA_FREE +-#define _DBUS_GLIB_ASYNC_DATA_FREE +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-void +-_dbus_glib_async_data_free (gpointer stuff) +-{ +- g_slice_free (DBusGAsyncData, stuff); +-} +-#endif +- +-#ifndef DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_UDisks +-#define DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_UDisks +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_enumerate_adapters (DBusGProxy *proxy, GPtrArray** OUT_devices, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "EnumerateAdapters", error, G_TYPE_INVALID, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), OUT_devices, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_enumerate_adapters_reply) (DBusGProxy *proxy, GPtrArray *OUT_devices, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_enumerate_adapters_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- GPtrArray* OUT_devices; +- dbus_g_proxy_end_call (proxy, call, &error, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), &OUT_devices, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_enumerate_adapters_reply)data->cb) (proxy, OUT_devices, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_enumerate_adapters_async (DBusGProxy *proxy, org_freedesktop_UDisks_enumerate_adapters_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "EnumerateAdapters", org_freedesktop_UDisks_enumerate_adapters_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_enumerate_expanders (DBusGProxy *proxy, GPtrArray** OUT_devices, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "EnumerateExpanders", error, G_TYPE_INVALID, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), OUT_devices, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_enumerate_expanders_reply) (DBusGProxy *proxy, GPtrArray *OUT_devices, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_enumerate_expanders_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- GPtrArray* OUT_devices; +- dbus_g_proxy_end_call (proxy, call, &error, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), &OUT_devices, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_enumerate_expanders_reply)data->cb) (proxy, OUT_devices, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_enumerate_expanders_async (DBusGProxy *proxy, org_freedesktop_UDisks_enumerate_expanders_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "EnumerateExpanders", org_freedesktop_UDisks_enumerate_expanders_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_enumerate_ports (DBusGProxy *proxy, GPtrArray** OUT_devices, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "EnumeratePorts", error, G_TYPE_INVALID, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), OUT_devices, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_enumerate_ports_reply) (DBusGProxy *proxy, GPtrArray *OUT_devices, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_enumerate_ports_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- GPtrArray* OUT_devices; +- dbus_g_proxy_end_call (proxy, call, &error, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), &OUT_devices, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_enumerate_ports_reply)data->cb) (proxy, OUT_devices, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_enumerate_ports_async (DBusGProxy *proxy, org_freedesktop_UDisks_enumerate_ports_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "EnumeratePorts", org_freedesktop_UDisks_enumerate_ports_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_enumerate_devices (DBusGProxy *proxy, GPtrArray** OUT_devices, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "EnumerateDevices", error, G_TYPE_INVALID, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), OUT_devices, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_enumerate_devices_reply) (DBusGProxy *proxy, GPtrArray *OUT_devices, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_enumerate_devices_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- GPtrArray* OUT_devices; +- dbus_g_proxy_end_call (proxy, call, &error, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), &OUT_devices, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_enumerate_devices_reply)data->cb) (proxy, OUT_devices, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_enumerate_devices_async (DBusGProxy *proxy, org_freedesktop_UDisks_enumerate_devices_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "EnumerateDevices", org_freedesktop_UDisks_enumerate_devices_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_enumerate_device_files (DBusGProxy *proxy, char *** OUT_device_files, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "EnumerateDeviceFiles", error, G_TYPE_INVALID, G_TYPE_STRV, OUT_device_files, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_enumerate_device_files_reply) (DBusGProxy *proxy, char * *OUT_device_files, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_enumerate_device_files_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char ** OUT_device_files; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_device_files, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_enumerate_device_files_reply)data->cb) (proxy, OUT_device_files, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_enumerate_device_files_async (DBusGProxy *proxy, org_freedesktop_UDisks_enumerate_device_files_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "EnumerateDeviceFiles", org_freedesktop_UDisks_enumerate_device_files_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_find_device_by_device_file (DBusGProxy *proxy, const char * IN_device_file, char** OUT_device, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "FindDeviceByDeviceFile", error, G_TYPE_STRING, IN_device_file, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, OUT_device, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_find_device_by_device_file_reply) (DBusGProxy *proxy, char *OUT_device, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_find_device_by_device_file_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char* OUT_device; +- dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_OBJECT_PATH, &OUT_device, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_find_device_by_device_file_reply)data->cb) (proxy, OUT_device, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_find_device_by_device_file_async (DBusGProxy *proxy, const char * IN_device_file, org_freedesktop_UDisks_find_device_by_device_file_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "FindDeviceByDeviceFile", org_freedesktop_UDisks_find_device_by_device_file_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_device_file, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_find_device_by_major_minor (DBusGProxy *proxy, const gint64 IN_device_major, const gint64 IN_device_minor, char** OUT_device, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "FindDeviceByMajorMinor", error, G_TYPE_INT64, IN_device_major, G_TYPE_INT64, IN_device_minor, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, OUT_device, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_find_device_by_major_minor_reply) (DBusGProxy *proxy, char *OUT_device, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_find_device_by_major_minor_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char* OUT_device; +- dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_OBJECT_PATH, &OUT_device, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_find_device_by_major_minor_reply)data->cb) (proxy, OUT_device, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_find_device_by_major_minor_async (DBusGProxy *proxy, const gint64 IN_device_major, const gint64 IN_device_minor, org_freedesktop_UDisks_find_device_by_major_minor_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "FindDeviceByMajorMinor", org_freedesktop_UDisks_find_device_by_major_minor_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INT64, IN_device_major, G_TYPE_INT64, IN_device_minor, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_drive_inhibit_all_polling (DBusGProxy *proxy, const char ** IN_options, char ** OUT_cookie, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveInhibitAllPolling", error, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_STRING, OUT_cookie, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_drive_inhibit_all_polling_reply) (DBusGProxy *proxy, char * OUT_cookie, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_drive_inhibit_all_polling_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char * OUT_cookie; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_cookie, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_drive_inhibit_all_polling_reply)data->cb) (proxy, OUT_cookie, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_drive_inhibit_all_polling_async (DBusGProxy *proxy, const char ** IN_options, org_freedesktop_UDisks_drive_inhibit_all_polling_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveInhibitAllPolling", org_freedesktop_UDisks_drive_inhibit_all_polling_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_drive_uninhibit_all_polling (DBusGProxy *proxy, const char * IN_cookie, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveUninhibitAllPolling", error, G_TYPE_STRING, IN_cookie, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_drive_uninhibit_all_polling_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_drive_uninhibit_all_polling_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_drive_uninhibit_all_polling_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_drive_uninhibit_all_polling_async (DBusGProxy *proxy, const char * IN_cookie, org_freedesktop_UDisks_drive_uninhibit_all_polling_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveUninhibitAllPolling", org_freedesktop_UDisks_drive_uninhibit_all_polling_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_cookie, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_drive_set_all_spindown_timeouts (DBusGProxy *proxy, const gint IN_timeout_seconds, const char ** IN_options, char ** OUT_cookie, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveSetAllSpindownTimeouts", error, G_TYPE_INT, IN_timeout_seconds, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_STRING, OUT_cookie, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_drive_set_all_spindown_timeouts_reply) (DBusGProxy *proxy, char * OUT_cookie, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_drive_set_all_spindown_timeouts_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char * OUT_cookie; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_cookie, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_drive_set_all_spindown_timeouts_reply)data->cb) (proxy, OUT_cookie, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_drive_set_all_spindown_timeouts_async (DBusGProxy *proxy, const gint IN_timeout_seconds, const char ** IN_options, org_freedesktop_UDisks_drive_set_all_spindown_timeouts_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveSetAllSpindownTimeouts", org_freedesktop_UDisks_drive_set_all_spindown_timeouts_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INT, IN_timeout_seconds, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_drive_unset_all_spindown_timeouts (DBusGProxy *proxy, const char * IN_cookie, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "DriveUnsetAllSpindownTimeouts", error, G_TYPE_STRING, IN_cookie, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_drive_unset_all_spindown_timeouts_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_drive_unset_all_spindown_timeouts_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_drive_unset_all_spindown_timeouts_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_drive_unset_all_spindown_timeouts_async (DBusGProxy *proxy, const char * IN_cookie, org_freedesktop_UDisks_drive_unset_all_spindown_timeouts_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "DriveUnsetAllSpindownTimeouts", org_freedesktop_UDisks_drive_unset_all_spindown_timeouts_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_cookie, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_linux_lvm2_vg_start (DBusGProxy *proxy, const char * IN_uuid, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxLvm2VGStart", error, G_TYPE_STRING, IN_uuid, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_linux_lvm2_vg_start_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_linux_lvm2_vg_start_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_linux_lvm2_vg_start_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_linux_lvm2_vg_start_async (DBusGProxy *proxy, const char * IN_uuid, const char ** IN_options, org_freedesktop_UDisks_linux_lvm2_vg_start_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxLvm2VGStart", org_freedesktop_UDisks_linux_lvm2_vg_start_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_uuid, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_linux_lvm2_vg_stop (DBusGProxy *proxy, const char * IN_uuid, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxLvm2VGStop", error, G_TYPE_STRING, IN_uuid, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_linux_lvm2_vg_stop_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_linux_lvm2_vg_stop_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_linux_lvm2_vg_stop_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_linux_lvm2_vg_stop_async (DBusGProxy *proxy, const char * IN_uuid, const char ** IN_options, org_freedesktop_UDisks_linux_lvm2_vg_stop_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxLvm2VGStop", org_freedesktop_UDisks_linux_lvm2_vg_stop_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_uuid, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_linux_lvm2_vg_set_name (DBusGProxy *proxy, const char * IN_uuid, const char * IN_name, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxLvm2VGSetName", error, G_TYPE_STRING, IN_uuid, G_TYPE_STRING, IN_name, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_linux_lvm2_vg_set_name_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_linux_lvm2_vg_set_name_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_linux_lvm2_vg_set_name_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_linux_lvm2_vg_set_name_async (DBusGProxy *proxy, const char * IN_uuid, const char * IN_name, org_freedesktop_UDisks_linux_lvm2_vg_set_name_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxLvm2VGSetName", org_freedesktop_UDisks_linux_lvm2_vg_set_name_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_uuid, G_TYPE_STRING, IN_name, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_linux_lvm2_vg_add_pv (DBusGProxy *proxy, const char * IN_uuid, const char* IN_physical_volume, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxLvm2VGAddPV", error, G_TYPE_STRING, IN_uuid, DBUS_TYPE_G_OBJECT_PATH, IN_physical_volume, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_linux_lvm2_vg_add_pv_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_linux_lvm2_vg_add_pv_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_linux_lvm2_vg_add_pv_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_linux_lvm2_vg_add_pv_async (DBusGProxy *proxy, const char * IN_uuid, const char* IN_physical_volume, const char ** IN_options, org_freedesktop_UDisks_linux_lvm2_vg_add_pv_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxLvm2VGAddPV", org_freedesktop_UDisks_linux_lvm2_vg_add_pv_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_uuid, DBUS_TYPE_G_OBJECT_PATH, IN_physical_volume, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_linux_lvm2_vg_remove_pv (DBusGProxy *proxy, const char * IN_vg_uuid, const char * IN_pv_uuid, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxLvm2VGRemovePV", error, G_TYPE_STRING, IN_vg_uuid, G_TYPE_STRING, IN_pv_uuid, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_linux_lvm2_vg_remove_pv_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_linux_lvm2_vg_remove_pv_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_linux_lvm2_vg_remove_pv_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_linux_lvm2_vg_remove_pv_async (DBusGProxy *proxy, const char * IN_vg_uuid, const char * IN_pv_uuid, const char ** IN_options, org_freedesktop_UDisks_linux_lvm2_vg_remove_pv_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxLvm2VGRemovePV", org_freedesktop_UDisks_linux_lvm2_vg_remove_pv_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_vg_uuid, G_TYPE_STRING, IN_pv_uuid, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_linux_lvm2_lv_set_name (DBusGProxy *proxy, const char * IN_group_uuid, const char * IN_uuid, const char * IN_name, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxLvm2LVSetName", error, G_TYPE_STRING, IN_group_uuid, G_TYPE_STRING, IN_uuid, G_TYPE_STRING, IN_name, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_linux_lvm2_lv_set_name_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_linux_lvm2_lv_set_name_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_linux_lvm2_lv_set_name_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_linux_lvm2_lv_set_name_async (DBusGProxy *proxy, const char * IN_group_uuid, const char * IN_uuid, const char * IN_name, org_freedesktop_UDisks_linux_lvm2_lv_set_name_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxLvm2LVSetName", org_freedesktop_UDisks_linux_lvm2_lv_set_name_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_group_uuid, G_TYPE_STRING, IN_uuid, G_TYPE_STRING, IN_name, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_linux_lvm2_lv_start (DBusGProxy *proxy, const char * IN_group_uuid, const char * IN_uuid, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxLvm2LVStart", error, G_TYPE_STRING, IN_group_uuid, G_TYPE_STRING, IN_uuid, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_linux_lvm2_lv_start_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_linux_lvm2_lv_start_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_linux_lvm2_lv_start_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_linux_lvm2_lv_start_async (DBusGProxy *proxy, const char * IN_group_uuid, const char * IN_uuid, const char ** IN_options, org_freedesktop_UDisks_linux_lvm2_lv_start_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxLvm2LVStart", org_freedesktop_UDisks_linux_lvm2_lv_start_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_group_uuid, G_TYPE_STRING, IN_uuid, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_linux_lvm2_lv_remove (DBusGProxy *proxy, const char * IN_group_uuid, const char * IN_uuid, const char ** IN_options, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxLvm2LVRemove", error, G_TYPE_STRING, IN_group_uuid, G_TYPE_STRING, IN_uuid, G_TYPE_STRV, IN_options, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_linux_lvm2_lv_remove_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_linux_lvm2_lv_remove_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_linux_lvm2_lv_remove_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_linux_lvm2_lv_remove_async (DBusGProxy *proxy, const char * IN_group_uuid, const char * IN_uuid, const char ** IN_options, org_freedesktop_UDisks_linux_lvm2_lv_remove_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxLvm2LVRemove", org_freedesktop_UDisks_linux_lvm2_lv_remove_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_group_uuid, G_TYPE_STRING, IN_uuid, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_linux_lvm2_lv_create (DBusGProxy *proxy, const char * IN_group_uuid, const char * IN_name, const guint64 IN_size, const guint IN_num_stripes, const guint64 IN_stripe_size, const guint IN_num_mirrors, const char ** IN_options, const char * IN_fstype, const char ** IN_fsoptions, char** OUT_created_device, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxLvm2LVCreate", error, G_TYPE_STRING, IN_group_uuid, G_TYPE_STRING, IN_name, G_TYPE_UINT64, IN_size, G_TYPE_UINT, IN_num_stripes, G_TYPE_UINT64, IN_stripe_size, G_TYPE_UINT, IN_num_mirrors, G_TYPE_STRV, IN_options, G_TYPE_STRING, IN_fstype, G_TYPE_STRV, IN_fsoptions, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, OUT_created_device, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_linux_lvm2_lv_create_reply) (DBusGProxy *proxy, char *OUT_created_device, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_linux_lvm2_lv_create_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char* OUT_created_device; +- dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_OBJECT_PATH, &OUT_created_device, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_linux_lvm2_lv_create_reply)data->cb) (proxy, OUT_created_device, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_linux_lvm2_lv_create_async (DBusGProxy *proxy, const char * IN_group_uuid, const char * IN_name, const guint64 IN_size, const guint IN_num_stripes, const guint64 IN_stripe_size, const guint IN_num_mirrors, const char ** IN_options, const char * IN_fstype, const char ** IN_fsoptions, org_freedesktop_UDisks_linux_lvm2_lv_create_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxLvm2LVCreate", org_freedesktop_UDisks_linux_lvm2_lv_create_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_group_uuid, G_TYPE_STRING, IN_name, G_TYPE_UINT64, IN_size, G_TYPE_UINT, IN_num_stripes, G_TYPE_UINT64, IN_stripe_size, G_TYPE_UINT, IN_num_mirrors, G_TYPE_STRV, IN_options, G_TYPE_STRING, IN_fstype, G_TYPE_STRV, IN_fsoptions, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_linux_md_start (DBusGProxy *proxy, const GPtrArray* IN_components, const char ** IN_options, char** OUT_device, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxMdStart", error, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), IN_components, G_TYPE_STRV, IN_options, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, OUT_device, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_linux_md_start_reply) (DBusGProxy *proxy, char *OUT_device, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_linux_md_start_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char* OUT_device; +- dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_OBJECT_PATH, &OUT_device, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_linux_md_start_reply)data->cb) (proxy, OUT_device, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_linux_md_start_async (DBusGProxy *proxy, const GPtrArray* IN_components, const char ** IN_options, org_freedesktop_UDisks_linux_md_start_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxMdStart", org_freedesktop_UDisks_linux_md_start_async_callback, stuff, _dbus_glib_async_data_free, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), IN_components, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_linux_md_create (DBusGProxy *proxy, const GPtrArray* IN_components, const char * IN_level, const guint64 IN_stripe_size, const char * IN_name, const char ** IN_options, char** OUT_device, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "LinuxMdCreate", error, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), IN_components, G_TYPE_STRING, IN_level, G_TYPE_UINT64, IN_stripe_size, G_TYPE_STRING, IN_name, G_TYPE_STRV, IN_options, G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, OUT_device, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_linux_md_create_reply) (DBusGProxy *proxy, char *OUT_device, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_linux_md_create_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char* OUT_device; +- dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_OBJECT_PATH, &OUT_device, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_linux_md_create_reply)data->cb) (proxy, OUT_device, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_linux_md_create_async (DBusGProxy *proxy, const GPtrArray* IN_components, const char * IN_level, const guint64 IN_stripe_size, const char * IN_name, const char ** IN_options, org_freedesktop_UDisks_linux_md_create_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "LinuxMdCreate", org_freedesktop_UDisks_linux_md_create_async_callback, stuff, _dbus_glib_async_data_free, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), IN_components, G_TYPE_STRING, IN_level, G_TYPE_UINT64, IN_stripe_size, G_TYPE_STRING, IN_name, G_TYPE_STRV, IN_options, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_inhibit (DBusGProxy *proxy, char ** OUT_cookie, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "Inhibit", error, G_TYPE_INVALID, G_TYPE_STRING, OUT_cookie, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_inhibit_reply) (DBusGProxy *proxy, char * OUT_cookie, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_inhibit_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- char * OUT_cookie; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_cookie, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_inhibit_reply)data->cb) (proxy, OUT_cookie, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_inhibit_async (DBusGProxy *proxy, org_freedesktop_UDisks_inhibit_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "Inhibit", org_freedesktop_UDisks_inhibit_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); +-} +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-gboolean +-org_freedesktop_UDisks_uninhibit (DBusGProxy *proxy, const char * IN_cookie, GError **error) +- +-{ +- return dbus_g_proxy_call (proxy, "Uninhibit", error, G_TYPE_STRING, IN_cookie, G_TYPE_INVALID, G_TYPE_INVALID); +-} +- +-typedef void (*org_freedesktop_UDisks_uninhibit_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); +- +-static void +-org_freedesktop_UDisks_uninhibit_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +-{ +- DBusGAsyncData *data = (DBusGAsyncData*) user_data; +- GError *error = NULL; +- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); +- (*(org_freedesktop_UDisks_uninhibit_reply)data->cb) (proxy, error, data->userdata); +- return; +-} +- +-static +-#ifdef G_HAVE_INLINE +-inline +-#endif +-DBusGProxyCall* +-org_freedesktop_UDisks_uninhibit_async (DBusGProxy *proxy, const char * IN_cookie, org_freedesktop_UDisks_uninhibit_reply callback, gpointer userdata) +- +-{ +- DBusGAsyncData *stuff; +- stuff = g_slice_new (DBusGAsyncData); +- stuff->cb = G_CALLBACK (callback); +- stuff->userdata = userdata; +- return dbus_g_proxy_begin_call (proxy, "Uninhibit", org_freedesktop_UDisks_uninhibit_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_cookie, G_TYPE_INVALID); +-} +-#endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_UDisks */ +- +-G_END_DECLS diff --git a/x11/libs/libfm/ympbuild b/x11/libs/libfm/ympbuild index 665a2e66..362c0630 100644 --- a/x11/libs/libfm/ympbuild +++ b/x11/libs/libfm/ympbuild @@ -7,10 +7,12 @@ description='Package description missing' email='bk@gmail.com' maintainer='bk' license=('GPLv3') -source=('https://github.com/lxde/libfm/archive/refs/tags/1.3.2.tar.gz') +source=('https://github.com/lxde/libfm/archive/refs/tags/1.3.2.tar.gz' + 'libfm-fixes.patch') depends=(gtk3 pango intltool) makedepends=() -md5sums=('8b2864ba2d21586171ab9616b5610aeb') +md5sums=('8b2864ba2d21586171ab9616b5610aeb' + 'SKIP') group=() uses=() uses_extra=(extra-only) @@ -18,6 +20,10 @@ arch=('x86_64') cd $name-$version +prepare(){ + patch -Np1 -i ../libfm-fixes.patch +} + setup(){ autoreconf -fvi ./configure --prefix=/usr \