Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUIInfoManager: revert 8809df940d265f79e3d529b6591a2c8333ed06d6, this… #13631

Merged
merged 1 commit into from Mar 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 7 additions & 27 deletions xbmc/GUIInfoManager.cpp
Expand Up @@ -126,22 +126,6 @@ using namespace ADDON;
using namespace PVR;
using namespace INFO;

class CSetCurrentItemJob : public CJob
{
CFileItemPtr m_itemCurrentFile;
public:
explicit CSetCurrentItemJob(const CFileItem& item) : m_itemCurrentFile(std::make_shared<CFileItem>(item)) { }

~CSetCurrentItemJob(void) override = default;

bool DoWork(void) override
{
g_infoManager.SetCurrentItemJob(m_itemCurrentFile);
g_application.m_ServiceManager->GetAnnouncementManager().Announce(ANNOUNCEMENT::Info, "xbmc", "OnChanged");

return true;
}
};

bool InfoBoolComparator(const InfoPtr &right, const InfoPtr &left)
{
Expand Down Expand Up @@ -9056,21 +9040,17 @@ void CGUIInfoManager::ResetCurrentItem()
}

void CGUIInfoManager::SetCurrentItem(const CFileItem &item)
{
CSetCurrentItemJob *job = new CSetCurrentItemJob(item);
CJobManager::GetInstance().AddJob(job, NULL);
}

void CGUIInfoManager::SetCurrentItemJob(const CFileItemPtr item)
{
ResetCurrentItem();

if (item->IsAudio())
SetCurrentSong(*item);
else if (item->IsGame())
SetCurrentGame(*item);
CFileItem newItem(item);

if (newItem.IsAudio())
SetCurrentSong(newItem);
else if (newItem.IsGame())
SetCurrentGame(newItem);
else
SetCurrentMovie(*item);
SetCurrentMovie(newItem);

SetChanged();
NotifyObservers(ObservableMessageCurrentItem);
Expand Down
19 changes: 1 addition & 18 deletions xbmc/GUIInfoManager.h
@@ -1,11 +1,3 @@
/*!
\file GUIInfoManager.h
\brief
*/

#ifndef GUIINFOMANAGER_H_
#define GUIINFOMANAGER_H_

This comment was marked as spam.

This comment was marked as spam.

/*
* Copyright (C) 2005-2013 Team XBMC
* http://kodi.tv
Expand All @@ -25,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
#pragma once

#include "threads/CriticalSection.h"
#include "guilib/IMsgTargetCallback.h"
Expand Down Expand Up @@ -88,17 +81,13 @@ class GUIInfo
int m_data2;
};

class CSetCurrentItemJob;

/*!
\ingroup strings
\brief
*/
class CGUIInfoManager : public IMsgTargetCallback, public Observable,
public KODI::MESSAGING::IMessageTarget
{
friend CSetCurrentItemJob;

public:
CGUIInfoManager(void);
~CGUIInfoManager(void) override;
Expand Down Expand Up @@ -285,8 +274,6 @@ friend CSetCurrentItemJob;
int AddMultiInfo(const GUIInfo &info);
int AddListItemProp(const std::string &str, int offset=0);

void SetCurrentItemJob(const CFileItemPtr item);

// Conditional string parameters are stored here
std::vector<std::string> m_stringParameters;

Expand Down Expand Up @@ -355,8 +342,4 @@ friend CSetCurrentItemJob;
\brief
*/
extern CGUIInfoManager g_infoManager;
#endif