mirror of https://github.com/KDE/kasts.git
Make app restore last playing item
This commit is contained in:
parent
218b86807e
commit
e1b374e375
|
@ -24,7 +24,7 @@ public:
|
|||
Feed* getFeed(QString const feedurl) const;
|
||||
Entry* getEntry(int const feed_index, int const entry_index) const;
|
||||
Entry* getEntry(const Feed* feed, int const entry_index) const;
|
||||
Entry* getEntry(const QString id) const;
|
||||
Q_INVOKABLE Entry* getEntry(const QString id) const;
|
||||
int feedCount() const;
|
||||
int entryCount(const int feed_index) const;
|
||||
int entryCount(const Feed* feed) const;
|
||||
|
|
|
@ -67,6 +67,7 @@ int main(int argc, char *argv[])
|
|||
engine->setObjectOwnership(SettingsManager::self(), QQmlEngine::CppOwnership);
|
||||
return SettingsManager::self();
|
||||
});
|
||||
qRegisterMetaType<Entry*>("const Entry*"); // "hack" to make qml understand Entry*
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
|
||||
|
|
|
@ -82,7 +82,7 @@ Kirigami.ApplicationWindow {
|
|||
Audio {
|
||||
id: audio
|
||||
|
||||
property var entry
|
||||
property var entry: SettingsManager.lastPlayingEntry !== "none" ? DataManager.getEntry(SettingsManager.lastPlayingEntry) : undefined
|
||||
property bool playerOpen: false
|
||||
|
||||
onEntryChanged: SettingsManager.lastPlayingEntry = entry.id
|
||||
|
|
Loading…
Reference in New Issue