~ubuntu-branches/debian/experimental/devicekit-disks/experimental

« back to all changes in this revision

Viewing changes to src/devkit-disks-device-private.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-10-09 17:52:20 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091009175220-qflk71dp3tmcyer3
Tags: 007-2
* debian/rules: Enable quilt patch system. Add quilt build dependency.
* Add 01-mkfs-tempdir.patch: Daemon does not create /var/run/DeviceKit-disks/,
  so mkfs jobs fail. Just create the directory in /tmp, this is what /tmp is
  for, after all. (See https://bugs.freedesktop.org/show_bug.cgi?id=24265)
* Add 00git-fix-inhibit.patch: Actually make Inhibit() work again. Taken
  from upstream git head. (LP: #428133)
* Add 02-unlock-CD-trays-after-mounting.patch: Unlike in the hal world, we
  do not have a daemon polling CD drives for eject button presses. In order
  to make hardware tray eject buttons work, unlock the tray after
  mounting a CD. This is pretty much equivalent to yanking out USB sticks,
  which we already handle reasonably (detecting disappeared device,
  force-unmounting). (https://bugs.freedesktop.org/show_bug.cgi?id=24052,
  LP: #397734)
* Add 03-fix-subsystem-check-for-firewire.patch: Firewire subsystem is
  called "ieee1394" in current Linux. Now check for both "ieee1394" and
  "firewire". This fixes firewire drives to not be considered system
  internal any more. (https://bugs.freedesktop.org/show_bug.cgi?id=24351,
  LP: #442604)
* Add 04-mount-vfat-with-shortname-mixed-by-default.patch: The previous
  default, shortname=lower, breaks all-uppercase file names ("touch
  FOO" creates "foo"), thus breaks rsync, and Windows compatibility. The
  default was changed in the Linux kernel for 2.6.32 as well.
  (https://bugs.freedesktop.org/show_bug.cgi?id=24129, LP: #428174)
* Add 00git-crash-on-removing-NULL-value-from-hash.patch: Properly handle
  the situtation where we're processing a 'change' event but the 'remove'
  event has happened but is still queued up in our own process. Also handle
  device file renames and 'move' uevents.
  (http://bugs.freedesktop.org/show_bug.cgi?id=24264, LP: #414407)
* Add 06-show-MMC-MemStick-cards-by-default.patch: Show MMC/MemStick cards
  by default; the previous whitelist in the udev rules ignored them.
  (https://bugs.freedesktop.org/show_bug.cgi?id=24053, LP: #429752)
* Add 05-german-translations.patch: Add German translations.
  (https://bugs.freedesktop.org/show_bug.cgi?id=2024420)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
  //g_debug ("XXX emitting 'changed' in idle");
34
34
 
35
 
  g_signal_emit_by_name (device->priv->daemon,
36
 
                         "device-changed",
37
 
                         device->priv->object_path);
38
 
  g_signal_emit_by_name (device, "changed");
39
 
 
 
35
  if (!device->priv->removed)
 
36
    {
 
37
      g_print ("**** EMITTING CHANGED for %s\n", device->priv->native_path);
 
38
      g_signal_emit_by_name (device->priv->daemon,
 
39
                             "device-changed",
 
40
                             device->priv->object_path);
 
41
      g_signal_emit_by_name (device, "changed");
 
42
    }
40
43
  device->priv->emit_changed_idle_id = 0;
41
44
 
42
45
  /* remove the idle source */
419
422
}
420
423
 
421
424
void
 
425
devkit_disks_device_set_device_presentation_nopolicy (DevkitDisksDevice *device, gboolean value)
 
426
{
 
427
  if (G_UNLIKELY (device->priv->device_presentation_nopolicy != value))
 
428
    {
 
429
      device->priv->device_presentation_nopolicy = value;
 
430
      emit_changed (device, "device_presentation_nopolicy");
 
431
    }
 
432
}
 
433
 
 
434
void
422
435
devkit_disks_device_set_device_presentation_name (DevkitDisksDevice *device, const gchar *value)
423
436
{
424
437
  if (G_UNLIKELY (g_strcmp0 (device->priv->device_presentation_name, value) != 0))
720
733
}
721
734
 
722
735
void
723
 
devkit_disks_device_set_drive_requires_eject (DevkitDisksDevice *device, gboolean value)
724
 
{
725
 
  if (G_UNLIKELY (device->priv->drive_requires_eject != value))
726
 
    {
727
 
      device->priv->drive_requires_eject = value;
728
 
      emit_changed (device, "drive_requires_eject");
 
736
devkit_disks_device_set_drive_can_detach (DevkitDisksDevice *device, gboolean value)
 
737
{
 
738
  if (G_UNLIKELY (device->priv->drive_can_detach != value))
 
739
    {
 
740
      device->priv->drive_can_detach = value;
 
741
      emit_changed (device, "drive_can_detach");
 
742
    }
 
743
}
 
744
 
 
745
void
 
746
devkit_disks_device_set_drive_can_spindown (DevkitDisksDevice *device, gboolean value)
 
747
{
 
748
  if (G_UNLIKELY (device->priv->drive_can_spindown != value))
 
749
    {
 
750
      device->priv->drive_can_spindown = value;
 
751
      emit_changed (device, "drive_can_spindown");
 
752
    }
 
753
}
 
754
 
 
755
void
 
756
devkit_disks_device_set_drive_is_rotational (DevkitDisksDevice *device, gboolean value)
 
757
{
 
758
  if (G_UNLIKELY (device->priv->drive_is_rotational != value))
 
759
    {
 
760
      device->priv->drive_is_rotational = value;
 
761
      emit_changed (device, "drive_is_rotational");
729
762
    }
730
763
}
731
764
 
1081
1114
}
1082
1115
 
1083
1116
void
1084
 
devkit_disks_device_set_drive_ata_smart_is_failing (DevkitDisksDevice *device, gboolean value)
1085
 
{
1086
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_is_failing != value))
1087
 
    {
1088
 
      device->priv->drive_ata_smart_is_failing = value;
1089
 
      emit_changed (device, "drive_ata_smart_is_failing");
1090
 
    }
1091
 
}
1092
 
 
1093
 
void
1094
 
devkit_disks_device_set_drive_ata_smart_is_failing_valid (DevkitDisksDevice *device, gboolean value)
1095
 
{
1096
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_is_failing_valid != value))
1097
 
    {
1098
 
      device->priv->drive_ata_smart_is_failing_valid = value;
1099
 
      emit_changed (device, "drive_ata_smart_is_failing_valid");
1100
 
    }
1101
 
}
1102
 
 
1103
 
void
1104
 
devkit_disks_device_set_drive_ata_smart_has_bad_sectors (DevkitDisksDevice *device, gboolean value)
1105
 
{
1106
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_has_bad_sectors != value))
1107
 
    {
1108
 
      device->priv->drive_ata_smart_has_bad_sectors = value;
1109
 
      emit_changed (device, "drive_ata_smart_has_bad_sectors");
1110
 
    }
1111
 
}
1112
 
 
1113
 
void
1114
 
devkit_disks_device_set_drive_ata_smart_has_bad_attributes (DevkitDisksDevice *device, gboolean value)
1115
 
{
1116
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_has_bad_attributes != value))
1117
 
    {
1118
 
      device->priv->drive_ata_smart_has_bad_attributes = value;
1119
 
      emit_changed (device, "drive_ata_smart_has_bad_attributes");
1120
 
    }
1121
 
}
1122
 
 
1123
 
void
1124
 
devkit_disks_device_set_drive_ata_smart_temperature_kelvin (DevkitDisksDevice *device, gdouble value)
1125
 
{
1126
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_temperature_kelvin != value))
1127
 
    {
1128
 
      device->priv->drive_ata_smart_temperature_kelvin = value;
1129
 
      emit_changed (device, "drive_ata_smart_temperature_kelvin");
1130
 
    }
1131
 
}
1132
 
 
1133
 
void
1134
 
devkit_disks_device_set_drive_ata_smart_power_on_seconds (DevkitDisksDevice *device, guint64 value)
1135
 
{
1136
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_power_on_seconds != value))
1137
 
    {
1138
 
      device->priv->drive_ata_smart_power_on_seconds = value;
1139
 
      emit_changed (device, "drive_ata_smart_power_on_seconds");
1140
 
    }
1141
 
}
1142
 
 
1143
 
void
1144
1117
devkit_disks_device_set_drive_ata_smart_time_collected (DevkitDisksDevice *device, guint64 value)
1145
1118
{
1146
1119
  if (G_UNLIKELY (device->priv->drive_ata_smart_time_collected != value))
1151
1124
}
1152
1125
 
1153
1126
void
1154
 
devkit_disks_device_set_drive_ata_smart_offline_data_collection_status (DevkitDisksDevice *device, guint value)
1155
 
{
1156
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_offline_data_collection_status != value))
1157
 
    {
1158
 
      device->priv->drive_ata_smart_offline_data_collection_status = value;
1159
 
      emit_changed (device, "drive_ata_smart_offline_data_collection_status");
1160
 
    }
1161
 
}
1162
 
 
1163
 
void
1164
 
devkit_disks_device_set_drive_ata_smart_offline_data_collection_seconds (DevkitDisksDevice *device, guint value)
1165
 
{
1166
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_offline_data_collection_seconds != value))
1167
 
    {
1168
 
      device->priv->drive_ata_smart_offline_data_collection_seconds = value;
1169
 
      emit_changed (device, "drive_ata_smart_offline_data_collection_seconds");
1170
 
    }
1171
 
}
1172
 
 
1173
 
void
1174
 
devkit_disks_device_set_drive_ata_smart_self_test_execution_status (DevkitDisksDevice *device, guint value)
1175
 
{
1176
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_self_test_execution_status != value))
1177
 
    {
1178
 
      device->priv->drive_ata_smart_self_test_execution_status = value;
1179
 
      emit_changed (device, "drive_ata_smart_self_test_execution_status");
1180
 
    }
1181
 
}
1182
 
 
1183
 
void
1184
 
devkit_disks_device_set_drive_ata_smart_self_test_execution_percent_remaining (DevkitDisksDevice *device, guint value)
1185
 
{
1186
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_self_test_execution_percent_remaining != value))
1187
 
    {
1188
 
      device->priv->drive_ata_smart_self_test_execution_percent_remaining = value;
1189
 
      emit_changed (device, "drive_ata_smart_self_test_execution_percent_remaining");
1190
 
    }
1191
 
}
1192
 
 
1193
 
void
1194
 
devkit_disks_device_set_drive_ata_smart_short_and_extended_self_test_available (DevkitDisksDevice *device, gboolean value)
1195
 
{
1196
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_short_and_extended_self_test_available != value))
1197
 
    {
1198
 
      device->priv->drive_ata_smart_short_and_extended_self_test_available = value;
1199
 
      emit_changed (device, "drive_ata_smart_short_and_extended_self_test_available");
1200
 
    }
1201
 
}
1202
 
 
1203
 
void
1204
 
devkit_disks_device_set_drive_ata_smart_conveyance_self_test_available (DevkitDisksDevice *device, gboolean value)
1205
 
{
1206
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_conveyance_self_test_available != value))
1207
 
    {
1208
 
      device->priv->drive_ata_smart_conveyance_self_test_available = value;
1209
 
      emit_changed (device, "drive_ata_smart_conveyance_self_test_available");
1210
 
    }
1211
 
}
1212
 
 
1213
 
void
1214
 
devkit_disks_device_set_drive_ata_smart_start_self_test_available (DevkitDisksDevice *device, gboolean value)
1215
 
{
1216
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_start_self_test_available != value))
1217
 
    {
1218
 
      device->priv->drive_ata_smart_start_self_test_available = value;
1219
 
      emit_changed (device, "drive_ata_smart_start_self_test_available");
1220
 
    }
1221
 
}
1222
 
 
1223
 
void
1224
 
devkit_disks_device_set_drive_ata_smart_abort_self_test_available (DevkitDisksDevice *device, gboolean value)
1225
 
{
1226
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_abort_self_test_available != value))
1227
 
    {
1228
 
      device->priv->drive_ata_smart_abort_self_test_available = value;
1229
 
      emit_changed (device, "drive_ata_smart_abort_self_test_available");
1230
 
    }
1231
 
}
1232
 
 
1233
 
void
1234
 
devkit_disks_device_set_drive_ata_smart_short_self_test_polling_minutes (DevkitDisksDevice *device, guint value)
1235
 
{
1236
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_short_self_test_polling_minutes != value))
1237
 
    {
1238
 
      device->priv->drive_ata_smart_short_self_test_polling_minutes = value;
1239
 
      emit_changed (device, "drive_ata_smart_short_self_test_polling_minutes");
1240
 
    }
1241
 
}
1242
 
 
1243
 
void
1244
 
devkit_disks_device_set_drive_ata_smart_extended_self_test_polling_minutes (DevkitDisksDevice *device, guint value)
1245
 
{
1246
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_extended_self_test_polling_minutes != value))
1247
 
    {
1248
 
      device->priv->drive_ata_smart_extended_self_test_polling_minutes = value;
1249
 
      emit_changed (device, "drive_ata_smart_extended_self_test_polling_minutes");
1250
 
    }
1251
 
}
1252
 
 
1253
 
void
1254
 
devkit_disks_device_set_drive_ata_smart_conveyance_self_test_polling_minutes (DevkitDisksDevice *device, guint value)
1255
 
{
1256
 
  if (G_UNLIKELY (device->priv->drive_ata_smart_conveyance_self_test_polling_minutes != value))
1257
 
    {
1258
 
      device->priv->drive_ata_smart_conveyance_self_test_polling_minutes = value;
1259
 
      emit_changed (device, "drive_ata_smart_conveyance_self_test_polling_minutes");
1260
 
    }
1261
 
}
1262
 
 
1263
 
void
1264
 
devkit_disks_device_set_drive_ata_smart_attributes_steal (DevkitDisksDevice *device, GPtrArray *attributes)
 
1127
devkit_disks_device_set_drive_ata_smart_status (DevkitDisksDevice *device, SkSmartOverall value)
 
1128
{
 
1129
  if (G_UNLIKELY (device->priv->drive_ata_smart_status != value))
 
1130
    {
 
1131
      device->priv->drive_ata_smart_status = value;
 
1132
      emit_changed (device, "drive_ata_smart_status");
 
1133
    }
 
1134
}
 
1135
 
 
1136
void
 
1137
devkit_disks_device_set_drive_ata_smart_blob_steal (DevkitDisksDevice *device, gchar *blob, gsize blob_size)
1265
1138
{
1266
1139
  /* TODO: compare? Not really needed, this happens very rarely */
1267
1140
 
1268
 
  g_ptr_array_foreach (device->priv->drive_ata_smart_attributes, (GFunc) g_value_array_free, NULL);
1269
 
  g_ptr_array_free (device->priv->drive_ata_smart_attributes, TRUE);
1270
 
 
1271
 
  device->priv->drive_ata_smart_attributes = attributes;
1272
 
 
1273
 
  emit_changed (device, "drive_ata_smart_attributes");
 
1141
  g_free (device->priv->drive_ata_smart_blob);
 
1142
  device->priv->drive_ata_smart_blob = blob;
 
1143
  device->priv->drive_ata_smart_blob_size = blob_size;
 
1144
 
 
1145
  emit_changed (device, "drive_ata_smart_blob");
1274
1146
}