forked from qt-creator/qt-creator
Merge remote branch 'origin/2.0'
Conflicts: doc/qtcreator.qdoc src/plugins/help/helpplugin.cpp src/plugins/projectexplorer/projectexplorer.cpp src/plugins/projectexplorer/projectexplorer.h src/plugins/qt4projectmanager/qt-maemo/maemopackagecontents.cpp src/plugins/qt4projectmanager/qt-maemo/maemopackagecontents.h src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationwidget.cpp src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp src/tools/qml/qmldump/main.cpp
This commit is contained in:
@@ -68,7 +68,6 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
|
||||
, m_devConfig(source->m_devConfig)
|
||||
, m_arguments(source->m_arguments)
|
||||
, m_lastDeployed(source->m_lastDeployed)
|
||||
, m_debuggingHelpersLastDeployed(source->m_debuggingHelpersLastDeployed)
|
||||
{
|
||||
init();
|
||||
}
|
||||
@@ -124,25 +123,30 @@ QVariantMap MaemoRunConfiguration::toMap() const
|
||||
QVariantMap map(RunConfiguration::toMap());
|
||||
map.insert(DeviceIdKey, m_devConfig.internalId);
|
||||
map.insert(ArgumentsKey, m_arguments);
|
||||
|
||||
addDeployTimesToMap(LastDeployedKey, m_lastDeployed, map);
|
||||
addDeployTimesToMap(DebuggingHelpersLastDeployedKey,
|
||||
m_debuggingHelpersLastDeployed, map);
|
||||
|
||||
addDeployTimesToMap(map);
|
||||
const QDir dir = QDir(target()->project()->projectDirectory());
|
||||
map.insert(ProFileKey, dir.relativeFilePath(m_proFilePath));
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
void MaemoRunConfiguration::addDeployTimesToMap(const QString &key,
|
||||
const QMap<QString, QDateTime> &deployTimes, QVariantMap &map) const
|
||||
void MaemoRunConfiguration::addDeployTimesToMap(QVariantMap &map) const
|
||||
{
|
||||
QMap<QString, QVariant> variantMap;
|
||||
QMap<QString, QDateTime>::ConstIterator it = deployTimes.begin();
|
||||
for (; it != deployTimes.end(); ++it)
|
||||
variantMap.insert(it.key(), it.value());
|
||||
map.insert(key, variantMap);
|
||||
QVariantList hostList;
|
||||
QVariantList fileList;
|
||||
QVariantList remotePathList;
|
||||
QVariantList timeList;
|
||||
typedef QHash<DeployablePerHost, QDateTime>::ConstIterator DepIt;
|
||||
for (DepIt it = m_lastDeployed.begin(); it != m_lastDeployed.end(); ++it) {
|
||||
hostList << it.key().first.localFilePath;
|
||||
remotePathList << it.key().first.remoteDir;
|
||||
fileList << it.key().second;
|
||||
timeList << it.value();
|
||||
}
|
||||
map.insert(LastDeployedHostsKey, hostList);
|
||||
map.insert(LastDeployedFilesKey, fileList);
|
||||
map.insert(LastDeployedRemotePathsKey, remotePathList);
|
||||
map.insert(LastDeployedTimesKey, timeList);
|
||||
}
|
||||
|
||||
bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
|
||||
@@ -153,62 +157,45 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
|
||||
setDeviceConfig(MaemoDeviceConfigurations::instance().
|
||||
find(map.value(DeviceIdKey, 0).toInt()));
|
||||
m_arguments = map.value(ArgumentsKey).toStringList();
|
||||
|
||||
getDeployTimesFromMap(LastDeployedKey, m_lastDeployed, map);
|
||||
getDeployTimesFromMap(DebuggingHelpersLastDeployedKey,
|
||||
m_debuggingHelpersLastDeployed, map);
|
||||
|
||||
getDeployTimesFromMap(map);
|
||||
const QDir dir = QDir(target()->project()->projectDirectory());
|
||||
m_proFilePath = dir.filePath(map.value(ProFileKey).toString());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MaemoRunConfiguration::getDeployTimesFromMap(const QString &key,
|
||||
QMap<QString, QDateTime> &deployTimes, const QVariantMap &map)
|
||||
void MaemoRunConfiguration::getDeployTimesFromMap(const QVariantMap &map)
|
||||
{
|
||||
const QVariantMap &variantMap = map.value(key).toMap();
|
||||
for (QVariantMap::ConstIterator it = variantMap.begin();
|
||||
it != variantMap.end(); ++it)
|
||||
deployTimes.insert(it.key(), it.value().toDateTime());
|
||||
}
|
||||
|
||||
bool MaemoRunConfiguration::currentlyNeedsDeployment(const QString &host) const
|
||||
{
|
||||
return fileNeedsDeployment(packageStep()->packageFilePath(),
|
||||
m_lastDeployed.value(host));
|
||||
}
|
||||
|
||||
void MaemoRunConfiguration::wasDeployed(const QString &host)
|
||||
{
|
||||
m_lastDeployed.insert(host, QDateTime::currentDateTime());
|
||||
}
|
||||
|
||||
bool MaemoRunConfiguration::hasDebuggingHelpers() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = activeQt4BuildConfiguration();
|
||||
return qt4bc->qtVersion()->hasDebuggingHelper();
|
||||
}
|
||||
|
||||
bool MaemoRunConfiguration::debuggingHelpersNeedDeployment(const QString &host) const
|
||||
{
|
||||
if (hasDebuggingHelpers()) {
|
||||
return fileNeedsDeployment(dumperLib(),
|
||||
m_debuggingHelpersLastDeployed.value(host));
|
||||
const QVariantList &hostList = map.value(LastDeployedHostsKey).toList();
|
||||
const QVariantList &fileList = map.value(LastDeployedFilesKey).toList();
|
||||
const QVariantList &remotePathList
|
||||
= map.value(LastDeployedRemotePathsKey).toList();
|
||||
const QVariantList &timeList = map.value(LastDeployedTimesKey).toList();
|
||||
const int elemCount
|
||||
= qMin(qMin(hostList.size(), fileList.size()),
|
||||
qMin(remotePathList.size(), timeList.size()));
|
||||
for (int i = 0; i < elemCount; ++i) {
|
||||
const MaemoDeployable d(fileList.at(i).toString(),
|
||||
remotePathList.at(i).toString());
|
||||
m_lastDeployed.insert(DeployablePerHost(d, hostList.at(i).toString()),
|
||||
timeList.at(i).toDateTime());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void MaemoRunConfiguration::debuggingHelpersDeployed(const QString &host)
|
||||
{
|
||||
m_debuggingHelpersLastDeployed.insert(host, QDateTime::currentDateTime());
|
||||
}
|
||||
|
||||
bool MaemoRunConfiguration::fileNeedsDeployment(const QString &path,
|
||||
const QDateTime &lastDeployed) const
|
||||
bool MaemoRunConfiguration::currentlyNeedsDeployment(const QString &host,
|
||||
const MaemoDeployable &deployable) const
|
||||
{
|
||||
const QDateTime &lastDeployed
|
||||
= m_lastDeployed.value(DeployablePerHost(deployable, host));
|
||||
return !lastDeployed.isValid()
|
||||
|| QFileInfo(path).lastModified() > lastDeployed;
|
||||
|| QFileInfo(deployable.localFilePath).lastModified() > lastDeployed;
|
||||
}
|
||||
|
||||
void MaemoRunConfiguration::setDeployed(const QString &host,
|
||||
const MaemoDeployable &deployable)
|
||||
{
|
||||
m_lastDeployed.insert(DeployablePerHost(deployable, host),
|
||||
QDateTime::currentDateTime());
|
||||
}
|
||||
|
||||
void MaemoRunConfiguration::setDeviceConfig(const MaemoDeviceConfig &devConf)
|
||||
@@ -322,7 +309,7 @@ void MaemoRunConfiguration::updateDeviceConfigurations()
|
||||
} else {
|
||||
m_devConfig = configManager.find(m_devConfig.internalId);
|
||||
}
|
||||
emit deviceConfigurationsUpdated();
|
||||
emit deviceConfigurationsUpdated(target());
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user