diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d33ca57b..31f54e55 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,8 @@ +6.7 (No pública) +Añadidos nuevos campos en la base de datos para almacenar información adicional sobre cómics: rating, página actual, bookmarks y configuración de imagen +Añadida comunicación entre YACReaderLibrary y YACReader para poder almacenar el progreso de los cómics e información adicional + + 6.6 (No pública) Modificado YACReader para que abra los archivos comprimidos usando 7z.dll (.so, .dylib) YACReader abre ahora los cómics por la última página leída. diff --git a/YACReaderLibrary/db/tableitem.h b/YACReaderLibrary/db/tableitem.h index 56bdcc54..2b0656ee 100644 --- a/YACReaderLibrary/db/tableitem.h +++ b/YACReaderLibrary/db/tableitem.h @@ -15,7 +15,7 @@ public: QVariant data(int column) const; void setData(int column,const QVariant & value); int row() const; - unsigned long long int id; //TODO sustituir por una clase adecuada + //unsigned long long int id; //TODO sustituir por una clase adecuada //Comic comic; private: QList itemData; diff --git a/YACReaderLibrary/db/tablemodel.cpp b/YACReaderLibrary/db/tablemodel.cpp index ba594e95..01b72710 100644 --- a/YACReaderLibrary/db/tablemodel.cpp +++ b/YACReaderLibrary/db/tablemodel.cpp @@ -563,3 +563,23 @@ void TableModel::remove(int row) { removeInTransaction(row); } + +void TableModel::reload(const ComicDB & comic) +{ + int row = 0; + bool found = false; + foreach(TableItem * item,_data) + { + if(item->data(ID).toULongLong() == comic.id) + { + found = true; + item->setData(CURRENT_PAGE,comic.info.currentPage); + item->setData(HAS_BEEN_OPENED,true); + break; + + } + row++; + } + if(found) + emit dataChanged(index(row,CURRENT_PAGE),index(row,CURRENT_PAGE)); +} \ No newline at end of file diff --git a/YACReaderLibrary/db/tablemodel.h b/YACReaderLibrary/db/tablemodel.h index cc081db2..90902009 100644 --- a/YACReaderLibrary/db/tablemodel.h +++ b/YACReaderLibrary/db/tablemodel.h @@ -50,6 +50,7 @@ public: qint64 asignNumbers(QList list,int startingNumber); void remove(ComicDB * comic, int row); void removeInTransaction(int row); + void reload(const ComicDB & comic); public slots: void remove(int row); diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index d5b8ca8d..e7d516f8 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -1687,4 +1687,9 @@ void LibraryWindow::libraryAlreadyExists(const QString & name) void LibraryWindow::importLibraryPackage() { importLibraryDialog->show(libraries); +} + +void LibraryWindow::updateComicsView(const ComicDB & comic) +{ + dmCV->reload(comic); } \ No newline at end of file diff --git a/YACReaderLibrary/library_window.h b/YACReaderLibrary/library_window.h index 686a0f4a..cd570b98 100644 --- a/YACReaderLibrary/library_window.h +++ b/YACReaderLibrary/library_window.h @@ -261,6 +261,7 @@ public: void updateHistory(const QModelIndex & mi); void libraryAlreadyExists(const QString & name); void importLibraryPackage(); + void updateComicsView(const ComicDB & comic); }; diff --git a/YACReaderLibrary/main.cpp b/YACReaderLibrary/main.cpp index 4dc5ba7d..0f5f6e31 100644 --- a/YACReaderLibrary/main.cpp +++ b/YACReaderLibrary/main.cpp @@ -8,6 +8,7 @@ #include "yacreader_global.h" #include "startup.h" #include "yacreader_local_server.h" +#include "comic_db.h" #define PICTUREFLOW_QT4 1 @@ -48,6 +49,8 @@ int main( int argc, char ** argv ) LibraryWindow * mw = new LibraryWindow(); + mw->connect(localServer,SIGNAL(comicUpdated(const ComicDB &)),mw,SLOT(updateComicsView(const ComicDB &))); + //connections to localServer mw->show();