Skip to content

Commit

Permalink
Fix rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Silarn committed Sep 21, 2023
1 parent 133c072 commit d2e48ed
Show file tree
Hide file tree
Showing 17 changed files with 157 additions and 1,382 deletions.
8 changes: 1 addition & 7 deletions src/categories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,9 @@ QString CategoryFactory::categoriesFilePath()
return qApp->property("dataPath").toString() + "/categories.dat";
}


QString CategoryFactory::nexusMappingFilePath()
{
return qApp->property("dataPath").toString() + "/nexuscatmap.dat";
}


CategoryFactory::CategoryFactory() : QObject()
{
atexit(&cleanup);
}

QString CategoryFactory::nexusMappingFilePath()
Expand Down
1 change: 0 additions & 1 deletion src/categoriesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ void CategoriesDialog::fillTable()
QTableWidget* table = ui->categoriesTable;
QListWidget* list = ui->nexusCategoryList;

#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
table->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
table->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
table->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Fixed);
Expand Down
1 change: 0 additions & 1 deletion src/directoryrefresher.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class DirectoryRefresher : public QObject
int priority;
};


DirectoryRefresher(std::size_t threadCount);

/**
Expand Down
25 changes: 12 additions & 13 deletions src/filterlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ class CriteriaItemFilter : public QObject
}
};


FilterList::FilterList(Ui::MainWindow* ui, OrganizerCore* organizer, PluginContainer* pluginContainer, CategoryFactory* factory)
: ui(ui), m_Organizer(organizer), m_pluginContainer(pluginContainer), m_factory(factory)
FilterList::FilterList(Ui::MainWindow* ui, OrganizerCore& core,
CategoryFactory& factory)
: ui(ui), m_core(core), m_factory(factory)
{
auto* eventFilter = new CriteriaItemFilter(ui->filters, [&](auto* item, int dir) {
return cycleItem(item, dir);
Expand Down Expand Up @@ -275,15 +275,15 @@ void FilterList::addContentCriteria()
void FilterList::addCategoryCriteria(QTreeWidgetItem* root,
const std::set<int>& categoriesUsed, int targetID)
{
const auto count = static_cast<unsigned int>(m_factory->numCategories());
const auto count = static_cast<unsigned int>(m_factory.numCategories());
for (unsigned int i = 1; i < count; ++i) {
if (m_factory->getParentID(i) == targetID) {
int categoryID = m_factory->getCategoryID(i);
if (m_factory.getParentID(i) == targetID) {
int categoryID = m_factory.getCategoryID(i);
if (categoriesUsed.find(categoryID) != categoriesUsed.end()) {
QTreeWidgetItem* item =
addCriteriaItem(root, m_factory->getCategoryName(i),
categoryID, ModListSortProxy::TypeCategory);
if (m_factory->hasChildren(i)) {
addCriteriaItem(root, m_factory.getCategoryName(i), categoryID,
ModListSortProxy::TypeCategory);
if (m_factory.hasChildren(i)) {
addCategoryCriteria(item, categoriesUsed, categoryID);
}
}
Expand All @@ -295,9 +295,8 @@ void FilterList::addSpecialCriteria(int type)
{
const auto sc = static_cast<CategoryFactory::SpecialCategories>(type);

addCriteriaItem(
nullptr, m_factory->getSpecialCategoryName(sc),
type, ModListSortProxy::TypeSpecial);
addCriteriaItem(nullptr, m_factory.getSpecialCategoryName(sc), type,
ModListSortProxy::TypeSpecial);
}

void FilterList::refresh()
Expand Down Expand Up @@ -334,7 +333,7 @@ void FilterList::refresh()
log::warn("cycle in categories: {}", SetJoin(cycleTest, ", "));
break;
}
currentID = m_factory->getParentID(m_factory->getCategoryIndex(currentID));
currentID = m_factory.getParentID(m_factory.getCategoryIndex(currentID));
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/filterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FilterList : public QObject
Q_OBJECT;

public:
FilterList(Ui::MainWindow* ui, OrganizerCore* organizer, PluginContainer* pluginContainer, CategoryFactory* factory);
FilterList(Ui::MainWindow* ui, OrganizerCore& organizer, CategoryFactory& factory);

void restoreState(const Settings& s);
void saveState(Settings& s) const;
Expand All @@ -36,9 +36,8 @@ class FilterList : public QObject
class CriteriaItem;

Ui::MainWindow* ui;
OrganizerCore* m_Organizer;
CategoryFactory* m_factory;
PluginContainer* m_pluginContainer;
OrganizerCore& m_core;
CategoryFactory& m_factory;

bool onClick(QMouseEvent* e);
void onItemActivated(QTreeWidgetItem* item);
Expand Down
Loading

0 comments on commit d2e48ed

Please sign in to comment.