X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=library.h;h=a1ac1764ba43a52adbe7fd4de0a7294a94ff65b9;hb=826aea4a3e3f4b4361b7592ad824963a529ffefd;hp=8f2f2e86603a521b4a29d40a5e72afb49149c415;hpb=5cb44bba326839e960956942b7a94a49b2b6e866;p=dorian diff --git a/library.h b/library.h index 8f2f2e8..a1ac176 100644 --- a/library.h +++ b/library.h @@ -16,10 +16,6 @@ class Library: public QAbstractListModel Q_OBJECT public: - enum { - BookRole = Qt::UserRole + 1, - }; - static Library *instance(); static void close(); int rowCount(const QModelIndex &parent = QModelIndex()) const; @@ -27,13 +23,17 @@ public: void save(); QModelIndex find(QString path) const; QModelIndex find(const Book *book) const; - Book *current() const; bool add(QString path); void remove(const QModelIndex &index); - void setCurrent(const QModelIndex index); + void setNowReading(const QModelIndex &index); + QModelIndex nowReading() const; + Book *book(const QModelIndex &index); signals: - void currentBookChanged(); + void nowReadingChanged(); + +public slots: + void onBookOpened(const QString &path); private: explicit Library(QObject *parent = 0); @@ -42,7 +42,7 @@ private: void clear(); static Library *mInstance; QList mBooks; - Book *mCurrent; + QModelIndex mNowReading; }; #endif // LIBRARY_H