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;
|
Feed* getFeed(QString const feedurl) const;
|
||||||
Entry* getEntry(int const feed_index, int const entry_index) 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 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 feedCount() const;
|
||||||
int entryCount(const int feed_index) const;
|
int entryCount(const int feed_index) const;
|
||||||
int entryCount(const Feed* feed) const;
|
int entryCount(const Feed* feed) const;
|
||||||
|
@ -67,6 +67,7 @@ int main(int argc, char *argv[])
|
|||||||
engine->setObjectOwnership(SettingsManager::self(), QQmlEngine::CppOwnership);
|
engine->setObjectOwnership(SettingsManager::self(), QQmlEngine::CppOwnership);
|
||||||
return SettingsManager::self();
|
return SettingsManager::self();
|
||||||
});
|
});
|
||||||
|
qRegisterMetaType<Entry*>("const Entry*"); // "hack" to make qml understand Entry*
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
|
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
|
||||||
|
@ -82,7 +82,7 @@ Kirigami.ApplicationWindow {
|
|||||||
Audio {
|
Audio {
|
||||||
id: audio
|
id: audio
|
||||||
|
|
||||||
property var entry
|
property var entry: SettingsManager.lastPlayingEntry !== "none" ? DataManager.getEntry(SettingsManager.lastPlayingEntry) : undefined
|
||||||
property bool playerOpen: false
|
property bool playerOpen: false
|
||||||
|
|
||||||
onEntryChanged: SettingsManager.lastPlayingEntry = entry.id
|
onEntryChanged: SettingsManager.lastPlayingEntry = entry.id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user