History

Implement "go home" action

David Rowe committed 10 years ago

Commit 5e00a1e1 parent f74be223 files · +20 −2Browse files

Showing the changes to interface/src/Bookmarks.cpp (1 of 3 files). Show all

Unified · Split

interface/src/Bookmarks.cpp+9−1
@@ -29,6 +29,10 @@ · 28 unmodified lines
2929 #include "Bookmarks.h"
3030 #include <QtQuick/QQuickWindow>
3131
32+
33+const QString Bookmarks::HOME_BOOKMARK = "Home";
34+
35+
3236 Bookmarks::Bookmarks() {
3337 _bookmarksFilename = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/" + BOOKMARKS_FILENAME;
3438 readFromFile();
@@ -60,6 +64,10 @@ bool Bookmarks::contains(const QString& name) const { · 25 unmodified lines
6064 return _bookmarks.contains(name);
6165 }
6266
67+QString Bookmarks::addressForBookmark(const QString& name) const {
68+ return _bookmarks.value(name).toString();
69+}
70+
6371 void Bookmarks::readFromFile() {
6472 QFile loadFile(_bookmarksFilename);
6573
@@ -150,7 +158,7 @@ void Bookmarks::bookmarkLocation() { · 84 unmodified lines
150158
151159 void Bookmarks::setHomeLocation() {
152160 Menu* menubar = Menu::getInstance();
153− QString bookmarkName = "Home";
161+ QString bookmarkName = HOME_BOOKMARK;
154162 auto addressManager = DependencyManager::get<AddressManager>();
155163 QString bookmarkAddress = addressManager->currentAddress().toString();
156164