-use QStringLiteral and QLatin1String in the code that is executed multiple times (avoids utf8->utf16 conversions)
-use splitRef when converting parts of qstring to ints to avoid redundant memory allocations -warnings--: remove redundant ';' CCMAIL: notmart@gmail.com
This commit is contained in:
parent
f32677b8e0
commit
db7f198a19
@ -43,13 +43,13 @@ class Application: public QObject
|
|||||||
/**
|
/**
|
||||||
* The name or path of the applications
|
* The name or path of the applications
|
||||||
*/
|
*/
|
||||||
Q_PROPERTY(QString application READ application WRITE setApplication NOTIFY applicationChanged);
|
Q_PROPERTY(QString application READ application WRITE setApplication NOTIFY applicationChanged)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the user wants the application to be running or not.
|
* Indicates whether the user wants the application to be running or not.
|
||||||
* It does not refer to the actual state of the application.
|
* It does not refer to the actual state of the application.
|
||||||
*/
|
*/
|
||||||
Q_PROPERTY(bool running READ running WRITE setRunning NOTIFY runningChanged);
|
Q_PROPERTY(bool running READ running WRITE setRunning NOTIFY runningChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Application(QObject *parent = Q_NULLPTR);
|
Application(QObject *parent = Q_NULLPTR);
|
||||||
|
@ -815,7 +815,7 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
|
|||||||
apiMinor = 0;
|
apiMinor = 0;
|
||||||
apiRevision = 0;
|
apiRevision = 0;
|
||||||
if (!apiVersion.isEmpty()) {
|
if (!apiVersion.isEmpty()) {
|
||||||
QStringList parts = apiVersion.split('.');
|
QVector<QStringRef> parts = apiVersion.splitRef('.');
|
||||||
if (!parts.isEmpty()) {
|
if (!parts.isEmpty()) {
|
||||||
apiMajor = parts.value(0).toInt();
|
apiMajor = parts.value(0).toInt();
|
||||||
}
|
}
|
||||||
|
@ -500,9 +500,10 @@ int AppletInterface::apiVersion() const
|
|||||||
// Look for C++ plugins first
|
// Look for C++ plugins first
|
||||||
auto filter = [](const KPluginMetaData &md) -> bool
|
auto filter = [](const KPluginMetaData &md) -> bool
|
||||||
{
|
{
|
||||||
return md.value("X-Plasma-API") == "declarativeappletscript" && md.value("X-Plasma-ComponentTypes").contains("Applet");
|
return md.value(QStringLiteral("X-Plasma-API")) == QLatin1String("declarativeappletscript")
|
||||||
|
&& md.value(QStringLiteral("X-Plasma-ComponentTypes")).contains(QLatin1String("Applet"));
|
||||||
};
|
};
|
||||||
QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins("plasma/scriptengines", filter);
|
QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("plasma/scriptengines"), filter);
|
||||||
if (plugins.isEmpty()) {
|
if (plugins.isEmpty()) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user