Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable save result to file #42

Merged
merged 2 commits into from
Feb 2, 2024
Merged

enable save result to file #42

merged 2 commits into from
Feb 2, 2024

Conversation

MartinKT
Copy link
Collaborator

No description provided.

@MartinKT MartinKT requested a review from fvacek January 19, 2024 16:31
@MartinKT MartinKT self-assigned this Jan 19, 2024
shvspy/src/texteditdialog.cpp Outdated Show resolved Hide resolved
shvspy/src/mainwindow.cpp Outdated Show resolved Hide resolved
@MartinKT MartinKT force-pushed the save-result-to-file branch from 0b40e4f to 03c194d Compare January 19, 2024 17:49
@syyyr
Copy link
Collaborator

syyyr commented Jan 19, 2024

Díky za opravy

@syyyr
Copy link
Collaborator

syyyr commented Jan 19, 2024

Ty faily na clazy clang-tidy ignorujte teď, je to bug

@@ -420,8 +420,14 @@ void MainWindow::displayValue(const shv::chainpack::RpcValue &rv)
view->setAttribute(Qt::WA_DeleteOnClose);
view->setWindowIconText(tr("Result"));
view->setReadOnly(true);
std::pair<const char *, size_t> data = rv.asData();
view->setText(QString::fromUtf8(std::get<0>(data), std::get<1>(data)));
auto rv_data = rv.asData();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

		auto [blob, size] = rv.asData();
		auto data = QByteArray::fromRawData(blob, size);

is more readable

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opraveno, super tip.

@MartinKT MartinKT force-pushed the save-result-to-file branch from 03c194d to 3994b14 Compare January 22, 2024 11:31
@fvacek fvacek merged commit fa91bbe into master Feb 2, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants