mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-17 13:01:41 +00:00
Changed: Update progress in CFilesCleaner
This commit is contained in:
parent
4fdf70d568
commit
879e4d0608
1 changed files with 14 additions and 0 deletions
|
@ -52,6 +52,8 @@ void CFilesCleaner::setDirectory(const QString &src)
|
||||||
|
|
||||||
bool CFilesCleaner::exec()
|
bool CFilesCleaner::exec()
|
||||||
{
|
{
|
||||||
|
if (m_listener) m_listener->operationPrepare();
|
||||||
|
|
||||||
QDir dir(m_directory);
|
QDir dir(m_directory);
|
||||||
|
|
||||||
// directory doesn't exist
|
// directory doesn't exist
|
||||||
|
@ -62,9 +64,21 @@ bool CFilesCleaner::exec()
|
||||||
// temporary files
|
// temporary files
|
||||||
QStringList files = dir.entryList(QStringList() << "*.string_cache" << "*.packed_sheets" << "*.packed" << "*.pem", QDir::Files);
|
QStringList files = dir.entryList(QStringList() << "*.string_cache" << "*.packed_sheets" << "*.packed" << "*.pem", QDir::Files);
|
||||||
|
|
||||||
|
if (m_listener)
|
||||||
|
{
|
||||||
|
m_listener->operationInit(0, files.size());
|
||||||
|
m_listener->operationStart();
|
||||||
|
}
|
||||||
|
|
||||||
|
int filesCount = 0;
|
||||||
|
|
||||||
foreach(const QString &file, files)
|
foreach(const QString &file, files)
|
||||||
{
|
{
|
||||||
dir.remove(file);
|
dir.remove(file);
|
||||||
|
|
||||||
|
if (m_listener) m_listener->operationProgress(filesCount, file);
|
||||||
|
|
||||||
|
++filesCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fonts directory is not needed anymore
|
// fonts directory is not needed anymore
|
||||||
|
|
Loading…
Reference in a new issue