summaryrefslogtreecommitdiffstats
path: root/apps/plugins/properties.c
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2006-12-13 19:52:08 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2006-12-13 19:52:08 +0000
commit1936f7c460acdc4410db94a94ca82937eee2c9d6 (patch)
treed7fc932297c3a3cb84d5cb87046dca59a0848d0b /apps/plugins/properties.c
parent20338ca60dffd886ec75461072d590939ed62569 (diff)
downloadrockbox-1936f7c460acdc4410db94a94ca82937eee2c9d6.tar.gz
rockbox-1936f7c460acdc4410db94a94ca82937eee2c9d6.tar.bz2
rockbox-1936f7c460acdc4410db94a94ca82937eee2c9d6.zip
Bugfix: recursive directory properties could not be aborted
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11751 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/properties.c')
-rw-r--r--apps/plugins/properties.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c
index 9a0ae5d09c..e9c57c049b 100644
--- a/apps/plugins/properties.c
+++ b/apps/plugins/properties.c
@@ -134,7 +134,7 @@ static bool _dir_properties(DPS* dps)
struct dirent* entry;
#endif
- result = 0;
+ result = true;
dirlen = rb->strlen(dps->dirname);
#ifdef HAVE_DIRCACHE
dir = rb->opendir_cached(dps->dirname);
@@ -146,9 +146,9 @@ static bool _dir_properties(DPS* dps)
/* walk through the directory content */
#ifdef HAVE_DIRCACHE
- while((!result) && (0 != (entry = rb->readdir_cached(dir))))
+ while(result && (0 != (entry = rb->readdir_cached(dir))))
#else
- while((!result) && (0 != (entry = rb->readdir(dir))))
+ while(result && (0 != (entry = rb->readdir(dir))))
#endif
{
/* append name to current directory */
@@ -178,14 +178,14 @@ static bool _dir_properties(DPS* dps)
#endif
/* recursion */
result = _dir_properties(dps);
- if(rb->get_action(CONTEXT_TREE,TIMEOUT_NOBLOCK))
- result = false;
}
else
{
dps->fc++; /* new file */
dps->bc += entry->size;
}
+ if(ACTION_STD_CANCEL == rb->get_action(CONTEXT_STD,TIMEOUT_NOBLOCK))
+ result = false;
rb->yield();
}
#ifdef HAVE_DIRCACHE
@@ -194,8 +194,6 @@ static bool _dir_properties(DPS* dps)
rb->closedir(dir);
#endif
- if(rb->action_userabort(0)) result = false;
-
return result;
}
@@ -208,8 +206,8 @@ static bool dir_properties(char* selected_file)
dps.dc = 0;
dps.fc = 0;
dps.bc = 0;
- if(_dir_properties(&dps))
- return true;
+ if(false == _dir_properties(&dps))
+ return false;
rb->snprintf(str_dirname, MAX_PATH, selected_file);
rb->snprintf(str_dircount, sizeof str_dircount, "Subdirs: %d", dps.dc);