[Merge] lp:~abreu-alexandre/webbrowser-app/single-instance-long-appid into lp:webbrowser-app
Alberto Mardegan
alberto.mardegan at canonical.com
Fri Jul 29 13:55:07 UTC 2016
Review: Approve
LGTM!
Diff comments:
> === modified file 'src/app/single-instance-manager.cpp'
> --- src/app/single-instance-manager.cpp 2016-05-10 14:21:58 +0000
> +++ src/app/single-instance-manager.cpp 2016-07-29 13:36:19 +0000
> @@ -70,7 +80,33 @@
> appDesktopName = appIdParts.first();
> }
>
> - return profilePath + QDir::separator() + appDesktopName;
> + return ProfilePathParts(profilePath + QDir::separator(), appDesktopName);
> +}
> +
> +bool ensureNameProfilePathExists(const QString& profilePath) {
> + QDir profile(profilePath);
> + if (!profile.exists()) {
> + if (!QDir::root().mkpath(profile.absolutePath())) {
> + qCritical() << "Failed to create profile directory,"
> + "unable to ensure a single instance of the application";
> + return false;
> + }
> + }
> + return true;
> +}
> +
> +bool isValidLocalServerNameLength(const QString& serverName) {
localServerNameLengthIsValid or isLocalServerNameLengthValid :-)
> +#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
> + struct ::sockaddr_un addr;
> + const QByteArray encodedServerName =
> + QFile::encodeName(serverName);
> + return (sizeof(addr.sun_path) >= (uint)encodedServerName.size() + 1);
> +#endif
> + return true;
> +}
> +
> +QString localServerNameFromProfilePath(const QString& profilePath) {
> + return QDir(profilePath).absoluteFilePath(QStringLiteral("SingletonSocket"));
> }
>
> }
--
https://code.launchpad.net/~abreu-alexandre/webbrowser-app/single-instance-long-appid/+merge/301490
Your team Ubuntu Phablet Team is subscribed to branch lp:webbrowser-app.
More information about the Ubuntu-reviews
mailing list