mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-27 14:57:09 -05:00
Merge branch 'develop' into feature/yubikey
This commit is contained in:
commit
15dd783d2c
@ -68,7 +68,7 @@ endmacro(add_gcc_compiler_flags)
|
|||||||
|
|
||||||
add_definitions(-DQT_NO_EXCEPTIONS -DQT_STRICT_ITERATORS -DQT_NO_CAST_TO_ASCII)
|
add_definitions(-DQT_NO_EXCEPTIONS -DQT_STRICT_ITERATORS -DQT_NO_CAST_TO_ASCII)
|
||||||
|
|
||||||
add_gcc_compiler_flags("-fno-common -fstack-protector --param=ssp-buffer-size=4")
|
add_gcc_compiler_flags("-fno-common -fstack-protector-strong --param=ssp-buffer-size=4")
|
||||||
add_gcc_compiler_flags("-Wall -Wextra -Wundef -Wpointer-arith -Wno-long-long")
|
add_gcc_compiler_flags("-Wall -Wextra -Wundef -Wpointer-arith -Wno-long-long")
|
||||||
add_gcc_compiler_flags("-Wformat=2 -Wmissing-format-attribute")
|
add_gcc_compiler_flags("-Wformat=2 -Wmissing-format-attribute")
|
||||||
add_gcc_compiler_flags("-fvisibility=hidden")
|
add_gcc_compiler_flags("-fvisibility=hidden")
|
||||||
@ -79,7 +79,7 @@ add_gcc_compiler_cxxflags("-Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virt
|
|||||||
add_gcc_compiler_cflags("-Wchar-subscripts -Wwrite-strings")
|
add_gcc_compiler_cflags("-Wchar-subscripts -Wwrite-strings")
|
||||||
|
|
||||||
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
|
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
|
||||||
if (CMAKE_BUILD_TYPE_LOWER MATCHES (release|relwithdebinfo|minsizerel))
|
if (CMAKE_BUILD_TYPE_LOWER MATCHES "(release|relwithdebinfo|minsizerel)")
|
||||||
add_gcc_compiler_flags("-D_FORTIFY_SOURCE=2")
|
add_gcc_compiler_flags("-D_FORTIFY_SOURCE=2")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -105,10 +105,14 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
if (CMAKE_COMPILER_IS_CLANGXX)
|
||||||
|
add_gcc_compiler_flags("-Qunused-arguments")
|
||||||
|
endif()
|
||||||
|
add_gcc_compiler_flags("-pie -fPIE")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-add-needed -Wl,--as-needed -Wl,--no-undefined")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-add-needed -Wl,--as-needed -Wl,--no-undefined")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro,-z,now")
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-add-needed -Wl,--as-needed")
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-add-needed -Wl,--as-needed")
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro")
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro,-z,now")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_gcc_compiler_cxxflags("-std=c++11")
|
add_gcc_compiler_cxxflags("-std=c++11")
|
||||||
@ -127,6 +131,9 @@ if(MINGW)
|
|||||||
set(CMAKE_RC_COMPILER_INIT windres)
|
set(CMAKE_RC_COMPILER_INIT windres)
|
||||||
enable_language(RC)
|
enable_language(RC)
|
||||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
|
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
|
||||||
|
# Enable DEP and ASLR
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
|
||||||
link_libraries(ws2_32 wsock32)
|
link_libraries(ws2_32 wsock32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# KeePassXC - KeePass Cross-platform Community Edition
|
# KeePassXC - KeePass Cross-platform Community Edition
|
||||||
|
|
||||||
[![Travis Build Status](https://travis-ci.org/keepassxreboot/keepassxc.svg?branch=develop)](https://travis-ci.org/keepassxreboot/keepassxc) [![Coverage Status](https://coveralls.io/repos/github/keepassxreboot/keepassxc/badge.svg)](https://coveralls.io/github/keepassxreboot/keepassxc)
|
[![Travis Build Status](https://travis-ci.org/keepassxreboot/keepassxc.svg?branch=develop)](https://travis-ci.org/keepassxreboot/keepassxc) [![Coverage Status](https://coveralls.io/repos/github/keepassxreboot/keepassxc/badge.svg)](https://coveralls.io/github/keepassxreboot/keepassxc)
|
||||||
|
<a href='https://pledgie.com/campaigns/33487'><img alt='KeePassXC Authenticode Certificate Campaign!' align=right src='https://pledgie.com/campaigns/33487.png?skin_name=chrome' border='0'></a>
|
||||||
|
|
||||||
## About
|
## About
|
||||||
KeePassXC is a community fork of [KeePassX](https://www.keepassx.org/) with the goal to extend and improve it with new features and bugfixes to provide a feature-rich, fully cross-platform and modern open-source password manager.
|
KeePassXC is a community fork of [KeePassX](https://www.keepassx.org/) with the goal to extend and improve it with new features and bugfixes to provide a feature-rich, fully cross-platform and modern open-source password manager.
|
||||||
|
@ -48,13 +48,13 @@ public:
|
|||||||
static AutoType* instance();
|
static AutoType* instance();
|
||||||
static void createTestInstance();
|
static void createTestInstance();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void performGlobalAutoType(const QList<Database*>& dbList);
|
void performGlobalAutoType(const QList<Database*>& dbList);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void globalShortcutTriggered();
|
void globalShortcutTriggered();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void performAutoTypeFromGlobal(Entry* entry, const QString& sequence);
|
void performAutoTypeFromGlobal(Entry* entry, const QString& sequence);
|
||||||
void resetInAutoType();
|
void resetInAutoType();
|
||||||
void unloadPlugin();
|
void unloadPlugin();
|
||||||
|
@ -91,7 +91,7 @@ void AutoTypeSelectDialog::emitEntryActivated(const QModelIndex& index)
|
|||||||
|
|
||||||
Entry* entry = m_view->entryFromIndex(index);
|
Entry* entry = m_view->entryFromIndex(index);
|
||||||
accept();
|
accept();
|
||||||
Q_EMIT entryActivated(entry, m_sequences[entry]);
|
emit entryActivated(entry, m_sequences[entry]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTypeSelectDialog::entryRemoved()
|
void AutoTypeSelectDialog::entryRemoved()
|
||||||
|
@ -33,13 +33,13 @@ public:
|
|||||||
explicit AutoTypeSelectDialog(QWidget* parent = nullptr);
|
explicit AutoTypeSelectDialog(QWidget* parent = nullptr);
|
||||||
void setEntries(const QList<Entry*>& entries, const QHash<Entry*, QString>& sequences);
|
void setEntries(const QList<Entry*>& entries, const QHash<Entry*, QString>& sequences);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void entryActivated(Entry* entry, const QString& sequence);
|
void entryActivated(Entry* entry, const QString& sequence);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void done(int r) override;
|
void done(int r) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void emitEntryActivated(const QModelIndex& index);
|
void emitEntryActivated(const QModelIndex& index);
|
||||||
void entryRemoved();
|
void entryRemoved();
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void mouseMoveEvent(QMouseEvent* event) override;
|
void mouseMoveEvent(QMouseEvent* event) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void selectFirstEntry();
|
void selectFirstEntry();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -460,7 +460,7 @@ OSStatus AutoTypePlatformMac::hotkeyHandler(EventHandlerCallRef nextHandler, Eve
|
|||||||
|
|
||||||
if (::GetEventParameter(theEvent, kEventParamDirectObject, typeEventHotKeyID, nullptr, sizeof(hotkeyId), nullptr, &hotkeyId) == noErr
|
if (::GetEventParameter(theEvent, kEventParamDirectObject, typeEventHotKeyID, nullptr, sizeof(hotkeyId), nullptr, &hotkeyId) == noErr
|
||||||
&& hotkeyId.id == HOTKEY_ID) {
|
&& hotkeyId.id == HOTKEY_ID) {
|
||||||
Q_EMIT self->globalShortcutTriggered();
|
emit self->globalShortcutTriggered();
|
||||||
}
|
}
|
||||||
|
|
||||||
return noErr;
|
return noErr;
|
||||||
|
@ -51,7 +51,7 @@ public:
|
|||||||
void sendChar(const QChar& ch, bool isKeyDown);
|
void sendChar(const QChar& ch, bool isKeyDown);
|
||||||
void sendKey(Qt::Key key, bool isKeyDown);
|
void sendKey(Qt::Key key, bool isKeyDown);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void globalShortcutTriggered();
|
void globalShortcutTriggered();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -60,7 +60,7 @@ public:
|
|||||||
void addActionChar(AutoTypeChar* action);
|
void addActionChar(AutoTypeChar* action);
|
||||||
void addActionKey(AutoTypeKey* action);
|
void addActionKey(AutoTypeKey* action);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void globalShortcutTriggered();
|
void globalShortcutTriggered();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -96,7 +96,7 @@ int AutoTypePlatformWin::platformEventFilter(void* event)
|
|||||||
MSG *msg = static_cast<MSG *>(event);
|
MSG *msg = static_cast<MSG *>(event);
|
||||||
|
|
||||||
if (msg->message == WM_HOTKEY && msg->wParam == HOTKEY_ID) {
|
if (msg->message == WM_HOTKEY && msg->wParam == HOTKEY_ID) {
|
||||||
Q_EMIT globalShortcutTriggered();
|
emit globalShortcutTriggered();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
void sendChar(const QChar& ch, bool isKeyDown);
|
void sendChar(const QChar& ch, bool isKeyDown);
|
||||||
void sendKey(Qt::Key key, bool isKeyDown);
|
void sendKey(Qt::Key key, bool isKeyDown);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void globalShortcutTriggered();
|
void globalShortcutTriggered();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -214,7 +214,7 @@ int AutoTypePlatformX11::platformEventFilter(void* event)
|
|||||||
&& (!QApplication::activeWindow() || QApplication::activeWindow()->isMinimized())
|
&& (!QApplication::activeWindow() || QApplication::activeWindow()->isMinimized())
|
||||||
&& m_loaded) {
|
&& m_loaded) {
|
||||||
if (type == XCB_KEY_PRESS) {
|
if (type == XCB_KEY_PRESS) {
|
||||||
Q_EMIT globalShortcutTriggered();
|
emit globalShortcutTriggered();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
|
|
||||||
void SendKeyPressedEvent(KeySym keysym);
|
void SendKeyPressedEvent(KeySym keysym);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void globalShortcutTriggered();
|
void globalShortcutTriggered();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -39,29 +39,29 @@ void AutoTypeAssociations::copyDataFrom(const AutoTypeAssociations* other)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT aboutToReset();
|
emit aboutToReset();
|
||||||
m_associations = other->m_associations;
|
m_associations = other->m_associations;
|
||||||
Q_EMIT reset();
|
emit reset();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTypeAssociations::add(const AutoTypeAssociations::Association& association)
|
void AutoTypeAssociations::add(const AutoTypeAssociations::Association& association)
|
||||||
{
|
{
|
||||||
int index = m_associations.size();
|
int index = m_associations.size();
|
||||||
Q_EMIT aboutToAdd(index);
|
emit aboutToAdd(index);
|
||||||
m_associations.append(association);
|
m_associations.append(association);
|
||||||
Q_EMIT added(index);
|
emit added(index);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTypeAssociations::remove(int index)
|
void AutoTypeAssociations::remove(int index)
|
||||||
{
|
{
|
||||||
Q_ASSERT(index >= 0 && index < m_associations.size());
|
Q_ASSERT(index >= 0 && index < m_associations.size());
|
||||||
|
|
||||||
Q_EMIT aboutToRemove(index);
|
emit aboutToRemove(index);
|
||||||
m_associations.removeAt(index);
|
m_associations.removeAt(index);
|
||||||
Q_EMIT removed(index);
|
emit removed(index);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTypeAssociations::removeEmpty()
|
void AutoTypeAssociations::removeEmpty()
|
||||||
@ -81,8 +81,8 @@ void AutoTypeAssociations::update(int index, const AutoTypeAssociations::Associa
|
|||||||
|
|
||||||
if (m_associations.at(index) != association) {
|
if (m_associations.at(index) != association) {
|
||||||
m_associations[index] = association;
|
m_associations[index] = association;
|
||||||
Q_EMIT dataChanged(index);
|
emit dataChanged(index);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QList<AutoTypeAssociations::Association> m_associations;
|
QList<AutoTypeAssociations::Association> m_associations;
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void modified();
|
void modified();
|
||||||
void dataChanged(int index);
|
void dataChanged(int index);
|
||||||
void aboutToAdd(int index);
|
void aboutToAdd(int index);
|
||||||
|
@ -238,7 +238,7 @@ bool Database::setKey(const CompositeKey& key, const QByteArray& transformSeed,
|
|||||||
if (updateChangedTime) {
|
if (updateChangedTime) {
|
||||||
m_metadata->setMasterKeyChanged(QDateTime::currentDateTimeUtc());
|
m_metadata->setMasterKeyChanged(QDateTime::currentDateTimeUtc());
|
||||||
}
|
}
|
||||||
Q_EMIT modifiedImmediate();
|
emit modifiedImmediate();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -310,7 +310,7 @@ void Database::recycleGroup(Group* group)
|
|||||||
void Database::merge(const Database* other)
|
void Database::merge(const Database* other)
|
||||||
{
|
{
|
||||||
m_rootGroup->merge(other->rootGroup());
|
m_rootGroup->merge(other->rootGroup());
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::setEmitModified(bool value)
|
void Database::setEmitModified(bool value)
|
||||||
|
@ -119,7 +119,7 @@ public:
|
|||||||
|
|
||||||
static Database* databaseByUuid(const Uuid& uuid);
|
static Database* databaseByUuid(const Uuid& uuid);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void groupDataChanged(Group* group);
|
void groupDataChanged(Group* group);
|
||||||
void groupAboutToAdd(Group* group, int index);
|
void groupAboutToAdd(Group* group, int index);
|
||||||
void groupAdded();
|
void groupAdded();
|
||||||
@ -131,7 +131,7 @@ Q_SIGNALS:
|
|||||||
void modified();
|
void modified();
|
||||||
void modifiedImmediate();
|
void modifiedImmediate();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void startModifiedTimer();
|
void startModifiedTimer();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -62,7 +62,7 @@ template <class T> inline bool Entry::set(T& property, const T& value)
|
|||||||
{
|
{
|
||||||
if (property != value) {
|
if (property != value) {
|
||||||
property = value;
|
property = value;
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -254,6 +254,17 @@ bool Entry::isExpired() const
|
|||||||
return m_data.timeInfo.expires() && m_data.timeInfo.expiryTime() < QDateTime::currentDateTimeUtc();
|
return m_data.timeInfo.expires() && m_data.timeInfo.expiryTime() < QDateTime::currentDateTimeUtc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Entry::hasReferences() const
|
||||||
|
{
|
||||||
|
const QList<QString> keyList = EntryAttributes::DefaultAttributes;
|
||||||
|
for (const QString& key : keyList) {
|
||||||
|
if (m_attributes->isReference(key)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
EntryAttributes* Entry::attributes()
|
EntryAttributes* Entry::attributes()
|
||||||
{
|
{
|
||||||
return m_attributes;
|
return m_attributes;
|
||||||
@ -288,7 +299,7 @@ void Entry::setIcon(int iconNumber)
|
|||||||
m_data.iconNumber = iconNumber;
|
m_data.iconNumber = iconNumber;
|
||||||
m_data.customIcon = Uuid();
|
m_data.customIcon = Uuid();
|
||||||
|
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
emitDataChanged();
|
emitDataChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -301,7 +312,7 @@ void Entry::setIcon(const Uuid& uuid)
|
|||||||
m_data.customIcon = uuid;
|
m_data.customIcon = uuid;
|
||||||
m_data.iconNumber = 0;
|
m_data.iconNumber = 0;
|
||||||
|
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
emitDataChanged();
|
emitDataChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -381,7 +392,7 @@ void Entry::setExpires(const bool& value)
|
|||||||
{
|
{
|
||||||
if (m_data.timeInfo.expires() != value) {
|
if (m_data.timeInfo.expires() != value) {
|
||||||
m_data.timeInfo.setExpires(value);
|
m_data.timeInfo.setExpires(value);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,7 +400,7 @@ void Entry::setExpiryTime(const QDateTime& dateTime)
|
|||||||
{
|
{
|
||||||
if (m_data.timeInfo.expiryTime() != dateTime) {
|
if (m_data.timeInfo.expiryTime() != dateTime) {
|
||||||
m_data.timeInfo.setExpiryTime(dateTime);
|
m_data.timeInfo.setExpiryTime(dateTime);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,7 +419,7 @@ void Entry::addHistoryItem(Entry* entry)
|
|||||||
Q_ASSERT(!entry->parent());
|
Q_ASSERT(!entry->parent());
|
||||||
|
|
||||||
m_history.append(entry);
|
m_history.append(entry);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entry::removeHistoryItems(const QList<Entry*>& historyEntries)
|
void Entry::removeHistoryItems(const QList<Entry*>& historyEntries)
|
||||||
@ -426,7 +437,7 @@ void Entry::removeHistoryItems(const QList<Entry*>& historyEntries)
|
|||||||
delete entry;
|
delete entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entry::truncateHistory()
|
void Entry::truncateHistory()
|
||||||
@ -622,7 +633,7 @@ void Entry::setGroup(Group* group)
|
|||||||
|
|
||||||
void Entry::emitDataChanged()
|
void Entry::emitDataChanged()
|
||||||
{
|
{
|
||||||
Q_EMIT dataChanged(this);
|
emit dataChanged(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Database* Entry::database() const
|
const Database* Entry::database() const
|
||||||
@ -679,20 +690,20 @@ QString Entry::resolvePlaceholder(const QString& str) const
|
|||||||
// using format from http://keepass.info/help/base/fieldrefs.html at the time of writing,
|
// using format from http://keepass.info/help/base/fieldrefs.html at the time of writing,
|
||||||
// but supporting lookups of standard fields and references by UUID only
|
// but supporting lookups of standard fields and references by UUID only
|
||||||
|
|
||||||
QRegExp tmpRegExp("\\{REF:([TUPAN])@I:([^}]+)\\}", Qt::CaseInsensitive, QRegExp::RegExp2);
|
QRegExp* tmpRegExp = m_attributes->referenceRegExp();
|
||||||
if (tmpRegExp.indexIn(result) != -1) {
|
if (tmpRegExp->indexIn(result) != -1) {
|
||||||
// cap(0) contains the whole reference
|
// cap(0) contains the whole reference
|
||||||
// cap(1) contains which field is wanted
|
// cap(1) contains which field is wanted
|
||||||
// cap(2) contains the uuid of the referenced entry
|
// cap(2) contains the uuid of the referenced entry
|
||||||
Entry* tmpRefEntry = m_group->database()->resolveEntry(Uuid(QByteArray::fromHex(tmpRegExp.cap(2).toLatin1())));
|
Entry* tmpRefEntry = m_group->database()->resolveEntry(Uuid(QByteArray::fromHex(tmpRegExp->cap(2).toLatin1())));
|
||||||
if (tmpRefEntry) {
|
if (tmpRefEntry) {
|
||||||
// entry found, get the relevant field
|
// entry found, get the relevant field
|
||||||
QString tmpRefField = tmpRegExp.cap(1).toLower();
|
QString tmpRefField = tmpRegExp->cap(1).toLower();
|
||||||
if (tmpRefField == "t") result.replace(tmpRegExp.cap(0), tmpRefEntry->title(), Qt::CaseInsensitive);
|
if (tmpRefField == "t") result.replace(tmpRegExp->cap(0), tmpRefEntry->title(), Qt::CaseInsensitive);
|
||||||
else if (tmpRefField == "u") result.replace(tmpRegExp.cap(0), tmpRefEntry->username(), Qt::CaseInsensitive);
|
else if (tmpRefField == "u") result.replace(tmpRegExp->cap(0), tmpRefEntry->username(), Qt::CaseInsensitive);
|
||||||
else if (tmpRefField == "p") result.replace(tmpRegExp.cap(0), tmpRefEntry->password(), Qt::CaseInsensitive);
|
else if (tmpRefField == "p") result.replace(tmpRegExp->cap(0), tmpRefEntry->password(), Qt::CaseInsensitive);
|
||||||
else if (tmpRefField == "a") result.replace(tmpRegExp.cap(0), tmpRefEntry->url(), Qt::CaseInsensitive);
|
else if (tmpRefField == "a") result.replace(tmpRegExp->cap(0), tmpRefEntry->url(), Qt::CaseInsensitive);
|
||||||
else if (tmpRefField == "n") result.replace(tmpRegExp.cap(0), tmpRefEntry->notes(), Qt::CaseInsensitive);
|
else if (tmpRefField == "n") result.replace(tmpRegExp->cap(0), tmpRefEntry->notes(), Qt::CaseInsensitive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,6 +79,7 @@ public:
|
|||||||
QString password() const;
|
QString password() const;
|
||||||
QString notes() const;
|
QString notes() const;
|
||||||
bool isExpired() const;
|
bool isExpired() const;
|
||||||
|
bool hasReferences() const;
|
||||||
EntryAttributes* attributes();
|
EntryAttributes* attributes();
|
||||||
const EntryAttributes* attributes() const;
|
const EntryAttributes* attributes() const;
|
||||||
EntryAttachments* attachments();
|
EntryAttachments* attachments();
|
||||||
@ -146,7 +147,7 @@ public:
|
|||||||
|
|
||||||
void setUpdateTimeinfo(bool value);
|
void setUpdateTimeinfo(bool value);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
/**
|
/**
|
||||||
* Emitted when a default attribute has been changed.
|
* Emitted when a default attribute has been changed.
|
||||||
*/
|
*/
|
||||||
@ -154,7 +155,7 @@ Q_SIGNALS:
|
|||||||
|
|
||||||
void modified();
|
void modified();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void emitDataChanged();
|
void emitDataChanged();
|
||||||
void updateTimeinfo();
|
void updateTimeinfo();
|
||||||
void updateModifiedSinceBegin();
|
void updateModifiedSinceBegin();
|
||||||
|
@ -48,7 +48,7 @@ void EntryAttachments::set(const QString& key, const QByteArray& value)
|
|||||||
bool addAttachment = !m_attachments.contains(key);
|
bool addAttachment = !m_attachments.contains(key);
|
||||||
|
|
||||||
if (addAttachment) {
|
if (addAttachment) {
|
||||||
Q_EMIT aboutToBeAdded(key);
|
emit aboutToBeAdded(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addAttachment || m_attachments.value(key) != value) {
|
if (addAttachment || m_attachments.value(key) != value) {
|
||||||
@ -57,14 +57,14 @@ void EntryAttachments::set(const QString& key, const QByteArray& value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (addAttachment) {
|
if (addAttachment) {
|
||||||
Q_EMIT added(key);
|
emit added(key);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Q_EMIT keyModified(key);
|
emit keyModified(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (emitModified) {
|
if (emitModified) {
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,12 +75,12 @@ void EntryAttachments::remove(const QString& key)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT aboutToBeRemoved(key);
|
emit aboutToBeRemoved(key);
|
||||||
|
|
||||||
m_attachments.remove(key);
|
m_attachments.remove(key);
|
||||||
|
|
||||||
Q_EMIT removed(key);
|
emit removed(key);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntryAttachments::clear()
|
void EntryAttachments::clear()
|
||||||
@ -89,23 +89,23 @@ void EntryAttachments::clear()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT aboutToBeReset();
|
emit aboutToBeReset();
|
||||||
|
|
||||||
m_attachments.clear();
|
m_attachments.clear();
|
||||||
|
|
||||||
Q_EMIT reset();
|
emit reset();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntryAttachments::copyDataFrom(const EntryAttachments* other)
|
void EntryAttachments::copyDataFrom(const EntryAttachments* other)
|
||||||
{
|
{
|
||||||
if (*this != *other) {
|
if (*this != *other) {
|
||||||
Q_EMIT aboutToBeReset();
|
emit aboutToBeReset();
|
||||||
|
|
||||||
m_attachments = other->m_attachments;
|
m_attachments = other->m_attachments;
|
||||||
|
|
||||||
Q_EMIT reset();
|
emit reset();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
bool operator==(const EntryAttachments& other) const;
|
bool operator==(const EntryAttachments& other) const;
|
||||||
bool operator!=(const EntryAttachments& other) const;
|
bool operator!=(const EntryAttachments& other) const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void modified();
|
void modified();
|
||||||
void keyModified(const QString& key);
|
void keyModified(const QString& key);
|
||||||
void aboutToBeAdded(const QString& key);
|
void aboutToBeAdded(const QString& key);
|
||||||
|
@ -28,6 +28,7 @@ const QString EntryAttributes::RememberCmdExecAttr = "_EXEC_CMD";
|
|||||||
|
|
||||||
EntryAttributes::EntryAttributes(QObject* parent)
|
EntryAttributes::EntryAttributes(QObject* parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
, m_referenceRegExp("\\{REF:([TUPAN])@I:([^}]+)\\}", Qt::CaseInsensitive, QRegExp::RegExp2)
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
@ -69,6 +70,25 @@ bool EntryAttributes::isProtected(const QString& key) const
|
|||||||
return m_protectedAttributes.contains(key);
|
return m_protectedAttributes.contains(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EntryAttributes::isReference(const QString& key) const
|
||||||
|
{
|
||||||
|
if (!m_attributes.contains(key)) {
|
||||||
|
Q_ASSERT(false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString data = value(key);
|
||||||
|
if (m_referenceRegExp.indexIn(data) != -1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QRegExp* EntryAttributes::referenceRegExp()
|
||||||
|
{
|
||||||
|
return &m_referenceRegExp;
|
||||||
|
}
|
||||||
|
|
||||||
void EntryAttributes::set(const QString& key, const QString& value, bool protect)
|
void EntryAttributes::set(const QString& key, const QString& value, bool protect)
|
||||||
{
|
{
|
||||||
bool emitModified = false;
|
bool emitModified = false;
|
||||||
@ -78,7 +98,7 @@ void EntryAttributes::set(const QString& key, const QString& value, bool protect
|
|||||||
bool defaultAttribute = isDefaultAttribute(key);
|
bool defaultAttribute = isDefaultAttribute(key);
|
||||||
|
|
||||||
if (addAttribute && !defaultAttribute) {
|
if (addAttribute && !defaultAttribute) {
|
||||||
Q_EMIT aboutToBeAdded(key);
|
emit aboutToBeAdded(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addAttribute || changeValue) {
|
if (addAttribute || changeValue) {
|
||||||
@ -97,17 +117,17 @@ void EntryAttributes::set(const QString& key, const QString& value, bool protect
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (emitModified) {
|
if (emitModified) {
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defaultAttribute && changeValue) {
|
if (defaultAttribute && changeValue) {
|
||||||
Q_EMIT defaultKeyModified();
|
emit defaultKeyModified();
|
||||||
}
|
}
|
||||||
else if (addAttribute) {
|
else if (addAttribute) {
|
||||||
Q_EMIT added(key);
|
emit added(key);
|
||||||
}
|
}
|
||||||
else if (emitModified) {
|
else if (emitModified) {
|
||||||
Q_EMIT customKeyModified(key);
|
emit customKeyModified(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,13 +140,13 @@ void EntryAttributes::remove(const QString& key)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT aboutToBeRemoved(key);
|
emit aboutToBeRemoved(key);
|
||||||
|
|
||||||
m_attributes.remove(key);
|
m_attributes.remove(key);
|
||||||
m_protectedAttributes.remove(key);
|
m_protectedAttributes.remove(key);
|
||||||
|
|
||||||
Q_EMIT removed(key);
|
emit removed(key);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntryAttributes::rename(const QString& oldKey, const QString& newKey)
|
void EntryAttributes::rename(const QString& oldKey, const QString& newKey)
|
||||||
@ -147,7 +167,7 @@ void EntryAttributes::rename(const QString& oldKey, const QString& newKey)
|
|||||||
QString data = value(oldKey);
|
QString data = value(oldKey);
|
||||||
bool protect = isProtected(oldKey);
|
bool protect = isProtected(oldKey);
|
||||||
|
|
||||||
Q_EMIT aboutToRename(oldKey, newKey);
|
emit aboutToRename(oldKey, newKey);
|
||||||
|
|
||||||
m_attributes.remove(oldKey);
|
m_attributes.remove(oldKey);
|
||||||
m_attributes.insert(newKey, data);
|
m_attributes.insert(newKey, data);
|
||||||
@ -156,8 +176,8 @@ void EntryAttributes::rename(const QString& oldKey, const QString& newKey)
|
|||||||
m_protectedAttributes.insert(newKey);
|
m_protectedAttributes.insert(newKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
Q_EMIT renamed(oldKey, newKey);
|
emit renamed(oldKey, newKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntryAttributes::copyCustomKeysFrom(const EntryAttributes* other)
|
void EntryAttributes::copyCustomKeysFrom(const EntryAttributes* other)
|
||||||
@ -166,7 +186,7 @@ void EntryAttributes::copyCustomKeysFrom(const EntryAttributes* other)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT aboutToBeReset();
|
emit aboutToBeReset();
|
||||||
|
|
||||||
// remove all non-default keys
|
// remove all non-default keys
|
||||||
const QList<QString> keyList = keys();
|
const QList<QString> keyList = keys();
|
||||||
@ -187,8 +207,8 @@ void EntryAttributes::copyCustomKeysFrom(const EntryAttributes* other)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT reset();
|
emit reset();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EntryAttributes::areCustomKeysDifferent(const EntryAttributes* other)
|
bool EntryAttributes::areCustomKeysDifferent(const EntryAttributes* other)
|
||||||
@ -215,13 +235,13 @@ bool EntryAttributes::areCustomKeysDifferent(const EntryAttributes* other)
|
|||||||
void EntryAttributes::copyDataFrom(const EntryAttributes* other)
|
void EntryAttributes::copyDataFrom(const EntryAttributes* other)
|
||||||
{
|
{
|
||||||
if (*this != *other) {
|
if (*this != *other) {
|
||||||
Q_EMIT aboutToBeReset();
|
emit aboutToBeReset();
|
||||||
|
|
||||||
m_attributes = other->m_attributes;
|
m_attributes = other->m_attributes;
|
||||||
m_protectedAttributes = other->m_protectedAttributes;
|
m_protectedAttributes = other->m_protectedAttributes;
|
||||||
|
|
||||||
Q_EMIT reset();
|
emit reset();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +259,7 @@ bool EntryAttributes::operator!=(const EntryAttributes& other) const
|
|||||||
|
|
||||||
void EntryAttributes::clear()
|
void EntryAttributes::clear()
|
||||||
{
|
{
|
||||||
Q_EMIT aboutToBeReset();
|
emit aboutToBeReset();
|
||||||
|
|
||||||
m_attributes.clear();
|
m_attributes.clear();
|
||||||
m_protectedAttributes.clear();
|
m_protectedAttributes.clear();
|
||||||
@ -248,8 +268,8 @@ void EntryAttributes::clear()
|
|||||||
m_attributes.insert(key, "");
|
m_attributes.insert(key, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT reset();
|
emit reset();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
int EntryAttributes::attributesSize()
|
int EntryAttributes::attributesSize()
|
||||||
|
@ -35,6 +35,8 @@ public:
|
|||||||
QString value(const QString& key) const;
|
QString value(const QString& key) const;
|
||||||
bool contains(const QString& key) const;
|
bool contains(const QString& key) const;
|
||||||
bool isProtected(const QString& key) const;
|
bool isProtected(const QString& key) const;
|
||||||
|
bool isReference(const QString& key) const;
|
||||||
|
QRegExp* referenceRegExp();
|
||||||
void set(const QString& key, const QString& value, bool protect = false);
|
void set(const QString& key, const QString& value, bool protect = false);
|
||||||
void remove(const QString& key);
|
void remove(const QString& key);
|
||||||
void rename(const QString& oldKey, const QString& newKey);
|
void rename(const QString& oldKey, const QString& newKey);
|
||||||
@ -55,7 +57,7 @@ public:
|
|||||||
static const QString RememberCmdExecAttr;
|
static const QString RememberCmdExecAttr;
|
||||||
static bool isDefaultAttribute(const QString& key);
|
static bool isDefaultAttribute(const QString& key);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void modified();
|
void modified();
|
||||||
void defaultKeyModified();
|
void defaultKeyModified();
|
||||||
void customKeyModified(const QString& key);
|
void customKeyModified(const QString& key);
|
||||||
@ -71,6 +73,7 @@ Q_SIGNALS:
|
|||||||
private:
|
private:
|
||||||
QMap<QString, QString> m_attributes;
|
QMap<QString, QString> m_attributes;
|
||||||
QSet<QString> m_protectedAttributes;
|
QSet<QString> m_protectedAttributes;
|
||||||
|
QRegExp m_referenceRegExp;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KEEPASSX_ENTRYATTRIBUTES_H
|
#endif // KEEPASSX_ENTRYATTRIBUTES_H
|
||||||
|
@ -74,7 +74,7 @@ template <class P, class V> inline bool Group::set(P& property, const V& value)
|
|||||||
if (property != value) {
|
if (property != value) {
|
||||||
property = value;
|
property = value;
|
||||||
updateTimeinfo();
|
updateTimeinfo();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -249,7 +249,7 @@ void Group::setUuid(const Uuid& uuid)
|
|||||||
void Group::setName(const QString& name)
|
void Group::setName(const QString& name)
|
||||||
{
|
{
|
||||||
if (set(m_data.name, name)) {
|
if (set(m_data.name, name)) {
|
||||||
Q_EMIT dataChanged(this);
|
emit dataChanged(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,8 +267,8 @@ void Group::setIcon(int iconNumber)
|
|||||||
m_data.customIcon = Uuid();
|
m_data.customIcon = Uuid();
|
||||||
|
|
||||||
updateTimeinfo();
|
updateTimeinfo();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
Q_EMIT dataChanged(this);
|
emit dataChanged(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,8 +281,8 @@ void Group::setIcon(const Uuid& uuid)
|
|||||||
m_data.iconNumber = 0;
|
m_data.iconNumber = 0;
|
||||||
|
|
||||||
updateTimeinfo();
|
updateTimeinfo();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
Q_EMIT dataChanged(this);
|
emit dataChanged(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ void Group::setExpanded(bool expanded)
|
|||||||
if (m_data.isExpanded != expanded) {
|
if (m_data.isExpanded != expanded) {
|
||||||
m_data.isExpanded = expanded;
|
m_data.isExpanded = expanded;
|
||||||
updateTimeinfo();
|
updateTimeinfo();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,7 +325,7 @@ void Group::setExpires(bool value)
|
|||||||
if (m_data.timeInfo.expires() != value) {
|
if (m_data.timeInfo.expires() != value) {
|
||||||
m_data.timeInfo.setExpires(value);
|
m_data.timeInfo.setExpires(value);
|
||||||
updateTimeinfo();
|
updateTimeinfo();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ void Group::setExpiryTime(const QDateTime& dateTime)
|
|||||||
if (m_data.timeInfo.expiryTime() != dateTime) {
|
if (m_data.timeInfo.expiryTime() != dateTime) {
|
||||||
m_data.timeInfo.setExpiryTime(dateTime);
|
m_data.timeInfo.setExpiryTime(dateTime);
|
||||||
updateTimeinfo();
|
updateTimeinfo();
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,12 +391,12 @@ void Group::setParent(Group* parent, int index)
|
|||||||
recSetDatabase(parent->m_db);
|
recSetDatabase(parent->m_db);
|
||||||
}
|
}
|
||||||
QObject::setParent(parent);
|
QObject::setParent(parent);
|
||||||
Q_EMIT aboutToAdd(this, index);
|
emit aboutToAdd(this, index);
|
||||||
Q_ASSERT(index <= parent->m_children.size());
|
Q_ASSERT(index <= parent->m_children.size());
|
||||||
parent->m_children.insert(index, this);
|
parent->m_children.insert(index, this);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Q_EMIT aboutToMove(this, parent, index);
|
emit aboutToMove(this, parent, index);
|
||||||
m_parent->m_children.removeAll(this);
|
m_parent->m_children.removeAll(this);
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
QObject::setParent(parent);
|
QObject::setParent(parent);
|
||||||
@ -408,13 +408,13 @@ void Group::setParent(Group* parent, int index)
|
|||||||
m_data.timeInfo.setLocationChanged(QDateTime::currentDateTimeUtc());
|
m_data.timeInfo.setLocationChanged(QDateTime::currentDateTimeUtc());
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
|
|
||||||
if (!moveWithinDatabase) {
|
if (!moveWithinDatabase) {
|
||||||
Q_EMIT added();
|
emit added();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Q_EMIT moved();
|
emit moved();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,7 +566,7 @@ void Group::merge(const Group* other)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
Group* Group::findChildByName(const QString& name)
|
Group* Group::findChildByName(const QString& name)
|
||||||
@ -623,7 +623,7 @@ void Group::addEntry(Entry* entry)
|
|||||||
Q_ASSERT(entry);
|
Q_ASSERT(entry);
|
||||||
Q_ASSERT(!m_entries.contains(entry));
|
Q_ASSERT(!m_entries.contains(entry));
|
||||||
|
|
||||||
Q_EMIT entryAboutToAdd(entry);
|
emit entryAboutToAdd(entry);
|
||||||
|
|
||||||
m_entries << entry;
|
m_entries << entry;
|
||||||
connect(entry, SIGNAL(dataChanged(Entry*)), SIGNAL(entryDataChanged(Entry*)));
|
connect(entry, SIGNAL(dataChanged(Entry*)), SIGNAL(entryDataChanged(Entry*)));
|
||||||
@ -631,23 +631,23 @@ void Group::addEntry(Entry* entry)
|
|||||||
connect(entry, SIGNAL(modified()), m_db, SIGNAL(modifiedImmediate()));
|
connect(entry, SIGNAL(modified()), m_db, SIGNAL(modifiedImmediate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
Q_EMIT entryAdded(entry);
|
emit entryAdded(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::removeEntry(Entry* entry)
|
void Group::removeEntry(Entry* entry)
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_entries.contains(entry));
|
Q_ASSERT(m_entries.contains(entry));
|
||||||
|
|
||||||
Q_EMIT entryAboutToRemove(entry);
|
emit entryAboutToRemove(entry);
|
||||||
|
|
||||||
entry->disconnect(this);
|
entry->disconnect(this);
|
||||||
if (m_db) {
|
if (m_db) {
|
||||||
entry->disconnect(m_db);
|
entry->disconnect(m_db);
|
||||||
}
|
}
|
||||||
m_entries.removeAll(entry);
|
m_entries.removeAll(entry);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
Q_EMIT entryRemoved(entry);
|
emit entryRemoved(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::recSetDatabase(Database* db)
|
void Group::recSetDatabase(Database* db)
|
||||||
@ -693,10 +693,10 @@ void Group::recSetDatabase(Database* db)
|
|||||||
void Group::cleanupParent()
|
void Group::cleanupParent()
|
||||||
{
|
{
|
||||||
if (m_parent) {
|
if (m_parent) {
|
||||||
Q_EMIT aboutToRemove(this);
|
emit aboutToRemove(this);
|
||||||
m_parent->m_children.removeAll(this);
|
m_parent->m_children.removeAll(this);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
Q_EMIT removed();
|
emit removed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ public:
|
|||||||
void copyDataFrom(const Group* other);
|
void copyDataFrom(const Group* other);
|
||||||
void merge(const Group* other);
|
void merge(const Group* other);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void dataChanged(Group* group);
|
void dataChanged(Group* group);
|
||||||
|
|
||||||
void aboutToAdd(Group* group, int index);
|
void aboutToAdd(Group* group, int index);
|
||||||
|
@ -73,7 +73,7 @@ void InactivityTimer::timeout()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_active && !m_timer->isActive()) {
|
if (m_active && !m_timer->isActive()) {
|
||||||
Q_EMIT inactivityDetected();
|
emit inactivityDetected();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_emitMutx.unlock();
|
m_emitMutx.unlock();
|
||||||
|
@ -33,13 +33,13 @@ public:
|
|||||||
void activate();
|
void activate();
|
||||||
void deactivate();
|
void deactivate();
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void inactivityDetected();
|
void inactivityDetected();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject* watched, QEvent* event);
|
bool eventFilter(QObject* watched, QEvent* event);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void timeout();
|
void timeout();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -55,7 +55,7 @@ template <class P, class V> bool Metadata::set(P& property, const V& value)
|
|||||||
{
|
{
|
||||||
if (property != value) {
|
if (property != value) {
|
||||||
property = value;
|
property = value;
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -69,7 +69,7 @@ template <class P, class V> bool Metadata::set(P& property, const V& value, QDat
|
|||||||
if (m_updateDatetime) {
|
if (m_updateDatetime) {
|
||||||
dateTime = QDateTime::currentDateTimeUtc();
|
dateTime = QDateTime::currentDateTimeUtc();
|
||||||
}
|
}
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -308,7 +308,7 @@ void Metadata::setGenerator(const QString& value)
|
|||||||
void Metadata::setName(const QString& value)
|
void Metadata::setName(const QString& value)
|
||||||
{
|
{
|
||||||
if (set(m_data.name, value, m_data.nameChanged)) {
|
if (set(m_data.name, value, m_data.nameChanged)) {
|
||||||
Q_EMIT nameTextChanged();
|
emit nameTextChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,7 +391,7 @@ void Metadata::addCustomIcon(const Uuid& uuid, const QImage& icon)
|
|||||||
m_customIconScaledCacheKeys[uuid] = QPixmapCache::Key();
|
m_customIconScaledCacheKeys[uuid] = QPixmapCache::Key();
|
||||||
m_customIconsOrder.append(uuid);
|
m_customIconsOrder.append(uuid);
|
||||||
Q_ASSERT(m_customIcons.count() == m_customIconsOrder.count());
|
Q_ASSERT(m_customIcons.count() == m_customIconsOrder.count());
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Metadata::addCustomIconScaled(const Uuid& uuid, const QImage& icon)
|
void Metadata::addCustomIconScaled(const Uuid& uuid, const QImage& icon)
|
||||||
@ -422,7 +422,7 @@ void Metadata::removeCustomIcon(const Uuid& uuid)
|
|||||||
m_customIconScaledCacheKeys.remove(uuid);
|
m_customIconScaledCacheKeys.remove(uuid);
|
||||||
m_customIconsOrder.removeAll(uuid);
|
m_customIconsOrder.removeAll(uuid);
|
||||||
Q_ASSERT(m_customIcons.count() == m_customIconsOrder.count());
|
Q_ASSERT(m_customIcons.count() == m_customIconsOrder.count());
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Metadata::copyCustomIcons(const QSet<Uuid>& iconList, const Metadata* otherMetadata)
|
void Metadata::copyCustomIcons(const QSet<Uuid>& iconList, const Metadata* otherMetadata)
|
||||||
@ -504,7 +504,7 @@ void Metadata::addCustomField(const QString& key, const QString& value)
|
|||||||
Q_ASSERT(!m_customFields.contains(key));
|
Q_ASSERT(!m_customFields.contains(key));
|
||||||
|
|
||||||
m_customFields.insert(key, value);
|
m_customFields.insert(key, value);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Metadata::removeCustomField(const QString& key)
|
void Metadata::removeCustomField(const QString& key)
|
||||||
@ -512,5 +512,5 @@ void Metadata::removeCustomField(const QString& key)
|
|||||||
Q_ASSERT(m_customFields.contains(key));
|
Q_ASSERT(m_customFields.contains(key));
|
||||||
|
|
||||||
m_customFields.remove(key);
|
m_customFields.remove(key);
|
||||||
Q_EMIT modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void copyAttributesFrom(const Metadata* other);
|
void copyAttributesFrom(const Metadata* other);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void nameTextChanged();
|
void nameTextChanged();
|
||||||
void modified();
|
void modified();
|
||||||
|
|
||||||
|
@ -97,11 +97,11 @@ QString PasswordGenerator::generatePassword() const
|
|||||||
|
|
||||||
int PasswordGenerator::getbits() const
|
int PasswordGenerator::getbits() const
|
||||||
{
|
{
|
||||||
QVector<PasswordGroup> groups = passwordGroups();
|
const QVector<PasswordGroup> groups = passwordGroups();
|
||||||
|
|
||||||
int bits = 0;
|
int bits = 0;
|
||||||
QVector<QChar> passwordChars;
|
QVector<QChar> passwordChars;
|
||||||
Q_FOREACH (const PasswordGroup& group, groups) {
|
for (const PasswordGroup& group: groups) {
|
||||||
bits += group.size();
|
bits += group.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ bool Application::event(QEvent* event)
|
|||||||
{
|
{
|
||||||
// Handle Apple QFileOpenEvent from finder (double click on .kdbx file)
|
// Handle Apple QFileOpenEvent from finder (double click on .kdbx file)
|
||||||
if (event->type() == QEvent::FileOpen) {
|
if (event->type() == QEvent::FileOpen) {
|
||||||
Q_EMIT openFile(static_cast<QFileOpenEvent*>(event)->file());
|
emit openFile(static_cast<QFileOpenEvent*>(event)->file());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
@ -153,7 +153,7 @@ void Application::handleUnixSignal(int sig)
|
|||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
{
|
{
|
||||||
char buf = 0;
|
char buf = 0;
|
||||||
::write(unixSignalSocket[0], &buf, sizeof(buf));
|
Q_UNUSED(::write(unixSignalSocket[0], &buf, sizeof(buf)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
@ -165,7 +165,7 @@ void Application::quitBySignal()
|
|||||||
{
|
{
|
||||||
m_unixSignalNotifier->setEnabled(false);
|
m_unixSignalNotifier->setEnabled(false);
|
||||||
char buf;
|
char buf;
|
||||||
::read(unixSignalSocket[1], &buf, sizeof(buf));
|
Q_UNUSED(::read(unixSignalSocket[1], &buf, sizeof(buf)));
|
||||||
|
|
||||||
if (nullptr != m_mainWindow)
|
if (nullptr != m_mainWindow)
|
||||||
static_cast<MainWindow*>(m_mainWindow)->appExit();
|
static_cast<MainWindow*>(m_mainWindow)->appExit();
|
||||||
|
@ -34,10 +34,10 @@ public:
|
|||||||
|
|
||||||
bool event(QEvent* event) override;
|
bool event(QEvent* event) override;
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void openFile(const QString& filename);
|
void openFile(const QString& filename);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
#if defined(Q_OS_UNIX)
|
#if defined(Q_OS_UNIX)
|
||||||
void quitBySignal();
|
void quitBySignal();
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,10 +31,10 @@ public:
|
|||||||
|
|
||||||
static Clipboard* instance();
|
static Clipboard* instance();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void clearCopiedText();
|
void clearCopiedText();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void clearClipboard();
|
void clearClipboard();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -39,7 +39,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CloneDialog> m_ui;
|
QScopedPointer<Ui::CloneDialog> m_ui;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void cloneEntry();
|
void cloneEntry();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -50,7 +50,7 @@ void DatabaseRepairWidget::openDatabase()
|
|||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
if (!key.load(keyFilename, &errorMsg)) {
|
if (!key.load(keyFilename, &errorMsg)) {
|
||||||
MessageBox::warning(this, tr("Error"), tr("Can't open key file").append(":\n").append(errorMsg));
|
MessageBox::warning(this, tr("Error"), tr("Can't open key file").append(":\n").append(errorMsg));
|
||||||
Q_EMIT editFinished(false);
|
emit editFinished(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
masterKey.addKey(key);
|
masterKey.addKey(key);
|
||||||
@ -62,7 +62,7 @@ void DatabaseRepairWidget::openDatabase()
|
|||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n")
|
MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n")
|
||||||
.append(file.errorString()));
|
.append(file.errorString()));
|
||||||
Q_EMIT editFinished(false);
|
emit editFinished(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_db) {
|
if (m_db) {
|
||||||
@ -75,21 +75,21 @@ void DatabaseRepairWidget::openDatabase()
|
|||||||
switch (repairResult) {
|
switch (repairResult) {
|
||||||
case KeePass2Repair::NothingTodo:
|
case KeePass2Repair::NothingTodo:
|
||||||
MessageBox::information(this, tr("Error"), tr("Database opened fine. Nothing to do."));
|
MessageBox::information(this, tr("Error"), tr("Database opened fine. Nothing to do."));
|
||||||
Q_EMIT editFinished(false);
|
emit editFinished(false);
|
||||||
return;
|
return;
|
||||||
case KeePass2Repair::UnableToOpen:
|
case KeePass2Repair::UnableToOpen:
|
||||||
MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n")
|
MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n")
|
||||||
.append(repair.errorString()));
|
.append(repair.errorString()));
|
||||||
Q_EMIT editFinished(false);
|
emit editFinished(false);
|
||||||
return;
|
return;
|
||||||
case KeePass2Repair::RepairSuccess:
|
case KeePass2Repair::RepairSuccess:
|
||||||
m_db = repair.database();
|
m_db = repair.database();
|
||||||
MessageBox::warning(this, tr("Success"), tr("The database has been successfully repaired\nYou can now save it."));
|
MessageBox::warning(this, tr("Success"), tr("The database has been successfully repaired\nYou can now save it."));
|
||||||
Q_EMIT editFinished(true);
|
emit editFinished(true);
|
||||||
return;
|
return;
|
||||||
case KeePass2Repair::RepairFailed:
|
case KeePass2Repair::RepairFailed:
|
||||||
MessageBox::warning(this, tr("Error"), tr("Unable to repair the database."));
|
MessageBox::warning(this, tr("Error"), tr("Unable to repair the database."));
|
||||||
Q_EMIT editFinished(false);
|
emit editFinished(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,9 +97,9 @@ void DatabaseRepairWidget::openDatabase()
|
|||||||
void DatabaseRepairWidget::processEditFinished(bool result)
|
void DatabaseRepairWidget::processEditFinished(bool result)
|
||||||
{
|
{
|
||||||
if (result) {
|
if (result) {
|
||||||
Q_EMIT success();
|
emit success();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Q_EMIT error();
|
emit error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,14 +27,14 @@ class DatabaseRepairWidget : public DatabaseOpenWidget
|
|||||||
public:
|
public:
|
||||||
explicit DatabaseRepairWidget(QWidget* parent = nullptr);
|
explicit DatabaseRepairWidget(QWidget* parent = nullptr);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void success();
|
void success();
|
||||||
void error();
|
void error();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void openDatabase() override;
|
void openDatabase() override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void processEditFinished(bool result);
|
void processEditFinished(bool result);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -124,12 +124,12 @@ void DatabaseSettingsWidget::save()
|
|||||||
truncateHistories();
|
truncateHistories();
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT editFinished(true);
|
emit editFinished(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseSettingsWidget::reject()
|
void DatabaseSettingsWidget::reject()
|
||||||
{
|
{
|
||||||
Q_EMIT editFinished(false);
|
emit editFinished(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseSettingsWidget::transformRoundsBenchmark()
|
void DatabaseSettingsWidget::transformRoundsBenchmark()
|
||||||
|
@ -38,10 +38,10 @@ public:
|
|||||||
|
|
||||||
void load(Database* db);
|
void load(Database* db);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void editFinished(bool accepted);
|
void editFinished(bool accepted);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void save();
|
void save();
|
||||||
void reject();
|
void reject();
|
||||||
void transformRoundsBenchmark();
|
void transformRoundsBenchmark();
|
||||||
|
@ -120,7 +120,7 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw,
|
|||||||
QFileInfo fileInfo(fileName);
|
QFileInfo fileInfo(fileName);
|
||||||
QString canonicalFilePath = fileInfo.canonicalFilePath();
|
QString canonicalFilePath = fileInfo.canonicalFilePath();
|
||||||
if (canonicalFilePath.isEmpty()) {
|
if (canonicalFilePath.isEmpty()) {
|
||||||
Q_EMIT messageGlobal(tr("File not found!"), MessageWidget::Error);
|
emit messageGlobal(tr("File not found!"), MessageWidget::Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw,
|
|||||||
if (!file.open(QIODevice::ReadWrite)) {
|
if (!file.open(QIODevice::ReadWrite)) {
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
// can't open
|
// can't open
|
||||||
Q_EMIT messageGlobal(
|
emit messageGlobal(
|
||||||
tr("Unable to open the database.").append("\n").append(file.errorString()), MessageWidget::Error);
|
tr("Unable to open the database.").append("\n").append(file.errorString()), MessageWidget::Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -198,7 +198,7 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw,
|
|||||||
insertDatabase(db, dbStruct);
|
insertDatabase(db, dbStruct);
|
||||||
|
|
||||||
if (dbStruct.readOnly) {
|
if (dbStruct.readOnly) {
|
||||||
Q_EMIT messageTab(tr("File opened in read only mode."), MessageWidget::Warning);
|
emit messageTab(tr("File opened in read only mode."), MessageWidget::Warning);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLastDatabases(dbStruct.filePath);
|
updateLastDatabases(dbStruct.filePath);
|
||||||
@ -209,7 +209,7 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw,
|
|||||||
else {
|
else {
|
||||||
dbStruct.dbWidget->switchToOpenDatabase(dbStruct.filePath);
|
dbStruct.dbWidget->switchToOpenDatabase(dbStruct.filePath);
|
||||||
}
|
}
|
||||||
Q_EMIT messageDismissGlobal();
|
emit messageDismissGlobal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseTabWidget::mergeDatabase()
|
void DatabaseTabWidget::mergeDatabase()
|
||||||
@ -314,7 +314,7 @@ void DatabaseTabWidget::deleteDatabase(Database* db)
|
|||||||
delete db;
|
delete db;
|
||||||
|
|
||||||
if (emitDatabaseWithFileClosed) {
|
if (emitDatabaseWithFileClosed) {
|
||||||
Q_EMIT databaseWithFileClosed(filePath);
|
emit databaseWithFileClosed(filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -501,7 +501,7 @@ void DatabaseTabWidget::exportToCsv()
|
|||||||
|
|
||||||
CsvExporter csvExporter;
|
CsvExporter csvExporter;
|
||||||
if (!csvExporter.exportDatabase(fileName, db)) {
|
if (!csvExporter.exportDatabase(fileName, db)) {
|
||||||
Q_EMIT messageGlobal(
|
emit messageGlobal(
|
||||||
tr("Writing the CSV file failed.").append("\n")
|
tr("Writing the CSV file failed.").append("\n")
|
||||||
.append(csvExporter.errorString()), MessageWidget::Error);
|
.append(csvExporter.errorString()), MessageWidget::Error);
|
||||||
}
|
}
|
||||||
@ -563,7 +563,7 @@ void DatabaseTabWidget::updateTabName(Database* db)
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTabText(index, tabName);
|
setTabText(index, tabName);
|
||||||
Q_EMIT tabNameChanged();
|
emit tabNameChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseTabWidget::updateTabNameFromDbSender()
|
void DatabaseTabWidget::updateTabNameFromDbSender()
|
||||||
@ -743,7 +743,7 @@ void DatabaseTabWidget::lockDatabases()
|
|||||||
// database has changed so we can't use the db variable anymore
|
// database has changed so we can't use the db variable anymore
|
||||||
updateTabName(dbWidget->database());
|
updateTabName(dbWidget->database());
|
||||||
|
|
||||||
Q_EMIT databaseLocked(dbWidget);
|
emit databaseLocked(dbWidget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -801,12 +801,12 @@ void DatabaseTabWidget::changeDatabase(Database* newDb, bool unsavedChanges)
|
|||||||
|
|
||||||
void DatabaseTabWidget::emitActivateDatabaseChanged()
|
void DatabaseTabWidget::emitActivateDatabaseChanged()
|
||||||
{
|
{
|
||||||
Q_EMIT activateDatabaseChanged(currentDatabaseWidget());
|
emit activateDatabaseChanged(currentDatabaseWidget());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseTabWidget::emitDatabaseUnlockedFromDbWidgetSender()
|
void DatabaseTabWidget::emitDatabaseUnlockedFromDbWidgetSender()
|
||||||
{
|
{
|
||||||
Q_EMIT databaseUnlocked(static_cast<DatabaseWidget*>(sender()));
|
emit databaseUnlocked(static_cast<DatabaseWidget*>(sender()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseTabWidget::connectDatabase(Database* newDb, Database* oldDb)
|
void DatabaseTabWidget::connectDatabase(Database* newDb, Database* oldDb)
|
||||||
|
@ -63,7 +63,7 @@ public:
|
|||||||
|
|
||||||
static const int LastDatabasesCount;
|
static const int LastDatabasesCount;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void newDatabase();
|
void newDatabase();
|
||||||
void openDatabase();
|
void openDatabase();
|
||||||
void mergeDatabase();
|
void mergeDatabase();
|
||||||
@ -80,7 +80,7 @@ public Q_SLOTS:
|
|||||||
void performGlobalAutoType();
|
void performGlobalAutoType();
|
||||||
void lockDatabases();
|
void lockDatabases();
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void tabNameChanged();
|
void tabNameChanged();
|
||||||
void databaseWithFileClosed(QString filePath);
|
void databaseWithFileClosed(QString filePath);
|
||||||
void activateDatabaseChanged(DatabaseWidget* dbWidget);
|
void activateDatabaseChanged(DatabaseWidget* dbWidget);
|
||||||
@ -91,7 +91,7 @@ Q_SIGNALS:
|
|||||||
void messageDismissGlobal();
|
void messageDismissGlobal();
|
||||||
void messageDismissTab();
|
void messageDismissTab();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void updateTabName(Database* db);
|
void updateTabName(Database* db);
|
||||||
void updateTabNameFromDbSender();
|
void updateTabNameFromDbSender();
|
||||||
void updateTabNameFromDbWidgetSender();
|
void updateTabNameFromDbWidgetSender();
|
||||||
|
@ -263,7 +263,7 @@ void DatabaseWidget::clearAllWidgets()
|
|||||||
|
|
||||||
void DatabaseWidget::emitCurrentModeChanged()
|
void DatabaseWidget::emitCurrentModeChanged()
|
||||||
{
|
{
|
||||||
Q_EMIT currentModeChanged(currentMode());
|
emit currentModeChanged(currentMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
Database* DatabaseWidget::database()
|
Database* DatabaseWidget::database()
|
||||||
@ -309,7 +309,7 @@ void DatabaseWidget::replaceDatabase(Database* db)
|
|||||||
Database* oldDb = m_db;
|
Database* oldDb = m_db;
|
||||||
m_db = db;
|
m_db = db;
|
||||||
m_groupView->changeDatabase(m_db);
|
m_groupView->changeDatabase(m_db);
|
||||||
Q_EMIT databaseChanged(m_db, m_databaseModified);
|
emit databaseChanged(m_db, m_databaseModified);
|
||||||
delete oldDb;
|
delete oldDb;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -700,7 +700,7 @@ void DatabaseWidget::updateMasterKey(bool accepted)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!m_db->hasKey()) {
|
else if (!m_db->hasKey()) {
|
||||||
Q_EMIT closeRequest();
|
emit closeRequest();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -712,7 +712,7 @@ void DatabaseWidget::openDatabase(bool accepted)
|
|||||||
if (accepted) {
|
if (accepted) {
|
||||||
replaceDatabase(static_cast<DatabaseOpenWidget*>(sender())->database());
|
replaceDatabase(static_cast<DatabaseOpenWidget*>(sender())->database());
|
||||||
setCurrentWidget(m_mainWidget);
|
setCurrentWidget(m_mainWidget);
|
||||||
Q_EMIT unlockedDatabase();
|
emit unlockedDatabase();
|
||||||
|
|
||||||
// We won't need those anymore and KeePass1OpenWidget closes
|
// We won't need those anymore and KeePass1OpenWidget closes
|
||||||
// the file in its dtor.
|
// the file in its dtor.
|
||||||
@ -727,7 +727,7 @@ void DatabaseWidget::openDatabase(bool accepted)
|
|||||||
if (m_databaseOpenWidget->database()) {
|
if (m_databaseOpenWidget->database()) {
|
||||||
delete m_databaseOpenWidget->database();
|
delete m_databaseOpenWidget->database();
|
||||||
}
|
}
|
||||||
Q_EMIT closeRequest();
|
emit closeRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -750,13 +750,13 @@ void DatabaseWidget::mergeDatabase(bool accepted)
|
|||||||
}
|
}
|
||||||
|
|
||||||
setCurrentWidget(m_mainWidget);
|
setCurrentWidget(m_mainWidget);
|
||||||
Q_EMIT databaseMerged(m_db);
|
emit databaseMerged(m_db);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseWidget::unlockDatabase(bool accepted)
|
void DatabaseWidget::unlockDatabase(bool accepted)
|
||||||
{
|
{
|
||||||
if (!accepted) {
|
if (!accepted) {
|
||||||
Q_EMIT closeRequest();
|
emit closeRequest();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -775,7 +775,7 @@ void DatabaseWidget::unlockDatabase(bool accepted)
|
|||||||
|
|
||||||
setCurrentWidget(m_mainWidget);
|
setCurrentWidget(m_mainWidget);
|
||||||
m_unlockDatabaseWidget->clearForms();
|
m_unlockDatabaseWidget->clearForms();
|
||||||
Q_EMIT unlockedDatabase();
|
emit unlockedDatabase();
|
||||||
|
|
||||||
if (sender() == m_unlockDatabaseDialog) {
|
if (sender() == m_unlockDatabaseDialog) {
|
||||||
QList<Database*> dbList;
|
QList<Database*> dbList;
|
||||||
@ -888,7 +888,7 @@ void DatabaseWidget::search(const QString& searchtext)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT searchModeAboutToActivate();
|
emit searchModeAboutToActivate();
|
||||||
|
|
||||||
Qt::CaseSensitivity caseSensitive = m_searchCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive;
|
Qt::CaseSensitivity caseSensitive = m_searchCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive;
|
||||||
|
|
||||||
@ -907,7 +907,7 @@ void DatabaseWidget::search(const QString& searchtext)
|
|||||||
|
|
||||||
m_searchingLabel->setVisible(true);
|
m_searchingLabel->setVisible(true);
|
||||||
|
|
||||||
Q_EMIT searchModeActivated();
|
emit searchModeActivated();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseWidget::setSearchCaseSensitive(bool state)
|
void DatabaseWidget::setSearchCaseSensitive(bool state)
|
||||||
@ -934,12 +934,12 @@ void DatabaseWidget::endSearch()
|
|||||||
{
|
{
|
||||||
if (isInSearchMode())
|
if (isInSearchMode())
|
||||||
{
|
{
|
||||||
Q_EMIT listModeAboutToActivate();
|
emit listModeAboutToActivate();
|
||||||
|
|
||||||
// Show the normal entry view of the current group
|
// Show the normal entry view of the current group
|
||||||
m_entryView->setGroup(currentGroup());
|
m_entryView->setGroup(currentGroup());
|
||||||
|
|
||||||
Q_EMIT listModeActivated();
|
emit listModeActivated();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_searchingLabel->setVisible(false);
|
m_searchingLabel->setVisible(false);
|
||||||
@ -950,12 +950,12 @@ void DatabaseWidget::endSearch()
|
|||||||
|
|
||||||
void DatabaseWidget::emitGroupContextMenuRequested(const QPoint& pos)
|
void DatabaseWidget::emitGroupContextMenuRequested(const QPoint& pos)
|
||||||
{
|
{
|
||||||
Q_EMIT groupContextMenuRequested(m_groupView->viewport()->mapToGlobal(pos));
|
emit groupContextMenuRequested(m_groupView->viewport()->mapToGlobal(pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseWidget::emitEntryContextMenuRequested(const QPoint& pos)
|
void DatabaseWidget::emitEntryContextMenuRequested(const QPoint& pos)
|
||||||
{
|
{
|
||||||
Q_EMIT entryContextMenuRequested(m_entryView->viewport()->mapToGlobal(pos));
|
emit entryContextMenuRequested(m_entryView->viewport()->mapToGlobal(pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DatabaseWidget::dbHasKey() const
|
bool DatabaseWidget::dbHasKey() const
|
||||||
|
@ -29,12 +29,12 @@ public:
|
|||||||
explicit DatabaseWidgetStateSync(QObject* parent = nullptr);
|
explicit DatabaseWidgetStateSync(QObject* parent = nullptr);
|
||||||
~DatabaseWidgetStateSync();
|
~DatabaseWidgetStateSync();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void setActive(DatabaseWidget* dbWidget);
|
void setActive(DatabaseWidget* dbWidget);
|
||||||
void restoreListView();
|
void restoreListView();
|
||||||
void restoreSearchView();
|
void restoreSearchView();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void blockUpdates();
|
void blockUpdates();
|
||||||
void updateSplitterSizes();
|
void updateSplitterSizes();
|
||||||
void updateColumnSizes();
|
void updateColumnSizes();
|
||||||
|
@ -34,7 +34,7 @@ protected:
|
|||||||
void dropEvent(QDropEvent* event) override;
|
void dropEvent(QDropEvent* event) override;
|
||||||
void tabLayoutChange() override;
|
void tabLayoutChange() override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void dragSwitchTab();
|
void dragSwitchTab();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -48,9 +48,9 @@ EditWidgetIcons::EditWidgetIcons(QWidget* parent)
|
|||||||
, m_defaultIconModel(new DefaultIconModel(this))
|
, m_defaultIconModel(new DefaultIconModel(this))
|
||||||
, m_customIconModel(new CustomIconModel(this))
|
, m_customIconModel(new CustomIconModel(this))
|
||||||
#ifdef WITH_XC_HTTP
|
#ifdef WITH_XC_HTTP
|
||||||
, m_httpClient(nullptr)
|
|
||||||
, m_fallbackToGoogle(true)
|
, m_fallbackToGoogle(true)
|
||||||
, m_redirectCount(0)
|
, m_redirectCount(0)
|
||||||
|
, m_httpClient(nullptr)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
@ -149,6 +149,7 @@ void EditWidgetIcons::setUrl(const QString& url)
|
|||||||
m_ui->faviconButton->setVisible(!url.isEmpty());
|
m_ui->faviconButton->setVisible(!url.isEmpty());
|
||||||
resetFaviconDownload();
|
resetFaviconDownload();
|
||||||
#else
|
#else
|
||||||
|
Q_UNUSED(url);
|
||||||
m_ui->faviconButton->setVisible(false);
|
m_ui->faviconButton->setVisible(false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -275,7 +276,7 @@ void EditWidgetIcons::addCustomIcon()
|
|||||||
m_ui->customIconsView->setCurrentIndex(index);
|
m_ui->customIconsView->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Q_EMIT messageEditEntry(tr("Can't read icon"), MessageWidget::Error);
|
emit messageEditEntry(tr("Can't read icon"), MessageWidget::Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,14 +63,14 @@ public:
|
|||||||
void reset();
|
void reset();
|
||||||
void load(const Uuid& currentUuid, Database* database, const IconStruct& iconStruct, const QString& url = "");
|
void load(const Uuid& currentUuid, Database* database, const IconStruct& iconStruct, const QString& url = "");
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void setUrl(const QString& url);
|
void setUrl(const QString& url);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void messageEditEntry(QString, MessageWidget::MessageType);
|
void messageEditEntry(QString, MessageWidget::MessageType);
|
||||||
void messageEditEntryDismiss();
|
void messageEditEntryDismiss();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void downloadFavicon();
|
void downloadFavicon();
|
||||||
#ifdef WITH_XC_HTTP
|
#ifdef WITH_XC_HTTP
|
||||||
void fetchFavicon(const QUrl& url);
|
void fetchFavicon(const QUrl& url);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "KMessageWidget.h"
|
#include "KMessageWidget.h"
|
||||||
|
|
||||||
#include "core/FilePath.h"
|
#include "core/FilePath.h"
|
||||||
|
#include "core/Global.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
@ -117,7 +118,8 @@ void KMessageWidgetPrivate::createLayout()
|
|||||||
qDeleteAll(buttons);
|
qDeleteAll(buttons);
|
||||||
buttons.clear();
|
buttons.clear();
|
||||||
|
|
||||||
Q_FOREACH (QAction *action, q->actions()) {
|
const auto actions = q->actions();
|
||||||
|
for (QAction *action: actions) {
|
||||||
QToolButton *button = new QToolButton(content);
|
QToolButton *button = new QToolButton(content);
|
||||||
button->setDefaultAction(action);
|
button->setDefaultAction(action);
|
||||||
button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||||
@ -137,7 +139,7 @@ void KMessageWidgetPrivate::createLayout()
|
|||||||
|
|
||||||
QHBoxLayout *buttonLayout = new QHBoxLayout;
|
QHBoxLayout *buttonLayout = new QHBoxLayout;
|
||||||
buttonLayout->addStretch();
|
buttonLayout->addStretch();
|
||||||
Q_FOREACH (QToolButton *button, buttons) {
|
for (QToolButton* button: asConst(buttons)) {
|
||||||
// For some reason, calling show() is necessary if wordwrap is true,
|
// For some reason, calling show() is necessary if wordwrap is true,
|
||||||
// otherwise the buttons do not show up. It is not needed if
|
// otherwise the buttons do not show up. It is not needed if
|
||||||
// wordwrap is false.
|
// wordwrap is false.
|
||||||
@ -151,7 +153,7 @@ void KMessageWidgetPrivate::createLayout()
|
|||||||
layout->addWidget(iconLabel);
|
layout->addWidget(iconLabel);
|
||||||
layout->addWidget(textLabel);
|
layout->addWidget(textLabel);
|
||||||
|
|
||||||
Q_FOREACH (QToolButton *button, buttons) {
|
for (QToolButton* button: asConst(buttons)) {
|
||||||
layout->addWidget(button);
|
layout->addWidget(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool isShowAnimationRunning() const;
|
bool isShowAnimationRunning() const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
/**
|
/**
|
||||||
* Set the text of the message widget to @p text.
|
* Set the text of the message widget to @p text.
|
||||||
* If the message widget is already visible, the text changes on the fly.
|
* If the message widget is already visible, the text changes on the fly.
|
||||||
@ -277,7 +277,7 @@ public Q_SLOTS:
|
|||||||
*/
|
*/
|
||||||
void setIcon(const QIcon &icon);
|
void setIcon(const QIcon &icon);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
/**
|
/**
|
||||||
* This signal is emitted when the user clicks a link in the text label.
|
* This signal is emitted when the user clicks a link in the text label.
|
||||||
* The URL referred to by the href anchor is passed in contents.
|
* The URL referred to by the href anchor is passed in contents.
|
||||||
|
@ -62,7 +62,7 @@ void KeePass1OpenWidget::openDatabase()
|
|||||||
|
|
||||||
if (m_db) {
|
if (m_db) {
|
||||||
m_db->metadata()->setName(QFileInfo(m_filename).completeBaseName());
|
m_db->metadata()->setName(QFileInfo(m_filename).completeBaseName());
|
||||||
Q_EMIT editFinished(true);
|
emit editFinished(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_ui->messageWidget->showMessage(tr("Unable to open the database.").append("\n")
|
m_ui->messageWidget->showMessage(tr("Unable to open the database.").append("\n")
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void resizeEvent(QResizeEvent* event) override;
|
void resizeEvent(QResizeEvent* event) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void updateCloseButton(const QString& text);
|
void updateCloseButton(const QString& text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
MainWindow();
|
MainWindow();
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
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());
|
||||||
void appExit();
|
void appExit();
|
||||||
@ -54,7 +54,7 @@ protected:
|
|||||||
void closeEvent(QCloseEvent* event) override;
|
void closeEvent(QCloseEvent* event) override;
|
||||||
void changeEvent(QEvent* event) override;
|
void changeEvent(QEvent* event) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void setMenuActionState(DatabaseWidget::Mode mode = DatabaseWidget::None);
|
void setMenuActionState(DatabaseWidget::Mode mode = DatabaseWidget::None);
|
||||||
void updateWindowTitle();
|
void updateWindowTitle();
|
||||||
void showAboutDialog();
|
void showAboutDialog();
|
||||||
|
@ -123,9 +123,7 @@
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="WelcomeWidget" name="welcomeWidget" native="true">
|
<widget class="WelcomeWidget" name="welcomeWidget" native="true"/>
|
||||||
<zorder>horizontalSpacer_2</zorder>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_2">
|
<spacer name="horizontalSpacer_2">
|
||||||
|
@ -27,7 +27,7 @@ class MessageWidget : public KMessageWidget
|
|||||||
public:
|
public:
|
||||||
explicit MessageWidget(QWidget* parent = 0);
|
explicit MessageWidget(QWidget* parent = 0);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void showMessage(const QString& text, MessageWidget::MessageType type);
|
void showMessage(const QString& text, MessageWidget::MessageType type);
|
||||||
void hideMessage();
|
void hideMessage();
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
void setNumberAlternatives(int alternatives);
|
void setNumberAlternatives(int alternatives);
|
||||||
void showPopup();
|
void showPopup();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void setEcho(bool echo);
|
void setEcho(bool echo);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -69,7 +69,7 @@ void PasswordEdit::setShowPassword(bool show)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateStylesheet();
|
updateStylesheet();
|
||||||
Q_EMIT showPasswordChanged(show);
|
emit showPasswordChanged(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PasswordEdit::passwordsEqual() const
|
bool PasswordEdit::passwordsEqual() const
|
||||||
|
@ -31,13 +31,13 @@ public:
|
|||||||
explicit PasswordEdit(QWidget* parent = nullptr);
|
explicit PasswordEdit(QWidget* parent = nullptr);
|
||||||
void enableVerifyMode(PasswordEdit* baseEdit);
|
void enableVerifyMode(PasswordEdit* baseEdit);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void setShowPassword(bool show);
|
void setShowPassword(bool show);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void showPasswordChanged(bool show);
|
void showPasswordChanged(bool show);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void updateStylesheet();
|
void updateStylesheet();
|
||||||
void autocompletePassword(QString password);
|
void autocompletePassword(QString password);
|
||||||
|
|
||||||
|
@ -145,8 +145,8 @@ void PasswordGeneratorWidget::generatePassword()
|
|||||||
void PasswordGeneratorWidget::applyPassword()
|
void PasswordGeneratorWidget::applyPassword()
|
||||||
{
|
{
|
||||||
saveSettings();
|
saveSettings();
|
||||||
Q_EMIT appliedPassword(m_ui->editNewPassword->text());
|
emit appliedPassword(m_ui->editNewPassword->text());
|
||||||
Q_EMIT dialogTerminated();
|
emit dialogTerminated();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PasswordGeneratorWidget::sliderMoved()
|
void PasswordGeneratorWidget::sliderMoved()
|
||||||
|
@ -43,11 +43,11 @@ public:
|
|||||||
void setStandaloneMode(bool standalone);
|
void setStandaloneMode(bool standalone);
|
||||||
void regeneratePassword();
|
void regeneratePassword();
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void appliedPassword(const QString& password);
|
void appliedPassword(const QString& password);
|
||||||
void dialogTerminated();
|
void dialogTerminated();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void applyPassword();
|
void applyPassword();
|
||||||
void generatePassword();
|
void generatePassword();
|
||||||
void updateApplyEnabled(const QString& password);
|
void updateApplyEnabled(const QString& password);
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "core/Config.h"
|
#include "core/Config.h"
|
||||||
#include "core/Translator.h"
|
#include "core/Translator.h"
|
||||||
#include "core/FilePath.h"
|
#include "core/FilePath.h"
|
||||||
|
#include "core/Global.h"
|
||||||
|
|
||||||
class SettingsWidget::ExtraPage
|
class SettingsWidget::ExtraPage
|
||||||
{
|
{
|
||||||
@ -144,8 +145,9 @@ void SettingsWidget::loadSettings()
|
|||||||
m_secUi->passwordRepeatCheckBox->setChecked(config()->get("security/passwordsrepeat").toBool());
|
m_secUi->passwordRepeatCheckBox->setChecked(config()->get("security/passwordsrepeat").toBool());
|
||||||
|
|
||||||
|
|
||||||
Q_FOREACH (const ExtraPage& page, m_extraPages)
|
for (const ExtraPage& page: asConst(m_extraPages)) {
|
||||||
page.loadSettings();
|
page.loadSettings();
|
||||||
|
}
|
||||||
|
|
||||||
setCurrentPage(0);
|
setCurrentPage(0);
|
||||||
}
|
}
|
||||||
@ -190,10 +192,11 @@ void SettingsWidget::saveSettings()
|
|||||||
config()->set("security/passwordscleartext", m_secUi->passwordCleartextCheckBox->isChecked());
|
config()->set("security/passwordscleartext", m_secUi->passwordCleartextCheckBox->isChecked());
|
||||||
config()->set("security/passwordsrepeat", m_secUi->passwordRepeatCheckBox->isChecked());
|
config()->set("security/passwordsrepeat", m_secUi->passwordRepeatCheckBox->isChecked());
|
||||||
|
|
||||||
Q_FOREACH (const ExtraPage& page, m_extraPages)
|
for (const ExtraPage& page: asConst(m_extraPages)) {
|
||||||
page.saveSettings();
|
page.saveSettings();
|
||||||
|
}
|
||||||
|
|
||||||
Q_EMIT editFinished(true);
|
emit editFinished(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsWidget::reject()
|
void SettingsWidget::reject()
|
||||||
@ -203,7 +206,7 @@ void SettingsWidget::reject()
|
|||||||
autoType()->registerGlobalShortcut(m_globalAutoTypeKey, m_globalAutoTypeModifiers);
|
autoType()->registerGlobalShortcut(m_globalAutoTypeKey, m_globalAutoTypeModifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EMIT editFinished(false);
|
emit editFinished(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsWidget::enableAutoSaveOnExit(bool checked)
|
void SettingsWidget::enableAutoSaveOnExit(bool checked)
|
||||||
|
@ -45,10 +45,10 @@ public:
|
|||||||
void addSettingsPage(ISettingsPage * page);
|
void addSettingsPage(ISettingsPage * page);
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void editFinished(bool accepted);
|
void editFinished(bool accepted);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void saveSettings();
|
void saveSettings();
|
||||||
void reject();
|
void reject();
|
||||||
void enableAutoSaveOnExit(bool checked);
|
void enableAutoSaveOnExit(bool checked);
|
||||||
|
@ -49,7 +49,7 @@ void UnlockDatabaseDialog::complete(bool r)
|
|||||||
{
|
{
|
||||||
if (r) {
|
if (r) {
|
||||||
accept();
|
accept();
|
||||||
Q_EMIT unlockDone(true);
|
emit unlockDone(true);
|
||||||
} else {
|
} else {
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,10 @@ public:
|
|||||||
void clearForms();
|
void clearForms();
|
||||||
Database* database();
|
Database* database();
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void unlockDone(bool);
|
void unlockDone(bool);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void complete(bool r);
|
void complete(bool r);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -64,5 +64,5 @@ void WelcomeWidget::openDatabaseFromFile(QListWidgetItem* item)
|
|||||||
if (item->text().isEmpty()) {
|
if (item->text().isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Q_EMIT openDatabaseFile(item->text());
|
emit openDatabaseFile(item->text());
|
||||||
}
|
}
|
@ -33,13 +33,13 @@ public:
|
|||||||
explicit WelcomeWidget(QWidget* parent = nullptr);
|
explicit WelcomeWidget(QWidget* parent = nullptr);
|
||||||
~WelcomeWidget();
|
~WelcomeWidget();
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void newDatabase();
|
void newDatabase();
|
||||||
void openDatabase();
|
void openDatabase();
|
||||||
void openDatabaseFile(QString);
|
void openDatabaseFile(QString);
|
||||||
void importKeePass1Database();
|
void importKeePass1Database();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void openDatabaseFromFile(QListWidgetItem* item);
|
void openDatabaseFromFile(QListWidgetItem* item);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -103,7 +103,7 @@ QVariant AutoTypeAssociationsModel::data(const QModelIndex& index, int role) con
|
|||||||
|
|
||||||
void AutoTypeAssociationsModel::associationChange(int i)
|
void AutoTypeAssociationsModel::associationChange(int i)
|
||||||
{
|
{
|
||||||
Q_EMIT dataChanged(index(i, 0), index(i, columnCount() - 1));
|
emit dataChanged(index(i, 0), index(i, columnCount() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTypeAssociationsModel::associationAboutToAdd(int i)
|
void AutoTypeAssociationsModel::associationAboutToAdd(int i)
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void associationChange(int i);
|
void associationChange(int i);
|
||||||
void associationAboutToAdd(int i);
|
void associationAboutToAdd(int i);
|
||||||
void associationAdd();
|
void associationAdd();
|
||||||
|
@ -132,6 +132,8 @@ void EditEntryWidget::setupAdvanced()
|
|||||||
connect(m_advancedUi->addAttributeButton, SIGNAL(clicked()), SLOT(insertAttribute()));
|
connect(m_advancedUi->addAttributeButton, SIGNAL(clicked()), SLOT(insertAttribute()));
|
||||||
connect(m_advancedUi->editAttributeButton, SIGNAL(clicked()), SLOT(editCurrentAttribute()));
|
connect(m_advancedUi->editAttributeButton, SIGNAL(clicked()), SLOT(editCurrentAttribute()));
|
||||||
connect(m_advancedUi->removeAttributeButton, SIGNAL(clicked()), SLOT(removeCurrentAttribute()));
|
connect(m_advancedUi->removeAttributeButton, SIGNAL(clicked()), SLOT(removeCurrentAttribute()));
|
||||||
|
connect(m_advancedUi->protectAttributeButton, SIGNAL(toggled(bool)), SLOT(protectCurrentAttribute(bool)));
|
||||||
|
connect(m_advancedUi->revealAttributeButton, SIGNAL(clicked(bool)), SLOT(revealCurrentAttribute()));
|
||||||
connect(m_advancedUi->attributesView->selectionModel(),
|
connect(m_advancedUi->attributesView->selectionModel(),
|
||||||
SIGNAL(currentChanged(QModelIndex,QModelIndex)),
|
SIGNAL(currentChanged(QModelIndex,QModelIndex)),
|
||||||
SLOT(updateCurrentAttribute()));
|
SLOT(updateCurrentAttribute()));
|
||||||
@ -210,7 +212,7 @@ void EditEntryWidget::emitHistoryEntryActivated(const QModelIndex& index)
|
|||||||
Q_ASSERT(!m_history);
|
Q_ASSERT(!m_history);
|
||||||
|
|
||||||
Entry* entry = m_historyModel->entryFromIndex(index);
|
Entry* entry = m_historyModel->entryFromIndex(index);
|
||||||
Q_EMIT historyEntryActivated(entry);
|
emit historyEntryActivated(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditEntryWidget::histEntryActivated(const QModelIndex& index)
|
void EditEntryWidget::histEntryActivated(const QModelIndex& index)
|
||||||
@ -351,6 +353,11 @@ void EditEntryWidget::setForms(const Entry* entry, bool restore)
|
|||||||
m_advancedUi->attributesEdit->setEnabled(false);
|
m_advancedUi->attributesEdit->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<int> sizes = m_advancedUi->attributesSplitter->sizes();
|
||||||
|
sizes.replace(0, m_advancedUi->attributesSplitter->width() * 0.3);
|
||||||
|
sizes.replace(1, m_advancedUi->attributesSplitter->width() * 0.7);
|
||||||
|
m_advancedUi->attributesSplitter->setSizes(sizes);
|
||||||
|
|
||||||
IconStruct iconStruct;
|
IconStruct iconStruct;
|
||||||
iconStruct.uuid = entry->iconUuid();
|
iconStruct.uuid = entry->iconUuid();
|
||||||
iconStruct.number = entry->iconNumber();
|
iconStruct.number = entry->iconNumber();
|
||||||
@ -400,7 +407,7 @@ void EditEntryWidget::saveEntry()
|
|||||||
if (m_history) {
|
if (m_history) {
|
||||||
clear();
|
clear();
|
||||||
hideMessage();
|
hideMessage();
|
||||||
Q_EMIT editFinished(false);
|
emit editFinished(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,7 +416,7 @@ void EditEntryWidget::saveEntry()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_advancedUi->attributesView->currentIndex().isValid()) {
|
if (m_advancedUi->attributesView->currentIndex().isValid() && m_advancedUi->attributesEdit->isEnabled()) {
|
||||||
QString key = m_attributesModel->keyByIndex(m_advancedUi->attributesView->currentIndex());
|
QString key = m_attributesModel->keyByIndex(m_advancedUi->attributesView->currentIndex());
|
||||||
m_entryAttributes->set(key, m_advancedUi->attributesEdit->toPlainText(),
|
m_entryAttributes->set(key, m_advancedUi->attributesEdit->toPlainText(),
|
||||||
m_entryAttributes->isProtected(key));
|
m_entryAttributes->isProtected(key));
|
||||||
@ -435,7 +442,7 @@ void EditEntryWidget::saveEntry()
|
|||||||
|
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
Q_EMIT editFinished(true);
|
emit editFinished(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditEntryWidget::updateEntryData(Entry* entry) const
|
void EditEntryWidget::updateEntryData(Entry* entry) const
|
||||||
@ -480,7 +487,7 @@ void EditEntryWidget::cancel()
|
|||||||
if (m_history) {
|
if (m_history) {
|
||||||
clear();
|
clear();
|
||||||
hideMessage();
|
hideMessage();
|
||||||
Q_EMIT editFinished(false);
|
emit editFinished(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -491,7 +498,7 @@ void EditEntryWidget::cancel()
|
|||||||
|
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
Q_EMIT editFinished(false);
|
emit editFinished(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditEntryWidget::clear()
|
void EditEntryWidget::clear()
|
||||||
@ -578,47 +585,97 @@ void EditEntryWidget::removeCurrentAttribute()
|
|||||||
QModelIndex index = m_advancedUi->attributesView->currentIndex();
|
QModelIndex index = m_advancedUi->attributesView->currentIndex();
|
||||||
|
|
||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
|
if (MessageBox::question(this, tr("Confirm Remove"), tr("Are you sure you want to remove this attribute?"),
|
||||||
|
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
|
||||||
m_entryAttributes->remove(m_attributesModel->keyByIndex(index));
|
m_entryAttributes->remove(m_attributesModel->keyByIndex(index));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EditEntryWidget::updateCurrentAttribute()
|
void EditEntryWidget::updateCurrentAttribute()
|
||||||
{
|
{
|
||||||
QModelIndex newIndex = m_advancedUi->attributesView->currentIndex();
|
QModelIndex newIndex = m_advancedUi->attributesView->currentIndex();
|
||||||
|
QString newKey = m_attributesModel->keyByIndex(newIndex);
|
||||||
|
|
||||||
if (m_history) {
|
if (!m_history && m_currentAttribute != newIndex) {
|
||||||
if (newIndex.isValid()) {
|
// Save changes to the currently selected attribute if editing is enabled
|
||||||
QString key = m_attributesModel->keyByIndex(newIndex);
|
if (m_currentAttribute.isValid() && m_advancedUi->attributesEdit->isEnabled()) {
|
||||||
m_advancedUi->attributesEdit->setPlainText(m_entryAttributes->value(key));
|
QString currKey = m_attributesModel->keyByIndex(m_currentAttribute);
|
||||||
m_advancedUi->attributesEdit->setEnabled(true);
|
m_entryAttributes->set(currKey, m_advancedUi->attributesEdit->toPlainText(),
|
||||||
|
m_entryAttributes->isProtected(currKey));
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
m_advancedUi->attributesEdit->setPlainText("");
|
|
||||||
m_advancedUi->attributesEdit->setEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (m_currentAttribute != newIndex) {
|
|
||||||
if (m_currentAttribute.isValid()) {
|
|
||||||
QString key = m_attributesModel->keyByIndex(m_currentAttribute);
|
|
||||||
m_entryAttributes->set(key, m_advancedUi->attributesEdit->toPlainText(),
|
|
||||||
m_entryAttributes->isProtected(key));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newIndex.isValid()) {
|
displayAttribute(newIndex, m_entryAttributes->isProtected(newKey));
|
||||||
QString key = m_attributesModel->keyByIndex(newIndex);
|
|
||||||
m_advancedUi->attributesEdit->setPlainText(m_entryAttributes->value(key));
|
|
||||||
m_advancedUi->attributesEdit->setEnabled(true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_advancedUi->attributesEdit->setPlainText("");
|
|
||||||
m_advancedUi->attributesEdit->setEnabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_advancedUi->editAttributeButton->setEnabled(newIndex.isValid());
|
|
||||||
m_advancedUi->removeAttributeButton->setEnabled(newIndex.isValid());
|
|
||||||
m_currentAttribute = newIndex;
|
m_currentAttribute = newIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditEntryWidget::displayAttribute(QModelIndex index, bool showProtected)
|
||||||
|
{
|
||||||
|
// Block signals to prevent extra calls
|
||||||
|
m_advancedUi->protectAttributeButton->blockSignals(true);
|
||||||
|
|
||||||
|
if (index.isValid()) {
|
||||||
|
QString key = m_attributesModel->keyByIndex(index);
|
||||||
|
if (showProtected) {
|
||||||
|
m_advancedUi->attributesEdit->setPlainText(tr("[PROTECTED] Press reveal to view or edit"));
|
||||||
|
m_advancedUi->attributesEdit->setEnabled(false);
|
||||||
|
m_advancedUi->revealAttributeButton->setEnabled(true);
|
||||||
|
m_advancedUi->protectAttributeButton->setChecked(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_advancedUi->attributesEdit->setPlainText(m_entryAttributes->value(key));
|
||||||
|
m_advancedUi->attributesEdit->setEnabled(true);
|
||||||
|
m_advancedUi->revealAttributeButton->setEnabled(false);
|
||||||
|
m_advancedUi->protectAttributeButton->setChecked(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't allow editing in history view
|
||||||
|
m_advancedUi->protectAttributeButton->setEnabled(!m_history);
|
||||||
|
m_advancedUi->editAttributeButton->setEnabled(!m_history);
|
||||||
|
m_advancedUi->removeAttributeButton->setEnabled(!m_history);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_advancedUi->attributesEdit->setPlainText("");
|
||||||
|
m_advancedUi->attributesEdit->setEnabled(false);
|
||||||
|
m_advancedUi->revealAttributeButton->setEnabled(false);
|
||||||
|
m_advancedUi->protectAttributeButton->setChecked(false);
|
||||||
|
m_advancedUi->protectAttributeButton->setEnabled(false);
|
||||||
|
m_advancedUi->editAttributeButton->setEnabled(false);
|
||||||
|
m_advancedUi->removeAttributeButton->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_advancedUi->protectAttributeButton->blockSignals(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void EditEntryWidget::protectCurrentAttribute(bool state)
|
||||||
|
{
|
||||||
|
QModelIndex index = m_advancedUi->attributesView->currentIndex();
|
||||||
|
if (!m_history && index.isValid()) {
|
||||||
|
QString key = m_attributesModel->keyByIndex(index);
|
||||||
|
if (state) {
|
||||||
|
// Save the current text and protect the attribute
|
||||||
|
m_entryAttributes->set(key, m_advancedUi->attributesEdit->toPlainText(), true);
|
||||||
|
} else {
|
||||||
|
// Unprotect the current attribute value (don't save text as it is obscured)
|
||||||
|
m_entryAttributes->set(key, m_entryAttributes->value(key), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display the attribute
|
||||||
|
displayAttribute(index, state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void EditEntryWidget::revealCurrentAttribute()
|
||||||
|
{
|
||||||
|
if (! m_advancedUi->attributesEdit->isEnabled()) {
|
||||||
|
QModelIndex index = m_advancedUi->attributesView->currentIndex();
|
||||||
|
if (index.isValid()) {
|
||||||
|
QString key = m_attributesModel->keyByIndex(index);
|
||||||
|
m_advancedUi->attributesEdit->setPlainText(m_entryAttributes->value(key));
|
||||||
|
m_advancedUi->attributesEdit->setEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -730,9 +787,14 @@ void EditEntryWidget::removeCurrentAttachment()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QMessageBox::StandardButton ans = MessageBox::question(this, tr("Confirm Remove"),
|
||||||
|
tr("Are you sure you want to remove this attachment?"),
|
||||||
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
|
if (ans == QMessageBox::Yes) {
|
||||||
QString key = m_attachmentsModel->keyByIndex(index);
|
QString key = m_attachmentsModel->keyByIndex(index);
|
||||||
m_entryAttachments->remove(key);
|
m_entryAttachments->remove(key);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EditEntryWidget::updateAutoTypeEnabled()
|
void EditEntryWidget::updateAutoTypeEnabled()
|
||||||
{
|
{
|
||||||
|
@ -63,11 +63,11 @@ public:
|
|||||||
void clear();
|
void clear();
|
||||||
bool hasBeenModified() const;
|
bool hasBeenModified() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void editFinished(bool accepted);
|
void editFinished(bool accepted);
|
||||||
void historyEntryActivated(Entry* entry);
|
void historyEntryActivated(Entry* entry);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void saveEntry();
|
void saveEntry();
|
||||||
void cancel();
|
void cancel();
|
||||||
void togglePasswordGeneratorButton(bool checked);
|
void togglePasswordGeneratorButton(bool checked);
|
||||||
@ -76,6 +76,8 @@ private Q_SLOTS:
|
|||||||
void editCurrentAttribute();
|
void editCurrentAttribute();
|
||||||
void removeCurrentAttribute();
|
void removeCurrentAttribute();
|
||||||
void updateCurrentAttribute();
|
void updateCurrentAttribute();
|
||||||
|
void protectCurrentAttribute(bool state);
|
||||||
|
void revealCurrentAttribute();
|
||||||
void insertAttachment();
|
void insertAttachment();
|
||||||
void saveCurrentAttachment();
|
void saveCurrentAttachment();
|
||||||
void openAttachment(const QModelIndex& index);
|
void openAttachment(const QModelIndex& index);
|
||||||
@ -110,6 +112,8 @@ private:
|
|||||||
QMenu* createPresetsMenu();
|
QMenu* createPresetsMenu();
|
||||||
void updateEntryData(Entry* entry) const;
|
void updateEntryData(Entry* entry) const;
|
||||||
|
|
||||||
|
void displayAttribute(QModelIndex index, bool showProtected);
|
||||||
|
|
||||||
Entry* m_entry;
|
Entry* m_entry;
|
||||||
Database* m_database;
|
Database* m_database;
|
||||||
|
|
||||||
|
@ -28,19 +28,50 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Additional attributes</string>
|
<string>Additional attributes</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
|
||||||
<widget class="AttributesListView" name="attributesView"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
|
<widget class="QSplitter" name="attributesSplitter">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="childrenCollapsible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="AttributesListView" name="attributesView">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="sizeAdjustPolicy">
|
||||||
|
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||||
|
</property>
|
||||||
|
<property name="resizeMode">
|
||||||
|
<enum>QListView::Adjust</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
<widget class="QPlainTextEdit" name="attributesEdit">
|
<widget class="QPlainTextEdit" name="attributesEdit">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>170</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="attributesButtonLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="addAttributeButton">
|
<widget class="QPushButton" name="addAttributeButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -48,16 +79,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="editAttributeButton">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Edit</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="removeAttributeButton">
|
<widget class="QPushButton" name="removeAttributeButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -68,6 +89,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="editAttributeButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Edit Name</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -81,6 +112,35 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="protectAttributeButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">margin-left:50%;margin-right:50%</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Protect</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="revealAttributeButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Reveal</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -103,7 +163,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="attachmentsButtonLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="addAttachmentButton">
|
<widget class="QPushButton" name="addAttachmentButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -172,11 +232,12 @@
|
|||||||
<tabstop>attributesView</tabstop>
|
<tabstop>attributesView</tabstop>
|
||||||
<tabstop>attributesEdit</tabstop>
|
<tabstop>attributesEdit</tabstop>
|
||||||
<tabstop>addAttributeButton</tabstop>
|
<tabstop>addAttributeButton</tabstop>
|
||||||
<tabstop>editAttributeButton</tabstop>
|
|
||||||
<tabstop>removeAttributeButton</tabstop>
|
<tabstop>removeAttributeButton</tabstop>
|
||||||
|
<tabstop>editAttributeButton</tabstop>
|
||||||
<tabstop>attachmentsView</tabstop>
|
<tabstop>attachmentsView</tabstop>
|
||||||
<tabstop>addAttachmentButton</tabstop>
|
<tabstop>addAttachmentButton</tabstop>
|
||||||
<tabstop>removeAttachmentButton</tabstop>
|
<tabstop>removeAttachmentButton</tabstop>
|
||||||
|
<tabstop>openAttachmentButton</tabstop>
|
||||||
<tabstop>saveAttachmentButton</tabstop>
|
<tabstop>saveAttachmentButton</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
@ -259,11 +259,6 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
<zorder></zorder>
|
|
||||||
<zorder></zorder>
|
|
||||||
<zorder></zorder>
|
|
||||||
<zorder></zorder>
|
|
||||||
<zorder></zorder>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -97,7 +97,7 @@ QString EntryAttachmentsModel::keyByIndex(const QModelIndex& index) const
|
|||||||
void EntryAttachmentsModel::attachmentChange(const QString& key)
|
void EntryAttachmentsModel::attachmentChange(const QString& key)
|
||||||
{
|
{
|
||||||
int row = m_entryAttachments->keys().indexOf(key);
|
int row = m_entryAttachments->keys().indexOf(key);
|
||||||
Q_EMIT dataChanged(index(row, 0), index(row, columnCount()-1));
|
emit dataChanged(index(row, 0), index(row, columnCount()-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntryAttachmentsModel::attachmentAboutToAdd(const QString& key)
|
void EntryAttachmentsModel::attachmentAboutToAdd(const QString& key)
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||||
QString keyByIndex(const QModelIndex& index) const;
|
QString keyByIndex(const QModelIndex& index) const;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void attachmentChange(const QString& key);
|
void attachmentChange(const QString& key);
|
||||||
void attachmentAboutToAdd(const QString& key);
|
void attachmentAboutToAdd(const QString& key);
|
||||||
void attachmentAdd();
|
void attachmentAdd();
|
||||||
|
@ -147,7 +147,7 @@ void EntryAttributesModel::attributeChange(const QString& key)
|
|||||||
{
|
{
|
||||||
int row = m_attributes.indexOf(key);
|
int row = m_attributes.indexOf(key);
|
||||||
Q_ASSERT(row != -1);
|
Q_ASSERT(row != -1);
|
||||||
Q_EMIT dataChanged(index(row, 0), index(row, columnCount()-1));
|
emit dataChanged(index(row, 0), index(row, columnCount()-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntryAttributesModel::attributeAboutToAdd(const QString& key)
|
void EntryAttributesModel::attributeAboutToAdd(const QString& key)
|
||||||
@ -213,7 +213,7 @@ void EntryAttributesModel::attributeRename(const QString& oldKey, const QString&
|
|||||||
m_nextRenameDataChange = false;
|
m_nextRenameDataChange = false;
|
||||||
|
|
||||||
QModelIndex keyIndex = index(m_attributes.indexOf(newKey), 0);
|
QModelIndex keyIndex = index(m_attributes.indexOf(newKey), 0);
|
||||||
Q_EMIT dataChanged(keyIndex, keyIndex);
|
emit dataChanged(keyIndex, keyIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
QModelIndex indexByKey(const QString& key) const;
|
QModelIndex indexByKey(const QString& key) const;
|
||||||
QString keyByIndex(const QModelIndex& index) const;
|
QString keyByIndex(const QModelIndex& index) const;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void attributeChange(const QString& key);
|
void attributeChange(const QString& key);
|
||||||
void attributeAboutToAdd(const QString& key);
|
void attributeAboutToAdd(const QString& key);
|
||||||
void attributeAdd();
|
void attributeAdd();
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
|
#include <QPalette>
|
||||||
|
|
||||||
#include "core/DatabaseIcons.h"
|
#include "core/DatabaseIcons.h"
|
||||||
#include "core/Entry.h"
|
#include "core/Entry.h"
|
||||||
@ -63,7 +64,7 @@ void EntryModel::setGroup(Group* group)
|
|||||||
makeConnections(group);
|
makeConnections(group);
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
Q_EMIT switchedToGroupMode();
|
emit switchedToGroupMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntryModel::setEntryList(const QList<Entry*>& entries)
|
void EntryModel::setEntryList(const QList<Entry*>& entries)
|
||||||
@ -100,7 +101,7 @@ void EntryModel::setEntryList(const QList<Entry*>& entries)
|
|||||||
}
|
}
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
Q_EMIT switchedToEntryListMode();
|
emit switchedToEntryListMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
int EntryModel::rowCount(const QModelIndex& parent) const
|
int EntryModel::rowCount(const QModelIndex& parent) const
|
||||||
@ -127,8 +128,10 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
Entry* entry = entryFromIndex(index);
|
Entry* entry = entryFromIndex(index);
|
||||||
|
EntryAttributes* attr = entry->attributes();
|
||||||
|
|
||||||
if (role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
|
QString result;
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case ParentGroup:
|
case ParentGroup:
|
||||||
if (entry->group()) {
|
if (entry->group()) {
|
||||||
@ -136,11 +139,23 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Title:
|
case Title:
|
||||||
return entry->title();
|
result = entry->resolvePlaceholder(entry->title());
|
||||||
|
if (attr->isReference(EntryAttributes::TitleKey)) {
|
||||||
|
result.prepend(tr("Ref: ","Reference abbreviation"));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
case Username:
|
case Username:
|
||||||
return entry->username();
|
result = entry->resolvePlaceholder(entry->username());
|
||||||
|
if (attr->isReference(EntryAttributes::UserNameKey)) {
|
||||||
|
result.prepend(tr("Ref: ","Reference abbreviation"));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
case Url:
|
case Url:
|
||||||
return entry->url();
|
result = entry->resolvePlaceholder(entry->url());
|
||||||
|
if (attr->isReference(EntryAttributes::URLKey)) {
|
||||||
|
result.prepend(tr("Ref: ","Reference abbreviation"));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (role == Qt::DecorationRole) {
|
else if (role == Qt::DecorationRole) {
|
||||||
@ -166,6 +181,12 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const
|
|||||||
}
|
}
|
||||||
return font;
|
return font;
|
||||||
}
|
}
|
||||||
|
else if (role == Qt::TextColorRole) {
|
||||||
|
if (entry->hasReferences()) {
|
||||||
|
QPalette p;
|
||||||
|
return QVariant(p.color(QPalette::Active, QPalette::Mid));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@ -294,7 +315,7 @@ void EntryModel::entryRemoved()
|
|||||||
void EntryModel::entryDataChanged(Entry* entry)
|
void EntryModel::entryDataChanged(Entry* entry)
|
||||||
{
|
{
|
||||||
int row = m_entries.indexOf(entry);
|
int row = m_entries.indexOf(entry);
|
||||||
Q_EMIT dataChanged(index(row, 0), index(row, columnCount()-1));
|
emit dataChanged(index(row, 0), index(row, columnCount()-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntryModel::severConnections()
|
void EntryModel::severConnections()
|
||||||
|
@ -52,14 +52,14 @@ public:
|
|||||||
|
|
||||||
void setEntryList(const QList<Entry*>& entries);
|
void setEntryList(const QList<Entry*>& entries);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void switchedToEntryListMode();
|
void switchedToEntryListMode();
|
||||||
void switchedToGroupMode();
|
void switchedToGroupMode();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void setGroup(Group* group);
|
void setGroup(Group* group);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void entryAboutToAdd(Entry* entry);
|
void entryAboutToAdd(Entry* entry);
|
||||||
void entryAdded(Entry* entry);
|
void entryAdded(Entry* entry);
|
||||||
void entryAboutToRemove(Entry* entry);
|
void entryAboutToRemove(Entry* entry);
|
||||||
|
@ -57,7 +57,7 @@ void EntryView::keyPressEvent(QKeyEvent* event)
|
|||||||
emitEntryActivated(currentIndex());
|
emitEntryActivated(currentIndex());
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
// Pressing return does not emit the QTreeView::activated signal on mac os
|
// Pressing return does not emit the QTreeView::activated signal on mac os
|
||||||
Q_EMIT activated(currentIndex());
|
emit activated(currentIndex());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ void EntryView::setFirstEntryActive()
|
|||||||
setCurrentEntry(m_model->entryFromIndex(index));
|
setCurrentEntry(m_model->entryFromIndex(index));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Q_EMIT entrySelectionChanged();
|
emit entrySelectionChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ void EntryView::emitEntryActivated(const QModelIndex& index)
|
|||||||
{
|
{
|
||||||
Entry* entry = entryFromIndex(index);
|
Entry* entry = entryFromIndex(index);
|
||||||
|
|
||||||
Q_EMIT entryActivated(entry, static_cast<EntryModel::ModelColumn>(m_sortModel->mapToSource(index).column()));
|
emit entryActivated(entry, static_cast<EntryModel::ModelColumn>(m_sortModel->mapToSource(index).column()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntryView::setModel(QAbstractItemModel* model)
|
void EntryView::setModel(QAbstractItemModel* model)
|
||||||
|
@ -42,17 +42,17 @@ public:
|
|||||||
int numberOfSelectedEntries();
|
int numberOfSelectedEntries();
|
||||||
void setFirstEntryActive();
|
void setFirstEntryActive();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void setGroup(Group* group);
|
void setGroup(Group* group);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void entryActivated(Entry* entry, EntryModel::ModelColumn column);
|
void entryActivated(Entry* entry, EntryModel::ModelColumn column);
|
||||||
void entrySelectionChanged();
|
void entrySelectionChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void keyPressEvent(QKeyEvent* event) override;
|
void keyPressEvent(QKeyEvent* event) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void emitEntryActivated(const QModelIndex& index);
|
void emitEntryActivated(const QModelIndex& index);
|
||||||
void switchToEntryListMode();
|
void switchToEntryListMode();
|
||||||
void switchToGroupMode();
|
void switchToGroupMode();
|
||||||
|
@ -130,7 +130,7 @@ void EditGroupWidget::save()
|
|||||||
}
|
}
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
Q_EMIT editFinished(true);
|
emit editFinished(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditGroupWidget::cancel()
|
void EditGroupWidget::cancel()
|
||||||
@ -141,7 +141,7 @@ void EditGroupWidget::cancel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
Q_EMIT editFinished(false);
|
emit editFinished(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditGroupWidget::clear()
|
void EditGroupWidget::clear()
|
||||||
|
@ -43,12 +43,12 @@ public:
|
|||||||
void loadGroup(Group* group, bool create, Database* database);
|
void loadGroup(Group* group, bool create, Database* database);
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void editFinished(bool accepted);
|
void editFinished(bool accepted);
|
||||||
void messageEditEntry(QString, MessageWidget::MessageType);
|
void messageEditEntry(QString, MessageWidget::MessageType);
|
||||||
void messageEditEntryDismiss();
|
void messageEditEntryDismiss();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void save();
|
void save();
|
||||||
void cancel();
|
void cancel();
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ QMimeData* GroupModel::mimeData(const QModelIndexList& indexes) const
|
|||||||
void GroupModel::groupDataChanged(Group* group)
|
void GroupModel::groupDataChanged(Group* group)
|
||||||
{
|
{
|
||||||
QModelIndex ix = index(group);
|
QModelIndex ix = index(group);
|
||||||
Q_EMIT dataChanged(ix, ix);
|
emit dataChanged(ix, ix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupModel::groupAboutToRemove(Group* group)
|
void GroupModel::groupAboutToRemove(Group* group)
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QModelIndex parent(Group* group) const;
|
QModelIndex parent(Group* group) const;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void groupDataChanged(Group* group);
|
void groupDataChanged(Group* group);
|
||||||
void groupAboutToRemove(Group* group);
|
void groupAboutToRemove(Group* group);
|
||||||
void groupRemoved();
|
void groupRemoved();
|
||||||
|
@ -112,7 +112,7 @@ void GroupView::expandGroup(Group* group, bool expand)
|
|||||||
|
|
||||||
void GroupView::emitGroupChanged(const QModelIndex& index)
|
void GroupView::emitGroupChanged(const QModelIndex& index)
|
||||||
{
|
{
|
||||||
Q_EMIT groupChanged(m_model->groupFromIndex(index));
|
emit groupChanged(m_model->groupFromIndex(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupView::setModel(QAbstractItemModel* model)
|
void GroupView::setModel(QAbstractItemModel* model)
|
||||||
@ -123,7 +123,7 @@ void GroupView::setModel(QAbstractItemModel* model)
|
|||||||
|
|
||||||
void GroupView::emitGroupChanged()
|
void GroupView::emitGroupChanged()
|
||||||
{
|
{
|
||||||
Q_EMIT groupChanged(currentGroup());
|
emit groupChanged(currentGroup());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupView::syncExpandedState(const QModelIndex& parent, int start, int end)
|
void GroupView::syncExpandedState(const QModelIndex& parent, int start, int end)
|
||||||
|
@ -36,10 +36,10 @@ public:
|
|||||||
void setCurrentGroup(Group* group);
|
void setCurrentGroup(Group* group);
|
||||||
void expandGroup(Group* group, bool expand = true);
|
void expandGroup(Group* group, bool expand = true);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void groupChanged(Group* group);
|
void groupChanged(Group* group);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void expandedChanged(const QModelIndex& index);
|
void expandedChanged(const QModelIndex& index);
|
||||||
void emitGroupChanged(const QModelIndex& index);
|
void emitGroupChanged(const QModelIndex& index);
|
||||||
void emitGroupChanged();
|
void emitGroupChanged();
|
||||||
|
@ -36,9 +36,10 @@ void AccessControlDialog::setUrl(const QString &url)
|
|||||||
|
|
||||||
void AccessControlDialog::setItems(const QList<Entry*> &items)
|
void AccessControlDialog::setItems(const QList<Entry*> &items)
|
||||||
{
|
{
|
||||||
Q_FOREACH (Entry * entry, items)
|
for (Entry* entry: items) {
|
||||||
ui->itemsList->addItem(entry->title() + " - " + entry->username());
|
ui->itemsList->addItem(entry->title() + " - " + entry->username());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool AccessControlDialog::remember() const
|
bool AccessControlDialog::remember() const
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
void saveSettings();
|
void saveSettings();
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void sliderMoved();
|
void sliderMoved();
|
||||||
void spinBoxChanged();
|
void spinBoxChanged();
|
||||||
|
|
||||||
|
@ -29,11 +29,11 @@ public:
|
|||||||
explicit OptionDialog(QWidget *parent = nullptr);
|
explicit OptionDialog(QWidget *parent = nullptr);
|
||||||
~OptionDialog();
|
~OptionDialog();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
void saveSettings();
|
void saveSettings();
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void removeSharedEncryptionKeys();
|
void removeSharedEncryptionKeys();
|
||||||
void removeStoredPermissions();
|
void removeStoredPermissions();
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "crypto/Random.h"
|
#include "crypto/Random.h"
|
||||||
#include "crypto/SymmetricCipher.h"
|
#include "crypto/SymmetricCipher.h"
|
||||||
#include "crypto/SymmetricCipherGcrypt.h"
|
#include "crypto/SymmetricCipherGcrypt.h"
|
||||||
|
#include "core/Global.h"
|
||||||
|
|
||||||
namespace KeepassHttpProtocol
|
namespace KeepassHttpProtocol
|
||||||
{
|
{
|
||||||
@ -370,8 +371,9 @@ QVariant Response::getEntries() const
|
|||||||
|
|
||||||
QList<QVariant> res;
|
QList<QVariant> res;
|
||||||
res.reserve(m_entries.size());
|
res.reserve(m_entries.size());
|
||||||
Q_FOREACH (const Entry &entry, m_entries)
|
for (const Entry& entry: asConst(m_entries)) {
|
||||||
res.append(qobject2qvariant(&entry));
|
res.append(qobject2qvariant(&entry));
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -383,14 +385,16 @@ void Response::setEntries(const QList<Entry> &entries)
|
|||||||
|
|
||||||
QList<Entry> encryptedEntries;
|
QList<Entry> encryptedEntries;
|
||||||
encryptedEntries.reserve(m_count);
|
encryptedEntries.reserve(m_count);
|
||||||
Q_FOREACH (const Entry &entry, entries) {
|
for (const Entry& entry: entries) {
|
||||||
Entry encryptedEntry(encrypt(entry.name(), m_cipher),
|
Entry encryptedEntry(encrypt(entry.name(), m_cipher),
|
||||||
encrypt(entry.login(), m_cipher),
|
encrypt(entry.login(), m_cipher),
|
||||||
entry.password().isNull() ? QString() : encrypt(entry.password(), m_cipher),
|
entry.password().isNull() ? QString() : encrypt(entry.password(), m_cipher),
|
||||||
encrypt(entry.uuid(), m_cipher));
|
encrypt(entry.uuid(), m_cipher));
|
||||||
Q_FOREACH (const StringField & field, entry.stringFields())
|
const auto stringFields = entry.stringFields();
|
||||||
|
for (const StringField& field: stringFields) {
|
||||||
encryptedEntry.addStringField(encrypt(field.key(), m_cipher),
|
encryptedEntry.addStringField(encrypt(field.key(), m_cipher),
|
||||||
encrypt(field.value(), m_cipher));
|
encrypt(field.value(), m_cipher));
|
||||||
|
}
|
||||||
encryptedEntries << encryptedEntry;
|
encryptedEntries << encryptedEntry;
|
||||||
}
|
}
|
||||||
m_entries = encryptedEntries;
|
m_entries = encryptedEntries;
|
||||||
@ -508,8 +512,9 @@ QVariant Entry::getStringFields() const
|
|||||||
|
|
||||||
QList<QVariant> res;
|
QList<QVariant> res;
|
||||||
res.reserve(m_stringFields.size());
|
res.reserve(m_stringFields.size());
|
||||||
Q_FOREACH (const StringField &stringfield, m_stringFields)
|
for (const StringField& stringfield: asConst(m_stringFields)) {
|
||||||
res.append(qobject2qvariant(&stringfield));
|
res.append(qobject2qvariant(&stringfield));
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,12 +23,15 @@
|
|||||||
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "core/Entry.h"
|
#include "core/Entry.h"
|
||||||
|
#include "core/Global.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
#include "core/EntrySearcher.h"
|
#include "core/EntrySearcher.h"
|
||||||
#include "core/Metadata.h"
|
#include "core/Metadata.h"
|
||||||
#include "core/Uuid.h"
|
#include "core/Uuid.h"
|
||||||
#include "core/PasswordGenerator.h"
|
#include "core/PasswordGenerator.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
static const unsigned char KEEPASSHTTP_UUID_DATA[] = {
|
static const unsigned char KEEPASSHTTP_UUID_DATA[] = {
|
||||||
0x34, 0x69, 0x7a, 0x40, 0x8a, 0x5b, 0x41, 0xc0,
|
0x34, 0x69, 0x7a, 0x40, 0x8a, 0x5b, 0x41, 0xc0,
|
||||||
0x9f, 0x36, 0x89, 0x7d, 0x62, 0x3e, 0xcb, 0x31
|
0x9f, 0x36, 0x89, 0x7d, 0x62, 0x3e, 0xcb, 0x31
|
||||||
@ -187,8 +190,9 @@ bool Service::removeFirstDomain(QString & hostname)
|
|||||||
QList<Entry*> Service::searchEntries(Database* db, const QString& hostname)
|
QList<Entry*> Service::searchEntries(Database* db, const QString& hostname)
|
||||||
{
|
{
|
||||||
QList<Entry*> entries;
|
QList<Entry*> entries;
|
||||||
if (Group* rootGroup = db->rootGroup())
|
if (Group* rootGroup = db->rootGroup()) {
|
||||||
Q_FOREACH (Entry* entry, EntrySearcher().search(hostname, rootGroup, Qt::CaseInsensitive)) {
|
const auto results = EntrySearcher().search(hostname, rootGroup, Qt::CaseInsensitive);
|
||||||
|
for (Entry* entry: results) {
|
||||||
QString title = entry->title();
|
QString title = entry->title();
|
||||||
QString url = entry->url();
|
QString url = entry->url();
|
||||||
|
|
||||||
@ -199,6 +203,7 @@ QList<Entry*> Service::searchEntries(Database* db, const QString& hostname)
|
|||||||
|| (matchUrlScheme(url) && hostname.endsWith(QUrl(url).host())) )
|
|| (matchUrlScheme(url) && hostname.endsWith(QUrl(url).host())) )
|
||||||
entries.append(entry);
|
entries.append(entry);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,8 +226,9 @@ QList<Entry*> Service::searchEntries(const QString& text)
|
|||||||
QString hostname = QUrl(text).host();
|
QString hostname = QUrl(text).host();
|
||||||
QList<Entry*> entries;
|
QList<Entry*> entries;
|
||||||
do {
|
do {
|
||||||
Q_FOREACH (Database* db, databases)
|
for (Database* db: asConst(databases)) {
|
||||||
entries << searchEntries(db, hostname);
|
entries << searchEntries(db, hostname);
|
||||||
|
}
|
||||||
} while(entries.isEmpty() && removeFirstDomain(hostname));
|
} while(entries.isEmpty() && removeFirstDomain(hostname));
|
||||||
|
|
||||||
return entries;
|
return entries;
|
||||||
@ -247,10 +253,13 @@ KeepassHttpProtocol::Entry Service::prepareEntry(const Entry* entry)
|
|||||||
KeepassHttpProtocol::Entry res(entry->resolvePlaceholder(entry->title()), entry->resolvePlaceholder(entry->username()), entry->resolvePlaceholder(entry->password()), entry->uuid().toHex());
|
KeepassHttpProtocol::Entry res(entry->resolvePlaceholder(entry->title()), entry->resolvePlaceholder(entry->username()), entry->resolvePlaceholder(entry->password()), entry->uuid().toHex());
|
||||||
if (HttpSettings::supportKphFields()) {
|
if (HttpSettings::supportKphFields()) {
|
||||||
const EntryAttributes * attr = entry->attributes();
|
const EntryAttributes * attr = entry->attributes();
|
||||||
Q_FOREACH (const QString& key, attr->keys())
|
const auto keys = attr->keys();
|
||||||
if (key.startsWith(QLatin1String("KPH: ")))
|
for (const QString& key: keys) {
|
||||||
|
if (key.startsWith(QLatin1String("KPH: "))) {
|
||||||
res.addStringField(key, attr->value(key));
|
res.addStringField(key, attr->value(key));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,7 +325,8 @@ QList<KeepassHttpProtocol::Entry> Service::findMatchingEntries(const QString& /*
|
|||||||
//Check entries for authorization
|
//Check entries for authorization
|
||||||
QList<Entry*> pwEntriesToConfirm;
|
QList<Entry*> pwEntriesToConfirm;
|
||||||
QList<Entry*> pwEntries;
|
QList<Entry*> pwEntries;
|
||||||
Q_FOREACH (Entry * entry, searchEntries(url)) {
|
const auto entries = searchEntries(url);
|
||||||
|
for (Entry* entry: entries) {
|
||||||
switch(checkAccess(entry, host, submitHost, realm)) {
|
switch(checkAccess(entry, host, submitHost, realm)) {
|
||||||
case Denied:
|
case Denied:
|
||||||
continue;
|
continue;
|
||||||
@ -350,7 +360,7 @@ QList<KeepassHttpProtocol::Entry> Service::findMatchingEntries(const QString& /*
|
|||||||
|
|
||||||
int res = dlg.exec();
|
int res = dlg.exec();
|
||||||
if (dlg.remember()) {
|
if (dlg.remember()) {
|
||||||
Q_FOREACH (Entry * entry, pwEntriesToConfirm) {
|
for (Entry* entry: asConst(pwEntriesToConfirm)) {
|
||||||
EntryConfig config;
|
EntryConfig config;
|
||||||
config.load(entry);
|
config.load(entry);
|
||||||
if (res == QDialog::Accepted) {
|
if (res == QDialog::Accepted) {
|
||||||
@ -383,26 +393,20 @@ QList<KeepassHttpProtocol::Entry> Service::findMatchingEntries(const QString& /*
|
|||||||
//Cache priorities
|
//Cache priorities
|
||||||
QHash<const Entry*, int> priorities;
|
QHash<const Entry*, int> priorities;
|
||||||
priorities.reserve(pwEntries.size());
|
priorities.reserve(pwEntries.size());
|
||||||
Q_FOREACH (const Entry * entry, pwEntries)
|
for (const Entry* entry: asConst(pwEntries)) {
|
||||||
priorities.insert(entry, sortPriority(entry, host, submitUrl, baseSubmitURL));
|
priorities.insert(entry, sortPriority(entry, host, submitUrl, baseSubmitURL));
|
||||||
|
|
||||||
//Sort by priorities
|
|
||||||
qSort(pwEntries.begin(), pwEntries.end(), SortEntries(priorities, HttpSettings::sortByTitle() ? "Title" : "UserName"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (pwEntries.count() > 0)
|
//Sort by priorities
|
||||||
//{
|
std::sort(pwEntries.begin(), pwEntries.end(), SortEntries(priorities, HttpSettings::sortByTitle() ? "Title" : "UserName"));
|
||||||
// var names = (from e in resp.Entries select e.Name).Distinct<string>();
|
}
|
||||||
// var n = String.Join("\n ", names.ToArray<string>());
|
|
||||||
// if (HttpSettings::receiveCredentialNotification())
|
|
||||||
// ShowNotification(QString("%0: %1 is receiving credentials for:\n%2").arg(Id).arg(host).arg(n)));
|
|
||||||
//}
|
|
||||||
|
|
||||||
//Fill the list
|
//Fill the list
|
||||||
QList<KeepassHttpProtocol::Entry> result;
|
QList<KeepassHttpProtocol::Entry> result;
|
||||||
result.reserve(pwEntries.count());
|
result.reserve(pwEntries.count());
|
||||||
Q_FOREACH (Entry * entry, pwEntries)
|
for (Entry* entry: asConst(pwEntries)) {
|
||||||
result << prepareEntry(entry);
|
result << prepareEntry(entry);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,12 +418,19 @@ int Service::countMatchingEntries(const QString &, const QString &url, const QSt
|
|||||||
QList<KeepassHttpProtocol::Entry> Service::searchAllEntries(const QString &)
|
QList<KeepassHttpProtocol::Entry> Service::searchAllEntries(const QString &)
|
||||||
{
|
{
|
||||||
QList<KeepassHttpProtocol::Entry> result;
|
QList<KeepassHttpProtocol::Entry> result;
|
||||||
if (DatabaseWidget * dbWidget = m_dbTabWidget->currentDatabaseWidget())
|
if (DatabaseWidget* dbWidget = m_dbTabWidget->currentDatabaseWidget()) {
|
||||||
if (Database * db = dbWidget->database())
|
if (Database* db = dbWidget->database()) {
|
||||||
if (Group * rootGroup = db->rootGroup())
|
if (Group* rootGroup = db->rootGroup()) {
|
||||||
Q_FOREACH (Entry * entry, rootGroup->entriesRecursive())
|
const auto entries = rootGroup->entriesRecursive();
|
||||||
if (!entry->url().isEmpty() || QUrl(entry->title()).isValid())
|
for (Entry* entry: entries) {
|
||||||
result << KeepassHttpProtocol::Entry(entry->title(), entry->username(), QString(), entry->uuid().toHex());
|
if (!entry->url().isEmpty() || QUrl(entry->title()).isValid()) {
|
||||||
|
result << KeepassHttpProtocol::Entry(entry->title(), entry->username(),
|
||||||
|
QString(), entry->uuid().toHex());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,11 +439,15 @@ Group * Service::findCreateAddEntryGroup()
|
|||||||
if (DatabaseWidget * dbWidget = m_dbTabWidget->currentDatabaseWidget())
|
if (DatabaseWidget * dbWidget = m_dbTabWidget->currentDatabaseWidget())
|
||||||
if (Database * db = dbWidget->database())
|
if (Database * db = dbWidget->database())
|
||||||
if (Group * rootGroup = db->rootGroup()) {
|
if (Group * rootGroup = db->rootGroup()) {
|
||||||
const QString groupName = QLatin1String(KEEPASSHTTP_GROUP_NAME);//TODO: setting to decide where new keys are created
|
//TODO: setting to decide where new keys are created
|
||||||
|
const QString groupName = QLatin1String(KEEPASSHTTP_GROUP_NAME);
|
||||||
|
|
||||||
Q_FOREACH (const Group * g, rootGroup->groupsRecursive(true))
|
const auto groups = rootGroup->groupsRecursive(true);
|
||||||
if (g->name() == groupName)
|
for (const Group * g: groups) {
|
||||||
|
if (g->name() == groupName) {
|
||||||
return db->resolveGroup(g->uuid());
|
return db->resolveGroup(g->uuid());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Group * group;
|
Group * group;
|
||||||
group = new Group();
|
group = new Group();
|
||||||
@ -505,14 +520,18 @@ void Service::removeSharedEncryptionKeys()
|
|||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
} else if (Entry* entry = getConfigEntry()) {
|
} else if (Entry* entry = getConfigEntry()) {
|
||||||
QStringList keysToRemove;
|
QStringList keysToRemove;
|
||||||
Q_FOREACH (const QString& key, entry->attributes()->keys())
|
const auto keys = entry->attributes()->keys();
|
||||||
if (key.startsWith(ASSOCIATE_KEY_PREFIX))
|
for (const QString& key: keys) {
|
||||||
|
if (key.startsWith(ASSOCIATE_KEY_PREFIX)) {
|
||||||
keysToRemove << key;
|
keysToRemove << key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(keysToRemove.count()) {
|
if(keysToRemove.count()) {
|
||||||
entry->beginUpdate();
|
entry->beginUpdate();
|
||||||
Q_FOREACH (const QString& key, keysToRemove)
|
for (const QString& key: asConst(keysToRemove)) {
|
||||||
entry->attributes()->remove(key);
|
entry->attributes()->remove(key);
|
||||||
|
}
|
||||||
entry->endUpdate();
|
entry->endUpdate();
|
||||||
|
|
||||||
const int count = keysToRemove.count();
|
const int count = keysToRemove.count();
|
||||||
@ -546,7 +565,7 @@ void Service::removeStoredPermissions()
|
|||||||
progress.setWindowModality(Qt::WindowModal);
|
progress.setWindowModality(Qt::WindowModal);
|
||||||
|
|
||||||
uint counter = 0;
|
uint counter = 0;
|
||||||
Q_FOREACH (Entry* entry, entries) {
|
for (Entry* entry: asConst(entries)) {
|
||||||
if (progress.wasCanceled())
|
if (progress.wasCanceled())
|
||||||
return;
|
return;
|
||||||
if (entry->attributes()->contains(KEEPASSHTTP_NAME)) {
|
if (entry->attributes()->contains(KEEPASSHTTP_NAME)) {
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
virtual void updateEntry(const QString& id, const QString& uuid, const QString& login, const QString& password, const QString& url);
|
virtual void updateEntry(const QString& id, const QString& uuid, const QString& login, const QString& password, const QString& url);
|
||||||
virtual QString generatePassword();
|
virtual QString generatePassword();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public slots:
|
||||||
void removeSharedEncryptionKeys();
|
void removeSharedEncryptionKeys();
|
||||||
void removeStoredPermissions();
|
void removeStoredPermissions();
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ protected:
|
|||||||
|
|
||||||
QIODevice* const m_baseDevice;
|
QIODevice* const m_baseDevice;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void closeStream();
|
void closeStream();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/**********************************************************************************
|
/**********************************************************************************
|
||||||
* C implementation of the zxcvbn password strength estimation method.
|
* C implementation of the zxcvbn password strength estimation method.
|
||||||
* Copyright (c) 2015, Tony Evans
|
* Copyright (c) 2015, Tony Evans
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef ZXCVBN_H_F98183CE2A01_INCLUDED
|
#ifndef ZXCVBN_H_F98183CE2A01_INCLUDED
|
||||||
#define ZXCVBN_H_F98183CE2A01_INCLUDED
|
#define ZXCVBN_H_F98183CE2A01_INCLUDED
|
||||||
/**********************************************************************************
|
/**********************************************************************************
|
||||||
* C implementation of the zxcvbn password strength estimation method.
|
* C implementation of the zxcvbn password strength estimation method.
|
||||||
|
@ -31,7 +31,7 @@ class TestAutoType : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
void init();
|
void init();
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
@ -24,7 +24,7 @@ class TestCryptoHash : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
@ -31,7 +31,7 @@ class TestCsvExporter : public QObject
|
|||||||
public:
|
public:
|
||||||
static const QString ExpectedHeaderLine;
|
static const QString ExpectedHeaderLine;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void init();
|
void init();
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
@ -29,7 +29,7 @@ class TestDeletedObjects : public QObject
|
|||||||
private:
|
private:
|
||||||
void createAndDelete(Database* db, int delObjectsSize);
|
void createAndDelete(Database* db, int delObjectsSize);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
void testDeletedObjectsFromFile();
|
void testDeletedObjectsFromFile();
|
||||||
void testDeletedObjectsFromNewDb();
|
void testDeletedObjectsFromNewDb();
|
||||||
|
@ -26,7 +26,7 @@ class TestEntry : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
void testHistoryItemDeletion();
|
void testHistoryItemDeletion();
|
||||||
void testCopyDataFrom();
|
void testCopyDataFrom();
|
||||||
|
@ -181,6 +181,12 @@ void TestEntryModel::testAttributesModel()
|
|||||||
QCOMPARE(spyAboutToRemove.count(), 1);
|
QCOMPARE(spyAboutToRemove.count(), 1);
|
||||||
QCOMPARE(spyRemoved.count(), 1);
|
QCOMPARE(spyRemoved.count(), 1);
|
||||||
|
|
||||||
|
// test attribute protection
|
||||||
|
QString value = entryAttributes->value("2nd");
|
||||||
|
entryAttributes->set("2nd", value, true);
|
||||||
|
QVERIFY(entryAttributes->isProtected("2nd"));
|
||||||
|
QCOMPARE(entryAttributes->value("2nd"), value);
|
||||||
|
|
||||||
QSignalSpy spyReset(model, SIGNAL(modelReset()));
|
QSignalSpy spyReset(model, SIGNAL(modelReset()));
|
||||||
entryAttributes->clear();
|
entryAttributes->clear();
|
||||||
model->setEntryAttributes(0);
|
model->setEntryAttributes(0);
|
||||||
|
@ -24,7 +24,7 @@ class TestEntryModel : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
void test();
|
void test();
|
||||||
void testAttachmentsModel();
|
void testAttachmentsModel();
|
||||||
|
@ -28,7 +28,7 @@ class TestEntrySearcher : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private slots:
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
void cleanupTestCase();
|
void cleanupTestCase();
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user