const-ify several methods.

This commit is contained in:
Felix Geyer 2014-05-15 22:53:59 +02:00
parent cda5e990ac
commit ce7e01a1b1
4 changed files with 14 additions and 14 deletions

View File

@ -503,7 +503,7 @@ DatabaseWidget* DatabaseTabWidget::currentDatabaseWidget()
}
}
bool DatabaseTabWidget::hasLockableDatabases()
bool DatabaseTabWidget::hasLockableDatabases() const
{
QHashIterator<Database*, DatabaseManagerStruct> i(m_dbList);
while (i.hasNext()) {

View File

@ -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;

View File

@ -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;
}

View File

@ -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: