Skip to content

Commit

Permalink
Reverted part of commits 7dce10c, 683f9df, f3da3f0, 616d61b and 264b434.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Feb 14, 2020
1 parent dc70988 commit 0e2319f
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 581 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Expand Up @@ -646,7 +646,6 @@ set(SOURCES
src/generalpreferenceswidget.cpp
src/main.cpp
src/mainwindow.cpp
src/pluginitemmodel.cpp
src/pluginsdialog.cpp
src/preferencesdialog.cpp
src/splashscreenwindow.cpp
Expand Down
14 changes: 7 additions & 7 deletions src/misc/plugincategoryitem.cpp.inl
@@ -1,31 +1,31 @@
// Return the given category item, after having created it, if it didn't
// already exist

PluginItem *res = mCategoryItems.value(pCategory);
QStandardItem *res = mCategoryItems.value(pCategory);

if (res == nullptr) {
// No category item exists for the given category, so create one and add
// it to our data model (and this in the right place)

bool inserted = false;
PluginItem *rootItem = mModel->invisibleRootItem();
QStandardItem *rootItem = mModel->invisibleRootItem();
QString categoryName = pluginCategoryName(pCategory);
QString nonDiacriticCategoryName = nonDiacriticString(categoryName);

res = new PluginItem(categoryName);
res = new QStandardItem(categoryName);

for (int i = 0, iMax = rootItem->childCount(); i < iMax; ++i) {
if (nonDiacriticCategoryName < nonDiacriticString(rootItem->child(i)->name())) {
for (int i = 0, iMax = rootItem->rowCount(); i < iMax; ++i) {
if (nonDiacriticCategoryName < nonDiacriticString(rootItem->child(i)->text())) {
inserted = true;

mModel->invisibleRootItem()->insert(i, res);
mModel->invisibleRootItem()->insertRow(i, res);

break;
}
}

if (!inserted) {
mModel->invisibleRootItem()->append(res);
mModel->invisibleRootItem()->appendRow(res);
}

// Keep track of the relationship between our new item and its category
Expand Down

0 comments on commit 0e2319f

Please sign in to comment.