Showing the changes to interface/src/Bookmarks.cpp (1 of 3 files). Show all
Unified · Split
| @@ -29,6 +29,10 @@ · 28 unmodified lines | ||
| 29 | 29 | #include "Bookmarks.h" |
| 30 | 30 | #include <QtQuick/QQuickWindow> |
| 31 | 31 | |
| 32 | + | |
| 33 | +const QString Bookmarks::HOME_BOOKMARK = "Home"; | |
| 34 | + | |
| 35 | + | |
| 32 | 36 | Bookmarks::Bookmarks() { |
| 33 | 37 | _bookmarksFilename = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/" + BOOKMARKS_FILENAME; |
| 34 | 38 | readFromFile(); |
| @@ -60,6 +64,10 @@ bool Bookmarks::contains(const QString& name) const { · 25 unmodified lines | ||
| 60 | 64 | return _bookmarks.contains(name); |
| 61 | 65 | } |
| 62 | 66 | |
| 67 | +QString Bookmarks::addressForBookmark(const QString& name) const { | |
| 68 | + return _bookmarks.value(name).toString(); | |
| 69 | +} | |
| 70 | + | |
| 63 | 71 | void Bookmarks::readFromFile() { |
| 64 | 72 | QFile loadFile(_bookmarksFilename); |
| 65 | 73 | |
| @@ -150,7 +158,7 @@ void Bookmarks::bookmarkLocation() { · 84 unmodified lines | ||
| 150 | 158 | |
| 151 | 159 | void Bookmarks::setHomeLocation() { |
| 152 | 160 | Menu* menubar = Menu::getInstance(); |
| 153 | − QString bookmarkName = "Home"; | |
| 161 | + QString bookmarkName = HOME_BOOKMARK; | |
| 154 | 162 | auto addressManager = DependencyManager::get<AddressManager>(); |
| 155 | 163 | QString bookmarkAddress = addressManager->currentAddress().toString(); |
| 156 | 164 | |