Merge pull request #6 from selmf/9.5.0_bugfixes

9.5.0 bugfixes
This commit is contained in:
Luis Ángel San Martín 2018-05-31 18:14:41 +02:00 committed by GitHub
commit 4608c9bb03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 35 deletions

View File

@ -1682,7 +1682,10 @@ void MainWindowViewer::decreasePageZoomLevel()
void MainWindowViewer::sendComic() void MainWindowViewer::sendComic()
{ {
YACReaderLocalClient * client = new YACReaderLocalClient; YACReaderLocalClient * client = new YACReaderLocalClient;
connect(client, &YACReaderLocalClient::finished, client, &YACReaderLocalClient::deleteLater);
currentComicDB.info.lastTimeOpened = QDateTime::currentMSecsSinceEpoch() / 1000; currentComicDB.info.lastTimeOpened = QDateTime::currentMSecsSinceEpoch() / 1000;
viewer->updateComic(currentComicDB); viewer->updateComic(currentComicDB);
if (currentComicDB.info.currentPage == currentComicDB.info.numPages) { if (currentComicDB.info.currentPage == currentComicDB.info.numPages) {
@ -1694,13 +1697,10 @@ void MainWindowViewer::sendComic()
int retries = 1; int retries = 1;
while(!client->sendComicInfo(libraryId, currentComicDB, nextComic.id) && retries!=0) while(!client->sendComicInfo(libraryId, currentComicDB, nextComic.id) && retries!=0)
retries--; retries--;
connect(client,SIGNAL(finished()),client,SLOT(deleteLater()));
} }
} else { } else {
int retries = 1; int retries = 1;
while(!client->sendComicInfo(libraryId, currentComicDB) && retries!=0) while(!client->sendComicInfo(libraryId, currentComicDB) && retries!=0)
retries--; retries--;
connect(client,SIGNAL(finished()),client,SLOT(deleteLater()));
} }
//delete client;
} }

View File

@ -86,7 +86,7 @@ SortVolumeComics::SortVolumeComics(QWidget *parent) :
//rows actions //rows actions
QAction * removeItemFromList = new QAction(tr("remove selected comics"),this); QAction * removeItemFromList = new QAction(tr("remove selected comics"),this);
QAction * restoreAllItems = new QAction(tr("restore all removed comics"),this); QAction * restoreAllItems = new QAction(tr("restore all removed comics"),this);
QAction * restoreItems = new QAction(tr("restore removed comics"),this); //QAction * restoreItems = new QAction(tr("restore removed comics"),this);
tableFiles->setContextMenuPolicy(Qt::ActionsContextMenu); tableFiles->setContextMenuPolicy(Qt::ActionsContextMenu);
tableFiles->addAction(removeItemFromList); tableFiles->addAction(removeItemFromList);
@ -95,7 +95,7 @@ SortVolumeComics::SortVolumeComics(QWidget *parent) :
connect(removeItemFromList,SIGNAL(triggered()),this,SLOT(removeSelectedComics())); connect(removeItemFromList,SIGNAL(triggered()),this,SLOT(removeSelectedComics()));
connect(restoreAllItems,SIGNAL(triggered()),this,SLOT(restoreAllComics())); connect(restoreAllItems,SIGNAL(triggered()),this,SLOT(restoreAllComics()));
connect(restoreItems,SIGNAL(triggered()),this,SLOT(showRemovedComicsSelector())); //connect(restoreItems,SIGNAL(triggered()),this,SLOT(showRemovedComicsSelector()));
} }
void SortVolumeComics::setData(QList<ComicDB> & comics, const QString &json, const QString &vID) void SortVolumeComics::setData(QList<ComicDB> & comics, const QString &json, const QString &vID)

View File

@ -823,7 +823,13 @@ void FolderModelProxy::setupFilteredModelData(QSqlQuery &sqlquery, FolderItem *p
//si el nodo es hijo de 1 y no hab<61>a sido previamente insertado como hijo, se a<>ade como tal //si el nodo es hijo de 1 y no hab<61>a sido previamente insertado como hijo, se a<>ade como tal
if(!parentPreviousInserted) if(!parentPreviousInserted)
{
filteredItems.value(ROOT)->appendChild(item); filteredItems.value(ROOT)->appendChild(item);
} }
else
{
delete item;
}
}
} }
} }

View File

@ -460,6 +460,8 @@ void HttpRequest::parseMultiPartFile()
else if (!fileName.isEmpty() && !fieldName.isEmpty()) else if (!fileName.isEmpty() && !fieldName.isEmpty())
{ {
// last field was a file // last field was a file
if (uploadedFile)
{
#ifdef SUPERVERBOSE #ifdef SUPERVERBOSE
qDebug("HttpRequest: finishing writing to uploaded file"); qDebug("HttpRequest: finishing writing to uploaded file");
#endif #endif
@ -471,6 +473,11 @@ void HttpRequest::parseMultiPartFile()
uploadedFiles.insert(fieldName,uploadedFile); uploadedFiles.insert(fieldName,uploadedFile);
qDebug("HttpRequest: uploaded file size is %i",(int) uploadedFile->size()); qDebug("HttpRequest: uploaded file size is %i",(int) uploadedFile->size());
} }
else
{
qWarning("HttpRequest: format error, unexpected end of file data");
}
}
if (line.contains(boundary+"--")) if (line.contains(boundary+"--"))
{ {
finished=true; finished=true;
@ -546,4 +553,3 @@ QHostAddress HttpRequest::getPeerAddress() const
{ {
return peerAddress; return peerAddress;
} }

View File

@ -92,8 +92,8 @@ void FileLogger::write(const LogMessage* logMessage)
// Check for success // Check for success
if (file->error()) if (file->error())
{ {
close();
qWarning("Cannot write to log file %s: %s",qPrintable(fileName),qPrintable(file->errorString())); qWarning("Cannot write to log file %s: %s",qPrintable(fileName),qPrintable(file->errorString()));
close();
} }
} }

View File

@ -275,6 +275,8 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
case 5: case 5:
flowType = Custom; flowType = Custom;
break; break;
default:
flowType = CoverFlowLike;
} }