diff --git a/kate/katedocmanager.h b/kate/katedocmanager.h --- a/kate/katedocmanager.h +++ b/kate/katedocmanager.h @@ -198,7 +198,6 @@ 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 &docs); @@ -212,8 +211,6 @@ typedef QPair TPair; QMap m_tempFiles; - QString m_openingErrors; - int m_documentStillToRestore; private Q_SLOTS: void documentOpened(); diff --git a/kate/katedocmanager.cpp b/kate/katedocmanager.cpp --- a/kate/katedocmanager.cpp +++ b/kate/katedocmanager.cpp @@ -51,7 +51,6 @@ , 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 @@ 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 @@ } 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(); - } -} -