~townsend/libertine/1.4.3-release

« back to all changes in this revision

Viewing changes to common/ContainerManager.cpp

  • Committer: Chris Townsend
  • Author(s): Chris Townsend, Larry Price, Stephen M. Webb
  • Date: 2016-10-31 17:20:44 UTC
  • mfrom: (94.157.50 devel)
  • Revision ID: christopher.townsend@canonical.com-20161031172044-74b8604iab6nw1t2
* Use libertine-lxc-manager when starting/stopping a container for libertine-container-manager operations if the session DBus is available.  If not, fallback to l-c-m starting/stopping the container. (LP: #1628587)
* Add a new entry to ContainersConfig for keeping track of running processes in a container. (LP: #1632729)
* libertine-launch: refactored core components of application session management.
* Split out Xmir helper apps into their own package.
* Add support for starting pasted and matchbox for snap based/ containerless apps in U8. (LP: #1637535)
* Add implementation for libertine gui as a system-settings plugin. (LP: #1623946)
* Manually require archive name during archive configuration.
* Add a warning to the top of ContainersConfig.json advising users not to edit the file.
* Missing error dialogs in PackageInfoView when fetching version results in an error.
* Avoid searching for apps based on empty directories.
* Bump version to 1.4.3. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * You should have received a copy of the GNU General Public License
17
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
18
 */
19
 
#include "libertine/ContainerManager.h"
 
19
#include "common/ContainerManager.h"
 
20
 
20
21
#include <QTemporaryFile>
21
22
 
22
23
 
32
33
static const QString RUN_COMMAND_FAILED = QObject::tr("Running command %1 failed");
33
34
static const QString CONTAINER_CONFIGURE_FAILED = QObject::tr("Attempt to configure container %1 failed");
34
35
static const QString SET_DEFAULT_CONTAINER_FAILED = QObject::tr("Attempt to set container as default failed");
 
36
static const QString GENERAL_ERROR = QObject::tr("An error occurred");
35
37
constexpr auto libertine_container_manager_tool = "libertine-container-manager";
36
38
 
37
39
 
66
68
ContainerManagerWorker()
67
69
{
68
70
  connect(&process_, static_cast<void(QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &QObject::deleteLater);
 
71
  connect(&process_,
 
72
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
 
73
          &QProcess::errorOccurred,
 
74
#else
 
75
          static_cast<void(QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
 
76
#endif
 
77
          [=](QProcess::ProcessError) {
 
78
            emit error(GENERAL_ERROR, process_.errorString());
 
79
  });
69
80
}
70
81
 
71
82