WelcomePage: Add tooltip for sessions

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>
This commit is contained in:
Thomas Hartmann
2012-02-23 17:50:30 +01:00
committed by hjk
parent 7e380e9d0c
commit 9bc042e09f
11 changed files with 443 additions and 84 deletions

View File

@@ -914,3 +914,16 @@ void SessionManager::sessionLoadingProgress()
m_future.setProgressValue(m_future.progressValue() + 1);
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
}
QStringList ProjectExplorer::SessionManager::projectsForSessionName(const QString &session) const
{
const QString fileName = sessionNameToFileName(session);
PersistentSettingsReader reader;
if (QFileInfo(fileName).exists()) {
if (!reader.load(fileName)) {
qWarning() << "Could not restore session" << fileName;
return QStringList();
}
}
return reader.restoreValue(QLatin1String("ProjectList")).toStringList();
}