KDE/kdelibs/plasma

2011-01-16 Thread Aaron J . Seigo
SVN commit 1214926 by aseigo:

QString is not thread-safe; since the matches get shuttled around between 
threads, we need to protect access to it. as writing is rare, this should 
hopefully not degrade performance too much. if it passes testing, then i will 
backport this.
CCBUG:238556
CCMAIL:plasma-devel@kde.org


 M  +37 -0 querymatch.cpp  


--- trunk/KDE/kdelibs/plasma/querymatch.cpp #1214925:1214926
@@ -21,6 +21,7 @@
 
 #include QAction
 #include QIcon
+#include QReadWriteLock
 #include QSharedData
 #include QStringList
 #include QVariant
@@ -38,6 +39,7 @@
 public:
 QueryMatchPrivate(AbstractRunner *r)
 : QSharedData(),
+  lock(new QReadWriteLock(QReadWriteLock::Recursive)),
   runner(r),
   type(QueryMatch::ExactMatch),
   relevance(.7),
@@ -47,6 +49,30 @@
 {
 }
 
+QueryMatchPrivate(const QueryMatchPrivate other)
+: QSharedData(other),
+  lock(new QReadWriteLock(QReadWriteLock::Recursive))
+{
+QReadLocker lock(other.lock);
+runner = other.runner;
+type = other.type;
+relevance = other.relevance;
+selAction = other.selAction;
+enabled = other.enabled;
+idSetByData = other.idSetByData;
+id = other.id;
+text = other.text;
+subtext = other.subtext;
+icon = other.icon;
+data = other.data;
+}
+
+~QueryMatchPrivate()
+{
+delete lock;
+}
+
+QReadWriteLock *lock;
 QWeakPointerAbstractRunner runner;
 QueryMatch::Type type;
 QString id;
@@ -116,16 +142,19 @@
 
 void QueryMatch::setText(const QString text)
 {
+QWriteLocker locker(d-lock);
 d-text = text;
 }
 
 void QueryMatch::setSubtext(const QString subtext)
 {
+QWriteLocker locker(d-lock);
 d-subtext = subtext;
 }
 
 void QueryMatch::setData(const QVariant  data)
 {
+QWriteLocker locker(d-lock);
 d-data = data;
 
 if (d-id.isEmpty() || d-idSetByData) {
@@ -139,6 +168,7 @@
 
 void QueryMatch::setId(const QString id)
 {
+QWriteLocker locker(d-lock);
 if (d-runner) {
 d-id = d-runner.data()-id();
 }
@@ -152,26 +182,31 @@
 
 void QueryMatch::setIcon(const QIcon icon)
 {
+QWriteLocker locker(d-lock);
 d-icon = icon;
 }
 
 QVariant QueryMatch::data() const
 {
+QReadLocker locker(d-lock);
 return d-data;
 }
 
 QString QueryMatch::text() const
 {
+QReadLocker locker(d-lock);
 return d-text;
 }
 
 QString QueryMatch::subtext() const
 {
+QReadLocker locker(d-lock);
 return d-subtext;
 }
 
 QIcon QueryMatch::icon() const
 {
+QReadLocker locker(d-lock);
 return d-icon;
 }
 
@@ -206,6 +241,8 @@
 return d-relevance  other.d-relevance;
 }
 
+QReadLocker locker(d-lock);
+QReadLocker otherLocker(other.d-lock);
 // when resorting to sort by alpha, we want the
 // reverse sort order!
 return d-text  other.d-text;
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma

2010-11-14 Thread Aaron J. Seigo
On Sunday, November 14, 2010, Chani wrote:
   breaks creation of new activities that aren't from templates :)
   either give me a different method that plasmaapp can use, or revert
   that line.
  
  whatever code is doing that is broken. that it worked at all was an
  accident of Corona::addContainment not sticking to the contract of
  immutability.
  
  what is the exact use case that is failing here?
 
 1)
 using addContainment to create a new empty containment for a new activity -
 PlasmaApp::createActivity(pluginname) iirc.

createActivity should not be called when the Corona is locked.

the only way i can see this becoming an issue is if an activity is created by 
a third application and we want plasma-desktop to react to that by adding a 
containt (or set of containments) for that activity when it is created in 
activity manager.

personally i don't think that's a valid use case. there should be one place 
that activities are created and destroyed only: the desktop shell.
 
 2) using addContainment to create a new containment when a screen is
 plugged in.

this is a valid use case, at least for when Corona is UserImmutable. this is a 
bug in Activity::addContainment for not unlocking the Corona first.

however, in the case of system immutability (kiosk), the Corona will refuse to 
unlock. which means that in a fully locked down system, adding a second 
screen will result in no desktop containment appearing for it. to be honest, 
that sounds about right.

one solution would be to move the creation of screen/desktop related 
containments internal to Corona, e.g. by adding a new containmentForScreen 
method, sth like:

Containment *containmentForScreen(int screen, int desktop = -1, const QString 
defaultPluginIfNonExistent = QString());

see attached diff.

we probably also should add a new Kiosk restriction to add to this lot:

http://techbase.kde.org/KDE_System_Administration/Kiosk/Keys#Plasma

which should allow the restriction of the creation of new activities. this 
would allow one to have the Corona itself unlocked, but not create activities. 
this is a simple matter of documenting the key on that page and adding a check 
for it in plasma-desktop with:

if (KAuthorized::authorize(plasma/create_new_activities)) {

another option for a system administrator would be to add an entry in the 
system-wide plasma config like this:

[General]
immutability[$i]=2

in theory that would make it impossible to change the value of immutability to 
Mutable. i say in theory because while the value would be preserved between 
restarts, at runtime one would still be able to Unlock widgets in plasma-
desktop.

still, plasma code would need to be altered to check to see if that key is 
immutable and if it is to treat it as non-changeable. in fact, this is 
probably viewable as a bug right now, in fact, since it is, in pratice, not 
possible to make that config key immutable using kiosk. almost sounds like we 
need a bool Corona::canChangeImmutability() const method.

if that was respected properly, then it would be possible to otherwise lock 
down the Corona while allowing it to do internal bookkeeping.

thoughts?

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
Index: corona.cpp
===
--- corona.cpp	(revision 1196287)
+++ corona.cpp	(working copy)
@@ -33,13 +33,14 @@
 
 #include cmath
 
+#include kaction.h
+#include kactioncollection.h
 #include kdebug.h
 #include kglobal.h
 #include klocale.h
 #include kmimetype.h
-#include kactioncollection.h
-#include kaction.h
 #include kshortcutsdialog.h
+#include kwindowsystem.h
 
 #include animator.h
 #include abstracttoolbox.h
@@ -192,7 +193,7 @@
 
 //kDebug()  Loading  name  args  id;
 
-if (pluginName.isEmpty()) {
+if (pluginName.isEmpty() || pluginName == default) {
 // default to the desktop containment
 pluginName = desktop;
 }
@@ -583,6 +584,23 @@
 return 0;
 }
 
+Containment *Corona::containmentForScreen(int screen, int desktop,
+  const QString defaultPluginIfNonExistent, const QVariantList defaultArgs)
+{
+Containment *containment = containmentForScreen(screen, desktop);
+if (!containment  !defaultPluginIfNonExistent.isEmpty()) {
+// screen requests are allowed to bypass immutability
+if (screen = 0  screen  numScreens() 
+desktop = -1  desktop  KWindowSystem::numberOfDesktops()) {
+containment = d-addContainment(defaultPluginIfNonExistent, defaultArgs, 0, false);
+if (containment) {
+containment-setScreen(screen, desktop);
+}
+}
+}
+
+return containment;
+}
 QListContainment* Corona::containments() const
 {
 return d-containments;
Index: corona.h

KDE/kdelibs/plasma

2010-10-14 Thread Aaron J . Seigo
SVN commit 1185856 by aseigo:

handle the caching case in setImagePath properly; this is a significant 
increase in complexity in this rather fundamental method. in combination with 
the change in Svg::setImagePath to call FrameSvg::setImagePath directly (due to 
an API wart i only today noticed), this has the potential to cause new issues, 
though it is running quite nicely on my system. needs extensive testing, but 
should also hopefully take care of the remaining crash being seen related to 
the FrameData cache
CCMAIL:plasma-devel@kde.org


 M  +50 -6 framesvg.cpp  
 M  +1 -0  svg.h  


--- trunk/KDE/kdelibs/plasma/framesvg.cpp #1185855:1185856
@@ -1,6 +1,6 @@
 /*
- *   Copyright 2008 by Aaron Seigo ase...@kde.org
- *   Copyright 2008 Marco Martin notm...@gmail.com
+ *   Copyright 2008-2010 by Aaron Seigo ase...@kde.org
+ *   Copyright 2008-2010 Marco Martin notm...@gmail.com
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU Library General Public License as
@@ -32,8 +32,9 @@
 
 #include kdebug.h
 
-#include plasma/theme.h
-#include plasma/applet.h
+#include applet.h
+#include theme.h
+#include private/svg_p.h
 
 namespace Plasma
 {
@@ -64,12 +65,55 @@
 return;
 }
 
-Svg::setImagePath(path);
+bool updateNeeded = true;
+clearCache();
+
+FrameData *fd = d-frames[d-prefix];
+if (fd-refcount() == 1) {
+// we're the only user of it, let's remove it from the shared keys
+// we don't want to deref it, however, as we'll still be using it
+const QString oldKey = d-cacheId(fd, d-prefix);
+FrameSvgPrivate::s_sharedFrames.remove(oldKey);
+} else {
+// others are using this frame, so deref it for ourselves
+fd-deref(this);
+fd = 0;
+}
+
+Svg::d-setImagePath(path);
+
+if (!fd) {
+// we need to replace our frame, start by looking in the frame cache
+const QString key = d-cacheId(fd, d-prefix);
+fd = FrameSvgPrivate::s_sharedFrames.value(key);
+
+if (fd) {
+// we found one, so ref it and use it; we also don't need to (or 
want to!)
+// trigger a full update of the frame since it is already the one 
we want
+// and likely already rendered just fine
+fd-ref(this);
+updateNeeded = false;
+} else {
+// nothing exists for us in the cache, so create a new FrameData 
based
+// on the old one
+fd = new FrameData(*d-frames[d-prefix], this);
+}
+
+d-frames.insert(d-prefix, fd);
+}
+
 setContainsMultipleImages(true);
+if (updateNeeded) {
+// ensure our frame is in the cache
+const QString key = d-cacheId(fd, d-prefix);
+FrameSvgPrivate::s_sharedFrames.insert(key, fd);
 
-clearCache();
+// this will emit repaintNeeded() as well when it is done
 d-updateAndSignalSizes();
+} else {
+emit repaintNeeded();
 }
+}
 
 void FrameSvg::setEnabledBorders(const EnabledBorders borders)
 {
--- trunk/KDE/kdelibs/plasma/svg.h #1185855:1185856
@@ -264,6 +264,7 @@
 
 friend class SvgPrivate;
 friend class FrameSvgPrivate;
+friend class FrameSvg;
 };
 
 } // Plasma namespace
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma

2010-08-17 Thread laurent Montel
 0x7f6fcc1eff8c in QCoreApplication::notifyInternal (this=0x17747f0, 
receiver=0x18b63b0, event=0x7fff3cf7f3a0)
---Type return to continue, or q return to quit---kmail(18298) 
KMail::ExpireJob::execute: ExpireJob: deleting unread older than 30 days
kmail(18298) KMail::ExpireJob::execute: ExpireJob: deleting read older than 30 
days
kmail(18298) KMail::ExpireJob::execute: ExpireJob: starting to expire in folder 
/home/laurent/Mail/.KDE.directory/kde-i18n-doc



-

 
 
 --- trunk/KDE/kdelibs/plasma/datacontainer.cpp #1164452:1164453
 @@ -19,6 +19,7 @@
  #include datacontainer.h
  #include private/datacontainer_p.h
  #include private/storage_p.h
 +#include pluginloader.h
 
  #include kdebug.h
 
 @@ -198,36 +199,43 @@
 
  setNeedsToBeStored(false);
 
 -if (d-store == NULL) {
 +if (!d-store) {
 +QVariantList args;
 +args.insert(0, de-name());
 +d-store =
 PluginLoader::pluginLoader()-loadService(akonadi_storage_plugin, args,
 0); +if (!d-store) {
  d-store = new Storage(de-name(), 0);
  }
 +}
 
  KConfigGroup op = d-store-operationDescription(save);
  op.writeEntry(source, objectName());
  DataEngine::Data dataToStore = data();
  DataEngine::Data::const_iterator it = dataToStore.constBegin();
 +
  while (it != dataToStore.constEnd()  dataToStore.constEnd() ==
 data().constEnd()) { QVariant v = it.value();
 -if ((it.value().type() == QVariant::String) || (it.value().type()
 == QVariant::Int)) { -op.writeEntry(key, it.key());
 -op.writeEntry(data, it.value());
 -} else {
  QByteArray b;
  QDataStream ds(b, QIODevice::WriteOnly);
  ds  it.value();
 -op.writeEntry(key, base64- + it.key());
 +op.writeEntry(key, it.key());
  op.writeEntry(data, b.toBase64());
  }
  ++it;
 -if (d-store == NULL) {
 +if (!d-store) {
 +QVariantList args;
 +args.insert(0, de-name());
 +d-store =
 PluginLoader::pluginLoader()-loadService(plasma_storage_akonadi, args,
 0); +if (!d-store) {
  d-store = new Storage(de-name(), 0);
  }
 +}
  ServiceJob* job = d-store-startOperationCall(op);
  d-storeCount++;
  connect(job, SIGNAL(finished(KJob*)), this,
 SLOT(storeJobFinished(KJob*))); }
 -}
 
 +
  void DataContainerPrivate::storeJobFinished(KJob* )
  {
  --storeCount;
 @@ -243,10 +251,17 @@
  if (de == NULL) {
  return;
  }
 -Storage* store = new Storage(de-name(), 0);
 -KConfigGroup retrieveGroup = store-operationDescription(retrieve);
 +if (!d-store) {
 +QVariantList args;
 +args.insert(0, de-name());
 +d-store =
 PluginLoader::pluginLoader()-loadService(plasma_storage_akonadi, args,
 0); +if (!d-store) {
 +d-store = new Storage(de-name(), 0);
 +}
 +}
 +KConfigGroup retrieveGroup =
 d-store-operationDescription(retrieve);
 retrieveGroup.writeEntry(source, objectName());
 -ServiceJob* retrieveJob = store-startOperationCall(retrieveGroup);
 +ServiceJob* retrieveJob = d-store-startOperationCall(retrieveGroup);
  connect(retrieveJob, SIGNAL(result(KJob*)), this,
  SLOT(populateFromStoredData(KJob*)));
  }
 @@ -261,27 +276,22 @@
  ServiceJob* ret = dynamic_castServiceJob*(job);
  QHashQString, QVariant h = ret-result().toHash();
  foreach (QString key, h.keys()) {
 -if (key.startsWith(base64-)) {
  QByteArray b =
 QByteArray::fromBase64(h[key].toString().toAscii()); QDataStream ds(b,
 QIODevice::ReadOnly);
  QVariant v(ds);
  key.remove(0, 7);
  dataToInsert.insert(key, v);
 -} else {
 -dataToInsert.insert(key, h[key]);
  }
 -}
 
 -if (!(data.isEmpty()))
 -{
  //Do not fill the source with old stored
  //data if it is already populated with new data.
 -return;
 +if (data.isEmpty())
 +{
 +data = dataToInsert;
 +//dirty = true;
 +//q-checkForUpdate();
  }
 
 -data = dataToInsert;
 -dirty = true;
 -q-checkForUpdate();
  }
 
  void DataContainer::disconnectVisualization(QObject *visualization)
 --- trunk/KDE/kdelibs/plasma/private/datacontainer_p.h #1164452:1164453
 @@ -35,7 +35,7 @@
  public:
  DataContainerPrivate(DataContainer *container)
 
  : q(container),
 
 -  store(NULL),
 +  store(0),
dirty(false),
cached(false),
enableStorage(false),
 @@ -66,7 +66,7 @@
  QMapQObject *, SignalRelay * relayObjects;
  QMapuint, SignalRelay * relays;
  QTime updateTs;
 -Storage* store;
 +Service* store;
  bool dirty : 1;
  bool cached : 1;
  bool enableStorage : 1;
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman

Re: KDE/kdelibs/plasma

2010-08-17 Thread Brian Pritchett
 0x7f6fccf47336 in KApplication::notify (this=0x17747f0,
 receiver=0x18b63b0, event=0x7fff3cf7f3a0)
 at /home/laurent/kde/kde4/kdelibs/kdeui/kernel/kapplication.cpp:310
 #32 0x7f6fcc1eff8c in QCoreApplication::notifyInternal (this=0x17747f0,
 receiver=0x18b63b0, event=0x7fff3cf7f3a0)
 ---Type return to continue, or q return to quit---kmail(18298)
 KMail::ExpireJob::execute: ExpireJob: deleting unread older than 30 days
 kmail(18298) KMail::ExpireJob::execute: ExpireJob: deleting read older than
 30 days
 kmail(18298) KMail::ExpireJob::execute: ExpireJob: starting to expire in
 folder /home/laurent/Mail/.KDE.directory/kde-i18n-doc
 
 
 
 -
 
  --- trunk/KDE/kdelibs/plasma/datacontainer.cpp #1164452:1164453
  @@ -19,6 +19,7 @@
  
   #include datacontainer.h
   #include private/datacontainer_p.h
   #include private/storage_p.h
  
  +#include pluginloader.h
  
   #include kdebug.h
  
  @@ -198,36 +199,43 @@
  
   setNeedsToBeStored(false);
  
  -if (d-store == NULL) {
  +if (!d-store) {
  +QVariantList args;
  +args.insert(0, de-name());
  +d-store =
  PluginLoader::pluginLoader()-loadService(akonadi_storage_plugin, args,
  0); +if (!d-store) {
  
   d-store = new Storage(de-name(), 0);
   
   }
  
  +}
  
   KConfigGroup op = d-store-operationDescription(save);
   op.writeEntry(source, objectName());
   DataEngine::Data dataToStore = data();
   DataEngine::Data::const_iterator it = dataToStore.constBegin();
  
  +
  
   while (it != dataToStore.constEnd()  dataToStore.constEnd() ==
  
  data().constEnd()) { QVariant v = it.value();
  -if ((it.value().type() == QVariant::String) ||
  (it.value().type() == QVariant::Int)) { -   
  op.writeEntry(key, it.key()); -op.writeEntry(data,
  it.value());
  -} else {
  
   QByteArray b;
   QDataStream ds(b, QIODevice::WriteOnly);
   ds  it.value();
  
  -op.writeEntry(key, base64- + it.key());
  +op.writeEntry(key, it.key());
  
   op.writeEntry(data, b.toBase64());
   
   }
   ++it;
  
  -if (d-store == NULL) {
  +if (!d-store) {
  +QVariantList args;
  +args.insert(0, de-name());
  +d-store =
  PluginLoader::pluginLoader()-loadService(plasma_storage_akonadi, args,
  0); +if (!d-store) {
  
   d-store = new Storage(de-name(), 0);
   
   }
  
  +}
  
   ServiceJob* job = d-store-startOperationCall(op);
   d-storeCount++;
   connect(job, SIGNAL(finished(KJob*)), this,
  
  SLOT(storeJobFinished(KJob*))); }
  -}
  
  +
  
   void DataContainerPrivate::storeJobFinished(KJob* )
   {
   
   --storeCount;
  
  @@ -243,10 +251,17 @@
  
   if (de == NULL) {
   
   return;
   
   }
  
  -Storage* store = new Storage(de-name(), 0);
  -KConfigGroup retrieveGroup =
  store-operationDescription(retrieve); +if (!d-store) {
  +QVariantList args;
  +args.insert(0, de-name());
  +d-store =
  PluginLoader::pluginLoader()-loadService(plasma_storage_akonadi, args,
  0); +if (!d-store) {
  +d-store = new Storage(de-name(), 0);
  +}
  +}
  +KConfigGroup retrieveGroup =
  d-store-operationDescription(retrieve);
  retrieveGroup.writeEntry(source, objectName());
  -ServiceJob* retrieveJob = store-startOperationCall(retrieveGroup);
  +ServiceJob* retrieveJob =
  d-store-startOperationCall(retrieveGroup);
  
   connect(retrieveJob, SIGNAL(result(KJob*)), this,
   
   SLOT(populateFromStoredData(KJob*)));
   
   }
  
  @@ -261,27 +276,22 @@
  
   ServiceJob* ret = dynamic_castServiceJob*(job);
   QHashQString, QVariant h = ret-result().toHash();
   foreach (QString key, h.keys()) {
  
  -if (key.startsWith(base64-)) {
  
   QByteArray b =
  
  QByteArray::fromBase64(h[key].toString().toAscii()); QDataStream ds(b,
  QIODevice::ReadOnly);
  
   QVariant v(ds);
   key.remove(0, 7);
   dataToInsert.insert(key, v);
  
  -} else {
  -dataToInsert.insert(key, h[key]);
  
   }
  
  -}
  
  -if (!(data.isEmpty()))
  -{
  
   //Do not fill the source with old stored
   //data if it is already populated with new data.
  
  -return;
  +if (data.isEmpty())
  +{
  +data = dataToInsert;
  +//dirty = true;
  +//q-checkForUpdate();
  
   }
  
  -data = dataToInsert;
  -dirty = true;
  -q-checkForUpdate();
  
   }
   
   void DataContainer::disconnectVisualization(QObject *visualization)
  
  --- trunk/KDE/kdelibs/plasma/private/datacontainer_p.h #1164452:1164453
  @@ -35,7 +35,7 @@
  
   public:
   DataContainerPrivate(DataContainer *container)
   
   : q(container

KDE/kdelibs/plasma

2010-07-30 Thread Marco Martin
SVN commit 1157190 by mart:

new property:
preferredToolBoxPlugin(Containment::Type)
used to decide what toolbox plugin dynamically load, only corona
implementations can decide this.

api review anyone? ;)

CCMAIL:plasma-devel@kde.org


 M  +12 -0 corona.cpp  
 M  +17 -0 corona.h  


--- trunk/KDE/kdelibs/plasma/corona.cpp #1157189:1157190
@@ -279,6 +279,7 @@
 KShortcutsDialog shortcutsDlg;
 QMapContainment::Type, ContainmentActionsPluginsConfig 
containmentActionsDefaults;
 QWeakPointerAbstractDialogManagerdialogManager;
+QHashContainment::Type, QString toolBoxPlugins;
 };
 
 bool CoronaPrivate::s_positioningContainments = false;
@@ -796,6 +797,17 @@
 {
 }
 
+void Corona::setPreferredToolBoxPlugin(const Containment::Type type, const 
QString plugin)
+{
+d-toolBoxPlugins[type] = plugin;
+//TODO: react to plugin changes on the fly? still don't see the use case 
(maybe for laptops that become tablets?)
+}
+
+QString Corona::preferredToolBoxPlugin(const Containment::Type type) const
+{
+return d-toolBoxPlugins.value(type);
+}
+
 void Corona::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
 {
 QGraphicsScene::dragEnterEvent(event);
--- trunk/KDE/kdelibs/plasma/corona.h #1157189:1157190
@@ -262,6 +262,15 @@
  */
 QListPlasma::Containment * importLayout(const KConfigBase config);
 
+/**
+ * Returns the name of the preferred plugin to be used as containment 
toolboxes.
+ * CustomContainments and CustomPanelContainments can still override it as 
their liking. It's also not guaranteed that the plugin will actually exist.
+ *
+ * @param type the containment type of which we want to know the 
associated toolbox plugin
+ * @since 4.6
+ */
+QString preferredToolBoxPlugin(const Containment::Type type) const;
+
 public Q_SLOTS:
 /**
  * Initializes the layout from a config file. This will first clear any 
existing
@@ -417,6 +426,14 @@
  */
 void mapAnimation(Animator::Animation from, const QString to);
 
+/**
+ * @return The preferred toolbox plugin name for a given containment type.
+ * @param type the containment type of which we want to know the preferred 
toolbox plugin.
+ * @param plugin the toolbox plugin name
+ * @since 4.6
+ */
+void setPreferredToolBoxPlugin(const Containment::Type type, const QString 
plugin);
+
 //Reimplemented from QGraphicsScene
 void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
 void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma

2010-07-30 Thread Aaron J. Seigo
On July 30, 2010, Marco Martin wrote:
 SVN commit 1157180 by mart:
 
 support load by plugin from AbstractToolBox

it's missing a static KPluginInfo::List listToolBoxInfo(const QString
 parentApp = QString()) method, to follow the pattern of the others.

 could be the case to add it to PluginLoader? don't see big use
 cases

yeah, i don't see why we'd need / want to do so.

-- 
Aaron J. Seigo
humru
 othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks



signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma/animations

2010-02-01 Thread Aaron J. Seigo
On February 1, 2010, Bruno de Oliveira Abinader wrote:
 SVN commit 1083641 by abinader:
 
 Removed implicit enumerated animation movement direction combinations (i.e.
 MoveUpRight) and added support for combinations (i.e. MoveUp|MoveLeft).
 Currently used by RotationStacked and Slide animations, which were
 previously adapted to this clean design
 
 
  M  +10 -15animation.h
 
 
 --- trunk/KDE/kdelibs/plasma/animations/animation.h #1083640:1083641
 @@ -65,28 +65,23 @@
   */
  enum Reference {
  Center = 0,
 -Up,
 -Down,
 -Left,
 -Right
 +Up = 0x1,
 +Down = 0x2,
 +Left = 0x4,
 +Right = 0x8
  };
 
  /**
 - * The movement direction of an animation.
 + * Animation movement direction.
   */
  enum MovementDirection {
 -MoveUp = 0, /** Move up */
 -MoveUpRight,/** Move up and right */
 -MoveRight,  /** Move right */
 -MoveDownRight,  /** Move down and right */
 -MoveDown,   /** Move down */
 -MoveDownLeft,   /** Move down and left */
 -MoveLeft,   /** Move left */
 -MoveUpLeft, /** Move up and left */
 -MoveAny /** Move in any direction*/
 +MoveAny = 0,
 +MoveUp = 0x1,
 +MoveRight = 0x2,
 +MoveDown = 0x4,
 +MoveLeft = 0x8
  };

these should have Q_DECLARE_FLAGS entries and this must be backported to the 
4.4 branches before 4.4.0 comes out at this is essentially an API change. code 
compiled against 4.4 will have the wrong values for these enumerations and so 
will behave oddly if run against a 4.5 kdelibs.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


KDE/kdelibs/plasma

2009-12-29 Thread Chani Armitage
SVN commit 1067596 by chani:

give wallpaper priority over containmentactions in all events

CCMAIL: plasma-devel@kde.org
note that the wallpaper is only getting wheel events and move events
when itemAt != this, which is different from the if there's no applet
there logic that's used for containmentactions stuff. this could
have... odd... effects for containments that use graphicsitems, like
folderview.
in general it seems like this code's gotten crufty and could do with
some cleanup, once someone decides what the 'proper' behaviour actually
is.

 M  +10 -10containment.cpp  


--- trunk/KDE/kdelibs/plasma/containment.cpp #1067595:1067596
@@ -1639,16 +1639,6 @@
 return; //no unexpected click-throughs
 }
 
-QString trigger = ContainmentActions::eventToString(event);
-
-if (d-actionPlugins.contains(trigger)) {
-if (d-prepareContainmentActions(trigger, event-screenPos())) {
-d-actionPlugins.value(trigger)-contextEvent(event);
-}
-event-accept();
-return;
-}
-
 if (d-wallpaper  d-wallpaper-isInitialized()) {
 QGraphicsItem *item = scene()-itemAt(event-scenePos());
 if (item == this) {
@@ -1661,6 +1651,16 @@
 }
 }
 
+QString trigger = ContainmentActions::eventToString(event);
+
+if (d-actionPlugins.contains(trigger)) {
+if (d-prepareContainmentActions(trigger, event-screenPos())) {
+d-actionPlugins.value(trigger)-contextEvent(event);
+}
+event-accept();
+return;
+}
+
 event-ignore();
 Applet::wheelEvent(event);
 }
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


KDE/kdelibs/plasma/extenders

2009-11-10 Thread Marco Martin
SVN commit 1047062 by mart:

emit a signal when the user clicks the close button.
would perhaps be better to bind it with an action and make it accessible
with action(close)?
CCMAIL: plasma-devel@kde.org


 M  +7 -1  extenderitem.cpp  
 M  +9 -0  extenderitem.h  


--- trunk/KDE/kdelibs/plasma/extenders/extenderitem.cpp #1047061:1047062
@@ -444,6 +444,11 @@
 
d-hostApplet()-config(ExtenderItems).deleteGroup(QString::number(d-extenderItemId));
 d-extender-d-removeExtenderItem(this);
 emit d-extender-itemDetached(this);
+
+if (sender() == d-destroyAction) {
+emit destroyActionTriggered();
+}
+
 deleteLater();
 }
 
@@ -689,6 +694,7 @@
   dragger(new FrameSvg(extenderItem)),
   background(new FrameSvg(extenderItem)),
   collapseIcon(0),
+  destroyAction(0),
   title(QString()),
   mouseOver(false),
   dragStarted(false),
@@ -766,7 +772,7 @@
 
 //add the close icon if desired.
 if (destroyActionVisibility) {
-IconWidget *destroyAction = new IconWidget(q);
+destroyAction = new IconWidget(q);
 destroyAction-setSvg(widgets/configuration-icons, close);
 QSizeF size = destroyAction-sizeFromIconSize(iconSize);
 destroyAction-setMinimumSize(size);
--- trunk/KDE/kdelibs/plasma/extenders/extenderitem.h #1047061:1047062
@@ -254,6 +254,15 @@
  */
 void hideCloseButton();
 
+Q_SIGNALS:
+/**
+ * Emitted when the user closes the extender item with the destroy 
icon,
+ * not when the item is destroyed programmatically.
+ *
+ * @since 4.4
+ */
+void destroyActionTriggered();
+
 protected:
 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, 
QWidget *widget);
 
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma/extenders

2009-11-10 Thread Aaron J. Seigo
On November 10, 2009, Marco Martin wrote:
 SVN commit 1047062 by mart:
 
 emit a signal when the user clicks the close button.
 would perhaps be better to bind it with an action and make it accessible
 with action(close)?

yes, i think so. it would allow disabling it, triggering it, and other such 
things easy as well.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma/extenders

2009-11-10 Thread Chani
On November 10, 2009 13:03:58 Aaron J. Seigo wrote:
 On November 10, 2009, Marco Martin wrote:
  SVN commit 1047062 by mart:
 
  emit a signal when the user clicks the close button.
  would perhaps be better to bind it with an action and make it accessible
  with action(close)?
 
 yes, i think so. it would allow disabling it, triggering it, and other such
 things easy as well.
 

actions++ :)

-- 
This message brought to you by eevil bananas and the number 3.
www.chani3.com


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


KDE/kdelibs/plasma/widgets

2009-10-02 Thread Marco Martin
SVN commit 1030634 by mart:

apparently if the label is hidden it doesn't receive font change events,
so at show event i have to check if the font is different from
QApplication::font() :/
now: is this the intended behaviour of qt or is a bug?
CCMAIL:plasma-devel@kde.org


 M  +11 -1 label.cpp  
 M  +1 -0  label.h  


--- trunk/KDE/kdelibs/plasma/widgets/label.cpp #1030633:1030634
@@ -19,6 +19,7 @@
 
 #include label.h
 
+#include QApplication
 #include QLabel
 #include QPainter
 #include QDir
@@ -293,7 +294,7 @@
 
 void Label::changeEvent(QEvent *event)
 {
-if (event-type() == QEvent::FontChange) {
+if (event-type() == QEvent::FontChange  font() != QApplication::font()) 
{
 d-customFont = true;
 nativeWidget()-setFont(font());
 }
@@ -301,6 +302,15 @@
 QGraphicsProxyWidget::changeEvent(event);
 }
 
+bool Label::event(QEvent *event)
+{
+if (event-type() == QEvent::Show  font() != QApplication::font()) {
+d-customFont = true;
+nativeWidget()-setFont(font());
+}
+return QGraphicsProxyWidget::event(event);
+}
+
 } // namespace Plasma
 
 #include label.moc
--- trunk/KDE/kdelibs/plasma/widgets/label.h #1030633:1030634
@@ -151,6 +151,7 @@
const QStyleOptionGraphicsItem *option,
QWidget *widget);
 void changeEvent(QEvent *event);
+bool event(QEvent *event);
 
 private:
 Q_PRIVATE_SLOT(d, void setPalette())
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


KDE/kdelibs/plasma/widgets

2009-09-24 Thread Marco Martin
SVN commit 1027814 by mart:

ensureRectVisible() a rect in internal widget coordinates will cause an
animated scroll until the rect becomes visible
it should not collide with kinetic scroll since the anim is stopped as
soon as amouse or wheel event is triggered
CCMAIL:plasma-devel@kde.org


 M  +42 -1 scrollwidget.cpp  
 M  +8 -0  scrollwidget.h  


--- trunk/KDE/kdelibs/plasma/widgets/scrollwidget.cpp #1027813:1027814
@@ -32,6 +32,7 @@
 //Plasma
 #include plasma/widgets/scrollbar.h
 #include plasma/widgets/svgwidget.h
+#include plasma/animator.h
 #include plasma/svg.h
 
 namespace Plasma
@@ -47,7 +48,8 @@
   bottomBorder(0),
   leftBorder(0),
   rightBorder(0),
-  dragging(false)
+  dragging(false),
+  animId(0)
 {
 }
 
@@ -181,6 +183,7 @@
 Qt::ScrollBarPolicy horizontalScrollBarPolicy;
 QString styleSheet;
 bool dragging;
+int animId;
 };
 
 
@@ -261,7 +264,33 @@
 return d-verticalScrollBarPolicy;
 }
 
+void ScrollWidget::ensureRectVisible(const QRectF rect)
+{
+QRectF viewRect = d-scrollingWidget-boundingRect();
+QRectF mappedRect = d-widget-mapToItem(d-scrollingWidget, 
rect).boundingRect();
+if (viewRect.contains(mappedRect)) {
+return;
+}
 
+QPointF delta(0, 0);
+
+if (mappedRect.top()  0) {
+delta.setY(-mappedRect.top());
+} else if  (mappedRect.bottom()  viewRect.bottom()) {
+delta.setY(viewRect.bottom() - mappedRect.bottom());
+}
+
+if (mappedRect.left()  0) {
+delta.setX(-mappedRect.left());
+} else if  (mappedRect.right()  viewRect.right()) {
+delta.setY(viewRect.right() - mappedRect.right());
+}
+
+d-animId = Animator::self()-moveItem(
+d-widget, Plasma::Animator::SlideOutMovement,
+(d-widget-pos() + delta).toPoint());
+}
+
 void ScrollWidget::setStyleSheet(const QString styleSheet)
 {
 d-styleSheet = styleSheet;
@@ -311,12 +340,20 @@
 return;
 }
 
+if (d-animId) {
+Animator::self()-stopItemMovement(d-animId);
+}
+
 d-mouseMoveEvent(event);
 QGraphicsWidget::mouseMoveEvent(event);
 }
 
 void ScrollWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
+if (d-animId) {
+Animator::self()-stopItemMovement(d-animId);
+}
+
 event-accept();
 d-mousePressEvent(event);
 }
@@ -328,6 +365,10 @@
 
 void ScrollWidget::wheelEvent(QGraphicsSceneWheelEvent *event)
 {
+if (d-animId) {
+Animator::self()-stopItemMovement(d-animId);
+}
+
 event-accept();
 d-wheelReleaseEvent( event );
 }
--- trunk/KDE/kdelibs/plasma/widgets/scrollwidget.h #1027813:1027814
@@ -96,6 +96,14 @@
 Qt::ScrollBarPolicy verticalScrollBarPolicy() const;
 
 /**
+ * Scroll the view until the given rectangle is visible
+ *
+ * @param rect rect we want visible, in coordinates mapped to the inner 
widget
+ * @since 4.4
+ */
+void ensureRectVisible(const QRectF rect);
+
+/**
  * Sets the stylesheet used to control the visual display of this 
ScrollWidget
  *
  * @arg stylesheet a CSS string
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


KDE/kdelibs/plasma/widgets

2009-09-02 Thread Marco Martin
SVN commit 1019013 by mart:

add tabAt(int) function
actually the correspondent qtabwidget is widget(), but on a
qgraphicsproxywidget it is taken, maybe needs a beter name?
CCMAIL: plasma-devel@kde.org


 M  +19 -0 tabbar.cpp  
 M  +8 -0  tabbar.h  


--- trunk/KDE/kdelibs/plasma/widgets/tabbar.cpp #1019012:1019013
@@ -425,6 +425,25 @@
 return returnItem;
 }
 
+QGraphicsLayoutItem *TabBar::tabAt(int index)
+{
+if (index  d-pages.count()) {
+return 0;
+}
+
+QGraphicsWidget *page = d-pages.value(index);
+
+QGraphicsLayoutItem *returnItem = 0;
+QGraphicsLayout *lay = page-layout();
+if (lay  lay-count() == 1) {
+returnItem = lay-itemAt(0);
+} else {
+returnItem = lay;
+}
+
+return returnItem;
+}
+
 void TabBar::setTabText(int index, const QString label)
 {
 if (index  d-pages.count()) {
--- trunk/KDE/kdelibs/plasma/widgets/tabbar.h #1019012:1019013
@@ -125,6 +125,14 @@
  * @since 4.4
  */
 QGraphicsLayoutItem *takeTab(int index);
+
+/**
+ * Returns the contents of a page
+ *
+ * @arg index the index of the tab to retrieve
+ * @since 4.4
+ */
+QGraphicsLayoutItem *tabAt(int index);
 
 /**
  * @return the index of the tab currently active
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


KDE/kdelibs/plasma

2009-08-08 Thread Sebastian Kügler
SVN commit 1009004 by sebas:

Make dropping remote content onto Plasma work

The idea is that you drop a file from a webpage, or basically a URL onto Plasma 
and Plasma creates a suitable applet to display this URL. For example an image 
frame for picture, or a previewer for pdf files. Downloading the data itself 
(and possibly saving it) is left to the applets. The mimetype needs to be 
retrieved as it cannot be determined from the URL.

The code pathes I've changed or added are, roughly:
- something is dropped onto Plasma
- if it's a remote URL, we don't know the mimetype of the object behind the URL 
yet
- a KIO::TransferJob is used to retrieve the mimetype asynchronously, and will 
call back
- we open a QMenu that says Fetching file type...
- If the user closes the menu while the mimetype is being retrieved, we will 
open a new one
- When the TransferJob calls back, and we have our mimetype, we offer a list of 
applets suitable for this kind of content
- If the user chooses to create an applet, we put the transfer job on hold to 
make it available for recycling by the applet
- If the user dismisses the offering, we kill the job

Thanks to marco for reviewing and everybody else for the input :)

Next steps are making some more applets work with this.

CCMAIL:plasma-devel@kde.org



 M  +102 -11   containment.cpp  
 M  +11 -1 containment.h  
 M  +4 -0  private/containment_p.h  


--- trunk/KDE/kdelibs/plasma/containment.cpp #1009003:1009004
@@ -43,6 +43,9 @@
 #include kstandarddirs.h
 #include ktemporaryfile.h
 #include kwindowsystem.h
+#include kio/jobclasses.h // for KIO::JobFlags
+#include kio/job.h
+#include kio/scheduler.h
 
 #include animator.h
 #include context.h
@@ -611,7 +614,7 @@
 //if there is only one, don't create a submenu
 if(enabled  2) {
 foreach(QAction *action, containmentMenu-actions()) {
-desktopMenu.addAction(action); 
+desktopMenu.addAction(action);
 }
 } else {
 desktopMenu.addMenu(containmentMenu);
@@ -1058,6 +1061,7 @@
 
 QGraphicsSceneDragDropEvent *dropEvent = 
dynamic_castQGraphicsSceneDragDropEvent*(event);
 QGraphicsSceneMouseEvent *mouseEvent = 
dynamic_castQGraphicsSceneMouseEvent*(event);
+//kDebug()  Something dropped mimetype, -data:   appletMimetype  
event-mimeData()-text();
 
 QPointF pos;
 QPointF scenePos;
@@ -1081,7 +1085,7 @@
 }
 
 if (!mimeData) {
-//Selection is either empty or not sopported on this OS
+//Selection is either empty or not supported on this OS
 kDebug()  no mime data;
 return;
 }
@@ -1093,7 +1097,6 @@
 if (!appletMimetype.isEmpty()  mimeData-hasFormat(appletMimetype)) {
 QString data = mimeData-data(appletMimetype);
 const QStringList appletNames = data.split('\n', 
QString::SkipEmptyParts);
-
 foreach (const QString appletName, appletNames) {
 //kDebug()  doing  appletName;
 QRectF geom(q-mapFromScene(scenePos), QSize(0, 0));
@@ -1123,12 +1126,14 @@
 QRectF geom(pos, QSize());
 QVariantList args;
 args  url.url();
-// kDebug()  mimeName;
+//kDebug()  can decode  mimeName  args;
+//kDebug()  protocol:  url.protocol();
 KPluginInfo::List appletList = 
Applet::listAppletInfoForMimetype(mimeName);
 
 if (!appletList.isEmpty()) {
-//TODO: should we show a dialog here to choose which plasmoid 
load if
-//!appletList.isEmpty()
+// The mimetype is known, i.e. there are applet that can load 
this mimetype
+// Offer the applets in a popupmenu
+kDebug()  Local file.;
 QMenu choices;
 QHashQAction *, QString actionsToPlugins;
 foreach (const KPluginInfo info, appletList) {
@@ -1141,16 +1146,29 @@
 
 actionsToPlugins.insert(action, info.pluginName());
 }
+actionsToPlugins.insert(choices.addAction(i18n(Icon)), 
icon);
 
-actionsToPlugins.insert(choices.addAction(i18n(Icon)), 
icon);
 QAction *choice = choices.exec(screenPos);
 if (choice) {
 q-addApplet(actionsToPlugins[choice], args, geom);
 }
-} else if (url.protocol() != data) {
-// We don't try to do anything with data: URIs
-// no special applet associated with this mimetype, let's
-q-addApplet(icon, args, geom);
+
+} else if (url.protocol() != data) { // Why not data:?
+//kDebug()  Let's start a KIO::TransferJob to retrieve the 
mimetype  KMimeType::findByUrl(url)-name();
+
+
+// It may be a directory or a file, let's stat
+KIO::JobFlags flags = KIO::HideProgressInfo;
+KIO::TransferJob *job

Re: KDE/kdelibs/plasma

2009-07-09 Thread Marco Martin
On 7/9/09, Richard Moore richmoor...@gmail.com wrote:
 On Wed, Jul 8, 2009 at 3:56 PM, Marco Martinnotm...@gmail.com wrote:
 +ItemStatus status();

 Const!

i was soo tired, i swear! :)


 Rich.
 ___
 Plasma-devel mailing list
 Plasma-devel@kde.org
 https://mail.kde.org/mailman/listinfo/plasma-devel

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma

2009-07-08 Thread Aaron J. Seigo
On Wednesday 08 July 2009, Marco Martin wrote:
 api to show/hide plasmoids from the systray, like NotificationItems

 +UnknownStatus = 0,
 +PassiveStatus = 1,
 +ActiveStatus = 2,
 +NeedsAttentionStatus = 3

* forget about systray; that's a use case, but isn't the only one. we have the 
same issue with autohiden panels, for instance

* are these status items really all we need? unknown, passive, active ...? how 
about a status for when the applet is engaged in user input (e.g. typing into 
a text edit) so we can e.g. identify when we can / can not hide a panel or 
should be grabbing focus for it?

* shouldn't this be in Applet rather than PopupApplet?

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma

2009-07-08 Thread Marco Martin
On 7/8/09, Aaron J. Seigo ase...@kde.org wrote:
 On Wednesday 08 July 2009, Marco Martin wrote:
 api to show/hide plasmoids from the systray, like NotificationItems

 +UnknownStatus = 0,
 +PassiveStatus = 1,
 +ActiveStatus = 2,
 +NeedsAttentionStatus = 3

 * forget about systray; that's a use case, but isn't the only one. we have
 the
 same issue with autohiden panels, for instance

ok, that's good, i wasfearing it was a too adhoc thing


 * are these status items really all we need? unknown, passive, active ...?
 how
 about a status for when the applet is engaged in user input (e.g. typing
 into
 a text edit) so we can e.g. identify when we can / can not hide a panel or
 should be grabbing focus for it?

AcceptingInputStatus? (better with or without the status desinence? i
don't want to create potential problems with other enums in the
future)

 * shouldn't this be in Applet rather than PopupApplet?

good point

 --
 Aaron J. Seigo
 humru othro a kohnu se
 GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

 KDE core developer sponsored by Qt Software

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma

2009-07-08 Thread Aaron J. Seigo
On Wednesday 08 July 2009, Marco Martin wrote:
 On 7/8/09, Aaron J. Seigo ase...@kde.org wrote:
  On Wednesday 08 July 2009, Marco Martin wrote:
  api to show/hide plasmoids from the systray, like NotificationItems
 
  +UnknownStatus = 0,
  +PassiveStatus = 1,
  +ActiveStatus = 2,
  +NeedsAttentionStatus = 3
 
  * forget about systray; that's a use case, but isn't the only one. we
  have the
  same issue with autohiden panels, for instance

 ok, that's good, i wasfearing it was a too adhoc thing

  * are these status items really all we need? unknown, passive, active
  ...? how
  about a status for when the applet is engaged in user input (e.g. typing
  into
  a text edit) so we can e.g. identify when we can / can not hide a panel
  or should be grabbing focus for it?

 AcceptingInputStatus? (better with or without the status desinence? i
 don't want to create potential problems with other enums in the
 future)

with status, so we know what it belongs to.

also, apidox and @since's are missing :)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma

2009-07-08 Thread Richard Moore
On Wed, Jul 8, 2009 at 3:56 PM, Marco Martinnotm...@gmail.com wrote:
 +ItemStatus status();

Const!

Rich.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


KDE/kdelibs/plasma

2009-06-30 Thread Marco Martin
SVN commit 989520 by mart:

allow applet configuration and extenderitems config nested into the
group of another applet
this thing is possibly dangerous, so better plasma-devel is informed
CCMAIL:plasma-devel@kde.org


 M  +5 -1  applet.cpp  
 M  +1 -0  extender.cpp  


--- trunk/KDE/kdelibs/plasma/applet.cpp #989519:989520
@@ -2108,6 +2108,7 @@
 d-modificationsTimerId = 0;
 // invalid group, will result in save using the default group
 KConfigGroup cg;
+
 save(cg);
 emit configNeedsSaving();
 }
@@ -2408,7 +2409,10 @@
 mainConfig = new KConfigGroup(containmentConfig, 
QString::number(appletId));
 } else {
 KConfigGroup appletConfig;
-if (q-containment()) {
+Plasma::Applet *parentApplet = qobject_castPlasma::Applet 
*(q-parent());
+if (parentApplet  q-containment()  parentApplet != 
q-containment()) {
+appletConfig = KConfigGroup(parentApplet-config(), Applets);
+} else if (q-containment()) {
 appletConfig = q-containment()-config();
 appletConfig = KConfigGroup(appletConfig, Applets);
 } else {
--- trunk/KDE/kdelibs/plasma/extender.cpp #989519:989520
@@ -662,6 +662,7 @@
 item = new ExtenderItem(q, extenderItemId.toInt());
 }
 sourceApplet-initExtenderItem(item);
+item-d-sourceApplet = sourceApplet;
 
 if (temporarySourceApplet) {
 delete sourceApplet;
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma

2009-06-30 Thread Aaron J. Seigo
On Tuesday 30 June 2009, Marco Martin wrote:
 allow applet configuration and extenderitems config nested into the
 group of another applet
 this thing is possibly dangerous, so better plasma-devel is informed

could probably get rid of a hack in the systemmonitor related to configuration 
now with this.. :)

this also needs to be reflected in Applet::itemChange. i'm doing that now :)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


KDE/kdelibs/plasma

2009-06-26 Thread Aaron J . Seigo
SVN commit 987462 by aseigo:

clickable tooltips; plasma-devel@ people: please review API one more time
CCMAIL:plasma-devel@kde.org


 M  +77 -34private/tooltip.cpp  
 M  +12 -0 private/tooltip_p.h  
 M  +19 -1 private/windowpreview.cpp  
 M  +4 -0  private/windowpreview_p.h  
 M  +14 -2 tooltipcontent.cpp  
 M  +81 -25tooltipcontent.h  
 M  +55 -10tooltipmanager.cpp  
 M  +24 -1 tooltipmanager.h  


http://websvn.kde.org/?view=revrevision=987462
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma

2009-05-01 Thread Aaron J. Seigo
On Thursday 30 April 2009, Aaron J. Seigo wrote:
 On Thursday 30 April 2009, David Nolden wrote:
  SVN commit 961915 by zwabel:
 
  - Allow painting a background color, or a background pattern behind
  freely floating elements of the theme, to provide a better fallback
  mechanism for transparent themes when composition is not available. The
  color/pattern is

 please revert this commit. (or i will.)

i have reverted these changes, given that David evidently isn't going to.

in fact, there was a new commit today that withdrew the public API bits (which 
is good) but completely failed to address any of the actual design issues 
raised.

David, plasma is not a place where you can simply shove code through simply on 
the merit that you have an svn account. we work together, towards consensus 
and try and keep things focused and on-track. there was discussion about what 
would be workable (a colour wash behind the transparent versions of the svgs, 
drawn from the theme config itself), and if you wish to implement that please 
do so (though please follow the coding style guide; we use the kdelibs coding 
style in libplasma).

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software



signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma

2009-04-30 Thread Aaron J. Seigo
On Thursday 30 April 2009, David Nolden wrote:
 SVN commit 961915 by zwabel:

 - Allow painting a background color, or a background pattern behind freely
 floating elements of the theme, to provide a better fallback mechanism for
 transparent themes when composition is not available. The color/pattern is

please revert this commit. (or i will.)

the added API to libplasma is neither wanted nor needed. i don't know how many 
times i need to say it, or in how many different ways, but while a color is 
fine:

* patterns are not
* dummy wallpaers are not
* it will not be added to any configuration UI as this is a highly specific 
visual tweak and if we add every single one of those in versus, you know, 
doing it _right_ we'll end up with a god awful mess

all that's really required is a colour entry in theme config file that goes 
well with the panel svg... no config, no new API, no complexity.

if you want anything more complex, write a panel containment that does it. i'm 
not interested in polluting libplasma with it, however.

and i'm really unimpressed with how this boils down to an attempt to shove 
though the fake translucent panels feature you want which has been 
explicitly rejected.

and none of this is news ... it was discussed on the mailing list, on 
reviewboard, etc.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software



signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: KDE/kdelibs/plasma/widgets

2009-02-09 Thread Aaron J. Seigo
On Monday 09 February 2009, Marco Martin wrote:
 this is an open question: i'm asking to everybody: opinions how it should
 be?

i don't think the scripting stuff needs anything in the media objects, so they 
don't need to be exposed, nor wrapped further, for them.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software



signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


KDE/kdelibs/plasma

2009-01-22 Thread Aaron J . Seigo
SVN commit 915488 by aseigo:

a lot less popup flickering and repainting. if there are no sideeffects to this 
discovered, this needs to be backported to the 4.2 branch.
CCMAIL:plasma-devel@kde.org


 M  +39 -30dialog.cpp  
 M  +8 -9  popupapplet.cpp  


--- trunk/KDE/kdelibs/plasma/dialog.cpp #915487:915488
@@ -48,8 +48,6 @@
 #include X11/Xlib.h
 #endif
 
-const int resizeAreaMargin = 20;
-
 namespace Plasma
 {
 
@@ -72,8 +70,10 @@
 
 void themeUpdated();
 void adjustView();
+void updateResizeCorners();
 
 Plasma::Dialog *q;
+
 /**
  * Holds the background SVG, to be re-rendered when the cache is 
invalidated,
  * for example by resizing the dialogue.
@@ -124,6 +124,7 @@
 } else {
 q-setContentsMargins(leftWidth, topHeight, rightWidth, bottomHeight);
 }
+
 q-update();
 }
 
@@ -196,32 +197,8 @@
 void Dialog::paintEvent(QPaintEvent *e)
 {
 QPainter p(this);
-p.setRenderHint(QPainter::Antialiasing);
-p.setClipRect(e-rect());
 p.setCompositionMode(QPainter::CompositionMode_Source);
-d-background-paintFrame(p);
-
-//we set the resize handlers
-d-resizeAreas.clear();
-if (d-resizeCorners  Dialog::NorthEast) {
-d-resizeAreas[Dialog::NorthEast] = QRect(rect().right() - 
resizeAreaMargin, 0,
- resizeAreaMargin, 
resizeAreaMargin);
-}
-
-if (d-resizeCorners  Dialog::NorthWest) {
-d-resizeAreas[Dialog::NorthWest] = QRect(0, 0, resizeAreaMargin, 
resizeAreaMargin);
-}
-
-if (d-resizeCorners  Dialog::SouthEast) {
-d-resizeAreas[Dialog::SouthEast] = QRect(rect().right() - 
resizeAreaMargin,
-rect().bottom() - resizeAreaMargin,
-resizeAreaMargin, 
resizeAreaMargin);
-}
-
-if (d-resizeCorners  Dialog::SouthWest) {
-d-resizeAreas[Dialog::SouthWest] = QRect(0, rect().bottom() - 
resizeAreaMargin,
-resizeAreaMargin, 
resizeAreaMargin);
-}
+d-background-paintFrame(p, e-rect());
 }
 
 void Dialog::mouseMoveEvent(QMouseEvent *event)
@@ -340,8 +317,38 @@
 
d-view-setSceneRect(d-widget-mapToScene(d-widget-boundingRect()).boundingRect());
 d-view-centerOn(d-widget);
 }
+
+d-updateResizeCorners();
 }
 
+void DialogPrivate::updateResizeCorners()
+{
+const int resizeAreaMargin = 20;
+const QRect r = q-rect();
+
+resizeAreas.clear();
+if (resizeCorners  Dialog::NorthEast) {
+resizeAreas[Dialog::NorthEast] = QRect(r.right() - resizeAreaMargin, 0,
+   resizeAreaMargin, 
resizeAreaMargin);
+}
+
+if (resizeCorners  Dialog::NorthWest) {
+resizeAreas[Dialog::NorthWest] = QRect(0, 0, resizeAreaMargin, 
resizeAreaMargin);
+}
+
+if (resizeCorners  Dialog::SouthEast) {
+resizeAreas[Dialog::SouthEast] = QRect(r.right() - resizeAreaMargin,
+   r.bottom() - resizeAreaMargin,
+   resizeAreaMargin, 
resizeAreaMargin);
+}
+
+if (resizeCorners  Dialog::SouthWest) {
+resizeAreas[Dialog::SouthWest] = QRect(0, r.bottom() - 
resizeAreaMargin,
+   resizeAreaMargin, 
resizeAreaMargin);
+}
+
+}
+
 void Dialog::setGraphicsWidget(QGraphicsWidget *widget)
 {
 if (d-widget) {
@@ -412,14 +419,16 @@
 
d-view-setSceneRect(d-widget-mapToScene(d-widget-boundingRect()).boundingRect());
 d-view-centerOn(d-widget);
 }
-
+
 emit dialogVisible(true);
 }
 
 void Dialog::setResizeHandleCorners(ResizeCorners corners)
 {
-d-resizeCorners = corners;
-update();
+if (d-resizeCorners != corners) {
+d-resizeCorners = corners;
+d-updateResizeCorners();
+}
 }
 
 Dialog::ResizeCorners Dialog::resizeCorners() const
--- trunk/KDE/kdelibs/plasma/popupapplet.cpp #915487:915488
@@ -478,7 +478,6 @@
 updateDialogPosition();
 KWindowSystem::setState(dialog-winId(), NET::SkipTaskbar | 
NET::SkipPager);
 dialog-show();
-dialog-resize(dialog-size());
 }
 
 dialog-clearFocus();
@@ -544,22 +543,22 @@
 QSize saved(width, height);
 
 if (saved.isNull()) {
-dialog-adjustSize();
+saved = dialog-sizeHint();
 } else {
 saved = saved.expandedTo(dialog-minimumSizeHint());
+}
+
+if (saved.width() != dialog-width() || saved.height() != 
dialog-height()) {
 dialog-resize(saved);
 }
 
 QSize s = dialog-size();
 QPoint pos = view-mapFromScene(q-scenePos());
+
 //try to access a corona
-if (q-containment()  q-containment()-corona()) {
-pos = q-containment()-corona()-popupPosition(q, s);
-} else {
-Corona *corona = qobject_castCorona *(q-scene());
-if (corona) {
-pos = corona-popupPosition(q, s