Merge lp:~zeller-benjamin/ubuntu-sdk-ide/no-superuser into lp:ubuntu-sdk-ide

Proposed by Benjamin Zeller
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 169
Merged at revision: 167
Proposed branch: lp:~zeller-benjamin/ubuntu-sdk-ide/no-superuser
Merge into: lp:ubuntu-sdk-ide
Diff against target: 48 lines (+11/-2)
2 files modified
dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp (+3/-1)
dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp (+8/-1)
To merge this branch: bzr merge lp:~zeller-benjamin/ubuntu-sdk-ide/no-superuser
Reviewer Review Type Date Requested Status
Zoltan Balogh Approve
ubuntu-sdk-build-bot continuous-integration Approve
Review via email: mp+310789@code.launchpad.net

Commit message

- Less warnings when opening a snapcraft project
- Do not allow superuser to open the IDE

Description of the change

- Less warnings when opening a snapcraft project
- Do not allow superuser to open the IDE

To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zoltan Balogh (bzoltan) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp'
--- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp 2016-11-07 11:19:36 +0000
+++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp 2016-11-14 16:00:48 +0000
@@ -420,7 +420,9 @@
420 watches << currentPath.toFileInfo().absoluteFilePath();420 watches << currentPath.toFileInfo().absoluteFilePath();
421 }421 }
422422
423 m_watcher->addPaths(watches);423 if (!watches.isEmpty())
424 m_watcher->addPaths(watches);
425
424 return currFolder;426 return currFolder;
425}427}
426428
427429
=== modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp'
--- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp 2016-11-07 10:48:52 +0000
+++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp 2016-11-14 16:00:48 +0000
@@ -91,6 +91,8 @@
9191
92#include <coreplugin/icore.h>92#include <coreplugin/icore.h>
93#include <stdint.h>93#include <stdint.h>
94#include <unistd.h>
95#include <sys/types.h>
9496
9597
96using namespace Ubuntu;98using namespace Ubuntu;
@@ -123,6 +125,11 @@
123 defaultFont.setFamily(QStringLiteral("Ubuntu"));125 defaultFont.setFamily(QStringLiteral("Ubuntu"));
124 defaultFont.setWeight(QFont::Light);126 defaultFont.setWeight(QFont::Light);
125127
128
129 if (::getuid() == 0) {
130 criticalError(tr("\nThe Ubuntu SDK can not be used as superuser."));
131 return false;
132 }
126 if (QStandardPaths::findExecutable(QStringLiteral("lxc")).isEmpty()) {133 if (QStandardPaths::findExecutable(QStringLiteral("lxc")).isEmpty()) {
127 criticalError(tr("\nLxd is not installed properly.\nIt is required for the Ubuntu-SDK-IDE to work."));134 criticalError(tr("\nLxd is not installed properly.\nIt is required for the Ubuntu-SDK-IDE to work."));
128 return false;135 return false;
@@ -419,7 +426,7 @@
419 case ERR_NO_ACCESS:426 case ERR_NO_ACCESS:
420 //the tool tells us that we have no access to the LXD server427 //the tool tells us that we have no access to the LXD server
421 criticalError(tr("The current user can not access the LXD server which is required for the Ubuntu SDK.\n"428 criticalError(tr("The current user can not access the LXD server which is required for the Ubuntu SDK.\n"
422 "Make sure the user is part of the lxd group and restart the IDE."));429 "Make sure the user is part of the lxd group, relogin and restart the IDE."));
423 break;430 break;
424 case ERR_NO_BRIDGE:431 case ERR_NO_BRIDGE:
425 if (Settings::askForContainerSetup()) {432 if (Settings::askForContainerSetup()) {

Subscribers

People subscribed via source and target branches