Commit 79dca432 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Hide message after 3 seconds on success

parent 3311fdde
......@@ -17,6 +17,7 @@
#include <KLocalizedString>
#include <KMessageWidget>
#include <QTimer>
KateProjectInfoViewCodeAnalysis::KateProjectInfoViewCodeAnalysis(KateProjectPluginView *pluginView, KateProject *project)
: m_pluginView(pluginView)
......@@ -232,6 +233,13 @@ void KateProjectInfoViewCodeAnalysis::finished(int exitCode, QProcess::ExitStatu
// normally 0 is successful but there are exceptions
m_messageWidget->setMessageType(KMessageWidget::Information);
m_messageWidget->setText(i18np("Analysis on %1 file finished.", "Analysis on %1 files finished.", m_analysisTool->getActualFilesCount()));
// hide after 3 seconds
QTimer::singleShot(3000, this, [this]() {
if (m_messageWidget) {
m_messageWidget->animatedHide();
}
});
} else {
// unfortunately, output was eaten by slotReadyRead()
// TODO: get stderr output, show it here
......
......@@ -12,6 +12,7 @@
#include <QComboBox>
#include <QLabel>
#include <QPointer>
#include <QProcess>
#include <QPushButton>
#include <QTreeView>
......@@ -93,7 +94,7 @@ private:
/**
* information widget showing a warning about missing ctags.
*/
KMessageWidget *m_messageWidget;
QPointer<KMessageWidget> m_messageWidget;
/**
* start/stop analysis button
......
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