]> sigrok.org Git - libsigrok.git/commitdiff
Revert "session_file.c: Use config_*() wrappers."
authorUwe Hermann <redacted>
Tue, 24 Mar 2015 22:35:29 +0000 (23:35 +0100)
committerUwe Hermann <redacted>
Tue, 24 Mar 2015 22:35:29 +0000 (23:35 +0100)
This temporarily reverts commit 421bc3eba02f060319c752a26461148fc93563ec.

We cannot yet use the sr_config_*() wrappers, otherwise loading *.sr
files is broken. A fix is being worked on.

src/session_file.c

index b8a1cb60d8e098d2986319767db2760a982ec461..91d4d7775f9f2223e3f4ca58f3259d8fcfa2cbcd 100644 (file)
@@ -180,11 +180,10 @@ SR_API int sr_session_load(const char *filename, struct sr_session **session)
                                        sr_session_dev_add(*session, sdi);
                                        (*session)->owned_devs = g_slist_append(
                                                        (*session)->owned_devs, sdi);
-
-                                       sr_config_set(sdi, NULL, SR_CONF_SESSIONFILE,
-                                                       g_variant_new_string(filename));
-                                       sr_config_set(sdi, NULL, SR_CONF_CAPTUREFILE,
-                                                       g_variant_new_string(val));
+                                       sdi->driver->config_set(SR_CONF_SESSIONFILE,
+                                                       g_variant_new_string(filename), sdi, NULL);
+                                       sdi->driver->config_set(SR_CONF_CAPTUREFILE,
+                                                       g_variant_new_string(val), sdi, NULL);
                                        g_ptr_array_add(capturefiles, val);
                                } else if (!strcmp(keys[j], "samplerate")) {
                                        if (!sdi) {
@@ -192,24 +191,24 @@ SR_API int sr_session_load(const char *filename, struct sr_session **session)
                                                break;
                                        }
                                        sr_parse_sizestring(val, &tmp_u64);
-                                       sr_config_set(sdi, NULL, SR_CONF_SAMPLERATE,
-                                                       g_variant_new_uint64(tmp_u64));
+                                       sdi->driver->config_set(SR_CONF_SAMPLERATE,
+                                                       g_variant_new_uint64(tmp_u64), sdi, NULL);
                                } else if (!strcmp(keys[j], "unitsize")) {
                                        if (!sdi) {
                                                ret = SR_ERR_DATA;
                                                break;
                                        }
                                        tmp_u64 = strtoull(val, NULL, 10);
-                                       sr_config_set(sdi, NULL, SR_CONF_CAPTURE_UNITSIZE,
-                                                       g_variant_new_uint64(tmp_u64));
+                                       sdi->driver->config_set(SR_CONF_CAPTURE_UNITSIZE,
+                                                       g_variant_new_uint64(tmp_u64), sdi, NULL);
                                } else if (!strcmp(keys[j], "total probes")) {
                                        if (!sdi) {
                                                ret = SR_ERR_DATA;
                                                break;
                                        }
                                        total_channels = strtoull(val, NULL, 10);
-                                       sr_config_set(sdi, NULL, SR_CONF_NUM_LOGIC_CHANNELS,
-                                                       g_variant_new_uint64(total_channels));
+                                       sdi->driver->config_set(SR_CONF_NUM_LOGIC_CHANNELS,
+                                                       g_variant_new_uint64(total_channels), sdi, NULL);
                                        for (p = 0; p < total_channels; p++) {
                                                snprintf(channelname, SR_MAX_CHANNELNAME_LEN, "%" PRIu64, p);
                                                sr_channel_new(sdi, p, SR_CHANNEL_LOGIC, FALSE,