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