Commit bb793093 authored by Tobias Hunger's avatar Tobias Hunger

Fix reading of existing .user files

Update factories for this to work as well as the settingsaccessor.

Change-Id: If7cb1db3fa0c50441aa5bd1c2d2659c6a0177743
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent a14b9daf
......@@ -56,7 +56,7 @@ enum AndroidQemuStatus {
#define ANDROID_BAT_SUFFIX ""
#endif
static const QLatin1String ANDROID_RC_ID_PREFIX(ANDROID_PREFIX ".");
static const QLatin1String ANDROID_RC_ID_PREFIX(ANDROID_PREFIX ":");
} // namespace Internal
......
......@@ -104,7 +104,7 @@ QList<Core::Id> AndroidRunConfigurationFactory::availableCreationIds(Target *par
QList<Qt4ProFileNode *> nodes = static_cast<Qt4Project *>(parent->project())->allProFiles();
foreach (Qt4ProFileNode *node, nodes)
if (node->projectType() == ApplicationTemplate || node->projectType() == LibraryTemplate)
ids << Core::Id(node->targetInformation().target);
ids << Core::Id(ANDROID_RC_ID_PREFIX + node->targetInformation().target);
return ids;
}
......
......@@ -49,7 +49,7 @@ const char MeeGoOsType[] = "MeeGoOsType";
#define EXEC_SUFFIX ""
#endif
static const char MAEMO_RC_ID_PREFIX[] = PREFIX ".";
static const char MAEMO_RC_ID_PREFIX[] = PREFIX ":";
static const QLatin1String LastDeployedHostsKey(PREFIX ".LastDeployedHosts");
static const QLatin1String LastDeployedFilesKey(PREFIX ".LastDeployedFiles");
......
......@@ -282,7 +282,7 @@ Qt4MaemoDeployConfigurationFactory::Qt4MaemoDeployConfigurationFactory(QObject *
QList<Core::Id> Qt4MaemoDeployConfigurationFactory::availableCreationIds(Target *parent) const
{
QList<Core::Id> ids;
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
if (!canHandle(parent))
return ids;
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(parent->profile());
......@@ -348,9 +348,10 @@ DeployConfiguration *Qt4MaemoDeployConfigurationFactory::create(Target *parent,
bool Qt4MaemoDeployConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
{
return canCreate(parent, idFromMap(map))
|| (idFromMap(map) == Core::Id(OldDeployConfigId)
&& MaemoGlobal::supportsMaemoDevice(parent->profile()));
Core::Id id = idFromMap(map);
return canHandle(parent)
&& (availableCreationIds(parent).contains(id) || id == Core::Id(OldDeployConfigId))
&& MaemoGlobal::supportsMaemoDevice(parent->profile());
}
DeployConfiguration *Qt4MaemoDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map)
......@@ -382,7 +383,16 @@ DeployConfiguration *Qt4MaemoDeployConfigurationFactory::clone(Target *parent,
if (!canClone(parent, product))
return 0;
return new Qt4MaemoDeployConfiguration(parent,
qobject_cast<Qt4MaemoDeployConfiguration *>(product));
qobject_cast<Qt4MaemoDeployConfiguration *>(product));
}
bool Qt4MaemoDeployConfigurationFactory::canHandle(Target *parent) const
{
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
return false;
if (!parent->project()->supportsProfile(parent->profile()))
return false;
return MaemoGlobal::supportsMaemoDevice(parent->profile());
}
} // namespace Internal
......
......@@ -56,12 +56,12 @@ public:
QString displayNameForId(const Core::Id id) const;
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
ProjectExplorer::DeployConfiguration *create(ProjectExplorer::Target *parent, const Core::Id id);
bool canRestore(ProjectExplorer::Target *parent,
const QVariantMap &map) const;
ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent,
const QVariantMap &map);
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
ProjectExplorer::DeployConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
ProjectExplorer::DeployConfiguration *clone(ProjectExplorer::Target *parent,
ProjectExplorer::DeployConfiguration *product);
bool canHandle(ProjectExplorer::Target *parent) const;
};
class Qt4MaemoDeployConfiguration : public RemoteLinux::RemoteLinuxDeployConfiguration
......
......@@ -114,8 +114,10 @@ public:
signals:
void availableCreationIdsChanged();
protected:
virtual bool canHandle(Target *parent) const;
private:
bool canHandle(Target *parent) const;
};
class PROJECTEXPLORER_EXPORT DeployConfigurationWidget : public NamedWidget
......
......@@ -466,7 +466,7 @@ Utils::FileName QMakeStep::mkspec()
}
}
return Qt4ProjectManager::QmakeProfileInformation::mkspec(target()->profile());
return Qt4ProjectManager::QmakeProfileInformation::effectiveMkspec(target()->profile());
}
QVariantMap QMakeStep::toMap() const
......
......@@ -79,7 +79,7 @@ using Utils::PersistentSettingsReader;
using Utils::PersistentSettingsWriter;
namespace {
const char * const QT4_RC_PREFIX("Qt4ProjectManager.Qt4RunConfiguration.");
const char * const QT4_RC_PREFIX("Qt4ProjectManager.Qt4RunConfiguration:");
const char * const COMMAND_LINE_ARGUMENTS_KEY("Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments");
const char * const PRO_FILE_KEY("Qt4ProjectManager.Qt4RunConfiguration.ProFile");
......
......@@ -57,7 +57,7 @@ using namespace Qt4ProjectManager::Internal;
namespace {
const char * const S60_DEVICE_RC_ID("Qt4ProjectManager.S60DeviceRunConfiguration");
const char * const S60_DEVICE_RC_PREFIX("Qt4ProjectManager.S60DeviceRunConfiguration.");
const char * const S60_DEVICE_RC_PREFIX("Qt4ProjectManager.S60DeviceRunConfiguration:");
const char * const PRO_FILE_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.ProFile");
const char * const COMMUNICATION_TYPE_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.CommunicationType");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment