diff --git a/bin/test/data/log/test_log.txt b/bin/test/data/log/test_log.txt index 75d76378..e1103410 100644 --- a/bin/test/data/log/test_log.txt +++ b/bin/test/data/log/test_log.txt @@ -1,50 +1,6 @@ -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml Token.cpp ERROR: Location Id was not referenced by this Token. Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class Edge.cpp ERROR: Nodes are not plain copies. - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc - INFO: Indexer - indexing source file: input.cc INFO: send MessageStatus Enabled console and file logging. INFO: send TestMessage INFO: send TestMessage @@ -73,3 +29,46 @@ TextAccess.cpp WARNING: Line numbers start with one, is 0 TextAccess.cpp WARNING: Line numbers start with one, is 0 TokenLocationCollection.cpp ERROR: TokenLocation has wrong boundaries: file.c 2:3 2:1 TokenLocationCollection.cpp ERROR: TokenLocation has wrong boundaries: file.c 4:1 1:10 + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc + INFO: Indexer - indexing source file: input.cc diff --git a/src/lib/data/SqliteStorage.cpp b/src/lib/data/SqliteStorage.cpp index 1f5053e0..a0e38315 100644 --- a/src/lib/data/SqliteStorage.cpp +++ b/src/lib/data/SqliteStorage.cpp @@ -9,7 +9,7 @@ #include "utility/text/TextAccess.h" #include "utility/Version.h" -const size_t SqliteStorage::STORAGE_VERSION = 8; +const size_t SqliteStorage::STORAGE_VERSION = 9; SqliteStorage::SqliteStorage(const FilePath& dbFilePath) : m_dbFilePath(dbFilePath.canonical()) @@ -340,35 +340,6 @@ Id SqliteStorage::addNodeBookmark(const NodeBookmark& bookmark) /*tokenName = utility::replace(tokenName, "\\", "/"); comment = utility::replace(comment, "\\", "/");*/ - // for backwards compatibility - m_database.execDML( - "CREATE TABLE IF NOT EXISTS nodeBookmark(" - "id INTEGER NOT NULL, " - "name TEXT, " - "comment TEXT, " - "timestamp TEXT, " - "category INTEGER, " - "PRIMARY KEY(id), " - "FOREIGN KEY(category) REFERENCES bookmarkCategory(id));" - ); - - m_database.execDML( - "CREATE TABLE IF NOT EXISTS nodeBookmarkToken(" - "id INTEGER NOT NULL, " - "bookmarkId INTEGER NOT NULL, " - "name TEXT, " - "type INTEGER, " - "PRIMARY KEY(id), " - "FOREIGN KEY(bookmarkId) REFERENCES nodeBookmark(id) ON DELETE CASCADE);" - ); - - m_database.execDML( - "CREATE TABLE IF NOT EXISTS bookmarkCategory(" - "id INTEGER NOT NULL, " - "name TEXT, " - "PRIMARY KEY(id));" - ); - std::string statement = "INSERT INTO nodeBookmark(name, comment, timestamp, category) " "VALUES (?, ?, ?, ?);"; @@ -397,7 +368,7 @@ Id SqliteStorage::addNodeBookmark(const NodeBookmark& bookmark) stmt.execDML(); } - + return id; } @@ -410,46 +381,6 @@ Id SqliteStorage::addEdgeBookmark(const EdgeBookmark& bookmark) tokenName = utility::replace(tokenName, "'", "''"); comment = utility::replace(comment, "'", "''"); - // for backwards compatibility - m_database.execDML( - "CREATE TABLE IF NOT EXISTS edgeBookmark(" - "id INTEGER NOT NULL, " - "name TEXT, " - "comment TEXT, " - "timestamp TEXT, " - "category INTEGER, " - "PRIMARY KEY(id), " - "FOREIGN KEY(category) REFERENCES bookmarkCategory(id));" - ); - - m_database.execDML( - "CREATE TABLE IF NOT EXISTS edgeBookmarkToken(" - "id INTEGER NOT NULL, " - "bookmarkId INTEGER NOT NULL, " - "name TEXT, " - "type INTEGER, " - "PRIMARY KEY(id), " - "FOREIGN KEY(bookmarkId) REFERENCES edgeBookmark(id) ON DELETE CASCADE);" - ); - - m_database.execDML( - "CREATE TABLE IF NOT EXISTS edgeBaseBookmark(" - "id INTEGER NOT NULL, " - "edgeId INTEGER, " - "PRIMARY KEY(id), " - "FOREIGN KEY(edgeId) REFERENCES edgeBookmark(id) ON DELETE CASCADE);" - ); - - m_database.execDML( - "CREATE TABLE IF NOT EXISTS edgeBaseBookmarkToken(" - "id INTEGER NOT NULL, " - "bookmarkId INTEGER NOT NULL, " - "name TEXT, " - "type INTEGER, " - "PRIMARY KEY(id), " - "FOREIGN KEY(bookmarkId) REFERENCES edgeBaseBookmark(id) ON DELETE CASCADE);" - ); - std::string statement = "INSERT INTO edgeBookmark(name, comment, timestamp, category) " "VALUES (?, ?, ?, ?);"; @@ -487,9 +418,6 @@ Id SqliteStorage::addEdgeBookmark(const EdgeBookmark& bookmark) for (unsigned int i = 0; i < bookmark.getTokenNames().size(); i++) { - std::string name = bookmark.getTokenNames()[i]; - int type = bookmark.getTokenTypes()[i]; - statement = "INSERT INTO edgeBaseBookmarkToken(bookmarkId, name, type) " "VALUES (" + std::to_string(baseId) + ", ?, " + std::to_string(bookmark.getTokenTypes()[i]) + ");"; @@ -504,14 +432,6 @@ Id SqliteStorage::addEdgeBookmark(const EdgeBookmark& bookmark) Id SqliteStorage::addBookmarkCategory(const std::string& name) { - // for backwards compatibility - m_database.execDML( - "CREATE TABLE IF NOT EXISTS bookmarkCategory(" - "id INTEGER NOT NULL, " - "name TEXT, " - "PRIMARY KEY(id));" - ); - std::string statement = "INSERT INTO bookmarkCategory(name) " "VALUES (?);"; @@ -1064,7 +984,7 @@ bool SqliteStorage::checkNodeBookmarkExistsByNames(const std::vector ResultType getFirstById(const Id id) const { diff --git a/src/lib/data/access/StorageAccessProxy.cpp b/src/lib/data/access/StorageAccessProxy.cpp index b820ca52..aa0894fa 100644 --- a/src/lib/data/access/StorageAccessProxy.cpp +++ b/src/lib/data/access/StorageAccessProxy.cpp @@ -63,6 +63,8 @@ StorageEdge StorageAccessProxy::getEdgeById(Id edgeId) const { return m_subject->getEdgeById(edgeId); } + + return StorageEdge(); } bool StorageAccessProxy::checkEdgeExists(Id edgeId) const diff --git a/src/lib/data/access/StorageAccessProxy.h b/src/lib/data/access/StorageAccessProxy.h index 741d47af..3d9738bc 100644 --- a/src/lib/data/access/StorageAccessProxy.h +++ b/src/lib/data/access/StorageAccessProxy.h @@ -86,7 +86,7 @@ public: virtual void removeEdgeBookmark(Id id); virtual void editEdgeBookmark(const EdgeBookmark& bookmark); - virtual virtual std::vector getAllBookmarkCategories() const; + virtual std::vector getAllBookmarkCategories() const; virtual bool checkBookmarkCategoryExists(const std::string& name) const; virtual void removeBookmarkCategory(Id id); diff --git a/src/lib_gui/qt/element/QtBookmark.cpp b/src/lib_gui/qt/element/QtBookmark.cpp index 60182792..7586f8f6 100644 --- a/src/lib_gui/qt/element/QtBookmark.cpp +++ b/src/lib_gui/qt/element/QtBookmark.cpp @@ -100,8 +100,6 @@ void QtBookmark::setBookmark(const std::shared_ptr bookmark) m_activateButton->setText(bookmark->getDisplayName().c_str()); - bool isValid = m_bookmark->isValid(); - if (m_bookmark->isValid() == false) { m_activateButton->setEnabled(false); @@ -173,8 +171,8 @@ void QtBookmark::deleteClicked() QMessageBox msgBox; msgBox.setText("Delete Bookmark"); msgBox.setInformativeText("Do you really want to delete this bookmark?"); - QAbstractButton* yesButton = msgBox.addButton("Delete", QMessageBox::ButtonRole::YesRole); - QAbstractButton* noButton = msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole); + msgBox.addButton("Delete", QMessageBox::ButtonRole::YesRole); + msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole); msgBox.setIcon(QMessageBox::Icon::Question); int ret = msgBox.exec(); @@ -235,7 +233,7 @@ std::string QtBookmark::getDateString() const std::string result = "n/a"; TimePoint creationDate = m_bookmark->getTimeStamp(); - + float delta = TimePoint::now() - creationDate; if (delta < 3600.0f) // less than an hour ago diff --git a/src/lib_gui/qt/element/QtBookmarkBar.cpp b/src/lib_gui/qt/element/QtBookmarkBar.cpp index 36230339..cac0b36e 100644 --- a/src/lib_gui/qt/element/QtBookmarkBar.cpp +++ b/src/lib_gui/qt/element/QtBookmarkBar.cpp @@ -137,13 +137,13 @@ void QtBookmarkBar::createBookmarkClicked() QMessageBox msgBox; msgBox.setText("Edit Bookmark"); msgBox.setInformativeText("Do you want to update or delete the Bookmark for the active Token?"); - QAbstractButton* editButton = msgBox.addButton("Edit", QMessageBox::ButtonRole::YesRole); - QAbstractButton* deleteButton = msgBox.addButton("Delete", QMessageBox::ButtonRole::DestructiveRole); - QAbstractButton* cancelButton = msgBox.addButton("Cancel", QMessageBox::ButtonRole::NoRole); + msgBox.addButton("Edit", QMessageBox::ButtonRole::YesRole); + msgBox.addButton("Delete", QMessageBox::ButtonRole::DestructiveRole); + msgBox.addButton("Cancel", QMessageBox::ButtonRole::NoRole); msgBox.setIcon(QMessageBox::Icon::Question); int ret = msgBox.exec(); - if (ret == 0) // QMessageBox::Yes) + if (ret == 0) // QMessageBox::Yes { MessageDisplayBookmarkCreator().dispatch(); } @@ -214,7 +214,7 @@ void QtBookmarkBar::doDisplayBookmarks(const std::vectorsetupBookmarkBrowser(); } - + m_bookmarkBrowser->setBookmarks(bookmarks); m_bookmarkBrowser->show(); } diff --git a/src/lib_gui/qt/element/QtBookmarkCategory.cpp b/src/lib_gui/qt/element/QtBookmarkCategory.cpp index 80a3d6b9..e0ff0249 100644 --- a/src/lib_gui/qt/element/QtBookmarkCategory.cpp +++ b/src/lib_gui/qt/element/QtBookmarkCategory.cpp @@ -9,11 +9,11 @@ #include "qt/utility/utilityQt.h" QtBookmarkCategory::QtBookmarkCategory() - : m_name(NULL) - , m_layout(NULL) + : m_layout(NULL) + , m_name(NULL) , m_deleteButton(NULL) - , m_id(-1) , m_treeItem(NULL) + , m_id(-1) { setObjectName("bookmark_category"); @@ -133,12 +133,12 @@ void QtBookmarkCategory::deleteClicked() QMessageBox msgBox; msgBox.setText("Delete Category"); msgBox.setInformativeText("Do you really want to delete this category AND all containing bookmarks?"); - QAbstractButton* yesButton = msgBox.addButton("Delete", QMessageBox::ButtonRole::YesRole); - QAbstractButton* noButton = msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole); + msgBox.addButton("Delete", QMessageBox::ButtonRole::YesRole); + msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole); msgBox.setIcon(QMessageBox::Icon::Question); int ret = msgBox.exec(); - if (ret == 0) + if (ret == 0) // QMessageBox::Yes { MessageDeleteBookmarkCategoryWithBookmarks(m_id).dispatch(); } diff --git a/src/lib_gui/qt/window/QtStartScreen.cpp b/src/lib_gui/qt/window/QtStartScreen.cpp index d5c04a39..22ccdfab 100644 --- a/src/lib_gui/qt/window/QtStartScreen.cpp +++ b/src/lib_gui/qt/window/QtStartScreen.cpp @@ -51,20 +51,17 @@ void QtRecentProjectButton::handleButtonClick() } else { - std::string text = "Couldn't find " + m_projectFilePath.str() - + " in your filesystem. Delete it from this recent Proejct list?"; - // int ret = QMessageBox::question(this, "Missing Project File", text.c_str(), QMessageBox::Yes | QMessageBox::No); - - QMessageBox msgBox; msgBox.setText("Missing Project File"); - msgBox.setInformativeText(text.c_str()); - QAbstractButton* yesButton = msgBox.addButton("Delete", QMessageBox::ButtonRole::YesRole); - QAbstractButton* noButton = msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole); + msgBox.setInformativeText(( + "Couldn't find " + m_projectFilePath.str() + " in your filesystem. Delete it from this recent Proejct list?" + ).c_str()); + msgBox.addButton("Delete", QMessageBox::ButtonRole::YesRole); + msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole); msgBox.setIcon(QMessageBox::Icon::Question); int ret = msgBox.exec(); - if (ret == 0) // QMessageBox::Yes) + if (ret == 0) // QMessageBox::Yes { std::vector recentProjects = ApplicationSettings::getInstance()->getRecentProjects(); const int maxRecentProjectsCount = ApplicationSettings::getInstance()->getMaxRecentProjectsCount();