Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
845ab2c9
Commit
845ab2c9
authored
Jul 30, 2019
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: QLineEdit never returns a NULL string, so we can simplify the code.
parent
58070b21
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
162 deletions
+46
-162
wb/lib/wb/qt/wb_watt_qt.cqt
wb/lib/wb/qt/wb_watt_qt.cqt
+16
-42
wb/lib/wb/qt/wb_wda_qt.cqt
wb/lib/wb/qt/wb_wda_qt.cqt
+10
-33
xtt/exe/rt_xtt/qt/rt_xtt_qt.cqt
xtt/exe/rt_xtt/qt/rt_xtt_qt.cqt
+4
-15
xtt/lib/xtt/qt/xtt_xatt_qt.cqt
xtt/lib/xtt/qt/xtt_xatt_qt.cqt
+8
-31
xtt/lib/xtt/qt/xtt_xattone_qt.cqt
xtt/lib/xtt/qt/xtt_xattone_qt.cqt
+0
-5
xtt/lib/xtt/qt/xtt_xcolwind_qt.cqt
xtt/lib/xtt/qt/xtt_xcolwind_qt.cqt
+8
-36
No files found.
wb/lib/wb/qt/wb_watt_qt.cqt
View file @
845ab2c9
...
...
@@ -210,16 +210,14 @@ void WAttQt::change_value_close()
if (input_multiline) {
char* text = qPrintableLatin1(cmd_scrolled_buffer->toPlainText());
if (text) {
// Replace ctrl characters with space
for (unsigned char* s = (unsigned char*)text; *s; s++) {
if (*s < ' ' && *s != 10 && *s != 13) {
*s = ' ';
}
// Replace ctrl characters with space
for (unsigned char* s = (unsigned char*)text; *s; s++) {
if (*s < ' ' && *s != 10 && *s != 13) {
*s = ' ';
}
wattnav->set_attr_value(input_node, input_name, text);
}
wattnav->set_attr_value(input_node, input_name, text);
statusbar->setMaximumHeight(25);
cmd_scrolledinput->setVisible(false);
set_prompt("");
...
...
@@ -229,16 +227,9 @@ void WAttQt::change_value_close()
wattnav->redraw();
wattnav->set_inputfocus();
if (!text) {
message('E', "Input error, invalid character");
}
} else {
char* text = qPrintableLatin1(cmd_entry->text());
if (text) {
wattnav->set_attr_value(input_node, input_name, text);
}
wattnav->set_attr_value(input_node, input_name,
qPrintableLatin1(cmd_entry->text()));
cmd_entry->setVisible(false);
set_prompt("");
input_open = 0;
...
...
@@ -247,10 +238,6 @@ void WAttQt::change_value_close()
}
wattnav->set_inputfocus();
if (!text) {
message('E', "Input error, invalid character");
}
}
if (pending_close) {
...
...
@@ -261,12 +248,9 @@ void WAttQt::change_value_close()
void WAttQtWidget::activate_cmd_entry()
{
char* text = qPrintableLatin1(watt->cmd_entry->text());
if (watt->input_open) {
if (text) {
watt->wattnav->set_attr_value(watt->input_node, watt->input_name, text);
}
watt->wattnav->set_attr_value(watt->input_node, watt->input_name,
qPrintableLatin1(watt->cmd_entry->text()));
watt->cmd_entry->setVisible(false);
watt->set_prompt("");
watt->input_open = 0;
...
...
@@ -280,10 +264,6 @@ void WAttQtWidget::activate_cmd_entry()
watt->wattnav->set_inputfocus();
if (!text) {
watt->message('E', "Input error, invalid character");
}
if (watt->pending_close) {
close();
}
...
...
@@ -294,16 +274,14 @@ void WAttQtWidget::activate_cmd_scrolled_ok()
if (watt->input_open) {
char* text = qPrintableLatin1(watt->cmd_scrolled_buffer->toPlainText());
if (text) {
// Replace ctrl characters with space
for (unsigned char* s = (unsigned char*)text; *s; s++) {
if (*s < ' ' && *s != 10 && *s != 13) {
*s = ' ';
}
// Replace ctrl characters with space
for (unsigned char* s = (unsigned char*)text; *s; s++) {
if (*s < ' ' && *s != 10 && *s != 13) {
*s = ' ';
}
watt->wattnav->set_attr_value(watt->input_node, watt->input_name, text);
}
watt->wattnav->set_attr_value(watt->input_node, watt->input_name, text);
watt->statusbar->setMaximumHeight(25);
watt->cmd_scrolledinput->setVisible(false);
watt->set_prompt("");
...
...
@@ -314,10 +292,6 @@ void WAttQtWidget::activate_cmd_scrolled_ok()
watt->wattnav->redraw();
watt->wattnav->set_inputfocus();
if (!text) {
watt->message('E', "Input error, invalid character");
}
if (watt->pending_close) {
close();
}
...
...
wb/lib/wb/qt/wb_wda_qt.cqt
View file @
845ab2c9
...
...
@@ -278,16 +278,9 @@ void WdaQt::change_value_close()
wdanav->redraw();
wdanav->set_inputfocus();
if (!text) {
message('E', "Input error, invalid character");
}
} else {
char* text = qPrintableLatin1(cmd_entry->text());
if (text) {
wdanav->set_attr_value(input_node, input_name, text);
}
wdanav->set_attr_value(input_node, input_name,
qPrintableLatin1(cmd_entry->text()));
cmd_entry->setVisible(false);
set_prompt("");
input_open = 0;
...
...
@@ -296,10 +289,6 @@ void WdaQt::change_value_close()
}
wdanav->set_inputfocus();
if (!text) {
message('E', "Input error, invalid character");
}
}
}
}
...
...
@@ -311,22 +300,15 @@ void WdaQtWidget::activate_cmd_entry()
wda->wdanav->set_inputfocus();
char* text = qPrintableLatin1(wda->cmd_entry->text());
if (wda->input_open) {
if (text) {
wda->wdanav->set_attr_value(wda->input_node, wda->input_name, text);
}
wda->wdanav->set_attr_value(wda->input_node, wda->input_name,
qPrintableLatin1(wda->cmd_entry->text()));
wda->cmd_entry->setVisible(false);
wda->set_prompt("");
wda->input_open = 0;
if (wda->redraw_cb) {
(wda->redraw_cb)(wda);
}
if (!text) {
wda->message('E', "Input error, invalid character");
}
}
}
...
...
@@ -335,16 +317,14 @@ void WdaQtWidget::activate_cmd_scrolled_ok()
if (wda->input_open) {
char* text = qPrintableLatin1(wda->cmd_scrolled_buffer->toPlainText());
if (text) {
// Replace ctrl characters with space
for (unsigned char* s = (unsigned char*)text; *s; s++) {
if (*s < ' ' && *s != 10 && *s != 13) {
*s = ' ';
}
// Replace ctrl characters with space
for (unsigned char* s = (unsigned char*)text; *s; s++) {
if (*s < ' ' && *s != 10 && *s != 13) {
*s = ' ';
}
wda->wdanav->set_attr_value(wda->input_node, wda->input_name, text);
}
wda->wdanav->set_attr_value(wda->input_node, wda->input_name, text);
wda->statusbar->setMaximumHeight(25);
wda->cmd_scrolledinput->setVisible(false);
wda->set_prompt("");
...
...
@@ -354,9 +334,6 @@ void WdaQtWidget::activate_cmd_scrolled_ok()
wda->wdanav->redraw();
wda->wdanav->set_inputfocus();
if (!text) {
wda->message('E', "Input error, invalid character");
}
}
}
...
...
xtt/exe/rt_xtt/qt/rt_xtt_qt.cqt
View file @
845ab2c9
...
...
@@ -519,20 +519,9 @@ void XttQtWidget::focusInEvent(QFocusEvent* event)
void XttQtWidget::valchanged_cmd_entry()
{
if (xtt->cmd_entry->text().isEmpty()) {
xtt->cmd_entry->setVisible(false);
xtt->set_prompt("");
xtt->input_open = 0;
xtt->command_open = 0;
xtt->xnav->set_inputfocus();
xtt->message('E', "Input error, invalid character");
return;
}
char* text = qPrintableLatin1(xtt->cmd_entry->text());
if (xtt->input_open) {
int sts = xtt->xnav->set_attr_value(text);
int sts = xtt->xnav->set_attr_value(
qPrintableLatin1(xtt->cmd_entry->text()));
xtt->cmd_entry->setVisible(false);
xtt->set_prompt("");
xtt->input_open = 0;
...
...
@@ -541,7 +530,7 @@ void XttQtWidget::valchanged_cmd_entry()
xtt->message('E', XNav::get_message(sts));
}
} else if (xtt->command_open) {
xtt->xnav->command(
text
);
xtt->xnav->command(
qPrintableLatin1(xtt->cmd_entry->text())
);
xtt->cmd_entry->setVisible(false);
xtt->set_prompt("");
xtt->command_open = 0;
...
...
@@ -815,4 +804,4 @@ XttQt::XttQt(int argc, char* argv[], int* return_sts)
xnav->gbl.advanced_user = 0;
tools_advuser->setVisible(false);
}
}
\ No newline at end of file
}
xtt/lib/xtt/qt/xtt_xatt_qt.cqt
View file @
845ab2c9
...
...
@@ -219,11 +219,8 @@ void XAttQt::change_value_close()
{
if (input_open) {
if (input_multiline) {
char* text = qPrintableLatin1(cmd_scrolled_buffer->toPlainText());
if (text) {
xattnav->set_attr_value(input_node, input_name, text);
}
xattnav->set_attr_value(input_node, input_name,
qPrintableLatin1(cmd_scrolled_buffer->toPlainText()));
statusbar->setMaximumHeight(25);
cmd_scrolledinput->setVisible(false);
...
...
@@ -234,15 +231,9 @@ void XAttQt::change_value_close()
xattnav->redraw();
xattnav->set_inputfocus();
if (!text) {
message('E', "Input error, invalid character");
}
} else {
char* text = qPrintableLatin1(cmd_entry->text());
if (text) {
xattnav->set_attr_value(input_node, input_name, text);
}
xattnav->set_attr_value(input_node, input_name,
qPrintableLatin1(cmd_entry->text()));
cmd_entry->setVisible(false);
set_prompt("");
input_open = 0;
...
...
@@ -251,9 +242,6 @@ void XAttQt::change_value_close()
}
xattnav->set_inputfocus();
if (!text) {
message('E', "Input error, invalid character");
}
}
}
}
...
...
@@ -266,33 +254,22 @@ void XAttQtWidget::activate_cmd_entry()
xatt->xattnav->set_inputfocus();
if (xatt->input_open) {
char* text = qPrintableLatin1(xatt->cmd_entry->text());
if (text) {
xatt->xattnav->set_attr_value(xatt->input_node, xatt->input_name, text);
}
xatt->xattnav->set_attr_value(xatt->input_node, xatt->input_name,
qPrintableLatin1(xatt->cmd_entry->text()));
xatt->cmd_entry->setVisible(false);
xatt->set_prompt("");
xatt->input_open = 0;
if (xatt->redraw_cb) {
(xatt->redraw_cb)(xatt);
}
if (!text) {
xatt->message('E', "Input error, invalid character");
}
}
}
void XAttQtWidget::activate_cmd_scrolled_ok()
{
if (xatt->input_open) {
char* text = qPrintableLatin1(xatt->cmd_scrolled_buffer->toPlainText());
if (text) {
xatt->xattnav->set_attr_value(xatt->input_node, xatt->input_name, text);
} else {
xatt->message('E', "Input error, invalid character");
}
xatt->xattnav->set_attr_value(xatt->input_node, xatt->input_name,
qPrintableLatin1(xatt->cmd_scrolled_buffer->toPlainText()));
xatt->statusbar->setMaximumHeight(25);
xatt->cmd_scrolledinput->setVisible(false);
...
...
xtt/lib/xtt/qt/xtt_xattone_qt.cqt
View file @
845ab2c9
...
...
@@ -85,11 +85,6 @@ int XAttOneQt::set_value()
textutf8 = cmd_entry->text();
}
if (textutf8.isEmpty()) {
message('E', "Input cannot be empty");
return 0;
}
char buff[1024];
int sts = XNav::attr_string_to_value(
atype, qPrintableLatin1(textutf8), buff, sizeof(buff), asize);
...
...
xtt/lib/xtt/qt/xtt_xcolwind_qt.cqt
View file @
845ab2c9
...
...
@@ -279,11 +279,8 @@ void XColWindQt::change_value_close()
{
if (input_open) {
if (input_multiline) {
char* text = qPrintableLatin1(cmd_scrolled_buffer->toPlainText());
if (text) {
xattnav->set_attr_value(input_node, input_name, text);
}
xattnav->set_attr_value(input_node, input_name,
qPrintableLatin1(cmd_scrolled_buffer->toPlainText()));
statusbar->setMaximumHeight(25);
cmd_scrolledinput->setVisible(false);
...
...
@@ -294,15 +291,9 @@ void XColWindQt::change_value_close()
xattnav->redraw();
xattnav->set_inputfocus();
if (!text) {
message('E', "Input error, invalid character");
}
} else {
char* text = qPrintableLatin1(cmd_entry->text());
if (text) {
xattnav->set_attr_value(input_node, input_name, text);
}
xattnav->set_attr_value(input_node, input_name,
qPrintableLatin1(cmd_entry->text()));
cmd_entry->setVisible(false);
set_prompt("");
input_open = 0;
...
...
@@ -311,9 +302,6 @@ void XColWindQt::change_value_close()
}
xattnav->set_inputfocus();
if (!text) {
message('E', "Input error, invalid character");
}
}
}
}
...
...
@@ -326,21 +314,14 @@ void XColWindQtWidget::activate_cmd_entry()
colwind->xattnav->set_inputfocus();
if (colwind->input_open) {
char* text = qPrintableLatin1(colwind->cmd_entry->text());
if (text) {
colwind->xattnav->set_attr_value(
colwind->input_node, colwind->input_name, text);
}
colwind->xattnav->set_attr_value(colwind->input_node, colwind->input_name,
qPrintableLatin1(colwind->cmd_entry->text()));
colwind->cmd_entry->setVisible(false);
colwind->set_prompt("");
colwind->input_open = 0;
if (colwind->redraw_cb) {
(colwind->redraw_cb)(colwind);
}
if (!text) {
colwind->message('E', "Input error, invalid character");
}
return;
}
}
...
...
@@ -348,17 +329,8 @@ void XColWindQtWidget::activate_cmd_entry()
void XColWindQtWidget::activate_cmd_scrolled_ok()
{
if (colwind->input_open) {
char* text = qPrintableLatin1(colwind->cmd_scrolled_buffer->toPlainText());
if (text) {
colwind->xattnav->set_attr_value(
colwind->input_node, colwind->input_name, text);
} else {
colwind->message('E', "Input error, invalid character");
}
colwind->xattnav->set_attr_value(
colwind->input_node, colwind->input_name, text);
colwind->xattnav->set_attr_value(colwind->input_node, colwind->input_name,
qPrintableLatin1(colwind->cmd_scrolled_buffer->toPlainText()));
colwind->statusbar->setMaximumHeight(25);
colwind->cmd_scrolledinput->setVisible(false);
colwind->set_prompt("");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment