Commit Graph

80 Commits

Author SHA1 Message Date
Marco Martin
af861eb2a4 move backgroundhints managment in Applet
Summary:
Applet is the more proper way to do it (and will make easier porting
to KF6) this also make it possible for the scripting interface to
access userBackgroundHints

Test Plan: everything behaves the same in plasmashell, the background button in the handle works

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D25742
2019-12-05 10:41:57 +01:00
David Edmundson
5f746ce1c2 Fix crash on teardown with Applet's ConfigLoader
Summary:
Deleting AppletPrivate will delete the ConfigLoader which will cause a
save, which can trigger a configSaved signal.

I think it is correct that the config might emit a signal just before
closing, and not at fault.

AppletPrivate is deleted by this point, but Applet is not so the
connection is still alive.

When we handle the signal, it goes into a Q_PRIVATE_SLOT that crashes.

This disconnect pattern is already used for guarding self config
changes.

BUG: 411221

Test Plan: kquitapp5 plasmashell, no longer crashes

Reviewers: #plasma, alexeymin

Reviewed By: alexeymin

Subscribers: alexeymin, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23707
2019-09-07 23:19:03 +02:00
Aleix Pol
d3b22f8828 Port trivial connects to the new style 2019-08-30 17:26:54 +02:00
Laurent Montel
f53365633c GIT_SILENT: Use QLatin1String in QString::contains etc. Fix replace
usage
2019-08-29 07:25:48 +02:00
Yuri Chornoivan
72ca2f79e0 Fix minor EBN issues and typos 2018-10-22 21:05:29 +03:00
Laurent Montel
e690c4726e Warning-- 2018-04-13 13:58:44 +02:00
Laurent Montel
d1949d9149 Const'ify, use nullptr 2017-12-25 18:41:50 +01:00
Marco Martin
604aba0e24 reuse KPackage instance between PluginLoader and Applet
Summary:
to minimize metadata lookups, pass the kpackage created in pluginloader
to the applet itself as args. the args structure will be used only by the
internal constructor and applet sublasses will get their args unaltered

Test Plan:
plasma loads correctly, from 3 kpackage instantiation per applet to 2
(last is in the access manager)

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D9123
2017-12-09 10:37:08 +01:00
Aleix Pol
b8b8a69fd1 Remove implicit string casting
Summary: Follow the KF5 guidelines

Test Plan: Plasma shell starts

Reviewers: #plasma, #frameworks, sebas

Reviewed By: #plasma, sebas

Subscribers: plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D9108
2017-12-02 15:44:14 +01:00
Aleix Pol
0ebe2ca1fa Don't enforce metadata.desktop, cleanup constructor
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
2016-10-10 16:28:13 +02:00
Aleix Pol
bd970141ce Simplify plugin construction by relying exclusively on KPluginMetaData
REVIEW: 129057
2016-10-04 23:56:17 +02:00
David Edmundson
048d5243f0 Update applet alternatives menu entry visibility on demand
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.
2016-10-03 01:46:33 +01:00
David Edmundson
22ba8186f0 When marking a containment as deleted, also mark all sub-applets as deleted - fixes system tray container configs not being deleted
This allows a custom applet to do cleanup (like the system tray, to
delete the inner containment)

REVIEW: 128754
2016-08-25 17:48:23 +01:00
Marco Martin
6f5816fc57 ensure the scriptengine is here
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
2016-06-15 11:04:21 +02:00
Ivan Čukić
8bd9e56572 Fixing the force-creation of applets when plasma is immutable
REVIEW:127442
2016-03-20 22:48:57 +01:00
Marco Martin
2661cd701c reintroduce busy property in Applet
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
2016-03-17 18:27:06 +01:00
Marco Martin
6973dac801 add icon/titleChanged
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
2016-03-09 11:34:21 +01:00
Marco Martin
f55e20cc5f properties configurationRequired and reason
unbreak api of Applet::SetConfigurationRequired + add bindings to
appletInterface as properties.
new properties configurationRequired and configurationRequiredReason

Change-Id: I18ff01df94c1a0c5fac79ff801bfa76714c9f986
REVIEW:127218
2016-02-29 14:26:52 +01:00
Aleix Pol
9f62532674 Fix most of Clazy warnings in plasma-framework
REVIEW: 126672
2016-02-29 00:13:41 +01:00
David Edmundson
01cd374c8e Don't emit statusChanged if it hasn't changed
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
2015-12-22 17:32:28 +00:00
Martin Klapetek
76186339f6 [libplasma] Add categorized debug output 2015-12-15 16:56:40 -05:00
Nick Shaforostoff
c7c2980f14 qstring optimizations
REVIEW: 126148
2015-11-27 20:03:48 +00:00
Marco Martin
64fdce2086 Revert "plasma: Fix applet actions might be nullptr"
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
2015-10-07 17:19:13 +02:00
Leslie Zhai
4e9b32d80d plasma: Fix applet actions might be nullptr
BUG:351777
2015-08-26 17:24:29 +08:00
Marco Martin
ea924b1469 port libplasma away from sycoca as much as possible
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
2015-05-07 16:26:37 +02:00
Marco Martin
fac1100fff make sure to not emit immutabilityChanged at startup
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
2015-03-17 19:13:28 +01:00
David Edmundson
e0f6b76f4b Port from deprecated KConfigLoader API
Change-Id: I9fe88d2b0b16dab02e4e35af3d0e992cec0edb91
2015-02-11 14:52:41 +01:00
Marco Martin
a629fe4d8f migrate to KPackage
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
2014-12-29 13:56:52 +01:00
Marco Martin
73500516ff track changes in destroyed()
Change-Id: Ibc4dcc64028e1127dd55e7c7d4d73000d2964dab
2014-10-30 18:06:50 +01:00
Marco Martin
f870ea1a11 drop QwaitingDeletionStatus
emit appletRemoved and appletAdded instead, making the graphics representation
(almost) just work

Change-Id: I481dbbb4dbf7d01a121b92511410dfee79b16469
2014-10-30 18:06:50 +01:00
Marco Martin
2475a2560e really delete awaiting applets on quit
Change-Id: I3b9107f988bde75262f27c1fd7e851b868140ccf
2014-10-28 19:07:09 +01:00
Nicolás Alvarez
8515d0ef09 Fix reference to Types::ImmutabilityType.
I don't know how Types::Types::ImmutabilityType even worked in gcc...
2014-08-30 14:45:50 -03:00
Marco Martin
80516dbef0 framework part of the applet alternatives chooser
this is the little part in plasma-framework for the applet alternatives chooser.
works together the branch mart/alternativesConfig of plasma-workspace and plsma-desktop.
for how it looks and why, see the vdg forum thread:
https://forum.kde.org/viewtopic.php?f=285&t=122067&p=315919#p315919

still possible problems:

I'm not sure about using a new desktop file entry X-Plasma-Provides, maybe Categories could be enough, but it may produce many false positives as well

REVIEW:119409
2014-07-23 12:25:32 +02:00
Marco Martin
2d29445164 set the shortcut to the action
BUG:334855
2014-05-16 10:03:45 +02:00
Eike Hein
1805bb7496 Make sure the args part of Containment::createApplet(..., args) ends up in the applet. 2014-05-06 20:52:42 +02:00
David Edmundson
4ce14a1654 Remove duplicated ConfigLoader
This moved to KConfigGui as KConfigLoader.

Use of private KConfig API in Service had to be ported to use only
public method.

REVIEW: 117784
2014-04-26 17:10:13 +02:00
Kevin Ottens
72ba7b4146 Apply the astyle-kdelibs script 2014-04-26 01:48:37 +02:00
Marco Martin
18f54dff73 make possible for containments to run as applets
take into account the slightly different behaviour needed when containments such as folderview act as a normal plasmoid
BUG:333320
2014-04-14 14:03:49 +02:00
Aleix Pol
9a305de76d Fix activationAction connection
It was connecting to a deprecated signal, use QAction::changed instead.
Since QAction::changed is more generic and modifying the shortcut seems
expensive, actually check that the property is different from the previous
value.

Reviewed by Vishesh Handa.
2014-04-12 20:09:08 +02:00
Marco Martin
767336e87e isContainment() only true for proper containments 2014-04-10 20:53:19 +02:00
Marco Martin
614af69f02 never show the dialog on destroy()
the remove action is now hooked to another slot, askDestroy()
it *MAY* solve the "Do you wish to remove this default desktop" bug, or may get it worse
CCBUG:332137
2014-03-20 19:22:27 +01:00
Marco Martin
cc8de5a789 remove unused variable 2014-03-11 17:07:15 +01:00
Marco Martin
d397358346 Make the delete containment dialog async
a syncronous dialog brings crashes if something gets deleted while the dialog's event loop is in execution
BUG:332027
2014-03-11 17:04:31 +01:00
David Edmundson
fb7451051e Expose globalShortcut in AppletInterface so it can be set from the config 2014-03-05 17:28:50 +01:00
Marco Martin
a0aa88f00d formFactorChanged, locationchanged signals 2014-03-04 18:13:19 +01:00
Marco Martin
12a766795e return the correct immutability 2014-02-17 12:00:24 +01:00
Marco Martin
50a584d0bc rename Applet::activate() with Applet::activated()
activate() is a name that suggests a slot more than a signal
2014-02-14 14:40:53 +01:00
Marco Martin
59dbfeeab6 ask confirmation to delete containments 2014-02-13 15:30:07 +01:00
David Edmundson
ef58fdbf6f Remove Applet::Private::isContainment
Instead determine by introspecting if this inherits from Containment

REVIEW: 114405
2013-12-11 15:50:48 +01:00
Aleix Pol
2cb4ebd6f5 Code cleanup
Remove unused includes
Remove void code logic (KCMUTILS_LIBS was always empty anyway)
2013-11-15 16:56:17 +01:00