Skip to content

Commit

Permalink
Show a warning about old docset storage (fixes #317)
Browse files Browse the repository at this point in the history
  • Loading branch information
trollixx committed Apr 19, 2015
1 parent 9604c84 commit a03af64
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <QAbstractEventDispatcher>
#include <QCloseEvent>
#include <QDesktopServices>
#include <QFileInfo>
#include <QKeyEvent>
#include <QMenu>
#include <QMessageBox>
Expand Down Expand Up @@ -319,6 +320,20 @@ MainWindow::MainWindow(Core::Application *app, QWidget *parent) :
ui->treeView->setAttribute(Qt::WA_MacShowFocusRect, false);
ui->sections->setAttribute(Qt::WA_MacShowFocusRect, false);
#endif

/// TODO: Remove in the future releases
// Check pre-0.1 docset path
QString oldDocsetDir = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
oldDocsetDir.remove(QStringLiteral("Zeal/Zeal"));
oldDocsetDir += QLatin1String("zeal/docsets");
if (QFileInfo::exists(oldDocsetDir) && m_settings->docsetPath != oldDocsetDir) {
QMessageBox::information(this, QStringLiteral("Zeal"),
QString(tr("Old docset storage has been found in <b>%1</b>. "
"You can move docsets to <b>%2</b> or change the docset storage path in the settings. <br><br>"
"Please note, that old docsets cannot be updated automatically, so it is better to download your docsets again. <br><br>"
"Remove or use the old docset storage to avoid this message in the future."))
.arg(oldDocsetDir, m_settings->docsetPath));
}
}

MainWindow::~MainWindow()
Expand Down

0 comments on commit a03af64

Please sign in to comment.