Your ROOT_URL in app.ini is https://scm.trinitydesktop.org/gitea/ but you are visiting https://scm.trinitydesktop.net/gitea/TDE/tdevelop/src/commit/d5fa554b1f75e73d3873fdaea7ef4dd1c68be69f/languages/cpp/debugger/debuggertracingdialog.cpp You should set ROOT_URL correctly, otherwise the web may not work correctly.
tdevelop/languages/cpp/debugger/debuggertracingdialog.cpp

107 lines
3.3 KiB

#include "debuggertracingdialog.h"
#include "breakpoint.h"
#include <tqbutton.h>
#include <tqlabel.h>
#include <tqcheckbox.h>
#include <klineedit.h>
#include <keditlistbox.h>
#include <kmessagebox.h>
namespace GDBDebugger
{
DebuggerTracingDialog
::DebuggerTracingDialog(Breakpoint* bp,
TQWidget* parent, const char* name)
: DebuggerTracingDialogBase(parent, name), bp_(bp)
{
expressions->setButtons(KEditListBox::Add | KEditListBox::Remove);
connect(enable, TQT_SIGNAL(stateChanged(int)),
this, TQT_SLOT(enableOrDisable(int)));
connect(enableCustomFormat, TQT_SIGNAL(stateChanged(int)),
this, TQT_SLOT(enableOrDisableCustomFormat(int)));
enable->setChecked(bp_->tracingEnabled());
expressions->setItems(bp_->tracedExpressions());
enableCustomFormat->setChecked(bp_->traceFormatStringEnabled());
customFormat->setText(bp_->traceFormatString());
enableOrDisable(enable->state());
}
void DebuggerTracingDialog::enableOrDisable(int state)
{
bool enable = (state == TQButton::On);
expressionsLabel->setEnabled(enable);
expressions->setEnabled(enable);
enableCustomFormat->setEnabled(enable);
customFormat->setEnabled(enable && enableCustomFormat->isOn());
}
void DebuggerTracingDialog::enableOrDisableCustomFormat(int state)
{
customFormat->setEnabled(state == TQButton::On);
}
void DebuggerTracingDialog::accept()
{
// Check that if we use format string,
// the number of expression is not larget than the number of
// format specifiers
bool ok = true;
if (enableCustomFormat->isOn())
{
TQString s = customFormat->text();
unsigned percent_count = 0;
for (unsigned i = 0; i < s.length(); ++i)
if (s[i] == '%')
{
if (i+1 < s.length())
{
if (s[i+1] != '%')
{
++percent_count;
}
else
{
// Double %
++i;
}
}
}
if (percent_count < expressions->items().count())
{
ok = false;
KMessageBox::error(
this,
"<b>Not enough format specifiers</b>"
"<p>The number of format specifiers in the custom format "
"string is less then the number of expressions. Either remove "
"some expressions or edit the format string.",
"Not enough format specifiers");
}
}
if (ok)
{
bp_->setTracingEnabled(enable->isOn());
bp_->setTracedExpressions(expressions->items());
bp_->setTraceFormatStringEnabled(enableCustomFormat->isOn());
bp_->setTraceFormatString(customFormat->text());
DebuggerTracingDialogBase::accept();
}
}
}
#include "debuggertracingdialog.moc"