mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-23 04:29:41 +02:00
Now only allows file browsing up to /, CARD_ROOT is /card/
This commit is contained in:
parent
ba9af53c21
commit
e9941dc4fd
@ -167,7 +167,7 @@ void BrowseDialog::directoryUp()
|
|||||||
if (p == path.size() - 1)
|
if (p == path.size() - 1)
|
||||||
p = path.rfind("/", p - 1);
|
p = path.rfind("/", p - 1);
|
||||||
|
|
||||||
if (p == string::npos || path.compare(0, CARD_ROOT_LEN, CARD_ROOT) != 0 || path.length() <= CARD_ROOT_LEN) {
|
if (p == string::npos || path.compare(0, 1, "/") != 0 || path.length() < 2) {
|
||||||
close = true;
|
close = true;
|
||||||
result = false;
|
result = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -77,8 +77,8 @@
|
|||||||
//#include <pnd_discovery.h>
|
//#include <pnd_discovery.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *CARD_ROOT = "/"; //Note: Add a trailing /!
|
const char *CARD_ROOT = "/card/"; //Note: Add a trailing /!
|
||||||
const int CARD_ROOT_LEN = 1;
|
const int CARD_ROOT_LEN = 5;
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace fastdelegate;
|
using namespace fastdelegate;
|
||||||
|
@ -152,7 +152,7 @@ int Selector::exec(int startSelection) {
|
|||||||
if ( gmenu2x->input[ACTION_X] ) {
|
if ( gmenu2x->input[ACTION_X] ) {
|
||||||
if (link->getSelectorBrowser()) {
|
if (link->getSelectorBrowser()) {
|
||||||
string::size_type p = dir.rfind("/", dir.size()-2);
|
string::size_type p = dir.rfind("/", dir.size()-2);
|
||||||
if (p==string::npos || dir.compare(0, CARD_ROOT_LEN, CARD_ROOT) != 0 || dir.length() <= CARD_ROOT_LEN) {
|
if (p==string::npos || dir.compare(0, 1, "/") != 0 || dir.length() < 2) {
|
||||||
close = true;
|
close = true;
|
||||||
result = false;
|
result = false;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user