Solucionado bug que evitaba que se creara un biblioteca en un directorio que ya

conten?a una biblioteca v?lida
This commit is contained in:
Luis Ángel San Martín
2012-08-20 22:06:18 +02:00
parent 359505d817
commit c66287fb37
2 changed files with 11 additions and 2 deletions

View File

@ -23,12 +23,14 @@ QMutex mutex;
//--------------------------------------------------------------------------------
LibraryCreator::LibraryCreator()
:creation(false)
{
_nameFilter << "*.cbr" << "*.cbz" << "*.rar" << "*.zip" << "*.tar";
}
void LibraryCreator::createLibrary(const QString &source, const QString &target)
{
creation = true;
processLibrary(source,target);
}
@ -47,7 +49,7 @@ void LibraryCreator::processLibrary(const QString & source, const QString & targ
delTree(target);
_mode = CREATOR;
}
else
else //
_mode = UPDATER;
}
@ -93,10 +95,15 @@ void LibraryCreator::run()
_database.commit();
_database.close();
QSqlDatabase::removeDatabase(_target);
emit(updated());
//si estabamos en modo creaci<63>n, se est<73> a<>adiendo una librer<65>a que ya exist<73>a y se ha actualizado antes de a<>adirse.
if(!creation)
emit(updated());
else
emit(created());
}
msleep(100);//TODO try to solve the problem with the udpate dialog
emit(finished());
creation = false;
}
void LibraryCreator::stop()

View File

@ -46,6 +46,8 @@
//qulonglong insertFolder(qulonglong parentId,const Folder & folder);
//qulonglong insertComic(const Comic & comic);
bool stopRunning;
//LibraryCreator est<73> en modo creaci<63>n si creation == true;
bool creation;
signals:
void finished();
void coverExtracted(QString);