/* GTK - The GIMP Toolkit *gtktrashmonitor.h:Monitorthetrash:/// folder to see if there is trash or not *Copyright(C)2011Suse * *Thisprogramisfreesoftware;youcanredistributeitand/ormodify *itunderthetermsoftheGNULesserGeneralPublicLicenseas *publishedbytheFreeSoftwareFoundation;eitherversion2.1ofthe *License,or(atyouroption)anylaterversion. * *Thisprogramisdistributedinthehopethatitwillbeuseful, *butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof *MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe *GNULesserGeneralPublicLicenseformoredetails. * *YoushouldhavereceivedacopyoftheGNULesserGeneralPublicLicense *alongwiththisprogram;ifnot,see<http://www.gnu.org/licenses/>. * *Authors:FedericoMenaQuintero<federico@gnome.org>
*/
/* Updates the internal has_trash flag and emits the "trash-state-changed" signal */ staticvoid
update_has_trash_and_notify (GtkTrashMonitor *monitor,
gboolean has_trash)
{ if (monitor->has_trash == !!has_trash) return;
/* Asynchronously recomputes whether there is trash or not */ staticvoid
recompute_trash_state (GtkTrashMonitor *monitor)
{
GFile *file;
/* Rate limit the updates to not flood the gvfsd-trash when too many changes *happenedinashorttime.
*/ if (monitor->timeout_id > 0)
{
monitor->pending = TRUE; return;
}
/* Callback used when the "trash:///" file monitor changes; we just recompute the trash state *wheneversomethinghappens.
*/ staticvoid
file_monitor_changed_cb (GFileMonitor *file_monitor,
GFile *child,
GFile *other_file,
GFileMonitorEvent event_type,
GtkTrashMonitor *monitor)
{
recompute_trash_state (monitor);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.