diff --git a/YACReader/main_window_viewer.cpp b/YACReader/main_window_viewer.cpp index 99bd4cc0..8429fac3 100644 --- a/YACReader/main_window_viewer.cpp +++ b/YACReader/main_window_viewer.cpp @@ -1682,7 +1682,10 @@ void MainWindowViewer::decreasePageZoomLevel() void MainWindowViewer::sendComic() { YACReaderLocalClient * client = new YACReaderLocalClient; + + connect(client, &YACReaderLocalClient::finished, client, &YACReaderLocalClient::deleteLater); currentComicDB.info.lastTimeOpened = QDateTime::currentMSecsSinceEpoch() / 1000; + viewer->updateComic(currentComicDB); if (currentComicDB.info.currentPage == currentComicDB.info.numPages) { @@ -1692,15 +1695,12 @@ void MainWindowViewer::sendComic() ComicDB & nextComic = siblingComics[currentIndex+1]; nextComic.info.hasBeenOpened = true; int retries = 1; - while(!client->sendComicInfo(libraryId,currentComicDB,nextComic.id) && retries!=0) + while(!client->sendComicInfo(libraryId, currentComicDB, nextComic.id) && retries!=0) retries--; - connect(client,SIGNAL(finished()),client,SLOT(deleteLater())); } } else { int retries = 1; - while(!client->sendComicInfo(libraryId,currentComicDB) && retries!=0) + while(!client->sendComicInfo(libraryId, currentComicDB) && retries!=0) retries--; - connect(client,SIGNAL(finished()),client,SLOT(deleteLater())); } - //delete client; } diff --git a/YACReaderLibrary/comic_vine/sort_volume_comics.cpp b/YACReaderLibrary/comic_vine/sort_volume_comics.cpp index c62ae6ca..45ed0bae 100644 --- a/YACReaderLibrary/comic_vine/sort_volume_comics.cpp +++ b/YACReaderLibrary/comic_vine/sort_volume_comics.cpp @@ -86,7 +86,7 @@ SortVolumeComics::SortVolumeComics(QWidget *parent) : //rows actions QAction * removeItemFromList = new QAction(tr("remove selected 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->addAction(removeItemFromList); @@ -95,7 +95,7 @@ SortVolumeComics::SortVolumeComics(QWidget *parent) : connect(removeItemFromList,SIGNAL(triggered()),this,SLOT(removeSelectedComics())); 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 & comics, const QString &json, const QString &vID) diff --git a/YACReaderLibrary/db/folder_model.cpp b/YACReaderLibrary/db/folder_model.cpp index f895e765..a6e095d3 100644 --- a/YACReaderLibrary/db/folder_model.cpp +++ b/YACReaderLibrary/db/folder_model.cpp @@ -823,7 +823,13 @@ void FolderModelProxy::setupFilteredModelData(QSqlQuery &sqlquery, FolderItem *p //si el nodo es hijo de 1 y no hab�a sido previamente insertado como hijo, se a�ade como tal if(!parentPreviousInserted) + { filteredItems.value(ROOT)->appendChild(item); + } + else + { + delete item; + } } } } diff --git a/YACReaderLibrary/server/lib/httpserver/httprequest.cpp b/YACReaderLibrary/server/lib/httpserver/httprequest.cpp index 0939bd47..efbf686b 100644 --- a/YACReaderLibrary/server/lib/httpserver/httprequest.cpp +++ b/YACReaderLibrary/server/lib/httpserver/httprequest.cpp @@ -460,16 +460,23 @@ void HttpRequest::parseMultiPartFile() else if (!fileName.isEmpty() && !fieldName.isEmpty()) { // last field was a file - #ifdef SUPERVERBOSE - qDebug("HttpRequest: finishing writing to uploaded file"); - #endif - uploadedFile->resize(uploadedFile->size()-2); - uploadedFile->flush(); - uploadedFile->seek(0); - parameters.insert(fieldName,fileName); - qDebug("HttpRequest: set parameter %s=%s",fieldName.data(),fileName.data()); - uploadedFiles.insert(fieldName,uploadedFile); - qDebug("HttpRequest: uploaded file size is %i",(int) uploadedFile->size()); + if (uploadedFile) + { + #ifdef SUPERVERBOSE + qDebug("HttpRequest: finishing writing to uploaded file"); + #endif + uploadedFile->resize(uploadedFile->size()-2); + uploadedFile->flush(); + uploadedFile->seek(0); + parameters.insert(fieldName,fileName); + 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+"--")) { @@ -546,4 +553,3 @@ QHostAddress HttpRequest::getPeerAddress() const { return peerAddress; } - diff --git a/YACReaderLibrary/server/lib/logging/filelogger.cpp b/YACReaderLibrary/server/lib/logging/filelogger.cpp index 3e027bc2..a30acd85 100644 --- a/YACReaderLibrary/server/lib/logging/filelogger.cpp +++ b/YACReaderLibrary/server/lib/logging/filelogger.cpp @@ -92,8 +92,8 @@ void FileLogger::write(const LogMessage* logMessage) // Check for success if (file->error()) { - close(); qWarning("Cannot write to log file %s: %s",qPrintable(fileName),qPrintable(file->errorString())); + close(); } } diff --git a/custom_widgets/yacreader_options_dialog.cpp b/custom_widgets/yacreader_options_dialog.cpp index 8e7af105..29fa4daa 100644 --- a/custom_widgets/yacreader_options_dialog.cpp +++ b/custom_widgets/yacreader_options_dialog.cpp @@ -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,SIGNAL(optionsChanged())); - + connect(gl->yPosition,SIGNAL(valueChanged(int)),this,SLOT(saveYPosition(int))); 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,SIGNAL(optionsChanged())); - + connect(gl->centralDistance,SIGNAL(valueChanged(int)),this,SLOT(saveCentralDistance(int))); 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,SIGNAL(optionsChanged())); - + connect(gl->yCoverOffset,SIGNAL(valueChanged(int)),this,SLOT(saveYCoverOffset(int))); 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,SIGNAL(optionsChanged())); - + connect(gl->coverRotation,SIGNAL(valueChanged(int)),this,SLOT(saveCoverRotation(int))); 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,SIGNAL(optionsChanged())); - + connect(gl->lightStrength,SIGNAL(valueChanged(int)),this,SLOT(saveLightStrength(int))); 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,SIGNAL(optionsChanged())); - + connect(gl->performanceSlider, SIGNAL(valueChanged(int)),this,SLOT(savePerformance(int))); connect(gl->performanceSlider, SIGNAL(valueChanged(int)),this,SIGNAL(optionsChanged())); @@ -237,7 +237,7 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings) sw->setVisible(true); useGL->setChecked(false); } - + if(!settings->contains(FLOW_TYPE_GL)) { @@ -253,7 +253,7 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings) gl->vSyncCheck->setChecked(false); gl->performanceSlider->setValue(settings->value(PERFORMANCE).toInt()); - + FlowType flowType; switch(settings->value(FLOW_TYPE_GL).toInt()) { @@ -275,8 +275,10 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings) case 5: flowType = Custom; break; + default: + flowType = CoverFlowLike; } - + if(flowType == Custom) { @@ -311,7 +313,7 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings) gl->radionModern->setChecked(true); return; } - + if(flowType == Roulette) { setRouletteConfig(); @@ -399,7 +401,7 @@ void YACReaderOptionsDialog::setModernConfig() void YACReaderOptionsDialog::setRouletteConfig() { gl->setValues(pressetYACReaderFlowDownConfig); - + saveFlowParameters(); settings->setValue(FLOW_TYPE_GL,Roulette);