Bugfix: recursive directory properties could not be aborted
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11751 a1c6a512-1295-4272-9138-f99709370657
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c
index 9a0ae5d..e9c57c0 100644
--- a/apps/plugins/properties.c
+++ b/apps/plugins/properties.c
@@ -134,7 +134,7 @@
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 @@
/* 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 @@
#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 @@
rb->closedir(dir);
#endif
- if(rb->action_userabort(0)) result = false;
-
return result;
}
@@ -208,8 +206,8 @@
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);