mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-02 03:26:14 -04:00
Correct plurals and logic gate
This commit is contained in:
parent
2e292699b7
commit
76102ee9f0
1 changed files with 8 additions and 9 deletions
|
@ -335,12 +335,11 @@ void EditWidgetIcons::addCustomIconFromFile()
|
||||||
for (const auto& filename : filenames) {
|
for (const auto& filename : filenames) {
|
||||||
if (!filename.isEmpty()) {
|
if (!filename.isEmpty()) {
|
||||||
auto icon = QImage(filename);
|
auto icon = QImage(filename);
|
||||||
if (!icon.isNull()) {
|
if (icon.isNull()) {
|
||||||
if (!addCustomIcon(QImage(filename))) {
|
|
||||||
++numexisting;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
errornames << filename;
|
errornames << filename;
|
||||||
|
} else if (!addCustomIcon(icon)) {
|
||||||
|
// Icon already exists in database
|
||||||
|
++numexisting;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -349,20 +348,20 @@ void EditWidgetIcons::addCustomIconFromFile()
|
||||||
QString msg;
|
QString msg;
|
||||||
|
|
||||||
if (numloaded > 0) {
|
if (numloaded > 0) {
|
||||||
msg = tr("Successfully loaded %1 of %2 icons").arg(numloaded).arg(filenames.size());
|
msg = tr("Successfully loaded %1 of %n icon(s)", "", filenames.size()).arg(numloaded);
|
||||||
} else {
|
} else {
|
||||||
msg = tr("No icons were loaded");
|
msg = tr("No icons were loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numexisting > 0) {
|
if (numexisting > 0) {
|
||||||
msg += ", " + tr("%1 icons already existed").arg(numexisting);
|
msg += "\n" + tr("%n icon(s) already exist in the database", "", numexisting);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!errornames.empty()) {
|
if (!errornames.empty()) {
|
||||||
// Show the first 8 icons that failed to load
|
// Show the first 8 icons that failed to load
|
||||||
errornames = errornames.mid(0, 8);
|
errornames = errornames.mid(0, 8);
|
||||||
emit messageEditEntry(msg + "\n" + tr("The following icons failed:") + "\n" + errornames.join("\n"),
|
emit messageEditEntry(msg + "\n" + tr("The following icon(s) failed:", "", errornames.size()) +
|
||||||
MessageWidget::Error);
|
"\n" + errornames.join("\n"), MessageWidget::Error);
|
||||||
} else if (numloaded > 0) {
|
} else if (numloaded > 0) {
|
||||||
emit messageEditEntry(msg, MessageWidget::Positive);
|
emit messageEditEntry(msg, MessageWidget::Positive);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue