Skip to content

Commit

Permalink
The more context items we refactor, the more we can merge. Like the n…
Browse files Browse the repository at this point in the history
…ormal delete from favourites and the delete in the favourites dialog.
  • Loading branch information
Fice committed Feb 15, 2013
1 parent db41923 commit 74ea3e3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
2 changes: 1 addition & 1 deletion xbmc/contextitems/FavoriteContextItems.h
Expand Up @@ -46,7 +46,7 @@ class CMAddRemoveFavorite : public IGUIContextItem
protected:
virtual bool execute(const CFileItemPtr item) {
CFavourites::AddOrRemove(item.get(), 0);

g_windowManager.SendMessage(GUI_MSG_REFRESH_LIST ,0 , WINDOW_DIALOG_FAVOURITES);
return true;
}

Expand Down
15 changes: 0 additions & 15 deletions xbmc/dialogs/GUIDialogFavourites.cpp
Expand Up @@ -125,7 +125,6 @@ void CGUIDialogFavourites::OnPopupMenu(int item)
choices.Add(1, 13332);
choices.Add(2, 13333);
}
choices.Add(3, 15015);
choices.Add(4, 118);
choices.Add(5, 20019);

Expand All @@ -144,8 +143,6 @@ void CGUIDialogFavourites::OnPopupMenu(int item)
OnMoveItem(item, -1);
else if (button == 2)
OnMoveItem(item, 1);
else if (button == 3)
OnDelete(item);
else if (button == 4)
OnRename(item);
else if (button == 5)
Expand All @@ -172,18 +169,6 @@ void CGUIDialogFavourites::OnMoveItem(int item, int amount)
UpdateList();
}

void CGUIDialogFavourites::OnDelete(int item)
{
if (item < 0 || item >= m_favourites->Size())
return;
m_favourites->Remove(item);
CFavourites::Save(*m_favourites);

CGUIMessage message(GUI_MSG_ITEM_SELECT, GetID(), FAVOURITES_LIST, item < m_favourites->Size() ? item : item - 1);
OnMessage(message);

UpdateList();
}

void CGUIDialogFavourites::OnRename(int item)
{
Expand Down
1 change: 0 additions & 1 deletion xbmc/dialogs/GUIDialogFavourites.h
Expand Up @@ -43,7 +43,6 @@ class CGUIDialogFavourites :
void OnClick(int item);
void OnPopupMenu(int item);
void OnMoveItem(int item, int amount);
void OnDelete(int item);
void OnRename(int item);
void OnSetThumb(int item);
void UpdateList();
Expand Down

0 comments on commit 74ea3e3

Please sign in to comment.