fix: local file up blank bug.
This commit is contained in:
@@ -72,7 +72,6 @@ void ClientCore::UseFrame(QSharedPointer<FrameBuffer> frame)
|
|||||||
case FrameBufferType::FBT_CLI_ASK_DIRFILE: {
|
case FrameBufferType::FBT_CLI_ASK_DIRFILE: {
|
||||||
DirFileInfoVec vec;
|
DirFileInfoVec vec;
|
||||||
InfoMsg info = infoUnpack<InfoMsg>(frame->data);
|
InfoMsg info = infoUnpack<InfoMsg>(frame->data);
|
||||||
vec.root = info.msg;
|
|
||||||
if (!localFile_.GetDirFile(info.msg, vec)) {
|
if (!localFile_.GetDirFile(info.msg, vec)) {
|
||||||
qWarning() << QString(tr("get dir file failed use %1")).arg(info.msg);
|
qWarning() << QString(tr("get dir file failed use %1")).arg(info.msg);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -172,13 +172,13 @@ void FileManager::evtUp()
|
|||||||
{
|
{
|
||||||
QString path(curRoot_);
|
QString path(curRoot_);
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
dir.cdUp();
|
if (!dir.cdUp()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
path = dir.path();
|
path = dir.path();
|
||||||
|
|
||||||
if (path.isEmpty()) {
|
if (path.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto r = fileHelper_->GetDirFile(path);
|
auto r = fileHelper_->GetDirFile(path);
|
||||||
if (r) {
|
if (r) {
|
||||||
curRoot_ = path;
|
curRoot_ = path;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ bool LocalFile::GetDirFile(const QString& dir)
|
|||||||
bool LocalFile::GetDirFile(const QString& dir, DirFileInfoVec& vec)
|
bool LocalFile::GetDirFile(const QString& dir, DirFileInfoVec& vec)
|
||||||
{
|
{
|
||||||
vec.vec.clear();
|
vec.vec.clear();
|
||||||
|
vec.root = dir;
|
||||||
|
|
||||||
QDir qdir(dir);
|
QDir qdir(dir);
|
||||||
if (!qdir.exists()) {
|
if (!qdir.exists()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user