Skip to content

Commit

Permalink
Removed reduntant "virtual".
Browse files Browse the repository at this point in the history
Fixes codefactor warnings
  • Loading branch information
jackburton79 committed Jan 13, 2025
1 parent f82dab9 commit 0913823
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
7 changes: 3 additions & 4 deletions src/helpers/gtab/GTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ class GTab : public BView , public GTabDropZone {
void SetLayoutItem(BLayoutItem* layItem) { fLayoutItem = layItem; }

BString Label() { return fLabel; };
void SetLabel(const char* label) { fLabel.SetTo(label); }
void SetLabel(const char* label) { fLabel.SetTo(label); }

virtual void OnDropMessage(BMessage* message) override;
void OnDropMessage(BMessage* message) override;

protected:
BLayoutItem* fLayoutItem;
Expand Down Expand Up @@ -151,8 +151,7 @@ class GTabCloseButton : public GTab {
};


class Filler : public BView, public GTabDropZone
{
class Filler : public BView, public GTabDropZone {
public:
Filler(TabsContainer* tabsContainer);

Expand Down
29 changes: 18 additions & 11 deletions src/ui/PanelTabManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@


#include "PanelTabManager.h"
#include "GTabView.h"
#include "GTab.h"

#include <cassert>

#include "GTab.h"
#include "GTabView.h"


class GTabID : public GTab {
Expand All @@ -27,12 +28,14 @@ struct tab_info {
GTabID* tab;
BView* view;
};

typedef std::map<tab_id, tab_info> TabIdMap;


class PanelTabView : public GTabView {
public:
PanelTabView(PanelTabManager* manager, const char* name, tab_affinity affinity, orientation orientation):
PanelTabView(PanelTabManager* manager, const char* name, tab_affinity affinity, orientation orientation)
:
GTabView(name, affinity, orientation)
{
}
Expand All @@ -43,38 +46,39 @@ class PanelTabView : public GTabView {
GTabView::AddTab(tab, panel);
}

bool HasTab(tab_id id) {
bool HasTab(tab_id id)
{
return fIdMap.contains(id);
}

void SelectTab(tab_id id) {
void SelectTab(tab_id id)
{
assert(fIdMap.contains(id) == true);
GTabView::SelectTab(fIdMap[id].tab);
}

void SetLabelForTab(tab_id id, const char* label) {
void SetLabelForTab(tab_id id, const char* label)
{
assert(fIdMap.contains(id) == true);
fIdMap[id].tab->SetLabel(label);
fIdMap[id].tab->Invalidate();
}



protected:
virtual void OnTabRemoved(GTab* _tab) override
void OnTabRemoved(GTab* _tab) override
{
GTabID* tab = dynamic_cast<GTabID*>(_tab);
assert(tab != nullptr && fIdMap.contains(tab->GetID()) == true);
fIdMap.erase(tab->GetID());
}
virtual void OnTabAdded(GTab* _tab, BView* panel) override
void OnTabAdded(GTab* _tab, BView* panel) override
{
GTabID* tab = dynamic_cast<GTabID*>(_tab);
assert(tab != nullptr && fIdMap.contains(tab->GetID()) == false);
fIdMap[tab->GetID()] = { tab, panel };
}

GTab* CreateTabView(GTab* clone) override
GTab* CreateTabView(GTab* clone) override
{
GTabID* tab = dynamic_cast<GTabID*>(clone);
return new GTabID(tab->GetID(), tab->Label().String());;
Expand All @@ -84,10 +88,13 @@ class PanelTabView : public GTabView {
TabIdMap fIdMap;
};


// PanelTabManager
PanelTabManager::PanelTabManager()
{
}


BView*
PanelTabManager::CreatePanelTabView(const char* tabview_name, orientation orientation)
{
Expand Down

0 comments on commit 0913823

Please sign in to comment.