Commit 2fbda435 authored by loh tar's avatar loh tar Committed by Christoph Cullmann

DocManager: Don't show load trouble popup messages

Summary:
Since there are fancy "in view" messages which show all loading trouble,
is there no need to fetch and show some error message.

Reviewers: #kate, cullmann, dhaumann, mwolff

Reviewed By: #kate, cullmann

Subscribers: kwrite-devel, #kate

Tags: #kate

Differential Revision: https://phabricator.kde.org/D18117
parent c68eabbb
......@@ -51,7 +51,6 @@ KateDocManager::KateDocManager(QObject *parent)
, m_metaInfos(QStringLiteral("katemetainfos"), KConfig::NoGlobals)
, m_saveMetaInfos(true)
, m_daysMetaInfos(0)
, m_documentStillToRestore(0)
{
// set our application wrapper
KTextEditor::Editor::instance()->setApplication(KateApp::self()->wrapper());
......@@ -446,8 +445,6 @@ void KateDocManager::restoreDocumentList(KConfig *config)
progress.setCancelButton(nullptr);
progress.setRange(0, count);
m_documentStillToRestore = count;
m_openingErrors.clear();
for (unsigned int i = 0; i < count; i++) {
KConfigGroup cg(config, QStringLiteral("Document %1").arg(i));
KTextEditor::Document *doc = nullptr;
......@@ -584,29 +581,13 @@ void KateDocManager::documentOpened()
}
disconnect(doc, SIGNAL(completed()), this, SLOT(documentOpened()));
disconnect(doc, &KParts::ReadOnlyPart::canceled, this, &KateDocManager::documentOpened);
if (doc->openingError()) {
m_openingErrors += QLatin1Char('\n') + doc->openingErrorMessage() + QStringLiteral("\n\n");
// Only set "no success" when doc is empty to avoid close of files
// with other trouble when do closeOrphaned()
if (doc->openingError() && doc->isEmpty()) {
KateDocumentInfo *info = documentInfo(doc);
if (info) {
info->openSuccess = false;
}
}
--m_documentStillToRestore;
if (m_documentStillToRestore == 0) {
QTimer::singleShot(0, this, &KateDocManager::showRestoreErrors);
}
}
void KateDocManager::showRestoreErrors()
{
if (!m_openingErrors.isEmpty()) {
KMessageBox::information(nullptr,
m_openingErrors,
i18n("Errors/Warnings while opening documents"));
// clear errors
m_openingErrors.clear();
}
}
......@@ -198,7 +198,6 @@ private Q_SLOTS:
void slotModChanged(KTextEditor::Document *doc);
void slotModChanged1(KTextEditor::Document *doc);
void showRestoreErrors();
private:
bool loadMetaInfos(KTextEditor::Document *doc, const QUrl &url);
void saveMetaInfos(const QList<KTextEditor::Document *> &docs);
......@@ -212,8 +211,6 @@ private:
typedef QPair<QUrl, QDateTime> TPair;
QMap<KTextEditor::Document *, TPair> m_tempFiles;
QString m_openingErrors;
int m_documentStillToRestore;
private Q_SLOTS:
void documentOpened();
......
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