Review Request: Patch to add free space indicator into device notifier plasmoid

Alessandro Diaferia alediaferia at gmail.com
Tue Aug 25 12:29:11 CEST 2009


2009/8/22 Jacopo De Simoi <wilderkde at gmail.com>

> I've not been connected to the internet for a few days, so please disregard
> this message if it is outdated.
>
> The problem is in fact in the solid plasma engine; the patch works as
> expected (*) with the following patch in soliddeviceengine.cpp
>
> Index: soliddeviceengine.cpp
> ===================================================================
> --- soliddeviceengine.cpp=(revision 1013054)
> +++ soliddeviceengine.cpp=(working copy)
>
> @@ -596,7 +597,7 @@
>  void SolidDeviceEngine::deviceChanged(const QString& udi, const QString
> &property, const QVariant &value)
>  {
>     setData(udi, property, value);
> -    scheduleSourcesUpdated();
> +    updateAllSources();
>  }
>
>  #include "soliddeviceengine.moc"
>
> However I see a couple of problems with the patch; the first one is that,
> for consistency, I believe the result should look like what is shown in
> KFilePlaces; the second one is that (*) the free disk space is not updated
> if files are added/removed. This is ultimately a problem with the engine but
> makes the free space indicator only partially useful;
>  I see two solutions:
> - Once the device is made accessible trigger an update of the free disk
> space every (say) 10 seconds
> - Make the KCapacityBar appear on hover and trigger an update of the free
> disk space on hover;
>
> I personally like the second possibility more than the first one,
> Best
>   --J
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>


I've already committed a patch for the soliddevice engine and it is the
following:

SVN commit 1013933 by adiaferia:

immediately update free space and hd temp in order to let applets be aware
of the status change of the device

 M  +2 -4      soliddeviceengine.cpp


--- trunk/KDE/kdebase/workspace/plasma/dataengines/soliddevice/soliddeviceengine.cpp
#1013932:1013933
@@ -507,8 +507,6 @@
            setData(query, predicatemap[query]);
        }
    }
-
-    scheduleSourcesUpdated();
 }

 qlonglong SolidDeviceEngine::freeDiskSpace(const QString &mountPoint)
@@ -591,13 +589,13 @@

    devicemap.remove(udi);
    removeSource(udi);
-    scheduleSourcesUpdated();
 }

 void SolidDeviceEngine::deviceChanged(const QString& udi, const QString
&property, const QVariant &value)
 {
    setData(udi, property, value);
-    scheduleSourcesUpdated();
+    updateFreeSpace(udi);
+    updateHardDiskTemperature(udi);
 }

 #include "soliddeviceengine.moc"


But i dunno if now it updates when files are added/removed. I feel the fix
should go into the engine imho anyway :)

Regards

-- 
Alessandro Diaferia
KDE Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20090825/579f0392/attachment.htm 


More information about the Plasma-devel mailing list