mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-10 07:20:23 -04:00
Correct checks for containers' emptiness
This commit is contained in:
parent
fc930bae69
commit
e81841550b
6 changed files with 9 additions and 8 deletions
|
@ -403,10 +403,11 @@ QString CsvParser::getStatus() const
|
|||
|
||||
int CsvParser::getCsvCols() const
|
||||
{
|
||||
if ((m_table.size() > 0) && (m_table.at(0).size() > 0))
|
||||
if (!m_table.isEmpty() && !m_table.at(0).isEmpty()) {
|
||||
return m_table.at(0).size();
|
||||
else
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int CsvParser::getCsvRows() const
|
||||
|
|
|
@ -731,7 +731,7 @@ Entry* KdbxXmlReader::parseEntry(bool history)
|
|||
}
|
||||
if (m_xml.name() == "Binary") {
|
||||
QPair<QString, QString> ref = parseEntryBinary(entry);
|
||||
if (!ref.first.isNull() && !ref.second.isNull()) {
|
||||
if (!ref.first.isEmpty() && !ref.second.isEmpty()) {
|
||||
binaryRefs.append(ref);
|
||||
}
|
||||
continue;
|
||||
|
|
|
@ -174,7 +174,7 @@ QSharedPointer<Database> DatabaseOpenWidget::database()
|
|||
|
||||
void DatabaseOpenWidget::enterKey(const QString& pw, const QString& keyFile)
|
||||
{
|
||||
if (!pw.isNull()) {
|
||||
if (!pw.isEmpty()) {
|
||||
m_ui->editPassword->setText(pw);
|
||||
}
|
||||
if (!keyFile.isEmpty()) {
|
||||
|
|
|
@ -220,7 +220,7 @@ void EntryPreviewWidget::updateEntryAttributesTab()
|
|||
m_ui->entryAttributesEdit->clear();
|
||||
const EntryAttributes* attributes = m_currentEntry->attributes();
|
||||
const QStringList customAttributes = attributes->customKeys();
|
||||
const bool haveAttributes = customAttributes.size() > 0;
|
||||
const bool haveAttributes = !customAttributes.isEmpty();
|
||||
setTabEnabled(m_ui->entryTabWidget, m_ui->entryAttributesTab, haveAttributes);
|
||||
if (haveAttributes) {
|
||||
QString attributesText;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue