mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
delTree has been replaced by QDir::removeRecursively() (Qt5) (Qt4 support has been dropped)
This commit is contained in:
parent
e9a487db5e
commit
463aae7b8a
@ -99,7 +99,8 @@ void LibraryCreator::processLibrary(const QString & source, const QString & targ
|
|||||||
if(DataBaseManagement::checkValidDB(target+"/library.ydb")=="")
|
if(DataBaseManagement::checkValidDB(target+"/library.ydb")=="")
|
||||||
{
|
{
|
||||||
//se limpia el directorio ./yacreaderlibrary
|
//se limpia el directorio ./yacreaderlibrary
|
||||||
delTree(target);
|
QDir d(target);
|
||||||
|
d.removeRecursively();
|
||||||
_mode = CREATOR;
|
_mode = CREATOR;
|
||||||
}
|
}
|
||||||
else //
|
else //
|
||||||
|
@ -1221,8 +1221,8 @@ void LibraryWindow::loadLibrary(const QString & name)
|
|||||||
if(QMessageBox::question(this,tr("Old library"),tr("Library '%1' has been created with an older version of YACReaderLibrary. It must be created again. Do you want to create the library now?").arg(currentLibrary),QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes)
|
if(QMessageBox::question(this,tr("Old library"),tr("Library '%1' has been created with an older version of YACReaderLibrary. It must be created again. Do you want to create the library now?").arg(currentLibrary),QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
QDir d(path+"/.yacreaderlibrary");
|
QDir d(path+"/.yacreaderlibrary");
|
||||||
delTree(d);
|
d.removeRecursively();
|
||||||
d.rmdir(path+"/.yacreaderlibrary");
|
//d.rmdir(path+"/.yacreaderlibrary");
|
||||||
createLibraryDialog->setDataAndStart(currentLibrary,path);
|
createLibraryDialog->setDataAndStart(currentLibrary,path);
|
||||||
//create(path,path+"/.yacreaderlibrary",currentLibrary);
|
//create(path,path+"/.yacreaderlibrary",currentLibrary);
|
||||||
}
|
}
|
||||||
@ -1741,8 +1741,7 @@ void LibraryWindow::deleteCurrentLibrary()
|
|||||||
path = path+"/.yacreaderlibrary";
|
path = path+"/.yacreaderlibrary";
|
||||||
|
|
||||||
QDir d(path);
|
QDir d(path);
|
||||||
delTree(d);
|
d.removeRecursively();
|
||||||
d.rmdir(path);
|
|
||||||
if(libraries.isEmpty())//no more libraries available.
|
if(libraries.isEmpty())//no more libraries available.
|
||||||
{
|
{
|
||||||
comicsView->setModel(NULL);
|
comicsView->setModel(NULL);
|
||||||
|
@ -1,24 +1 @@
|
|||||||
#include "custom_widgets.h"
|
#include "custom_widgets.h"
|
||||||
|
|
||||||
#include <QDir>
|
|
||||||
#include <QFileInfo>
|
|
||||||
|
|
||||||
void delTree(QDir dir)
|
|
||||||
{
|
|
||||||
dir.setFilter(QDir::AllDirs|QDir::Files|QDir::Hidden|QDir::NoDotAndDotDot);
|
|
||||||
QFileInfoList list = dir.entryInfoList();
|
|
||||||
for (int i = 0; i < list.size(); ++i)
|
|
||||||
{
|
|
||||||
QFileInfo fileInfo = list.at(i);
|
|
||||||
QString path = fileInfo.filePath();
|
|
||||||
if(fileInfo.isDir())
|
|
||||||
{
|
|
||||||
delTree(QDir(fileInfo.absoluteFilePath()));
|
|
||||||
dir.rmdir(fileInfo.absoluteFilePath());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dir.remove(fileInfo.absoluteFilePath());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
#ifndef __CUSTOM_WIDGETS_H
|
#ifndef __CUSTOM_WIDGETS_H
|
||||||
#define __CUSTOM_WIDGETS_H
|
#define __CUSTOM_WIDGETS_H
|
||||||
|
|
||||||
class QDir;
|
|
||||||
|
|
||||||
void delTree(QDir dir);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user