mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
const-ify several methods.
This commit is contained in:
parent
cda5e990ac
commit
ce7e01a1b1
@ -503,7 +503,7 @@ DatabaseWidget* DatabaseTabWidget::currentDatabaseWidget()
|
||||
}
|
||||
}
|
||||
|
||||
bool DatabaseTabWidget::hasLockableDatabases()
|
||||
bool DatabaseTabWidget::hasLockableDatabases() const
|
||||
{
|
||||
QHashIterator<Database*, DatabaseManagerStruct> i(m_dbList);
|
||||
while (i.hasNext()) {
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
void openDatabase(const QString& fileName, const QString& pw = QString(),
|
||||
const QString& keyFile = QString());
|
||||
DatabaseWidget* currentDatabaseWidget();
|
||||
bool hasLockableDatabases();
|
||||
bool hasLockableDatabases() const;
|
||||
|
||||
static const int LastDatabasesCount;
|
||||
|
||||
|
@ -786,19 +786,19 @@ void DatabaseWidget::emitEntryContextMenuRequested(const QPoint& pos)
|
||||
Q_EMIT entryContextMenuRequested(m_entryView->viewport()->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
bool DatabaseWidget::dbHasKey()
|
||||
bool DatabaseWidget::dbHasKey() const
|
||||
{
|
||||
return m_db->hasKey();
|
||||
}
|
||||
|
||||
bool DatabaseWidget::canDeleteCurrentGoup()
|
||||
bool DatabaseWidget::canDeleteCurrentGoup() const
|
||||
{
|
||||
bool isRootGroup = m_db->rootGroup() == m_groupView->currentGroup();
|
||||
bool isRecycleBin = m_db->metadata()->recycleBin() == m_groupView->currentGroup();
|
||||
return !isRootGroup && !isRecycleBin;
|
||||
}
|
||||
|
||||
bool DatabaseWidget::isInSearchMode()
|
||||
bool DatabaseWidget::isInSearchMode() const
|
||||
{
|
||||
return m_entryView->inEntryListMode();
|
||||
}
|
||||
@ -825,12 +825,12 @@ void DatabaseWidget::updateFilename(const QString& fileName)
|
||||
m_filename = fileName;
|
||||
}
|
||||
|
||||
int DatabaseWidget::numberOfSelectedEntries()
|
||||
int DatabaseWidget::numberOfSelectedEntries() const
|
||||
{
|
||||
return m_entryView->numberOfSelectedEntries();
|
||||
}
|
||||
|
||||
QStringList DatabaseWidget::customEntryAttributes()
|
||||
QStringList DatabaseWidget::customEntryAttributes() const
|
||||
{
|
||||
Entry* entry = m_entryView->currentEntry();
|
||||
if (!entry) {
|
||||
@ -840,7 +840,7 @@ QStringList DatabaseWidget::customEntryAttributes()
|
||||
return entry->attributes()->customKeys();
|
||||
}
|
||||
|
||||
bool DatabaseWidget::isGroupSelected()
|
||||
bool DatabaseWidget::isGroupSelected() const
|
||||
{
|
||||
return m_groupView->currentGroup() != Q_NULLPTR;
|
||||
}
|
||||
|
@ -62,18 +62,18 @@ public:
|
||||
GroupView* groupView();
|
||||
EntryView* entryView();
|
||||
Database* database();
|
||||
bool dbHasKey();
|
||||
bool canDeleteCurrentGoup();
|
||||
bool isInSearchMode();
|
||||
bool dbHasKey() const;
|
||||
bool canDeleteCurrentGoup() const;
|
||||
bool isInSearchMode() const;
|
||||
int addWidget(QWidget* w);
|
||||
void setCurrentIndex(int index);
|
||||
void setCurrentWidget(QWidget* widget);
|
||||
DatabaseWidget::Mode currentMode() const;
|
||||
void lock();
|
||||
void updateFilename(const QString& filename);
|
||||
int numberOfSelectedEntries();
|
||||
QStringList customEntryAttributes();
|
||||
bool isGroupSelected();
|
||||
int numberOfSelectedEntries() const;
|
||||
QStringList customEntryAttributes() const;
|
||||
bool isGroupSelected()const ;
|
||||
bool isInEditMode() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
|
Loading…
Reference in New Issue
Block a user