summaryrefslogtreecommitdiff
blob: 655427f1d638575020d83ef534e99398f6188347 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff -Naurp filer-0.0.12/Filer/Config.pm filer-0.0.12.new/Filer/Config.pm
--- filer-0.0.12/Filer/Config.pm	2005-07-03 14:48:23.000000000 -0400
+++ filer-0.0.12.new/Filer/Config.pm	2006-09-06 10:28:03.000000000 -0400
@@ -22,7 +22,15 @@ use warnings;
 sub new {
 	my ($class,$side) = @_;
 	my $self = bless {}, $class;
-	$self->{cfg_home} = (new File::BaseDir)->xdg_config_home . "/filer";
+
+	my $xdg_config_home = File::BaseDir::xdg_config_home;
+	my $xdg_data_home = File::BaseDir::xdg_data_home;
+
+	$self->{cfg_home} = "$xdg_config_home/filer";
+
+	if (! -e $xdg_config_home) {
+		mkdir($xdg_config_home);
+	}
 
 	# move old config directory if it exists:
 	if (-e "$ENV{HOME}/.filer/") {
@@ -30,14 +38,24 @@ sub new {
 		rename("$ENV{HOME}/.filer", $self->{cfg_home});
 	}
 
-	if (! -e File::BaseDir::xdg_config_home) {
-		mkdir(File::BaseDir::xdg_config_home);
-	}
-
 	if (! -e $self->{cfg_home}) {
 		mkdir($self->{cfg_home});
 	}
 
+	if (! -e $xdg_data_home) {
+		mkdir($xdg_data_home);
+	}
+
+	my $trashdir = $xdg_data_home . "/Trash";
+	my $trashdir_files = "$trashdir/files";
+	my $trashdir_info = "$trashdir/info";
+
+    if (! -e $trashdir) {
+        mkdir($trashdir);
+        mkdir($trashdir_files);
+        mkdir($trashdir_info);
+    }
+
 	if (! -e "$self->{cfg_home}/config") {
 		my $cfg = {
 			PathLeft		=> $ENV{HOME},