This reverts commit 2ed819f37d.
panel loading was completely broken, the patch idea was fine,
but has to be redone and tested better.
CCMAIL:aleixpol@kde.org
We were not looking into the plugin directory when figuring out the applet
path when it's load from an absolute path.
Fixes configmodeltest
REVIEW: 129101
Makes it possible to use plugins that offer a metadata.json file.
Define the service type when falling back to the desktop file parser, so
the type system is proper.
Don't destroy a KPluginMetadata tuple to instanciate it right away.
REVIEW: 129102
Commit 752626ad55 left a code path through
the switch statement where defaultActionsCfg would be an invalid group.
This is semantically correct as there is no relevant actions config for
this type of containment, however we then call methods on it which leads
to an assert in kconfig - and a failing unit test.
REVIEW: 129096
It's reasnoble to expect people to download an applet just before trying
to change an existing applet using the alternatives system.
Therefore doing the check at applet initialisation time is semantically
wrong. Especially as it doesn't just disable the action but also skips
creating it.
Finally this gives a startup performance boost; loading all the applets
metadata takes a small amount of time (~20 milliseconds) not really
noticable when you're doing it once, but it adds up if you're doing it
over multiple applets sequentially.
Show times where 0 is the beginning of the process
Use QDebug to get QVariant's values
Delay constructor print so that we know which class is being constructed
Use QJsonObject instead of going back and forth with QVariantMap
Reviewed by David Edmundson
The svg elements cache isn't really a "configuration" and it's not
something that should be overridden by global config settings.
Loading it as a simple config skips the cascading and saves reparsing
kdeglobals.
REVIEW: 128966
applets will be deleted by the parent, as they are
acontainment's children. by not deleting them by hand
also every signal will be disconnected, not causing appletRemoved
to be emitted, so not causing removal of config
pieces at shutdown, this removes the need of the
explicit disconnect in aboutToQuit from contaiment interface
Change-Id: Iddf6ded60ae849ca03c363be6e736da496310b82
reviewed-by: David Edmundson
The containment's status is the max of all applets.
Unfortunately, HiddenStatus, while semantically lower, has the highest value,
so as soon as there's a hidden applet (eg. pager with just one virtual desktop),
the panel will always auto-hide even when popups are open as its status will be HiddenStatus.
REVIEW: 128301
screen ids are going to not be continuous anymore
as screen id is going to correspond 1:1 to connectors,
it will be possible to have "holes", therefore valid ids
that are bigger than screenNum()
REVIEWED-BY:sebas@kde.org
Change-Id: I1c0b1fb827dba4d95f228d32209403150c089c77
ensure the scriptengine gets created also for c++ applets
that have a valid scriptengine, move the script init
out of applet::init that can be reimplemented.
remove the second appletscript constructor that is
not necessary anymore
REVIEWED-BY: Kai Uwe Broulik
Summary:
The notifications applet installs the .so into the toplevel plugins dir,
and my earlier code removal broke the loading of that applet.
Reviewers: lbeltrame, mart
Reviewed By: mart
Differential Revision: https://phabricator.kde.org/D1851
Summary:
The name of the actual plugin was missing, making the warning rather useless.
Since this is only used within PluginLoader, I added a private function
isPluginVersionCompatible(KPluginLoader), taking code from
Plasma::isPluginVersionCompatible(uint). That one could probably be deprecated,
although no public replacement would be available, just "use PluginLoader".
Test Plan: plasmoidviewer -a org.kde.plasma.digitalclock
Reviewers: mart
Reviewed By: mart
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D1825
Summary:
This code was passing PREFIX/share/plasma/plasmoids/org.kde.desktopcontainment/metadata.desktop
to KPluginLoader (which expects a .so!), which led to warning noise
"Plasma::isPluginVersionCompatible: unversioned plugin detected, may result in instability"
(since that code tries to find a version symbol in the .so).
The reason why KPluginInfo::libraryPath() returns the .desktop file seems
to be a KPluginMetaData misuse, but this is compat code marked as "to be removed"
so I didn't fully debug the KPluginMetaData misuse.
Test Plan: plasmoidviewer -a org.kde.plasma.digitalclock
Reviewers: mart
Reviewed By: mart
Differential Revision: https://phabricator.kde.org/D1827
add a new containment type for use in the systray:
this way it will be able to have a screen number without
actually creating a panel from its own
REVIEW:128118
emergency change: in Qml the name "state" for a property
is reserved for the internal state machine, so any object that
exposes a "state" property on its own would automatically
break the state machine
Like KIconloader, support a Selected state, in IconItem,
as in all generic svgs/framesvg
it replaces the text color with HighlightedText and the
background color with HighlightColor
Change-Id: Id97a527405d2c3feed75a172f05547defdbf440c
REVIEW:127975
license to LGPL2+ as in frameworks licensing policy
The old license in the files was actually wrong, because:
servicejob_p.h : splitted from servicejob.cpp (already 2+)
in 89b71cd9f195da51993533f7fc2329ddc08a7de4
package_p.h: splitted from package.cpp (already 2+)
in 9cb9cfe65e
packagestructure_p.h: created by me in a629fe4d8f
(by copy/paste of the header)
following KIconLoader, use QXmlStreamReader/Writer
here too to replace the svg stylesheet to color
the svg with system colors.
it should be hopefully slightly more efficient
REVIEW:127937
lately the highlight color of plasma became a very
washed-out blue, (since it switched to use the
global system colors) that was because it actually
taken the highlight color (and highlightedText)
from the wrong source.
there is a correct color group in kcolorscheme for
that, that is Selection, take those two colors
from that (also means highlight and highlightedtext
always be the same in all plasma::theme::colorgroups
but that's not a problem)
update test to reflect that
REVIEW:127842
Currently, the "name" key is deleted from plasmarc when you select the
default theme (breeze) in the desktop theme KCM.
This leads to unexpected behaviour: If you set e.g. oxygen as look&feel,
and then set breeze as desktop theme, Plasma actually uses Air (the
default desktop theme in the oxygen l&f) on next login instead of
breeze. In other words, it is impossible to configure breeze as desktop
theme when using a different look&feel as breeze.
This fixes the problem by removing the check whether the default theme
is selected and always writes the "name" config key to plasmarc.
REVIEW: 127698
add named colors for positive (usually green)
neutral(usually yellow) negative(usually red)
foreground objects, such as text or parts of
svg icons/themes
REVIEW:127696
Change-Id: I646306339f1684cdc062da3d3af1489af6092372
we have a color in the Plasma theme "highlight" that is basically
an accent color used around.. but one of the uses is to use it as
a background, such as highlighted text. in that case we don't know
what color would be safe for contrasting on top of it for things
like the highlighted text color (plasma style used the background
color for that, which is incorrect)
REVIEW:127637
Summary:
Avoids a crash and a bogus menu entry.
Current code does not properly handle any resetting, which results
in Applet::hasValidAssociatedApplication() still returning true
when urls have been set to an empty list and the application name
to an empty string.
Also are connections to the "destroyed" signal collected on
repeated set calls.
This patch fixes that.
This fixes "Run the Associated Application" menu entry showing up with widgets.
It also prevents the crash in associatedapplicationmanager.cpp:76, which assumes
url lists to be non-empty:
const QString mimeType = mimeDb.mimeTypeForUrl(i.value().first()).name();
Not happy yet with the signal/slot connection management,
improvement proposals welcome.
Reviewers: mart
Reviewed By: mart
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1372
KIconLoader::global()->theme() might return null. Thus we need to
guard for this case (happens e.g. on build.kde.org).
This results in iconThemeMetadataPath not being set, which is fine
as that condition is handled later on.
CCMAIL: notmart@gmail.com
Reviewed-By: Bhushan Shah
Plasma::Theme emits the applicationPaletteChanged signal after it has fetched the
colors from KColorScheme and scheduled the caches to be nuked. There's no need to do
the same exact thing from every single Svg out there.
This speeds up Plasma picking up color scheme changes significantly and is now
on a par with other opened applications.
REVIEW: 127426
both the comic and weather applet have to pick out the
_plasma_graphicsObject to access the AppletInterface
object just to set the busy property on it.
this reintroduces the busy proeprty in Applet too,
both setting it to Applet or AppletInterface
will keep them in sync
REVIEW:127411
Makes it possible for plasmoids to test themselves in the different shells
by providing API to extract the object that will test the plasmoid
instance.
REVIEW: 127345
so much for removing sytray-related hacks.. :/
when the widgets are locked, must be possible to add/remove
widgets in the sytemtray anyways, as their creation/destruction
can depend from dbus activation (or the first time you launch
plasma with the new systray and it must be populated)
Change-Id: I8095ebf831ae57e1306a4d623b253c2a10ef219f
REVIEW:127373
make it possible to set icon and title from
the Applet subclass, making appletInterface (so plasmoid obj)
notice about the change and relay the notify signal
PluginLoader::loadApplet works both by passing a simple plugin
name and a full path of a plasmoid package.
However, when loading the optional C++ plugin, we have to look
in the standard plasmoid plugin path, so only consider the
tail of the path name, as is guaranteed that part is equal to
the plugin name.
BUG:359902
Change-Id: Ic7300b7c12d7693bcb5590e29de780109a8ff81c
unbreak api of Applet::SetConfigurationRequired + add bindings to
appletInterface as properties.
new properties configurationRequired and configurationRequiredReason
Change-Id: I18ff01df94c1a0c5fac79ff801bfa76714c9f986
REVIEW:127218
Applet contains the menu actions, therefore reloading the menu should
happen in Applet not AppletInterface. With AppletInterface being a dumb
wrapper.
This exposes functionality to anyone who overrides Applet, but also will
also allows system tray to emit this signal without having to use
private API.
Change-Id: I95e65de315744a78a82ebba2a954e4f3ae1bd7b2
REVIEW: 127217
svgElementsCache may be created on render thread and deleted
on main thread, which will make KSharedConfig crash because
it uses per-thread storage.
BUG: 359539
REVIEW: 127112
Deprecated: use Containment::createApplet instead,
you are not supposed to have applets without containments
Change-Id: I5e73335523687969918a71e56eaa3124d779ee74
https://git.reviewboard.kde.org/r/126459/ introduced new
flag that allows to skip the grouping of notifications.
This should fix all bugs caused by checking for appName
being "plasma_workspace" which are all default notifications
from any plasmoid.
CCBUG: 356653
REVIEW: 126461
(this also needs to raise the KF5 dep to 5.18 which is
normally done at release time, but in order to use this
now, it needs to be bumped now, otherwise build failures
will ensue)
It has a timer that wakes up every 2 seconds and drains my battery just
simply because I have debug builds. This make it on demand.
Don't track containments twice.
Containments inherit from Applets which also have the same line
Change-Id: Ia9a9b58a0b1197083d692c58e4ce75838c311db4
REVIEW: 126472
Self-hiding plasmoid is useful https://forum.kde.org/viewtopic.php?f=83&t=39501
for example, bluetooth plasmoid can be totally hided when there is NO bluetooth
adpater available.
PassiveStatus is NOT enough, because plasma-workspace's systemtray applet ONLY
hide the passive status plasmoid into ExpandedRepresentation. when click the
expanding triangle, the 'hidden' plasmoid is still visible.
So I added HiddenStatus and implemented it in the plasma-workspace systemtray
applet.
REVIEW: 126297
For some applets the status is bound to a complex expression that can be
re-evaluated a lot. This ends up causing a lot of unnecassary updates.
REVIEW: 126471
ContainmentPrivate::createApplet may return null pointer
(eg. when desktop is immutable), so check the pointer before
emitting appletCreated.
REVIEW: 126449
BUG: 356428
Plasma framework's FrameSVG class uses cached regions for efficiency. However
Coverity caught a mis-use of QCache in FrameSvg::mask(), which could lead to a
use-after-free situation. (CID 1291560)
Basically, any pointer passed into QCache::insert must be assumed to be deleted
after insert() has been called -- we can't then return that pointer to the
caller.
Moreover we were simply returning a pointer to calling code that had been (and
still would be) owned by QCache, which is unsafe as it can be deleted at any
time. The fix in both cases is to make a local copy of the QRegion from out of
the cache and return that.
REVIEW:126411
FIXED-IN:5.18
Should help in the future if there are similar problems like the recent
one when Plasma wouldn't load because it failed to load the ScriptEngine
and nobody knew why it fails to load.
plasma-scriptengine.desktop defines the property "X-Plasma-
ComponentTypes" as Type=QStringList. When reading it using
KPluginMetaData::value(..) it expects a QString back. This
used to work but regressed in kcoreaddons in commit
cfd18cf09b559a050fd6a2680ad4e71eeb950383.Making it read the
property as a stringlist works and is correct and also fixes
Plasma startup.
REVIEW: 126320
the CompactApplet file from the shell package
defines the behavior of the poopup applets in
the panel (it implements an internal dialog
and all that jazz)
implementing a simplified systray(both the one
for the phone and a separate one for the desktop),
i noticed that a containment may have different
ideas on how to expand an applet: the systray would
have for instance a single popup dialog and put all
of its applet full representtions in the same Dialog,
this lets containment representation to override
that file (*if* won't get abused, that's the only
thing makes me a bit on the fence about this)
It would make possible also fairly different designs
that have been proposed in the past, such as the bug
sidebar similar to the "charm bar"
Have to keep an eye opened if having the file list
changing with the path may be an issue, but
shouldn't as ChangeableMainScript already does
something similar.
Change-Id: I1c7fda55d6829d3a67f511c91822b131dea85ac1
REVIEW:126244
since seems there are so many event filters installed
on the QApplication installed that may give performanc
issues, try to use separate, singleton watchers for them
to decrease the amount of eventfilters called
REVIEW:126113
since this is a blind connect to a slot that may exist
or not exist, the new syntax can't be used, but check
for the slot existence before attempting a connection
BUG:354751
-use splitRef when converting parts of qstring to ints to avoid redundant memory allocations
-warnings--: remove redundant ';'
CCMAIL: notmart@gmail.com
This makes IconItem try to load global icons from the theme
with Plasma::Svg as well, making it assign the colors from
the stylesheet if the breeze monochrome icons are treated,
that should be scriptable, from some attempts i did the
script seems to convert them correctly, without any
change in rendering.
This will automatically color monochrome breeze icons only
in plasmashell, and more specifically only those that use
IconItem, not QIconItem (iconitem should probably have an
animation-less mode to be able to be used in taskmanager
and stuff)
perhaps in the future we'll be able somehow to hook all
this stuff in QIconEngine to be able to use it in QWidget
applications, but since QIcon does have any idea where it is,
is not usable yet for things like the fullscreen fixed-dark
gwenview view.
Change-Id: I28e5fedabafbe8ed82a9df7614f8e2af18c6a24d
REVIEW:125657
appletCreated is different from appletAdded because it gets
emitted only when the user explicitly creates one, so not in
case of an applet migrating and not during restore
needed by https://git.reviewboard.kde.org/r/125562/
REVIEW:125569
Change-Id: I1db9286beb160391c13f1aca0ac48ed490495ea2
This reverts commit 4e9b32d80d.
doesn't fix the problem and just introduces a memleak
(the crash is actually about a deleted containment,
so the problem is somewhere else)
CCMAIL:xiangzhai83@gmail.com
restore a feature from Plasma4, the ability for plasmoids to provide
an icon insude their package.
intended for GHNS plasmoids,
already used in the widget explorer, this makes it the default
plasmoid icon as runtime as well.
Change-Id: I196897eeedbe0c385c2795ab73c278f7c837221d
REVIEW:125336
We can not generate proper PluginInfo most likely because metadata was
not valid, printing metadata itself will not be useful and will result
in printing message like,
Could not load plugin info for plugin : "" skipping plugin
Which is 0% useful.
solves some highdpi issues
saves and reads natural sizes separed by scalefactor
so they don't get mixed up when the scaefactor changes
resulting in wrongly sized items
reviewed-by:David Edmundson <david@davidedmundson.co.uk>
Only the background contrast effect provides real contrast for contents, the blur effect
doesn't improve readability that much; so we now use the translucent theme only when we
have the background contrast effect. This significantly improves readability.
CHANGELOG: An opaque theme is now used when only the blur effect is available
REVIEW: 124039
BUG: 342934
BUG: 348154
QMimeType::aliases() does not return the main mimetype in the returned
list and so when there are no aliases for a mimetype, there would be no
associated application found as it would be querying for empty mimetype.
This now always prepends the current mimetype to the list for which the
apps are queried.
REVIEW: 123779
BUG: 340326
FIXED-IN: 5.11
CHANGELOG: Fix AssociatedApplicationManager lookup when a mimetype has
no aliases
Change-Id: I322b03f2ac17fa4c0eb70fc3354c65a0f7a5e34c
With the same mechanism as plasma 1, add the possibility to load kcms directly
in the plasmoids config windows. this works only for qml based ones.
the apply enable and trigger is correctly wired between the config dialog
and kcm apis.
Change-Id: I66b5ab2253dcbb5f223b5dcf5616efc9d5aab274
REVIEW:123673
this ports most of libplasma away from sycoca, using instead
a combination of KPluginLoader and KPackage::PackageLoader instead
(so eventually using their own little caches instead of the
global sycoca cache)
a kservicetypetrader call is left in the loading of
containmentactions since is the only way to make an older
workspace still work, but is only a fallback, so containmentactions
in plasma-workspace can be ported eventually as well
Change-Id: Ie9579c3e01284f6d97043e22d01bbe63d3c3f45a
REVIEW:123626
KPluginLoader has all the needed machinery to identify a plugin by its
pluginId. No need to use the query parser here, replace it with a
lambda.
Look for C++ dataengines first. These are much more common, especially
in essential cases. By looking up the plugins through KPluginLoader
first, we can save querying ksycoca.
REVIEW:123297
CHANGELOG:Use KPluginLoader instead of ksycoca for loading C++ dataengines
if the immutability doesn't actuall change at startup,
don't emit immutabilityChanged even tough each applet needs
one ImmutableConstraint at start to correctly initialize
stuff
Change-Id: Id1fd40ffd62c09a2b092d13d7fb4c556cfb34994
rectSaveTimer is used to event compress the save and sync of the
configuration file that is used as a cache of the rectangles of
svg items (in order to avoid svg renderers creation when possible)
there is exactly one situation where it seems to not work: during
creation of svgitems/framesvgitems, insertintorectcache ends up
being called by another thread than the Theme's qobject thread,
and that is not allowed.
with invokeMethod the timer will be started by the correct thread
REVIEW:122915
Change-Id: I3ff4a4ebd1dfdba4b9b830fe6c08feece19b903e
when QT_DEVICE_PIXELRATIO is something different from 1,
the pixmaps generated by Svg will be scaled up to give a proper texture.
This is complementary but not replacing our current approach:
the pixelratio that can be accessed by units is now in relation to the qt pixel ratio,
spacings are also adjusted accordingly (therefore, spaces and sizes won't
need an integer value like pixelratio)
svg introduces also a scaleFactor property (that is pretty much like its old pixelRatio)
basically, scalefactor, will scale both the textures and all the reported sizes,
(old method) pixelratio just scales textures without altering measures
(like qt pixelratio likes)
Change-Id: I304aa0d80abf76abafac239be185dd3b2ab741b7
REVIEW:122673
Adds a X-Plasma-Requires property for the plasmoid metadata files that will
specify the features.
Furthermore, adds a feature called ExternalScripts so that a plasmoid can
request to load files that are outside of the import directories.
REVIEW: 122595
It might not have caught up yet when we decide to nuke the cache, resulting in
the translucent graphics staying when disabling blur or switching to XRender.
Changelog: Fix Plasma popups being hard to read tue to translucent background
REVIEW: 122676
BUG: 344179
fallback to empty Applet/containment if an inexisting library
was specified in the metadata file.
this fixes old applets with incorrect metadata
BUG:344281
Change-Id: I0efc9dc32dee0e6fe4f3757065004a19f6e01844
make possible for an applet to be implemented in c++ but still
have the qml package with the usual api, this was supposed to
be supported from the beginning.
if a c++ applet has been loaded, make available the property
plasmoid.nativeInterface to the qml part, exposing the subclasses
Applet instance with all eventual extra propertiels/slots.
if no c++ plugin is present, appletInterface will be dummy/not available
this (besides limiting a bit the qml import rabbit procreation)
makes available some things not available to normal private imports:
* access to applet config() to save more complex things compared to what kconfigxt allows
or save/load stuff from the c++ part
* access to containment()/corona(), may be useful for containment implementations
* easier port for old very big applets such as comics/weather
Change-Id: I65117660043de3a60ad58c77b086f686683d4d8c
This allows being able to change just the alignment, which can happen, since
the order of QML bindings being re-evaluated is non-deterministic
REVIEW: 122593
Installing the Plasma directory (which contains the CamelCase forwarding
headers) breaks on case-insensitive filesystems (eg: Windows) because it
is that directory also contains the lowercase build-time-only forwarding
headers (they are put in the plasma directory). These then overwrite the
real lowercase headers with ones that forward to the source directory.
However, the first argument to ecm_generate_headers is a variable name
containing exactly the CamelCase headers that should be installed,
avoiding this issue rather neatly.
Reviewed-by: Patrick von Reth
make hint-apply-color-scheme work (kiconeffect based coloring),
and make sure the kcolorschemes are reloaded when app palette changes
and the theme follows system colors
BUG:343389
Change-Id: I0a7a7eb0f89ed0948e618f1d608521f235aa1959
make hint-apply-color-scheme work (kiconeffect based coloring),
and make sure the kcolorschemes are reloaded when app palette changes
and the theme follows system colors
BUG:343389
Change-Id: I0a7a7eb0f89ed0948e618f1d608521f235aa1959
when an applet or cont is deleted, when invisible has systemimmutable as
its immutability (then restored to mutable if restored)
notify correctly the change
BUG:342704
Change-Id: Iea37fd287d6b120e161f5ac7ad4a17a078fec9bb
when a deleted applet of a deleted panel
gets undeleted, undetele before the panel itself
that's the safest and most "expected" outcome
BUG:343096
Change-Id: Iece7710028052b2118f590377fd39e3c78279b11
Plasma::Package internally uses KPackage, being a pure wrapper.
old client code and old packagestructures still work using the wrapper.
old workspace code that is not directly using kpackage continues to work correctly
Change-Id: I05f95e8d05e3b67759973c4009e3753c61b1dcce
A single Plasma theme will be represented by one ThemePrivate object,
which is exported in multiple Theme objects.
We want to save the cache when that theme stops being used, not each
time an item stops using the theme.
saveSvgElementsCache calls sync() which involves a lot of parsing and
IO. This makes everything a lot faster at no cost.
Change-Id: Ica6ba0273bc99fb8ad8733a1c90db8f1e87c49ea
some of the behavior of the theme has changed.
this makes some of the old themes to not work correctly
(like black text on black)
read a version number of the "plasma version this theme has been intended for"
and use it to change the behavior for retrocompatibility
(all themes that don't export this are assumed to be from KDE4)
Change-Id: I4bc20a0c10de9f9a6c3facd63b6c5b6da210039a
add a property in Svg (and framesvgitem) to tell if the current theme
has this image, or if some fallback did happen
useful for items that are better not displayed than showing the potentially different
default theme
Change-Id: Ib914c0e196c5c941d35d9a600cc7d38818fc754f
As with containment, make sure Containment::applets()
is always sorted by id, to have the least sursprises possible
it adds a test
Change-Id: Ib1aeeff7c70bb6969b32b2fef8557889a43edf09
the order in which containments were restored used to be quite random:
ensure that's ordered by id this makes the shell startups be more reproduceable
from one to another, if a new containment arrives, ensure it's inserted
maintaining id order
containment::appelts() will need the same treatment
adds a test as well that checks the order is right
Change-Id: Ie1b278e5b83d7e3645f7293bf6d030aa7f43a221
if a containment's lastScreen is not -1 (and a valid screen)
*and* its activity() is not the current one, its QML
will *not* be loaded, therefore it would dangle blocking
corona::startupCompleted until the activity is selected
Change-Id: I6757d29240a012377e9ff0a22fe16541ea712ee6
Containments with no applets will emit uiReady now
It adds a test as well that checks if this is the case.
There is still a case where the corona doesn't emit startupCompleted()
that's when there is more than one activity, but that, as well the test
will be adressed by another patch on a different part.
Change-Id: I4d83aa612c29fb0f441d11681bc5aba241370bc3