(iOS) Extensions list argument for dir_list_new should only be passed

when extension filtering is enabled
This commit is contained in:
Twinaphex 2015-01-01 18:47:39 +01:00
parent 6ca7e0561e
commit a3f4c07078
2 changed files with 7 additions and 2 deletions

View File

@ -23,6 +23,7 @@
#include <file/config_file.h>
#include "../../content.h"
#include "../../general.h"
#include <file/dir_list.h>
#include "../../file_ops.h"
#include <file/file_path.h>
@ -233,7 +234,7 @@ static void file_action(enum file_action action, NSString* source, NSString* tar
[self.sections addObject:[NSMutableArray arrayWithObject:i]];
// List contents
struct string_list* contents = dir_list_new(self.path.UTF8String, self.extensions.UTF8String, true);
struct string_list *contents = dir_list_new(self.path.UTF8String, g_settings.menu.navigation.browser.filter.supported_extensions_enable ? self.extensions.UTF8String : NULL, true);
if (contents)
{
@ -422,7 +423,7 @@ static void file_action(enum file_action action, NSString* source, NSString* tar
// List contents
struct string_list* contents = dir_list_new([self.path stringByDeletingLastPathComponent].UTF8String, 0, true);
struct string_list* contents = dir_list_new([self.path stringByDeletingLastPathComponent].UTF8String, NULL, true);
NSMutableArray* items = [NSMutableArray arrayWithObject:BOXSTRING("")];
if (contents)

View File

@ -93,6 +93,10 @@ static void fill_rect(uint16_t *buf, unsigned pitch,
uint16_t (*col)(unsigned x, unsigned y))
{
unsigned j, i;
if (!buf)
return;
for (j = y; j < y + height; j++)
for (i = x; i < x + width; i++)
buf[j * (pitch >> 1) + i] = col(i, j);