Bug 241641 - Current Track applet isn't displayed properly
Summary: Current Track applet isn't displayed properly
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Context View/Current Track (show other bugs)
Version: 2.3.1-GIT
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 250483 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-13 13:43 UTC by karaluh
Modified: 2010-10-01 18:40 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.4
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description karaluh 2010-06-13 13:43:29 UTC
Version:           2.3.1
OS:                Linux

When Amarok starts and "Continue playing when Amarok is started" is selected, the applet shows five songs of the artist instead of the current track info.

Reproducible: Always




OS: Linux (i686) release 2.6.32-22-generic
Compiler: cc
Comment 1 Mikko C. 2010-06-13 13:52:57 UTC
Confirmed here but for me it shows the last 5 played songs + how long ago they were played.
Comment 2 karaluh 2010-06-14 09:42:16 UTC
(In reply to comment #1)
> Confirmed here but for me it shows the last 5 played songs + how long ago they
> were played.

Yes, that's the case.
Comment 3 Mark Fraser 2010-09-03 18:38:18 UTC
I see this too even though I don't have "Resume playback on start" selected.
Comment 4 Myriam Schweingruber 2010-09-03 18:44:19 UTC
Mark, that is absolutely normal, it will change once you play something :)
Comment 5 Mark Fraser 2010-09-03 18:51:06 UTC
The first track I play after loading Amarok doesn't show the current track info in the context window, only the last 5 tracks played. When the next song starts, it displays correctly.
Comment 6 Mark Fraser 2010-09-04 11:42:34 UTC
Confirmed on another computer.

If I start Amarok playing from the system tray without the main window showing and then bring up the main window, I'll see a short glimpse of the currently playing track followed by 'no track playing' and then a display of the last 5 tracks played.
Comment 7 Myriam Schweingruber 2010-09-07 21:42:07 UTC
*** Bug 250483 has been marked as a duplicate of this bug. ***
Comment 8 Mark Kretschmann 2010-10-01 14:08:44 UTC
commit 82ba1151783e3cb3f19f567d9422f8e07d43bf0e
Author: Mark Kretschmann <kretschmann@kde.org>
Date:   Fri Oct 1 14:05:31 2010 +0200

    This Patch fixes Bug 241641 which causes the current engine to be not
    up-to-date after startup when a should continue playing. Now the current
    track and the albums applet show the right information just after startup.
    
    Patch by Conrad Hübler, thanks!
    
    BUG: 241641

diff --git a/src/App.cpp b/src/App.cpp
index 4d0625b..cd0efa3 100644
--- a/src/App.cpp
+++ b/src/App.cpp
@@ -643,6 +643,12 @@ App::continueInit()
         splash->show();
     }
 
+    if( AmarokConfig::resumePlayback() && restoreSession && !args->isSet( "stop" ) ) {
+        //restore session as long as the user didn't specify media to play etc.
+        //do this after applySettings() so OSD displays correctly
+        The::engineController()->restoreSession();
+    }
+
     PERF_LOG( "Creating MainWindow" )
     m_mainWindow = new MainWindow();
     PERF_LOG( "Done creating MainWindow" )
@@ -682,13 +688,6 @@ App::continueInit()
     Amarok::KNotificationBackend::instance()->setEnabled( AmarokConfig::kNotifyEnabled() );
     Amarok::OSD::instance()->applySettings(); // Create after setting volume (don't show OSD for that)
 
-
-    if( AmarokConfig::resumePlayback() && restoreSession && !args->isSet( "stop" ) ) {
-        //restore session as long as the user didn't specify media to play etc.
-        //do this after applySettings() so OSD displays correctly
-        The::engineController()->restoreSession();
-    }
-
     if( AmarokConfig::monitorChanges() )
         CollectionManager::instance()->checkCollectionChanges();
 
diff --git a/src/context/engines/current/CurrentEngine.cpp b/src/context/engines/current/CurrentEngine.cpp
index bb8e869..475b170 100644
--- a/src/context/engines/current/CurrentEngine.cpp
+++ b/src/context/engines/current/CurrentEngine.cpp
@@ -49,13 +49,19 @@ CurrentEngine::CurrentEngine( QObject* parent, const QList<QVariant>& args )
     m_sources << "current" << "albums";
     m_requested[ "current" ] = true;
     m_requested[ "albums" ] = false;
-    update();
 }
 
 CurrentEngine::~CurrentEngine()
 {
 }
 
+void
+CurrentEngine::init()
+{
+    m_currentTrack = The::engineController()->currentTrack();
+    Plasma::DataEngine::init();
+}
+
 QStringList
 CurrentEngine::sources() const
 {
diff --git a/src/context/engines/current/CurrentEngine.h b/src/context/engines/current/CurrentEngine.h
index 1214e50..0369065 100644
--- a/src/context/engines/current/CurrentEngine.h
+++ b/src/context/engines/current/CurrentEngine.h
@@ -54,6 +54,7 @@ class CurrentEngine : public Context::DataEngine,
 public:
     CurrentEngine( QObject* parent, const QList<QVariant>& args );
     virtual ~CurrentEngine();
+    virtual void init();
 
     QStringList sources() const;