Commit f7835eb5 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Android: Remove unneeded qualifications

Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I44745947f315b73f0b983d4362f884580dc2d94b
Reviewed-by: default avatarBogDan Vatra <bogdan@kde.org>
parent e02a9433
......@@ -61,7 +61,7 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati
params.sysroot = SysRootKitInformation::sysRoot(target->kit()).toString();
// TODO: Not sure if these are the right paths.
params.workingDirectory = target->project()->projectDirectory().toString();
if (runMode == ProjectExplorer::QmlProfilerRunMode) {
if (runMode == QmlProfilerRunMode) {
QTcpServer server;
QTC_ASSERT(server.listen(QHostAddress::LocalHost)
|| server.listen(QHostAddress::LocalHostIPv6), return 0);
......
......@@ -135,9 +135,9 @@ namespace {
static bool is32BitUserSpace()
{
// Do the exact same check as android's emulator is doing:
if (Utils::HostOsInfo::isLinuxHost()) {
if (HostOsInfo::isLinuxHost()) {
if (QSysInfo::WordSize == 32 ) {
Utils::Environment env = Utils::Environment::systemEnvironment();
Environment env = Environment::systemEnvironment();
QString executable = env.searchInPath(QLatin1String("file")).toString();
QString shell = env.value(QLatin1String("SHELL"));
if (executable.isEmpty() || shell.isEmpty())
......@@ -390,13 +390,13 @@ QList<SdkPlatform> AndroidConfig::sdkTargets(int minApiLevel) const
FileName AndroidConfig::adbToolPath() const
{
Utils::FileName path = m_sdkLocation;
FileName path = m_sdkLocation;
return path.appendPath(QLatin1String("platform-tools/adb" QTC_HOST_EXE_SUFFIX));
}
Utils::Environment AndroidConfig::androidToolEnvironment() const
Environment AndroidConfig::androidToolEnvironment() const
{
Utils::Environment env = Utils::Environment::systemEnvironment();
Environment env = Environment::systemEnvironment();
if (!m_openJDKLocation.isEmpty())
env.set(QLatin1String("JAVA_HOME"), m_openJDKLocation.toUserOutput());
return env;
......@@ -535,7 +535,7 @@ QFuture<AndroidConfig::CreateAvdInfo> AndroidConfig::createAVD(CreateAvdInfo inf
return QtConcurrent::run(&AndroidConfig::createAVDImpl, info, androidToolPath(), androidToolEnvironment());
}
AndroidConfig::CreateAvdInfo AndroidConfig::createAVDImpl(CreateAvdInfo info, Utils::FileName androidToolPath, Utils::Environment env)
AndroidConfig::CreateAvdInfo AndroidConfig::createAVDImpl(CreateAvdInfo info, FileName androidToolPath, Environment env)
{
QProcess proc;
proc.setProcessEnvironment(env.toProcessEnvironment());
......@@ -610,7 +610,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::androidVirtualDevices() const
return androidVirtualDevicesImpl(androidToolPath(), androidToolEnvironment());
}
QVector<AndroidDeviceInfo> AndroidConfig::androidVirtualDevicesImpl(const Utils::FileName &androidTool, const Utils::Environment &environment)
QVector<AndroidDeviceInfo> AndroidConfig::androidVirtualDevicesImpl(const FileName &androidTool, const Environment &environment)
{
QVector<AndroidDeviceInfo> devices;
QProcess proc;
......@@ -1015,7 +1015,7 @@ void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
emit m_instance->updated();
}
AndroidDeviceInfo AndroidConfigurations::showDeviceDialog(ProjectExplorer::Project *project,
AndroidDeviceInfo AndroidConfigurations::showDeviceDialog(Project *project,
int apiLevel, const QString &abi,
Options options)
{
......@@ -1045,13 +1045,13 @@ AndroidDeviceInfo AndroidConfigurations::showDeviceDialog(ProjectExplorer::Proje
return AndroidDeviceInfo();
}
void AndroidConfigurations::clearDefaultDevices(ProjectExplorer::Project *project)
void AndroidConfigurations::clearDefaultDevices(Project *project)
{
if (m_instance->m_defaultDeviceForAbi.contains(project))
m_instance->m_defaultDeviceForAbi.remove(project);
}
void AndroidConfigurations::setDefaultDevice(ProjectExplorer::Project *project, const QString &abi, const QString &serialNumber)
void AndroidConfigurations::setDefaultDevice(Project *project, const QString &abi, const QString &serialNumber)
{
m_instance->m_defaultDeviceForAbi[project][abi] = serialNumber;
}
......@@ -1124,7 +1124,7 @@ void AndroidConfigurations::updateAutomaticKitList()
continue;
// Update code for 3.0 beta, which shipped with a bug for the debugger settings
ProjectExplorer::ToolChain *tc =ToolChainKitInformation::toolChain(k);
ToolChain *tc =ToolChainKitInformation::toolChain(k);
if (tc && Debugger::DebuggerKitInformation::debuggerCommand(k) != tc->suggestedDebugger()) {
Debugger::DebuggerItem debugger;
debugger.setCommand(tc->suggestedDebugger());
......@@ -1166,7 +1166,7 @@ void AndroidConfigurations::updateAutomaticKitList()
foreach (QtSupport::BaseQtVersion *qt, qtVersions) {
Kit *newKit = new Kit;
newKit->setAutoDetected(true);
newKit->setIconPath(Utils::FileName::fromString(QLatin1String(Constants::ANDROID_SETTINGS_CATEGORY_ICON)));
newKit->setIconPath(FileName::fromString(QLatin1String(Constants::ANDROID_SETTINGS_CATEGORY_ICON)));
DeviceTypeKitInformation::setDeviceTypeId(newKit, Core::Id(Constants::ANDROID_DEVICE_TYPE));
ToolChainKitInformation::setToolChain(newKit, tc);
QtSupport::QtKitInformation::setQtVersion(newKit, qt);
......@@ -1203,7 +1203,7 @@ void AndroidConfigurations::updateAutomaticKitList()
}
foreach (Kit *k, existingKits) {
ProjectExplorer::ToolChain *tc = ToolChainKitInformation::toolChain(k);
ToolChain *tc = ToolChainKitInformation::toolChain(k);
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k);
if (tc && tc->type() == QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE)
&& qtVersion && qtVersion->type() == QLatin1String(Constants::ANDROIDQT)) {
......@@ -1319,7 +1319,7 @@ void AndroidConfigurations::load()
} else if (HostOsInfo::isMacHost()) {
QString javaHome = QLatin1String("/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home");
if (QFileInfo::exists(javaHome))
m_config.setOpenJDKLocation(Utils::FileName::fromString(javaHome));
m_config.setOpenJDKLocation(FileName::fromString(javaHome));
} else if (HostOsInfo::isWindowsHost()) {
QSettings settings(QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Javasoft\\Java Development Kit"), QSettings::NativeFormat);
QStringList allVersions = settings.childGroups();
......@@ -1366,7 +1366,7 @@ void AndroidConfigurations::updateAndroidDevice()
{
DeviceManager * const devMgr = DeviceManager::instance();
if (m_instance->m_config.adbToolPath().exists())
devMgr->addDevice(IDevice::Ptr(new Internal::AndroidDevice));
devMgr->addDevice(IDevice::Ptr(new AndroidDevice));
else if (devMgr->find(Constants::ANDROID_DEVICE_ID))
devMgr->removeDevice(Core::Id(Constants::ANDROID_DEVICE_ID));
}
......
......@@ -90,8 +90,8 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.displayName = AndroidManager::packageName(target);
params.remoteSetupNeeded = true;
Debugger::DebuggerRunConfigurationAspect *aspect
= runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
DebuggerRunConfigurationAspect *aspect
= runConfig->extraAspect<DebuggerRunConfigurationAspect>();
if (aspect->useCppDebugger()) {
params.languages |= CppLanguage;
Kit *kit = target->kit();
......@@ -135,8 +135,8 @@ AndroidDebugSupport::AndroidDebugSupport(AndroidRunConfiguration *runConfig,
connect(m_runControl, SIGNAL(finished()),
m_runner, SLOT(stop()));
Debugger::DebuggerRunConfigurationAspect *aspect
= runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
DebuggerRunConfigurationAspect *aspect
= runConfig->extraAspect<DebuggerRunConfigurationAspect>();
Q_ASSERT(aspect->useCppDebugger() || aspect->useQmlDebugger());
Q_UNUSED(aspect)
......
......@@ -42,7 +42,7 @@
using namespace Android;
using namespace Internal;
Android::Internal::AndroidManifestEditor::AndroidManifestEditor(AndroidManifestEditorWidget *editorWidget)
AndroidManifestEditor::AndroidManifestEditor(AndroidManifestEditorWidget *editorWidget)
: Core::IEditor(editorWidget), m_toolBar(0)
{
m_toolBar = new QToolBar(editorWidget);
......
......@@ -53,7 +53,7 @@ QString AndroidPotentialKit::displayName() const
return tr("Configure Android...");
}
void Android::Internal::AndroidPotentialKit::executeFromMenu()
void AndroidPotentialKit::executeFromMenu()
{
Core::ICore::showOptionsDialog(Constants::ANDROID_SETTINGS_CATEGORY,
Constants::ANDROID_SETTINGS_ID);
......
......@@ -88,20 +88,20 @@ QString AndroidQtVersion::invalidReason() const
return tmp;
}
QList<ProjectExplorer::Abi> AndroidQtVersion::detectQtAbis() const
QList<Abi> AndroidQtVersion::detectQtAbis() const
{
QList<ProjectExplorer::Abi> abis = qtAbisFromLibrary(qtCorePaths(versionInfo(), qtVersionString()));
QList<Abi> abis = qtAbisFromLibrary(qtCorePaths(versionInfo(), qtVersionString()));
for (int i = 0; i < abis.count(); ++i) {
abis[i] = Abi(abis.at(i).architecture(),
abis.at(i).os(),
ProjectExplorer::Abi::AndroidLinuxFlavor,
Abi::AndroidLinuxFlavor,
abis.at(i).binaryFormat(),
abis.at(i).wordWidth());
}
return abis;
}
void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const
void AndroidQtVersion::addToEnvironment(const Kit *k, Utils::Environment &env) const
{
// this env vars are used by qmake mkspecs to generate makefiles (check QTDIR/mkspecs/android-g++/qmake.conf for more info)
env.set(QLatin1String("ANDROID_NDK_HOST"), AndroidConfigurations::currentConfig().toolchainHost());
......
......@@ -56,8 +56,7 @@ AndroidRunControlFactory::AndroidRunControlFactory(QObject *parent)
{
}
bool AndroidRunControlFactory::canRun(RunConfiguration *runConfiguration,
ProjectExplorer::RunMode mode) const
bool AndroidRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const
{
if (mode != NormalRunMode && mode != DebugRunMode && mode != QmlProfilerRunMode)
return false;
......@@ -65,7 +64,7 @@ bool AndroidRunControlFactory::canRun(RunConfiguration *runConfiguration,
}
RunControl *AndroidRunControlFactory::create(RunConfiguration *runConfig,
ProjectExplorer::RunMode mode, QString *errorMessage)
RunMode mode, QString *errorMessage)
{
Q_ASSERT(canRun(runConfig, mode));
AndroidRunConfiguration *rc = qobject_cast<AndroidRunConfiguration *>(runConfig);
......
......@@ -64,16 +64,14 @@ using namespace Utils;
static const char ANDROID_QT_VERSION_KEY[] = "Qt4ProjectManager.Android.QtVersion";
static const char ANDROID_NDK_TC_VERION[] = "Qt4ProjectManager.Android.NDK_TC_VERION";
QMap<ProjectExplorer::Abi::Architecture, QList<int> > AndroidToolChainFactory::m_newestVersionForArch;
Utils::FileName AndroidToolChainFactory::m_ndkLocation;
QMap<Abi::Architecture, QList<int> > AndroidToolChainFactory::m_newestVersionForArch;
FileName AndroidToolChainFactory::m_ndkLocation;
AndroidToolChain::AndroidToolChain(Abi::Architecture arch, const QString &ndkToolChainVersion, Detection d)
: GccToolChain(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID), d),
m_ndkToolChainVersion(ndkToolChainVersion), m_secondaryToolChain(false)
{
ProjectExplorer::Abi abi = ProjectExplorer::Abi(arch, ProjectExplorer::Abi::LinuxOS,
ProjectExplorer::Abi::AndroidLinuxFlavor, ProjectExplorer::Abi::ElfFormat,
32);
Abi abi = Abi(arch, Abi::LinuxOS, Abi::AndroidLinuxFlavor, Abi::ElfFormat, 32);
setTargetAbi(abi);
setDisplayName(QString::fromLatin1("Android GCC (%1-%2)")
.arg(Abi::toString(targetAbi().architecture()))
......@@ -148,7 +146,7 @@ FileName AndroidToolChain::suggestedDebugger() const
FileName AndroidToolChain::suggestedGdbServer() const
{
Utils::FileName path = AndroidConfigurations::currentConfig().ndkLocation();
FileName path = AndroidConfigurations::currentConfig().ndkLocation();
path.appendPath(QString::fromLatin1("prebuilt/android-%1/gdbserver/gdbserver")
.arg(Abi::toString(targetAbi().architecture())));
if (path.exists())
......@@ -160,7 +158,7 @@ FileName AndroidToolChain::suggestedGdbServer() const
if (path.exists())
return path;
return Utils::FileName();
return FileName();
}
QVariantMap AndroidToolChain::toMap() const
......@@ -195,15 +193,13 @@ bool AndroidToolChain::fromMap(const QVariantMap &data)
m_ndkToolChainVersion = command.mid(index + 1);
QString platform = command.left(index);
Abi::Architecture arch = AndroidConfig::architectureForToolChainPrefix(platform);
ProjectExplorer::Abi abi = ProjectExplorer::Abi(arch, ProjectExplorer::Abi::LinuxOS,
ProjectExplorer::Abi::AndroidLinuxFlavor, ProjectExplorer::Abi::ElfFormat,
32);
Abi abi = Abi(arch, Abi::LinuxOS, Abi::AndroidLinuxFlavor, Abi::ElfFormat, 32);
setTargetAbi(abi);
} else {
m_ndkToolChainVersion = data.value(QLatin1String(ANDROID_NDK_TC_VERION)).toString();
}
ProjectExplorer::Abi::Architecture arch = targetAbi().architecture();
Abi::Architecture arch = targetAbi().architecture();
m_secondaryToolChain = AndroidToolChainFactory::versionCompareLess(AndroidToolChainFactory::versionNumberFromString(m_ndkToolChainVersion),
AndroidToolChainFactory::newestToolChainVersionForArch(arch));
return isValid();
......@@ -214,7 +210,7 @@ QList<FileName> AndroidToolChain::suggestedMkspecList() const
return QList<FileName>()<< FileName::fromLatin1("android-g++");
}
QString AndroidToolChain::makeCommand(const Utils::Environment &env) const
QString AndroidToolChain::makeCommand(const Environment &env) const
{
QStringList extraDirectories = AndroidConfigurations::currentConfig().makeExtraSearchDirectories();
if (HostOsInfo::isWindowsHost()) {
......@@ -291,7 +287,7 @@ ToolChain *AndroidToolChainFactory::restore(const QVariantMap &data)
return 0;
}
QList<AndroidToolChainFactory::AndroidToolChainInformation> AndroidToolChainFactory::toolchainPathsForNdk(const Utils::FileName &ndkPath)
QList<AndroidToolChainFactory::AndroidToolChainInformation> AndroidToolChainFactory::toolchainPathsForNdk(const FileName &ndkPath)
{
QList<AndroidToolChainInformation> result;
if (ndkPath.isEmpty())
......@@ -364,7 +360,7 @@ bool AndroidToolChainFactory::versionCompareLess(AndroidToolChain *atc, AndroidT
return versionCompareLess(a, b);
}
QList<ToolChain *> AndroidToolChainFactory::createToolChainsForNdk(const Utils::FileName &ndkPath)
QList<ToolChain *> AndroidToolChainFactory::createToolChainsForNdk(const FileName &ndkPath)
{
QList<ToolChain *> result;
if (ndkPath.isEmpty())
......
......@@ -358,5 +358,5 @@ void CreateAndroidManifestWizard::createAndroidTemplateFiles()
void CreateAndroidManifestWizard::accept()
{
createAndroidTemplateFiles();
Utils::Wizard::accept();
Wizard::accept();
}
......@@ -137,7 +137,7 @@ bool QmakeAndroidBuildApkStepFactory::canHandle(ProjectExplorer::Target *t) cons
QmakeAndroidBuildApkStep::QmakeAndroidBuildApkStep(ProjectExplorer::BuildStepList *bc)
:Android::AndroidBuildApkStep(bc, ANDROID_BUILD_APK_ID)
:AndroidBuildApkStep(bc, ANDROID_BUILD_APK_ID)
{
ctor();
}
......@@ -151,7 +151,7 @@ QString QmakeAndroidBuildApkStep::proFilePathForInputFile() const
}
QmakeAndroidBuildApkStep::QmakeAndroidBuildApkStep(ProjectExplorer::BuildStepList *bc, QmakeAndroidBuildApkStep *other)
: Android::AndroidBuildApkStep(bc, other)
: AndroidBuildApkStep(bc, other)
{
ctor();
}
......@@ -175,7 +175,7 @@ bool QmakeAndroidBuildApkStep::init()
if (AndroidManager::checkForQt51Files(project()->projectDirectory()))
emit addOutput(tr("Found old folder \"android\" in source directory. Qt 5.2 does not use that folder by default."), ErrorOutput);
if (!Android::AndroidBuildApkStep::init())
if (!AndroidBuildApkStep::init())
return false;
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
......@@ -305,12 +305,12 @@ ProjectExplorer::BuildStepConfigWidget *QmakeAndroidBuildApkStep::createConfigWi
bool QmakeAndroidBuildApkStep::fromMap(const QVariantMap &map)
{
return Android::AndroidBuildApkStep::fromMap(map);
return AndroidBuildApkStep::fromMap(map);
}
QVariantMap QmakeAndroidBuildApkStep::toMap() const
{
QVariantMap map = Android::AndroidBuildApkStep::toMap();
QVariantMap map = AndroidBuildApkStep::toMap();
return map;
}
......
......@@ -58,7 +58,7 @@ static QString pathFromId(const Core::Id id)
}
QmakeAndroidRunConfigurationFactory::QmakeAndroidRunConfigurationFactory(QObject *parent)
: ProjectExplorer::IRunConfigurationFactory(parent)
: IRunConfigurationFactory(parent)
{
}
......@@ -136,10 +136,10 @@ bool QmakeAndroidRunConfigurationFactory::canHandle(Target *t) const
#ifdef Q_CC_GCC
# warning FIX ME !!!
#endif
QList<RunConfiguration *> QmakeAndroidRunConfigurationFactory::runConfigurationsForNode(Target *t, ProjectExplorer::Node *n)
QList<RunConfiguration *> QmakeAndroidRunConfigurationFactory::runConfigurationsForNode(Target *t, Node *n)
{
QList<ProjectExplorer::RunConfiguration *> result;
foreach (ProjectExplorer::RunConfiguration *rc, t->runConfigurations())
QList<RunConfiguration *> result;
foreach (RunConfiguration *rc, t->runConfigurations())
if (QmakeAndroidRunConfiguration *qt4c = qobject_cast<QmakeAndroidRunConfiguration *>(rc))
if (qt4c->proFilePath() == n->path())
result << rc;
......
......@@ -112,18 +112,18 @@ Utils::FileName QmakeAndroidSupport::androiddeployqtPath(ProjectExplorer::Target
Utils::FileName QmakeAndroidSupport::androiddeployJsonPath(ProjectExplorer::Target *target) const
{
const auto *pro = static_cast<QmakeProjectManager::QmakeProject *>(target->project());
const auto *pro = static_cast<QmakeProject *>(target->project());
QmakeAndroidBuildApkStep *buildApkStep
= Android::AndroidGlobal::buildStep<QmakeAndroidBuildApkStep>(target->activeBuildConfiguration());
if (!buildApkStep) // should never happen
return Utils::FileName();
const QmakeProjectManager::QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(buildApkStep->proFilePathForInputFile());
const QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(buildApkStep->proFilePathForInputFile());
if (!node) // should never happen
return Utils::FileName();
QString inputFile = node->singleVariableValue(QmakeProjectManager::AndroidDeploySettingsFile);
QString inputFile = node->singleVariableValue(AndroidDeploySettingsFile);
if (inputFile.isEmpty()) // should never happen
return Utils::FileName();
......
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