summaryrefslogtreecommitdiff
path: root/libs/ardour/lv2_plugin.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-04-14 12:53:30 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-04-14 12:53:30 -0400
commit99bf5d9eeda1e5e1811d660c0c22bb5a2d4984c0 (patch)
tree575dfd6b04936b46787cbc5358e169bfbfc63380 /libs/ardour/lv2_plugin.cc
parenteef4e1efee2ae76fac181c078b46ca3bc6d33d2e (diff)
backport 1d85ab27a7e and ba128eea from cairocanvas branch to remove GIO (possible hotfix release)
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r--libs/ardour/lv2_plugin.cc24
1 files changed, 2 insertions, 22 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index a0720044d4..204ae2c694 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -31,6 +31,7 @@
#include <boost/utility.hpp>
+#include "pbd/clear_dir.h"
#include "pbd/pathscanner.h"
#include "pbd/compose.h"
#include "pbd/error.h"
@@ -880,27 +881,6 @@ LV2Plugin::lv2_state_make_path(LV2_State_Make_Path_Handle handle,
return g_strndup(abs_path.c_str(), abs_path.length());
}
-static void
-remove_directory(const std::string& path)
-{
- if (!Glib::file_test(path, Glib::FILE_TEST_IS_DIR)) {
- warning << string_compose("\"%1\" is not a directory", path) << endmsg;
- return;
- }
-
- Glib::RefPtr<Gio::File> dir = Gio::File::create_for_path(path);
- Glib::RefPtr<Gio::FileEnumerator> e = dir->enumerate_children();
- Glib::RefPtr<Gio::FileInfo> fi;
- while ((fi = e->next_file())) {
- if (fi->get_type() == Gio::FILE_TYPE_DIRECTORY) {
- remove_directory(fi->get_name());
- } else {
- dir->get_child(fi->get_name())->remove();
- }
- }
- dir->remove();
-}
-
void
LV2Plugin::add_state(XMLNode* root) const
{
@@ -952,7 +932,7 @@ LV2Plugin::add_state(XMLNode* root) const
} else {
// State is identical, decrement version and nuke directory
lilv_state_free(state);
- remove_directory(new_dir);
+ PBD::remove_directory(new_dir);
--_state_version;
}