forked from qt-creator/qt-creator
Remove class SessionNodeImpl, just use SessionNode directly
The class added nothing over SessionNode. Change-Id: I137c274514b2c5897a591b7e093ba84e1a91e9d7 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -94,7 +94,6 @@ HEADERS += projectexplorer.h \
|
||||
taskhub.h \
|
||||
localapplicationruncontrol.h \
|
||||
customexecutableconfigurationwidget.h \
|
||||
sessionnodeimpl.h \
|
||||
metatypedeclarations.h \
|
||||
publishing/publishingwizardselectiondialog.h \
|
||||
publishing/ipublishingwizardfactory.h \
|
||||
@@ -185,7 +184,6 @@ SOURCES += projectexplorer.cpp \
|
||||
processparameters.cpp \
|
||||
localapplicationruncontrol.cpp \
|
||||
customexecutableconfigurationwidget.cpp \
|
||||
sessionnodeimpl.cpp \
|
||||
publishing/publishingwizardselectiondialog.cpp \
|
||||
appoutputpane.cpp \
|
||||
codestylesettingspropertiespage.cpp \
|
||||
|
||||
@@ -595,8 +595,8 @@ bool ProjectNode::sortNodesByPath(Node *n1, Node *n2) {
|
||||
\class ProjectExplorer::SessionNode
|
||||
*/
|
||||
|
||||
SessionNode::SessionNode(const QString &sessionPath, QObject *parentObject)
|
||||
: FolderNode(sessionPath)
|
||||
SessionNode::SessionNode(QObject *parentObject)
|
||||
: FolderNode(QLatin1String("session"))
|
||||
{
|
||||
setParent(parentObject);
|
||||
setNodeType(SessionNodeType);
|
||||
|
||||
@@ -77,6 +77,7 @@ class FolderNode;
|
||||
class ProjectNode;
|
||||
class NodesWatcher;
|
||||
class NodesVisitor;
|
||||
class SessionManager;
|
||||
|
||||
// Documentation inside.
|
||||
class PROJECTEXPLORER_EXPORT Node : public QObject {
|
||||
@@ -245,8 +246,9 @@ private:
|
||||
// Documentation inside.
|
||||
class PROJECTEXPLORER_EXPORT SessionNode : public FolderNode {
|
||||
Q_OBJECT
|
||||
friend class SessionManager;
|
||||
public:
|
||||
SessionNode(const QString &sessionFilePath, QObject *parentObject);
|
||||
SessionNode(QObject *parentObject);
|
||||
|
||||
QList<ProjectNode*> projectNodes() const;
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "session.h"
|
||||
#include "sessionnodeimpl.h"
|
||||
|
||||
#include "project.h"
|
||||
#include "projectexplorer.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "nodesvisitor.h"
|
||||
#include "editorconfiguration.h"
|
||||
#include "projectnodes.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/imode.h>
|
||||
@@ -323,7 +323,7 @@ void SessionFile::clearFailedProjectFileNames()
|
||||
SessionManager::SessionManager(QObject *parent)
|
||||
: QObject(parent),
|
||||
m_file(new SessionFile),
|
||||
m_sessionNode(new Internal::SessionNodeImpl(this)),
|
||||
m_sessionNode(new SessionNode(this)),
|
||||
m_virginSession(true)
|
||||
{
|
||||
connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)),
|
||||
@@ -502,7 +502,7 @@ void SessionManager::addProjects(const QList<Project*> &projects)
|
||||
if (!m_file->m_projects.contains(pro)) {
|
||||
clearedList.append(pro);
|
||||
m_file->m_projects.append(pro);
|
||||
m_sessionNode->addProjectNode(pro->rootProjectNode());
|
||||
m_sessionNode->addProjectNodes(QList<ProjectNode *>() << pro->rootProjectNode());
|
||||
|
||||
connect(pro, SIGNAL(fileListChanged()),
|
||||
this, SLOT(clearProjectFileCache()));
|
||||
@@ -918,7 +918,7 @@ void SessionManager::removeProjects(QList<Project *> remove)
|
||||
|
||||
if (debug)
|
||||
qDebug() << "SessionManager - emitting projectRemoved(" << pro->displayName() << ")";
|
||||
m_sessionNode->removeProjectNode(pro->rootProjectNode());
|
||||
m_sessionNode->removeProjectNodes(QList<ProjectNode *>() << pro->rootProjectNode());
|
||||
emit projectRemoved(pro);
|
||||
delete pro;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ private:
|
||||
void updateName(const QString &session);
|
||||
|
||||
Internal::SessionFile *m_file;
|
||||
Internal::SessionNodeImpl *m_sessionNode;
|
||||
SessionNode *m_sessionNode;
|
||||
QString m_sessionName;
|
||||
bool m_virginSession;
|
||||
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "sessionnodeimpl.h"
|
||||
#include "session.h"
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
SessionNodeImpl::SessionNodeImpl(SessionManager *manager)
|
||||
: ProjectExplorer::SessionNode(
|
||||
manager->sessionNameToFileName(manager->currentSession()),
|
||||
manager)
|
||||
{
|
||||
setFileName(QLatin1String("session"));
|
||||
}
|
||||
|
||||
void SessionNodeImpl::addProjectNode(ProjectNode *projectNode)
|
||||
{
|
||||
addProjectNodes(QList<ProjectNode*>() << projectNode);
|
||||
}
|
||||
|
||||
void SessionNodeImpl::removeProjectNode(ProjectNode *projectNode)
|
||||
{
|
||||
removeProjectNodes(QList<ProjectNode*>() << projectNode);
|
||||
}
|
||||
|
||||
void SessionNodeImpl::setFileName(const QString &fileName)
|
||||
{
|
||||
setPath(fileName);
|
||||
setDisplayName(fileName);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
@@ -1,60 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef SESSIONNODEIMPL_H
|
||||
#define SESSIONNODEIMPL_H
|
||||
|
||||
#include "projectnodes.h"
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class SessionManager;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
// Must be in a header as otherwise moc has issues
|
||||
// with ProjectExplorer::SessionNode on msvc2005
|
||||
class SessionNodeImpl : public ProjectExplorer::SessionNode
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SessionNodeImpl(SessionManager *manager);
|
||||
|
||||
void addProjectNode(ProjectNode *projectNode);
|
||||
void removeProjectNode(ProjectNode *projectNode);
|
||||
|
||||
void setFileName(const QString &fileName);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // SESSIONNODEIMPL_H
|
||||
Reference in New Issue
Block a user