As far as I can see the saved string was changed in May 2010 to not
store the filename but just the session name. Thus this code only worked
because completeBaseName() is the same if the name not contained a dot.
Task-number: QTCREATORBUG-8064
Change-Id: I59326282012ef46206da473a72d99a813f7a7ce7
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Do not save XML config files (profiles.xml, toolchains.xml, etc.)
if the file has not changed.
Change-Id: I5f0dea374b33a05e7c428f4031d53c83d92de595
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Also removed all <QMainWindow> includes which are not needed
anymore.
Change-Id: I393c9a62a5c6df95d9f35d872e1473a4f13bcdc4
Reviewed-by: hjk <qthjk@ovi.com>
E.g. this could happen if a session with two projects is opened, where
the startup project no longer exists.
Change-Id: I1c60bacb62b5f39f7830a3bc30e3aa388a825884
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Those are just comments on the code, nothing to do.
Change-Id: I1daaa26eafd3d5f4da1d4be3eede9996ea87248f
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
addProject() is called from 2 places: openProject and restoreSession
openProject() takes care of setting a startup project itself and
restoreSession sets it explicitly after opening the projects. So the
code in addProject() is not needed.
Change-Id: Iaa5de3e36fd4b60c8ceb79b8ea3ca68dbc9b491c
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
The tooltip allows renaming, cloning and deleting and shows
included projects.
The following method was added to Session:
QStringList projectsForSessionName(const QString &session) const;
I moved the SessionNameInputDialog into the header to reuse it.
I added new roles to SessionModel (ProjectsPathRole, ProjectsDisplayRole).
The following slots were added to SessionModel to expose the backend
functionality:
void cloneSession(const QString &session);
void deleteSession(const QString &session);
void renameSession(const QString &session);
Change-Id: I0182a26dc63b4f051ea948756decd5413c832c60
Reviewed-by: hjk <qthjk@ovi.com>
And adapt the other API respectively.
Change-Id: I1e04e555409be09242db6890f9e013396f83aeed
Reviewed-by: Bill King <bill.king@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Getting the #include directives ready for Qt5. This includes the
new-project wizards.
Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Also move the editor closing out of the function. It isn't needed on
shutdown as all editors are already closed then.
Change-Id: Ie50a238e0a0382a99b0a267b286f9ed9484f26f6
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
The order of actions and thus the state at which the signals are emitted
has changed. The aboutToUnloadSession comes before the actual saving
now. Also the aboutToLoadSession is after restoring values but before
restoring projects and editors.
Change-Id: I3eae66cffae970f00535d8d6e2bb11a6ca645456
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Instead of reseting the variable at new SessionFile, I did it at the
right place, that is after reportingFinished().
Change-Id: Ia5b58734a646840ff645dad07dd87a2bffcef02b
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Note: The m_dep.clear() calls on new SessionFile are theoretically
unecessary. After SessionManager::clear(), m_depMap should be empty.
I can't prove that easily though, so I'll remove that later.
Change-Id: I50b36ca7578dccb50b2b2d81351c8e2d1f0826cd
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Note: We do not need to clear it on delete m_file; new SessionFile,
since the clear() before that removes all projects from m_projects
Change-Id: I800f52939602cc2c02deff993da578e28ad9115c
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Preserve the exact same semantics, that is set it to 0 even if it is
later overriden anyway. Note, this 0 setting prevents the startup
project changed signal from being emitted, so it's likely to be wrong.
I'll fix that later.
Change-Id: I8efc33e54fca1fe3636006fe8616ae20aa8c211b
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Remove the functions and access the variable directly.
Change-Id: Ic35d971a618299b6ccf26f9fb0d76de498268cc1
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Removing the bool success makes later refactorings easier to do. The
code flow is the same, except that the block handling failedProjects
after load was always run, even if SessionFile::load returned false.
The only place SessionFile::load returns false failedProjects didn't yet
change, so the code was wrong before.
Change-Id: I8ce565791d67ece7ab8fc7c4a799ed365153e34b
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
I want to get rid of SessionFile, this is the first step.
Only slight coding style reformating has been done.
Change-Id: I57cae8356b9f12229e3f788f2e71f8e1161fc3c7
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
It's easily constructed from sessionName, thus removing one member
Change-Id: I8ae92db0732dada6baa7b50ec84d7b95a16efed6
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Only called in debug output, which is going to change later anyway
Change-Id: I7dd6ec4a30a5d98eeab82cf46276c2811dc0207c
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
There used to be 3 states for the SessionManager:
1) Uninitialized (after ctor)
2) A default virgin session
3) Using a session (including the default session)
And we used to switch from state 1 to 2 or 3 after ICore::coreOpened().
This changes that we start in state 2 and thus don't emit a few signals
after coreOpened. I don't think that'll break anything.
Change-Id: I4cf7dade132c9d0ebd6d472d79c8b70c07acd20f
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
It's only ever called two times and makes it easier to understand how
m_sesionName is changed
Change-Id: I0106516b78481181d7a027a6348eee45e0e462d6
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
To reproduce the bug:
1) Load a project into the default session.cpp
2) Close creator (which saves the session)
3) Start Creator
4) Create a new session and switch to it => This calls createImpl
and overrides the default session, even though it shouldn't
5) Load the default session, which will now be empty
Change-Id: I7c23fba8c1f9fd32cc95b3b9206afc422c1f0133
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This saves one function call compared to the instance()->currentProject()
pattern and is typically less to type on the caller site.
Change-Id: I65568f30205fc90e2aaca7e8e7f0192241df8c85
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>