mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
merge
This commit is contained in:
parent
de49a17f85
commit
5b70ebeaad
@ -72,6 +72,7 @@ ClassicComicsView::ClassicComicsView(QWidget *parent)
|
|||||||
connect(tableView, SIGNAL(comicRated(int,QModelIndex)), this, SIGNAL(comicRated(int,QModelIndex)));
|
connect(tableView, SIGNAL(comicRated(int,QModelIndex)), this, SIGNAL(comicRated(int,QModelIndex)));
|
||||||
connect(comicFlow, SIGNAL(selected(uint)), this, SIGNAL(selected(uint)));
|
connect(comicFlow, SIGNAL(selected(uint)), this, SIGNAL(selected(uint)));
|
||||||
connect(tableView->horizontalHeader(), SIGNAL(sectionMoved(int,int,int)), this, SLOT(saveTableHeadersStatus()));
|
connect(tableView->horizontalHeader(), SIGNAL(sectionMoved(int,int,int)), this, SLOT(saveTableHeadersStatus()));
|
||||||
|
connect(tableView->horizontalHeader(), SIGNAL(sectionResized(int,int,int)), this, SLOT(saveTableHeadersStatus()));
|
||||||
connect(comicFlow, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(requestedViewContextMenu(QPoint)));
|
connect(comicFlow, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(requestedViewContextMenu(QPoint)));
|
||||||
connect(tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(requestedItemContextMenu(QPoint)));
|
connect(tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(requestedItemContextMenu(QPoint)));
|
||||||
layout->addWidget(sVertical);
|
layout->addWidget(sVertical);
|
||||||
@ -83,8 +84,10 @@ ClassicComicsView::ClassicComicsView(QWidget *parent)
|
|||||||
sVertical->setCollapsible(1,false);
|
sVertical->setCollapsible(1,false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
settingsMutex.lock();
|
||||||
if(settings->contains(COMICS_VIEW_FLOW_SPLITTER_STATUS))
|
if(settings->contains(COMICS_VIEW_FLOW_SPLITTER_STATUS))
|
||||||
sVertical->restoreState(settings->value(COMICS_VIEW_FLOW_SPLITTER_STATUS).toByteArray());
|
sVertical->restoreState(settings->value(COMICS_VIEW_FLOW_SPLITTER_STATUS).toByteArray());
|
||||||
|
settingsMutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassicComicsView::setToolBar(QToolBar *toolBar)
|
void ClassicComicsView::setToolBar(QToolBar *toolBar)
|
||||||
@ -120,22 +123,30 @@ void ClassicComicsView::setModel(ComicModel *model)
|
|||||||
tableView->horizontalHeader()->setMovable(true);
|
tableView->horizontalHeader()->setMovable(true);
|
||||||
#endif
|
#endif
|
||||||
//TODO parametrizar la configuración de las columnas
|
//TODO parametrizar la configuración de las columnas
|
||||||
for(int i = 0;i<tableView->horizontalHeader()->count();i++)
|
settingsMutex.lock();
|
||||||
tableView->horizontalHeader()->hideSection(i);
|
if(!settings->contains(COMICS_VIEW_HEADERS))
|
||||||
|
{
|
||||||
|
for(int i = 0;i<tableView->horizontalHeader()->count();i++)
|
||||||
|
tableView->horizontalHeader()->hideSection(i);
|
||||||
|
|
||||||
tableView->horizontalHeader()->showSection(ComicModel::Number);
|
tableView->horizontalHeader()->showSection(ComicModel::Number);
|
||||||
tableView->horizontalHeader()->showSection(ComicModel::Title);
|
tableView->horizontalHeader()->showSection(ComicModel::Title);
|
||||||
tableView->horizontalHeader()->showSection(ComicModel::FileName);
|
tableView->horizontalHeader()->showSection(ComicModel::FileName);
|
||||||
tableView->horizontalHeader()->showSection(ComicModel::NumPages);
|
tableView->horizontalHeader()->showSection(ComicModel::NumPages);
|
||||||
tableView->horizontalHeader()->showSection(ComicModel::Hash); //Size is part of the Hash...TODO add Columns::Size to Columns
|
tableView->horizontalHeader()->showSection(ComicModel::Hash); //Size is part of the Hash...TODO add Columns::Size to Columns
|
||||||
tableView->horizontalHeader()->showSection(ComicModel::ReadColumn);
|
tableView->horizontalHeader()->showSection(ComicModel::ReadColumn);
|
||||||
tableView->horizontalHeader()->showSection(ComicModel::CurrentPage);
|
tableView->horizontalHeader()->showSection(ComicModel::CurrentPage);
|
||||||
tableView->horizontalHeader()->showSection(ComicModel::Rating);
|
tableView->horizontalHeader()->showSection(ComicModel::Rating);
|
||||||
|
}
|
||||||
|
settingsMutex.unlock();
|
||||||
|
|
||||||
//debido a un bug, qt4 no es capaz de ajustar el ancho teniendo en cuenta todas la filas (no sólo las visibles)
|
//debido a un bug, qt4 no es capaz de ajustar el ancho teniendo en cuenta todas la filas (no sólo las visibles)
|
||||||
//así que se ecala la primera vez y después se deja el control al usuario.
|
//así que se ecala la primera vez y después se deja el control al usuario.
|
||||||
//if(!settings->contains(COMICS_VIEW_HEADERS))
|
settingsMutex.lock();
|
||||||
tableView->resizeColumnsToContents();
|
if(!settings->contains(COMICS_VIEW_HEADERS))
|
||||||
|
tableView->resizeColumnsToContents();
|
||||||
|
settingsMutex.unlock();
|
||||||
|
|
||||||
tableView->horizontalHeader()->setStretchLastSection(true);
|
tableView->horizontalHeader()->setStretchLastSection(true);
|
||||||
|
|
||||||
QStringList paths = model->getPaths(model->getCurrentPath());//TODO ComicsView: get currentpath from somewhere currentPath());
|
QStringList paths = model->getPaths(model->getCurrentPath());//TODO ComicsView: get currentpath from somewhere currentPath());
|
||||||
@ -270,8 +281,10 @@ void ClassicComicsView::saveTableHeadersStatus()
|
|||||||
|
|
||||||
void ClassicComicsView::saveSplitterStatus()
|
void ClassicComicsView::saveSplitterStatus()
|
||||||
{
|
{
|
||||||
|
settingsMutex.lock();
|
||||||
if(!searching)
|
if(!searching)
|
||||||
settings->setValue(COMICS_VIEW_FLOW_SPLITTER_STATUS, sVertical->saveState());
|
settings->setValue(COMICS_VIEW_FLOW_SPLITTER_STATUS, sVertical->saveState());
|
||||||
|
settingsMutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassicComicsView::applyModelChanges(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
|
void ClassicComicsView::applyModelChanges(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
|
||||||
|
@ -169,10 +169,12 @@ void SortVolumeComics::moveDownCL()
|
|||||||
QList<QModelIndex> selection = tableFiles->selectionModel()->selectedIndexes();
|
QList<QModelIndex> selection = tableFiles->selectionModel()->selectedIndexes();
|
||||||
|
|
||||||
if(selection.count() > 0)
|
if(selection.count() > 0)
|
||||||
|
{
|
||||||
localComicsModel->moveSelectionDown(selection);
|
localComicsModel->moveSelectionDown(selection);
|
||||||
|
|
||||||
selection = tableFiles->selectionModel()->selectedIndexes();
|
selection = tableFiles->selectionModel()->selectedIndexes();
|
||||||
tableFiles->scrollTo(selection.last());
|
tableFiles->scrollTo(selection.last());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SortVolumeComics::moveUpIL()
|
void SortVolumeComics::moveUpIL()
|
||||||
|
@ -47,7 +47,7 @@ bool ComicModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, i
|
|||||||
return data->formats().contains(YACReader::YACReaderLibrarComiscSelectionMimeDataFormat);
|
return data->formats().contains(YACReader::YACReaderLibrarComiscSelectionMimeDataFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: optimize this method
|
//TODO: optimize this method (seriously)
|
||||||
bool ComicModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
|
bool ComicModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -118,9 +118,26 @@ bool ComicModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int
|
|||||||
|
|
||||||
QLOG_INFO() << newSorting;
|
QLOG_INFO() << newSorting;
|
||||||
|
|
||||||
if(!beginMoveRows(parent,currentIndexes.first(),currentIndexes.last(),parent,row))
|
int tempRow = row;
|
||||||
return false;
|
foreach(qulonglong id, comicIds)
|
||||||
_data = resortedData;
|
{
|
||||||
|
int i = 0;
|
||||||
|
foreach (ComicItem *item, _data) {
|
||||||
|
if(item->data(Id) == id)
|
||||||
|
{
|
||||||
|
beginMoveRows(parent,i,i,parent,tempRow);
|
||||||
|
_data.removeAll(item);
|
||||||
|
_data.insert(tempRow++, item);
|
||||||
|
endMoveRows();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if(!beginMoveRows(parent,currentIndexes.first(),currentIndexes.last(),parent,row))
|
||||||
|
return false;*/
|
||||||
|
_data = resortedData; //TODO No longer needed
|
||||||
|
|
||||||
|
|
||||||
//TODO emit signals
|
//TODO emit signals
|
||||||
@ -145,7 +162,7 @@ bool ComicModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int
|
|||||||
|
|
||||||
QSqlDatabase::removeDatabase(_databasePath);
|
QSqlDatabase::removeDatabase(_databasePath);
|
||||||
|
|
||||||
endMoveRows();
|
//endMoveRows();
|
||||||
|
|
||||||
emit resortedIndexes(newSorting);
|
emit resortedIndexes(newSorting);
|
||||||
int destSelectedIndex = row<0?_data.length():row;
|
int destSelectedIndex = row<0?_data.length():row;
|
||||||
|
@ -339,6 +339,12 @@ Rectangle {
|
|||||||
currentIndex: 0
|
currentIndex: 0
|
||||||
cacheBuffer: 0
|
cacheBuffer: 0
|
||||||
|
|
||||||
|
footer: Rectangle { //fix for the scroll issue, TODO find what causes the issue (some times the bottoms cells are hidden for the toolbar, no full scroll)
|
||||||
|
height : 25
|
||||||
|
width : parent.width
|
||||||
|
color : backgroundColor
|
||||||
|
}
|
||||||
|
|
||||||
move: Transition {
|
move: Transition {
|
||||||
NumberAnimation { properties: "x,y"; duration: 250 }
|
NumberAnimation { properties: "x,y"; duration: 250 }
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ void FolderController::service(HttpRequest& request, HttpResponse& response)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(folderId!=1)
|
if(folderId!=1)
|
||||||
t.setVariable("folder.name",folderName);
|
t.setVariable("folder.name",folderName);
|
||||||
else
|
else
|
||||||
t.setVariable("folder.name",libraryName);
|
t.setVariable("folder.name",libraryName);
|
||||||
QList<LibraryItem *> folderContent = DBHelper::getFolderSubfoldersFromLibrary(libraryId,folderId);
|
QList<LibraryItem *> folderContent = DBHelper::getFolderSubfoldersFromLibrary(libraryId,folderId);
|
||||||
@ -155,75 +155,81 @@ void FolderController::service(HttpRequest& request, HttpResponse& response)
|
|||||||
t.setVariable(QString("path%1.name").arg(i-1),DBHelper::getFolderName(libraryId,foldersPath[i].first));
|
t.setVariable(QString("path%1.name").arg(i-1),DBHelper::getFolderName(libraryId,foldersPath[i].first));
|
||||||
}
|
}
|
||||||
|
|
||||||
t.loop("element",numFoldersAtCurrentPage);
|
if(folderContent.length() > 0)
|
||||||
int i = 0;
|
{
|
||||||
while(i<numFoldersAtCurrentPage)
|
t.loop("element",numFoldersAtCurrentPage);
|
||||||
{
|
int i = 0;
|
||||||
LibraryItem * item = folderContent.at(i + (page*elementsPerPage));
|
while(i<numFoldersAtCurrentPage)
|
||||||
t.setVariable(QString("element%1.name").arg(i),folderContent.at(i + (page*elementsPerPage))->name);
|
{
|
||||||
if(item->isDir())
|
LibraryItem * item = folderContent.at(i + (page*elementsPerPage));
|
||||||
{
|
t.setVariable(QString("element%1.name").arg(i),folderContent.at(i + (page*elementsPerPage))->name);
|
||||||
t.setVariable(QString("element%1.class").arg(i),"folder");
|
if(item->isDir())
|
||||||
|
|
||||||
QList<LibraryItem *> children = DBHelper::getFolderComicsFromLibrary(libraryId, item->id);
|
|
||||||
if(children.length()>0)
|
|
||||||
{
|
{
|
||||||
const ComicDB * comic = static_cast<ComicDB*>(children.at(0));
|
t.setVariable(QString("element%1.class").arg(i),"folder");
|
||||||
t.setVariable(QString("element%1.image.url").arg(i),QString("/library/%1/cover/%2.jpg?folderCover=true").arg(libraryId).arg(comic->info.hash));
|
|
||||||
|
QList<LibraryItem *> children = DBHelper::getFolderComicsFromLibrary(libraryId, item->id);
|
||||||
|
if(children.length()>0)
|
||||||
|
{
|
||||||
|
const ComicDB * comic = static_cast<ComicDB*>(children.at(0));
|
||||||
|
t.setVariable(QString("element%1.image.url").arg(i),QString("/library/%1/cover/%2.jpg?folderCover=true").arg(libraryId).arg(comic->info.hash));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
t.setVariable(QString("element%1.image.url").arg(i),"/images/f.png");
|
||||||
|
|
||||||
|
t.setVariable(QString("element%1.browse").arg(i),QString("<a class =\"browseButton\" href=\"%1\">BROWSE</a>").arg(QString("/library/%1/folder/%2").arg(libraryId).arg(item->id)));
|
||||||
|
t.setVariable(QString("element%1.cover.browse").arg(i),QString("<a href=\"%1\">").arg(QString("/library/%1/folder/%2").arg(libraryId).arg(item->id)));
|
||||||
|
t.setVariable(QString("element%1.cover.browse.end").arg(i),"</a>");
|
||||||
|
//t.setVariable(QString("element%1.url").arg(i),"/library/"+libraryName+"/folder/"+QString("%1").arg(folderContent.at(i + (page*10))->id));
|
||||||
|
//t.setVariable(QString("element%1.downloadurl").arg(i),"/library/"+libraryName+"/folder/"+QString("%1/info").arg(folderContent.at(i + (page*elementsPerPage))->id));
|
||||||
|
|
||||||
|
t.setVariable(QString("element%1.download").arg(i),QString("<a onclick=\"this.innerHTML='IMPORTING';this.className='importedButton';\" class =\"importButton\" href=\"%1\">IMPORT</a>").arg("/library/"+QString::number(libraryId)+"/folder/"+QString("%1/info").arg(folderContent.at(i + (page*elementsPerPage))->id)));
|
||||||
|
t.setVariable(QString("element%1.read").arg(i),"");
|
||||||
|
|
||||||
|
t.setVariable(QString("element%1.size").arg(i),"");
|
||||||
|
t.setVariable(QString("element%1.pages").arg(i),"");
|
||||||
|
t.setVariable(QString("element%1.status").arg(i),"");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
t.setVariable(QString("element%1.image.url").arg(i),"/images/f.png");
|
{
|
||||||
|
t.setVariable(QString("element%1.class").arg(i),"cover");
|
||||||
t.setVariable(QString("element%1.browse").arg(i),QString("<a class =\"browseButton\" href=\"%1\">BROWSE</a>").arg(QString("/library/%1/folder/%2").arg(libraryId).arg(item->id)));
|
const ComicDB * comic = (ComicDB *)item;
|
||||||
t.setVariable(QString("element%1.cover.browse").arg(i),QString("<a href=\"%1\">").arg(QString("/library/%1/folder/%2").arg(libraryId).arg(item->id)));
|
t.setVariable(QString("element%1.browse").arg(i),"");
|
||||||
t.setVariable(QString("element%1.cover.browse.end").arg(i),"</a>");
|
//t.setVariable(QString("element%1.downloadurl").arg(i),"/library/"+libraryName+"/comic/"+QString("%1").arg(comic->id));
|
||||||
//t.setVariable(QString("element%1.url").arg(i),"/library/"+libraryName+"/folder/"+QString("%1").arg(folderContent.at(i + (page*10))->id));
|
if(!session.isComicOnDevice(comic->info.hash) && !session.isComicDownloaded(comic->info.hash))
|
||||||
//t.setVariable(QString("element%1.downloadurl").arg(i),"/library/"+libraryName+"/folder/"+QString("%1/info").arg(folderContent.at(i + (page*elementsPerPage))->id));
|
t.setVariable(QString("element%1.download").arg(i),QString("<a onclick=\"this.innerHTML='IMPORTING';this.className='importedButton';\" class =\"importButton\" href=\"%1\">IMPORT</a>").arg("/library/"+QString::number(libraryId)+"/comic/"+QString("%1").arg(comic->id)));
|
||||||
|
else if (session.isComicOnDevice(comic->info.hash))
|
||||||
t.setVariable(QString("element%1.download").arg(i),QString("<a onclick=\"this.innerHTML='IMPORTING';this.className='importedButton';\" class =\"importButton\" href=\"%1\">IMPORT</a>").arg("/library/"+QString::number(libraryId)+"/folder/"+QString("%1/info").arg(folderContent.at(i + (page*elementsPerPage))->id)));
|
|
||||||
t.setVariable(QString("element%1.read").arg(i),"");
|
|
||||||
|
|
||||||
t.setVariable(QString("element%1.size").arg(i),"");
|
|
||||||
t.setVariable(QString("element%1.pages").arg(i),"");
|
|
||||||
t.setVariable(QString("element%1.status").arg(i),"");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
t.setVariable(QString("element%1.class").arg(i),"cover");
|
|
||||||
const ComicDB * comic = (ComicDB *)item;
|
|
||||||
t.setVariable(QString("element%1.browse").arg(i),"");
|
|
||||||
//t.setVariable(QString("element%1.downloadurl").arg(i),"/library/"+libraryName+"/comic/"+QString("%1").arg(comic->id));
|
|
||||||
if(!session.isComicOnDevice(comic->info.hash) && !session.isComicDownloaded(comic->info.hash))
|
|
||||||
t.setVariable(QString("element%1.download").arg(i),QString("<a onclick=\"this.innerHTML='IMPORTING';this.className='importedButton';\" class =\"importButton\" href=\"%1\">IMPORT</a>").arg("/library/"+QString::number(libraryId)+"/comic/"+QString("%1").arg(comic->id)));
|
|
||||||
else if (session.isComicOnDevice(comic->info.hash))
|
|
||||||
t.setVariable(QString("element%1.download").arg(i),QString("<div class=\"importedButton\">IMPORTED</div>"));
|
t.setVariable(QString("element%1.download").arg(i),QString("<div class=\"importedButton\">IMPORTED</div>"));
|
||||||
else
|
else
|
||||||
t.setVariable(QString("element%1.download").arg(i),QString("<div class=\"importedButton\">IMPORTING</div>"));
|
t.setVariable(QString("element%1.download").arg(i),QString("<div class=\"importedButton\">IMPORTING</div>"));
|
||||||
|
|
||||||
//t.setVariable(QString("element%1.image.url").arg(i),"/images/f.png");
|
//t.setVariable(QString("element%1.image.url").arg(i),"/images/f.png");
|
||||||
|
|
||||||
t.setVariable(QString("element%1.read").arg(i),QString("<a class =\"readButton\" href=\"%1\">READ</a>").arg("/library/"+QString::number(libraryId)+"/comic/"+QString("%1").arg(comic->id)+"/remote"));
|
t.setVariable(QString("element%1.read").arg(i),QString("<a class =\"readButton\" href=\"%1\">READ</a>").arg("/library/"+QString::number(libraryId)+"/comic/"+QString("%1").arg(comic->id)+"/remote"));
|
||||||
|
|
||||||
t.setVariable(QString("element%1.image.url").arg(i),QString("/library/%1/cover/%2.jpg").arg(libraryId).arg(comic->info.hash));
|
t.setVariable(QString("element%1.image.url").arg(i),QString("/library/%1/cover/%2.jpg").arg(libraryId).arg(comic->info.hash));
|
||||||
|
|
||||||
t.setVariable(QString("element%1.size").arg(i),"<span class=\"comicSize\">" + QString::number(comic->info.hash.right(comic->info.hash.length()-40).toInt()/1024.0/1024.0,'f',2)+"Mb</span>");
|
t.setVariable(QString("element%1.size").arg(i),"<span class=\"comicSize\">" + QString::number(comic->info.hash.right(comic->info.hash.length()-40).toInt()/1024.0/1024.0,'f',2)+"Mb</span>");
|
||||||
if(comic->info.hasBeenOpened)
|
if(comic->info.hasBeenOpened)
|
||||||
t.setVariable(QString("element%1.pages").arg(i),QString("<span class=\"numPages\">%1/%2 pages</span>").arg(comic->info.currentPage).arg(comic->info.numPages.toInt()));
|
t.setVariable(QString("element%1.pages").arg(i),QString("<span class=\"numPages\">%1/%2 pages</span>").arg(comic->info.currentPage).arg(comic->info.numPages.toInt()));
|
||||||
else
|
else
|
||||||
t.setVariable(QString("element%1.pages").arg(i),QString("<span class=\"numPages\">%1 pages</span>").arg(comic->info.numPages.toInt()));
|
t.setVariable(QString("element%1.pages").arg(i),QString("<span class=\"numPages\">%1 pages</span>").arg(comic->info.numPages.toInt()));
|
||||||
|
|
||||||
if(comic->info.read)
|
if(comic->info.read)
|
||||||
t.setVariable(QString("element%1.status").arg(i), QString("<div class=\"mark\"><img src=\"/images/readMark.png\" style = \"width: 15px\"/> </div>"));
|
t.setVariable(QString("element%1.status").arg(i), QString("<div class=\"mark\"><img src=\"/images/readMark.png\" style = \"width: 15px\"/> </div>"));
|
||||||
else if(comic->info.hasBeenOpened)
|
else if(comic->info.hasBeenOpened)
|
||||||
t.setVariable(QString("element%1.status").arg(i), QString("<div class=\"mark\"><img src=\"/images/readingMark.png\" style = \"width: 15px\"/> </div>"));
|
t.setVariable(QString("element%1.status").arg(i), QString("<div class=\"mark\"><img src=\"/images/readingMark.png\" style = \"width: 15px\"/> </div>"));
|
||||||
else
|
else
|
||||||
t.setVariable(QString("element%1.status").arg(i),"");
|
t.setVariable(QString("element%1.status").arg(i),"");
|
||||||
|
|
||||||
t.setVariable(QString("element%1.cover.browse").arg(i),"");
|
t.setVariable(QString("element%1.cover.browse").arg(i),"");
|
||||||
t.setVariable(QString("element%1.cover.browse.end").arg(i),"");
|
t.setVariable(QString("element%1.cover.browse.end").arg(i),"");
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
t.loop("element",0);
|
||||||
|
}
|
||||||
|
|
||||||
if(numPages > 1)
|
if(numPages > 1)
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@ HttpSessionStore::HttpSessionStore(QSettings* settings, QObject* parent)
|
|||||||
connect(&cleanupTimer,SIGNAL(timeout()),this,SLOT(timerEvent()));
|
connect(&cleanupTimer,SIGNAL(timeout()),this,SLOT(timerEvent()));
|
||||||
cleanupTimer.start(60000);
|
cleanupTimer.start(60000);
|
||||||
cookieName=settings->value("cookieName","sessionid").toByteArray();
|
cookieName=settings->value("cookieName","sessionid").toByteArray();
|
||||||
expirationTime=settings->value("expirationTime",86400000).toInt();
|
expirationTime=settings->value("expirationTime",864000000).toInt();
|
||||||
qDebug("HttpSessionStore: Sessions expire after %i milliseconds",expirationTime);
|
qDebug("HttpSessionStore: Sessions expire after %i milliseconds",expirationTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +90,9 @@ void HttpSessionStore::timerEvent() {
|
|||||||
++i;
|
++i;
|
||||||
HttpSession session=prev.value();
|
HttpSession session=prev.value();
|
||||||
qint64 lastAccess=session.getLastAccess();
|
qint64 lastAccess=session.getLastAccess();
|
||||||
if (now-lastAccess>expirationTime) {
|
if (now-lastAccess>expirationTime) { //TODO cleaning up will cause current opened comic to be deleted, so clients won't be able to download it
|
||||||
|
//If the cleaning occurs in the midle of a download it going to cause issues
|
||||||
|
//Temporal fix: use a big expirationTime = 10 days
|
||||||
qDebug("HttpSessionStore: session %s expired",session.getId().data());
|
qDebug("HttpSessionStore: session %s expired",session.getId().data());
|
||||||
sessions.erase(prev);
|
sessions.erase(prev);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ body{
|
|||||||
|
|
||||||
/* libraries */
|
/* libraries */
|
||||||
#contentLibraries{
|
#contentLibraries{
|
||||||
width: 300px;
|
width: 400px;
|
||||||
border: 1px solid #C6C6C6;
|
border: 1px solid #C6C6C6;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
@ -36,7 +36,7 @@ body{
|
|||||||
|
|
||||||
#contentLibraries .library-link
|
#contentLibraries .library-link
|
||||||
{
|
{
|
||||||
width: 211px;
|
width: 311px;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 11px 0 0 0px;
|
padding: 11px 0 0 0px;
|
||||||
@ -47,6 +47,7 @@ body{
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #525252 ;
|
color: #525252 ;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#contentLibraries a
|
#contentLibraries a
|
||||||
|
@ -35,7 +35,7 @@ body{
|
|||||||
|
|
||||||
#contentLibraries .library-link
|
#contentLibraries .library-link
|
||||||
{
|
{
|
||||||
width: 211px;
|
width: 65%;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 11px 0 0 0px;
|
padding: 11px 0 0 0px;
|
||||||
@ -46,6 +46,7 @@ body{
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #525252 ;
|
color: #525252 ;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#contentLibraries a
|
#contentLibraries a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user