summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/filetypes.c6
-rw-r--r--apps/plugins/viewers.config33
-rwxr-xr-xtools/buildzip.pl36
3 files changed, 47 insertions, 28 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index 721d5326ea..9235e22315 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -188,7 +188,7 @@ char* filetype_get_plugin(const struct entry* file)
188 return NULL; 188 return NULL;
189 189
190 snprintf(plugin_name, sizeof(plugin_name), 190 snprintf(plugin_name, sizeof(plugin_name),
191 VIEWERS_DIR "/%s.rock",filetypes[ix].plugin); 191 "%s/%s.rock", ROCKBOX_DIR, filetypes[ix].plugin);
192 192
193 return plugin_name; 193 return plugin_name;
194} 194}
@@ -453,9 +453,13 @@ static int add_plugin(char *plugin)
453 if (!plugin) 453 if (!plugin)
454 return 0; 454 return 0;
455 455
456#if 0
457 /* starting now, Oct 2005, the plugins are given without extension in the
458 viewers.config file */
456 cp=strrchr(plugin, '.'); 459 cp=strrchr(plugin, '.');
457 if (cp) 460 if (cp)
458 *cp='\0'; 461 *cp='\0';
462#endif
459 463
460 for (i=first_soft_filetype; i < cnt_filetypes; i++) 464 for (i=first_soft_filetype; i < cnt_filetypes; i++)
461 { 465 {
diff --git a/apps/plugins/viewers.config b/apps/plugins/viewers.config
index da8b086fa6..b29835e50a 100644
--- a/apps/plugins/viewers.config
+++ b/apps/plugins/viewers.config
@@ -1,17 +1,16 @@
1ch8,chip8.rock,70 70 7f 7f 70 70 1ch8,viewers/chip8,70 70 7f 7f 70 70
2txt,viewer.rock,55 55 55 55 55 55 2txt,viewers/viewer,55 55 55 55 55 55
3nfo,viewer.rock,55 55 55 55 55 55 3nfo,viewers/viewer,55 55 55 55 55 55
4jpg,jpeg.rock,18 24 3C 3C 24 18 4jpg,viewers/jpeg,18 24 3C 3C 24 18
5ucl,rockbox_flash.rock,2A 7F 41 41 7F 2A 5ucl,viewers/rockbox_flash,2A 7F 41 41 7F 2A
6rvf,video.rock,5D 7F 5D 7F 5D 7F 6rvf,viewers/video,5D 7F 5D 7F 5D 7F
7mp3,vbrfix.rock,10 08 58 38 04 02 7mp3,viewers/vbrfix,10 08 58 38 04 02
8m3u,search.rock,00 00 00 00 00 00 8m3u,viewers/search,00 00 00 00 00 00
9txt,sort.rock, 00 00 00 00 00 00 9txt,viewers/sort, 00 00 00 00 00 00
10gb,rockboy.rock, 0C 2A 59 7A 2E 0C 10gb,viewers/rockboy, 0C 2A 59 7A 2E 0C
11gbc,rockboy.rock, 0C 2A 59 7A 2E 0C 11gbc,viewers/rockboy, 0C 2A 59 7A 2E 0C
12m3u,iriverify.rock,00 00 00 00 00 00 12m3u,viewers/iriverify,00 00 00 00 00 00
13mid,midi2wav.rock, 20 70 70 3F 00 00 13mid,viewers/midi2wav, 20 70 70 3F 00 00
14rsp,searchengine.rock, 0e 11 11 31 7e 60 14rsp,viewers/searchengine, 0e 11 11 31 7e 60
15ss,sudoku.rock, 55 55 55 55 55 55 15ss,rocks/sudoku, 55 55 55 55 55 55
16wav,wav2wv.rock, 00 00 00 00 00 00 16wav,viewers/wav2wv, 00 00 00 00 00 00
17
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index b5e4435545..3d6a42137c 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -76,23 +76,39 @@ sub buildzip {
76 open VIEWERS, ">.rockbox/viewers.config" or 76 open VIEWERS, ">.rockbox/viewers.config" or
77 die "can't create .rockbox/viewers.config"; 77 die "can't create .rockbox/viewers.config";
78 mkdir ".rockbox/viewers", 0777; 78 mkdir ".rockbox/viewers", 0777;
79 for (@viewers) { 79 foreach my $line (@viewers) {
80 if (/,(.+).rock,/) { 80 if ($line =~ /([^,]*),([^,]*),/) {
81 my $r = "$1.rock"; 81 my ($ext, $plugin)=($1, $2);
82 my $o = "$1.ovl"; 82 my $r = "${plugin}.rock";
83 if(-e ".rockbox/rocks/$r") { 83 my $o = "${plugin}.ovl";
84 `mv .rockbox/rocks/$r .rockbox/viewers`; 84
85 print VIEWERS $_; 85 my $dir = $r;
86 my $name;
87
88 # strip off the last slash and file name part
89 $dir =~ s/(.*)\/(.*)/$1/;
90 # store the file name part
91 $name = $2;
92
93 # print STDERR "$ext $plugin $dir $name $r\n";
94
95 if(-e ".rockbox/rocks/$name") {
96 if($dir ne "rocks") {
97 # target is not 'rocks' but the plugins are always in that
98 # dir at first!
99 `mv .rockbox/rocks/$name .rockbox/$r`;
100 }
101 print VIEWERS $line;
86 } 102 }
87 elsif(-e ".rockbox/viewers/$r") { 103 elsif(-e ".rockbox/$r") {
88 # in case the same plugin works for multiple extensions, it 104 # in case the same plugin works for multiple extensions, it
89 # was already moved to the viewers dir 105 # was already moved to the viewers dir
90 print VIEWERS $_; 106 print VIEWERS $line;
91 } 107 }
92 if(-e ".rockbox/rocks/$o") { 108 if(-e ".rockbox/rocks/$o") {
93 # if there's an "overlay" file for the .rock, move that as 109 # if there's an "overlay" file for the .rock, move that as
94 # well 110 # well
95 `mv .rockbox/rocks/$o .rockbox/viewers`; 111 `mv .rockbox/rocks/$o .rockbox/$o`;
96 } 112 }
97 } 113 }
98 } 114 }