mirror of
https://github.com/YACReader/yacreader
synced 2025-06-03 17:18:23 -04:00
a?adidos los m?todos de remove para las clases "comic flow", ahora ya se puede implementar la funci?n de eliminar c?mics
This commit is contained in:
parent
8ce3579d53
commit
ea9d2bd169
@ -126,6 +126,16 @@ void ComicFlow::wheelEvent(QWheelEvent * event)
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void ComicFlow::removeSlide(int cover)
|
||||
{
|
||||
imageFiles.removeAt(cover);
|
||||
if(imagesLoaded[cover])
|
||||
numImagesLoaded--;
|
||||
imagesLoaded.remove(cover);
|
||||
imagesSetted.remove(cover);
|
||||
|
||||
YACReaderFlow::removeSlide(cover);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
//ImageLoader
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -23,6 +23,7 @@ public:
|
||||
void setImagePaths(const QStringList& paths);
|
||||
//bool eventFilter(QObject *target, QEvent *event);
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
void removeSlide(int cover);
|
||||
|
||||
private slots:
|
||||
void preload();
|
||||
|
@ -127,6 +127,11 @@ void ComicFlowWidgetSW::updateConfig(QSettings * settings)
|
||||
}
|
||||
}
|
||||
|
||||
void ComicFlowWidgetSW::remove(int cover)
|
||||
{
|
||||
flow->removeSlide(cover);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@ -313,6 +318,11 @@ void ComicFlowWidgetGL::updateConfig(QSettings * settings)
|
||||
|
||||
}
|
||||
|
||||
void ComicFlowWidgetGL::remove(int cover)
|
||||
{
|
||||
flow->remove(cover);
|
||||
}
|
||||
|
||||
//void ComicFlowWidgetGL::setCF_RX(int value){ flow->setCF_RX(value);}
|
||||
//void ComicFlowWidgetGL::setCF_RY(int value){ flow->setCF_RY(value);}
|
||||
//void ComicFlowWidgetGL::setCF_RZ(int value){ flow->setCF_RZ(value);}
|
||||
|
@ -30,6 +30,7 @@ public slots:
|
||||
virtual void setFlowType(FlowType flowType) = 0;
|
||||
virtual void render() = 0;
|
||||
virtual void updateConfig(QSettings * settings) = 0;
|
||||
virtual void remove(int cover) = 0;
|
||||
signals:
|
||||
void centerIndexChanged(int);
|
||||
void selected(unsigned int);
|
||||
@ -59,6 +60,7 @@ public:
|
||||
void setFlowType(FlowType flowType);
|
||||
void render();
|
||||
void updateConfig(QSettings * settings);
|
||||
void remove(int cover);
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
void paintEvent(QPaintEvent *event);
|
||||
@ -92,6 +94,7 @@ public:
|
||||
void setFlowType(FlowType flowType);
|
||||
void render();
|
||||
void updateConfig(QSettings * settings);
|
||||
void remove(int cover);
|
||||
//public slots:
|
||||
// void setCF_RX(int value);
|
||||
// //the Y Rotation of the Coverflow
|
||||
|
@ -1085,6 +1085,18 @@ void PictureFlow::addSlide(const QPixmap& pixmap)
|
||||
addSlide(pixmap.toImage());
|
||||
}
|
||||
|
||||
void PictureFlow::removeSlide(int index)
|
||||
{
|
||||
int c = d->state->slideImages.count();
|
||||
if (index >= 0 && index < c)
|
||||
{
|
||||
d->state->slideImages.remove(index);
|
||||
d->state->marks.remove(index);
|
||||
//TODO remove loaded flags
|
||||
triggerRender();
|
||||
}
|
||||
}
|
||||
|
||||
void PictureFlow::setSlide(int index, const QImage& image)
|
||||
{
|
||||
if((index >= 0) && (index < slideCount()))
|
||||
|
@ -130,6 +130,11 @@ public slots:
|
||||
*/
|
||||
void addSlide(const QPixmap& pixmap);
|
||||
|
||||
/*!
|
||||
Removes an existing slide.
|
||||
*/
|
||||
void removeSlide(int index);
|
||||
|
||||
/*!
|
||||
Sets an image for specified slide. If the slide already exists,
|
||||
it will be replaced.
|
||||
|
@ -674,6 +674,10 @@ void YACReaderFlowGL::remove(int item)
|
||||
}
|
||||
numObjects--;
|
||||
cfImages = (CFImage*)realloc(cfImages,numObjects*sizeof(CFImage));
|
||||
|
||||
loaded.remove(item);
|
||||
marks.remove(item);
|
||||
paths.removeAt(item);
|
||||
}
|
||||
|
||||
/*Info*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user