- Less warnings when opening a snapcraft project

- Do not allow superuser to open the IDE.

Approved by Zoltan Balogh, ubuntu-sdk-build-bot.
This commit is contained in:
Benjamin Zeller
2016-11-14 16:43:10 +00:00
committed by Tarmac
2 changed files with 11 additions and 2 deletions

View File

@@ -420,7 +420,9 @@ ProjectExplorer::FolderNode *SnapcraftGenericPartNode::createOrFindFolder(const
watches << currentPath.toFileInfo().absoluteFilePath();
}
m_watcher->addPaths(watches);
if (!watches.isEmpty())
m_watcher->addPaths(watches);
return currFolder;
}

View File

@@ -91,6 +91,8 @@
#include <coreplugin/icore.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/types.h>
using namespace Ubuntu;
@@ -123,6 +125,11 @@ bool UbuntuPlugin::initialize(const QStringList &arguments, QString *errorString
defaultFont.setFamily(QStringLiteral("Ubuntu"));
defaultFont.setWeight(QFont::Light);
if (::getuid() == 0) {
criticalError(tr("\nThe Ubuntu SDK can not be used as superuser."));
return false;
}
if (QStandardPaths::findExecutable(QStringLiteral("lxc")).isEmpty()) {
criticalError(tr("\nLxd is not installed properly.\nIt is required for the Ubuntu-SDK-IDE to work."));
return false;
@@ -419,7 +426,7 @@ bool UbuntuPlugin::checkContainerSetup()
case ERR_NO_ACCESS:
//the tool tells us that we have no access to the LXD server
criticalError(tr("The current user can not access the LXD server which is required for the Ubuntu SDK.\n"
"Make sure the user is part of the lxd group and restart the IDE."));
"Make sure the user is part of the lxd group, relogin and restart the IDE."));
break;
case ERR_NO_BRIDGE:
if (Settings::askForContainerSetup()) {