SessionManager: More useless null checks

Change-Id: Ice94b56ffda04babbb66317f77d5b121f72b051f
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Daniel Teske
2012-01-31 15:51:17 +01:00
parent 32ccf8ade4
commit c730a7dadf
2 changed files with 3 additions and 13 deletions

View File

@@ -734,27 +734,19 @@ QString BookmarkManager::bookmarkToString(const Bookmark *b)
/* Saves the bookmarks to the session settings. */
void BookmarkManager::saveBookmarks()
{
SessionManager *s = sessionManager();
if (!s)
return;
QStringList list;
foreach (const FileNameBookmarksMap *bookmarksMap, m_bookmarksMap)
foreach (const Bookmark *bookmark, *bookmarksMap)
list << bookmarkToString(bookmark);
s->setValue("Bookmarks", list);
sessionManager()->setValue("Bookmarks", list);
}
/* Loads the bookmarks from the session settings. */
void BookmarkManager::loadBookmarks()
{
removeAllBookmarks();
SessionManager *s = sessionManager();
if (!s)
return;
const QStringList &list = s->value("Bookmarks").toStringList();
const QStringList &list = sessionManager()->value("Bookmarks").toStringList();
foreach (const QString &bookmarkString, list)
addBookmark(bookmarkString);

View File

@@ -104,9 +104,7 @@ void ResourceHandler::ensureInitialized()
if (m_sessionNode)
return;
ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance();
ProjectExplorer::SessionManager *session = pe->session();
m_sessionNode = session->sessionNode();
m_sessionNode = pe->session()->sessionNode();
m_sessionWatcher = new ProjectExplorer::NodesWatcher();
connect(m_sessionWatcher, SIGNAL(filesAdded()), this, SLOT(updateResources()));