diff options
author | Alex Zolotarev <deathbaba@gmail.com> | 2011-07-03 19:47:31 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:20:29 +0300 |
commit | adde2107d1effebd18358b60bc190c7bd4e5d75b (patch) | |
tree | c32e80f0f03c999ed3738e3331ae45b00a037ee5 /qt/mainwindow.cpp | |
parent | 1f30f7f693ac1d66c3cfd66413f6bb78be256479 (diff) |
Removed Platform::ReadPathForFile
Diffstat (limited to 'qt/mainwindow.cpp')
-rw-r--r-- | qt/mainwindow.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/qt/mainwindow.cpp b/qt/mainwindow.cpp index 72d240874f..e46355bf40 100644 --- a/qt/mainwindow.cpp +++ b/qt/mainwindow.cpp @@ -94,16 +94,21 @@ MainWindow::MainWindow() if (bShow) { - QFile welcomeTextFile(GetPlatform().ReadPathForFile("welcome.html").c_str()); - bool bShowUpdateDialog = true; - if (welcomeTextFile.open(QIODevice::ReadOnly)) + string text; + try { - QByteArray text = welcomeTextFile.readAll(); - welcomeTextFile.close(); + ReaderPtr<Reader> reader = GetPlatform().GetReader("welcome.html"); + reader.ReadAsString(text); + } + catch (...) + {} - InfoDialog welcomeDlg(tr("Welcome to MapsWithMe!"), text, this, QStringList(tr("Download Maps"))); + if (!text.empty()) + { + InfoDialog welcomeDlg(tr("Welcome to MapsWithMe!"), text.c_str(), + this, QStringList(tr("Download Maps"))); if (welcomeDlg.exec() == QDialog::Rejected) bShowUpdateDialog = false; } |