From f3f7fa24184a36e7613559c7e23df005379984bf Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Wed, 12 Sep 2012 17:21:02 +0200 Subject: [PATCH] scide: DocManager - report warnings via the status bar Signed-off-by: Tim Blechmann --- editors/sc-ide/core/doc_manager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/editors/sc-ide/core/doc_manager.cpp b/editors/sc-ide/core/doc_manager.cpp index 683dca133..d26d9d728 100644 --- a/editors/sc-ide/core/doc_manager.cpp +++ b/editors/sc-ide/core/doc_manager.cpp @@ -20,6 +20,7 @@ #include "doc_manager.hpp" #include "main.hpp" +#include "main_window.hpp" #include "settings/manager.hpp" #include "../../common/SC_TextUtils.hpp" @@ -134,7 +135,7 @@ Document *DocumentManager::open( const QString & path, int initialCursorPosition info.setFile(cpath); if (cpath.isEmpty()) { - qWarning() << "DocumentManager: Can not open file: canonical path is empty."; + MainWindow::instance()->showStatusMessage(QString("Cannot open file: %1 (file does not exist)").arg(path)); return 0; } @@ -151,7 +152,7 @@ Document *DocumentManager::open( const QString & path, int initialCursorPosition // Open the file QFile file(cpath); if(!file.open(QIODevice::ReadOnly)) { - qWarning() << "DocumentManager: the file" << cpath << "could not be opened for reading."; + MainWindow::instance()->showStatusMessage(QString("Cannot open file for reading: %1").arg(cpath)); return 0; } QByteArray bytes( file.readAll() ); @@ -197,9 +198,10 @@ bool DocumentManager::reload( Document *doc ) QFile file(doc->mFilePath); if(!file.open(QIODevice::ReadOnly)) { - qWarning() << "DocumentManager: the file" << doc->mFilePath << "could not be opened for reading."; + MainWindow::instance()->showStatusMessage(QString("Cannot open file for reading: %1").arg(doc->mFilePath)); return false; } + QByteArray bytes( file.readAll() ); file.close(); -- 2.11.4.GIT