[Merge] lp:~dandrader/qtubuntu/betterSessionName into lp:qtubuntu

Nick Dedekind nick.dedekind at canonical.com
Wed Jun 1 12:48:06 UTC 2016



Diff comments:

> === modified file 'src/ubuntumirclient/integration.cpp'
> --- src/ubuntumirclient/integration.cpp	2016-04-28 14:44:18 +0000
> +++ src/ubuntumirclient/integration.cpp	2016-06-01 11:59:05 +0000
> @@ -190,6 +195,36 @@
>      u_application_description_set_application_lifecycle_delegate(mDesc, delegate);
>  }
>  
> +QByteArray UbuntuClientIntegration::generateSessionName(QStringList &args)
> +{

Perhaps use QApplication::applicationName first? I actually had a branch for this about a thousand years ago, but it never went anywhere.

> +    // Try to come up with some meaningful session name to uniquely identify this session,
> +    // helping with shell debugging
> +
> +    if (args.count() == 0) {
> +        return QByteArray("QtUbuntu");
> +    } if (args[0].contains("qmlscene")) {
> +        return generateSessionNameFromQmlFile(args);
> +    } else {
> +        // use the executable name
> +        QFileInfo fileInfo(args[0]);
> +        return fileInfo.fileName().toLocal8Bit();
> +    }
> +}
> +
> +QByteArray UbuntuClientIntegration::generateSessionNameFromQmlFile(QStringList &args)
> +{
> +    for (int i = 0; i < args.count(); ++i) {
> +        QString arg = args[i];
> +        if (arg.endsWith(".qml")) {
> +            QFileInfo fileInfo(arg);
> +            return fileInfo.fileName().toLocal8Bit();
> +        }
> +    }
> +
> +    // give up
> +    return "qmlscene";
> +}
> +
>  QPlatformWindow* UbuntuClientIntegration::createPlatformWindow(QWindow* window) const
>  {
>      return const_cast<UbuntuClientIntegration*>(this)->createPlatformWindow(window);


-- 
https://code.launchpad.net/~dandrader/qtubuntu/betterSessionName/+merge/296198
Your team Ubuntu Phablet Team is requested to review the proposed merge of lp:~dandrader/qtubuntu/betterSessionName into lp:qtubuntu.



More information about the Ubuntu-reviews mailing list