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
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) {
@ -1692,15 +1695,12 @@ void MainWindowViewer::sendComic()
ComicDB & nextComic = siblingComics[currentIndex+1]; ComicDB & nextComic = siblingComics[currentIndex+1];
nextComic.info.hasBeenOpened = true; nextComic.info.hasBeenOpened = true;
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,16 +460,23 @@ 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
#ifdef SUPERVERBOSE if (uploadedFile)
qDebug("HttpRequest: finishing writing to uploaded file"); {
#endif #ifdef SUPERVERBOSE
uploadedFile->resize(uploadedFile->size()-2); qDebug("HttpRequest: finishing writing to uploaded file");
uploadedFile->flush(); #endif
uploadedFile->seek(0); uploadedFile->resize(uploadedFile->size()-2);
parameters.insert(fieldName,fileName); uploadedFile->flush();
qDebug("HttpRequest: set parameter %s=%s",fieldName.data(),fileName.data()); uploadedFile->seek(0);
uploadedFiles.insert(fieldName,uploadedFile); parameters.insert(fieldName,fileName);
qDebug("HttpRequest: uploaded file size is %i",(int) uploadedFile->size()); qDebug("HttpRequest: set parameter %s=%s",fieldName.data(),fileName.data());
uploadedFiles.insert(fieldName,uploadedFile);
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+"--"))
{ {
@ -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

@ -70,37 +70,37 @@ YACReaderOptionsDialog::YACReaderOptionsDialog(QWidget * parent)
connect(gl->xRotation,SIGNAL(valueChanged(int)),this,SLOT(saveXRotation(int))); connect(gl->xRotation,SIGNAL(valueChanged(int)),this,SLOT(saveXRotation(int)));
connect(gl->xRotation,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->xRotation,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
connect(gl->yPosition,SIGNAL(valueChanged(int)),this,SLOT(saveYPosition(int))); connect(gl->yPosition,SIGNAL(valueChanged(int)),this,SLOT(saveYPosition(int)));
connect(gl->yPosition,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->yPosition,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
connect(gl->coverDistance,SIGNAL(valueChanged(int)),this,SLOT(saveCoverDistance(int))); connect(gl->coverDistance,SIGNAL(valueChanged(int)),this,SLOT(saveCoverDistance(int)));
connect(gl->coverDistance,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->coverDistance,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
connect(gl->centralDistance,SIGNAL(valueChanged(int)),this,SLOT(saveCentralDistance(int))); connect(gl->centralDistance,SIGNAL(valueChanged(int)),this,SLOT(saveCentralDistance(int)));
connect(gl->centralDistance,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->centralDistance,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
connect(gl->zoomLevel,SIGNAL(valueChanged(int)),this,SLOT(saveZoomLevel(int))); connect(gl->zoomLevel,SIGNAL(valueChanged(int)),this,SLOT(saveZoomLevel(int)));
connect(gl->zoomLevel,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->zoomLevel,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
connect(gl->yCoverOffset,SIGNAL(valueChanged(int)),this,SLOT(saveYCoverOffset(int))); connect(gl->yCoverOffset,SIGNAL(valueChanged(int)),this,SLOT(saveYCoverOffset(int)));
connect(gl->yCoverOffset,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->yCoverOffset,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
connect(gl->zCoverOffset,SIGNAL(valueChanged(int)),this,SLOT(saveZCoverOffset(int))); connect(gl->zCoverOffset,SIGNAL(valueChanged(int)),this,SLOT(saveZCoverOffset(int)));
connect(gl->zCoverOffset,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->zCoverOffset,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
connect(gl->coverRotation,SIGNAL(valueChanged(int)),this,SLOT(saveCoverRotation(int))); connect(gl->coverRotation,SIGNAL(valueChanged(int)),this,SLOT(saveCoverRotation(int)));
connect(gl->coverRotation,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->coverRotation,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
connect(gl->fadeOutDist,SIGNAL(valueChanged(int)),this,SLOT(saveFadeOutDist(int))); connect(gl->fadeOutDist,SIGNAL(valueChanged(int)),this,SLOT(saveFadeOutDist(int)));
connect(gl->fadeOutDist,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->fadeOutDist,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
connect(gl->lightStrength,SIGNAL(valueChanged(int)),this,SLOT(saveLightStrength(int))); connect(gl->lightStrength,SIGNAL(valueChanged(int)),this,SLOT(saveLightStrength(int)));
connect(gl->lightStrength,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->lightStrength,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
connect(gl->maxAngle,SIGNAL(valueChanged(int)),this,SLOT(saveMaxAngle(int))); connect(gl->maxAngle,SIGNAL(valueChanged(int)),this,SLOT(saveMaxAngle(int)));
connect(gl->maxAngle,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->maxAngle,SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
connect(gl->performanceSlider, SIGNAL(valueChanged(int)),this,SLOT(savePerformance(int))); connect(gl->performanceSlider, SIGNAL(valueChanged(int)),this,SLOT(savePerformance(int)));
connect(gl->performanceSlider, SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); connect(gl->performanceSlider, SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged()));
@ -237,7 +237,7 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
sw->setVisible(true); sw->setVisible(true);
useGL->setChecked(false); useGL->setChecked(false);
} }
if(!settings->contains(FLOW_TYPE_GL)) if(!settings->contains(FLOW_TYPE_GL))
{ {
@ -253,7 +253,7 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
gl->vSyncCheck->setChecked(false); gl->vSyncCheck->setChecked(false);
gl->performanceSlider->setValue(settings->value(PERFORMANCE).toInt()); gl->performanceSlider->setValue(settings->value(PERFORMANCE).toInt());
FlowType flowType; FlowType flowType;
switch(settings->value(FLOW_TYPE_GL).toInt()) switch(settings->value(FLOW_TYPE_GL).toInt())
{ {
@ -275,8 +275,10 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
case 5: case 5:
flowType = Custom; flowType = Custom;
break; break;
default:
flowType = CoverFlowLike;
} }
if(flowType == Custom) if(flowType == Custom)
{ {
@ -311,7 +313,7 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
gl->radionModern->setChecked(true); gl->radionModern->setChecked(true);
return; return;
} }
if(flowType == Roulette) if(flowType == Roulette)
{ {
setRouletteConfig(); setRouletteConfig();
@ -399,7 +401,7 @@ void YACReaderOptionsDialog::setModernConfig()
void YACReaderOptionsDialog::setRouletteConfig() void YACReaderOptionsDialog::setRouletteConfig()
{ {
gl->setValues(pressetYACReaderFlowDownConfig); gl->setValues(pressetYACReaderFlowDownConfig);
saveFlowParameters(); saveFlowParameters();
settings->setValue(FLOW_TYPE_GL,Roulette); settings->setValue(FLOW_TYPE_GL,Roulette);