Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
58497e46
Commit
58497e46
authored
Mar 29, 2010
by
dt
Browse files
Fix restoring of default sessions
They appeared to be always empty. Task-Nr: QTCREATORBUG-977
parent
e813f280
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/session.cpp
View file @
58497e46
...
...
@@ -381,7 +381,7 @@ SessionManager::SessionManager(QObject *parent)
m_file
(
new
SessionFile
),
m_sessionNode
(
new
Internal
::
SessionNodeImpl
(
this
)),
m_currentEditor
(
0
),
m_
defaultV
irginSession
(
true
)
m_
v
irginSession
(
true
)
{
// Create qtcreator dir if it doesn't yet exist
QString
configDir
=
QFileInfo
(
m_core
->
settings
()
->
fileName
()).
path
();
...
...
@@ -435,7 +435,8 @@ SessionManager::~SessionManager()
bool
SessionManager
::
isDefaultVirgin
()
const
{
return
m_defaultVirginSession
;
return
isDefaultSession
(
m_sessionName
)
&&
m_virginSession
;
}
bool
SessionManager
::
isDefaultSession
(
const
QString
&
session
)
const
...
...
@@ -573,7 +574,7 @@ void SessionManager::addProject(Project *project)
void
SessionManager
::
addProjects
(
const
QList
<
Project
*>
&
projects
)
{
m_
defaultV
irginSession
=
false
;
m_
v
irginSession
=
false
;
QList
<
Project
*>
clearedList
;
foreach
(
Project
*
pro
,
projects
)
{
if
(
!
m_file
->
m_projects
.
contains
(
pro
))
{
...
...
@@ -604,7 +605,7 @@ void SessionManager::addProjects(const QList<Project*> &projects)
void
SessionManager
::
removeProject
(
Project
*
project
)
{
m_
defaultV
irginSession
=
false
;
m_
v
irginSession
=
false
;
if
(
project
==
0
)
{
qDebug
()
<<
"SessionManager::removeProject(0) ... THIS SHOULD NOT HAPPEN"
;
return
;
...
...
@@ -634,7 +635,7 @@ bool SessionManager::createImpl(const QString &fileName)
setStartupProject
(
0
);
}
m_
defaultV
irginSession
=
fals
e
;
m_
v
irginSession
=
tru
e
;
if
(
debug
)
qDebug
()
<<
"SessionManager - creating new session returns "
<<
success
;
...
...
@@ -662,7 +663,7 @@ bool SessionManager::loadImpl(const QString &fileName)
}
}
m_
defaultV
irginSession
=
false
;
m_
v
irginSession
=
false
;
if
(
success
)
{
emit
aboutToUnloadSession
();
...
...
@@ -1144,7 +1145,7 @@ void SessionManager::markSessionFileDirty(bool makeDefaultVirginDirty)
if
(
m_file
&&
!
m_file
->
fileName
().
isEmpty
())
m_autoSaveSessionTimer
->
start
();
if
(
makeDefaultVirginDirty
)
m_
defaultV
irginSession
=
false
;
m_
v
irginSession
=
false
;
}
#include
"session.moc"
src/plugins/projectexplorer/session.h
View file @
58497e46
...
...
@@ -194,7 +194,7 @@ private:
QPointer
<
Core
::
IEditor
>
m_currentEditor
;
QString
m_displayName
;
QString
m_sessionName
;
bool
m_
defaultV
irginSession
;
bool
m_
v
irginSession
;
mutable
QStringList
m_sessions
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment