Commit 7742e14a authored by Burak Hancerli's avatar Burak Hancerli 🍻 Committed by Carl Schwan
Browse files

Fix small issues in "Saving and Loading" example

There were a couple of inconsistencies between the example code and the
sub-sections where the code is explained line by line.
parent fd4793a6
......@@ -131,7 +131,7 @@ void MainWindow::saveFileAs()
void MainWindow::saveFile()
if(!fileName.isEmpty()) {
} else {
......@@ -155,13 +155,13 @@ Here we use the [QUrl]( class to handle files f
Then we use the KIO library to retrieve our file. This allows us to open the file normally even if it's stored in a remote location like an FTP site. We make the following call to the [KIO::storedGet](docs:kio;KIO::storedGet) function with an argument for the file you wish to open or download:
const KIO::Job *job = KIO::storedGet(fileNameFromDialog);
KIO::Job *job = KIO::storedGet(fileNameFromDialog);
The function returns a handle to a [KIO::Job](docs:kio;KIO::Job), which we first connect to our `downloadFinished()` slot before "running" the job.
connect(job, &KJob::result, this, &KJob::downloadFinished);
connect(job, &KJob::result, this, &MainWindow::downloadFinished);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment