mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
fixed bug deleting folders
This commit is contained in:
parent
1def3ee438
commit
bba514b727
@ -28,8 +28,8 @@ LIBS += -lpoppler-qt4
|
||||
INCLUDEPATH += ../dependencies/poppler/include/qt4
|
||||
}
|
||||
|
||||
QMAKE_CXXFLAGS_RELEASE += /MP /Ob2 /Oi /Ot /GT /GL
|
||||
QMAKE_LFLAGS_RELEASE += /LTCG
|
||||
#QMAKE_CXXFLAGS_RELEASE += /MP /Ob2 /Oi /Ot /GT /GL
|
||||
#QMAKE_LFLAGS_RELEASE += /LTCG
|
||||
CONFIG -= embed_manifest_exe
|
||||
}
|
||||
|
||||
|
@ -1493,12 +1493,19 @@ void LibraryWindow::addFolderToCurrentIndex()
|
||||
void LibraryWindow::deleteSelectedFolder()
|
||||
{
|
||||
QModelIndex currentIndex = getCurrentFolderIndex();
|
||||
QString relativePath = foldersModel->getFolderPath(currentIndex);
|
||||
QString folderPath = QDir::cleanPath(currentPath()+relativePath);
|
||||
|
||||
if(!currentIndex.isValid())
|
||||
QMessageBox::information(this,tr("No folder selected"), tr("Please, select a folder first"));
|
||||
else
|
||||
{
|
||||
int ret = QMessageBox::question(this,tr("Delete folder"),tr("The selected folder and all its contents will be deleted from your disk. Are you sure?"),QMessageBox::Yes,QMessageBox::No);
|
||||
QString libraryPath = QDir::cleanPath(currentPath());
|
||||
if((libraryPath == folderPath) || relativePath.isEmpty() || relativePath == "/")
|
||||
QMessageBox::critical(this,tr("Error in path"),tr("There was an error accessing the folder's path"));
|
||||
else
|
||||
{
|
||||
int ret = QMessageBox::question(this,tr("Delete folder"),tr("The selected folder and all its contents will be deleted from your disk. Are you sure?") + "\n\nFolder : " + folderPath,QMessageBox::Yes,QMessageBox::No);
|
||||
|
||||
if(ret == QMessageBox::Yes)
|
||||
{
|
||||
@ -1507,7 +1514,7 @@ void LibraryWindow::deleteSelectedFolder()
|
||||
indexList << currentIndex;
|
||||
|
||||
QList<QString> paths;
|
||||
paths << QDir::cleanPath(currentPath()+foldersModel->getFolderPath(currentIndex));
|
||||
paths << folderPath;
|
||||
|
||||
FoldersRemover * remover = new FoldersRemover(indexList,paths);
|
||||
|
||||
@ -1528,6 +1535,7 @@ void LibraryWindow::deleteSelectedFolder()
|
||||
thread->start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LibraryWindow::errorDeletingFolder()
|
||||
|
Loading…
x
Reference in New Issue
Block a user