-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General: don't ask to confirm the overwriting of a file when on macOS…
… 10.15 (closes #2261).
- Loading branch information
Showing
6 changed files
with
45 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Return the given category item, after having created it, if it didn't | ||
// already exist | ||
|
||
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; | ||
QStandardItem *rootItem = mModel->invisibleRootItem(); | ||
QString categoryName = pluginCategoryName(pCategory); | ||
QString nonDiacriticCategoryName = nonDiacriticString(categoryName); | ||
|
||
res = new QStandardItem(categoryName); | ||
|
||
for (int i = 0, iMax = rootItem->rowCount(); i < iMax; ++i) { | ||
if (nonDiacriticCategoryName < nonDiacriticString(rootItem->child(i)->text())) { | ||
inserted = true; | ||
|
||
mModel->invisibleRootItem()->insertRow(i, res); | ||
|
||
break; | ||
} | ||
} | ||
|
||
if (!inserted) { | ||
mModel->invisibleRootItem()->appendRow(res); | ||
} | ||
|
||
// Keep track of the relationship between our new item and its category | ||
|
||
mCategoryItems.insert(pCategory, res); | ||
mItemCategories.insert(res, pCategory); | ||
} | ||
|
||
return res; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters