From 2866bc626a02f7d0f2943dad3725200f318850cf Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Wed, 20 Dec 2017 09:58:02 -0500 Subject: [PATCH] Removed dead code --- src/CMakeLists.txt | 1 - src/core/Database.cpp | 6 ------ src/core/Database.h | 1 - src/core/ToDbExporter.cpp | 39 --------------------------------------- src/core/ToDbExporter.h | 33 --------------------------------- 5 files changed, 80 deletions(-) delete mode 100644 src/core/ToDbExporter.cpp delete mode 100644 src/core/ToDbExporter.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1908cea09..c04d7110f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -62,7 +62,6 @@ set(keepassx_SOURCES core/ScreenLockListenerPrivate.cpp core/TimeDelta.cpp core/TimeInfo.cpp - core/ToDbExporter.cpp core/Tools.cpp core/Translator.cpp core/Uuid.cpp diff --git a/src/core/Database.cpp b/src/core/Database.cpp index 3aeaa3d26..2f2f2967d 100644 --- a/src/core/Database.cpp +++ b/src/core/Database.cpp @@ -374,12 +374,6 @@ void Database::setEmitModified(bool value) m_emitModified = value; } -void Database::copyAttributesFrom(const Database* other) -{ - m_data = other->m_data; - m_data.kdf = m_data.kdf->clone(); - m_metadata->copyAttributesFrom(other->m_metadata); -} Uuid Database::uuid() { diff --git a/src/core/Database.h b/src/core/Database.h index c199069d3..b293c760d 100644 --- a/src/core/Database.h +++ b/src/core/Database.h @@ -107,7 +107,6 @@ public: void recycleGroup(Group* group); void emptyRecycleBin(); void setEmitModified(bool value); - void copyAttributesFrom(const Database* other); void merge(const Database* other); QString saveToFile(QString filePath); diff --git a/src/core/ToDbExporter.cpp b/src/core/ToDbExporter.cpp deleted file mode 100644 index 1f76fb744..000000000 --- a/src/core/ToDbExporter.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2014 Felix Geyer - * Copyright (C) 2014 Florian Geyer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 or (at your option) - * version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "ToDbExporter.h" -#include "core/Database.h" -#include "core/Group.h" -#include "core/Metadata.h" - -Database* ToDbExporter::exportGroup(Group* group) -{ - Database* oldDb = group->database(); - Q_ASSERT(oldDb); - - Database* db = new Database(); - Group* clonedGroup = group->clone(Entry::CloneNewUuid | Entry::CloneIncludeHistory); - clonedGroup->setParent(db->rootGroup()); - - QSet customIcons = group->customIconsRecursive(); - db->metadata()->copyCustomIcons(customIcons, oldDb->metadata()); - - db->copyAttributesFrom(oldDb); - - return db; -} diff --git a/src/core/ToDbExporter.h b/src/core/ToDbExporter.h deleted file mode 100644 index 58c5efeb3..000000000 --- a/src/core/ToDbExporter.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2014 Felix Geyer - * Copyright (C) 2014 Florian Geyer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 or (at your option) - * version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef KEEPASSX_TODBEXPORTER_H -#define KEEPASSX_TODBEXPORTER_H - -#include "core/Exporter.h" - -class Database; -class Group; - -class ToDbExporter : Exporter -{ -public: - Database* exportGroup(Group* group); -}; - -#endif // KEEPASSX_TODBEXPORTER_H