Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions EUExFileMgr/EUExFileMgr/EUExFileMgr.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ -(void)openFile:(NSMutableArray *)inArguments {
[self jsSuccessWithName:@"uexFileMgr.cbOpenFile" opId:[inOpId intValue] dataType:UEX_CALLBACK_DATATYPE_INT intData:UEX_CSUCCESS];
}
return;
}else {
}
else {
uexFile = [[EUExFile alloc] init];
}

Expand Down Expand Up @@ -238,10 +239,12 @@ -(void)deleteFileByID:(NSMutableArray *)inArguments {
if ([File removeFile:truePath]) {
[fobjDict removeObjectForKey:inOpId];
[self jsSuccessWithName:@"uexFileMgr.cbDeleteFileByID" opId:[inOpId intValue] dataType:UEX_CALLBACK_DATATYPE_INT intData:UEX_CSUCCESS];
}else {
}
else {
[self jsSuccessWithName:@"uexFileMgr.cbDeleteFileByID" opId:[inOpId intValue] dataType:UEX_CALLBACK_DATATYPE_INT intData:UEX_CFAILED];
}
}else {
}else
{
[self jsSuccessWithName:@"uexFileMgr.cbDeleteFileByID" opId:[inOpId intValue] dataType:UEX_CALLBACK_DATATYPE_INT intData:UEX_CFAILED];
}
}else{
Expand Down Expand Up @@ -328,6 +331,7 @@ -(void)isFileExistByID:(NSMutableArray *)inArguments{
//11.文件浏览器

-(void)explorer:(NSMutableArray *)inArguments {

NSString *inPath = [inArguments objectAtIndex:0];
if (inPath == nil) {
[super jsFailedWithOpId:0 errorCode:1091001 errorDes:UEX_ERROR_DESCRIBE_ARGS];
Expand All @@ -336,6 +340,8 @@ -(void)explorer:(NSMutableArray *)inArguments {
inPath = [File getDocumentsPath:@""];
}else {
inPath =[super absPath:inPath];

NSLog(@"++++++++++++++++++++++++++%@",inPath);
}
//open a file explorer
fExplorer = [[FileExplorer alloc] init];
Expand Down Expand Up @@ -453,7 +459,6 @@ - (void)uexCallBack:(id)userInfo {

}


//16.读文件
-(void)readFile:(NSMutableArray *)inArguments {
NSString *inOpId = [inArguments objectAtIndex:0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
@property (nonatomic, retain) UILabel *headLabel;
@property (nonatomic, retain) NSMutableString *currentPath;
@property (nonatomic, retain) NSMutableArray *fileItemArray;
@property (nonatomic,strong)NSMutableString *chuanRuPath;

@property (nonatomic,assign) id< FileSelectorDelegate > delegate;
-(id)initWithRootPath:(NSString *)inPath;
@end
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
@implementation FileSelectorViewController

@synthesize fileItemArray,currentPath;
@synthesize delegate,headView,fTableView,headLabel;
@synthesize delegate,headView,fTableView,headLabel,chuanRuPath;

-(void)loadData:(NSString *)relpath{
NSFileManager *fmanager = [NSFileManager defaultManager];

// NSString *preDirStr = [relpath stringByDeletingLastPathComponent];
//NSString *preDirStr = [relpath stringByDeletingLastPathComponent];
NSRange range = [relpath rangeOfString:NSHomeDirectory()];
NSString *subPath = [relpath substringFromIndex:range.length];
if (subPath) {
Expand All @@ -44,7 +44,8 @@ -(void)loadData:(NSString *)relpath{
}

//init
-(id)initWithRootPath:(NSString *)inPath{
-(id)initWithRootPath:(NSString *)inPath{

self = [super init];
if (self != nil) {
NSString *relpath;
Expand All @@ -56,6 +57,7 @@ -(id)initWithRootPath:(NSString *)inPath{
currentPath = [[NSMutableString alloc]initWithString:inPath];;
relpath = inPath;
}
chuanRuPath=[[NSMutableString alloc]initWithString:relpath];
[self loadData:relpath];
}
return self;
Expand Down Expand Up @@ -187,14 +189,15 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
return cell;
}
-(void)backBtnClick{
if ([currentPath isEqualToString:NSHomeDirectory()]) {


if ([currentPath isEqualToString:chuanRuPath]) {
[self.navigationItem.leftBarButtonItem setEnabled:NO];

if(delegate!=nil && [delegate respondsToSelector: @selector(fileSelectCancled:)] == YES){
[delegate fileSelectCancled:self];
}

// return;
return;
}
[currentPath setString:[currentPath stringByDeletingLastPathComponent]];
[self loadData:currentPath];
Expand All @@ -207,7 +210,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath

NSString *fileName = item.fileName;
[currentPath setString:[currentPath stringByAppendingPathComponent:fileName]];
PluginLog(@"current path = %@",currentPath);
if ([item.itemType intValue]==1&&[item.subItems count]==0) {
[currentPath setString:[currentPath stringByDeletingLastPathComponent]];
return;
Expand Down Expand Up @@ -291,6 +293,7 @@ - (void)dealloc {

[fileItemArray release];
[currentPath release];
[chuanRuPath release];
[super dealloc];
}

Expand Down
5 changes: 3 additions & 2 deletions EUExFileMgr/uexFileMgr/info.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<uexplugins>
<plugin
uexName="uexFileMgr" version="3.0.19" build="19">
<info>19:添加IDE支持</info>
uexName="uexFileMgr" version="3.0.20" build="20">
<info>20:修改能够直接返回到应用程序界面,而不能通过该页面返回到附件的父目录下</info>
<build>19:添加IDE支持</build>
<build>18:删除info.plist</build>
<build>17:添加国际化支持</build>
<build>16:getFileListByPath不再返回其子目录下的文件路径</build>
Expand Down
Binary file modified EUExFileMgr/uexFileMgr/libuexFileMgr.a
Binary file not shown.