1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/xavier007-Z4PIDE

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
dirscan.cpp 1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
纵使有花兼明月何堪无酒亦无人 Отправлено 18.02.2016 12:04 c7d8d6f
#include "dirscan.h"
#include <QtCore>
int DirScan::k = 0 ;
DirScan::DirScan(QObject *parent) :
QObject(parent)
{
}
void DirScan::AsncScan(const QString strPath)
{
QtConcurrent::run(this, &DirScan::Scan, strPath);
}
void DirScan::Scan(const QString strPath)
{
//! 第一次肯定是显示磁盘驱动器
if(k == 0 && !QString::compare(strPath , QString(tr("我的电脑")))){
QFileInfoList drivers = QDir::drives();
int q = 0 ;
do{
QFileInfo d = drivers.at(q++);
qDebug("-----sendBack:%s\n" , d.filePath().toLatin1().data());
emit ItemScaned(strPath , d , k);
}while(q < drivers.size());
k++ ;
//! 其它就是盘符下面的内容
}else{
QDir dir(strPath);
if(dir.exists())
{
k ++ ;
QFileInfoList fileList = dir.entryInfoList();
int i = 0 ;
do{
QFileInfo file = fileList.at(i++);
emit ItemScaned(strPath, file , k);
}while(i < fileList.size());
}
}
return ;
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/xavier007-Z4PIDE.git
git@api.gitlife.ru:oschina-mirror/xavier007-Z4PIDE.git
oschina-mirror
xavier007-Z4PIDE
xavier007-Z4PIDE
master