summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-03-26 09:15:31 +0200
committerDaniel Friesel <derf@finalrewind.org>2017-03-26 09:15:31 +0200
commitd7607133e13621661a55efb65d6d20b02901ff40 (patch)
treee3aa41b07930d22446c0794059b235c4f5edc6cd
parent8d95cbea15ecca3fe14bf9c02a00f1c0d678ebb6 (diff)
Use system-provided Oxygen icons instead of shipping them with the module
-rw-r--r--Build.PL1
-rwxr-xr-xlib/App/Dthumb.pm17
-rw-r--r--share/folder-blue.pngbin3233 -> 0 bytes
-rw-r--r--share/unknown.pngbin6873 -> 0 bytes
4 files changed, 18 insertions, 0 deletions
diff --git a/Build.PL b/Build.PL
index 2844668..cc0a9e5 100644
--- a/Build.PL
+++ b/Build.PL
@@ -23,6 +23,7 @@ my $build = Module::Build->new(
'autodie' => 0,
'Cwd' => 0,
'Data::Section' => 0,
+ 'File::Copy' => 0,
'Getopt::Long' => 0,
'Image::Imlib2' => 0,
'IO::Handle' => 0,
diff --git a/lib/App/Dthumb.pm b/lib/App/Dthumb.pm
index a478c7d..0223016 100755
--- a/lib/App/Dthumb.pm
+++ b/lib/App/Dthumb.pm
@@ -6,6 +6,7 @@ use 5.010;
use App::Dthumb::Data;
use Cwd;
+use File::Copy qw(copy);
use File::Slurp qw(read_dir write_file);
use Image::Imlib2;
@@ -30,6 +31,8 @@ sub new {
$conf{names} //= ( $conf{'no-names'} ? 0 : 1 );
+ $conf{oxygen_base} //= '/usr/share/icons/oxygen/base';
+
$ref->{config} = \%conf;
$ref->{data} = App::Dthumb::Data->new();
@@ -90,6 +93,14 @@ sub create_files {
my $thumbdir = $self->{config}->{dir_thumbs};
my $datadir = $self->{config}->{dir_data};
my @files = $self->{data}->list_archived;
+ my @icons;
+
+ if ( $self->{config}{all} ) {
+ push( @icons, 'mimetypes/unknown.png' );
+ }
+ if ( $self->{config}{recursive} ) {
+ push( @icons, 'places/folder-blue.png' );
+ }
for my $dir ( $thumbdir, $datadir, "${datadir}/css", "${datadir}/js" ) {
if ( not -d $dir ) {
@@ -101,6 +112,12 @@ sub create_files {
write_file( "${datadir}/${file}", $self->{data}->get($file) );
}
+ for my $icon (@icons) {
+ my ( $dir, $file ) = split( qr{/}, $icon );
+ my $base = $self->{config}{oxygen_base};
+ copy( "${base}/128x128/${dir}/${file}", "${datadir}/${file}" );
+ }
+
return;
}
diff --git a/share/folder-blue.png b/share/folder-blue.png
deleted file mode 100644
index b083196..0000000
--- a/share/folder-blue.png
+++ /dev/null
Binary files differ
diff --git a/share/unknown.png b/share/unknown.png
deleted file mode 100644
index 50a2969..0000000
--- a/share/unknown.png
+++ /dev/null
Binary files differ