Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
DoraemonKit
提交
2b32e581
D
DoraemonKit
项目概览
DiDi
/
DoraemonKit
大约 1 年 前同步成功
通知
166
Star
19623
Fork
3062
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DoraemonKit
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2b32e581
编写于
12月 20, 2018
作者:
Y
yixiangboy
提交者:
GitHub
12月 20, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18 from toss156/master
修复清理本地数据问题和优化文件名过长时的展示
上级
fa8f4b1c
de1606a5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
28 addition
and
4 deletion
+28
-4
DoraemonKit/Src/Core/Plugin/DeleteLocalData/DoraemonDeleteLocalDataViewController.m
...n/DeleteLocalData/DoraemonDeleteLocalDataViewController.m
+2
-2
DoraemonKit/Src/Core/Plugin/Sanbox/VC/DoraemonSandboxCell.m
DoraemonKit/Src/Core/Plugin/Sanbox/VC/DoraemonSandboxCell.m
+2
-1
DoraemonKit/Src/Core/Plugin/Sanbox/VC/DoraemonSandboxViewController.m
...Src/Core/Plugin/Sanbox/VC/DoraemonSandboxViewController.m
+1
-0
DoraemonKit/Src/Core/Util/DoraemonUtil.h
DoraemonKit/Src/Core/Util/DoraemonUtil.h
+2
-0
DoraemonKit/Src/Core/Util/DoraemonUtil.m
DoraemonKit/Src/Core/Util/DoraemonUtil.m
+21
-1
未找到文件。
DoraemonKit/Src/Core/Plugin/DeleteLocalData/DoraemonDeleteLocalDataViewController.m
浏览文件 @
2b32e581
...
...
@@ -45,8 +45,8 @@
UIAlertController
*
alertController
=
[
UIAlertController
alertControllerWithTitle
:
DoraemonLocalizedString
(
@"提示"
)
message
:
DoraemonLocalizedString
(
@"确定要删除本地数据"
)
preferredStyle
:
UIAlertControllerStyleAlert
];
UIAlertAction
*
cancelAction
=
[
UIAlertAction
actionWithTitle
:
DoraemonLocalizedString
(
@"取消"
)
style
:
UIAlertActionStyleCancel
handler
:
nil
];
UIAlertAction
*
okAction
=
[
UIAlertAction
actionWithTitle
:
DoraemonLocalizedString
(
@"确定"
)
style
:
UIAlertActionStyleDefault
handler
:^
(
UIAlertAction
*
_Nonnull
action
)
{
NSString
*
homeDir
=
NSHomeDirectory
()
;
[
DoraemonUtil
clear
FileWithPath
:
homeDir
];
[
weakSelf
.
cellBtn
renderUIWithRightContent
:
@"正在清理中"
]
;
[
DoraemonUtil
clear
LocalDatas
];
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
5
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
weakSelf
.
cellBtn
renderUIWithRightContent
:[
self
getHomeDirFileSize
]];
});
...
...
DoraemonKit/Src/Core/Plugin/Sanbox/VC/DoraemonSandboxCell.m
浏览文件 @
2b32e581
...
...
@@ -56,8 +56,9 @@
self
.
fileTypeIcon
.
frame
=
CGRectMake
(
kDoraemonSizeFrom750
(
32
),
[[
self
class
]
cellHeight
]
/
2
-
self
.
fileTypeIcon
.
doraemon_height
/
2
,
self
.
fileTypeIcon
.
doraemon_width
,
self
.
fileTypeIcon
.
doraemon_height
);
self
.
fileTitleLabel
.
text
=
model
.
name
;
self
.
fileTitleLabel
.
lineBreakMode
=
NSLineBreakByTruncatingMiddle
;
[
self
.
fileTitleLabel
sizeToFit
];
self
.
fileTitleLabel
.
frame
=
CGRectMake
(
self
.
fileTypeIcon
.
doraemon_right
+
kDoraemonSizeFrom750
(
32
),
[[
self
class
]
cellHeight
]
/
2
-
self
.
fileTitleLabel
.
doraemon_height
/
2
,
DoraemonScreenWidth
-
1
2
0
,
self
.
fileTitleLabel
.
doraemon_height
);
self
.
fileTitleLabel
.
frame
=
CGRectMake
(
self
.
fileTypeIcon
.
doraemon_right
+
kDoraemonSizeFrom750
(
32
),
[[
self
class
]
cellHeight
]
/
2
-
self
.
fileTitleLabel
.
doraemon_height
/
2
,
DoraemonScreenWidth
-
1
5
0
,
self
.
fileTitleLabel
.
doraemon_height
);
DoraemonUtil
*
util
=
[[
DoraemonUtil
alloc
]
init
];
[
util
getFileSizeWithPath
:
model
.
path
];
...
...
DoraemonKit/Src/Core/Plugin/Sanbox/VC/DoraemonSandboxViewController.m
浏览文件 @
2b32e581
...
...
@@ -48,6 +48,7 @@
-
(
void
)
initUI
{
self
.
title
=
DoraemonLocalizedString
(
@"沙盒浏览器"
);
self
.
tableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
self
.
bigTitleView
.
doraemon_bottom
,
self
.
view
.
doraemon_width
,
self
.
view
.
doraemon_height
-
self
.
bigTitleView
.
doraemon_bottom
)
style
:
UITableViewStylePlain
];
self
.
tableView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentAutomatic
;
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
[
self
.
view
addSubview
:
self
.
tableView
];
...
...
DoraemonKit/Src/Core/Util/DoraemonUtil.h
浏览文件 @
2b32e581
...
...
@@ -39,4 +39,6 @@
//删除某一路径下的所有文件
+
(
void
)
clearFileWithPath
:(
NSString
*
)
path
;
+
(
void
)
clearLocalDatas
;
@end
DoraemonKit/Src/Core/Util/DoraemonUtil.m
浏览文件 @
2b32e581
...
...
@@ -169,7 +169,27 @@
//删除某一路径下的所有文件
+
(
void
)
clearFileWithPath
:(
NSString
*
)
path
{
NSFileManager
*
fm
=
[
NSFileManager
defaultManager
];
[
fm
removeItemAtPath
:
path
error
:
nil
];
NSArray
*
files
=
[[
NSFileManager
defaultManager
]
subpathsAtPath
:
path
];
for
(
NSString
*
file
in
files
)
{
NSError
*
error
;
NSString
*
filePath
=
[
path
stringByAppendingPathComponent
:
file
];
if
([[
NSFileManager
defaultManager
]
fileExistsAtPath
:
filePath
])
{
[[
NSFileManager
defaultManager
]
removeItemAtPath
:
filePath
error
:
&
error
];
if
(
!
error
)
{
NSLog
(
@"remove file: %@"
,
file
);
}
}
}
}
+
(
void
)
clearLocalDatas
{
dispatch_async
(
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
),
^
{
NSString
*
homePath
=
NSHomeDirectory
();
NSArray
*
folders
=
@[
@"Documents"
,
@"Library"
,
@"tmp"
];
for
(
NSString
*
folder
in
folders
)
{
[
DoraemonUtil
clearFileWithPath
:[
homePath
stringByAppendingPathComponent
:
folder
]];
}
});
}
@end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录