QbsProjectManager: Display qbs errors for adding and removing files.

If the operation fails, people currently don't get any hint as to what
the reason could be. For lack of a better place, log the error message
to the General Messages pane.

Change-Id: I19c48bbee0e0030b2d542425d43c089a29600756
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Christian Kandeler
2014-07-11 10:56:26 +02:00
parent e7b07a2b36
commit 5e8bd53a79

View File

@@ -35,6 +35,7 @@
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/idocument.h>
#include <coreplugin/messagemanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <qtsupport/qtsupportconstants.h>
@@ -125,6 +126,7 @@ static bool addQbsFiles(QbsBaseProjectNode *node, const QStringList &filePaths,
foreach (const QString &path, filePaths) {
qbs::ErrorInfo err = prj.addFiles(productData, groupData, QStringList() << path);
if (err.hasError()) {
Core::MessageManager::write(err.toString());
*notAdded += path;
} else {
allPaths += path;
@@ -144,6 +146,7 @@ static bool removeQbsFiles(QbsBaseProjectNode *node, const QStringList &filePath
foreach (const QString &path, filePaths) {
qbs::ErrorInfo err = prj.removeFiles(productData, groupData, QStringList() << path);
if (err.hasError()) {
Core::MessageManager::write(err.toString());
*notRemoved += path;
} else {
allPaths.removeOne(path);