Changeset View
Changeset View
Standalone View
Standalone View
addons/gdbplugin/ioview.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 45 | { | |||
---|---|---|---|---|---|
61 | m_output->setFocusProxy(m_input); // take the focus from the output | 61 | m_output->setFocusProxy(m_input); // take the focus from the output | ||
62 | 62 | | |||
63 | QVBoxLayout *layout = new QVBoxLayout(this); | 63 | QVBoxLayout *layout = new QVBoxLayout(this); | ||
64 | layout->addWidget(m_output, 10); | 64 | layout->addWidget(m_output, 10); | ||
65 | layout->addWidget(m_input, 0); | 65 | layout->addWidget(m_input, 0); | ||
66 | layout->setContentsMargins(0,0,0,0); | 66 | layout->setContentsMargins(0,0,0,0); | ||
67 | layout->setSpacing(0); | 67 | layout->setSpacing(0); | ||
68 | 68 | | |||
69 | connect(m_input, SIGNAL(returnPressed()), this, SLOT(returnPressed())); | 69 | connect(m_input, &QLineEdit::returnPressed, this, &IOView::returnPressed); | ||
70 | createFifos(); | 70 | createFifos(); | ||
71 | } | 71 | } | ||
72 | 72 | | |||
73 | IOView::~IOView() | 73 | IOView::~IOView() | ||
74 | { | 74 | { | ||
75 | m_stdin.close(); | 75 | m_stdin.close(); | ||
76 | 76 | | |||
77 | m_stdout.close(); | 77 | m_stdout.close(); | ||
Show All 22 Lines | 91 | { | |||
100 | m_stdoutD.open(QIODevice::ReadWrite); | 100 | m_stdoutD.open(QIODevice::ReadWrite); | ||
101 | 101 | | |||
102 | m_stdout.setFileName(m_stdoutFifo); | 102 | m_stdout.setFileName(m_stdoutFifo); | ||
103 | m_stdoutFD = ::open(m_stdoutFifo.toLocal8Bit().data(), O_RDWR|O_NONBLOCK); | 103 | m_stdoutFD = ::open(m_stdoutFifo.toLocal8Bit().data(), O_RDWR|O_NONBLOCK); | ||
104 | if (m_stdoutFD == -1) return; | 104 | if (m_stdoutFD == -1) return; | ||
105 | if (!m_stdout.open(m_stdoutFD, QIODevice::ReadWrite)) return; | 105 | if (!m_stdout.open(m_stdoutFD, QIODevice::ReadWrite)) return; | ||
106 | 106 | | |||
107 | m_stdoutNotifier = new QSocketNotifier(m_stdoutFD, QSocketNotifier::Read, this); | 107 | m_stdoutNotifier = new QSocketNotifier(m_stdoutFD, QSocketNotifier::Read, this); | ||
108 | connect(m_stdoutNotifier, SIGNAL(activated(int)), this, SLOT(readOutput())); | 108 | connect(m_stdoutNotifier, &QSocketNotifier::activated, this, &IOView::readOutput); | ||
109 | m_stdoutNotifier->setEnabled(true); | 109 | m_stdoutNotifier->setEnabled(true); | ||
110 | 110 | | |||
111 | 111 | | |||
112 | m_stderrD.setFileName(m_stderrFifo); | 112 | m_stderrD.setFileName(m_stderrFifo); | ||
113 | m_stderrD.open(QIODevice::ReadWrite); | 113 | m_stderrD.open(QIODevice::ReadWrite); | ||
114 | 114 | | |||
115 | m_stderr.setFileName(m_stderrFifo); | 115 | m_stderr.setFileName(m_stderrFifo); | ||
116 | m_stderrFD = ::open(m_stderrFifo.toLocal8Bit().data(), O_RDONLY|O_NONBLOCK); | 116 | m_stderrFD = ::open(m_stderrFifo.toLocal8Bit().data(), O_RDONLY|O_NONBLOCK); | ||
117 | if (m_stderrFD == -1) return; | 117 | if (m_stderrFD == -1) return; | ||
118 | if (!m_stderr.open(m_stderrFD, QIODevice::ReadOnly)) return; | 118 | if (!m_stderr.open(m_stderrFD, QIODevice::ReadOnly)) return; | ||
119 | 119 | | |||
120 | m_stderrNotifier = new QSocketNotifier(m_stderrFD, QSocketNotifier::Read, this); | 120 | m_stderrNotifier = new QSocketNotifier(m_stderrFD, QSocketNotifier::Read, this); | ||
121 | connect(m_stderrNotifier, SIGNAL(activated(int)), this, SLOT(readErrors())); | 121 | connect(m_stderrNotifier, &QSocketNotifier::activated, this, &IOView::readErrors); | ||
122 | m_stderrNotifier->setEnabled(true); | 122 | m_stderrNotifier->setEnabled(true); | ||
123 | 123 | | |||
124 | return; | 124 | return; | ||
125 | } | 125 | } | ||
126 | 126 | | |||
127 | void IOView::returnPressed() | 127 | void IOView::returnPressed() | ||
128 | { | 128 | { | ||
129 | m_stdin.write(m_input->text().toLocal8Bit()); | 129 | m_stdin.write(m_input->text().toLocal8Bit()); | ||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |