forked from qt-creator/qt-creator
Misc: 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: I919da493d0629b719d328e5e71c96a29d230dfd1
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
using namespace bb::cascades;
|
using namespace bb::cascades;
|
||||||
|
|
||||||
ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
|
ApplicationUI::ApplicationUI(Application *app) :
|
||||||
QObject(app)
|
QObject(app)
|
||||||
{
|
{
|
||||||
// By default the QmlDocument object is owned by the Application instance
|
// By default the QmlDocument object is owned by the Application instance
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ enum { debugLeaks = 0 };
|
|||||||
loading.
|
loading.
|
||||||
\code
|
\code
|
||||||
// 'plugins' and subdirs will be searched for plugins
|
// 'plugins' and subdirs will be searched for plugins
|
||||||
ExtensionSystem::PluginManager::setPluginPaths(QStringList() << "plugins");
|
PluginManager::setPluginPaths(QStringList() << "plugins");
|
||||||
ExtensionSystem::PluginManager::loadPlugins(); // try to load all the plugins
|
PluginManager::loadPlugins(); // try to load all the plugins
|
||||||
\endcode
|
\endcode
|
||||||
Additionally, it is possible to directly access the plugin specifications
|
Additionally, it is possible to directly access the plugin specifications
|
||||||
(the information in the descriptor file), the plugin instances (via PluginSpec),
|
(the information in the descriptor file), the plugin instances (via PluginSpec),
|
||||||
@@ -129,10 +129,10 @@ enum { debugLeaks = 0 };
|
|||||||
// Plugin A provides a "MimeTypeHandler" extension point
|
// Plugin A provides a "MimeTypeHandler" extension point
|
||||||
// in plugin B:
|
// in plugin B:
|
||||||
MyMimeTypeHandler *handler = new MyMimeTypeHandler();
|
MyMimeTypeHandler *handler = new MyMimeTypeHandler();
|
||||||
ExtensionSystem::PluginManager::instance()->addObject(handler);
|
PluginManager::instance()->addObject(handler);
|
||||||
// In plugin A:
|
// In plugin A:
|
||||||
QList<MimeTypeHandler *> mimeHandlers =
|
QList<MimeTypeHandler *> mimeHandlers =
|
||||||
ExtensionSystem::PluginManager::getObjects<MimeTypeHandler>();
|
PluginManager::getObjects<MimeTypeHandler>();
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ using namespace ExtensionSystem::Internal;
|
|||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
uint ExtensionSystem::qHash(const ExtensionSystem::PluginDependency &value)
|
uint ExtensionSystem::qHash(const PluginDependency &value)
|
||||||
{
|
{
|
||||||
return qHash(value.name);
|
return qHash(value.name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ PluginView::PluginView(QWidget *parent)
|
|||||||
m_categoryView->setColumnWidth(LoadedColumn, 40);
|
m_categoryView->setColumnWidth(LoadedColumn, 40);
|
||||||
m_categoryView->header()->setDefaultSectionSize(120);
|
m_categoryView->header()->setDefaultSectionSize(120);
|
||||||
m_categoryView->header()->setMinimumSectionSize(35);
|
m_categoryView->header()->setMinimumSectionSize(35);
|
||||||
m_categoryView->setActivationMode(Utils::DoubleClickActivation);
|
m_categoryView->setActivationMode(DoubleClickActivation);
|
||||||
m_categoryView->setSelectionMode(QAbstractItemView::SingleSelection);
|
m_categoryView->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
m_categoryView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
m_categoryView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ bool DiagnosticMessage::isError() const
|
|||||||
return _kind == Error;
|
return _kind == Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GLSL::DiagnosticMessage::isWarning() const
|
bool DiagnosticMessage::isWarning() const
|
||||||
{
|
{
|
||||||
return _kind == Warning;
|
return _kind == Warning;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -378,8 +378,8 @@ bool Semantic::visit(FunctionCallExpressionAST *ast)
|
|||||||
_engine->error(ast->lineno, QString::fromLatin1("too many arguments"));
|
_engine->error(ast->lineno, QString::fromLatin1("too many arguments"));
|
||||||
_expr.type = funTy->returnType();
|
_expr.type = funTy->returnType();
|
||||||
} else if (const OverloadSet *overloads = id.type->asOverloadSetType()) {
|
} else if (const OverloadSet *overloads = id.type->asOverloadSetType()) {
|
||||||
QVector<GLSL::Function *> candidates;
|
QVector<Function *> candidates;
|
||||||
foreach (GLSL::Function *f, overloads->functions()) {
|
foreach (Function *f, overloads->functions()) {
|
||||||
if (f->argumentCount() == actuals.size()) {
|
if (f->argumentCount() == actuals.size()) {
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
for (; argc < actuals.size(); ++argc) {
|
for (; argc < actuals.size(); ++argc) {
|
||||||
|
|||||||
@@ -263,10 +263,10 @@ bool SshEncryptionFacility::createAuthenticationKeyFromPKCS8(const QByteArray &p
|
|||||||
qWarning("%s: Unexpected code flow, expected success or exception.", Q_FUNC_INFO);
|
qWarning("%s: Unexpected code flow, expected success or exception.", Q_FUNC_INFO);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (const Botan::Exception &ex) {
|
} catch (const Exception &ex) {
|
||||||
error = QLatin1String(ex.what());
|
error = QLatin1String(ex.what());
|
||||||
return false;
|
return false;
|
||||||
} catch (const Botan::Decoding_Error &ex) {
|
} catch (const Decoding_Error &ex) {
|
||||||
error = QLatin1String(ex.what());
|
error = QLatin1String(ex.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -334,10 +334,10 @@ bool SshEncryptionFacility::createAuthenticationKeyFromOpenSSL(const QByteArray
|
|||||||
|
|
||||||
sequence.discard_remaining();
|
sequence.discard_remaining();
|
||||||
sequence.verify_end();
|
sequence.verify_end();
|
||||||
} catch (const Botan::Exception &ex) {
|
} catch (const Exception &ex) {
|
||||||
error = QLatin1String(ex.what());
|
error = QLatin1String(ex.what());
|
||||||
return false;
|
return false;
|
||||||
} catch (const Botan::Decoding_Error &ex) {
|
} catch (const Decoding_Error &ex) {
|
||||||
error = QLatin1String(ex.what());
|
error = QLatin1String(ex.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,20 +78,20 @@ bool SshKeyGenerator::generateKeys(KeyType type, PrivateKeyFormat format, int ke
|
|||||||
generateOpenSslPublicKeyString(key);
|
generateOpenSslPublicKeyString(key);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (const Botan::Exception &e) {
|
} catch (const Exception &e) {
|
||||||
m_error = tr("Error generating key: %1").arg(QString::fromLatin1(e.what()));
|
m_error = tr("Error generating key: %1").arg(QString::fromLatin1(e.what()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SshKeyGenerator::generatePkcs8KeyStrings(const KeyPtr &key, Botan::RandomNumberGenerator &rng)
|
void SshKeyGenerator::generatePkcs8KeyStrings(const KeyPtr &key, RandomNumberGenerator &rng)
|
||||||
{
|
{
|
||||||
generatePkcs8KeyString(key, false, rng);
|
generatePkcs8KeyString(key, false, rng);
|
||||||
generatePkcs8KeyString(key, true, rng);
|
generatePkcs8KeyString(key, true, rng);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SshKeyGenerator::generatePkcs8KeyString(const KeyPtr &key, bool privateKey,
|
void SshKeyGenerator::generatePkcs8KeyString(const KeyPtr &key, bool privateKey,
|
||||||
Botan::RandomNumberGenerator &rng)
|
RandomNumberGenerator &rng)
|
||||||
{
|
{
|
||||||
Pipe pipe;
|
Pipe pipe;
|
||||||
pipe.start_msg();
|
pipe.start_msg();
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ bool ToolTip::pinToolTip(QWidget *w, QWidget *parent)
|
|||||||
// Find the parent WidgetTip, tell it to pin/release the
|
// Find the parent WidgetTip, tell it to pin/release the
|
||||||
// widget and close.
|
// widget and close.
|
||||||
for (QWidget *p = w->parentWidget(); p ; p = p->parentWidget()) {
|
for (QWidget *p = w->parentWidget(); p ; p = p->parentWidget()) {
|
||||||
if (Internal::WidgetTip *wt = qobject_cast<Internal::WidgetTip *>(p)) {
|
if (WidgetTip *wt = qobject_cast<WidgetTip *>(p)) {
|
||||||
wt->pinToolTipWidget(parent);
|
wt->pinToolTipWidget(parent);
|
||||||
ToolTip::hide();
|
ToolTip::hide();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ public slots:
|
|||||||
void startTool();
|
void startTool();
|
||||||
void selectToolboxAction(int);
|
void selectToolboxAction(int);
|
||||||
void selectMenuAction();
|
void selectMenuAction();
|
||||||
void modeChanged(Core::IMode *mode);
|
void modeChanged(IMode *mode);
|
||||||
void resetLayout();
|
void resetLayout();
|
||||||
void updateRunActions();
|
void updateRunActions();
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ using namespace ProjectExplorer;
|
|||||||
namespace Analyzer {
|
namespace Analyzer {
|
||||||
|
|
||||||
AnalyzerRunControl::AnalyzerRunControl(const AnalyzerStartParameters &sp,
|
AnalyzerRunControl::AnalyzerRunControl(const AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
RunConfiguration *runConfiguration)
|
||||||
: RunControl(runConfiguration, sp.runMode)
|
: RunControl(runConfiguration, sp.runMode)
|
||||||
{
|
{
|
||||||
setIcon(QLatin1String(":/images/analyzer_start_small.png"));
|
setIcon(QLatin1String(":/images/analyzer_start_small.png"));
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ using namespace ProjectExplorer::Constants;
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// AutotoolsBuildConfiguration class
|
// AutotoolsBuildConfiguration class
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(ProjectExplorer::Target *parent)
|
AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent)
|
||||||
: BuildConfiguration(parent, Core::Id(AUTOTOOLS_BC_ID))
|
: BuildConfiguration(parent, Core::Id(AUTOTOOLS_BC_ID))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@@ -71,11 +71,11 @@ NamedWidget *AutotoolsBuildConfiguration::createConfigWidget()
|
|||||||
return new AutotoolsBuildSettingsWidget(this);
|
return new AutotoolsBuildSettingsWidget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(ProjectExplorer::Target *parent, Core::Id id)
|
AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent, Core::Id id)
|
||||||
: BuildConfiguration(parent, id)
|
: BuildConfiguration(parent, id)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(ProjectExplorer::Target *parent,
|
AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent,
|
||||||
AutotoolsBuildConfiguration *source)
|
AutotoolsBuildConfiguration *source)
|
||||||
: BuildConfiguration(parent, source)
|
: BuildConfiguration(parent, source)
|
||||||
{
|
{
|
||||||
@@ -173,7 +173,7 @@ bool AutotoolsBuildConfigurationFactory::canHandle(const Target *t) const
|
|||||||
return t->project()->id() == Constants::AUTOTOOLS_PROJECT_ID;
|
return t->project()->id() == Constants::AUTOTOOLS_PROJECT_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildInfo *AutotoolsBuildConfigurationFactory::createBuildInfo(const ProjectExplorer::Kit *k,
|
BuildInfo *AutotoolsBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||||
const Utils::FileName &buildDir) const
|
const Utils::FileName &buildDir) const
|
||||||
{
|
{
|
||||||
BuildInfo *info = new BuildInfo(this);
|
BuildInfo *info = new BuildInfo(this);
|
||||||
@@ -230,7 +230,7 @@ void AutotoolsBuildConfiguration::setBuildDirectory(const Utils::FileName &direc
|
|||||||
if (directory == buildDirectory())
|
if (directory == buildDirectory())
|
||||||
return;
|
return;
|
||||||
BuildConfiguration::setBuildDirectory(directory);
|
BuildConfiguration::setBuildDirectory(directory);
|
||||||
ProjectExplorer::BuildStepList *bsl = stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
BuildStepList *bsl = stepList(BUILDSTEPS_BUILD);
|
||||||
foreach (BuildStep *bs, bsl->steps()) {
|
foreach (BuildStep *bs, bsl->steps()) {
|
||||||
ConfigureStep *cs = qobject_cast<ConfigureStep *>(bs);
|
ConfigureStep *cs = qobject_cast<ConfigureStep *>(bs);
|
||||||
if (cs) {
|
if (cs) {
|
||||||
|
|||||||
@@ -51,10 +51,10 @@ bool AutotoolsProjectNode::showInSimpleTree() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<ProjectExplorer::ProjectAction> AutotoolsProjectNode::supportedActions(Node *node) const
|
QList<ProjectAction> AutotoolsProjectNode::supportedActions(Node *node) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(node);
|
Q_UNUSED(node);
|
||||||
return QList<ProjectExplorer::ProjectAction>();
|
return QList<ProjectAction>();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AutotoolsProjectNode::canAddSubProject(const QString &proFilePath) const
|
bool AutotoolsProjectNode::canAddSubProject(const QString &proFilePath) const
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ void MakeStepConfigWidget::updateDetails()
|
|||||||
BuildConfiguration *bc = m_makeStep->buildConfiguration();
|
BuildConfiguration *bc = m_makeStep->buildConfiguration();
|
||||||
if (!bc)
|
if (!bc)
|
||||||
bc = m_makeStep->target()->activeBuildConfiguration();
|
bc = m_makeStep->target()->activeBuildConfiguration();
|
||||||
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(m_makeStep->target()->kit());
|
ToolChain *tc = ToolChainKitInformation::toolChain(m_makeStep->target()->kit());
|
||||||
|
|
||||||
if (tc) {
|
if (tc) {
|
||||||
QString arguments = Utils::QtcProcess::joinArgs(m_makeStep->m_buildTargets);
|
QString arguments = Utils::QtcProcess::joinArgs(m_makeStep->m_buildTargets);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ BareMetalDevice::IDevice::Ptr BareMetalDevice::clone() const
|
|||||||
|
|
||||||
DeviceProcessSignalOperation::Ptr BareMetalDevice::signalOperation() const
|
DeviceProcessSignalOperation::Ptr BareMetalDevice::signalOperation() const
|
||||||
{
|
{
|
||||||
return ProjectExplorer::DeviceProcessSignalOperation::Ptr();
|
return DeviceProcessSignalOperation::Ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BareMetalDevice::displayType() const
|
QString BareMetalDevice::displayType() const
|
||||||
@@ -98,7 +98,7 @@ QString BareMetalDevice::displayType() const
|
|||||||
return QCoreApplication::translate("BareMetal::Internal::BareMetalDevice", "Bare Metal");
|
return QCoreApplication::translate("BareMetal::Internal::BareMetalDevice", "Bare Metal");
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::IDeviceWidget *BareMetalDevice::createWidget()
|
IDeviceWidget *BareMetalDevice::createWidget()
|
||||||
{
|
{
|
||||||
return new BareMetalDeviceConfigurationWidget(sharedFromThis());
|
return new BareMetalDeviceConfigurationWidget(sharedFromThis());
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ void BareMetalDevice::executeAction(Core::Id actionId, QWidget *parent)
|
|||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::DeviceProcess *BareMetalDevice::createProcess(QObject *parent) const
|
DeviceProcess *BareMetalDevice::createProcess(QObject *parent) const
|
||||||
{
|
{
|
||||||
return new GdbServerProviderProcess(sharedFromThis(), parent);
|
return new GdbServerProviderProcess(sharedFromThis(), parent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ QVariantMap BareMetalGdbCommandsDeployStep::toMap() const
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::BuildStepConfigWidget *BareMetalGdbCommandsDeployStep::createConfigWidget()
|
BuildStepConfigWidget *BareMetalGdbCommandsDeployStep::createConfigWidget()
|
||||||
{
|
{
|
||||||
return new BareMetalGdbCommandsDeployStepWidget(*this);
|
return new BareMetalGdbCommandsDeployStepWidget(*this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ QString BareMetalRunConfiguration::defaultDisplayName()
|
|||||||
QString BareMetalRunConfiguration::localExecutableFilePath() const
|
QString BareMetalRunConfiguration::localExecutableFilePath() const
|
||||||
{
|
{
|
||||||
return target()->applicationTargets()
|
return target()->applicationTargets()
|
||||||
.targetForProject(Utils::FileName::fromString(m_projectFilePath)).toString();
|
.targetForProject(FileName::fromString(m_projectFilePath)).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BareMetalRunConfiguration::arguments() const
|
QString BareMetalRunConfiguration::arguments() const
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ static QString pathFromId(Core::Id id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BareMetalRunConfigurationFactory::BareMetalRunConfigurationFactory(QObject *parent) :
|
BareMetalRunConfigurationFactory::BareMetalRunConfigurationFactory(QObject *parent) :
|
||||||
ProjectExplorer::IRunConfigurationFactory(parent)
|
IRunConfigurationFactory(parent)
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("BareMetalRunConfigurationFactory"));
|
setObjectName(QLatin1String("BareMetalRunConfigurationFactory"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace BareMetal {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
BareMetalRunControlFactory::BareMetalRunControlFactory(QObject *parent) :
|
BareMetalRunControlFactory::BareMetalRunControlFactory(QObject *parent) :
|
||||||
ProjectExplorer::IRunControlFactory(parent)
|
IRunControlFactory(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public:
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class BinEditorFind : public Core::IFindSupport
|
class BinEditorFind : public IFindSupport
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public:
|
|||||||
QString currentFindString() const { return QString(); }
|
QString currentFindString() const { return QString(); }
|
||||||
QString completedFindString() const { return QString(); }
|
QString completedFindString() const { return QString(); }
|
||||||
|
|
||||||
Core::FindFlags supportedFindFlags() const
|
FindFlags supportedFindFlags() const
|
||||||
{
|
{
|
||||||
return FindBackward | FindCaseSensitively;
|
return FindBackward | FindCaseSensitively;
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ public:
|
|||||||
m_incrementalWrappedState = false;
|
m_incrementalWrappedState = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void highlightAll(const QString &txt, Core::FindFlags findFlags)
|
virtual void highlightAll(const QString &txt, FindFlags findFlags)
|
||||||
{
|
{
|
||||||
m_widget->highlightSearchResults(txt.toLatin1(), textDocumentFlagsForFindFlags(findFlags));
|
m_widget->highlightSearchResults(txt.toLatin1(), textDocumentFlagsForFindFlags(findFlags));
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ public:
|
|||||||
m_widget->highlightSearchResults(QByteArray());
|
m_widget->highlightSearchResults(QByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
int find(const QByteArray &pattern, int pos, Core::FindFlags findFlags, bool *wrapped)
|
int find(const QByteArray &pattern, int pos, FindFlags findFlags, bool *wrapped)
|
||||||
{
|
{
|
||||||
if (wrapped)
|
if (wrapped)
|
||||||
*wrapped = false;
|
*wrapped = false;
|
||||||
@@ -149,7 +149,7 @@ public:
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result findIncremental(const QString &txt, Core::FindFlags findFlags) {
|
Result findIncremental(const QString &txt, FindFlags findFlags) {
|
||||||
QByteArray pattern = txt.toLatin1();
|
QByteArray pattern = txt.toLatin1();
|
||||||
if (pattern != m_lastPattern)
|
if (pattern != m_lastPattern)
|
||||||
resetIncrementalSearch(); // Because we don't search for nibbles.
|
resetIncrementalSearch(); // Because we don't search for nibbles.
|
||||||
@@ -184,7 +184,7 @@ public:
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result findStep(const QString &txt, Core::FindFlags findFlags) {
|
Result findStep(const QString &txt, FindFlags findFlags) {
|
||||||
QByteArray pattern = txt.toLatin1();
|
QByteArray pattern = txt.toLatin1();
|
||||||
bool wasReset = (m_incrementalStartPos < 0);
|
bool wasReset = (m_incrementalStartPos < 0);
|
||||||
if (m_contPos == -1) {
|
if (m_contPos == -1) {
|
||||||
@@ -224,12 +224,12 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class BinEditorDocument : public Core::IDocument
|
class BinEditorDocument : public IDocument
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
BinEditorDocument(BinEditorWidget *parent) :
|
BinEditorDocument(BinEditorWidget *parent) :
|
||||||
Core::IDocument(parent)
|
IDocument(parent)
|
||||||
{
|
{
|
||||||
setId(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
setId(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
||||||
setMimeType(QLatin1String(BinEditor::Constants::C_BINEDITOR_MIMETYPE));
|
setMimeType(QLatin1String(BinEditor::Constants::C_BINEDITOR_MIMETYPE));
|
||||||
@@ -274,14 +274,14 @@ public:
|
|||||||
if (errorString)
|
if (errorString)
|
||||||
*errorString = msg;
|
*errorString = msg;
|
||||||
else
|
else
|
||||||
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"), msg);
|
QMessageBox::critical(ICore::mainWindow(), tr("File Error"), msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (offset >= size)
|
if (offset >= size)
|
||||||
return false;
|
return false;
|
||||||
if (file.open(QIODevice::ReadOnly)) {
|
if (file.open(QIODevice::ReadOnly)) {
|
||||||
file.close();
|
file.close();
|
||||||
setFilePath(Utils::FileName::fromString(fileName));
|
setFilePath(FileName::fromString(fileName));
|
||||||
m_widget->setSizes(offset, file.size());
|
m_widget->setSizes(offset, file.size());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -290,7 +290,7 @@ public:
|
|||||||
if (errorString)
|
if (errorString)
|
||||||
*errorString = errStr;
|
*errorString = errStr;
|
||||||
else
|
else
|
||||||
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"), errStr);
|
QMessageBox::critical(ICore::mainWindow(), tr("File Error"), errStr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@ private slots:
|
|||||||
data += QByteArray(blockSize - dataSize, 0);
|
data += QByteArray(blockSize - dataSize, 0);
|
||||||
m_widget->addData(block, data);
|
m_widget->addData(block, data);
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"),
|
QMessageBox::critical(ICore::mainWindow(), tr("File Error"),
|
||||||
tr("Cannot open %1: %2").arg(
|
tr("Cannot open %1: %2").arg(
|
||||||
fn.toUserOutput(), file.errorString()));
|
fn.toUserOutput(), file.errorString()));
|
||||||
}
|
}
|
||||||
@@ -361,7 +361,7 @@ private:
|
|||||||
BinEditorWidget *m_widget;
|
BinEditorWidget *m_widget;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BinEditor : public Core::IEditor
|
class BinEditor : public IEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@@ -406,7 +406,7 @@ public:
|
|||||||
QTC_ASSERT(fileName == realFileName, return false); // The bineditor can do no autosaving
|
QTC_ASSERT(fileName == realFileName, return false); // The bineditor can do no autosaving
|
||||||
return m_file->open(errorString, fileName);
|
return m_file->open(errorString, fileName);
|
||||||
}
|
}
|
||||||
Core::IDocument *document() { return m_file; }
|
IDocument *document() { return m_file; }
|
||||||
|
|
||||||
QWidget *toolBar() { return m_toolBar; }
|
QWidget *toolBar() { return m_toolBar; }
|
||||||
|
|
||||||
@@ -445,7 +445,7 @@ BinEditorFactory::BinEditorFactory(BinEditorPlugin *owner) :
|
|||||||
addMimeType(Constants::C_BINEDITOR_MIMETYPE);
|
addMimeType(Constants::C_BINEDITOR_MIMETYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IEditor *BinEditorFactory::createEditor()
|
IEditor *BinEditorFactory::createEditor()
|
||||||
{
|
{
|
||||||
BinEditorWidget *widget = new BinEditorWidget();
|
BinEditorWidget *widget = new BinEditorWidget();
|
||||||
BinEditor *editor = new BinEditor(widget);
|
BinEditor *editor = new BinEditor(widget);
|
||||||
@@ -466,14 +466,14 @@ BinEditorPlugin::~BinEditorPlugin()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction *BinEditorPlugin::registerNewAction(Core::Id id, const QString &title)
|
QAction *BinEditorPlugin::registerNewAction(Id id, const QString &title)
|
||||||
{
|
{
|
||||||
QAction *result = new QAction(title, this);
|
QAction *result = new QAction(title, this);
|
||||||
Core::ActionManager::registerAction(result, id, m_context);
|
ActionManager::registerAction(result, id, m_context);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction *BinEditorPlugin::registerNewAction(Core::Id id,
|
QAction *BinEditorPlugin::registerNewAction(Id id,
|
||||||
QObject *receiver,
|
QObject *receiver,
|
||||||
const char *slot,
|
const char *slot,
|
||||||
const QString &title)
|
const QString &title)
|
||||||
@@ -522,7 +522,7 @@ void BinEditorPlugin::extensionsInitialized()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void BinEditorPlugin::updateCurrentEditor(Core::IEditor *editor)
|
void BinEditorPlugin::updateCurrentEditor(IEditor *editor)
|
||||||
{
|
{
|
||||||
BinEditorWidget *binEditor = 0;
|
BinEditorWidget *binEditor = 0;
|
||||||
if (editor)
|
if (editor)
|
||||||
|
|||||||
@@ -209,17 +209,17 @@ void BookmarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
|||||||
}
|
}
|
||||||
|
|
||||||
BookmarkView::BookmarkView(BookmarkManager *manager) :
|
BookmarkView::BookmarkView(BookmarkManager *manager) :
|
||||||
m_bookmarkContext(new Core::IContext(this)),
|
m_bookmarkContext(new IContext(this)),
|
||||||
m_manager(manager)
|
m_manager(manager)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("Bookmarks"));
|
setWindowTitle(tr("Bookmarks"));
|
||||||
|
|
||||||
m_bookmarkContext->setWidget(this);
|
m_bookmarkContext->setWidget(this);
|
||||||
m_bookmarkContext->setContext(Core::Context(Constants::BOOKMARKS_CONTEXT));
|
m_bookmarkContext->setContext(Context(Constants::BOOKMARKS_CONTEXT));
|
||||||
|
|
||||||
ICore::addContextObject(m_bookmarkContext);
|
ICore::addContextObject(m_bookmarkContext);
|
||||||
|
|
||||||
Utils::ListView::setModel(manager);
|
ListView::setModel(manager);
|
||||||
|
|
||||||
setItemDelegate(new BookmarkDelegate(this));
|
setItemDelegate(new BookmarkDelegate(this));
|
||||||
setFrameStyle(QFrame::NoFrame);
|
setFrameStyle(QFrame::NoFrame);
|
||||||
@@ -289,12 +289,12 @@ void BookmarkView::keyPressEvent(QKeyEvent *event)
|
|||||||
event->accept();
|
event->accept();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Utils::ListView::keyPressEvent(event);
|
ListView::keyPressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarkView::removeAll()
|
void BookmarkView::removeAll()
|
||||||
{
|
{
|
||||||
if (Utils::CheckableMessageBox::doNotAskAgainQuestion(this,
|
if (CheckableMessageBox::doNotAskAgainQuestion(this,
|
||||||
tr("Remove All Bookmarks"),
|
tr("Remove All Bookmarks"),
|
||||||
tr("Are you sure you want to remove all bookmarks from all files in the current session?"),
|
tr("Are you sure you want to remove all bookmarks from all files in the current session?"),
|
||||||
ICore::settings(),
|
ICore::settings(),
|
||||||
@@ -323,7 +323,7 @@ BookmarkManager::BookmarkManager() :
|
|||||||
m_bookmarkIcon(QLatin1String(":/bookmarks/images/bookmark.png")),
|
m_bookmarkIcon(QLatin1String(":/bookmarks/images/bookmark.png")),
|
||||||
m_selectionModel(new QItemSelectionModel(this, this))
|
m_selectionModel(new QItemSelectionModel(this, this))
|
||||||
{
|
{
|
||||||
connect(Core::ICore::instance(), &ICore::contextChanged,
|
connect(ICore::instance(), &ICore::contextChanged,
|
||||||
this, &BookmarkManager::updateActionStatus);
|
this, &BookmarkManager::updateActionStatus);
|
||||||
|
|
||||||
connect(SessionManager::instance(), &SessionManager::sessionLoaded,
|
connect(SessionManager::instance(), &SessionManager::sessionLoaded,
|
||||||
@@ -421,7 +421,7 @@ QStringList BookmarkManager::mimeTypes() const
|
|||||||
|
|
||||||
QMimeData *BookmarkManager::mimeData(const QModelIndexList &indexes) const
|
QMimeData *BookmarkManager::mimeData(const QModelIndexList &indexes) const
|
||||||
{
|
{
|
||||||
auto data = new Utils::FileDropMimeData;
|
auto data = new FileDropMimeData;
|
||||||
foreach (const QModelIndex &index, indexes) {
|
foreach (const QModelIndex &index, indexes) {
|
||||||
if (!index.isValid() || index.column() != 0 || index.row() < 0 || index.row() >= m_bookmarksList.count())
|
if (!index.isValid() || index.column() != 0 || index.row() < 0 || index.row() >= m_bookmarksList.count())
|
||||||
continue;
|
continue;
|
||||||
@@ -861,7 +861,7 @@ BookmarkViewFactory::BookmarkViewFactory(BookmarkManager *bm)
|
|||||||
setDisplayName(BookmarkView::tr("Bookmarks"));
|
setDisplayName(BookmarkView::tr("Bookmarks"));
|
||||||
setPriority(300);
|
setPriority(300);
|
||||||
setId("Bookmarks");
|
setId("Bookmarks");
|
||||||
setActivationSequence(QKeySequence(Core::UseMacShortcuts ? tr("Alt+Meta+M") : tr("Alt+M")));
|
setActivationSequence(QKeySequence(UseMacShortcuts ? tr("Alt+Meta+M") : tr("Alt+M")));
|
||||||
}
|
}
|
||||||
|
|
||||||
NavigationView BookmarkViewFactory::createWidget()
|
NavigationView BookmarkViewFactory::createWidget()
|
||||||
|
|||||||
@@ -131,15 +131,15 @@ static const char CMD_ID_STATUS[] = "ClearCase.Status";
|
|||||||
|
|
||||||
static const VcsBaseEditorParameters editorParameters[] = {
|
static const VcsBaseEditorParameters editorParameters[] = {
|
||||||
{
|
{
|
||||||
VcsBase::LogOutput,
|
LogOutput,
|
||||||
"ClearCase File Log Editor", // id
|
"ClearCase File Log Editor", // id
|
||||||
QT_TRANSLATE_NOOP("VCS", "ClearCase File Log Editor"), // display_name
|
QT_TRANSLATE_NOOP("VCS", "ClearCase File Log Editor"), // display_name
|
||||||
"text/vnd.qtcreator.clearcase.log"},
|
"text/vnd.qtcreator.clearcase.log"},
|
||||||
{ VcsBase::AnnotateOutput,
|
{ AnnotateOutput,
|
||||||
"ClearCase Annotation Editor", // id
|
"ClearCase Annotation Editor", // id
|
||||||
QT_TRANSLATE_NOOP("VCS", "ClearCase Annotation Editor"), // display_name
|
QT_TRANSLATE_NOOP("VCS", "ClearCase Annotation Editor"), // display_name
|
||||||
"text/vnd.qtcreator.clearcase.annotation"},
|
"text/vnd.qtcreator.clearcase.annotation"},
|
||||||
{ VcsBase::DiffOutput,
|
{ DiffOutput,
|
||||||
"ClearCase Diff Editor", // id
|
"ClearCase Diff Editor", // id
|
||||||
QT_TRANSLATE_NOOP("VCS", "ClearCase Diff Editor"), // display_name
|
QT_TRANSLATE_NOOP("VCS", "ClearCase Diff Editor"), // display_name
|
||||||
"text/x-patch"}
|
"text/x-patch"}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ void SettingsPageWidget::setSettings(const ClearCaseSettings &s)
|
|||||||
m_ui.commandPathChooser->setPath(s.ccCommand);
|
m_ui.commandPathChooser->setPath(s.ccCommand);
|
||||||
m_ui.timeOutSpinBox->setValue(s.timeOutS);
|
m_ui.timeOutSpinBox->setValue(s.timeOutS);
|
||||||
m_ui.autoCheckOutCheckBox->setChecked(s.autoCheckOut);
|
m_ui.autoCheckOutCheckBox->setChecked(s.autoCheckOut);
|
||||||
bool extDiffAvailable = !Utils::Environment::systemEnvironment().searchInPath(QLatin1String("diff")).isEmpty();
|
bool extDiffAvailable = !Environment::systemEnvironment().searchInPath(QLatin1String("diff")).isEmpty();
|
||||||
if (extDiffAvailable) {
|
if (extDiffAvailable) {
|
||||||
m_ui.diffWarningLabel->setVisible(false);
|
m_ui.diffWarningLabel->setVisible(false);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe
|
|||||||
Q_UNUSED(errorMessage)
|
Q_UNUSED(errorMessage)
|
||||||
|
|
||||||
// Create the globalcontext list to register actions accordingly
|
// Create the globalcontext list to register actions accordingly
|
||||||
Core::Context globalcontext(Core::Constants::C_GLOBAL);
|
Context globalcontext(Core::Constants::C_GLOBAL);
|
||||||
|
|
||||||
// Create the settings Page
|
// Create the settings Page
|
||||||
m_settings->fromSettings(Core::ICore::settings());
|
m_settings->fromSettings(ICore::settings());
|
||||||
SettingsPage *settingsPage = new SettingsPage(m_settings);
|
SettingsPage *settingsPage = new SettingsPage(m_settings);
|
||||||
addAutoReleasedObject(settingsPage);
|
addAutoReleasedObject(settingsPage);
|
||||||
|
|
||||||
@@ -151,30 +151,30 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe
|
|||||||
|
|
||||||
//register actions
|
//register actions
|
||||||
|
|
||||||
Core::ActionContainer *toolsContainer =
|
ActionContainer *toolsContainer =
|
||||||
Core::ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
ActionManager::actionContainer(Core::Constants::M_TOOLS);
|
||||||
|
|
||||||
Core::ActionContainer *cpContainer =
|
ActionContainer *cpContainer =
|
||||||
Core::ActionManager::createMenu("CodePaster");
|
ActionManager::createMenu("CodePaster");
|
||||||
cpContainer->menu()->setTitle(tr("&Code Pasting"));
|
cpContainer->menu()->setTitle(tr("&Code Pasting"));
|
||||||
toolsContainer->addMenu(cpContainer);
|
toolsContainer->addMenu(cpContainer);
|
||||||
|
|
||||||
Core::Command *command;
|
Command *command;
|
||||||
|
|
||||||
m_postEditorAction = new QAction(tr("Paste Snippet..."), this);
|
m_postEditorAction = new QAction(tr("Paste Snippet..."), this);
|
||||||
command = Core::ActionManager::registerAction(m_postEditorAction, "CodePaster.Post", globalcontext);
|
command = ActionManager::registerAction(m_postEditorAction, "CodePaster.Post", globalcontext);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+P") : tr("Alt+C,Alt+P")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+P") : tr("Alt+C,Alt+P")));
|
||||||
connect(m_postEditorAction, &QAction::triggered, this, &CodepasterPlugin::pasteSnippet);
|
connect(m_postEditorAction, &QAction::triggered, this, &CodepasterPlugin::pasteSnippet);
|
||||||
cpContainer->addAction(command);
|
cpContainer->addAction(command);
|
||||||
|
|
||||||
m_fetchAction = new QAction(tr("Fetch Snippet..."), this);
|
m_fetchAction = new QAction(tr("Fetch Snippet..."), this);
|
||||||
command = Core::ActionManager::registerAction(m_fetchAction, "CodePaster.Fetch", globalcontext);
|
command = ActionManager::registerAction(m_fetchAction, "CodePaster.Fetch", globalcontext);
|
||||||
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+F") : tr("Alt+C,Alt+F")));
|
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+F") : tr("Alt+C,Alt+F")));
|
||||||
connect(m_fetchAction, &QAction::triggered, this, &CodepasterPlugin::fetch);
|
connect(m_fetchAction, &QAction::triggered, this, &CodepasterPlugin::fetch);
|
||||||
cpContainer->addAction(command);
|
cpContainer->addAction(command);
|
||||||
|
|
||||||
m_fetchUrlAction = new QAction(tr("Fetch from URL..."), this);
|
m_fetchUrlAction = new QAction(tr("Fetch from URL..."), this);
|
||||||
command = Core::ActionManager::registerAction(m_fetchUrlAction, "CodePaster.FetchUrl", globalcontext);
|
command = ActionManager::registerAction(m_fetchUrlAction, "CodePaster.FetchUrl", globalcontext);
|
||||||
connect(m_fetchUrlAction, &QAction::triggered, this, &CodepasterPlugin::fetchUrl);
|
connect(m_fetchUrlAction, &QAction::triggered, this, &CodepasterPlugin::fetchUrl);
|
||||||
cpContainer->addAction(command);
|
cpContainer->addAction(command);
|
||||||
|
|
||||||
@@ -274,7 +274,7 @@ void CodepasterPlugin::post(QString data, const QString &mimeType)
|
|||||||
if (dialogResult == QDialog::Accepted
|
if (dialogResult == QDialog::Accepted
|
||||||
&& m_settings->protocol != view.protocol()) {
|
&& m_settings->protocol != view.protocol()) {
|
||||||
m_settings->protocol = view.protocol();
|
m_settings->protocol = view.protocol();
|
||||||
m_settings->toSettings(Core::ICore::settings());
|
m_settings->toSettings(ICore::settings());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,7 +305,7 @@ void CodepasterPlugin::fetch()
|
|||||||
// Save new protocol in case user changed it.
|
// Save new protocol in case user changed it.
|
||||||
if (m_settings->protocol != dialog.protocol()) {
|
if (m_settings->protocol != dialog.protocol()) {
|
||||||
m_settings->protocol = dialog.protocol();
|
m_settings->protocol = dialog.protocol();
|
||||||
m_settings->toSettings(Core::ICore::settings());
|
m_settings->toSettings(ICore::settings());
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString pasteID = dialog.pasteId();
|
const QString pasteID = dialog.pasteId();
|
||||||
@@ -320,7 +320,7 @@ void CodepasterPlugin::finishPost(const QString &link)
|
|||||||
{
|
{
|
||||||
if (m_settings->copyToClipboard)
|
if (m_settings->copyToClipboard)
|
||||||
QApplication::clipboard()->setText(link);
|
QApplication::clipboard()->setText(link);
|
||||||
MessageManager::write(link, m_settings->displayOutput ? Core::MessageManager::ModeSwitch : Core::MessageManager::Silent);
|
MessageManager::write(link, m_settings->displayOutput ? MessageManager::ModeSwitch : MessageManager::Silent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract the characters that can be used for a file name from a title
|
// Extract the characters that can be used for a file name from a title
|
||||||
@@ -392,7 +392,7 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription,
|
|||||||
const QString fileName = saver.fileName();
|
const QString fileName = saver.fileName();
|
||||||
m_fetchedSnippets.push_back(fileName);
|
m_fetchedSnippets.push_back(fileName);
|
||||||
// Open editor with title.
|
// Open editor with title.
|
||||||
Core::IEditor *editor = EditorManager::openEditor(fileName);
|
IEditor *editor = EditorManager::openEditor(fileName);
|
||||||
QTC_ASSERT(editor, return);
|
QTC_ASSERT(editor, return);
|
||||||
editor->document()->setDisplayName(titleDescription);
|
editor->document()->setDisplayName(titleDescription);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ int GenericBuildConfigurationFactory::priority(const Target *parent) const
|
|||||||
|
|
||||||
QList<BuildInfo *> GenericBuildConfigurationFactory::availableBuilds(const Target *parent) const
|
QList<BuildInfo *> GenericBuildConfigurationFactory::availableBuilds(const Target *parent) const
|
||||||
{
|
{
|
||||||
QList<ProjectExplorer::BuildInfo *> result;
|
QList<BuildInfo *> result;
|
||||||
BuildInfo *info = createBuildInfo(parent->kit(), parent->project()->projectDirectory());
|
BuildInfo *info = createBuildInfo(parent->kit(), parent->project()->projectDirectory());
|
||||||
result << info;
|
result << info;
|
||||||
return result;
|
return result;
|
||||||
@@ -110,7 +110,7 @@ int GenericBuildConfigurationFactory::priority(const Kit *k, const QString &proj
|
|||||||
QList<BuildInfo *> GenericBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const
|
QList<BuildInfo *> GenericBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const
|
||||||
{
|
{
|
||||||
QList<BuildInfo *> result;
|
QList<BuildInfo *> result;
|
||||||
BuildInfo *info = createBuildInfo(k, ProjectExplorer::Project::projectDirectory(Utils::FileName::fromString(projectPath)));
|
BuildInfo *info = createBuildInfo(k, Project::projectDirectory(Utils::FileName::fromString(projectPath)));
|
||||||
//: The name of the build configuration created by default for a generic project.
|
//: The name of the build configuration created by default for a generic project.
|
||||||
info->displayName = tr("Default");
|
info->displayName = tr("Default");
|
||||||
result << info;
|
result << info;
|
||||||
@@ -184,7 +184,7 @@ bool GenericBuildConfigurationFactory::canHandle(const Target *t) const
|
|||||||
return qobject_cast<GenericProject *>(t->project());
|
return qobject_cast<GenericProject *>(t->project());
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildInfo *GenericBuildConfigurationFactory::createBuildInfo(const ProjectExplorer::Kit *k,
|
BuildInfo *GenericBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||||
const Utils::FileName &buildDir) const
|
const Utils::FileName &buildDir) const
|
||||||
{
|
{
|
||||||
BuildInfo *info = new BuildInfo(this);
|
BuildInfo *info = new BuildInfo(this);
|
||||||
|
|||||||
@@ -358,8 +358,8 @@ void GenericProject::refreshCppCodeModel()
|
|||||||
ppBuilder.setConfigFileName(configFileName());
|
ppBuilder.setConfigFileName(configFileName());
|
||||||
ppBuilder.setCxxFlags(QStringList() << QLatin1String("-std=c++11"));
|
ppBuilder.setCxxFlags(QStringList() << QLatin1String("-std=c++11"));
|
||||||
|
|
||||||
const QList<Core::Id> languages = ppBuilder.createProjectPartsForFiles(files());
|
const QList<Id> languages = ppBuilder.createProjectPartsForFiles(files());
|
||||||
foreach (Core::Id language, languages)
|
foreach (Id language, languages)
|
||||||
setProjectLanguage(language, true);
|
setProjectLanguage(language, true);
|
||||||
|
|
||||||
pInfo.finish();
|
pInfo.finish();
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ bool GenericProjectNode::showInSimpleTree() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<ProjectExplorer::ProjectAction> GenericProjectNode::supportedActions(Node *node) const
|
QList<ProjectAction> GenericProjectNode::supportedActions(Node *node) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(node);
|
Q_UNUSED(node);
|
||||||
return QList<ProjectAction>()
|
return QList<ProjectAction>()
|
||||||
|
|||||||
@@ -78,11 +78,11 @@ void GenericProjectPlugin::test_simple()
|
|||||||
QCOMPARE(pPart->files.first().kind, ProjectFile::CXXSource);
|
QCOMPARE(pPart->files.first().kind, ProjectFile::CXXSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QStringList simplify(const QList<CppTools::ProjectFile> &files, const QString &prefix)
|
static QStringList simplify(const QList<ProjectFile> &files, const QString &prefix)
|
||||||
{
|
{
|
||||||
QStringList result;
|
QStringList result;
|
||||||
|
|
||||||
foreach (const CppTools::ProjectFile &file, files) {
|
foreach (const ProjectFile &file, files) {
|
||||||
if (file.path.startsWith(prefix))
|
if (file.path.startsWith(prefix))
|
||||||
result.append(file.path.mid(prefix.size()));
|
result.append(file.path.mid(prefix.size()));
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ IAssistProposal *GlslCompletionAssistProcessor::perform(const AssistInterface *i
|
|||||||
|
|
||||||
QList<GLSL::Symbol *> members;
|
QList<GLSL::Symbol *> members;
|
||||||
QStringList specialMembers;
|
QStringList specialMembers;
|
||||||
QList<TextEditor::AssistProposalItem *> m_completions;
|
QList<AssistProposalItem *> m_completions;
|
||||||
|
|
||||||
bool functionCall = (ch == QLatin1Char('(') && pos == m_interface->position() - 1);
|
bool functionCall = (ch == QLatin1Char('(') && pos == m_interface->position() - 1);
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ enum {
|
|||||||
UPDATE_DOCUMENT_DEFAULT_INTERVAL = 150
|
UPDATE_DOCUMENT_DEFAULT_INTERVAL = 150
|
||||||
};
|
};
|
||||||
|
|
||||||
class CreateRanges: protected GLSL::Visitor
|
class CreateRanges: protected Visitor
|
||||||
{
|
{
|
||||||
QTextDocument *textDocument;
|
QTextDocument *textDocument;
|
||||||
Document::Ptr glslDocument;
|
Document::Ptr glslDocument;
|
||||||
@@ -91,12 +91,12 @@ public:
|
|||||||
CreateRanges(QTextDocument *textDocument, Document::Ptr glslDocument)
|
CreateRanges(QTextDocument *textDocument, Document::Ptr glslDocument)
|
||||||
: textDocument(textDocument), glslDocument(glslDocument) {}
|
: textDocument(textDocument), glslDocument(glslDocument) {}
|
||||||
|
|
||||||
void operator()(GLSL::AST *ast) { accept(ast); }
|
void operator()(AST *ast) { accept(ast); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using GLSL::Visitor::visit;
|
using GLSL::Visitor::visit;
|
||||||
|
|
||||||
virtual void endVisit(GLSL::CompoundStatementAST *ast)
|
virtual void endVisit(CompoundStatementAST *ast)
|
||||||
{
|
{
|
||||||
if (ast->symbol) {
|
if (ast->symbol) {
|
||||||
QTextCursor tc(textDocument);
|
QTextCursor tc(textDocument);
|
||||||
@@ -214,7 +214,7 @@ void GlslEditorWidget::updateDocumentNow()
|
|||||||
|
|
||||||
Document::Ptr doc(new Document());
|
Document::Ptr doc(new Document());
|
||||||
Engine engine;
|
Engine engine;
|
||||||
doc->_engine = new GLSL::Engine();
|
doc->_engine = new Engine();
|
||||||
Parser parser(doc->_engine, preprocessedCode.constData(), preprocessedCode.size(), variant);
|
Parser parser(doc->_engine, preprocessedCode.constData(), preprocessedCode.size(), variant);
|
||||||
TranslationUnitAST *ast = parser.parse();
|
TranslationUnitAST *ast = parser.parse();
|
||||||
if (ast != 0 || extraSelections(CodeWarningsSelection).isEmpty()) {
|
if (ast != 0 || extraSelections(CodeWarningsSelection).isEmpty()) {
|
||||||
|
|||||||
@@ -43,20 +43,20 @@ namespace Internal {
|
|||||||
|
|
||||||
GlslHighlighter::GlslHighlighter()
|
GlslHighlighter::GlslHighlighter()
|
||||||
{
|
{
|
||||||
static QVector<TextEditor::TextStyle> categories;
|
static QVector<TextStyle> categories;
|
||||||
if (categories.isEmpty()) {
|
if (categories.isEmpty()) {
|
||||||
categories << TextEditor::C_NUMBER
|
categories << C_NUMBER
|
||||||
<< TextEditor::C_STRING
|
<< C_STRING
|
||||||
<< TextEditor::C_TYPE
|
<< C_TYPE
|
||||||
<< TextEditor::C_KEYWORD
|
<< C_KEYWORD
|
||||||
<< TextEditor::C_OPERATOR
|
<< C_OPERATOR
|
||||||
<< TextEditor::C_PREPROCESSOR
|
<< C_PREPROCESSOR
|
||||||
<< TextEditor::C_LABEL
|
<< C_LABEL
|
||||||
<< TextEditor::C_COMMENT
|
<< C_COMMENT
|
||||||
<< TextEditor::C_DOXYGEN_COMMENT
|
<< C_DOXYGEN_COMMENT
|
||||||
<< TextEditor::C_DOXYGEN_TAG
|
<< C_DOXYGEN_TAG
|
||||||
<< TextEditor::C_VISUAL_WHITESPACE
|
<< C_VISUAL_WHITESPACE
|
||||||
<< TextEditor::C_REMOVED_LINE;
|
<< C_REMOVED_LINE;
|
||||||
}
|
}
|
||||||
setTextFormatCategories(categories);
|
setTextFormatCategories(categories);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ QWidget *GeneralSettingsPage::widget()
|
|||||||
m_ui->helpStartComboBox->setCurrentIndex(m_startOption);
|
m_ui->helpStartComboBox->setCurrentIndex(m_startOption);
|
||||||
|
|
||||||
m_contextOption = HelpManager::customValue(QLatin1String("ContextHelpOption"),
|
m_contextOption = HelpManager::customValue(QLatin1String("ContextHelpOption"),
|
||||||
Core::HelpManager::SideBySideIfPossible).toInt();
|
HelpManager::SideBySideIfPossible).toInt();
|
||||||
m_ui->contextHelpComboBox->setCurrentIndex(m_contextOption);
|
m_ui->contextHelpComboBox->setCurrentIndex(m_contextOption);
|
||||||
|
|
||||||
connect(m_ui->currentPageButton, &QPushButton::clicked,
|
connect(m_ui->currentPageButton, &QPushButton::clicked,
|
||||||
@@ -182,7 +182,7 @@ void GeneralSettingsPage::apply()
|
|||||||
m_contextOption = helpOption;
|
m_contextOption = helpOption;
|
||||||
HelpManager::setCustomValue(QLatin1String("ContextHelpOption"), helpOption);
|
HelpManager::setCustomValue(QLatin1String("ContextHelpOption"), helpOption);
|
||||||
|
|
||||||
QSettings *settings = Core::ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
settings->beginGroup(QLatin1String(Help::Constants::ID_MODE_HELP));
|
settings->beginGroup(QLatin1String(Help::Constants::ID_MODE_HELP));
|
||||||
settings->setValue(QLatin1String("ContextHelpOption"), helpOption);
|
settings->setValue(QLatin1String("ContextHelpOption"), helpOption);
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
@@ -217,7 +217,7 @@ void GeneralSettingsPage::importBookmarks()
|
|||||||
{
|
{
|
||||||
m_ui->errorLabel->setVisible(false);
|
m_ui->errorLabel->setVisible(false);
|
||||||
|
|
||||||
QString fileName = QFileDialog::getOpenFileName(Core::ICore::dialogParent(),
|
QString fileName = QFileDialog::getOpenFileName(ICore::dialogParent(),
|
||||||
tr("Import Bookmarks"), QDir::currentPath(), tr("Files (*.xbel)"));
|
tr("Import Bookmarks"), QDir::currentPath(), tr("Files (*.xbel)"));
|
||||||
|
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
@@ -239,7 +239,7 @@ void GeneralSettingsPage::exportBookmarks()
|
|||||||
{
|
{
|
||||||
m_ui->errorLabel->setVisible(false);
|
m_ui->errorLabel->setVisible(false);
|
||||||
|
|
||||||
QString fileName = QFileDialog::getSaveFileName(Core::ICore::dialogParent(),
|
QString fileName = QFileDialog::getSaveFileName(ICore::dialogParent(),
|
||||||
tr("Save File"), QLatin1String("untitled.xbel"), tr("Files (*.xbel)"));
|
tr("Save File"), QLatin1String("untitled.xbel"), tr("Files (*.xbel)"));
|
||||||
|
|
||||||
QLatin1String suffix(".xbel");
|
QLatin1String suffix(".xbel");
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ HelpViewerFindSupport::HelpViewerFindSupport(HelpViewer *viewer)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::FindFlags HelpViewerFindSupport::supportedFindFlags() const
|
FindFlags HelpViewerFindSupport::supportedFindFlags() const
|
||||||
{
|
{
|
||||||
return FindBackward | FindCaseSensitively;
|
return FindBackward | FindCaseSensitively;
|
||||||
}
|
}
|
||||||
@@ -52,23 +52,23 @@ QString HelpViewerFindSupport::currentFindString() const
|
|||||||
return m_viewer->selectedText();
|
return m_viewer->selectedText();
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IFindSupport::Result HelpViewerFindSupport::findIncremental(const QString &txt,
|
IFindSupport::Result HelpViewerFindSupport::findIncremental(const QString &txt,
|
||||||
Core::FindFlags findFlags)
|
FindFlags findFlags)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_viewer, return NotFound);
|
QTC_ASSERT(m_viewer, return NotFound);
|
||||||
findFlags &= ~FindBackward;
|
findFlags &= ~FindBackward;
|
||||||
return find(txt, findFlags, true) ? Found : NotFound;
|
return find(txt, findFlags, true) ? Found : NotFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IFindSupport::Result HelpViewerFindSupport::findStep(const QString &txt,
|
IFindSupport::Result HelpViewerFindSupport::findStep(const QString &txt,
|
||||||
Core::FindFlags findFlags)
|
FindFlags findFlags)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_viewer, return NotFound);
|
QTC_ASSERT(m_viewer, return NotFound);
|
||||||
return find(txt, findFlags, false) ? Found : NotFound;
|
return find(txt, findFlags, false) ? Found : NotFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HelpViewerFindSupport::find(const QString &txt,
|
bool HelpViewerFindSupport::find(const QString &txt,
|
||||||
Core::FindFlags findFlags, bool incremental)
|
FindFlags findFlags, bool incremental)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_viewer, return false);
|
QTC_ASSERT(m_viewer, return false);
|
||||||
bool wrapped = false;
|
bool wrapped = false;
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ QList<LocatorFilterEntry> HelpIndexFilter::matchesFor(QFutureInterface<LocatorFi
|
|||||||
void HelpIndexFilter::accept(LocatorFilterEntry selection) const
|
void HelpIndexFilter::accept(LocatorFilterEntry selection) const
|
||||||
{
|
{
|
||||||
const QString &key = selection.displayName;
|
const QString &key = selection.displayName;
|
||||||
const QMap<QString, QUrl> &links = Core::HelpManager::linksForKeyword(key);
|
const QMap<QString, QUrl> &links = HelpManager::linksForKeyword(key);
|
||||||
|
|
||||||
if (links.size() == 1)
|
if (links.size() == 1)
|
||||||
emit linkActivated(links.begin().value());
|
emit linkActivated(links.begin().value());
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
|||||||
addAutoReleasedObject(m_generalSettingsPage = new GeneralSettingsPage());
|
addAutoReleasedObject(m_generalSettingsPage = new GeneralSettingsPage());
|
||||||
addAutoReleasedObject(m_searchTaskHandler = new SearchTaskHandler);
|
addAutoReleasedObject(m_searchTaskHandler = new SearchTaskHandler);
|
||||||
|
|
||||||
m_centralWidget = new Help::Internal::CentralWidget(modecontext);
|
m_centralWidget = new CentralWidget(modecontext);
|
||||||
connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this,
|
connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this,
|
||||||
SLOT(updateSideBarSource(QUrl)));
|
SLOT(updateSideBarSource(QUrl)));
|
||||||
connect(m_centralWidget, &CentralWidget::closeButtonClicked,
|
connect(m_centralWidget, &CentralWidget::closeButtonClicked,
|
||||||
@@ -302,7 +302,7 @@ void HelpPlugin::saveExternalWindowSettings()
|
|||||||
if (!m_externalWindow)
|
if (!m_externalWindow)
|
||||||
return;
|
return;
|
||||||
m_externalWindowState = m_externalWindow->geometry();
|
m_externalWindowState = m_externalWindow->geometry();
|
||||||
QSettings *settings = Core::ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
settings->setValue(QLatin1String(kExternalWindowStateKey),
|
settings->setValue(QLatin1String(kExternalWindowStateKey),
|
||||||
qVariantFromValue(m_externalWindowState));
|
qVariantFromValue(m_externalWindowState));
|
||||||
}
|
}
|
||||||
@@ -331,7 +331,7 @@ void HelpPlugin::createRightPaneContextViewer()
|
|||||||
{
|
{
|
||||||
if (m_rightPaneSideBarWidget)
|
if (m_rightPaneSideBarWidget)
|
||||||
return;
|
return;
|
||||||
m_rightPaneSideBarWidget = createHelpWidget(Core::Context(Constants::C_HELP_SIDEBAR),
|
m_rightPaneSideBarWidget = createHelpWidget(Context(Constants::C_HELP_SIDEBAR),
|
||||||
HelpWidget::SideBarWidget);
|
HelpWidget::SideBarWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,10 +340,10 @@ HelpViewer *HelpPlugin::externalHelpViewer()
|
|||||||
if (m_externalWindow)
|
if (m_externalWindow)
|
||||||
return m_externalWindow->currentViewer();
|
return m_externalWindow->currentViewer();
|
||||||
doSetupIfNeeded();
|
doSetupIfNeeded();
|
||||||
m_externalWindow = createHelpWidget(Core::Context(Constants::C_HELP_EXTERNAL),
|
m_externalWindow = createHelpWidget(Context(Constants::C_HELP_EXTERNAL),
|
||||||
HelpWidget::ExternalWindow);
|
HelpWidget::ExternalWindow);
|
||||||
if (m_externalWindowState.isNull()) {
|
if (m_externalWindowState.isNull()) {
|
||||||
QSettings *settings = Core::ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
m_externalWindowState = settings->value(QLatin1String(kExternalWindowStateKey)).toRect();
|
m_externalWindowState = settings->value(QLatin1String(kExternalWindowStateKey)).toRect();
|
||||||
}
|
}
|
||||||
if (m_externalWindowState.isNull())
|
if (m_externalWindowState.isNull())
|
||||||
@@ -413,7 +413,7 @@ void HelpPlugin::activateHelpMode()
|
|||||||
void HelpPlugin::showLinkInHelpMode(const QUrl &source)
|
void HelpPlugin::showLinkInHelpMode(const QUrl &source)
|
||||||
{
|
{
|
||||||
activateHelpMode();
|
activateHelpMode();
|
||||||
Core::ICore::raiseWindow(m_mode->widget());
|
ICore::raiseWindow(m_mode->widget());
|
||||||
m_centralWidget->setSource(source);
|
m_centralWidget->setSource(source);
|
||||||
m_centralWidget->setFocus();
|
m_centralWidget->setFocus();
|
||||||
}
|
}
|
||||||
@@ -421,7 +421,7 @@ void HelpPlugin::showLinkInHelpMode(const QUrl &source)
|
|||||||
void HelpPlugin::showLinksInHelpMode(const QMap<QString, QUrl> &links, const QString &key)
|
void HelpPlugin::showLinksInHelpMode(const QMap<QString, QUrl> &links, const QString &key)
|
||||||
{
|
{
|
||||||
activateHelpMode();
|
activateHelpMode();
|
||||||
Core::ICore::raiseWindow(m_mode->widget());
|
ICore::raiseWindow(m_mode->widget());
|
||||||
m_centralWidget->showTopicChooser(links, key);
|
m_centralWidget->showTopicChooser(links, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,7 +477,7 @@ void HelpPlugin::setupHelpEngineIfNeeded()
|
|||||||
{
|
{
|
||||||
LocalHelpManager::setEngineNeedsUpdate();
|
LocalHelpManager::setEngineNeedsUpdate();
|
||||||
if (ModeManager::currentMode() == m_mode
|
if (ModeManager::currentMode() == m_mode
|
||||||
|| contextHelpOption() == Core::HelpManager::ExternalHelpAlways)
|
|| contextHelpOption() == HelpManager::ExternalHelpAlways)
|
||||||
LocalHelpManager::setupGuiHelpEngine();
|
LocalHelpManager::setupGuiHelpEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,24 +500,24 @@ bool HelpPlugin::canShowHelpSideBySide() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
HelpViewer *HelpPlugin::viewerForHelpViewerLocation(Core::HelpManager::HelpViewerLocation location)
|
HelpViewer *HelpPlugin::viewerForHelpViewerLocation(HelpManager::HelpViewerLocation location)
|
||||||
{
|
{
|
||||||
Core::HelpManager::HelpViewerLocation actualLocation = location;
|
HelpManager::HelpViewerLocation actualLocation = location;
|
||||||
if (location == Core::HelpManager::SideBySideIfPossible)
|
if (location == HelpManager::SideBySideIfPossible)
|
||||||
actualLocation = canShowHelpSideBySide() ? Core::HelpManager::SideBySideAlways
|
actualLocation = canShowHelpSideBySide() ? HelpManager::SideBySideAlways
|
||||||
: Core::HelpManager::HelpModeAlways;
|
: HelpManager::HelpModeAlways;
|
||||||
|
|
||||||
if (actualLocation == Core::HelpManager::ExternalHelpAlways)
|
if (actualLocation == HelpManager::ExternalHelpAlways)
|
||||||
return externalHelpViewer();
|
return externalHelpViewer();
|
||||||
|
|
||||||
if (actualLocation == Core::HelpManager::SideBySideAlways) {
|
if (actualLocation == HelpManager::SideBySideAlways) {
|
||||||
createRightPaneContextViewer();
|
createRightPaneContextViewer();
|
||||||
RightPaneWidget::instance()->setWidget(m_rightPaneSideBarWidget);
|
RightPaneWidget::instance()->setWidget(m_rightPaneSideBarWidget);
|
||||||
RightPaneWidget::instance()->setShown(true);
|
RightPaneWidget::instance()->setShown(true);
|
||||||
return m_rightPaneSideBarWidget->currentViewer();
|
return m_rightPaneSideBarWidget->currentViewer();
|
||||||
}
|
}
|
||||||
|
|
||||||
QTC_CHECK(actualLocation == Core::HelpManager::HelpModeAlways);
|
QTC_CHECK(actualLocation == HelpManager::HelpModeAlways);
|
||||||
|
|
||||||
activateHelpMode(); // should trigger an createPage...
|
activateHelpMode(); // should trigger an createPage...
|
||||||
HelpViewer *viewer = m_centralWidget->currentViewer();
|
HelpViewer *viewer = m_centralWidget->currentViewer();
|
||||||
@@ -567,7 +567,7 @@ void HelpPlugin::showContextHelp()
|
|||||||
// Find out what to show
|
// Find out what to show
|
||||||
QMap<QString, QUrl> links;
|
QMap<QString, QUrl> links;
|
||||||
QString idFromContext;
|
QString idFromContext;
|
||||||
if (IContext *context = Core::ICore::currentContextObject()) {
|
if (IContext *context = ICore::currentContextObject()) {
|
||||||
idFromContext = context->contextHelpId();
|
idFromContext = context->contextHelpId();
|
||||||
links = HelpManager::linksForIdentifier(idFromContext);
|
links = HelpManager::linksForIdentifier(idFromContext);
|
||||||
// Maybe the id is already an URL
|
// Maybe the id is already an URL
|
||||||
@@ -597,7 +597,7 @@ void HelpPlugin::showContextHelp()
|
|||||||
viewer->scrollToAnchor(source.fragment());
|
viewer->scrollToAnchor(source.fragment());
|
||||||
}
|
}
|
||||||
viewer->setFocus();
|
viewer->setFocus();
|
||||||
Core::ICore::raiseWindow(viewer);
|
ICore::raiseWindow(viewer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -624,7 +624,7 @@ void HelpPlugin::highlightSearchTermsInContextHelp()
|
|||||||
m_contextHelpHighlightId.clear();
|
m_contextHelpHighlightId.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HelpPlugin::handleHelpRequest(const QUrl &url, Core::HelpManager::HelpViewerLocation location)
|
void HelpPlugin::handleHelpRequest(const QUrl &url, HelpManager::HelpViewerLocation location)
|
||||||
{
|
{
|
||||||
if (HelpViewer::launchWithExternalApp(url))
|
if (HelpViewer::launchWithExternalApp(url))
|
||||||
return;
|
return;
|
||||||
@@ -648,7 +648,7 @@ void HelpPlugin::handleHelpRequest(const QUrl &url, Core::HelpManager::HelpViewe
|
|||||||
HelpViewer *viewer = viewerForHelpViewerLocation(location);
|
HelpViewer *viewer = viewerForHelpViewerLocation(location);
|
||||||
QTC_ASSERT(viewer, return);
|
QTC_ASSERT(viewer, return);
|
||||||
viewer->setSource(newUrl);
|
viewer->setSource(newUrl);
|
||||||
Core::ICore::raiseWindow(viewer);
|
ICore::raiseWindow(viewer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HelpPlugin::slotOpenSupportPage()
|
void HelpPlugin::slotOpenSupportPage()
|
||||||
@@ -672,15 +672,15 @@ void HelpPlugin::doSetupIfNeeded()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::HelpManager::HelpViewerLocation HelpPlugin::contextHelpOption() const
|
HelpManager::HelpViewerLocation HelpPlugin::contextHelpOption() const
|
||||||
{
|
{
|
||||||
QSettings *settings = Core::ICore::settings();
|
QSettings *settings = ICore::settings();
|
||||||
const QString key = QLatin1String(Help::Constants::ID_MODE_HELP) + QLatin1String("/ContextHelpOption");
|
const QString key = QLatin1String(Help::Constants::ID_MODE_HELP) + QLatin1String("/ContextHelpOption");
|
||||||
if (settings->contains(key))
|
if (settings->contains(key))
|
||||||
return Core::HelpManager::HelpViewerLocation(
|
return HelpManager::HelpViewerLocation(
|
||||||
settings->value(key, Core::HelpManager::SideBySideIfPossible).toInt());
|
settings->value(key, HelpManager::SideBySideIfPossible).toInt());
|
||||||
|
|
||||||
const QHelpEngineCore &engine = LocalHelpManager::helpEngine();
|
const QHelpEngineCore &engine = LocalHelpManager::helpEngine();
|
||||||
return Core::HelpManager::HelpViewerLocation(engine.customValue(QLatin1String("ContextHelpOption"),
|
return HelpManager::HelpViewerLocation(engine.customValue(QLatin1String("ContextHelpOption"),
|
||||||
Core::HelpManager::SideBySideIfPossible).toInt());
|
HelpManager::SideBySideIfPossible).toInt());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ bool QtWebKitHelpWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
if (event->type() == QEvent::KeyPress) {
|
if (event->type() == QEvent::KeyPress) {
|
||||||
if (QKeyEvent *keyEvent = static_cast<QKeyEvent*> (event)) {
|
if (QKeyEvent *keyEvent = static_cast<QKeyEvent*> (event)) {
|
||||||
if (keyEvent->key() == Qt::Key_Slash)
|
if (keyEvent->key() == Qt::Key_Slash)
|
||||||
Core::FindPlugin::instance()->openFindToolBar(Core::FindPlugin::FindForwardDirection);
|
FindPlugin::instance()->openFindToolBar(FindPlugin::FindForwardDirection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QWebView::eventFilter(obj, event);
|
return QWebView::eventFilter(obj, event);
|
||||||
@@ -569,7 +569,7 @@ void QtWebKitHelpViewer::setOpenInNewPageActionVisible(bool visible)
|
|||||||
m_webView->setOpenInNewPageActionVisible(visible);
|
m_webView->setOpenInNewPageActionVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QtWebKitHelpViewer::findText(const QString &text, Core::FindFlags flags,
|
bool QtWebKitHelpViewer::findText(const QString &text, FindFlags flags,
|
||||||
bool incremental, bool fromSearch, bool *wrapped)
|
bool incremental, bool fromSearch, bool *wrapped)
|
||||||
{
|
{
|
||||||
Q_UNUSED(incremental);
|
Q_UNUSED(incremental);
|
||||||
@@ -577,9 +577,9 @@ bool QtWebKitHelpViewer::findText(const QString &text, Core::FindFlags flags,
|
|||||||
if (wrapped)
|
if (wrapped)
|
||||||
*wrapped = false;
|
*wrapped = false;
|
||||||
QWebPage::FindFlags options;
|
QWebPage::FindFlags options;
|
||||||
if (flags & Core::FindBackward)
|
if (flags & FindBackward)
|
||||||
options |= QWebPage::FindBackward;
|
options |= QWebPage::FindBackward;
|
||||||
if (flags & Core::FindCaseSensitively)
|
if (flags & FindCaseSensitively)
|
||||||
options |= QWebPage::FindCaseSensitively;
|
options |= QWebPage::FindCaseSensitively;
|
||||||
|
|
||||||
bool found = m_webView->findText(text, options);
|
bool found = m_webView->findText(text, options);
|
||||||
|
|||||||
@@ -201,36 +201,36 @@ QStringList QbsProject::files(Project::FilesMode fileMode) const
|
|||||||
|
|
||||||
bool QbsProject::isProjectEditable() const
|
bool QbsProject::isProjectEditable() const
|
||||||
{
|
{
|
||||||
return m_qbsProject.isValid() && !isParsing() && !ProjectExplorer::BuildManager::isBuilding();
|
return m_qbsProject.isValid() && !isParsing() && !BuildManager::isBuilding();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChangeExpector
|
class ChangeExpector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ChangeExpector(const QString &filePath, const QSet<Core::IDocument *> &documents)
|
ChangeExpector(const QString &filePath, const QSet<IDocument *> &documents)
|
||||||
: m_document(0)
|
: m_document(0)
|
||||||
{
|
{
|
||||||
foreach (Core::IDocument * const doc, documents) {
|
foreach (IDocument * const doc, documents) {
|
||||||
if (doc->filePath().toString() == filePath) {
|
if (doc->filePath().toString() == filePath) {
|
||||||
m_document = doc;
|
m_document = doc;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QTC_ASSERT(m_document, return);
|
QTC_ASSERT(m_document, return);
|
||||||
Core::DocumentManager::expectFileChange(filePath);
|
DocumentManager::expectFileChange(filePath);
|
||||||
m_wasInDocumentManager = Core::DocumentManager::removeDocument(m_document);
|
m_wasInDocumentManager = DocumentManager::removeDocument(m_document);
|
||||||
QTC_CHECK(m_wasInDocumentManager);
|
QTC_CHECK(m_wasInDocumentManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
~ChangeExpector()
|
~ChangeExpector()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_document, return);
|
QTC_ASSERT(m_document, return);
|
||||||
Core::DocumentManager::addDocument(m_document);
|
DocumentManager::addDocument(m_document);
|
||||||
Core::DocumentManager::unexpectFileChange(m_document->filePath().toString());
|
DocumentManager::unexpectFileChange(m_document->filePath().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Core::IDocument *m_document;
|
IDocument *m_document;
|
||||||
bool m_wasInDocumentManager;
|
bool m_wasInDocumentManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -240,12 +240,12 @@ bool QbsProject::ensureWriteableQbsFile(const QString &file)
|
|||||||
QFileInfo fi(file);
|
QFileInfo fi(file);
|
||||||
if (!fi.isWritable()) {
|
if (!fi.isWritable()) {
|
||||||
// Try via vcs manager
|
// Try via vcs manager
|
||||||
Core::IVersionControl *versionControl =
|
IVersionControl *versionControl =
|
||||||
Core::VcsManager::findVersionControlForDirectory(fi.absolutePath());
|
VcsManager::findVersionControlForDirectory(fi.absolutePath());
|
||||||
if (!versionControl || !versionControl->vcsOpen(file)) {
|
if (!versionControl || !versionControl->vcsOpen(file)) {
|
||||||
bool makeWritable = QFile::setPermissions(file, fi.permissions() | QFile::WriteUser);
|
bool makeWritable = QFile::setPermissions(file, fi.permissions() | QFile::WriteUser);
|
||||||
if (!makeWritable) {
|
if (!makeWritable) {
|
||||||
QMessageBox::warning(Core::ICore::mainWindow(),
|
QMessageBox::warning(ICore::mainWindow(),
|
||||||
tr("Failed!"),
|
tr("Failed!"),
|
||||||
tr("Could not write project file %1.").arg(file));
|
tr("Could not write project file %1.").arg(file));
|
||||||
return false;
|
return false;
|
||||||
@@ -266,7 +266,7 @@ bool QbsProject::addFilesToProduct(QbsBaseProjectNode *node, const QStringList &
|
|||||||
foreach (const QString &path, filePaths) {
|
foreach (const QString &path, filePaths) {
|
||||||
qbs::ErrorInfo err = m_qbsProject.addFiles(productData, groupData, QStringList() << path);
|
qbs::ErrorInfo err = m_qbsProject.addFiles(productData, groupData, QStringList() << path);
|
||||||
if (err.hasError()) {
|
if (err.hasError()) {
|
||||||
Core::MessageManager::write(err.toString());
|
MessageManager::write(err.toString());
|
||||||
*notAdded += path;
|
*notAdded += path;
|
||||||
} else {
|
} else {
|
||||||
allPaths += path;
|
allPaths += path;
|
||||||
@@ -293,7 +293,7 @@ bool QbsProject::removeFilesFromProduct(QbsBaseProjectNode *node, const QStringL
|
|||||||
qbs::ErrorInfo err
|
qbs::ErrorInfo err
|
||||||
= m_qbsProject.removeFiles(productData, groupData, QStringList() << path);
|
= m_qbsProject.removeFiles(productData, groupData, QStringList() << path);
|
||||||
if (err.hasError()) {
|
if (err.hasError()) {
|
||||||
Core::MessageManager::write(err.toString());
|
MessageManager::write(err.toString());
|
||||||
*notRemoved += path;
|
*notRemoved += path;
|
||||||
} else {
|
} else {
|
||||||
allPaths.removeOne(path);
|
allPaths.removeOne(path);
|
||||||
@@ -489,7 +489,7 @@ void QbsProject::startParsing()
|
|||||||
{
|
{
|
||||||
// Qbs does update the build graph during the build. So we cannot
|
// Qbs does update the build graph during the build. So we cannot
|
||||||
// start to parse while a build is running or we will lose information.
|
// start to parse while a build is running or we will lose information.
|
||||||
if (ProjectExplorer::BuildManager::isBuilding(this)) {
|
if (BuildManager::isBuilding(this)) {
|
||||||
scheduleParsing();
|
scheduleParsing();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -771,9 +771,9 @@ void QbsProject::updateCppCodeModel()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<Core::Id> languages =
|
const QList<Id> languages =
|
||||||
ppBuilder.createProjectPartsForFiles(grp.allFilePaths());
|
ppBuilder.createProjectPartsForFiles(grp.allFilePaths());
|
||||||
foreach (Core::Id language, languages)
|
foreach (Id language, languages)
|
||||||
setProjectLanguage(language, true);
|
setProjectLanguage(language, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -847,24 +847,24 @@ void QbsProject::updateQmlJsCodeModel()
|
|||||||
|
|
||||||
void QbsProject::updateApplicationTargets()
|
void QbsProject::updateApplicationTargets()
|
||||||
{
|
{
|
||||||
ProjectExplorer::BuildTargetInfoList applications;
|
BuildTargetInfoList applications;
|
||||||
foreach (const qbs::ProductData &productData, m_projectData.allProducts()) {
|
foreach (const qbs::ProductData &productData, m_projectData.allProducts()) {
|
||||||
if (!productData.isEnabled() || !productData.isRunnable())
|
if (!productData.isEnabled() || !productData.isRunnable())
|
||||||
continue;
|
continue;
|
||||||
const QString displayName = productDisplayName(m_qbsProject, productData);
|
const QString displayName = productDisplayName(m_qbsProject, productData);
|
||||||
if (productData.targetArtifacts().isEmpty()) { // No build yet.
|
if (productData.targetArtifacts().isEmpty()) { // No build yet.
|
||||||
applications.list << ProjectExplorer::BuildTargetInfo(displayName,
|
applications.list << BuildTargetInfo(displayName,
|
||||||
Utils::FileName(),
|
FileName(),
|
||||||
Utils::FileName::fromString(productData.location().filePath()));
|
FileName::fromString(productData.location().filePath()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach (const qbs::TargetArtifact &ta, productData.targetArtifacts()) {
|
foreach (const qbs::TargetArtifact &ta, productData.targetArtifacts()) {
|
||||||
QTC_ASSERT(ta.isValid(), continue);
|
QTC_ASSERT(ta.isValid(), continue);
|
||||||
if (!ta.isExecutable())
|
if (!ta.isExecutable())
|
||||||
continue;
|
continue;
|
||||||
applications.list << ProjectExplorer::BuildTargetInfo(displayName,
|
applications.list << BuildTargetInfo(displayName,
|
||||||
Utils::FileName::fromString(ta.filePath()),
|
FileName::fromString(ta.filePath()),
|
||||||
Utils::FileName::fromString(productData.location().filePath()));
|
FileName::fromString(productData.location().filePath()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
activeTarget()->setApplicationTargets(applications);
|
activeTarget()->setApplicationTargets(applications);
|
||||||
@@ -872,15 +872,15 @@ void QbsProject::updateApplicationTargets()
|
|||||||
|
|
||||||
void QbsProject::updateDeploymentInfo()
|
void QbsProject::updateDeploymentInfo()
|
||||||
{
|
{
|
||||||
ProjectExplorer::DeploymentData deploymentData;
|
DeploymentData deploymentData;
|
||||||
if (m_qbsProject.isValid()) {
|
if (m_qbsProject.isValid()) {
|
||||||
qbs::InstallOptions installOptions;
|
qbs::InstallOptions installOptions;
|
||||||
installOptions.setInstallRoot(QLatin1String("/"));
|
installOptions.setInstallRoot(QLatin1String("/"));
|
||||||
foreach (const qbs::InstallableFile &f, m_qbsProject
|
foreach (const qbs::InstallableFile &f, m_qbsProject
|
||||||
.installableFilesForProject(m_projectData, installOptions)) {
|
.installableFilesForProject(m_projectData, installOptions)) {
|
||||||
deploymentData.addFile(f.sourceFilePath(), f.targetDirectory(), f.isExecutable()
|
deploymentData.addFile(f.sourceFilePath(), f.targetDirectory(), f.isExecutable()
|
||||||
? ProjectExplorer::DeployableFile::TypeExecutable
|
? DeployableFile::TypeExecutable
|
||||||
: ProjectExplorer::DeployableFile::TypeNormal);
|
: DeployableFile::TypeNormal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
activeTarget()->setDeploymentData(deploymentData);
|
activeTarget()->setDeploymentData(deploymentData);
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ void QbsProjectManagerPlugin::updateContextActions()
|
|||||||
&& m_selectedProject && !m_selectedProject->isParsing()
|
&& m_selectedProject && !m_selectedProject->isParsing()
|
||||||
&& m_selectedNode && m_selectedNode->isEnabled();
|
&& m_selectedNode && m_selectedNode->isEnabled();
|
||||||
|
|
||||||
bool isFile = m_selectedProject && m_selectedNode && (m_selectedNode->nodeType() == ProjectExplorer::FileNodeType);
|
bool isFile = m_selectedProject && m_selectedNode && (m_selectedNode->nodeType() == FileNodeType);
|
||||||
bool isProduct = m_selectedProject && m_selectedNode && dynamic_cast<QbsProductNode *>(m_selectedNode->projectNode());
|
bool isProduct = m_selectedProject && m_selectedNode && dynamic_cast<QbsProductNode *>(m_selectedNode->projectNode());
|
||||||
QbsProjectNode *subproject = dynamic_cast<QbsProjectNode *>(m_selectedNode);
|
QbsProjectNode *subproject = dynamic_cast<QbsProjectNode *>(m_selectedNode);
|
||||||
bool isSubproject = m_selectedProject && subproject && subproject != m_selectedProject->rootProjectNode();
|
bool isSubproject = m_selectedProject && subproject && subproject != m_selectedProject->rootProjectNode();
|
||||||
@@ -318,7 +318,7 @@ void QbsProjectManagerPlugin::updateBuildActions()
|
|||||||
m_buildSubproject->setParameter(subprojectName);
|
m_buildSubproject->setParameter(subprojectName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsProjectManagerPlugin::buildStateChanged(ProjectExplorer::Project *project)
|
void QbsProjectManagerPlugin::buildStateChanged(Project *project)
|
||||||
{
|
{
|
||||||
if (project == m_currentProject)
|
if (project == m_currentProject)
|
||||||
updateReparseQbsAction();
|
updateReparseQbsAction();
|
||||||
@@ -445,7 +445,7 @@ void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList
|
|||||||
QTC_ASSERT(project, return);
|
QTC_ASSERT(project, return);
|
||||||
QTC_ASSERT(!files.isEmpty(), return);
|
QTC_ASSERT(!files.isEmpty(), return);
|
||||||
|
|
||||||
ProjectExplorer::Target *t = project->activeTarget();
|
Target *t = project->activeTarget();
|
||||||
if (!t)
|
if (!t)
|
||||||
return;
|
return;
|
||||||
QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
||||||
@@ -461,7 +461,7 @@ void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList
|
|||||||
|
|
||||||
const Core::Id buildStep = ProjectExplorer::Constants::BUILDSTEPS_BUILD;
|
const Core::Id buildStep = ProjectExplorer::Constants::BUILDSTEPS_BUILD;
|
||||||
|
|
||||||
const QString name = ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
const QString name = ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
||||||
BuildManager::buildList(bc->stepList(buildStep), name);
|
BuildManager::buildList(bc->stepList(buildStep), name);
|
||||||
|
|
||||||
bc->setChangedFiles(QStringList());
|
bc->setChangedFiles(QStringList());
|
||||||
@@ -479,7 +479,7 @@ void QbsProjectManagerPlugin::buildProducts(QbsProject *project, const QStringLi
|
|||||||
QTC_ASSERT(project, return);
|
QTC_ASSERT(project, return);
|
||||||
QTC_ASSERT(!products.isEmpty(), return);
|
QTC_ASSERT(!products.isEmpty(), return);
|
||||||
|
|
||||||
ProjectExplorer::Target *t = project->activeTarget();
|
Target *t = project->activeTarget();
|
||||||
if (!t)
|
if (!t)
|
||||||
return;
|
return;
|
||||||
QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ QString QbsProjectParser::pluginsBaseDirectory() const
|
|||||||
const QString qbsInstallDir = QLatin1String(QBS_INSTALL_DIR);
|
const QString qbsInstallDir = QLatin1String(QBS_INSTALL_DIR);
|
||||||
if (!qbsInstallDir.isEmpty())
|
if (!qbsInstallDir.isEmpty())
|
||||||
return qbsInstallDir + QLatin1String("/lib/");
|
return qbsInstallDir + QLatin1String("/lib/");
|
||||||
if (Utils::HostOsInfo::isMacHost())
|
if (HostOsInfo::isMacHost())
|
||||||
return QDir::cleanPath(QCoreApplication::applicationDirPath()
|
return QDir::cleanPath(QCoreApplication::applicationDirPath()
|
||||||
+ QLatin1String("/../PlugIns"));
|
+ QLatin1String("/../PlugIns"));
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -56,6 +56,6 @@ ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin) :
|
|||||||
|
|
||||||
Core::IEditor *ResourceEditorFactory::createEditor()
|
Core::IEditor *ResourceEditorFactory::createEditor()
|
||||||
{
|
{
|
||||||
Core::Context context(ResourceEditor::Constants::C_RESOURCEEDITOR);
|
Core::Context context(C_RESOURCEEDITOR);
|
||||||
return new ResourceEditorW(context, m_plugin);
|
return new ResourceEditorW(context, m_plugin);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ bool ResourceEditorPlugin::initialize(const QStringList &arguments, QString *err
|
|||||||
m_renameResourceFile->setEnabled(false);
|
m_renameResourceFile->setEnabled(false);
|
||||||
m_removeResourceFile->setEnabled(false);
|
m_removeResourceFile->setEnabled(false);
|
||||||
|
|
||||||
connect(ProjectExplorer::ProjectTree::instance(), &ProjectTree::currentNodeChanged,
|
connect(ProjectTree::instance(), &ProjectTree::currentNodeChanged,
|
||||||
this, &ResourceEditorPlugin::updateContextActions);
|
this, &ResourceEditorPlugin::updateContextActions);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -264,7 +264,7 @@ void ResourceEditorPlugin::removeFileContextMenu()
|
|||||||
{
|
{
|
||||||
ResourceFolderNode *rfn = static_cast<ResourceFolderNode *>(ProjectTree::currentNode());
|
ResourceFolderNode *rfn = static_cast<ResourceFolderNode *>(ProjectTree::currentNode());
|
||||||
QString path = rfn->path();
|
QString path = rfn->path();
|
||||||
ProjectExplorer::FolderNode *parent = rfn->parentFolderNode();
|
FolderNode *parent = rfn->parentFolderNode();
|
||||||
if (!parent->removeFiles(QStringList() << path))
|
if (!parent->removeFiles(QStringList() << path))
|
||||||
QMessageBox::warning(Core::ICore::mainWindow(),
|
QMessageBox::warning(Core::ICore::mainWindow(),
|
||||||
tr("File Removal Failed"),
|
tr("File Removal Failed"),
|
||||||
@@ -302,7 +302,7 @@ void ResourceEditorPlugin::renamePrefixContextMenu()
|
|||||||
node->renamePrefix(prefix, dialog.lang());
|
node->renamePrefix(prefix, dialog.lang());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceEditorPlugin::updateContextActions(ProjectExplorer::Node *node, ProjectExplorer::Project *)
|
void ResourceEditorPlugin::updateContextActions(Node *node, Project *)
|
||||||
{
|
{
|
||||||
bool isResourceNode = dynamic_cast<ResourceTopLevelNode *>(node);
|
bool isResourceNode = dynamic_cast<ResourceTopLevelNode *>(node);
|
||||||
m_addPrefix->setEnabled(isResourceNode);
|
m_addPrefix->setEnabled(isResourceNode);
|
||||||
@@ -312,9 +312,9 @@ void ResourceEditorPlugin::updateContextActions(ProjectExplorer::Node *node, Pro
|
|||||||
bool enableRemove = false;
|
bool enableRemove = false;
|
||||||
|
|
||||||
if (isResourceNode) {
|
if (isResourceNode) {
|
||||||
ProjectExplorer::FolderNode *parent = node ? node->parentFolderNode() : 0;
|
FolderNode *parent = node ? node->parentFolderNode() : 0;
|
||||||
enableRename = parent && parent->supportedActions(node).contains(ProjectExplorer::Rename);
|
enableRename = parent && parent->supportedActions(node).contains(Rename);
|
||||||
enableRemove = parent && parent->supportedActions(node).contains(ProjectExplorer::RemoveFile);
|
enableRemove = parent && parent->supportedActions(node).contains(RemoveFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_renameResourceFile->setEnabled(isResourceNode && enableRename);
|
m_renameResourceFile->setEnabled(isResourceNode && enableRename);
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ static bool parseTaskFile(QString *errorString, const QString &base, const QStri
|
|||||||
// TaskListPlugin
|
// TaskListPlugin
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
Core::IDocument *TaskListPlugin::openTasks(const QString &base, const QString &fileName)
|
IDocument *TaskListPlugin::openTasks(const QString &base, const QString &fileName)
|
||||||
{
|
{
|
||||||
foreach (TaskFile *doc, m_openFiles) {
|
foreach (TaskFile *doc, m_openFiles) {
|
||||||
if (doc->filePath().toString() == fileName)
|
if (doc->filePath().toString() == fileName)
|
||||||
@@ -178,7 +178,7 @@ Core::IDocument *TaskListPlugin::openTasks(const QString &base, const QString &f
|
|||||||
|
|
||||||
QString errorString;
|
QString errorString;
|
||||||
if (!file->open(&errorString, fileName)) {
|
if (!file->open(&errorString, fileName)) {
|
||||||
QMessageBox::critical(Core::ICore::mainWindow(), tr("File Error"), errorString);
|
QMessageBox::critical(ICore::mainWindow(), tr("File Error"), errorString);
|
||||||
delete file;
|
delete file;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -186,7 +186,7 @@ Core::IDocument *TaskListPlugin::openTasks(const QString &base, const QString &f
|
|||||||
m_openFiles.append(file);
|
m_openFiles.append(file);
|
||||||
|
|
||||||
// Register with filemanager:
|
// Register with filemanager:
|
||||||
Core::DocumentManager::addDocument(file);
|
DocumentManager::addDocument(file);
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
@@ -203,13 +203,13 @@ bool TaskListPlugin::initialize(const QStringList &arguments, QString *errorMess
|
|||||||
//: Category under which tasklist tasks are listed in Issues view
|
//: Category under which tasklist tasks are listed in Issues view
|
||||||
TaskHub::addCategory(Constants::TASKLISTTASK_ID, tr("My Tasks"));
|
TaskHub::addCategory(Constants::TASKLISTTASK_ID, tr("My Tasks"));
|
||||||
|
|
||||||
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":tasklist/TaskList.mimetypes.xml"), errorMessage))
|
if (!MimeDatabase::addMimeTypes(QLatin1String(":tasklist/TaskList.mimetypes.xml"), errorMessage))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_fileFactory = new IDocumentFactory;
|
m_fileFactory = new IDocumentFactory;
|
||||||
m_fileFactory->addMimeType(QLatin1String("text/x-tasklist"));
|
m_fileFactory->addMimeType(QLatin1String("text/x-tasklist"));
|
||||||
m_fileFactory->setOpener([this](const QString &fileName) -> IDocument * {
|
m_fileFactory->setOpener([this](const QString &fileName) -> IDocument * {
|
||||||
ProjectExplorer::Project *project = ProjectExplorer::ProjectTree::currentProject();
|
Project *project = ProjectTree::currentProject();
|
||||||
return this->openTasks(project ? project->projectDirectory().toString() : QString(), fileName);
|
return this->openTasks(project ? project->projectDirectory().toString() : QString(), fileName);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ void TodoItemsProvider::createScanners()
|
|||||||
void TodoItemsProvider::setItemsListWithinStartupProject()
|
void TodoItemsProvider::setItemsListWithinStartupProject()
|
||||||
{
|
{
|
||||||
QHashIterator<QString, QList<TodoItem> > it(m_itemsHash);
|
QHashIterator<QString, QList<TodoItem> > it(m_itemsHash);
|
||||||
QSet<QString> fileNames = QSet<QString>::fromList(m_startupProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles));
|
QSet<QString> fileNames = QSet<QString>::fromList(m_startupProject->files(Project::ExcludeGeneratedFiles));
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
it.next();
|
it.next();
|
||||||
if (fileNames.contains(it.key()))
|
if (fileNames.contains(it.key()))
|
||||||
@@ -125,7 +125,7 @@ void TodoItemsProvider::itemsFetched(const QString &fileName, const QList<TodoIt
|
|||||||
m_shouldUpdateList = true;
|
m_shouldUpdateList = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TodoItemsProvider::startupProjectChanged(ProjectExplorer::Project *project)
|
void TodoItemsProvider::startupProjectChanged(Project *project)
|
||||||
{
|
{
|
||||||
m_startupProject = project;
|
m_startupProject = project;
|
||||||
updateList();
|
updateList();
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ CallgrindRunControl::CallgrindRunControl(const AnalyzerStartParameters &sp,
|
|||||||
: ValgrindRunControl(sp, runConfiguration)
|
: ValgrindRunControl(sp, runConfiguration)
|
||||||
, m_markAsPaused(false)
|
, m_markAsPaused(false)
|
||||||
{
|
{
|
||||||
connect(&m_runner, &Valgrind::Callgrind::CallgrindRunner::finished,
|
connect(&m_runner, &Callgrind::CallgrindRunner::finished,
|
||||||
this, &CallgrindRunControl::slotFinished);
|
this, &CallgrindRunControl::slotFinished);
|
||||||
connect(m_runner.parser(), SIGNAL(parserDataReady()), this, SLOT(slotFinished()));
|
connect(m_runner.parser(), SIGNAL(parserDataReady()), this, SLOT(slotFinished()));
|
||||||
connect(&m_runner, &Valgrind::Callgrind::CallgrindRunner::statusMessage,
|
connect(&m_runner, &Callgrind::CallgrindRunner::statusMessage,
|
||||||
this, &CallgrindRunControl::showStatusMessage);
|
this, &CallgrindRunControl::showStatusMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ QString CallgrindRunControl::progressTitle() const
|
|||||||
return tr("Profiling");
|
return tr("Profiling");
|
||||||
}
|
}
|
||||||
|
|
||||||
Valgrind::ValgrindRunner * CallgrindRunControl::runner()
|
ValgrindRunner * CallgrindRunControl::runner()
|
||||||
{
|
{
|
||||||
return &m_runner;
|
return &m_runner;
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ bool CallgrindRunControl::startEngine()
|
|||||||
|
|
||||||
void CallgrindRunControl::dump()
|
void CallgrindRunControl::dump()
|
||||||
{
|
{
|
||||||
m_runner.controller()->run(Valgrind::Callgrind::CallgrindController::Dump);
|
m_runner.controller()->run(Callgrind::CallgrindController::Dump);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallgrindRunControl::setPaused(bool paused)
|
void CallgrindRunControl::setPaused(bool paused)
|
||||||
@@ -135,20 +135,20 @@ void CallgrindRunControl::setToggleCollectFunction(const QString &toggleCollectF
|
|||||||
|
|
||||||
void CallgrindRunControl::reset()
|
void CallgrindRunControl::reset()
|
||||||
{
|
{
|
||||||
m_runner.controller()->run(Valgrind::Callgrind::CallgrindController::ResetEventCounters);
|
m_runner.controller()->run(Callgrind::CallgrindController::ResetEventCounters);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallgrindRunControl::pause()
|
void CallgrindRunControl::pause()
|
||||||
{
|
{
|
||||||
m_runner.controller()->run(Valgrind::Callgrind::CallgrindController::Pause);
|
m_runner.controller()->run(Callgrind::CallgrindController::Pause);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallgrindRunControl::unpause()
|
void CallgrindRunControl::unpause()
|
||||||
{
|
{
|
||||||
m_runner.controller()->run(Valgrind::Callgrind::CallgrindController::UnPause);
|
m_runner.controller()->run(Callgrind::CallgrindController::UnPause);
|
||||||
}
|
}
|
||||||
|
|
||||||
Valgrind::Callgrind::ParseData *CallgrindRunControl::takeParserData()
|
Callgrind::ParseData *CallgrindRunControl::takeParserData()
|
||||||
{
|
{
|
||||||
return m_runner.parser()->takeData();
|
return m_runner.parser()->takeData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public:
|
|||||||
void updateEventCombo();
|
void updateEventCombo();
|
||||||
|
|
||||||
AnalyzerRunControl *createRunControl(const AnalyzerStartParameters &sp,
|
AnalyzerRunControl *createRunControl(const AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
RunConfiguration *runConfiguration = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void cycleDetectionEnabled(bool enabled);
|
void cycleDetectionEnabled(bool enabled);
|
||||||
@@ -131,8 +131,8 @@ public slots:
|
|||||||
void slotRequestDump();
|
void slotRequestDump();
|
||||||
void loadExternalLogFile();
|
void loadExternalLogFile();
|
||||||
|
|
||||||
void selectFunction(const Valgrind::Callgrind::Function *);
|
void selectFunction(const Function *);
|
||||||
void setCostFormat(Valgrind::Internal::CostDelegate::CostFormat format);
|
void setCostFormat(CostDelegate::CostFormat format);
|
||||||
void enableCycleDetection(bool enabled);
|
void enableCycleDetection(bool enabled);
|
||||||
void shortenTemplates(bool enabled);
|
void shortenTemplates(bool enabled);
|
||||||
void setCostEvent(int index);
|
void setCostEvent(int index);
|
||||||
@@ -160,15 +160,15 @@ public slots:
|
|||||||
void dataFunctionSelected(const QModelIndex &index);
|
void dataFunctionSelected(const QModelIndex &index);
|
||||||
void calleeFunctionSelected(const QModelIndex &index);
|
void calleeFunctionSelected(const QModelIndex &index);
|
||||||
void callerFunctionSelected(const QModelIndex &index);
|
void callerFunctionSelected(const QModelIndex &index);
|
||||||
void visualisationFunctionSelected(const Valgrind::Callgrind::Function *function);
|
void visualisationFunctionSelected(const Function *function);
|
||||||
void showParserResults(const Valgrind::Callgrind::ParseData *data);
|
void showParserResults(const ParseData *data);
|
||||||
|
|
||||||
void takeParserDataFromRunControl(CallgrindRunControl *rc);
|
void takeParserDataFromRunControl(CallgrindRunControl *rc);
|
||||||
void takeParserData(ParseData *data);
|
void takeParserData(ParseData *data);
|
||||||
void engineStarting(const Analyzer::AnalyzerRunControl *);
|
void engineStarting(const AnalyzerRunControl *);
|
||||||
void engineFinished();
|
void engineFinished();
|
||||||
|
|
||||||
void editorOpened(Core::IEditor *);
|
void editorOpened(IEditor *);
|
||||||
void requestContextMenu(TextEditorWidget *widget, int line, QMenu *menu);
|
void requestContextMenu(TextEditorWidget *widget, int line, QMenu *menu);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -401,7 +401,7 @@ void CallgrindToolPrivate::updateCostFormat()
|
|||||||
|
|
||||||
void CallgrindToolPrivate::handleFilterProjectCosts()
|
void CallgrindToolPrivate::handleFilterProjectCosts()
|
||||||
{
|
{
|
||||||
ProjectExplorer::Project *pro = ProjectExplorer::ProjectTree::currentProject();
|
Project *pro = ProjectTree::currentProject();
|
||||||
QTC_ASSERT(pro, return);
|
QTC_ASSERT(pro, return);
|
||||||
|
|
||||||
if (m_filterProjectCosts->isChecked()) {
|
if (m_filterProjectCosts->isChecked()) {
|
||||||
@@ -819,7 +819,7 @@ void CallgrindToolPrivate::clearTextMarks()
|
|||||||
m_textMarks.clear();
|
m_textMarks.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallgrindToolPrivate::engineStarting(const Analyzer::AnalyzerRunControl *)
|
void CallgrindToolPrivate::engineStarting(const AnalyzerRunControl *)
|
||||||
{
|
{
|
||||||
// enable/disable actions
|
// enable/disable actions
|
||||||
m_resetAction->setEnabled(true);
|
m_resetAction->setEnabled(true);
|
||||||
@@ -929,7 +929,7 @@ void CallgrindToolPrivate::slotRequestDump()
|
|||||||
void CallgrindToolPrivate::loadExternalLogFile()
|
void CallgrindToolPrivate::loadExternalLogFile()
|
||||||
{
|
{
|
||||||
const QString filePath = QFileDialog::getOpenFileName(
|
const QString filePath = QFileDialog::getOpenFileName(
|
||||||
Core::ICore::mainWindow(),
|
ICore::mainWindow(),
|
||||||
tr("Open Callgrind Log File"),
|
tr("Open Callgrind Log File"),
|
||||||
QString(),
|
QString(),
|
||||||
tr("Callgrind Output (callgrind.out*);;All Files (*)"));
|
tr("Callgrind Output (callgrind.out*);;All Files (*)"));
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace Valgrind {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
MemcheckRunControl::MemcheckRunControl(const AnalyzerStartParameters &sp,
|
MemcheckRunControl::MemcheckRunControl(const AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
RunConfiguration *runConfiguration)
|
||||||
: ValgrindRunControl(sp, runConfiguration)
|
: ValgrindRunControl(sp, runConfiguration)
|
||||||
{
|
{
|
||||||
connect(&m_parser, &XmlProtocol::ThreadedParser::error,
|
connect(&m_parser, &XmlProtocol::ThreadedParser::error,
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ bool MemcheckErrorFilterProxyModel::filterAcceptsRow(int sourceRow, const QModel
|
|||||||
foreach (Project *project, SessionManager::projects()) {
|
foreach (Project *project, SessionManager::projects()) {
|
||||||
validFolders << project->projectDirectory().toString();
|
validFolders << project->projectDirectory().toString();
|
||||||
foreach (Target *target, project->targets()) {
|
foreach (Target *target, project->targets()) {
|
||||||
foreach (const ProjectExplorer::DeployableFile &file,
|
foreach (const DeployableFile &file,
|
||||||
target->deploymentData().allFiles()) {
|
target->deploymentData().allFiles()) {
|
||||||
if (file.isExecutable())
|
if (file.isExecutable())
|
||||||
validFolders << file.remoteDirectory();
|
validFolders << file.remoteDirectory();
|
||||||
@@ -519,7 +519,7 @@ void MemcheckTool::loadExternalXmlLogFile()
|
|||||||
parser->parse(logFile); // ThreadedParser owns the file
|
parser->parse(logFile); // ThreadedParser owns the file
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemcheckTool::parserError(const Valgrind::XmlProtocol::Error &error)
|
void MemcheckTool::parserError(const Error &error)
|
||||||
{
|
{
|
||||||
m_errorModel->addError(error);
|
m_errorModel->addError(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace Valgrind {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
ValgrindRunControl::ValgrindRunControl(const AnalyzerStartParameters &sp,
|
ValgrindRunControl::ValgrindRunControl(const AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
RunConfiguration *runConfiguration)
|
||||||
: AnalyzerRunControl(sp, runConfiguration),
|
: AnalyzerRunControl(sp, runConfiguration),
|
||||||
m_settings(0),
|
m_settings(0),
|
||||||
m_isStopping(false)
|
m_isStopping(false)
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
|
|||||||
sp.connParams.host = server.serverAddress().toString();
|
sp.connParams.host = server.serverAddress().toString();
|
||||||
sp.connParams.port = server.serverPort();
|
sp.connParams.port = server.serverPort();
|
||||||
sp.startMode = StartLocal;
|
sp.startMode = StartLocal;
|
||||||
sp.localRunMode = static_cast<ProjectExplorer::ApplicationLauncher::Mode>(rc1->runMode());
|
sp.localRunMode = static_cast<ApplicationLauncher::Mode>(rc1->runMode());
|
||||||
} else if (RemoteLinux::AbstractRemoteLinuxRunConfiguration *rc2 =
|
} else if (RemoteLinux::AbstractRemoteLinuxRunConfiguration *rc2 =
|
||||||
qobject_cast<RemoteLinux::AbstractRemoteLinuxRunConfiguration *>(runConfiguration)) {
|
qobject_cast<RemoteLinux::AbstractRemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||||
sp.startMode = StartRemote;
|
sp.startMode = StartRemote;
|
||||||
@@ -131,7 +131,7 @@ public:
|
|||||||
|
|
||||||
RunConfigWidget *createConfigurationWidget()
|
RunConfigWidget *createConfigurationWidget()
|
||||||
{
|
{
|
||||||
return new Analyzer::AnalyzerRunConfigWidget(this);
|
return new AnalyzerRunConfigWidget(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ void WinRtDevice::executeAction(Core::Id actionId, QWidget *parent)
|
|||||||
|
|
||||||
DeviceProcessSignalOperation::Ptr WinRtDevice::signalOperation() const
|
DeviceProcessSignalOperation::Ptr WinRtDevice::signalOperation() const
|
||||||
{
|
{
|
||||||
class WinRtDesktopSignalOperation : public ProjectExplorer::DesktopProcessSignalOperation
|
class WinRtDesktopSignalOperation : public DesktopProcessSignalOperation
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WinRtDesktopSignalOperation() {}
|
WinRtDesktopSignalOperation() {}
|
||||||
|
|||||||
@@ -242,14 +242,14 @@ QString WinRtPackageDeploymentStep::defaultWinDeployQtArguments() const
|
|||||||
void WinRtPackageDeploymentStep::raiseError(const QString &errorMessage)
|
void WinRtPackageDeploymentStep::raiseError(const QString &errorMessage)
|
||||||
{
|
{
|
||||||
emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
|
emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
|
||||||
emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
|
emit addTask(Task(Task::Error, errorMessage, Utils::FileName(), -1,
|
||||||
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
|
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WinRtPackageDeploymentStep::raiseWarning(const QString &warningMessage)
|
void WinRtPackageDeploymentStep::raiseWarning(const QString &warningMessage)
|
||||||
{
|
{
|
||||||
emit addOutput(warningMessage, BuildStep::MessageOutput);
|
emit addOutput(warningMessage, BuildStep::MessageOutput);
|
||||||
emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Warning, warningMessage, Utils::FileName(), -1,
|
emit addTask(Task(Task::Warning, warningMessage, Utils::FileName(), -1,
|
||||||
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
|
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,8 +136,8 @@ WinRtRunControlFactory::WinRtRunControlFactory()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WinRtRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
bool WinRtRunControlFactory::canRun(RunConfiguration *runConfiguration,
|
||||||
ProjectExplorer::RunMode mode) const
|
RunMode mode) const
|
||||||
{
|
{
|
||||||
if (!runConfiguration)
|
if (!runConfiguration)
|
||||||
return false;
|
return false;
|
||||||
@@ -158,7 +158,7 @@ bool WinRtRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::RunControl *WinRtRunControlFactory::create(
|
RunControl *WinRtRunControlFactory::create(
|
||||||
RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
|
RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
WinRtRunConfiguration *rc = qobject_cast<WinRtRunConfiguration *>(runConfiguration);
|
WinRtRunConfiguration *rc = qobject_cast<WinRtRunConfiguration *>(runConfiguration);
|
||||||
|
|||||||
@@ -56,11 +56,11 @@ static QString dataFile(const QLatin1String &file)
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
qRegisterMetaType<Valgrind::XmlProtocol::Error>();
|
qRegisterMetaType<Error>();
|
||||||
|
|
||||||
ThreadedParser parser;
|
ThreadedParser parser;
|
||||||
|
|
||||||
Valgrind::Memcheck::MemcheckRunner runner;
|
Memcheck::MemcheckRunner runner;
|
||||||
runner.setValgrindExecutable(fakeValgrindExecutable());
|
runner.setValgrindExecutable(fakeValgrindExecutable());
|
||||||
runner.setValgrindArguments(QStringList() << QLatin1String("-i") << dataFile(QLatin1String("memcheck-output-sample1.xml")) );
|
runner.setValgrindArguments(QStringList() << QLatin1String("-i") << dataFile(QLatin1String("memcheck-output-sample1.xml")) );
|
||||||
runner.setParser(&parser);
|
runner.setParser(&parser);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
namespace QTest {
|
namespace QTest {
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline bool qCompare(int const &t1, Valgrind::XmlProtocol::MemcheckErrorKind const &t2,
|
inline bool qCompare(int const &t1, MemcheckErrorKind const &t2,
|
||||||
char const *actual, char const *expected, char const *file, int line)
|
char const *actual, char const *expected, char const *file, int line)
|
||||||
{
|
{
|
||||||
return qCompare(t1, int(t2), actual, expected, file, line);
|
return qCompare(t1, int(t2), actual, expected, file, line);
|
||||||
@@ -219,7 +219,7 @@ void ParserTests::testHelgrindSample1()
|
|||||||
expectedErrors.append(error1);
|
expectedErrors.append(error1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Valgrind::XmlProtocol::Parser parser;
|
Parser parser;
|
||||||
Recorder rec(&parser);
|
Recorder rec(&parser);
|
||||||
|
|
||||||
parser.parse(m_socket);
|
parser.parse(m_socket);
|
||||||
@@ -295,7 +295,7 @@ void ParserTests::testMemcheckSample1()
|
|||||||
expectedSuppCounts.push_back(qMakePair(QString::fromLatin1("dl-hack3-cond-1"), static_cast<qint64>(2)));
|
expectedSuppCounts.push_back(qMakePair(QString::fromLatin1("dl-hack3-cond-1"), static_cast<qint64>(2)));
|
||||||
expectedSuppCounts.push_back(qMakePair(QString::fromLatin1("glibc-2.5.x-on-SUSE-10.2-(PPC)-2a"), static_cast<qint64>(2)));
|
expectedSuppCounts.push_back(qMakePair(QString::fromLatin1("glibc-2.5.x-on-SUSE-10.2-(PPC)-2a"), static_cast<qint64>(2)));
|
||||||
|
|
||||||
Valgrind::XmlProtocol::Parser parser;
|
Parser parser;
|
||||||
Recorder rec(&parser);
|
Recorder rec(&parser);
|
||||||
|
|
||||||
parser.parse(m_socket);
|
parser.parse(m_socket);
|
||||||
@@ -326,7 +326,7 @@ void ParserTests::testMemcheckSample2()
|
|||||||
|
|
||||||
initTest(QLatin1String("memcheck-output-sample2.xml"));
|
initTest(QLatin1String("memcheck-output-sample2.xml"));
|
||||||
|
|
||||||
Valgrind::XmlProtocol::Parser parser;
|
Parser parser;
|
||||||
Recorder rec(&parser);
|
Recorder rec(&parser);
|
||||||
|
|
||||||
parser.parse(m_socket);
|
parser.parse(m_socket);
|
||||||
@@ -352,7 +352,7 @@ void ParserTests::testMemcheckSample3()
|
|||||||
|
|
||||||
initTest(QLatin1String("memcheck-output-sample3.xml"));
|
initTest(QLatin1String("memcheck-output-sample3.xml"));
|
||||||
|
|
||||||
Valgrind::XmlProtocol::Parser parser;
|
Parser parser;
|
||||||
Recorder rec(&parser);
|
Recorder rec(&parser);
|
||||||
|
|
||||||
parser.parse(m_socket);
|
parser.parse(m_socket);
|
||||||
@@ -405,7 +405,7 @@ void ParserTests::testMemcheckCharm()
|
|||||||
// a somewhat larger file, to make sure buffering and partial I/O works ok
|
// a somewhat larger file, to make sure buffering and partial I/O works ok
|
||||||
initTest(QLatin1String("memcheck-output-untitled.xml"));
|
initTest(QLatin1String("memcheck-output-untitled.xml"));
|
||||||
|
|
||||||
Valgrind::XmlProtocol::Parser parser;
|
Parser parser;
|
||||||
Recorder rec(&parser);
|
Recorder rec(&parser);
|
||||||
|
|
||||||
parser.parse(m_socket);
|
parser.parse(m_socket);
|
||||||
@@ -423,7 +423,7 @@ void ParserTests::testValgrindCrash()
|
|||||||
{
|
{
|
||||||
initTest(QLatin1String("memcheck-output-sample1.xml"), QStringList() << "--crash");
|
initTest(QLatin1String("memcheck-output-sample1.xml"), QStringList() << "--crash");
|
||||||
|
|
||||||
Valgrind::XmlProtocol::Parser parser;
|
Parser parser;
|
||||||
parser.parse(m_socket);
|
parser.parse(m_socket);
|
||||||
m_process->waitForFinished();
|
m_process->waitForFinished();
|
||||||
QCOMPARE(m_process->state(), QProcess::NotRunning);
|
QCOMPARE(m_process->state(), QProcess::NotRunning);
|
||||||
@@ -438,7 +438,7 @@ void ParserTests::testValgrindGarbage()
|
|||||||
{
|
{
|
||||||
initTest(QLatin1String("memcheck-output-sample1.xml"), QStringList() << "--garbage");
|
initTest(QLatin1String("memcheck-output-sample1.xml"), QStringList() << "--garbage");
|
||||||
|
|
||||||
Valgrind::XmlProtocol::Parser parser;
|
Parser parser;
|
||||||
parser.parse(m_socket);
|
parser.parse(m_socket);
|
||||||
m_process->waitForFinished();
|
m_process->waitForFinished();
|
||||||
QCOMPARE(m_process->state(), QProcess::NotRunning);
|
QCOMPARE(m_process->state(), QProcess::NotRunning);
|
||||||
@@ -451,7 +451,7 @@ void ParserTests::testValgrindGarbage()
|
|||||||
void ParserTests::testParserStop()
|
void ParserTests::testParserStop()
|
||||||
{
|
{
|
||||||
ThreadedParser parser;
|
ThreadedParser parser;
|
||||||
Valgrind::Memcheck::MemcheckRunner runner;
|
Memcheck::MemcheckRunner runner;
|
||||||
runner.setValgrindExecutable(fakeValgrindExecutable());
|
runner.setValgrindExecutable(fakeValgrindExecutable());
|
||||||
runner.setParser(&parser);
|
runner.setParser(&parser);
|
||||||
runner.setValgrindArguments(QStringList() << QLatin1String("-i")
|
runner.setValgrindArguments(QStringList() << QLatin1String("-i")
|
||||||
@@ -471,7 +471,7 @@ void ParserTests::testRealValgrind()
|
|||||||
qDebug() << "running exe:" << executable << " HINT: set VALGRIND_TEST_BIN to change this";
|
qDebug() << "running exe:" << executable << " HINT: set VALGRIND_TEST_BIN to change this";
|
||||||
ThreadedParser parser;
|
ThreadedParser parser;
|
||||||
|
|
||||||
Valgrind::Memcheck::MemcheckRunner runner;
|
Memcheck::MemcheckRunner runner;
|
||||||
runner.setValgrindExecutable(QLatin1String("valgrind"));
|
runner.setValgrindExecutable(QLatin1String("valgrind"));
|
||||||
runner.setDebuggeeExecutable(executable);
|
runner.setDebuggeeExecutable(executable);
|
||||||
runner.setParser(&parser);
|
runner.setParser(&parser);
|
||||||
@@ -507,7 +507,7 @@ void ParserTests::testValgrindStartError()
|
|||||||
|
|
||||||
ThreadedParser parser;
|
ThreadedParser parser;
|
||||||
|
|
||||||
Valgrind::Memcheck::MemcheckRunner runner;
|
Memcheck::MemcheckRunner runner;
|
||||||
runner.setParser(&parser);
|
runner.setParser(&parser);
|
||||||
runner.setValgrindExecutable(valgrindExe);
|
runner.setValgrindExecutable(valgrindExe);
|
||||||
runner.setValgrindArguments(valgrindArgs);
|
runner.setValgrindArguments(valgrindArgs);
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ private slots:
|
|||||||
qApp->quit();
|
qApp->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleError(QSsh::SshError error)
|
void handleError(SshError error)
|
||||||
{
|
{
|
||||||
if (m_testSet.isEmpty()) {
|
if (m_testSet.isEmpty()) {
|
||||||
qDebug("Error: Received error %d, but no test was running.", error);
|
qDebug("Error: Received error %d, but no test was running.", error);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ ArgumentsCollector::ArgumentsCollector(const QStringList &args)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QSsh::SshConnectionParameters ArgumentsCollector::collect(bool &success) const
|
SshConnectionParameters ArgumentsCollector::collect(bool &success) const
|
||||||
{
|
{
|
||||||
SshConnectionParameters parameters;
|
SshConnectionParameters parameters;
|
||||||
parameters.options &= ~SshIgnoreDefaultProxy;
|
parameters.options &= ~SshIgnoreDefaultProxy;
|
||||||
|
|||||||
@@ -93,8 +93,7 @@ void RemoteProcessTest::handleProcessStarted()
|
|||||||
} else {
|
} else {
|
||||||
m_started = true;
|
m_started = true;
|
||||||
if (m_state == TestingCrash) {
|
if (m_state == TestingCrash) {
|
||||||
QSsh::SshRemoteProcessRunner * const killer
|
SshRemoteProcessRunner * const killer = new SshRemoteProcessRunner(this);
|
||||||
= new QSsh::SshRemoteProcessRunner(this);
|
|
||||||
killer->run("pkill -9 sleep", m_sshParams);
|
killer->run("pkill -9 sleep", m_sshParams);
|
||||||
} else if (m_state == TestingIoDevice) {
|
} else if (m_state == TestingIoDevice) {
|
||||||
connect(m_catProcess.data(), SIGNAL(readyRead()), SLOT(handleReadyRead()));
|
connect(m_catProcess.data(), SIGNAL(readyRead()), SLOT(handleReadyRead()));
|
||||||
@@ -214,7 +213,7 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
|
|||||||
}
|
}
|
||||||
std::cout << "Ok.\nTesting I/O device functionality... " << std::flush;
|
std::cout << "Ok.\nTesting I/O device functionality... " << std::flush;
|
||||||
m_state = TestingIoDevice;
|
m_state = TestingIoDevice;
|
||||||
m_sshConnection = new QSsh::SshConnection(m_sshParams);
|
m_sshConnection = new SshConnection(m_sshParams);
|
||||||
connect(m_sshConnection, SIGNAL(connected()), SLOT(handleConnected()));
|
connect(m_sshConnection, SIGNAL(connected()), SLOT(handleConnected()));
|
||||||
connect(m_sshConnection, SIGNAL(error(QSsh::SshError)),
|
connect(m_sshConnection, SIGNAL(error(QSsh::SshError)),
|
||||||
SLOT(handleConnectionError()));
|
SLOT(handleConnectionError()));
|
||||||
@@ -308,7 +307,7 @@ void RemoteProcessTest::handleReadyRead()
|
|||||||
<< qPrintable(testString()) << "', got '" << qPrintable(data) << "'." << std::endl;
|
<< qPrintable(testString()) << "', got '" << qPrintable(data) << "'." << std::endl;
|
||||||
qApp->exit(1);
|
qApp->exit(1);
|
||||||
}
|
}
|
||||||
QSsh::SshRemoteProcessRunner * const killer = new QSsh::SshRemoteProcessRunner(this);
|
SshRemoteProcessRunner * const killer = new SshRemoteProcessRunner(this);
|
||||||
killer->run("pkill -9 cat", m_sshParams);
|
killer->run("pkill -9 cat", m_sshParams);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ void SftpTest::handleChannelClosed()
|
|||||||
m_connection->disconnectFromHost();
|
m_connection->disconnectFromHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SftpTest::handleJobFinished(QSsh::SftpJobId job, const QString &error)
|
void SftpTest::handleJobFinished(SftpJobId job, const QString &error)
|
||||||
{
|
{
|
||||||
switch (m_state) {
|
switch (m_state) {
|
||||||
case UploadingSmall:
|
case UploadingSmall:
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
using namespace QSsh;
|
using namespace QSsh;
|
||||||
|
|
||||||
Shell::Shell(const QSsh::SshConnectionParameters ¶meters, QObject *parent)
|
Shell::Shell(const SshConnectionParameters ¶meters, QObject *parent)
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
m_connection(new SshConnection(parameters)),
|
m_connection(new SshConnection(parameters)),
|
||||||
m_stdin(new QFile(this))
|
m_stdin(new QFile(this))
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ ArgumentsCollector::ArgumentsCollector(const QStringList &args)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QSsh::SshConnectionParameters ArgumentsCollector::collect(bool &success) const
|
SshConnectionParameters ArgumentsCollector::collect(bool &success) const
|
||||||
{
|
{
|
||||||
SshConnectionParameters parameters;
|
SshConnectionParameters parameters;
|
||||||
parameters.options &= ~SshIgnoreDefaultProxy;
|
parameters.options &= ~SshIgnoreDefaultProxy;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const QByteArray TestData("Urgsblubb?");
|
|||||||
|
|
||||||
using namespace QSsh;
|
using namespace QSsh;
|
||||||
|
|
||||||
Tunnel::Tunnel(const QSsh::SshConnectionParameters ¶meters, QObject *parent)
|
Tunnel::Tunnel(const SshConnectionParameters ¶meters, QObject *parent)
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
m_connection(new SshConnection(parameters, this)),
|
m_connection(new SshConnection(parameters, this)),
|
||||||
m_tunnelServer(new QTcpServer(this)),
|
m_tunnelServer(new QTcpServer(this)),
|
||||||
|
|||||||
Reference in New Issue
Block a user