\snippet examples/addressbook-sdk/part1/main.cpp main function
- The code constructs a new \c AddressBook widget on the stack and
- invokes its \l{QWidget::}{show()} function to display it.
+ The code constructs a new \c AddressBook widget on the stack and
+ invokes its \l{QWidget::}{show()} function to display it.
However, the widget will not be shown until the application's event
loop is started. This is done by calling the application's
\l{QApplication::}{exec()} function. Finally, the result returned by
the case that you have better ideas, discuss them with other developers
before writing the code.
\o Take advantage of Qt. Don't re-invent the wheel. Think about what parts
- of your code are generic enough that they might be incorporated into
- Qt proper.
+ of your code are generic enough that they might be incorporated into
+ Qt proper.
\o Document interfaces. Right now we use qdoc, but changing to doxygen
is being considered.
\endlist
\endcode
-\o Using Qt's foreach is ok in non-time critical code when using a QTL
+\o Using Qt's foreach is ok in non-time critical code when using a QTL
container. It is a nice way to keep line noise down and to give the
loop variable a proper name:
for (Container::iterator it = container.begin(); it != end; ++it)
doSomething(*it);
\endcode
-
- If the loop variable can be made const, do so. This can prevent
+
+ If the loop variable can be made const, do so. This can prevent
unnecessary detaching of shared data in some cases. So:
\code
foreach (const QString &name, someListOfNames)
doSomething(name);
-
+
- NOT -
foreach (QString name, someListOfNames)
-NOT-
QString a = "Joe", b = "Foo"; // not used in Qt Creator
\endcode
- [Note that 'QString a = "Joe"' is formally calling a copy constructor
+ [Note that 'QString a = "Joe"' is formally calling a copy constructor
on a temporary constructed from a string literal and therefore has the
potential of being more expensive then direct construction by
'QString a("joe")'. However the compiler is allowed to elide the copy
line with the traditional C-style initialization, _and_ cannot be
mistaken as function declaration, _and_ reduces the level of nested
parantheses in more initializations.]
-
+
\section2 Pointers and references
\section2 File headers
- If you create a new file, the top of the file should include a
+ If you create a new file, the top of the file should include a
header comment equal to the one found in other source files of Qt Creator.
\section2 Include order
You document for the other developers, not for yourself.
In the header you should document interfaces, i.e. what the function does,
not the implementation.
- In the .cpp files you document the implementation if the implementation
+ In the .cpp files you document the implementation if the implementation
in non-obvious.
## Properly close subshell
-)
+)
exit $?
## Properly close subshell
-)
+)
exit $?
{
ModelIndex *mm = reinterpret_cast<ModelIndex *>(&mi);
mm->r = mm->c = 0;
- mm->p = mm->m = 0;
+ mm->p = mm->m = 0;
static const char *printFormat = sizeof(void *) == sizeof(long) ?
"%d,%d,0x%lx,0x%lx" : "%d,%d,0x%llx,0x%llx";
sscanf(d.templateParameters[0], printFormat, &mm->r, &mm->c, &mm->p, &mm->m);
case QVariant::KeySequence:
#ifndef QT_NO_SHORTCUT
*value = qvariant_cast<QKeySequence>(*v).toString();
- #else
+ #else
*value = QString::fromLatin1("Disabled by QT_NO_SHORTCUT");
#endif
break;
const QSharedPointer<int> &ptr =
*reinterpret_cast<const QSharedPointer<int> *>(d.data);
- if (ptr.isNull()) {
+ if (ptr.isNull()) {
d.putItem("value", "<null>");
d.putItem("valueeditable", "false");
d.putItem("numchild", 0);
const SizeMap::const_iterator cend = sizeMap.constEnd();
for (SizeMap::const_iterator it = sizeMap.constBegin(); it != cend; ++it) {
// new size list
- if (it.key() != lastSize) {
+ if (it.key() != lastSize) {
if (lastSize)
- d.put("],");
+ d.put("],");
d.put("[\"");
d.put(it.key());
lastSize = it.key();
d.put(it.value());
d.put('"');
}
- d.put("]]");
+ d.put("]]");
}
extern "C" Q_DECL_EXPORT
TEMPLATE = lib
CONFIG += shared
-linux-* {
+linux-* {
CONFIG -= release
CONFIG += debug
}
SOURCES = gdbmacros.cpp
-false {
+false {
DEFINES += USE_QT_GUI=0
QT = core
}
-else {
+else {
DEFINES += USE_QT_GUI=1
QT = core \
gui
test.insert(QLatin1String("42s"), QLatin1String("fortytwo"));
test.insert(QLatin1String("423"), QLatin1String("fortytree"));
}
- prepareInBuffer("QMap", "local.qmapqstringqstring", "local.qmapqstringqstring", "QString@QString");
+ prepareInBuffer("QMap", "local.qmapqstringqstring", "local.qmapqstringqstring", "QString@QString");
qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(QString), sizeof(QString), sizeof(mapNode), valueOffset);
fputs(qDumpOutBuffer, stdout);
fputc('\n', stdout);
static int dumpStdMapIntString()
{
- std::map<int,std::string> test;
+ std::map<int,std::string> test;
std::map<int,std::string>::value_type entry(42, std::string("fortytwo"));
if (!optEmptyContainers) {
test.insert(entry);
/*!
\fn void Client::startExpandingMacro(unsigned offset, const Macro ¯o, const QByteArray &originalText, bool inCondition = false, const QVector<MacroArgumentReference> &actuals = QVector<MacroArgumentReference>())
-
+
Called when starting to expand a macro. The parameter \a inCondition indicates whether the
expansion is happening inside a preprocessor conditional.
-
+
\sa stopExpandingMacro()
*/
}
}
- } else if (Function *funTy = ty->asFunctionType()) {
+ } else if (Function *funTy = ty->asFunctionType()) {
if (maybeValidPrototype(funTy, actualArgumentCount))
addResult(funTy->returnType().simplified(), lastVisibleSymbol);
Name *arrowAccessOp = control()->operatorNameId(OperatorNameId::ArrowOp);
const QList<Symbol *> candidates = resolveClass(namedTy->name(), result, _context);
- foreach (Symbol *classObject, candidates) {
+ foreach (Symbol *classObject, candidates) {
const QList<Result> overloads = resolveMember(arrowAccessOp, classObject->asClass(),
namedTy->name());
foreach (Symbol *candidate, candidates) {
FullySpecifiedType ty = candidate->type();
Name *unqualifiedNameId = className;
-
+
if (QualifiedNameId *q = className->asQualifiedNameId())
unqualifiedNameId = q->unqualifiedNameId();
-
+
if (TemplateNameId *templId = unqualifiedNameId->asTemplateNameId()) {
GenTemplateInstance::Substitution subst;
-
+
for (unsigned i = 0; i < templId->templateArgumentCount(); ++i) {
FullySpecifiedType templArgTy = templId->templateArgumentAt(i);
-
+
if (i < klass->templateParameterCount()) {
Name *templArgName = klass->templateParameterAt(i)->name();
if (templArgName && templArgName->identifier()) {
}
}
}
-
+
GenTemplateInstance inst(_context, subst);
ty = inst(candidate);
}
-
+
results.append(Result(ty, candidate));
}
QMap<QString, QString> *foundAppOptions,
QString *errorString,
PluginManagerPrivate *pmPrivate);
-
+
bool parse();
static const char *NO_LOAD_OPTION;
enum TokenType { OptionalToken, RequiredToken };
bool nextToken(TokenType type = OptionalToken);
-
+
const QStringList &m_args;
const QMap<QString, bool> &m_appOptions;
QMap<QString, QString> *m_foundAppOptions;
QString *m_errorString;
PluginManagerPrivate *m_pmPrivate;
-
+
// state
QString m_currentArg;
QStringList::const_iterator m_it;
public:
PluginDetailsView(QWidget *parent = 0);
~PluginDetailsView();
-
+
void update(PluginSpec *spec);
private:
The caller (the application) may register itself for options via the \a appOptions list, containing pairs
of "option string" and a bool that indicates if the option requires an argument.
Application options always override any plugin's options.
-
+
\a foundAppOptions is set to pairs of ("option string", "argument") for any application options that were found.
The command line options that were not processed can be retrieved via the arguments() method.
If an error occurred (like missing argument for an option that requires one), \a errorString contains
a descriptive message of the error.
-
+
Returns if there was an error.
*/
bool PluginManager::parseOptions(const QStringList &args,
given plugin \a manager with a given \a parent widget.
*/
PluginView::PluginView(PluginManager *manager, QWidget *parent)
- : QWidget(parent),
+ : QWidget(parent),
m_ui(new Internal::Ui::PluginView),
p(new Internal::PluginViewPrivate)
{
#include <windows.h>
-namespace Utils {
+namespace Utils {
QStringList AbstractProcess::fixWinEnvironment(const QStringList &env)
{
/*!
\class Utils::SavedAction
-
+
\brief The SavedAction class is a helper class for actions with persistent
state.
}
/*
- Uses \c settingsGroup() and \c settingsKey() to restore the
+ Uses \c settingsGroup() and \c settingsKey() to restore the
item from \a settings,
\sa settingsKey(), settingsGroup(), writeSettings()
}
/*
- Uses \c settingsGroup() and \c settingsKey() to write the
+ Uses \c settingsGroup() and \c settingsKey() to write the
item to \a settings,
\sa settingsKey(), settingsGroup(), readSettings()
//qDebug() << "WRITING: " << m_settingsKey << " -> " << toString();
settings->endGroup();
}
-
+
/*
A \c SavedAction can be connected to a widget, typically a
checkbox, radiobutton, or a lineedit in some configuration dialog.
- The widget will retrieve its contents from the SavedAction's
+ The widget will retrieve its contents from the SavedAction's
value, and - depending on the \a ApplyMode - either write
changes back immediately, or when \s SavedAction::apply()
is called explicitly.
qDebug() << "ALREADY CONNECTED: " << widget << m_widget << toString(); return);
m_widget = widget;
m_applyMode = applyMode;
-
+
if (QAbstractButton *button = qobject_cast<QAbstractButton *>(widget)) {
if (button->isCheckable()) {
button->setChecked(m_value.toBool());
}
} else if (QSpinBox *spinBox = qobject_cast<QSpinBox *>(widget)) {
spinBox->setValue(m_value.toInt());
- //qDebug() << "SETTING VALUE" << spinBox->value();
+ //qDebug() << "SETTING VALUE" << spinBox->value();
connect(spinBox, SIGNAL(valueChanged(int)),
this, SLOT(spinBoxValueChanged(int)));
connect(spinBox, SIGNAL(valueChanged(QString)),
this, SLOT(spinBoxValueChanged(QString)));
} else if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget)) {
lineEdit->setText(m_value.toString());
- //qDebug() << "SETTING TEXT" << lineEdit->text();
+ //qDebug() << "SETTING TEXT" << lineEdit->text();
connect(lineEdit, SIGNAL(editingFinished()),
this, SLOT(lineEditEditingFinished()));
} else if (PathChooser *pathChooser = qobject_cast<PathChooser *>(widget)) {
virtual void readSettings(QSettings *settings);
Q_SLOT virtual void writeSettings(QSettings *settings);
-
+
virtual void connectWidget(QWidget *widget, ApplyMode applyMode = DeferedApply);
virtual void disconnectWidget();
Q_SLOT virtual void apply(QSettings *settings);
const QChar newLine = QLatin1Char('\n');
QString rc;
QTextCursor cursor(e->document());
- cursor.movePosition(QTextCursor::Start);
+ cursor.movePosition(QTextCursor::Start);
while (!cursor.atEnd()) {
cursor.select(QTextCursor::LineUnderCursor);
rc += cursor.selectedText();
qDebug() << Q_FUNC_INFO << v;
if (v) {
m_d->m_ui.description->setLineWrapColumnOrWidth(m_d->m_lineWidth);
- m_d->m_ui.description->setLineWrapMode(QTextEdit::FixedColumnWidth);
+ m_d->m_ui.description->setLineWrapMode(QTextEdit::FixedColumnWidth);
} else {
m_d->m_ui.description->setLineWrapMode(QTextEdit::NoWrap);
}
void SubmitEditorWidget::editorCustomContextMenuRequested(const QPoint &pos)
{
- QMenu *menu = m_d->m_ui.description->createStandardContextMenu();
+ QMenu *menu = m_d->m_ui.description->createStandardContextMenu();
// Extend
foreach (const SubmitEditorWidgetPrivate::AdditionalContextMenuAction &a, m_d->descriptionEditContextMenuActions) {
if (a.second) {
clearButton->deleteLater();
browseButton->deleteLater();
toolBar->deleteLater();
- lineEdit->deleteLater();
+ lineEdit->deleteLater();
combo->deleteLater();
layout->deleteLater();
}
{
// remove old fields
for (int i = m_d->fieldEntries.size() - 1 ; i >= 0 ; i--)
- removeField(i);
+ removeField(i);
m_d->fields = f;
if (!f.empty())
fancymainwindow.cpp \
detailsbutton.cpp \
detailswidget.cpp
-win32 {
+win32 {
SOURCES += abstractprocess_win.cpp \
consoleprocess_win.cpp \
winutils.cpp
if (!(*verQueryValueW)(data, TEXT("\\"), &versionInfo, &len)) {
*errorMessage = QString::fromLatin1("Unable to determine version string of %1: %2").arg(name, winErrorMessage(GetLastError()));
return QString();
- }
+ }
QString rc;
switch (t) {
case WinDLLFileVersion:
}
}
}
- }
+ }
m_generatorComboBox->clear();
// Find out whether we have multiple msvc versions
QStringList msvcVersions = ProjectExplorer::ToolChain::availableMSVCVersions();
generator = "-GCodeBlocks - NMake Makefiles";
m_cmakeWizard->setMsvcVersion(version);
}
- }
+ }
}
#else // Q_OS_WIN
QString generator = QLatin1String("-GCodeBlocks - Unix Makefiles");
{
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
m_projectContext = uidm->uniqueIdentifier(CMakeProjectManager::Constants::PROJECTCONTEXT);
- m_projectLanguage = uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
+ m_projectLanguage = uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
}
int CMakeManager::projectContext() const
proc->setProcessChannelMode(QProcess::MergedChannels);
proc->setEnvironment(env.toStringList());
- const QString srcdir = buildDirectory.exists(QLatin1String("CMakeCache.txt")) ? QString(QLatin1Char('.')) : sourceDirectory;
+ const QString srcdir = buildDirectory.exists(QLatin1String("CMakeCache.txt")) ? QString(QLatin1Char('.')) : sourceDirectory;
proc->start(cmakeExecutable(), QStringList() << srcdir << arguments << generator);
}
cmakeopenprojectwizard.cpp \
cmakebuildenvironmentwidget.cpp
RESOURCES += cmakeproject.qrc
-FORMS +=
+FORMS +=
OTHER_FILES += CMakeProjectManager.pluginspec
protected:
void updateToolTipWithKeySequence();
-
+
QAction *m_action;
QList<CommandLocation> m_locations;
QString m_toolTip;
namespace Internal {
struct ShortcutItem;
-
+
class CommandsFile : public QObject
{
Q_OBJECT
generalsettings.ui
RESOURCES += core.qrc \
fancyactionbar.qrc
-unix:!macx {
+unix:!macx {
images.files = images/qtcreator_logo_*.png
images.path = /share/pixmaps
INSTALLS += images
const QString &contents = QString());
bool openExternalEditor(const QString &fileName, const QString &editorKind);
-
+
QStringList getOpenFileNames() const;
QString getOpenWithEditorKind(const QString &fileName, bool *isExternalEditor = 0) const;
inline bool isView() const { return m_view != 0; }
inline bool isRoot() const { return m_isRoot; }
-
+
inline bool isSplitter() const { return m_splitter != 0; }
inline Core::IEditor *editor() const { return m_view ? m_view->currentEditor() : 0; }
inline QList<Core::IEditor *> editors() const { return m_view ? m_view->editors() : QList<Core::IEditor*>(); }
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
-
+
#ifndef OPENEDITORSVIEW_H
#define OPENEDITORSVIEW_H
void mousePressEvent(QMouseEvent *ev)
{
- if (ev->modifiers() & Qt::ShiftModifier)
+ if (ev->modifiers() & Qt::ShiftModifier)
Utils::StyleHelper::setBaseColor(QColorDialog::getColor(Utils::StyleHelper::baseColor(), m_parent));
}
private:
virtual QString displayName() = 0;
virtual QKeySequence activationSequence();
// This design is not optimal, think about it again once we need to extend it
- // It could be implemented as returning an object which has both the widget
+ // It could be implemented as returning an object which has both the widget
// and the docktoolbar widgets
// Similar to how IView
virtual NavigationView createWidget() = 0;
void OutputPaneManager::create()
{
- m_instance = new OutputPaneManager;
+ m_instance = new OutputPaneManager;
}
void OutputPaneManager::destroy()
#include <QtGui/QPainter>
#include <QtGui/QWidget>
-/*
+/*
* This is a set of helper classes to allow for widget animations in
* the style. Its mostly taken from Vista style so it should be fully documented
* there.
*
*/
-
+
class Animation
{
public :
void startAnimation(Animation *);
void stopAnimation(const QWidget *);
Animation* widgetAnimation(const QWidget *) const;
-
+
private:
QBasicTimer animationTimer;
QList <Animation*> animations;
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
"PARTICULAR PURPOSE.<br/>")
- .arg(version, QLatin1String(QT_VERSION_STR), QString::number(QSysInfo::WordSize),
- QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(IDE_YEAR),
+ .arg(version, QLatin1String(QT_VERSION_STR), QString::number(QSysInfo::WordSize),
+ QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(IDE_YEAR),
(QLatin1String(IDE_AUTHOR)), ideRev);
QLabel *copyRightLabel = new QLabel(description);
connect(m_newClassWidget, SIGNAL(validChanged()), this, SLOT(slotValidChanged()));
- QVBoxLayout *pageLayout = new QVBoxLayout(this);
+ QVBoxLayout *pageLayout = new QVBoxLayout(this);
pageLayout->addWidget(m_newClassWidget);
QSpacerItem *vSpacer = new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::Expanding);
pageLayout->addItem(vSpacer);
void CPPEditor::findUsages()
-{
+{
if (Symbol *canonicalSymbol = markSymbols()) {
m_modelManager->findUsages(canonicalSymbol);
}
bool CPPEditorEditable::open(const QString & fileName)
{
- bool b = TextEditor::BaseTextEditorEditable::open(fileName);
+ bool b = TextEditor::BaseTextEditorEditable::open(fileName);
editor()->setMimeType(Core::ICore::instance()->mimeDatabase()->findByFile(QFileInfo(fileName)).type());
return b;
}
| TextEditor::TextEditorActionHandler::UnCollapseAll);
m_actionHandler->initializeActions();
-
+
contextMenu->addAction(createSeparator(am, this, context, CppEditor::Constants::SEPARATOR));
cmd = am->command(TextEditor::Constants::AUTO_INDENT_SELECTION);
void toSettings(QSettings *) const;
void fromSettings(QSettings *);
- bool applySuffixesToMimeDB();
+ bool applySuffixesToMimeDB();
// Convenience to return a license template completely formatted.
// Currently made public in
CppFileSettings settings() const;
void setSettings(const CppFileSettings &s);
-private slots:
+private slots:
void slotEdit();
private:
public Q_SLOTS:
void updateModifiedSourceFiles();
- virtual void updateSourceFiles(const QStringList &sourceFiles) = 0;
+ virtual void updateSourceFiles(const QStringList &sourceFiles) = 0;
virtual void GC() = 0;
};
// return;
if (m_data->markerLineNumber != lineNumber) {
m_data->markerLineNumber = lineNumber;
- // FIXME: should we tell gdb about the change?
+ // FIXME: should we tell gdb about the change?
// Ignore it for now, as we would require re-compilation
// and debugger re-start anyway.
if (0 && !m_data->bpLineNumber.isEmpty()) {
bpMultiple = false;
//#if defined(Q_OS_MAC)
// // full names do not work on Mac/MI
- useFullPath = false;
+ useFullPath = false;
//#else
// //where = m_manager->shortName(data->fileName);
-// useFullPath = true;
+// useFullPath = true;
//#endif
}
// str = data->markerFileName;
str = str.isEmpty() ? empty : str;
if (data->useFullPath)
- str = "/.../" + str;
+ str = "/.../" + str;
return str;
}
if (role == Qt::UserRole)
}
return true;
}
- default: {
+ default: {
return false;
}
}
void BreakWindow::setAlwaysResizeColumnsToContents(bool on)
{
m_alwaysResizeColumnsToContents = on;
- QHeaderView::ResizeMode mode = on
+ QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
for (int i = model()->columnCount(); --i >= 0; )
header()->setResizeMode(i, mode);
# Detect presence of "Debugging Tools For Windows"
-# in case VS compilers are used.
+# in case VS compilers are used.
win32 {
contains(QMAKE_CXX, cl) {
ignoreCount = 0;
oneShot = false;
enabled = true;
- clearExpressionData();
+ clearExpressionData();
}
void CDBBreakPoint::clearExpressionData()
CIDebugSymbols *syms,
BreakHandler *handler,
QString *errorMessage, QStringList *warnings)
-{
+{
errorMessage->clear();
warnings->clear();
// Do an initial check whether we are in a state that allows
m_eventThreadId(-1),
m_interruptArticifialThreadId(-1),
m_ignoreInitialBreakPoint(false),
- m_interrupted(false),
+ m_interrupted(false),
m_watchTimer(-1),
m_debugEventCallBack(engine),
m_engine(engine),
}
void CdbDebugEnginePrivate::processCreatedAttached(ULONG64 processHandle, ULONG64 initialThreadHandle)
-{
+{
m_engine->setState(InferiorRunningRequested, Q_FUNC_INFO, __LINE__);
setDebuggeeHandles(reinterpret_cast<HANDLE>(processHandle), reinterpret_cast<HANDLE>(initialThreadHandle));
ULONG currentThreadId;
}
bool success = false;
switch (action) {
- case DetachInferior: {
+ case DetachInferior: {
const HRESULT hr = m_cif.debugClient->DetachCurrentProcess();
if (SUCCEEDED(hr)) {
success = true;
str << 'p';
break;
case DEBUG_STATUS_STEP_INTO:
- str << 't';
+ str << 't';
break;
case CdbExtendedExecutionStatusStepOut:
str << "gu";
}
void CdbDebugEngine::stepIExec()
-{
+{
stepExec(); // Step into by instruction (figured out by step)
}
void CdbDebugEngine::continueInferior()
{
- QString errorMessage;
+ QString errorMessage;
if (!m_d->continueInferior(&errorMessage))
warning(msgFunctionFailed(Q_FUNC_INFO, errorMessage));
}
QString errorMessage;
bool success = false;
StackHandler *stackHandler = manager()->stackHandler();
- do {
+ do {
WatchHandler *watchHandler = manager()->watchHandler();
const int oldIndex = stackHandler->currentIndex();
if (frameIndex >= stackHandler->stackSize()) {
bool ok = false;
QString errorMessage;
do {
- // get address
+ // get address
QString address;
if (!frame.file.isEmpty())
address = frame.address;
return false;
}
const QString msg = CdbDebugEngine::tr("Changing threads: %1 -> %2").arg(currentThreadId).arg(threadId);
- m_engine->showStatusMessage(msg, 500);
+ m_engine->showStatusMessage(msg, 500);
return true;
}
break;
}
// Visibly warn the users about missing top frames/all frames, as they otherwise
- // might think stepping is broken.
+ // might think stepping is broken.
if (!stackFrames.at(0).isUsable()) {
const QString topFunction = count ? stackFrames.at(0).function : QString();
const QString msg = current >= 0 ?
virtual void nextExec();
virtual void stepIExec();
virtual void nextIExec();
-
- virtual void continueInferior();
+
+ virtual void continueInferior();
virtual void interruptInferior();
virtual void runToLineExec(const QString &fileName, int lineNumber);
private slots:
void slotConsoleStubStarted();
void slotConsoleStubError(const QString &msg);
- void slotConsoleStubTerminated();
+ void slotConsoleStubTerminated();
void warning(const QString &w);
private:
const QSharedPointer<CdbOptions> m_options;
HANDLE m_hDebuggeeProcess;
HANDLE m_hDebuggeeThread;
- bool m_interrupted;
+ bool m_interrupted;
int m_currentThreadId;
int m_eventThreadId;
int m_interruptArticifialThreadId;
int m_watchTimer;
CdbComInterfaces m_cif;
CdbDebugEventCallback m_debugEventCallBack;
- CdbDebugOutput m_debugOutputCallBack;
+ CdbDebugOutput m_debugOutputCallBack;
QSharedPointer<CdbDumperHelper> m_dumper;
QString m_baseImagePath;
__in ULONG64 /* ThreadDataOffset */,
__in ULONG64 /* StartOffset */
)
-{
+{
return S_OK;
}
__in ULONG /* CheckSum */,
__in ULONG /* TimeDateStamp */
)
-{
+{
return S_OK;
}
__in ULONG /* Flags */,
__in ULONG64 /* Argument */
)
-{
+{
return S_OK;
}
case CdbDumperHelper::Loaded: // Injection load succeeded, ideally
break;
}
- // Perform remaining initialization
+ // Perform remaining initialization
emit statusMessage(QCoreApplication::translate("Debugger::Internal::CdbDumperHelper", "Initializing dumpers..."), 60000);
m_ok = m_helper.initResolveSymbols(m_errorMessage) && m_helper.initKnownTypes(m_errorMessage);
}
{
errorMessage->clear();
// Check failure cache and supported types
- if (m_state == Disabled) {
+ if (m_state == Disabled) {
*errorMessage =m_msgDisabled;
return DumpNotHandled;
}
{
// Retrieve current state
memset(&m_oldParameters, 0, sizeof(DEBUG_EXCEPTION_FILTER_PARAMETERS));
- if (getExceptionParameters(ctrl, code, &m_oldParameters, &m_errorString)) {
+ if (getExceptionParameters(ctrl, code, &m_oldParameters, &m_errorString)) {
// Are we in a nested instantiation?
const ULONG desiredExOption = m == IgnoreException ? DEBUG_FILTER_IGNORE : DEBUG_FILTER_OUTPUT;
const bool isAlreadyBlocked = m_oldParameters.ExecutionOption == desiredExOption
}
bool getModuleList(CIDebugSymbols *syms, QList<Module> *modules, QString *errorMessage)
-{
+{
ULONG count;
modules->clear();
if (!getModuleCount(syms, &count, errorMessage))
bool searchSymbols(CIDebugSymbols *syms, const QString &pattern,
QStringList *matches, QString *errorMessage)
{
- matches->clear();
+ matches->clear();
ULONG64 handle = 0;
// E_NOINTERFACE means "no match". Apparently, it does not always
// set handle.
// Prevent recursion of the model by setting value and type
static inline bool fixDumperType(WatchData *wd, const WatchData *source = 0)
-{
+{
const bool missing = wd->isTypeNeeded() || wd->type.isEmpty();
if (missing) {
static const QString unknownType = QCoreApplication::translate("CdbStackFrameContext", "<Unknown Type>");
explicit CdbStackFrameContext(const QSharedPointer<CdbDumperHelper> &dumper,
CdbSymbolGroupContext *symbolContext);
- ~CdbStackFrameContext();
+ ~CdbStackFrameContext();
bool assignValue(const QString &iname, const QString &value,
QString *newValue /* = 0 */, QString *errorMessage);
CdbStackTraceContext *CdbStackTraceContext::create(const QSharedPointer<CdbDumperHelper> &dumper,
unsigned long threadId,
QString *errorMessage)
-{
+{
if (debugCDB)
qDebug() << Q_FUNC_INFO << threadId;
// fill the DEBUG_STACK_FRAME array
}
int CdbStackTraceContext::indexOf(const QString &function) const
-{
+{
const QChar exclamationMark = QLatin1Char('!');
const int count = m_frames.size();
*errorMessage = msgFrameContextFailed(index, m_frames.at(index), *errorMessage);
return 0;
}
- // Exclude unitialized variables if desired
+ // Exclude unitialized variables if desired
QStringList uninitializedVariables;
- if (theDebuggerAction(UseCodeModel)->isChecked()) {
+ if (theDebuggerAction(UseCodeModel)->isChecked()) {
const StackFrame &frame = m_frames.at(index);
getUninitializedVariables(DebuggerManager::instance()->cppCodeModelSnapshot(), frame.function, frame.file, frame.line, &uninitializedVariables);
}
}
ULONG frameCount;
// Ignore the top frame if it is "ntdll!KiFastSystemCallRet", which is
- // not interesting for display.
+ // not interesting for display.
DEBUG_STACK_FRAME frames[MaxFrames];
hr = cif.debugControl->GetStackTrace(0, 0, 0, frames, MaxFrames, &frameCount);
if (FAILED(hr)) {
* Maintains an on-demand constructed list of CdbStackFrameContext
* containining the local variables of the stack. */
-class CdbStackTraceContext
+class CdbStackTraceContext
{
Q_DISABLE_COPY(CdbStackTraceContext)
return false;
stringValue.remove(0, 2);
// Remove 64bit separator
- if (stringValue.size() > 9) {
+ if (stringValue.size() > 9) {
const int sepPos = stringValue.size() - 9;
if (stringValue.at(sepPos) == QLatin1Char('`'))
stringValue.remove(sepPos, 1);
const QString fullShadowedName = WatchData::shadowedName(name, shadowedNumber);
wd.name = WatchData::shadowedName(removeInnerTemplateType(name), shadowedNumber);
wd.addr = hexSymbolOffset(m_symbolGroup, index);
- const QString type = getSymbolString(m_symbolGroup, &IDebugSymbolGroup2::GetSymbolTypeNameWide, index);
- wd.setType(type);
+ const QString type = getSymbolString(m_symbolGroup, &IDebugSymbolGroup2::GetSymbolTypeNameWide, index);
+ wd.setType(type);
// Check for unitialized variables at level 0 only.
const DEBUG_SYMBOL_PARAMETERS &p = m_symbolParameters.at(index);
if (p.ParentSymbol == DEBUG_ANY_ID && m_uninitializedVariables.contains(fullShadowedName)) {
public:
~CdbSymbolGroupContext();
- static CdbSymbolGroupContext *create(const QString &prefix,
+ static CdbSymbolGroupContext *create(const QString &prefix,
CIDebugSymbolGroup *symbolGroup,
const QStringList &uninitializedVariables,
QString *errorMessage);
startexternaldialog.ui \
startremotedialog.ui
RESOURCES += debugger.qrc
-false {
+false {
SOURCES += $$PWD/modeltest.cpp
HEADERS += $$PWD/modeltest.h
DEFINES += USE_MODEL_TEST=1
{
qDeleteAll(m_items);
}
-
+
void DebuggerSettings::insertItem(int code, SavedAction *item)
{
QTC_ASSERT(!m_items.contains(code),
foreach (SavedAction *item, m_items)
item->writeSettings(settings);
}
-
+
SavedAction *DebuggerSettings::item(int code) const
{
QTC_ASSERT(m_items.value(code, 0), qDebug() << "CODE: " << code; return 0);
void writeSettings(QSettings *settings) const;
private:
- QHash<int, Utils::SavedAction *> m_items;
+ QHash<int, Utils::SavedAction *> m_items;
};
DebugDebuggingHelpers,
UseCodeModel,
-
+
UseToolTipsInMainEditor,
UseToolTipsInLocalsView,
UseToolTipsInBreakpointsView,
}
MemoryViewAgent::MemoryViewAgent(DebuggerManager *manager, const QString &addr)
- : QObject(manager), m_engine(manager->currentEngine()), m_manager(manager)
+ : QObject(manager), m_engine(manager->currentEngine()), m_manager(manager)
{
bool ok = true;
init(addr.toULongLong(&ok, 0));
setContents(*it);
return;
}
- }
+ }
IDebuggerEngine *engine = d->manager->currentEngine();
QTC_ASSERT(engine, return);
engine->fetchDisassembler(this, frame);
bool DisassemblerViewAgent::contentsCoversAddress(const QString &contents) const
{
QTC_ASSERT(d, return false);
- for (int pos = 0, line = 0; ; ++line, ++pos) {
+ for (int pos = 0, line = 0; ; ++line, ++pos) {
if (contents.midRef(pos, d->frame.address.size()) == d->frame.address)
return true;
pos = contents.indexOf('\n', pos + 1);
LogStatus, // Used for status changed messages
LogTime, // Used for time stamp messages
LogDebug,
- LogMisc
+ LogMisc
};
} // namespace Debugger
m_ui->serverStartScript->setExpectedKind(Utils::PathChooser::File);
m_ui->serverStartScript->setPromptDialogTitle(tr("Select Executable"));
- connect(m_ui->useServerStartScriptCheckBox, SIGNAL(toggled(bool)),
+ connect(m_ui->useServerStartScriptCheckBox, SIGNAL(toggled(bool)),
this, SLOT(updateState()));
-
+
connect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
foreach (QDockWidget *dockWidget, dockWidgets) {
- if (dockWidget == d->m_outputDock)
+ if (dockWidget == d->m_outputDock)
d->m_mainWindow->addDockWidget(Qt::TopDockWidgetArea, dockWidget);
else
d->m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dockWidget);
d->m_startParameters->toolChainType, &errorMessage);
break;
default:
- d->m_engine = determineDebuggerEngine(d->m_startParameters->executable,
+ d->m_engine = determineDebuggerEngine(d->m_startParameters->executable,
d->m_startParameters->toolChainType, &errorMessage, &settingsIdHint);
break;
}
{
if (d->m_outputWindow)
emit emitShowInput(channel, msg);
- else
+ else
qDebug() << "INPUT: " << channel << msg;
}
ScriptEngineType = 0x02,
CdbEngineType = 0x04,
AllEngineTypes = GdbEngineType
- | ScriptEngineType
- | CdbEngineType
+ | ScriptEngineType
+ | CdbEngineType
};
QDebug operator<<(QDebug d, DebuggerState state);
Internal::ThreadsHandler *threadsHandler() const;
Internal::WatchHandler *watchHandler() const;
Internal::SourceFilesWindow *sourceFileWindow() const;
- QWidget *threadsWindow() const;
+ QWidget *threadsWindow() const;
Internal::DebuggerManagerActions debuggerManagerActions() const;
void bringPaneToForeground() { emit showPage(); }
void setCursor(const QCursor &cursor);
-
+
QString combinedContents() const;
QString inputContents() const;
m_ui.checkBoxUseMessageBoxForSignals);
m_group.insert(theDebuggerAction(SkipKnownFrames),
m_ui.checkBoxSkipKnownFrames);
- m_group.insert(theDebuggerAction(UseToolTipsInMainEditor),
+ m_group.insert(theDebuggerAction(UseToolTipsInMainEditor),
m_ui.checkBoxUseToolTipsInMainEditor);
m_group.insert(theDebuggerAction(AutoDerefPointers), 0);
m_group.insert(theDebuggerAction(UseToolTipsInLocalsView), 0);
m_group.insert(theDebuggerAction(UseToolTipsInBreakpointsView), 0);
m_group.insert(theDebuggerAction(UseAddressInBreakpointsView), 0);
m_group.insert(theDebuggerAction(UseAddressInStackView), 0);
- m_group.insert(theDebuggerAction(EnableReverseDebugging),
+ m_group.insert(theDebuggerAction(EnableReverseDebugging),
m_ui.checkBoxEnableReverseDebugging);
- m_group.insert(theDebuggerAction(MaximalStackDepth),
+ m_group.insert(theDebuggerAction(MaximalStackDepth),
m_ui.spinBoxMaximalStackDepth);
m_group.insert(theDebuggerAction(GdbWatchdogTimeout), 0);
m_group.insert(theDebuggerAction(LogTimeStamps), 0);
return s;
}
-Q_SLOT void ToolTipWidget::computeSize()
+Q_SLOT void ToolTipWidget::computeSize()
{
int columns = 0;
for (int i = 0; i < 3; ++i) {
// The adapter is still running just fine, but it failed to acquire a debuggee.
void inferiorStartFailed(const QString &msg);
-
+
protected:
DebuggerState state() const
{ return m_engine->state(); }
connect(theDebuggerAction(RecheckDebuggingHelpers), SIGNAL(triggered()),
this, SLOT(recheckDebuggingHelperAvailability()));
}
-
+
void GdbEngine::disconnectDebuggingHelperActions()
{
disconnect(theDebuggerAction(UseDebuggingHelpers), 0, this, 0);
while (from != to) {
GdbMi data;
if (*from != ',') {
- // happens on archer where we get
- // 23^running <NL> *running,thread-id="all" <NL> (gdb)
+ // happens on archer where we get
+ // 23^running <NL> *running,thread-id="all" <NL> (gdb)
result.m_type = GdbMi::Tuple;
break;
}
showStatusMessage(tr("Library %1 unloaded.").arg(_(id)));
invalidateSourcesList();
} else if (asyncClass == "thread-group-created") {
- // Archer has "{id="28902"}"
+ // Archer has "{id="28902"}"
QByteArray id = result.findChild("id").data();
showStatusMessage(tr("Thread group %1 created.").arg(_(id)));
int pid = id.toInt();
if (pid != inferiorPid())
handleInferiorPidChanged(pid);
} else if (asyncClass == "thread-created") {
- //"{id="1",group-id="28902"}"
+ //"{id="1",group-id="28902"}"
QByteArray id = result.findChild("id").data();
showStatusMessage(tr("Thread %1 created.").arg(_(id)));
} else if (asyncClass == "thread-group-exited") {
- // Archer has "{id="28902"}"
+ // Archer has "{id="28902"}"
QByteArray id = result.findChild("id").data();
showStatusMessage(tr("Thread group %1 exited.").arg(_(id)));
} else if (asyncClass == "thread-exited") {
- //"{id="1",group-id="28902"}"
+ //"{id="1",group-id="28902"}"
QByteArray id = result.findChild("id").data();
QByteArray groupid = result.findChild("group-id").data();
showStatusMessage(tr("Thread %1 in group %2 exited.")
} else if (asyncClass == "thread-selected") {
QByteArray id = result.findChild("id").data();
showStatusMessage(tr("Thread %1 selected.").arg(_(id)));
- //"{id="2"}"
+ //"{id="2"}"
#if defined(Q_OS_MAC)
} else if (asyncClass == "shlibs-updated") {
// MAC announces updated libs
void GdbEngine::readGdbStandardOutput()
{
- if (m_commandTimer->isActive())
+ if (m_commandTimer->isActive())
m_commandTimer->start(); // Retrigger
int newstart = 0;
}
if (pid == inferiorPid())
return;
- debugMessage(_("FOUND PID %1").arg(pid));
+ debugMessage(_("FOUND PID %1").arg(pid));
handleInferiorPidChanged(pid);
if (m_dumperInjectionLoad)
"the operation.\nYou can choose between waiting "
"longer or abort debugging.").arg(timeOut / 1000);
QMessageBox *mb = showMessageBox(QMessageBox::Critical,
- tr("Gdb not responding"), msg,
+ tr("Gdb not responding"), msg,
QMessageBox::Ok | QMessageBox::Cancel);
mb->button(QMessageBox::Cancel)->setText(tr("Give gdb more time"));
mb->button(QMessageBox::Ok)->setText(tr("Stop debugging"));
tr("Executable failed"), QString::fromLocal8Bit(msg));
showStatusMessage(tr("Process failed to start."));
shutdown();
- } else if (msg == "\"finish\" not meaningful in the outermost frame.") {
+ } else if (msg == "\"finish\" not meaningful in the outermost frame.") {
// Handle a case known to appear on gdb 6.4 symbianelf when
// the stack is cut due to access to protected memory.
debugMessage(_("APPLYING WORKAROUND #2"));
if (supportsThreads())
postCommand(_("-thread-list-ids"), WatchUpdate, CB(handleStackListThreads), 0);
manager()->reloadRegisters();
- updateLocals();
+ updateLocals();
}
void GdbEngine::handleQuerySources(const GdbResponse &response)
{
QTC_ASSERT(state() == InferiorStopped, /**/);
QTC_ASSERT(startMode() != AttachCore, /**/);
- postCommand(_("detach"));
+ postCommand(_("detach"));
setState(InferiorShuttingDown);
setState(InferiorShutDown);
shutdown();
void GdbEngine::startDebugger(const DebuggerStartParametersPtr &sp)
{
QTC_ASSERT(state() == EngineStarting, qDebug() << state());
- // This should be set by the constructor or in exitDebugger()
+ // This should be set by the constructor or in exitDebugger()
// via initializeVariables()
//QTC_ASSERT(m_debuggingHelperState == DebuggingHelperUninitialized,
// initializeVariables());
void GdbEngine::reloadBreakListInternal()
{
- m_breakListUpdating = true;
+ m_breakListUpdating = true;
postCommand(_("-break-list"), NeedsStop, CB(handleBreakList));
}
showStatusMessage(tr("Retrieving data for stack view..."), 3000);
manager()->reloadRegisters();
reloadStack(true);
- updateLocals();
+ updateLocals();
}
void GdbEngine::reloadFullStack()
targetFrame = i;
}
- bool canExpand = !cookie.isFull
+ bool canExpand = !cookie.isFull
&& (n >= theDebuggerAction(MaximalStackDepth)->value().toInt());
theDebuggerAction(ExpandStack)->setEnabled(canExpand);
manager()->stackHandler()->setFrames(stackFrames, canExpand);
// For targetFrame == 0 we already issued a 'gotoLocation'
// when reading the *stopped message.
bool jump = (m_isMacGdb || targetFrame != 0);
-
+
manager()->stackHandler()->setCurrentIndex(targetFrame);
if (jump || cookie.gotoLocation) {
const StackFrame &frame = manager()->stackHandler()->currentFrame();
data.setValue(_("<unavailable>"));
data.setHasChildren(false);
insertData(data);
- return;
+ return;
}
m_processedNames.insert(processedName);
#if DEBUG_SUBITEM
qDebug() << "IT'S A POINTER";
#endif
-
+
if (theDebuggerBoolSetting(AutoDerefPointers)) {
// Try automatic dereferentiation
data.exp = _("(*(") + data.exp + _("))");
data1.setValue(_("<unavailable>"));
data1.setHasChildren(false);
insertData(data1);
- return;
+ return;
}
m_processedNames.insert(processedName);
}
GdbMi all("[" + out + "]");
//GdbMi all(out);
-
+
//qDebug() << "\n\n\nALL: " << all.toString() << "\n";
GdbMi locals = all.findChild("locals");
//qDebug() << "\n\n\nLOCALS: " << locals.toString() << "\n";
data.setError(WatchData::msgNotInScope());
return data;
}
- //: Type of local variable or parameter shadowed by another
+ //: Type of local variable or parameter shadowed by another
//: variable of the same name in a nested block.
setWatchDataValue(data, item.findChild("value"));
- data.setType(GdbEngine::tr("<shadowed>"));
+ data.setType(GdbEngine::tr("<shadowed>"));
data.setHasChildren(false);
return data;
}
// Load at least gdb macro based dumpers.
QFile file(_(":/gdb/gdbmacros.txt"));
file.open(QIODevice::ReadOnly);
- QByteArray contents = file.readAll();
+ QByteArray contents = file.readAll();
m_debuggingHelperState = DebuggingHelperLoadTried;
postCommand(_(contents));
return;
QString end = QString::number(address + 100, 16);
// -data-disassemble [ -s start-addr -e end-addr ]
// | [ -f filename -l linenum [ -n lines ] ] -- mode
- if (useMixedMode)
+ if (useMixedMode)
postCommand(_("-data-disassemble -s 0x%1 -e 0x%2 -- 1").arg(start).arg(end),
Discardable, CB(handleFetchDisassemblerByAddress1),
QVariant::fromValue(DisassemblerAgentCookie(agent)));
if (line >= 0 && line < fileContents.size())
ba += " " + fileContents.at(line) + '\n';
GdbMi insn = child.findChild("line_asm_insn");
- foreach (const GdbMi &line, insn.children())
+ foreach (const GdbMi &line, insn.children())
ba += parseLine(line);
} else {
// the non-mixed version
}
}
if (m_gdbAdapter->dumperHandling() == AbstractGdbAdapter::DumperLoadedByGdbPreload
- && checkDebuggingHelpers()) {
+ && checkDebuggingHelpers()) {
QString cmd = _("set environment ");
cmd += _(Debugger::Constants::Internal::LD_PRELOAD_ENV_VAR);
cmd += _c(' ');
else
result += "Invalid";
break;
- case Const:
+ case Const:
if (!m_name.isEmpty())
result += m_name + "=";
result += "\"" + escapeCString(m_data) + "\"";
/*
-output ==>
- ( out-of-band-record )* [ result-record ] "(gdb)" nl
-result-record ==>
- [ token ] "^" result-class ( "," result )* nl
-out-of-band-record ==>
- async-record | stream-record
-async-record ==>
- exec-async-output | status-async-output | notify-async-output
-exec-async-output ==>
- [ token ] "*" async-output
-status-async-output ==>
- [ token ] "+" async-output
-notify-async-output ==>
- [ token ] "=" async-output
-async-output ==>
- async-class ( "," result )* nl
-result-class ==>
- "done" | "running" | "connected" | "error" | "exit"
-async-class ==>
- "stopped" | others (where others will be added depending on the needs--this is still in development).
-result ==>
- variable "=" value
-variable ==>
- string
-value ==>
- const | tuple | list
-const ==>
- c-string
-tuple ==>
- "{}" | "{" result ( "," result )* "}"
-list ==>
- "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
-stream-record ==>
- console-stream-output | target-stream-output | log-stream-output
-console-stream-output ==>
- "~" c-string
-target-stream-output ==>
- "@" c-string
-log-stream-output ==>
- "&" c-string
-nl ==>
- CR | CR-LF
-token ==>
- any sequence of digits.
+output ==>
+ ( out-of-band-record )* [ result-record ] "(gdb)" nl
+result-record ==>
+ [ token ] "^" result-class ( "," result )* nl
+out-of-band-record ==>
+ async-record | stream-record
+async-record ==>
+ exec-async-output | status-async-output | notify-async-output
+exec-async-output ==>
+ [ token ] "*" async-output
+status-async-output ==>
+ [ token ] "+" async-output
+notify-async-output ==>
+ [ token ] "=" async-output
+async-output ==>
+ async-class ( "," result )* nl
+result-class ==>
+ "done" | "running" | "connected" | "error" | "exit"
+async-class ==>
+ "stopped" | others (where others will be added depending on the needs--this is still in development).
+result ==>
+ variable "=" value
+variable ==>
+ string
+value ==>
+ const | tuple | list
+const ==>
+ c-string
+tuple ==>
+ "{}" | "{" result ( "," result )* "}"
+list ==>
+ "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]"
+stream-record ==>
+ console-stream-output | target-stream-output | log-stream-output
+console-stream-output ==>
+ "~" c-string
+target-stream-output ==>
+ "@" c-string
+log-stream-output ==>
+ "&" c-string
+nl ==>
+ CR | CR-LF
+token ==>
+ any sequence of digits.
*/
inline const QList<GdbMi> &children() const { return m_children; }
inline int childCount() const { return m_children.size(); }
- const GdbMi &childAt(int index) const { return m_children[index]; }
+ const GdbMi &childAt(int index) const { return m_children[index]; }
GdbMi &childAt(int index) { return m_children[index]; }
GdbMi findChild(const char *name) const;
enum GdbResultClass
{
- // "done" | "running" | "connected" | "error" | "exit"
+ // "done" | "running" | "connected" | "error" | "exit"
GdbResultUnknown,
GdbResultDone,
GdbResultRunning,
m_ui.scriptFileChooser);
m_group.insert(theDebuggerAction(GdbEnvironment),
m_ui.environmentEdit);
- m_group.insert(theDebuggerAction(UsePreciseBreakpoints),
+ m_group.insert(theDebuggerAction(UsePreciseBreakpoints),
m_ui.checkBoxUsePreciseBreakpoints);
- m_group.insert(theDebuggerAction(GdbWatchdogTimeout),
+ m_group.insert(theDebuggerAction(GdbWatchdogTimeout),
m_ui.spinBoxGdbWatchdogTimeout);
* Provides a static convenience to prompt for both connection types. */
class S60DebuggerBluetoothStarter : public trk::AbstractBluetoothStarter
-{
+{
public:
static trk::PromptStartCommunicationResult
startCommunication(const TrkDevicePtr &trkDevice,
QWidget *msgBoxParent,
QString *errorMessage);
-protected:
+protected:
virtual trk::BluetoothListener *createListener();
private:
{
QTC_ASSERT(range.size() == uint(ba.size()),
qDebug() << "RANGE: " << range << " BA SIZE: " << ba.size(); return);
-
+
MEMORY_DEBUG("INSERT: " << range);
// Try to combine with existing chunk.
Snapshot::Memory::iterator it = memory.begin();
// Kill inferior process
logMessage(msgGdbPacket(QLatin1String("kill")));
sendTrkMessage(0x41, TrkCB(handleDeleteProcess),
- trkDeleteProcessMessage(), "Delete process");
+ trkDeleteProcessMessage(), "Delete process");
}
else if (cmd.startsWith("m")) {
if (data.startsWith("auxv:read::")) {
const int offsetPos = data.lastIndexOf(':') + 1;
const int commaPos = data.lastIndexOf(',');
- if (commaPos != -1) {
+ if (commaPos != -1) {
bool ok1 = false, ok2 = false;
const int offset = data.mid(offsetPos, commaPos - offsetPos)
.toUInt(&ok1, 16);
const char *data = result.data.data() + 1; // Skip ok byte
for (int i = 0; i < RegisterCount; ++i)
m_snapshot.registers[i] = extractInt(data + 4 * i);
-}
+}
void TrkGdbAdapter::handleWriteRegister(const TrkResult &result)
{
return;
}
sendGdbServerMessage("OK");
-}
+}
void TrkGdbAdapter::reportRegisters()
{
Snapshot::Memory::const_iterator et = m_snapshot.memory.end();
for ( ; it != et; ++it) {
MEMORY_DEBUG(" NEEDED: " << needed);
- needed -= it.key();
+ needed -= it.key();
}
MEMORY_DEBUG("NEEDED: " << needed);
if (result.errorCode()) {
logMessage("ERROR: " + result.errorString());
//return;
- }
+ }
sendGdbServerMessage("OK");
}
logMessage(QLatin1String("### Starting TrkGdbAdapter"));
m_trkDevice->setSerialFrame(effectiveTrkDeviceType() != TrkOptions::BlueTooth);
// Prompt the user to start communication
- QString message;
+ QString message;
const trk::PromptStartCommunicationResult src =
S60DebuggerBluetoothStarter::startCommunication(m_trkDevice,
effectiveTrkDevice(),
appendByte(&ba, 0xe5);
#else
// Thumb:
- // subs r0, #16
+ // subs r0, #16
appendByte(&ba, 0x08);
appendByte(&ba, 0x3b);
- // subs r0, #16
+ // subs r0, #16
appendByte(&ba, 0x08);
appendByte(&ba, 0x3b);
//
appendByte(&ba, 0x08);
appendByte(&ba, 0x3b);
- // subs r0, #16
+ // subs r0, #16
appendByte(&ba, 0x08);
appendByte(&ba, 0x3b);
#endif
QByteArray trkWriteMemoryMessage(uint addr, const QByteArray &date);
QByteArray trkBreakpointMessage(uint addr, uint len, bool armMode = true);
QByteArray trkStepRangeMessage(byte option);
- QByteArray trkDeleteProcessMessage();
+ QByteArray trkDeleteProcessMessage();
QByteArray trkInterruptMessage();
QSharedPointer<trk::TrkDevice> m_trkDevice;
virtual void nextExec() = 0;
virtual void stepIExec() = 0;
virtual void nextIExec() = 0;
-
+
virtual void continueInferior() = 0;
virtual void interruptInferior() = 0;
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
static QString headers[] = {
- tr("Module name") + " ",
+ tr("Module name") + " ",
tr("Symbols read") + " ",
tr("Start address") + " ",
tr("End address") + " "
break;
case 1:
if (role == Qt::DisplayRole)
- return module.symbolsRead ? "yes" : "no";
+ return module.symbolsRead ? "yes" : "no";
break;
case 2:
if (role == Qt::DisplayRole)
void ModulesWindow::setAlwaysResizeColumnsToContents(bool on)
{
m_alwaysResizeColumnsToContents = on;
- QHeaderView::ResizeMode mode = on
+ QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
header()->setResizeMode(0, mode);
header()->setResizeMode(1, mode);
QTreeView::setModel(model);
setAlwaysResizeColumnsToContents(true);
}
-
+
void ModulesWindow::showSymbols(const QString &name)
{
if (name.isEmpty())
#endif // DO_TRACE
namespace Debugger {
-namespace Internal {
+namespace Internal {
class NameDemanglerPrivate
{
QLatin1String(""))
{
}
-
+
const QString makeExpr(const QStringList &exprs) const
{
Q_ASSERT(exprs.size() == 2);
QLatin1String(""))
{
}
-
+
const QString makeExpr(const QStringList &exprs) const
{
Q_ASSERT(exprs.size() == 2);
QLatin1String(""))
{
}
-
+
virtual const QString makeExpr(const QStringList &exprs) const
{
Q_ASSERT(exprs.size() == 3);
bool demangle(const QString &mangledName);
/*
- * A textual description of the error encountered, if there was one.
+ * A textual description of the error encountered, if there was one.
* Only valid if demangle() returned false.
*/
const QString &errorString() const;
if (role == RegisterChangedRole)
return reg.changed;
-
+
return QVariant();
}
{
RegisterNumberBaseRole = Qt::UserRole, // Currently used number base
RegisterAddressRole, // Start value for opening memory view
- RegisterChangedRole // Used for painting changed values
+ RegisterChangedRole // Used for painting changed values
};
class Register
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &idx) const;
-
+
QList<Register> m_registers;
int m_base;
int m_strlen; // approximate width of an value in chars
menu.addAction(theDebuggerAction(SettingsDialog));
QAction *act = menu.exec(ev->globalPos());
-
+
if (act == actAdjust)
resizeColumnsToContents();
else if (act == actAlwaysAdjust)
SOURCES += \
$$PWD/scriptengine.cpp \
-FORMS +=
+FORMS +=
-RESOURCES +=
+RESOURCES +=
private:
void maybeBreakNow(bool byFunction);
- ScriptEngine *q;
+ ScriptEngine *q;
};
ScriptAgent::ScriptAgent(ScriptEngine *debugger, QScriptEngine *script)
void ScriptEngine::shutdown()
{
- exitDebugger();
+ exitDebugger();
}
void ScriptEngine::exitDebugger()
showStatusMessage(tr("Stopped."), 5000);
StackFrame frame;
- frame.file = fileName;
+ frame.file = fileName;
frame.line = lineNumber;
manager()->gotoLocation(frame, true);
updateLocals();
//
// Build stack
- //
+ //
QList<StackFrame> stackFrames;
int i = 0;
for (QScriptContext *c = context; c; c = c->parentContext(), ++i) {
frame.from = QString::number(info.functionStartLineNumber());
frame.to = QString::number(info.functionEndLineNumber());
frame.line = info.lineNumber();
-
+
if (frame.function.isEmpty())
frame.function = "<global scope>";
//frame.address = ...;
#include <stdio.h>
#include <signal.h>
#include <execinfo.h>
-#endif
+#endif
namespace Debugger {
namespace Internal {
void dumpBacktrace(int maxdepth = -1);
-} // namespace Internal
+} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_BACKTRACE_H
namespace Debugger {
namespace Internal {
-
+
#ifdef USE_PSAPI
static inline QString imageName(DWORD processId)
{
#endif
// Empty. This is the case for MinGW binaries
if (debugDirSize == 0)
- return true;
+ return true;
// Look up in file
DWORD debugDirOffset;
if (!getFileOffsetFromRVA(ntHeaders, debugDirRva, &debugDirOffset)) {
namespace Debugger {
namespace Internal {
-
+
bool getPDBFiles(const QString &peExecutableFileName, QStringList *rc, QString *errorMessage)
{
HANDLE hFile = NULL;
// Return a list of Program-Database (*.pdb) files a PE executable refers to. */
bool getPDBFiles(const QString &peExecutableFileName, QStringList *rc, QString *errorMessage);
-} // namespace Internal
+} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_PEUTILS_H
SOURCES += $$PWD/backtrace.cpp
-HEADERS += $$PWD/backtrace.h
+HEADERS += $$PWD/backtrace.h
win32 {
# For the Privilege manipulation functions in sharedlibraryinjector.cpp.
# Not required for MinGW.
LIBS += advapi32.lib
-}
+}
}
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
static QString headers[] = {
- tr("Internal name") + " ",
+ tr("Internal name") + " ",
tr("Full name") + " ",
};
return headers[section];
setRootIsDecorated(false);
setIconSize(QSize(10, 10));
//header()->setDefaultAlignment(Qt::AlignLeft);
-
+
connect(this, SIGNAL(activated(QModelIndex)),
this, SLOT(sourceFileActivated(QModelIndex)));
connect(act, SIGNAL(toggled(bool)),
act2 = new QAction(tr("Open file \"%1\"'").arg(name), &menu);
act2->setEnabled(true);
}
-
+
menu.addAction(act1);
menu.addAction(act2);
menu.addSeparator();
m_model->setSourceFiles(QMap<QString, QString>());
header()->setResizeMode(0, QHeaderView::ResizeToContents);
}
-
+
#include "sourcefileswindow.moc"
namespace Internal {
class SourceFilesModel;
-
+
class SourceFilesWindow : public QTreeView
{
Q_OBJECT
return QVariant();
if (index.row() == m_stackFrames.size()) {
- if (role == Qt::DisplayRole && index.column() == 0)
+ if (role == Qt::DisplayRole && index.column() == 0)
return tr("...");
- if (role == Qt::DisplayRole && index.column() == 1)
+ if (role == Qt::DisplayRole && index.column() == 1)
return tr("<More>");
if (role == Qt::DecorationRole && index.column() == 0)
return m_emptyIcon;
}
StackFrame StackHandler::currentFrame() const
-{
+{
QTC_ASSERT(m_currentIndex >= 0, return StackFrame());
QTC_ASSERT(m_currentIndex < m_stackFrames.size(), return StackFrame());
return m_stackFrames.at(m_currentIndex);
QModelIndex idx = indexAt(ev->pos());
StackFrame frame = model()->data(idx, Qt::UserRole).value<StackFrame>();
QString address = frame.address;
-
+
QMenu menu;
menu.addAction(theDebuggerAction(ExpandStack));
actShowMemory->setEnabled(false);
} else {
actShowMemory->setText(tr("Open memory editor at %1").arg(address));
- }
+ }
QAction *actShowDisassembler = menu.addAction(QString());
if (address.isEmpty()) {
namespace Internal {
class DisassemblerViewAgent;
-
+
class StackWindow : public QTreeView
{
Q_OBJECT
namespace Debugger {
namespace Internal {
-
+
class ThreadsWindow : public QTreeView
{
Q_OBJECT
#if DEBUG_MODEL
# define MODEL_DEBUG(s) qDebug() << s
#else
-# define MODEL_DEBUG(s)
+# define MODEL_DEBUG(s)
#endif
#define MODEL_DEBUGX(s) qDebug() << s
// WatchData
//
////////////////////////////////////////////////////////////////////
-
+
WatchData::WatchData() :
hasChildren(false),
generation(-1),
// column. No need to duplicate it here.
if (value.startsWith("(" + type + ") 0x"))
value = value.section(" ", -1, -1);
-
+
setValueUnneeded();
}
for (int i = 0; i < 10; ++i) {
int start = type.indexOf("std::allocator<");
if (start == -1)
- break;
+ break;
// search for matching '>'
int pos;
int level = 0;
WatchItem *WatchModel::watchItem(const QModelIndex &idx) const
{
- return idx.isValid()
+ return idx.isValid()
? static_cast<WatchItem*>(idx.internalPointer()) : m_root;
}
return watchIndexHelper(item, m_root, QModelIndex());
}
-QModelIndex WatchModel::watchIndexHelper(const WatchItem *needle,
+QModelIndex WatchModel::watchIndexHelper(const WatchItem *needle,
const WatchItem *parentItem, const QModelIndex &parentIndex) const
{
if (needle == parentItem)
return QModelIndex();
}
-void WatchModel::emitDataChanged(int column, const QModelIndex &parentIndex)
+void WatchModel::emitDataChanged(int column, const QModelIndex &parentIndex)
{
QModelIndex idx1 = index(0, column, parentIndex);
QModelIndex idx2 = index(rowCount(parentIndex) - 1, column, parentIndex);
case ActiveDataRole:
qDebug() << "ASK FOR" << data.iname;
return true;
-
+
case TypeFormatListRole:
if (isIntType(data.type))
return QStringList() << tr("decimal") << tr("hexadecimal")
}
default:
- break;
+ break;
}
return QVariant();
}
}
} else if (role == TypeFormatRole) {
m_handler->setFormat(data.type, value.toInt());
- } else if (role == IndividualFormatRole) {
+ } else if (role == IndividualFormatRole) {
const int format = value.toInt();
if (format == -1) {
m_handler->m_individualFormats.remove(data.iname);
case 2: return QString(tr("Type") + QLatin1String(" "));
}
}
- return QVariant();
+ return QVariant();
}
struct IName : public QString
return i1 < i2;
}
}
- return name1 < name2;
+ return name1 < name2;
}
bool operator<(const IName &iname1, const IName &iname2)
{
QList<WatchItem *>::const_iterator it =
qLowerBound(list.begin(), list.end(), item, iNameSorter);
- return it - list.begin();
+ return it - list.begin();
}
void WatchModel::insertData(const WatchData &data)
void WatchModel::insertBulkData(const QList<WatchData> &list)
{
#if 0
- for (int i = 0; i != list.size(); ++i)
+ for (int i = 0; i != list.size(); ++i)
insertData(list.at(i));
return;
#endif
QTC_ASSERT(false, /**/);
return 0;
}
-
+
WatchModel *WatchHandler::modelForIName(const QString &iname) const
{
if (iname.startsWith(QLatin1String("local")))
bool isLocal() const { return iname.startsWith(QLatin1String("local.")); }
bool isWatcher() const { return iname.startsWith(QLatin1String("watch.")); }
bool isValid() const { return !iname.isEmpty(); }
-
+
bool isEqual(const WatchData &other) const;
static QString msgNotInScope();
enum DumpableFormat
{
PrettyFormat = 0, // keep that at 0 as default
- PlainFomat,
+ PlainFomat,
};
class WatchModel : public QAbstractItemModel
it = seenHash->insert(name, 0);
} else {
++(it.value());
- }
+ }
// Is the declaration on or past the current line, that is,
// the variable not initialized.
if (symbol->line() >= line)
{
if (debug > 1)
qDebug() << Q_FUNC_INFO << '\n' << root.toString(false, 0);
- WatchData w;
+ WatchData w;
QString v;
// Check for name/iname and use as expression default
if (ctx.recursionLevel == 0) {
w.exp = v;
gdbMiGetStringValue(&w.addr, root, "addr");
gdbMiGetStringValue(&w.saddr, root, "saddr");
- gdbMiGetBoolValue(&w.valueEnabled, root, "valueenabled");
+ gdbMiGetBoolValue(&w.valueEnabled, root, "valueenabled");
gdbMiGetBoolValue(&w.valueEditable, root, "valueeditable");
if (gdbMiGetStringValue(&v, root, "valuetooltip", "valuetooltipencoded"))
w.setValue(v);
{
QLineEdit *lineEdit = qobject_cast<QLineEdit *>(editor);
QTC_ASSERT(lineEdit, return);
- if (index.column() == 1)
+ if (index.column() == 1)
lineEdit->setText(index.model()->data(index, Qt::DisplayRole).toString());
else
lineEdit->setText(index.model()->data(index, ExpressionRole).toString());
this, SLOT(expandNode(QModelIndex)));
connect(this, SIGNAL(collapsed(QModelIndex)),
this, SLOT(collapseNode(QModelIndex)));
-}
-
-void WatchWindow::expandNode(const QModelIndex &idx)
-{
+}
+
+void WatchWindow::expandNode(const QModelIndex &idx)
+{
model()->setData(idx, true, ExpandedRole);
-}
-
-void WatchWindow::collapseNode(const QModelIndex &idx)
-{
+}
+
+void WatchWindow::collapseNode(const QModelIndex &idx)
+{
model()->setData(idx, false, ExpandedRole);
}
QString exp = model()->data(mi0, ExpressionRole).toString();
QString type = model()->data(mi2).toString();
- QStringList alternativeFormats =
+ QStringList alternativeFormats =
model()->data(mi0, TypeFormatListRole).toStringList();
const int typeFormat = qMax(int(DecimalFormat), model()->data(mi0, TypeFormatRole).toInt());
const int individualFormat = model()->data(mi0, IndividualFormatRole).toInt();
menu.addAction(actClearCodeModelSnapshot);
menu.addSeparator();
menu.addAction(theDebuggerAction(UseToolTipsInLocalsView));
-
+
menu.addAction(theDebuggerAction(AutoDerefPointers));
QAction *actAdjustColumnWidths =
m_manager->clearCppCodeModelSnapshot();
} else if (clearIndividualFormatAction && act == clearIndividualFormatAction) {
model()->setData(mi1, -1, IndividualFormatRole);
- } else {
+ } else {
for (int i = 0; i != alternativeFormats.size(); ++i) {
if (act == typeFormatActions.at(i))
model()->setData(mi1, i, TypeFormatRole);
if (!header())
return;
m_alwaysResizeColumnsToContents = on;
- QHeaderView::ResizeMode mode = on
+ QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
header()->setResizeMode(0, mode);
header()->setResizeMode(1, mode);
WatchWindow(Type type, DebuggerManager *manager, QWidget *parent = 0);
void setType(Type type) { m_type = type; }
Type type() const { return m_type; }
-
+
public slots:
void resizeColumnsToContents();
void setAlwaysResizeColumnsToContents(bool on = true);
{
public:
FormClassWizardGenerationParametersPrivate();
- void fromSettings(const QSettings *);
+ void fromSettings(const QSettings *);
void toSettings(QSettings *) const;
bool equals(const FormClassWizardGenerationParametersPrivate &rhs) const;
qDebug() << '<' << Q_FUNC_INFO << newUiClassName << rc;
return rc;
}
-#endif // USE_XSLT
+#endif // USE_XSLT
} // namespace Internal
} // namespace Designer
return QString::null;
// Activate once all Qt branches around have integrated 4.5.2
// (Kinetic)
-/*
+/*
#if QT_VERSION > 0x040501
// Quiet save as of Qt 4.5.2
qdesigner_internal::FormWindowBase *fwb = qobject_cast<qdesigner_internal::FormWindowBase *>(m_formWindow);
private:
void syncGridFeature();
- FormWindowBasePrivate *m_d;
+ FormWindowBasePrivate *m_d;
};
} // namespace qdesigner_internal
#include "fakevimactions.h"
-// Please do not add any direct dependencies to other Qt Creator code here.
+// Please do not add any direct dependencies to other Qt Creator code here.
// Instead emit signals and let the FakeVimPlugin channel the information to
// Qt Creator. The idea is to keep this file here in a "clean" state that
// allows easy reuse with any QTextEdit or QPlainTextEdit derived class.
{
qDeleteAll(m_items);
}
-
+
void FakeVimSettings::insertItem(int code, SavedAction *item,
const QString &longName, const QString &shortName)
{
foreach (SavedAction *item, m_items)
item->writeSettings(settings);
}
-
+
SavedAction *FakeVimSettings::item(int code)
{
QTC_ASSERT(m_items.value(code, 0), qDebug() << "CODE: " << code; return 0);
void writeSettings(QSettings *settings);
private:
- QHash<int, Utils::SavedAction *> m_items;
- QHash<QString, int> m_nameToCode;
- QHash<int, QString> m_codeToName;
+ QHash<int, Utils::SavedAction *> m_items;
+ QHash<QString, int> m_nameToCode;
+ QHash<int, QString> m_codeToName;
};
FakeVimSettings *theFakeVimSettings();
: beginPos(qMin(b, e)), endPos(qMax(b, e)), rangemode(m)
{}
- QString toString() const
+ QString toString() const
{
return QString("%1-%2 (mode: %3)").arg(beginPos).arg(endPos)
.arg(rangemode);
m_ui.setupUi(w);
m_group.clear();
- m_group.insert(theFakeVimSetting(ConfigUseFakeVim),
+ m_group.insert(theFakeVimSetting(ConfigUseFakeVim),
m_ui.checkBoxUseFakeVim);
- m_group.insert(theFakeVimSetting(ConfigExpandTab),
+ m_group.insert(theFakeVimSetting(ConfigExpandTab),
m_ui.checkBoxExpandTab);
- m_group.insert(theFakeVimSetting(ConfigHlSearch),
+ m_group.insert(theFakeVimSetting(ConfigHlSearch),
m_ui.checkBoxHlSearch);
- m_group.insert(theFakeVimSetting(ConfigShiftWidth),
+ m_group.insert(theFakeVimSetting(ConfigShiftWidth),
m_ui.lineEditShiftWidth);
- m_group.insert(theFakeVimSetting(ConfigSmartTab),
+ m_group.insert(theFakeVimSetting(ConfigSmartTab),
m_ui.checkBoxSmartTab);
- m_group.insert(theFakeVimSetting(ConfigStartOfLine),
+ m_group.insert(theFakeVimSetting(ConfigStartOfLine),
m_ui.checkBoxStartOfLine);
- m_group.insert(theFakeVimSetting(ConfigTabStop),
+ m_group.insert(theFakeVimSetting(ConfigTabStop),
m_ui.lineEditTabStop);
- m_group.insert(theFakeVimSetting(ConfigBackspace),
+ m_group.insert(theFakeVimSetting(ConfigBackspace),
m_ui.lineEditBackspace);
- m_group.insert(theFakeVimSetting(ConfigAutoIndent),
+ m_group.insert(theFakeVimSetting(ConfigAutoIndent),
m_ui.checkBoxAutoIndent);
- m_group.insert(theFakeVimSetting(ConfigIncSearch),
+ m_group.insert(theFakeVimSetting(ConfigIncSearch),
m_ui.checkBoxIncSearch);
connect(m_ui.pushButtonCopyTextEditorSettings, SIGNAL(clicked()),
void FakeVimOptionPage::copyTextEditorSettings()
{
- TextEditor::TabSettings ts =
+ TextEditor::TabSettings ts =
TextEditor::TextEditorSettings::instance()->tabSettings();
-
+
m_ui.checkBoxExpandTab->setChecked(ts.m_spacesForTabs);
m_ui.lineEditTabStop->setText(QString::number(ts.m_tabSize));
m_ui.lineEditShiftWidth->setText(QString::number(ts.m_indentSize));
} // namespace FakeVim
FakeVimPluginPrivate::FakeVimPluginPrivate(FakeVimPlugin *plugin)
-{
+{
q = plugin;
m_fakeVimOptionsPage = 0;
}
m_fakeVimOptionsPage = new FakeVimOptionPage;
q->addObject(m_fakeVimOptionsPage);
theFakeVimSettings()->readSettings(Core::ICore::instance()->settings());
-
+
Core::Command *cmd = 0;
cmd = actionManager->registerAction(theFakeVimSetting(ConfigUseFakeVim),
Constants::INSTALL_HANDLER, globalcontext);
// we can only handle QTextEdit and QPlainTextEdit
if (!qobject_cast<QTextEdit *>(widget) && !qobject_cast<QPlainTextEdit *>(widget))
return;
-
+
//qDebug() << "OPENING: " << editor << editor->widget()
// << "MODE: " << theFakeVimSetting(ConfigUseFakeVim)->value();
handler->setCurrentFileName(editor->file()->fileName());
handler->installEventFilter();
-
+
// pop up the bar
if (theFakeVimSetting(ConfigUseFakeVim)->value().toBool())
showCommandBuffer("");
//qDebug() << "SET USE FAKEVIM" << value;
bool on = value.toBool();
if (on) {
- Core::EditorManager::instance()->showEditorStatusBar(
- QLatin1String(Constants::MINI_BUFFER),
+ Core::EditorManager::instance()->showEditorStatusBar(
+ QLatin1String(Constants::MINI_BUFFER),
"vi emulation mode. Type :q to leave. Use , Ctrl-R to trigger run.",
tr("Quit FakeVim"), this, SLOT(quitFakeVim()));
foreach (Core::IEditor *editor, m_editorToHandler.keys())
file->save(fileName);
Core::ICore::instance()->fileManager()->unblockFileChange(file);
*handled = true;
- }
+ }
}
void FakeVimPluginPrivate::handleExCommand(const QString &cmd)
if (!bt)
return;
- TextEditor::TabSettings tabSettings =
+ TextEditor::TabSettings tabSettings =
TextEditor::TextEditorSettings::instance()->tabSettings();
typedef SharedTools::Indenter<TextEditor::TextBlockIterator> Indenter;
Indenter &indenter = Indenter::instance();
void FakeVimPluginPrivate::showCommandBuffer(const QString &contents)
{
//qDebug() << "SHOW COMMAND BUFFER" << contents;
- Core::EditorManager::instance()->showEditorStatusBar(
+ Core::EditorManager::instance()->showEditorStatusBar(
QLatin1String(Constants::MINI_BUFFER), contents,
tr("Quit FakeVim"), this, SLOT(quitFakeVim()));
}
public:
ProjectFilesFactory(Manager *manager, TextEditor::TextEditorActionHandler *handler);
virtual ~ProjectFilesFactory();
-
+
Manager *manager() const;
virtual Core::IEditor *createEditor(QWidget *parent);
return false;
else if (fileName == QLatin1String("CVS"))
- return false;
+ return false;
// ### user include/exclude
output += process.readAllStandardOutput();
error += QString::fromLocal8Bit(process.readAllStandardError());
switch (m_reportTerminationMode) {
- case NoReport:
+ case NoReport:
break;
case ReportStdout:
output += msgTermination(process.exitCode(), m_binaryPath, m_jobs.at(j).arguments).toUtf8();
}
void GitoriousHostWidget::slotDelete()
-{
+{
const QModelIndex index = ui->hostView->selectionModel()->currentIndex();
ui->hostView->selectionModel()->clear();
if (index.isValid()) {
{
QStringList headers;
headers << tr("Name") << tr("Owner") << tr("Description");
- m_model->setHorizontalHeaderLabels(headers);
+ m_model->setHorizontalHeaderLabels(headers);
// Filter on all columns
m_filterModel->setSourceModel(m_model);
m_filterModel->setFilterKeyColumn(-1);
// keywords (words in front of a colon as in 'Task: <bla>').
class GitSubmitHighlighter : QSyntaxHighlighter {
-public:
+public:
explicit GitSubmitHighlighter(QTextEdit *parent);
virtual void highlightBlock(const QString &text);
private:
enum State { Header, Comment, Other };
- const QTextCharFormat m_commentFormat;
+ const QTextCharFormat m_commentFormat;
const QRegExp m_keywordPattern;
const QChar m_hashChar;
};
state = Comment;
}
// Apply format.
- switch (state) {
+ switch (state) {
case Header: {
QTextCharFormat charFormat = format(0);
charFormat.setFontWeight(QFont::Bold);
SOURCES += helloworldplugin.cpp \
helloworldwindow.cpp
-
+
viewer->setZoom(zoom);
viewer->setSource(url);
viewer->setFocus(Qt::OtherFocusReason);
-
+
#if defined(QT_NO_WEBKIT)
QFont font = viewer->font();
font.setPointSize(font.pointSize() + int(zoom));
closePages->setEnabled(enableAction);
menu.addSeparator();
-
+
QAction *newBookmark = menu.addAction(tr("Add Bookmark for this Page..."));
const QString &url = viewer->source().toString();
if (url.isEmpty() || url == QLatin1String("about:blank"))
QString homePage = m_helpEngine->customValue(QLatin1String("HomePage"),
QString()).toString();
-
+
if (homePage.isEmpty()) {
homePage = m_helpEngine->customValue(QLatin1String("DefaultHomePage"),
QLatin1String("about:blank")).toString();
index = m_helpEngine->customValue(QLatin1String("ContextHelpOption"), 0).toInt();
m_ui.contextHelpComboBox->setCurrentIndex(index);
-
+
connect(m_ui.currentPageButton, SIGNAL(clicked()), this, SLOT(setCurrentPage()));
connect(m_ui.blankPageButton, SIGNAL(clicked()), this, SLOT(setBlankPage()));
connect(m_ui.defaultPageButton, SIGNAL(clicked()), this, SLOT(setDefaultPage()));
}
void PerforceSettings::setSettings(const Settings &newSettings)
-{
+{
if (newSettings != m_settings) {
// trigger check
m_settings = newSettings;
namespace Perforce {
namespace Internal {
-
+
/* Submit editor widget with additional information pane
* at the top. */
class PerforceSubmitEditorWidget : public Utils::SubmitEditorWidget
m_watcher.setFuture(QtConcurrent::run(&BuildStep::run, m_currentBuildStep));
} else {
m_running = false;
- m_previousBuildStepProject = 0;
+ m_previousBuildStepProject = 0;
m_progressFutureInterface->reportFinished();
m_progressWatcher.setFuture(QFuture<void>());
delete m_progressFutureInterface;
class PROJECTEXPLORER_EXPORT CustomExecutableRunConfiguration : public LocalApplicationRunConfiguration
{
// the configuration widget needs to setExecutable setWorkingDirectory and setCommandLineArguments
- friend class Internal::CustomExecutableConfigurationWidget;
+ friend class Internal::CustomExecutableConfigurationWidget;
Q_OBJECT
public:
vbox2->addLayout(horizontalLayout);
vbox->addWidget(m_detailsContainer);
-
+
connect(m_model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
this, SLOT(updateButtons()));
void appendOutput(RunControl *rc, const QString &out);
void appendOutputInline(RunControl *rc, const QString &out);
void showTabFor(RunControl *rc);
-
+
public slots:
void projectRemoved();
void coreAboutToClose();
Internal::ProjectFileFactory *findProjectFileFactory(const QString &filename) const;
static ProjectExplorerPlugin *m_instance;
- ProjectExplorerPluginPrivate *d;
+ ProjectExplorerPluginPrivate *d;
};
} // namespace ProjectExplorer
removefiledialog.ui \
projectexplorersettingspage.ui \
projectwelcomepagewidget.ui
-win32 {
+win32 {
SOURCES += applicationlauncher_win.cpp \
winguiprocess.cpp
HEADERS += winguiprocess.h
* Note that all RunControls and the project hold a shared pointer to the RunConfiguration.
* That is the lifetime of the RunConfiguration might exceed the life of the project.
* The user might still have a RunControl running (or output tab of that RunControl open)
- * and yet unloaded the project.
- * Also a RunConfiguration might be already removed from the list of RunConfigurations
+ * and yet unloaded the project.
+ * Also a RunConfiguration might be already removed from the list of RunConfigurations
* for a project, but stil be runnable via the output tab.
-
+
*/
class PROJECTEXPLORER_EXPORT RunConfiguration : public QObject
{
painter->drawPixmap(2, opt.rect.top() + 2, icon.pixmap(16, 16));
int width = opt.rect.width() - model->sizeOfFile() - model->sizeOfLineNumber() - 12 - 22;
- if (!selected) {
+ if (!selected) {
// in small mode we lay out differently
QString bottom = index.data(TaskModel::Description).toString();
painter->drawText(22, 2 + opt.rect.top() + fm.ascent(), bottom);
}
QByteArray newDefine = "#define " + key + " " + value + '\n';
m_predefinedMacros.append(newDefine);
- }
+ }
}
QFile::remove(tmpFilePath);
}
ToolChain();
virtual ~ToolChain();
-
+
static bool equals(ToolChain *, ToolChain *);
// Factory methods
static ToolChain *createGccToolChain(const QString &gcc);
m_completion->setCaseSensitivity(caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
settings->endGroup();
settings->endGroup();
-
+
error_message->clear();
return true;
public:
ProjectFilesFactory(Manager *manager, TextEditor::TextEditorActionHandler *handler);
virtual ~ProjectFilesFactory();
-
+
Manager *manager() const;
virtual Core::IEditor *createEditor(QWidget *parent);
return false;
else if (fileName == QLatin1String("CVS"))
- return false;
+ return false;
// ### user include/exclude
$$PWD/classdefinition.ui \
$$PWD/customwidgetwidgetswizardpage.ui \
$$PWD/customwidgetpluginwizardpage.ui
-
+
}
foreach(const QString& roDir, src.entryList(QDir::NoDotAndDotDot|QDir::Dirs)) {
copyRecursive(src, dest, QDir(roDir).dirName());
- }
+ }
}
} // namespace
// ======== S60DeviceRunControlBase
S60DeviceRunControlBase::S60DeviceRunControlBase(const QSharedPointer<RunConfiguration> &runConfiguration) :
- RunControl(runConfiguration),
+ RunControl(runConfiguration),
m_makesis(new QProcess(this)),
m_signsis(new QProcess(this)),
m_launcher(0)
-{
+{
connect(m_makesis, SIGNAL(readyReadStandardError()),
this, SLOT(readStandardError()));
connect(m_makesis, SIGNAL(readyReadStandardOutput()),
initLauncher(runFileName, m_launcher);
emit addToOutputWindow(this, tr("Package: %1\nDeploying application to '%2'...").arg(lsFile(copySrc), m_serialPortFriendlyName));
QString errorMessage;
- // Prompt the user to start up the Blue tooth connection
+ // Prompt the user to start up the Blue tooth connection
const trk::PromptStartCommunicationResult src =
S60RunConfigBluetoothStarter::startCommunication(m_launcher->trkDevice(),
m_serialPortName,
{
if (m_launcher && m_launcher->state() == trk::Launcher::WaitingForTrk) {
stop();
- error(this, tr("Canceled."));
+ error(this, tr("Canceled."));
emit finished();
}
}
bool m_cachedTargetInformationValid;
QString m_serialPortName;
int m_communicationType;
- SigningMode m_signingMode;
+ SigningMode m_signingMode;
QString m_customSignaturePath;
QString m_customKeyPath;
};
void slotLauncherStateChanged(int);
void slotWaitingForTrkClosed();
-private:
+private:
bool createPackageFileFromTemplate(QString *errorMessage);
QString m_serialPortName;
virtual void stop();
-protected:
+protected:
virtual void initLauncher(const QString &executable, trk::Launcher *);
virtual void handleLauncherFinished();
virtual bool checkConfiguration(QString *errorMessage,
formLayout->addRow(nameLabel, m_nameLineEdit);
formLayout->addRow(tr("Install File:"), m_sisxFileLabel);
- updateSerialDevices();
+ updateSerialDevices();
connect(S60Manager::instance()->serialDeviceLister(), SIGNAL(updated()),
this, SLOT(updateSerialDevices()));
// Serial devices control
tr("<No Device>");
const QString signature = m_runConfiguration->signingMode() == S60DeviceRunConfiguration::SignCustom ?
tr("(custom certificate)") :
- tr("(self-signed certificate)");
+ tr("(self-signed certificate)");
m_detailsWidget->setSummaryText(tr("Summary: Run on '%1' %2").arg(device, signature));
}
};
if (!m_infoLauncher->startServer(&message)) {
setDeviceInfoLabel(message, true);
- m_infoLauncher->deleteLater();
+ m_infoLauncher->deleteLater();
return;
}
// Wait for either timeout or results
m_serialDeviceLister(new SerialDeviceLister(this))
{
m_instance = this;
-
+
addAutoReleasedObject(new S60DevicesPreferencePane(m_devices, this));
m_devices->detectQtForDevices(); // Order!
-
+
addAutoReleasedObject(new S60EmulatorRunConfigurationFactory(this));
addAutoReleasedObject(new RunControlFactory<S60EmulatorRunControl,
S60EmulatorRunConfiguration>
const QString friendlyFormat = QLatin1String("Bluetooth device (%1)");
for (int d = 0; d < 4; d++) {
CommunicationDevice device(BlueToothCommunication, prefix + QString::number(d));
- if (d == 0 || QFileInfo(device.portName).exists()) {
+ if (d == 0 || QFileInfo(device.portName).exists()) {
device.friendlyName = friendlyFormat.arg(device.portName);
rc.push_back(device);
}
bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments)
-
+
Core::ICore *core = Core::ICore::instance();
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":qt4projectmanager/Qt4ProjectManager.mimetypes.xml"), errorMessage))
return false;
}
void Qt4RunConfiguration::restore(const PersistentSettingsReader &reader)
-{
+{
LocalApplicationRunConfiguration::restore(reader);
const QDir projectDir = QFileInfo(project()->file()->fileName()).absoluteDir();
m_commandLineArguments = reader.restoreValue("CommandLineArguments").toStringList();
// Set the items tooltip, which may cause costly initialization
// of QtVersion and must be up-to-date
if (o != m_ui->qtdirList || e->type() != QEvent::ToolTip)
- return false;
+ return false;
QHelpEvent *helpEvent = static_cast<QHelpEvent *>(e);
const QPoint treePos = helpEvent->pos() - QPoint(0, m_ui->qtdirList->header()->height());
QTreeWidgetItem *item = m_ui->qtdirList->itemAt(treePos);
bool formInputCheckable() const;
bool formInputChecked() const;
QStringList baseClassChoices() const;
- bool lowerCaseFiles() const;
+ bool lowerCaseFiles() const;
bool isClassTypeComboVisible() const;
void setSuffixes(const QString &header, const QString &source, const QString &form = QString());
// Order! suffixes first to generate files correctly
dialog->setLowerCaseFiles(QtWizard::lowerCaseFiles());
dialog->setSuffixes(headerSuffix(), sourceSuffix(), formSuffix());
- dialog->setBaseClasses(baseClasses());
+ dialog->setBaseClasses(baseClasses());
return dialog;
}
form = QSharedPointer<Core::GeneratedFile>(new Core::GeneratedFile(formName));
if (!parametrizeTemplate(templatePath, QLatin1String("widget.ui"), params, &contents, errorMessage))
return Core::GeneratedFiles();
- form->setContents(contents);
+ form->setContents(contents);
if (!generateFormClass(params, *form, &formSource, &formHeader, errorMessage))
return Core::GeneratedFiles();
} else {
LibraryWizardDialog *dialog = new LibraryWizardDialog(name(), icon(), extensionPages, parent);
dialog->setLowerCaseFiles(QtWizard::lowerCaseFiles());
dialog->setPath(defaultPath.isEmpty() ? Utils::PathChooser::homePath() : defaultPath);
- dialog->setSuffixes(headerSuffix(), sourceSuffix(), formSuffix());
+ dialog->setSuffixes(headerSuffix(), sourceSuffix(), formSuffix());
return dialog;
}
m_completion->setCaseSensitivity(caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
settings->endGroup();
settings->endGroup();
-
+
error_message->clear();
return true;
snippetswindow.h \
snippetspec.h \
snippetscompletion.h \
- inputwidget.h
+ inputwidget.h
SOURCES += snippetsplugin.cpp \
snippetswindow.cpp \
snippetspec.cpp \
snippetscompletion.cpp \
- inputwidget.cpp
+ inputwidget.cpp
RESOURCES += snippets.qrc
if (Core::IEditor *editor = locateEditor("annotateFileName", file)) {
editor->createNew(response.stdOut);
VCSBase::VCSBaseEditor::gotoLineOfEditor(editor, lineNumber);
- Core::EditorManager::instance()->activateEditor(editor);
+ Core::EditorManager::instance()->activateEditor(editor);
} else {
const QString title = QString::fromLatin1("svn annotate %1").arg(QFileInfo(file).fileName());
Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::AnnotateOutput, file, codec);
m_watcher.setFuture(Utils::findInFilesRegExp(txt, files(), findFlags, ITextEditor::openedTextEditorsContents()));
else
m_watcher.setFuture(Utils::findInFiles(txt, files(), findFlags, ITextEditor::openedTextEditorsContents()));
- Core::FutureProgress *progress =
+ Core::FutureProgress *progress =
Core::ICore::instance()->progressManager()->addTask(m_watcher.future(),
"Search",
Constants::TASK_SEARCH,
connect(job.data(), SIGNAL(succeeded()), this, SLOT(slotSucceeded()));
QApplication::setOverrideCursor(Qt::WaitCursor);
ui->logPlainTextEdit->clear();
- setSubTitle(tr("Checkout started..."));
+ setSubTitle(tr("Checkout started..."));
m_state = Running;
// Note: Process jobs can emit failed() right from
// the start() method on Windows.
void CheckoutProgressWizardPage::slotSucceeded()
{
if (m_state == Running) {
- m_state = Succeeded;
+ m_state = Succeeded;
QApplication::restoreOverrideCursor();
setSubTitle(tr("Succeeded."));
emit completeChanged();
QList<QStandardItem *> NickNameEntry::toModelRow() const
{
- const QVariant nickNameData = nickName();
+ const QVariant nickNameData = nickName();
const Qt::ItemFlags flags = Qt::ItemIsSelectable|Qt::ItemIsEnabled;
QStandardItem *i1 = new QStandardItem(name);
i1->setFlags(flags);
}
}
-void VCSBaseEditor::slotDiffBrowse(int index)
+void VCSBaseEditor::slotDiffBrowse(int index)
{
// goto diffed file as indicated by index/line number
if (index < 0 || index >= d->m_diffSections.size())
- return;
+ return;
const int lineNumber = d->m_diffSections.at(index);
Core::EditorManager *editorManager = Core::EditorManager::instance();
editorManager->addCurrentPositionToNavigationHistory();
// Adapt diff file browse combo to new position
// if the cursor goes across a file line.
QTC_ASSERT(d->m_parameters->type == DiffOutput, return)
- const int newCursorLine = textCursor().blockNumber();
+ const int newCursorLine = textCursor().blockNumber();
if (newCursorLine == d->m_cursorLine)
return;
// Which section does it belong to?
Utils::SubmitFieldWidget *fieldWidget = new Utils::SubmitFieldWidget;
connect(fieldWidget, SIGNAL(browseButtonClicked(int,QString)),
- this, SLOT(slotSetFieldNickName(int)));
+ this, SLOT(slotSetFieldNickName(int)));
fieldWidget->setCompleter(completer);
fieldWidget->setAllowDuplicateFields(true);
fieldWidget->setHasBrowseButton(true);
if (!checkProcess.waitForFinished()) {
*errorMessage = tr("The check script '%1' could not be run: %2").arg(checkScript, checkProcess.errorString());
return false;
- }
+ }
const int exitCode = checkProcess.exitCode();
if (exitCode != 0) {
*errorMessage = QString::fromLocal8Bit(checkProcess.readAllStandardError());
# this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var
QMAKE_RPATHDIR += \$\$ORIGIN/../$$IDE_LIBRARY_BASENAME/qtcreator
IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":")
-
+
QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\'
QMAKE_RPATHDIR =
}
QByteArray utf = rawText.toUtf8();
QString enc;
enc.reserve(utf.length()); // Make sure we at least have space for a normal US-ASCII URL
-
+
QByteArray::const_iterator it = utf.constBegin();
while (it != utf.constEnd()) {
char ch = *it;
// The algorithm works like this:
// On the first match we only get the filename of the first patch part
// On the second match (if any) we get the diff content, and the name of the next file patch
-
+
while (-1 != (splitIndex = splitExpr.indexIn(strData,splitIndex))) {
if (!filename.isEmpty()) {
QString content = strData.mid(previousSplit, splitIndex - previousSplit);
if (declarator->postfix_declarators && declarator->postfix_declarators->asFunctionDeclarator()
&& ! declarator->initializer) {
return false;
- }
+ }
}
return true;
* | |
* | |
* Handles QVBoxLayout [margin: SELECTION_MARGIN]
- * |
+ * |
* Frame [margin: lineWidth]
* |
* QVBoxLayout
{
bookmarkIcon = QIcon(QLatin1String(":/help/images/bookmark.png"));
folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon);
-
+
connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this,
SLOT(itemChanged(QStandardItem*)));
}
item->setIcon(bookmarkIcon);
item->setData(false, Qt::UserRole + 11);
item->setData(url, Qt::UserRole + 10);
-
+
if (index.isValid())
treeModel->itemFromIndex(index)->appendRow(item);
else
Q_OBJECT
public:
- BookmarkDialog(BookmarkManager *manager, const QString &title,
+ BookmarkDialog(BookmarkManager *manager, const QString &title,
const QString &url, QWidget *parent = 0);
~BookmarkDialog();
void selectBookmarkFolder(const QString &folderName);
void customContextMenuRequested(const QPoint &point);
void currentChanged(const QModelIndex& current);
-
+
private:
bool eventFilter(QObject *object, QEvent *e);
private slots:
void itemChanged(QStandardItem *item);
-private:
+private:
QString uniqueFolderName() const;
void removeBookmarkFolderItems(QStandardItem *item);
void readBookmarksRecursive(const QStandardItem *item, QDataStream &stream,
QUrl url;
if (links.count() > 1) {
TopicChooser tc(this, keyword, links);
- if (tc.exec() == QDialog::Accepted)
+ if (tc.exec() == QDialog::Accepted)
url = tc.link();
} else if (links.count() == 1) {
url = links.constBegin().value();
QMap<QString, QUrl>::const_iterator it = m_links.constBegin();
for (; it != m_links.constEnd(); ++it)
ui.listWidget->addItem(it.key());
-
+
if (ui.listWidget->count() != 0)
ui.listWidget->setCurrentRow(0);
ui.listWidget->setFocus();
TopicChooser(QWidget *parent, const QString &keyword,
const QMap<QString, QUrl> &links);
- QUrl link() const;
-
+ QUrl link() const;
+
private:
Ui::TopicChooser ui;
QMap<QString, QUrl> m_links;
ProCommandManager::~ProCommandManager()
{
- qDeleteAll(m_groups);
+ qDeleteAll(m_groups);
}
void ProCommandManager::beginGroup(const QString &name)
delete m_groups.takeLast();
m_pos = m_groups.count();
}
-
+
m_group = new ProCommandGroup(name);
}
namespace Qt4ProjectManager {
namespace Internal {
-
+
class ProCommand
{
public:
private:
ProCommandGroup *m_group;
QList<ProCommandGroup *> m_groups;
-
+
int m_pos;
ProCommandGroup *m_savepoint;
};
namespace Qt4ProjectManager {
namespace Internal {
-
+
class ProAddCommand : public ProCommand
{
public:
beginInsertRows(parent, row, row);
block->setItems(proitems);
endInsertRows();
-
+
markProFileModified(parent);
return true;
}
void ProEditorModel::markProFileModified(QModelIndex index)
{
- while (index.isValid()) {
+ while (index.isValid()) {
if (proItem(index)->kind() == ProItem::BlockKind) {
ProBlock * block = proBlock(index);
if (block->blockKind() == ProBlock::ProFileKind) {
ProBlock *proBlock(const QModelIndex &index) const;
ProVariable *proVariable(const QModelIndex &index) const;
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
Q_OBJECT
public:
- enum CheckableType {
+ enum CheckableType {
None,
- Variable,
+ Variable,
Blocks
};
-
+
void setVariableFilter(const QStringList &vars);
void setCheckable( CheckableType ct );
void ProVariableInfo::addValue(ProValueInfo *value)
{
- m_values.insert(value->id(), value);
+ m_values.insert(value->id(), value);
}
void ProVariableInfo::setMultiple(bool multiple)
m_out.setDevice(&data);
writeItem(profile, QString());
data.close();
-
+
return true;
}
QString ProWriter::fixComment(const QString &comment, const QString &indent) const
{
QString result = comment;
- result = result.replace(QLatin1Char('\n'),
+ result = result.replace(QLatin1Char('\n'),
QLatin1Char('\n') + indent + QLatin1String("# "));
return QLatin1String("# ") + result;
}
m_out << indent << QLatin1String(" ");
m_writeState &= ~NewLine;
}
-
+
m_out << value->value();
if (!(m_writeState & LastItem))
QDomNode ProXmlParser::createItemNode(QDomDocument doc, ProItem *item) const
{
-
+
QDomElement tag;
if (item->kind() == ProItem::ValueKind) {
tag = doc.createElement(QLatin1String("value"));
tag.appendChild(childNode);
}
}
-
+
QString comment = item->comment();
comment = comment.replace('\\', QLatin1String("\\\\"));
comment = comment.replace('\n', QLatin1String("\\n"));
if (!comment.isEmpty())
tag.setAttribute(QLatin1String("comment"), comment);
-
+
return tag;
}
void removePrefix(int prefix_idx);
void removeFile(int prefix_idx, int file_idx);
-
+
void replacePrefix(int prefix_idx, const QString &prefix);
void replaceLang(int prefix_idx, const QString &lang);
void replaceAlias(int prefix_idx, int file_idx, const QString &alias);
bool isDirty() const;
void setDirty(bool dirty);
- void enableContextMenu(bool enable);
+ void enableContextMenu(bool enable);
void addFiles(QStringList fileList, const QModelIndex &index);
class QT_QTLOCKEDFILE_EXPORT QtLockedFile : public QFile
{
-public:
+public:
enum LockMode { NoLock = 0, ReadLock, WriteLock };
QtLockedFile();
QtLockedFile(const QString &name);
~QtLockedFile();
-
+
bool lock(LockMode mode, bool block = true);
bool unlock();
bool isLocked() const;
LockMode lockMode() const;
-
+
private:
#ifdef Q_OS_WIN
Qt::HANDLE m_semaphore_hnd;
qWarning("QtLockedFile::lock(): file is not opened");
return false;
}
-
+
if (mode == NoLock)
return unlock();
-
+
if (mode == m_lock_mode)
return true;
fl.l_type = (mode == ReadLock) ? F_RDLCK : F_WRLCK;
int cmd = block ? F_SETLKW : F_SETLK;
int ret = fcntl(handle(), cmd, &fl);
-
+
if (ret == -1) {
if (errno != EINTR && errno != EAGAIN)
qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno));
return false;
}
-
+
m_lock_mode = mode;
return true;
}
fl.l_len = 0;
fl.l_type = F_UNLCK;
int ret = fcntl(handle(), F_SETLKW, &fl);
-
+
if (ret == -1) {
qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno));
return false;
}
-
+
m_lock_mode = NoLock;
return true;
}
return true;
}
-void BluetoothListener::slotStdOutput()
+void BluetoothListener::slotStdOutput()
{
emitMessage(QString::fromLocal8Bit(d->process.readAllStandardOutput()));
}
QMessageBox messageBox(QMessageBox::Information, msgBoxTitle, msgBoxText, QMessageBox::Cancel, msgBoxParent);
QObject::connect(&starter, SIGNAL(connected()), &messageBox, SLOT(close()));
QObject::connect(&starter, SIGNAL(timeout()), &messageBox, SLOT(close()));
- messageBox.exec();
+ messageBox.exec();
// Only starter.state() is reliable here to obtain the state.
switch (starter.state()) {
case AbstractBluetoothStarter::Running:
d(new LauncherPrivate(dev))
{
d->m_startupActions = startupActions;
- connect(d->m_device.data(), SIGNAL(messageReceived(trk::TrkResult)), this, SLOT(handleResult(trk::TrkResult)));
+ connect(d->m_device.data(), SIGNAL(messageReceived(trk::TrkResult)), this, SLOT(handleResult(trk::TrkResult)));
connect(this, SIGNAL(finished()), d->m_device.data(), SLOT(close()));
}
void setInstallFileName(const QString &name);
void setCommandLineArgs(const QStringList &args);
bool startServer(QString *errorMessage);
- void setVerbose(int v);
+ void setVerbose(int v);
void setSerialFrame(bool b);
bool serialFrame() const;
// Close device or leave it open
///////////////////////////////////////////////////////////////////////
class TrkWriteQueue
-{
+{
Q_DISABLE_COPY(TrkWriteQueue)
public:
explicit TrkWriteQueue();
class WriterThread : public QThread {
Q_OBJECT
Q_DISABLE_COPY(WriterThread)
-public:
+public:
explicit WriterThread(const QSharedPointer<DeviceContext> &context);
// Enqueue messages.
private slots:
void invokeNoopMessage(const trk::TrkMessage &);
-private:
+private:
bool write(const QByteArray &data, QString *errorMessage);
inline int writePendingMessage();
if (!ClearCommError(m_context->device, NULL, &comStat)){
emit error(QString::fromLatin1("ClearCommError failed: %1").arg(winErrorMessage(GetLastError())));
return -7;
- }
+ }
const DWORD bytesToRead = qMax(DWORD(1), qMin(comStat.cbInQue, DWORD(BufSize)));
// Trigger read
DWORD bytesRead = 0;
if (readError != ERROR_IO_PENDING) {
emit error(QString::fromLatin1("Read error: %1").arg(winErrorMessage(readError)));
return -1;
- }
+ }
// Wait for either termination or data
const DWORD wr = WaitForMultipleObjects(HandleCount, m_handles, false, INFINITE);
if (wr == WAIT_FAILED) {
int m_terminatePipeFileDescriptors[2];
};
-UnixReaderThread::UnixReaderThread(const QSharedPointer<DeviceContext> &context) :
+UnixReaderThread::UnixReaderThread(const QSharedPointer<DeviceContext> &context) :
ReaderThreadBase(context)
{
m_terminatePipeFileDescriptors[0] = m_terminatePipeFileDescriptors[1] = -1;
d->writerThread = QSharedPointer<WriterThread>(new WriterThread(d->deviceContext));
connect(d->writerThread.data(), SIGNAL(error(QString)), this, SLOT(emitError(QString)),
- Qt::QueuedConnection);
- d->writerThread->start();
+ Qt::QueuedConnection);
+ d->writerThread->start();
if (d->verbose)
qDebug() << "Opened" << port;
void TrkDevice::slotMessageReceived(const trk::TrkResult &result, const QByteArray &rawData)
{
d->writerThread->slotHandleResult(result);
- emit messageReceived(result);
+ emit messageReceived(result);
if (!rawData.isEmpty())
emit rawDataReceived(rawData);
}
* Trk communications. Provides synchronous write and asynchronous
* read operation.
* The serialFrames property specifies whether packets are encapsulated in
- * "0x90 <length>" frames, which is currently the case for serial ports.
+ * "0x90 <length>" frames, which is currently the case for serial ports.
* Contains a write message queue allowing
* for queueing messages with a notification callback. If the message receives
* an ACK, the callback is invoked.
struct TrkAppVersion {
TrkAppVersion();
- void reset();
+ void reset();
int trkMajor;
int trkMinor;
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
-HEADERS +=
+HEADERS +=
return result;
}
-public:
+public:
QString m_fileName;
};
//
// Files
- //
+ //
QDockWidget *filesDock = new QDockWidget(this);
filesDock->setObjectName("FilesDock");
filesDock->setGeometry(QRect(0, 0, 200, 200));
debugMenu->addAction(m_manager->m_breakAction);
//debugMenu->addAction(m_startDebuggerAction);
menuBar()->addMenu(debugMenu);
-
+
//
// Toolbar
//
return;
foreach (const QString &fileName, fileNames)
loadFile(fileName);
- startDebuggingRequest();
+ startDebuggingRequest();
}
void MainWindow::startDebuggingRequest()
Q_UNUSED(setMarker)
TextViewer *textViewer = findOrCreateTextViewer(fileName);
m_textViewers->setCurrentWidget(textViewer);
-
+
const int blockNumber = line - 1;
const QTextBlock &block = textViewer->document()->findBlockByNumber(blockNumber);
if (block.isValid()) {
settings().setValue("FileOpen/LastDir", QFileInfo(fileName).dir().dirName());
if (fileName.isEmpty())
return;
- loadFile(fileName);
+ loadFile(fileName);
}
void MainWindow::queryCurrentTextEditor(QString *fileName, int *line, QObject **object)
{
QMessageBox::warning(this, tr("Cannot find special data dumpers"),
tr("The debugged binary does not contain information needed for "
- "nice display of Qt data types.\n\n"
+ "nice display of Qt data types.\n\n"
"Make sure you use something like\n\n"
"SOURCES *= .../ide/main/bin/gdbmacros/gdbmacros.cpp\n\n"
"in your .pro file.")
namespace GdbDebugger {
namespace Internal {
-class DebuggerManager;
+class DebuggerManager;
} // namespace Internal
} // namespace GdbDebugger
INCLUDEPATH += $${QTCREATOR}
INCLUDEPATH += $${QTCREATOR}/gdbdebugger
-HEADERS += \
+HEADERS += \
lean.h \
mainwindow.h \
$${QTCREATOR}/gdbdebugger/attachexternaldialog.h \
true {
DEFINES += USE_BASETEXTEDITOR
-DEFINES += TEXTEDITOR_STANDALONE
+DEFINES += TEXTEDITOR_STANDALONE
INCLUDEPATH += $${QTCREATOR}
INCLUDEPATH += $${QTCREATOR}/texteditor
INCLUDEPATH += $${QTCREATOR}/../libs
-HEADERS += \
+HEADERS += \
$${QTCREATOR}/texteditor/basetextdocument.h \
$${QTCREATOR}/texteditor/basetexteditor.h \
$${QTCREATOR}/texteditor/storagesettings.h \
void DetailsWidget_CW::initialize(QDesignerFormEditorInterface *core)
{
const bool firstTime = !initialized();
- CustomWidget<Utils::DetailsWidget>::initialize(core);
+ CustomWidget<Utils::DetailsWidget>::initialize(core);
if (firstTime)
if (QExtensionManager *manager = core->extensionManager())
manager->registerExtensions(new DetailsWidgetExtensionFactory(manager), Q_TYPEID(QDesignerContainerExtension));
virtual QList<QDesignerCustomWidgetInterface*> customWidgets() const;
private:
- QList<QDesignerCustomWidgetInterface*> m_plugins;
+ QList<QDesignerCustomWidgetInterface*> m_plugins;
};
#endif // CUSTOMWIDGETS_H
HEADERS = customwidgets.h \
customwidget.h
-SOURCES = customwidgets.cpp
+SOURCES = customwidgets.cpp
# Link against the qtcreator utils lib
while(token != NULL) {
// check if it ends with the token
- if ((tlen >= strlen(token))
+ if ((tlen >= strlen(token))
&& (strcasecmp((data+tlen)-strlen(token), token) == 0))
return true;
token = strtok(NULL, ";");
long getBufferStringLength(char *data, char *end);
bool endsWithTokens(const char *data);
- bool patchHelper(char *inbuffer, const char *oldstr,
+ bool patchHelper(char *inbuffer, const char *oldstr,
const char *newstr, size_t len, long *rw);
bool useLength;
CONFIG += console
QT -= gui
TEMPLATE = app
-TARGET =
+TARGET =
DEPENDPATH += .
INCLUDEPATH += .
DESTDIR = .
{
return new MyEditable(this);
}
-
+
void setPlainText(const QString &contents)
- {
+ {
qDebug() << "Setting contents to:\n" << contents;
QPlainTextEdit::setPlainText(contents);
}
settings().setValue("FileOpen/LastDir", QFileInfo(fileName).dir().dirName());
if (fileName.isEmpty())
return;
- loadFile(fileName);
+ loadFile(fileName);
}
QHash<QString, Editor *> m_textViewerFromName;
Editor *findOrCreateTextViewer(const QString &fileName);
Editor *currentTextViewer();
-
+
QSettings &settings();
QAction * m_fileOpenAction;
QAction * m_quitAction;
TARGET = ../../../bin/texteditor
-QT += gui
+QT += gui
CONFIG -= release
CONFIG += debug
INCLUDEPATH += $${QTCREATOR}
INCLUDEPATH += $${QTCREATOR}/texteditor
-HEADERS += \
+HEADERS += \
mainwindow.h \
$${QTCREATOR}/texteditor/basetextdocument.h \
$${QTCREATOR}/texteditor/basetexteditor.h \
}
-template <typename T>
+template <typename T>
inline QByteArray N(T t) { return QByteArray::number(t); }
static const char gdbmi1[] =
for (int i = 0; i < l1.size() && i < l2.size(); ++i) {
if (l1.at(i) == l2.at(i))
qWarning() << "== " << l1.at(i);
- else
+ else
//qWarning() << "!= " << l1.at(i).right(30) << l2.at(i).right(30);
qWarning() << "!= " << l1.at(i) << l2.at(i);
}
QByteArray value;
if (d.isNull())
value = "value='(null)'";
- else
+ else
value = QByteArray("value='%',valueencoded='2'")
<< utfToBase64(d.toString());
"numchild='0',addr='$A',type='"NS"QObjectSignal'},"
"{name='21',value='columnsMoved(QModelIndex,int,int,QModelIndex,int)',"
"numchild='0',addr='$A',type='"NS"QObjectSignal'}]";
-
+
testDumper(expected << "0" << "0" << "0" << "0" << "0" << "0",
&m, NS"QObjectSignalList", true);
QVERIFY(sizeof(int) == sizeof(d.weakref));
QVERIFY(sizeof(int) == sizeof(d.strongref));
const size_t qObjectPrivateSize = sizeof(QObjectPrivate);
- const size_t objectPrivateSize = sizeof(ObjectPrivate);
+ const size_t objectPrivateSize = sizeof(ObjectPrivate);
QVERIFY2(qObjectPrivateSize == objectPrivateSize, QString::fromLatin1("QObjectPrivate=%1 ObjectPrivate=%2").arg(qObjectPrivateSize).arg(objectPrivateSize).toLatin1().constData());
VERIFY_OFFSETOF(threadData);
VERIFY_OFFSETOF(extraData);
~Foo()
{
- }
+ }
void doit()
{
static QObject ob;
QByteArray ba = m_proc->readAllStandardOutput();
DEBUG("THREAD GDB OUT: " << ba);
// =library-loaded...
- if (ba.startsWith("="))
+ if (ba.startsWith("="))
return;
if (ba.startsWith("*stopped")) {
m_lastStopped = ba;
}
// The "call" is always aborted with a message like:
- // "~"2321\t /* A */ QString s;\n" "
+ // "~"2321\t /* A */ QString s;\n" "
// "&"The program being debugged stopped while in a function called ..."
// "^error,msg="The program being debugged stopped ..."
// Extract the "2321" from this
{
#ifndef Q_CC_GNU
QSKIP("gdb test not applicable for compiler", SkipAll);
-#endif
+#endif
//qDebug() << "\nTHREAD RUN" << getpid() << gettid();
QProcess *gdbProc = new QProcess;
QStringList args;
} else {
qWarning() << "!= size: " << l1.size() << l2.size();
}
-
+
if (!ok) {
int i = 0;
for ( ; i < l1.size() && i < l2.size(); ++i) {
ok = false;
}
}
- for ( ; i < l2.size(); ++i)
+ for ( ; i < l2.size(); ++i)
qWarning() << "!= " << "-----" << l2.at(i);
- for ( ; i < l1.size(); ++i)
+ for ( ; i < l1.size(); ++i)
qWarning() << "!= " << l1.at(i) << "-----";
if (l1.size() != l2.size()) {
ok = false;
QByteArray value;
if (d.isNull())
value = "value='(null)'";
- else
+ else
value = QByteArray("value='%',valueencoded='2'")
<< utfToBase64(d.toString());
"type='"NS"QObject',value='<not in scope>',"
"numchild='0'}");
next(4);
-
+
run("F","{iname='local.ob',name='ob',type='"NS"QObject',valueencoded='7',"
"value='41006e0020004f0062006a00650063007400',numchild='4',children=["
"{name='parent',type='"NS"QObject *',"
"local.simplePtr,local.simplePtr2,local.simplePtr3,local.simplePtr4,"
"local.compositePtr,local.compositePtr,local.compositePtr,"
"local.compositePtr");
-
+
#endif
}
void dump_QString()
{
/* A */ QString s;
- /* B */ s = "hallo";
+ /* B */ s = "hallo";
/* C */ s += "x";
/* D */ (void) 0;
}
prepare("dump_QVariant");
if (checkUninitialized) /*<not in scope>*/
run("A","{"PRE"'value=<not in scope>',numchild='0'}");
- next();
+ next();
run("<invalid>", "{"PRE"value='<invalid>',numchild='0'}");
- next();
+ next();
run("QBitArray", "{"PRE"value='("NS"QBitArray)',numchild='1',children=["
"{name='data',type='"NS"QBitArray',value='{...}',numchild='1'}]}",
"local.v");
- next();
+ next();
//run("QBitMap", "{"PRE"value="NS"QBitMap'',numchild='1',children=["
// "]}", "local.v");
- next();
+ next();
run("bool", "{"PRE"value='true',numchild='0'}", "local.v");
- next();
+ next();
//run("QBrush", "{"PRE"value='"NS"QBrush',numchild='1',children=["
// "]}", "local.v");
- next();
+ next();
run("QByteArray", "{"PRE"value='("NS"QByteArray)',numchild='1',"
"children=[{name='data',type='"NS"QByteArray',valueencoded='6',"
"value='616263',numchild='3'}]}", "local.v");
- next();
+ next();
run("QChar", "{"PRE"value='("NS"QChar)',numchild='1',"
"children=[{name='data',type='"NS"QChar',value=''x', ucs=120',numchild='0'}]}", "local.v");
- next();
+ next();
//run("QColor", "{"PRE"value='("NS"QColor)',numchild='1',children=["
// "]}", "local.v");
- next();
+ next();
//run("QCursor", "{"PRE"value='',numchild='1',children=["
// "]}", "local.v");
- next();
+ next();
run("QDate", "{"PRE"value='("NS"QDate)',numchild='1',children=["
"{name='data',type='"NS"QDate',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
run("QDateTime", "{"PRE"value='("NS"QDateTime)',numchild='1',children=["
"{name='data',type='"NS"QDateTime',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
run("double", "{"PRE"value='46',numchild='0'}", "local.v");
- next();
+ next();
//run("QFont", "{"PRE"value='(NS"QFont")',numchild='1',children=["
// "{name='data',type='"NS"QFont',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
run("QVariantHash", "{"PRE"value='("NS"QVariantHash)',numchild='1',children=["
"{name='data',type='"NS"QHash<"NS"QString, "NS"QVariant>',"
"value='<0 items>',numchild='0'}]}", "local.v");
- next();
+ next();
//run("QIcon", "{"PRE"value='("NS"QIcon)',numchild='1',children=["
// "{name='data',type='"NS"QIcon',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QImage", "{"PRE"value='("NS"QImage)',numchild='1',children=["
// "{name='data',type='"NS"QImage',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
run("int", "{"PRE"value='42',numchild='0'}", "local.v");
- next();
+ next();
//run("QKeySequence", "{"PRE"value='("NS"QKeySequence)',numchild='1'",
// "local.v");
- next();
+ next();
run("QLine", "{"PRE"value='("NS"QLine)',numchild='1',children=["
"{name='data',type='"NS"QLine',value='{...}',numchild='2'}]}", "local.v");
- next();
+ next();
run("QLineF", "{"PRE"value='("NS"QLineF)',numchild='1',children=["
"{name='data',type='"NS"QLineF',value='{...}',numchild='2'}]}", "local.v");
- next();
+ next();
run("QVariantList", "{"PRE"value='("NS"QVariantList)',numchild='1',children=["
"{name='data',type='"NS"QList<"NS"QVariant>',"
"value='<0 items>',numchild='0'}]}", "local.v");
- next();
+ next();
run("QLocale", "{"PRE"value='("NS"QLocale)',numchild='1',children=["
"{name='data',type='"NS"QLocale',value='{...}',numchild='2'}]}", "local.v");
- next();
+ next();
run("qlonglong", "{"PRE"value='44',numchild='0'}", "local.v");
- next();
+ next();
run("QVariantMap", "{"PRE"value='("NS"QVariantMap)',numchild='1',children=["
"{name='data',type='"NS"QMap<"NS"QString, "NS"QVariant>',"
"value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QTransform", "{"PRE"value='("NS"QTransform)',numchild='1',children=["
// "{name='data',type='"NS"QTransform',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QMatrix4x4", "{"PRE"value='("NS"QMatrix4x4)',numchild='1',children=["
// "{name='data',type='"NS"QMatrix4x4',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QPalette", "{"PRE"value='("NS"QPalette)',numchild='1',children=["
// "{name='data',type='"NS"QPalette',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QPen", "{"PRE"value='("NS"QPen)',numchild='1',children=["
// "{name='data',type='"NS"QPen',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QPixmap", "{"PRE"value='("NS"QPixmap)',numchild='1',children=["
// "{name='data',type='"NS"QPixmap',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
run("QPoint", "{"PRE"value='("NS"QPoint)',numchild='1',children=["
"{name='data',type='"NS"QPoint',value='(45, 46)',numchild='2'}]}",
"local.v");
- next();
+ next();
//run("QPointArray", "{"PRE"value='("NS"QPointArray)',numchild='1',children=["
// "{name='data',type='"NS"QPointArray',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
// FIXME
// run("QPointF", "{"PRE"value='("NS"QPointF)',numchild='1',children=["
// "{name='data',type='"NS"QPointF',value='(41, 42)',numchild='2'}]}",
// "local.v");
- next();
+ next();
//run("QPolygon", "{"PRE"value='("NS"QPolygon)',numchild='1',children=["
// "{name='data',type='"NS"QPolygon',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QQuaternion", "{"PRE"value='("NS"QQuaternion)',numchild='1',children=["
// "{name='data',type='"NS"QQuaternion',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
run("QRect", "{"PRE"value='("NS"QRect)',numchild='1',children=["
"{name='data',type='"NS"QRect',value='{...}',numchild='4'}]}", "local.v");
- next();
+ next();
// FIXME:
// run("QRectF", "{"PRE"value='("NS"QRectF)',numchild='1',children=["
// "{name='data',type='"NS"QRectF',value='{...}',numchild='4'}]}", "local.v");
- next();
+ next();
run("QRegExp", "{"PRE"value='("NS"QRegExp)',numchild='1',children=["
"{name='data',type='"NS"QRegExp',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QRegion", "{"PRE"value='("NS"QRegion)',numchild='1',children=["
// "{name='data',type='"NS"QRegion',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
run("QSize", "{"PRE"value='("NS"QSize)',numchild='1',children=["
"{name='data',type='"NS"QSize',value='(0, 0)',numchild='2'}]}", "local.v");
- next();
+ next();
// FIXME:
// run("QSizeF", "{"PRE"value='("NS"QSizeF)',numchild='1',children=["
// "{name='data',type='"NS"QSizeF',value='(0, 0)',numchild='2'}]}", "local.v");
- next();
+ next();
//run("QSizePolicy", "{"PRE"value='("NS"QSizePolicy)',numchild='1',children=["
// "{name='data',type='"NS"QSizePolicy',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
run("QString", "{"PRE"value='("NS"QString)',numchild='1',children=["
"{name='data',type='"NS"QString',valueencoded='7',value='610062006300',numchild='0'}]}",
"local.v");
- next();
+ next();
run("QStringList", "{"PRE"value='("NS"QStringList)',numchild='1',children=["
"{name='data',type='"NS"QStringList',value='<1 items>',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QTextFormat", "{"PRE"value='("NS"QTextFormat)',numchild='1',children=["
// "{name='data',type='"NS"QTextFormat',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QTextLength", "{"PRE"value='("NS"QTextLength)',numchild='1',children=["
// "{name='data',type='"NS"QTextLength',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
run("QTime", "{"PRE"value='("NS"QTime)',numchild='1',children=["
"{name='data',type='"NS"QTime',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
run("uint", "{"PRE"value='43',numchild='0'}", "local.v");
- next();
+ next();
run("qulonglong", "{"PRE"value='45',numchild='0'}", "local.v");
- next();
+ next();
run("QUrl", "{"PRE"value='("NS"QUrl)',numchild='1',children=["
"{name='data',type='"NS"QUrl',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QVector2D", "{"PRE"value='("NS"QVector2D)',numchild='1',children=["
// "{name='data',type='"NS"QVector2D',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QVector3D", "{"PRE"value='("NS"QVector3D)',numchild='1',children=["
// "{name='data',type='"NS"QVector3D',value='{...}',numchild='1'}]}", "local.v");
- next();
+ next();
//run("QVector4D", "{"PRE"value='("NS"QVector4D)',numchild='1',children=["
// "{name='data',type='"NS"QVector4D',value='{...}',numchild='1'}]}", "local.v");
}
using namespace Debugger;
using namespace Debugger::Internal;
-
+
static QByteArray stripped(QByteArray ba)
{
for (int i = ba.size(); --i >= 0; ) {
void changeStatusData(const QString &info) { m_statusData = info; }
void changeStatusMessage(const QString &info) { m_statusMessage = info; }
void changeExtraInformation(const QString &info) { m_infoMessage = info; }
-
+
private slots:
// command mode
void command_Cxx_down_dot();
void test_i_cw_i();
private:
- void setup();
+ void setup();
void send(const QString &command) { sendEx("normal " + command); }
void sendEx(const QString &command); // send an ex command
static const QString escape;
};
-const QString tst_FakeVim::lines =
+const QString tst_FakeVim::lines =
/* 0 1 2 3 4 */
/* 0123456789012345678901234567890123457890 */
"\n"
check("ibx" + escape, "b@xa" + lines);
check("icyy" + escape, "bcy@yxa" + lines);
check("u", "b@xa" + lines);
- check("u", "@a" + lines);
+ check("u", "@a" + lines);
checkEx("redo", "b@xa" + lines);
check("u", "@a" + lines);
}
setup();
move("4j", "@int main");
move("$", "int main(int argc, char *argv[])@");
- check("rx", lmid(0, 4) + "\nint main(int argc, char *argv[]x@\n" + lmid(5));
+ check("rx", lmid(0, 4) + "\nint main(int argc, char *argv[]x@\n" + lmid(5));
check("2h", lmid(0, 4) + "\nint main(int argc, char *argv[@]x\n" + lmid(5));
check("4ra", lmid(0, 4) + "\nint main(int argc, char *argv[@]x\n" + lmid(5));
qWarning("FIXME");
{
setup();
move("4j4l", "int @main");
-
+
check("J", lmid(0, 5) + "@ " + lmid(5));
- check("u", lmid(0, 4) + "\nint @main(int argc, char *argv[])\n" + lmid(5));
+ check("u", lmid(0, 4) + "\nint @main(int argc, char *argv[])\n" + lmid(5));
checkEx("redo", lmid(0, 5) + "@ " + lmid(5));
return; // FIXME: not in sync with Gui behaviour?
check("3J", lmid(0, 5) + " " + lmid(5, 1) + "@" + lmid(6).mid(3));
- check("u", lmid(0, 4) + "\nint @main(int argc, char *argv[])\n" + lmid(5));
+ check("u", lmid(0, 4) + "\nint @main(int argc, char *argv[])\n" + lmid(5));
checkEx("redo", lmid(0, 5) + "@ " + lmid(5));
}
-QT =
+QT =
macx:CONFIG -= app_bundle
include(../../../src/shared/cplusplus/cplusplus.pri)
-unix {
+unix {
debug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
release:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
debug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
TEMPLATE = app
-TARGET =
+TARGET =
DEPENDPATH += .
INCLUDEPATH += .
-DEFINES +=
+DEFINES +=
LIBS += Dbghelp.lib dbgeng.lib
// } else
// qDebug() << "SymGetLineFromAddr64 failed w/ error code" << GetLastError();
- // m_currentStackTrace.append(sf);
+ // m_currentStackTrace.append(sf);
// }
//} while (bSuccess);
setupUi(this);
connect(&m_debugger, SIGNAL(debugOutput(const QString&)), SLOT(appendOutput(const QString&)));
- connect(&m_debugger, SIGNAL(debuggeePaused()), SLOT(onDebuggeePaused()));
+ connect(&m_debugger, SIGNAL(debuggeePaused()), SLOT(onDebuggeePaused()));
}
void MainWindow::setDebuggee(const QString& filename)
ZeroMemory(&m_pi, sizeof(m_pi));
DWORD dwCreationFlags = DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS;
- bSuccess = CreateProcess(m_processFileName.utf16(), NULL, NULL, NULL, FALSE,
+ bSuccess = CreateProcess(m_processFileName.utf16(), NULL, NULL, NULL, FALSE,
dwCreationFlags,
NULL, NULL, &si, &m_pi
);
{
QMessageBox::information(m_widget, "Information", info);
}
-
+
void updateStatusBar()
{
int slack = 80 - m_statusMessage.size() - m_statusData.size();
mw.resize(600, 650);
mw.move(0, 0);
mw.show();
-
+
QFont font = widget->font();
//: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
//font.setFamily("Misc");
{
int s = 0;
for (int i = 1; i != 2000; ++i)
- s += i;
+ s += i;
fprintf(stderr, "in plugin test\n");
return s;
}
struct Bar {
Bar() : ob(0) {}
- QObject *ob;
+ QObject *ob;
};
public:
hgg0[11] = 11.0;
hgg0[22] = 22.0;
-
+
QHash<QString, float> hgg1;
hgg1["22.0"] = 22.0;
QHash<QString, Foo> hgg3;
hgg3["22.0"] = Foo(22);
hgg3["33.0"] = Foo(33);
-
+
QObject ob;
QHash<QString, QPointer<QObject> > hash;
hash.insert("Hallo", QPointer<QObject>(&ob));
qDebug() << "qDebug() 1";
qDebug() << "qDebug() 2";
qDebug() << "qDebug() 3";
-
+
std::cout << "std::cout @@ 1\n";
std::cout << "std::cout @@ 2\n";
std::cout << "std::cout @@ 3\n";
gg0[11] = 11.0;
gg0[22] = 22.0;
-
+
QMap<QString, float> gg1;
gg1["22.0"] = 22.0;
{
int s = 0;
for (int i = 1; i != 2000; ++i)
- s += i;
+ s += i;
fprintf(stderr, "in plugin test");
return s;
}
struct Bar {
Bar() : ob(0) {}
- QObject *ob;
+ QObject *ob;
};
public:
hgg0[11] = 11.0;
hgg0[22] = 22.0;
-
+
QHash<QString, float> hgg1;
hgg1["22.0"] = 22.0;
QHash<QString, Foo> hgg3;
hgg3["22.0"] = Foo(22);
hgg3["33.0"] = Foo(33);
-
+
QObject ob;
QHash<QString, QPointer<QObject> > hash;
hash.insert("Hallo", QPointer<QObject>(&ob));
qDebug() << "qDebug() 1";
qDebug() << "qDebug() 2";
qDebug() << "qDebug() 3";
-
+
std::cout << "std::cout @@ 1\n";
std::cout << "std::cout @@ 2\n";
std::cout << "std::cout @@ 3\n";
gg0[11] = 11.0;
gg0[22] = 22.0;
-
+
QMap<QString, float> gg1;
gg1["22.0"] = 22.0;
{
int s = 0;
for (int i = 1; i != 2000; ++i)
- s += i;
+ s += i;
fprintf(stderr, "in plugin test");
return s;
}
TEMPLATE = app
-TARGET =
+TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += console
QT += xml
-PROXMLPATH = ../../../src/plugins/qt4projectmanager/proparser
+PROXMLPATH = ../../../src/plugins/qt4projectmanager/proparser
PROPARSERPATH = $$(QTDIR)/tools/linguist/shared
INCLUDEPATH += $$PROPARSERPATH $$PROXMLPATH
#comment
TEMPLATE = app
-TARGET =
+TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += console
executeCommand("symbol-file filebrowseapp.sym");
//executeCommand("info address CFileBrowseAppUi::HandleCommandL",
- // GdbCB(handleInfoMainAddress));
-
+ // GdbCB(handleInfoMainAddress));
+
executeCommand("-break-insert filebrowseappui.cpp:39");
executeCommand("target remote " + m_adapter->gdbServerName());
executeCommand("-exec-continue");
TEMPLATE = app
MAKEFILE = Makefile.swapendian
-QT = core
+QT = core
HEADERS += \
if (!option.startsWith(QLatin1Char('-')))
break;
if (option.size() != 2)
- return TrkLauncherPtr();
+ return TrkLauncherPtr();
switch (option.at(1).toAscii()) {
case 'v':
verbosity++;