8000 Don't discard result from QFile::open by nicolasfella · Pull Request #261 · qcoro/qcoro · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Don't discard result from QFile::open #261

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

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/background-task/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ auto backgroundTask(const Stop &stop) -> QCoro::Task<> {
co_await QCoro::sleepFor(0ms);
qDebug() << "Task: Event loop is running";
QFile file(QStringLiteral("/dev/stdin"));
file.open(QIODevice::ReadOnly | QIODevice::Unbuffered);
bool openResult = file.open(QIODevice::ReadOnly | QIODevice::Unbuffered);
Q_UNUSED(openResult);
while (!stop.stopRequested()) {
qDebug() << "Task: Waiting for input...";
const auto result = co_await qCoro(file).readLine(1024, 5s);
Expand Down Expand Up @@ -65,4 +66,4 @@ int main(int argc, char **argv)
qDebug() << "App: Background task completed";

return result;
}
}
Loading
0