summaryrefslogtreecommitdiff
path: root/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master
diff options
context:
space:
mode:
authorraveit65 (via Travis CI) <[email protected]>2024-02-22 18:58:56 +0000
committerraveit65 (via Travis CI) <[email protected]>2024-02-22 18:58:56 +0000
commitfac22fad6c018807799a4849934a67229c28a27a (patch)
tree9a885eaed09a944a4203d4c69b675cbab3aae531 /2021-06-25-153248-0614-cppcheck@198f334ccf4c_master
downloadmate-user-share-fac22fad6c018807799a4849934a67229c28a27a.tar.bz2
mate-user-share-fac22fad6c018807799a4849934a67229c28a27a.tar.xz
Deploy mate-desktop/mate-user-share to github.com/mate-desktop/mate-user-share.git:gh-pagesgh-pages
Diffstat (limited to '2021-06-25-153248-0614-cppcheck@198f334ccf4c_master')
-rw-r--r--2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/0.html1505
-rw-r--r--2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/1.html1061
-rw-r--r--2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/2.html1295
-rw-r--r--2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/3.html771
-rw-r--r--2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/4.html1189
-rw-r--r--2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/index.html141
-rw-r--r--2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/stats.html109
-rw-r--r--2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/style.css137
8 files changed, 6208 insertions, 0 deletions
diff --git a/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/0.html b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/0.html
new file mode 100644
index 0000000..e20d301
--- /dev/null
+++ b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/0.html
@@ -0,0 +1,1505 @@
+
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-user-share</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+pre { line-height: 125%; }
+td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
+span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
+td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #ffffff; }
+.highlight .c { color: #888888 } /* Comment */
+.highlight .err { color: #FF0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #008800; font-weight: bold } /* Keyword */
+.highlight .o { color: #333333 } /* Operator */
+.highlight .ch { color: #888888 } /* Comment.Hashbang */
+.highlight .cm { color: #888888 } /* Comment.Multiline */
+.highlight .cp { color: #557799 } /* Comment.Preproc */
+.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
+.highlight .c1 { color: #888888 } /* Comment.Single */
+.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #003388; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #333399; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #6600EE; font-weight: bold } /* Literal.Number */
+.highlight .s { background-color: #fff0f0 } /* Literal.String */
+.highlight .na { color: #0000CC } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #BB0066; font-weight: bold } /* Name.Class */
+.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #880000; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0066BB; font-weight: bold } /* Name.Function */
+.highlight .nl { color: #997700; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #007700 } /* Name.Tag */
+.highlight .nv { color: #996633 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #4400EE; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { background-color: #fff0f0 } /* Literal.String.Affix */
+.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.highlight .sc { color: #0044DD } /* Literal.String.Char */
+.highlight .dl { background-color: #fff0f0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #DD4422 } /* Literal.String.Doc */
+.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.highlight .se { color: #666666; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.highlight .si { background-color: #eeeeee } /* Literal.String.Interpol */
+.highlight .sx { color: #DD2200; background-color: #fff0f0 } /* Literal.String.Other */
+.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.highlight .ss { color: #AA6600 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #0066BB; font-weight: bold } /* Name.Function.Magic */
+.highlight .vc { color: #336699 } /* Name.Variable.Class */
+.highlight .vg { color: #dd7700; font-weight: bold } /* Name.Variable.Global */
+.highlight .vi { color: #3333BB } /* Name.Variable.Instance */
+.highlight .vm { color: #996633 } /* Name.Variable.Magic */
+.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
+ </style>
+ <script>
+ function getStyle(el, styleProp) {
+ var y;
+
+ if (el.currentStyle) {
+ y = el.currentStyle[styleProp];
+ } else if (window.getComputedStyle) {
+ y = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
+ }
+
+ return y;
+ }
+
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+
+ if (el.style.display === "block") {
+ el.style.display = "none";
+ mark.textContent = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.textContent = "[-]";
+ }
+ }
+
+ function initExpandables() {
+ var elements = document.querySelectorAll(".expandable");
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ var el = elements[i];
+ var clickable = el.querySelector("span");
+ var marker = clickable.querySelector(".marker");
+ var content = el.querySelector(".content");
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.addEventListener("click", toggle);
+ }
+ }
+
+ function toggleDisplay(id) {
+ var elements = document.querySelectorAll("." + id);
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ elements[i].classList.toggle("d-none");
+ }
+ }
+
+ function toggleAll() {
+ var elements = document.querySelectorAll("input");
+
+ // starting from 1 since 0 is the "toggle all" input
+ for (var i = 1, len = elements.length; i < len; i++) {
+ var el = elements[i];
+
+ if (el.checked) {
+ el.checked = false;
+ } else {
+ el.checked = true;
+ }
+
+ toggleDisplay(el.id);
+ }
+ }
+ window.addEventListener("load", initExpandables);
+ </script>
+ </head>
+ <body>
+ <div id="header" class="header">
+ <h1>Cppcheck report - mate-user-share: src/file-share-properties.c</h1>
+ </div>
+ <div class="wrapper">
+ <div id="menu">
+ <p id="filename"><a href="index.html">Defects:</a> file-share-properties.c</p>
+<a href="0.html#line-49"> shadowVariable 49</a><a href="0.html#line-49"> shadowVariable 49</a><a href="0.html#line-49"> shadowVariable 49</a><a href="0.html#line-49"> shadowVariable 49</a><a href="0.html#line-49"> shadowVariable 49</a><a href="0.html#line-49"> shadowVariable 49</a><a href="0.html#line-49"> shadowVariable 49</a><a href="0.html#line-49"> shadowVariable 49</a><a href="0.html#line-49"> shadowVariable 49</a><a href="0.html#line-49"> shadowVariable 49</a><a href="0.html#line-83"> variableScope 83</a><a href="0.html#line-98"> shadowVariable 98</a><a href="0.html#line-106"> unusedVariable 106</a><a href="0.html#line-250"> shadowVariable 250</a><a href="0.html#line-274"> shadowVariable 274</a><a href="0.html#line-295"> shadowVariable 295</a><a href="0.html#line-324"> shadowVariable 324</a><a href="0.html#line-341"> shadowVariable 341</a><a href="0.html#line-358"> shadowVariable 358</a><a href="0.html#line-378"> shadowVariable 378</a><a href="0.html#line-394"> shadowVariable 394</a><a href="0.html#line-458"> shadowVariable 458</a><a href="0.html#line-621"> variableScope 621</a>
+ </div>
+ <div id="content">
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653</pre></div></td><td class="code"><div class="highlight"><pre><span></span><a name="line-1"></a><span class="cm">/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */</span>
+<a name="line-2"></a>
+<a name="line-3"></a><span class="cm">/*</span>
+<a name="line-4"></a><span class="cm"> * Copyright (C) 2004 Red Hat, Inc.</span>
+<a name="line-5"></a><span class="cm"> * Copyright (C) 2012-2021 MATE Developers</span>
+<a name="line-6"></a><span class="cm"> *</span>
+<a name="line-7"></a><span class="cm"> * Caja is free software; you can redistribute it and/or</span>
+<a name="line-8"></a><span class="cm"> * modify it under the terms of the GNU General Public License as</span>
+<a name="line-9"></a><span class="cm"> * published by the Free Software Foundation; either version 2 of the</span>
+<a name="line-10"></a><span class="cm"> * License, or (at your option) any later version.</span>
+<a name="line-11"></a><span class="cm"> *</span>
+<a name="line-12"></a><span class="cm"> * Caja is distributed in the hope that it will be useful,</span>
+<a name="line-13"></a><span class="cm"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
+<a name="line-14"></a><span class="cm"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
+<a name="line-15"></a><span class="cm"> * General Public License for more details.</span>
+<a name="line-16"></a><span class="cm"> *</span>
+<a name="line-17"></a><span class="cm"> * You should have received a copy of the GNU General Public License</span>
+<a name="line-18"></a><span class="cm"> * along with this program; if not, write to the Free Software</span>
+<a name="line-19"></a><span class="cm"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span>
+<a name="line-20"></a><span class="cm"> *</span>
+<a name="line-21"></a><span class="cm"> * Authors: Alexander Larsson &lt;[email protected]&gt;</span>
+<a name="line-22"></a><span class="cm"> *</span>
+<a name="line-23"></a><span class="cm"> */</span>
+<a name="line-24"></a>
+<a name="line-25"></a><span class="cp">#include</span> <span class="cpf">&quot;config.h&quot;</span><span class="cp"></span>
+<a name="line-26"></a>
+<a name="line-27"></a><span class="cp">#include</span> <span class="cpf">&lt;string.h&gt;</span><span class="cp"></span>
+<a name="line-28"></a><span class="cp">#include</span> <span class="cpf">&lt;stdio.h&gt;</span><span class="cp"></span>
+<a name="line-29"></a>
+<a name="line-30"></a><span class="cp">#include</span> <span class="cpf">&lt;gtk/gtk.h&gt;</span><span class="cp"></span>
+<a name="line-31"></a><span class="cp">#include</span> <span class="cpf">&lt;glib/gi18n.h&gt;</span><span class="cp"></span>
+<a name="line-32"></a><span class="cp">#include</span> <span class="cpf">&lt;gio/gio.h&gt;</span><span class="cp"></span>
+<a name="line-33"></a>
+<a name="line-34"></a><span class="cp">#include</span> <span class="cpf">&quot;user_share-private.h&quot;</span><span class="cp"></span>
+<a name="line-35"></a>
+<a name="line-36"></a><span class="cp">#define REALM &quot;Please log in as the user guest&quot;</span>
+<a name="line-37"></a><span class="cp">#define USER &quot;guest&quot;</span>
+<a name="line-38"></a><span class="cp">#define GSETTINGS_SCHEMA &quot;org.mate.FileSharing&quot;</span>
+<a name="line-39"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_ENABLED &quot;enabled&quot;</span>
+<a name="line-40"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ENABLED &quot;bluetooth-enabled&quot;</span>
+<a name="line-41"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_REQUIRE_PASSWORD &quot;require-password&quot;</span>
+<a name="line-42"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ALLOW_WRITE &quot;bluetooth-allow-write&quot;</span>
+<a name="line-43"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_REQUIRE_PAIRING &quot;bluetooth-require-pairing&quot;</span>
+<a name="line-44"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED &quot;bluetooth-obexpush-enabled&quot;</span>
+<a name="line-45"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES &quot;bluetooth-accept-files&quot;</span>
+<a name="line-46"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY &quot;bluetooth-notify&quot;</span>
+<a name="line-47"></a>
+<a name="line-48"></a><span class="k">static</span> <span class="n">GtkBuilder</span><span class="o">*</span> <span class="n">builder</span><span class="p">;</span>
+<a name="line-49"></a><span class="hll"><span class="k">static</span> <span class="n">GSettings</span><span class="o">*</span> <span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadowed declaration</span><span class="error2">&lt;--- Shadowed declaration</span><span class="error2">&lt;--- Shadowed declaration</span><span class="error2">&lt;--- Shadowed declaration</span><span class="error2">&lt;--- Shadowed declaration</span><span class="error2">&lt;--- Shadowed declaration</span><span class="error2">&lt;--- Shadowed declaration</span><span class="error2">&lt;--- Shadowed declaration</span><span class="error2">&lt;--- Shadowed declaration</span><span class="error2">&lt;--- Shadowed declaration</span>
+</span><a name="line-50"></a>
+<a name="line-51"></a>
+<a name="line-52"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-53"></a><span class="n">write_out_password</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">password</span><span class="p">)</span>
+<a name="line-54"></a><span class="p">{</span>
+<a name="line-55"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">to_hash</span><span class="p">;</span>
+<a name="line-56"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">ascii_digest</span><span class="p">;</span>
+<a name="line-57"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">line</span><span class="p">;</span>
+<a name="line-58"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">filename</span><span class="p">;</span>
+<a name="line-59"></a> <span class="kt">FILE</span> <span class="o">*</span><span class="n">file</span><span class="p">;</span>
+<a name="line-60"></a>
+<a name="line-61"></a> <span class="n">to_hash</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;%s:%s:%s&quot;</span><span class="p">,</span> <span class="n">USER</span><span class="p">,</span> <span class="n">REALM</span><span class="p">,</span> <span class="n">password</span><span class="p">);</span>
+<a name="line-62"></a> <span class="n">ascii_digest</span> <span class="o">=</span> <span class="n">g_compute_checksum_for_string</span> <span class="p">(</span><span class="n">G_CHECKSUM_MD5</span><span class="p">,</span> <span class="n">to_hash</span><span class="p">,</span> <span class="n">strlen</span> <span class="p">(</span><span class="n">to_hash</span><span class="p">));</span>
+<a name="line-63"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">to_hash</span><span class="p">);</span>
+<a name="line-64"></a> <span class="n">line</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;%s:%s:%s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">USER</span><span class="p">,</span> <span class="n">REALM</span><span class="p">,</span> <span class="n">ascii_digest</span><span class="p">);</span>
+<a name="line-65"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">ascii_digest</span><span class="p">);</span>
+<a name="line-66"></a>
+<a name="line-67"></a> <span class="n">filename</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">g_get_user_config_dir</span> <span class="p">(),</span> <span class="s">&quot;user-share&quot;</span><span class="p">,</span> <span class="s">&quot;passwd&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-68"></a>
+<a name="line-69"></a> <span class="n">file</span> <span class="o">=</span> <span class="n">fopen</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="s">&quot;w&quot;</span><span class="p">);</span>
+<a name="line-70"></a> <span class="k">if</span> <span class="p">(</span><span class="n">file</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-71"></a> <span class="n">fwrite</span> <span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">strlen</span> <span class="p">(</span><span class="n">line</span><span class="p">),</span> <span class="mi">1</span><span class="p">,</span> <span class="n">file</span><span class="p">);</span>
+<a name="line-72"></a> <span class="n">fclose</span> <span class="p">(</span><span class="n">file</span><span class="p">);</span>
+<a name="line-73"></a> <span class="p">}</span>
+<a name="line-74"></a>
+<a name="line-75"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-76"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">line</span><span class="p">);</span>
+<a name="line-77"></a><span class="p">}</span>
+<a name="line-78"></a>
+<a name="line-79"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-80"></a><span class="n">flush_password</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-81"></a><span class="p">{</span>
+<a name="line-82"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">password_entry</span><span class="p">;</span>
+<a name="line-83"></a><span class="hll"> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">password</span><span class="p">;</span><div class="verbose expandable"><span class="error2">&lt;--- The scope of the variable 'password' can be reduced. <span class="marker">[+]</span></span><div class="content">The scope of the variable &apos;password&apos; can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for &apos;i&apos; can be reduced:
+void f(int x)
+{
+ int i = 0;
+ if (x) {
+ // it&apos;s safe to move &apos;int i = 0;&apos; here
+ for (int n = 0; n &lt; 10; ++n) {
+ // it is possible but not safe to move &apos;int i = 0;&apos; here
+ do_something(&amp;i);
+ }
+ }
+}
+When you see this message it is always safe to reduce the variable scope 1 level.</div></div>
+</span><a name="line-84"></a>
+<a name="line-85"></a> <span class="n">password_entry</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;password_entry&quot;</span><span class="p">));</span>
+<a name="line-86"></a>
+<a name="line-87"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span><span class="p">(</span> <span class="n">password_entry</span><span class="p">),</span> <span class="s">&quot;user_edited&quot;</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-88"></a> <span class="n">password</span> <span class="o">=</span> <span class="n">gtk_entry_get_text</span> <span class="p">(</span><span class="n">GTK_ENTRY</span> <span class="p">(</span><span class="n">password_entry</span><span class="p">));</span>
+<a name="line-89"></a> <span class="k">if</span> <span class="p">(</span><span class="n">password</span> <span class="o">!=</span> <span class="nb">NULL</span> <span class="o">&amp;&amp;</span> <span class="n">password</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span>
+<a name="line-90"></a> <span class="n">write_out_password</span> <span class="p">(</span><span class="n">password</span><span class="p">);</span>
+<a name="line-91"></a> <span class="p">}</span>
+<a name="line-92"></a><span class="p">}</span>
+<a name="line-93"></a>
+<a name="line-94"></a>
+<a name="line-95"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-96"></a><span class="n">update_ui</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-97"></a><span class="p">{</span>
+<a name="line-98"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-99"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-100"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-101"></a> <span class="n">gboolean</span> <span class="n">bluetooth_enabled</span><span class="p">,</span> <span class="n">bluetooth_write_enabled</span><span class="p">,</span> <span class="n">require_pairing_enabled</span><span class="p">;</span>
+<a name="line-102"></a> <span class="n">gboolean</span> <span class="n">bluetooth_obexpush_enabled</span><span class="p">,</span> <span class="n">bluetooth_obexpush_notify</span><span class="p">;</span>
+<a name="line-103"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-104"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">str</span><span class="p">;</span>
+<a name="line-105"></a> <span class="n">PasswordSetting</span> <span class="n">password_setting</span><span class="p">;</span>
+<a name="line-106"></a><span class="hll"> <span class="n">AcceptSetting</span> <span class="n">accept_setting</span><span class="p">;</span><span class="error2">&lt;--- Unused variable: accept_setting</span>
+</span><a name="line-107"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">check</span><span class="p">;</span>
+<a name="line-108"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">password_combo</span><span class="p">;</span>
+<a name="line-109"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">password_entry</span><span class="p">;</span>
+<a name="line-110"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-111"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">vbox_share_bluetooth</span><span class="p">;</span>
+<a name="line-112"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">vbox_receive_bluetooth</span><span class="p">;</span>
+<a name="line-113"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">bluetooth_check</span><span class="p">;</span>
+<a name="line-114"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">allow_write_bluetooth_check</span><span class="p">;</span>
+<a name="line-115"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">require_pairing_check</span><span class="p">;</span>
+<a name="line-116"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">enable_obexpush_check</span><span class="p">;</span>
+<a name="line-117"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">accept_obexpush_combo</span><span class="p">;</span>
+<a name="line-118"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">notify_received_obexpush_check</span><span class="p">;</span>
+<a name="line-119"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-120"></a>
+<a name="line-121"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">);</span>
+<a name="line-122"></a>
+<a name="line-123"></a> <span class="n">enabled</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-124"></a> <span class="n">FILE_SHARING_ENABLED</span><span class="p">);</span>
+<a name="line-125"></a>
+<a name="line-126"></a> <span class="n">str</span> <span class="o">=</span> <span class="n">g_settings_get_string</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_REQUIRE_PASSWORD</span><span class="p">);</span>
+<a name="line-127"></a> <span class="n">password_setting</span> <span class="o">=</span> <span class="n">password_setting_from_string</span> <span class="p">(</span><span class="n">str</span><span class="p">);</span>
+<a name="line-128"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">str</span><span class="p">);</span>
+<a name="line-129"></a>
+<a name="line-130"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-131"></a> <span class="n">bluetooth_enabled</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-132"></a> <span class="n">FILE_SHARING_BLUETOOTH_ENABLED</span><span class="p">);</span>
+<a name="line-133"></a> <span class="n">bluetooth_write_enabled</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-134"></a> <span class="n">FILE_SHARING_BLUETOOTH_ALLOW_WRITE</span><span class="p">);</span>
+<a name="line-135"></a> <span class="n">require_pairing_enabled</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-136"></a> <span class="n">FILE_SHARING_BLUETOOTH_REQUIRE_PAIRING</span><span class="p">);</span>
+<a name="line-137"></a> <span class="n">bluetooth_obexpush_enabled</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-138"></a> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED</span><span class="p">);</span>
+<a name="line-139"></a> <span class="n">bluetooth_obexpush_notify</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-140"></a> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY</span><span class="p">);</span>
+<a name="line-141"></a>
+<a name="line-142"></a> <span class="n">str</span> <span class="o">=</span> <span class="n">g_settings_get_string</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES</span><span class="p">);</span>
+<a name="line-143"></a> <span class="n">accept_setting</span> <span class="o">=</span> <span class="n">accept_setting_from_string</span> <span class="p">(</span><span class="n">str</span><span class="p">);</span>
+<a name="line-144"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">str</span><span class="p">);</span>
+<a name="line-145"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-146"></a>
+<a name="line-147"></a> <span class="n">check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;enable_check&quot;</span><span class="p">));</span>
+<a name="line-148"></a> <span class="n">password_combo</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;password_combo&quot;</span><span class="p">));</span>
+<a name="line-149"></a> <span class="n">password_entry</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;password_entry&quot;</span><span class="p">));</span>
+<a name="line-150"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-151"></a> <span class="n">vbox_share_bluetooth</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;vbox_share_bluetooth&quot;</span><span class="p">));</span>
+<a name="line-152"></a> <span class="n">vbox_receive_bluetooth</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;vbox_receive_bluetooth&quot;</span><span class="p">));</span>
+<a name="line-153"></a> <span class="n">bluetooth_check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;enable_bluetooth_check&quot;</span><span class="p">));</span>
+<a name="line-154"></a> <span class="n">allow_write_bluetooth_check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;allow_write_bluetooth_check&quot;</span><span class="p">));</span>
+<a name="line-155"></a> <span class="n">require_pairing_check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;require_pairing_check&quot;</span><span class="p">));</span>
+<a name="line-156"></a> <span class="n">enable_obexpush_check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;enable_obexpush_check&quot;</span><span class="p">));</span>
+<a name="line-157"></a> <span class="n">accept_obexpush_combo</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;accept_obexpush_combo&quot;</span><span class="p">));</span>
+<a name="line-158"></a> <span class="n">notify_received_obexpush_check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;notify_received_obexpush_check&quot;</span><span class="p">));</span>
+<a name="line-159"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-160"></a>
+<a name="line-161"></a> <span class="cm">/* Network */</span>
+<a name="line-162"></a> <span class="n">gtk_toggle_button_set_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">check</span><span class="p">),</span> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-163"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">password_combo</span><span class="p">,</span> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-164"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">password_entry</span><span class="p">,</span> <span class="n">enabled</span> <span class="o">&amp;&amp;</span> <span class="n">password_setting</span> <span class="o">!=</span> <span class="n">PASSWORD_NEVER</span><span class="p">);</span>
+<a name="line-165"></a>
+<a name="line-166"></a> <span class="n">gtk_combo_box_set_active</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">password_combo</span><span class="p">),</span>
+<a name="line-167"></a> <span class="n">password_setting</span><span class="p">);</span>
+<a name="line-168"></a>
+<a name="line-169"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-170"></a> <span class="cm">/* Bluetooth ObexFTP */</span>
+<a name="line-171"></a> <span class="n">gtk_widget_set_visible</span> <span class="p">(</span><span class="n">vbox_share_bluetooth</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-172"></a> <span class="n">gtk_toggle_button_set_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">bluetooth_check</span><span class="p">),</span> <span class="n">bluetooth_enabled</span><span class="p">);</span>
+<a name="line-173"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">allow_write_bluetooth_check</span><span class="p">,</span> <span class="n">bluetooth_enabled</span><span class="p">);</span>
+<a name="line-174"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">require_pairing_check</span><span class="p">,</span> <span class="n">bluetooth_enabled</span><span class="p">);</span>
+<a name="line-175"></a>
+<a name="line-176"></a> <span class="n">gtk_toggle_button_set_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">allow_write_bluetooth_check</span><span class="p">),</span>
+<a name="line-177"></a> <span class="n">bluetooth_write_enabled</span><span class="p">);</span>
+<a name="line-178"></a> <span class="n">gtk_toggle_button_set_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">require_pairing_check</span><span class="p">),</span>
+<a name="line-179"></a> <span class="n">require_pairing_enabled</span><span class="p">);</span>
+<a name="line-180"></a>
+<a name="line-181"></a> <span class="cm">/* Bluetooth ObexPush */</span>
+<a name="line-182"></a> <span class="n">gtk_widget_set_visible</span> <span class="p">(</span><span class="n">vbox_receive_bluetooth</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-183"></a> <span class="n">gtk_toggle_button_set_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">enable_obexpush_check</span><span class="p">),</span> <span class="n">bluetooth_obexpush_enabled</span><span class="p">);</span>
+<a name="line-184"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">accept_obexpush_combo</span><span class="p">,</span> <span class="n">bluetooth_obexpush_enabled</span><span class="p">);</span>
+<a name="line-185"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">notify_received_obexpush_check</span><span class="p">,</span> <span class="n">bluetooth_obexpush_enabled</span><span class="p">);</span>
+<a name="line-186"></a>
+<a name="line-187"></a> <span class="n">gtk_toggle_button_set_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">notify_received_obexpush_check</span><span class="p">),</span>
+<a name="line-188"></a> <span class="n">bluetooth_obexpush_notify</span><span class="p">);</span>
+<a name="line-189"></a>
+<a name="line-190"></a> <span class="n">gtk_combo_box_set_active</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">accept_obexpush_combo</span><span class="p">),</span>
+<a name="line-191"></a> <span class="n">accept_setting</span><span class="p">);</span>
+<a name="line-192"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-193"></a>
+<a name="line-194"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-195"></a><span class="p">}</span>
+<a name="line-196"></a>
+<a name="line-197"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-198"></a><span class="n">file_sharing_enabled_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-199"></a><span class="p">{</span>
+<a name="line-200"></a> <span class="n">update_ui</span> <span class="p">();</span>
+<a name="line-201"></a><span class="p">}</span>
+<a name="line-202"></a>
+<a name="line-203"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-204"></a><span class="n">password_required_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-205"></a><span class="p">{</span>
+<a name="line-206"></a> <span class="n">update_ui</span> <span class="p">();</span>
+<a name="line-207"></a><span class="p">}</span>
+<a name="line-208"></a>
+<a name="line-209"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-210"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-211"></a><span class="n">file_sharing_bluetooth_enabled_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-212"></a><span class="p">{</span>
+<a name="line-213"></a> <span class="n">update_ui</span> <span class="p">();</span>
+<a name="line-214"></a><span class="p">}</span>
+<a name="line-215"></a>
+<a name="line-216"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-217"></a><span class="n">file_sharing_bluetooth_allow_write_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-218"></a><span class="p">{</span>
+<a name="line-219"></a> <span class="n">update_ui</span> <span class="p">();</span>
+<a name="line-220"></a><span class="p">}</span>
+<a name="line-221"></a>
+<a name="line-222"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-223"></a><span class="n">file_sharing_bluetooth_require_pairing_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-224"></a><span class="p">{</span>
+<a name="line-225"></a> <span class="n">update_ui</span> <span class="p">();</span>
+<a name="line-226"></a><span class="p">}</span>
+<a name="line-227"></a>
+<a name="line-228"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-229"></a><span class="n">file_sharing_bluetooth_obexpush_enabled_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-230"></a><span class="p">{</span>
+<a name="line-231"></a> <span class="n">update_ui</span> <span class="p">();</span>
+<a name="line-232"></a><span class="p">}</span>
+<a name="line-233"></a>
+<a name="line-234"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-235"></a><span class="n">file_sharing_bluetooth_obexpush_accept_files_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-236"></a><span class="p">{</span>
+<a name="line-237"></a> <span class="n">update_ui</span> <span class="p">();</span>
+<a name="line-238"></a><span class="p">}</span>
+<a name="line-239"></a>
+<a name="line-240"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-241"></a><span class="n">file_sharing_bluetooth_obexpush_notify_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-242"></a><span class="p">{</span>
+<a name="line-243"></a> <span class="n">update_ui</span> <span class="p">();</span>
+<a name="line-244"></a><span class="p">}</span>
+<a name="line-245"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-246"></a>
+<a name="line-247"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-248"></a><span class="n">password_combo_changed</span> <span class="p">(</span><span class="n">GtkComboBox</span> <span class="o">*</span><span class="n">combo_box</span><span class="p">)</span>
+<a name="line-249"></a><span class="p">{</span>
+<a name="line-250"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-251"></a> <span class="n">guint</span> <span class="n">setting</span><span class="p">;</span>
+<a name="line-252"></a>
+<a name="line-253"></a> <span class="n">setting</span> <span class="o">=</span> <span class="n">gtk_combo_box_get_active</span> <span class="p">(</span><span class="n">combo_box</span><span class="p">);</span>
+<a name="line-254"></a>
+<a name="line-255"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">)</span> <span class="p">;</span>
+<a name="line-256"></a>
+<a name="line-257"></a> <span class="n">g_settings_set_string</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-258"></a> <span class="n">FILE_SHARING_REQUIRE_PASSWORD</span><span class="p">,</span>
+<a name="line-259"></a> <span class="n">password_string_from_setting</span> <span class="p">(</span><span class="n">setting</span><span class="p">));</span>
+<a name="line-260"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-261"></a><span class="p">}</span>
+<a name="line-262"></a>
+<a name="line-263"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-264"></a><span class="n">launch_share</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-265"></a><span class="p">{</span>
+<a name="line-266"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">g_spawn_command_line_async</span> <span class="p">(</span><span class="n">USER_SHARE_PROGRAM</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">))</span>
+<a name="line-267"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Unable to start mate-user-share program&quot;</span><span class="p">);</span>
+<a name="line-268"></a><span class="p">}</span>
+<a name="line-269"></a>
+<a name="line-270"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-271"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-272"></a><span class="n">enable_bluetooth_check_toggled</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">check</span><span class="p">)</span>
+<a name="line-273"></a><span class="p">{</span>
+<a name="line-274"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-275"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-276"></a>
+<a name="line-277"></a> <span class="n">enabled</span> <span class="o">=</span> <span class="n">gtk_toggle_button_get_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">check</span><span class="p">));</span>
+<a name="line-278"></a>
+<a name="line-279"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">)</span> <span class="p">;</span>
+<a name="line-280"></a>
+<a name="line-281"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-282"></a> <span class="n">FILE_SHARING_BLUETOOTH_ENABLED</span><span class="p">,</span>
+<a name="line-283"></a> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-284"></a>
+<a name="line-285"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-286"></a>
+<a name="line-287"></a> <span class="k">if</span> <span class="p">(</span><span class="n">enabled</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-288"></a> <span class="n">launch_share</span> <span class="p">();</span>
+<a name="line-289"></a><span class="p">}</span>
+<a name="line-290"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-291"></a>
+<a name="line-292"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-293"></a><span class="n">enable_check_toggled</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">check</span><span class="p">)</span>
+<a name="line-294"></a><span class="p">{</span>
+<a name="line-295"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-296"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-297"></a>
+<a name="line-298"></a> <span class="n">enabled</span> <span class="o">=</span> <span class="n">gtk_toggle_button_get_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">check</span><span class="p">));</span>
+<a name="line-299"></a>
+<a name="line-300"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">);</span>
+<a name="line-301"></a>
+<a name="line-302"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-303"></a> <span class="n">FILE_SHARING_ENABLED</span><span class="p">,</span>
+<a name="line-304"></a> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-305"></a>
+<a name="line-306"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-307"></a>
+<a name="line-308"></a> <span class="k">if</span> <span class="p">(</span><span class="n">enabled</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-309"></a> <span class="n">launch_share</span> <span class="p">();</span>
+<a name="line-310"></a><span class="p">}</span>
+<a name="line-311"></a>
+<a name="line-312"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-313"></a><span class="n">password_entry_changed</span> <span class="p">(</span><span class="n">GtkEditable</span> <span class="o">*</span><span class="n">editable</span><span class="p">)</span>
+<a name="line-314"></a><span class="p">{</span>
+<a name="line-315"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">editable</span><span class="p">),</span>
+<a name="line-316"></a> <span class="s">&quot;user_edited&quot;</span><span class="p">,</span> <span class="n">GINT_TO_POINTER</span> <span class="p">(</span><span class="mi">1</span><span class="p">));</span>
+<a name="line-317"></a> <span class="n">flush_password</span> <span class="p">();</span>
+<a name="line-318"></a><span class="p">}</span>
+<a name="line-319"></a>
+<a name="line-320"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-321"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-322"></a><span class="n">bluetooth_allow_write_check_toggled</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">check</span><span class="p">)</span>
+<a name="line-323"></a><span class="p">{</span>
+<a name="line-324"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-325"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-326"></a>
+<a name="line-327"></a> <span class="n">enabled</span> <span class="o">=</span> <span class="n">gtk_toggle_button_get_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">check</span><span class="p">));</span>
+<a name="line-328"></a>
+<a name="line-329"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">)</span> <span class="p">;</span>
+<a name="line-330"></a>
+<a name="line-331"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-332"></a> <span class="n">FILE_SHARING_BLUETOOTH_ALLOW_WRITE</span><span class="p">,</span>
+<a name="line-333"></a> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-334"></a>
+<a name="line-335"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-336"></a><span class="p">}</span>
+<a name="line-337"></a>
+<a name="line-338"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-339"></a><span class="n">bluetooth_require_pairing_check_toggled</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">check</span><span class="p">)</span>
+<a name="line-340"></a><span class="p">{</span>
+<a name="line-341"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-342"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-343"></a>
+<a name="line-344"></a> <span class="n">enabled</span> <span class="o">=</span> <span class="n">gtk_toggle_button_get_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">check</span><span class="p">));</span>
+<a name="line-345"></a>
+<a name="line-346"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">)</span> <span class="p">;</span>
+<a name="line-347"></a>
+<a name="line-348"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-349"></a> <span class="n">FILE_SHARING_BLUETOOTH_REQUIRE_PAIRING</span><span class="p">,</span>
+<a name="line-350"></a> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-351"></a>
+<a name="line-352"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-353"></a><span class="p">}</span>
+<a name="line-354"></a>
+<a name="line-355"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-356"></a><span class="n">enable_obexpush_check_toggled</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">check</span><span class="p">)</span>
+<a name="line-357"></a><span class="p">{</span>
+<a name="line-358"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-359"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-360"></a>
+<a name="line-361"></a> <span class="n">enabled</span> <span class="o">=</span> <span class="n">gtk_toggle_button_get_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">check</span><span class="p">));</span>
+<a name="line-362"></a>
+<a name="line-363"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">)</span> <span class="p">;</span>
+<a name="line-364"></a>
+<a name="line-365"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-366"></a> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED</span><span class="p">,</span>
+<a name="line-367"></a> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-368"></a>
+<a name="line-369"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-370"></a>
+<a name="line-371"></a> <span class="k">if</span> <span class="p">(</span><span class="n">enabled</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-372"></a> <span class="n">launch_share</span> <span class="p">();</span>
+<a name="line-373"></a><span class="p">}</span>
+<a name="line-374"></a>
+<a name="line-375"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-376"></a><span class="n">accept_obexpush_combo_changed</span> <span class="p">(</span><span class="n">GtkComboBox</span> <span class="o">*</span><span class="n">combo_box</span><span class="p">)</span>
+<a name="line-377"></a><span class="p">{</span>
+<a name="line-378"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-379"></a> <span class="n">guint</span> <span class="n">setting</span><span class="p">;</span>
+<a name="line-380"></a>
+<a name="line-381"></a> <span class="n">setting</span> <span class="o">=</span> <span class="n">gtk_combo_box_get_active</span> <span class="p">(</span><span class="n">combo_box</span><span class="p">);</span>
+<a name="line-382"></a>
+<a name="line-383"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">)</span> <span class="p">;</span>
+<a name="line-384"></a>
+<a name="line-385"></a> <span class="n">g_settings_set_string</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-386"></a> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES</span><span class="p">,</span>
+<a name="line-387"></a> <span class="n">accept_string_from_setting</span> <span class="p">(</span><span class="n">setting</span><span class="p">));</span>
+<a name="line-388"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-389"></a><span class="p">}</span>
+<a name="line-390"></a>
+<a name="line-391"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-392"></a><span class="n">notify_received_obexpush_check_toggled</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">check</span><span class="p">)</span>
+<a name="line-393"></a><span class="p">{</span>
+<a name="line-394"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-395"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-396"></a>
+<a name="line-397"></a> <span class="n">enabled</span> <span class="o">=</span> <span class="n">gtk_toggle_button_get_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">check</span><span class="p">));</span>
+<a name="line-398"></a>
+<a name="line-399"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">)</span> <span class="p">;</span>
+<a name="line-400"></a>
+<a name="line-401"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-402"></a> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY</span><span class="p">,</span>
+<a name="line-403"></a> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-404"></a>
+<a name="line-405"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-406"></a><span class="p">}</span>
+<a name="line-407"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-408"></a>
+<a name="line-409"></a><span class="k">static</span> <span class="n">GtkWidget</span> <span class="o">*</span>
+<a name="line-410"></a><span class="n">error_dialog</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">title</span><span class="p">,</span>
+<a name="line-411"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">reason</span><span class="p">,</span>
+<a name="line-412"></a> <span class="n">GtkWindow</span> <span class="o">*</span><span class="n">parent</span><span class="p">)</span>
+<a name="line-413"></a><span class="p">{</span>
+<a name="line-414"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">error_dialog</span><span class="p">;</span>
+<a name="line-415"></a>
+<a name="line-416"></a> <span class="k">if</span> <span class="p">(</span><span class="n">reason</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-417"></a> <span class="n">reason</span> <span class="o">=</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;No reason&quot;</span><span class="p">);</span>
+<a name="line-418"></a>
+<a name="line-419"></a> <span class="n">error_dialog</span> <span class="o">=</span>
+<a name="line-420"></a> <span class="n">gtk_message_dialog_new</span> <span class="p">(</span><span class="n">parent</span><span class="p">,</span>
+<a name="line-421"></a> <span class="n">GTK_DIALOG_MODAL</span><span class="p">,</span>
+<a name="line-422"></a> <span class="n">GTK_MESSAGE_ERROR</span><span class="p">,</span>
+<a name="line-423"></a> <span class="n">GTK_BUTTONS_OK</span><span class="p">,</span>
+<a name="line-424"></a> <span class="s">&quot;%s&quot;</span><span class="p">,</span> <span class="n">title</span><span class="p">);</span>
+<a name="line-425"></a> <span class="n">gtk_message_dialog_format_secondary_text</span>
+<a name="line-426"></a> <span class="p">(</span><span class="n">GTK_MESSAGE_DIALOG</span> <span class="p">(</span><span class="n">error_dialog</span><span class="p">),</span> <span class="s">&quot;%s&quot;</span><span class="p">,</span> <span class="n">reason</span><span class="p">);</span>
+<a name="line-427"></a>
+<a name="line-428"></a> <span class="n">gtk_window_set_title</span> <span class="p">(</span><span class="n">GTK_WINDOW</span> <span class="p">(</span><span class="n">error_dialog</span><span class="p">),</span> <span class="s">&quot;&quot;</span><span class="p">);</span> <span class="cm">/* as per HIG */</span>
+<a name="line-429"></a> <span class="n">gtk_container_set_border_width</span> <span class="p">(</span><span class="n">GTK_CONTAINER</span> <span class="p">(</span><span class="n">error_dialog</span><span class="p">),</span> <span class="mi">5</span><span class="p">);</span>
+<a name="line-430"></a> <span class="n">gtk_dialog_set_default_response</span> <span class="p">(</span><span class="n">GTK_DIALOG</span> <span class="p">(</span><span class="n">error_dialog</span><span class="p">),</span>
+<a name="line-431"></a> <span class="n">GTK_RESPONSE_OK</span><span class="p">);</span>
+<a name="line-432"></a> <span class="n">gtk_window_set_modal</span> <span class="p">(</span><span class="n">GTK_WINDOW</span> <span class="p">(</span><span class="n">error_dialog</span><span class="p">),</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-433"></a>
+<a name="line-434"></a> <span class="k">return</span> <span class="n">error_dialog</span><span class="p">;</span>
+<a name="line-435"></a><span class="p">}</span>
+<a name="line-436"></a>
+<a name="line-437"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-438"></a><span class="n">help_button_clicked</span> <span class="p">(</span><span class="n">GtkButton</span> <span class="o">*</span><span class="n">button</span><span class="p">,</span> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">window</span><span class="p">)</span>
+<a name="line-439"></a><span class="p">{</span>
+<a name="line-440"></a> <span class="n">GError</span> <span class="o">*</span><span class="n">error</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-441"></a>
+<a name="line-442"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gtk_show_uri_on_window</span> <span class="p">(</span><span class="n">GTK_WINDOW</span> <span class="p">(</span><span class="n">window</span><span class="p">),</span> <span class="s">&quot;help:mate-user-share&quot;</span><span class="p">,</span> <span class="n">gtk_get_current_event_time</span> <span class="p">(),</span> <span class="o">&amp;</span><span class="n">error</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-443"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">dialog</span><span class="p">;</span>
+<a name="line-444"></a>
+<a name="line-445"></a> <span class="n">dialog</span> <span class="o">=</span> <span class="n">error_dialog</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Could not display the help contents.&quot;</span><span class="p">),</span> <span class="n">error</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">,</span> <span class="n">GTK_WINDOW</span> <span class="p">(</span><span class="n">window</span><span class="p">));</span>
+<a name="line-446"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">dialog</span><span class="p">),</span> <span class="s">&quot;response&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span>
+<a name="line-447"></a> <span class="p">(</span><span class="n">gtk_widget_destroy</span><span class="p">),</span> <span class="n">error_dialog</span><span class="p">);</span>
+<a name="line-448"></a> <span class="n">gtk_window_present</span> <span class="p">(</span><span class="n">GTK_WINDOW</span> <span class="p">(</span><span class="n">dialog</span><span class="p">));</span>
+<a name="line-449"></a>
+<a name="line-450"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">error</span><span class="p">);</span>
+<a name="line-451"></a> <span class="p">}</span>
+<a name="line-452"></a><span class="p">}</span>
+<a name="line-453"></a>
+<a name="line-454"></a><span class="k">static</span> <span class="n">GtkWidget</span> <span class="o">*</span>
+<a name="line-455"></a><span class="n">create_window</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-456"></a><span class="p">{</span>
+<a name="line-457"></a> <span class="n">GError</span> <span class="o">*</span><span class="n">error</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-458"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-459"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">check</span><span class="p">;</span>
+<a name="line-460"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">password_combo</span><span class="p">;</span>
+<a name="line-461"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">password_entry</span><span class="p">;</span>
+<a name="line-462"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-463"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">bluetooth_check</span><span class="p">;</span>
+<a name="line-464"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">bluetooth_allow_write_check</span><span class="p">;</span>
+<a name="line-465"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">require_pairing_check</span><span class="p">;</span>
+<a name="line-466"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">enable_obexpush_check</span><span class="p">;</span>
+<a name="line-467"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">accept_obexpush_combo</span><span class="p">;</span>
+<a name="line-468"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">notify_received_obexpush_check</span><span class="p">;</span>
+<a name="line-469"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-470"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">window</span><span class="p">;</span>
+<a name="line-471"></a> <span class="n">GtkListStore</span> <span class="o">*</span><span class="n">store</span><span class="p">;</span>
+<a name="line-472"></a> <span class="n">GtkCellRenderer</span> <span class="o">*</span><span class="n">cell</span><span class="p">;</span>
+<a name="line-473"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-474"></a>
+<a name="line-475"></a> <span class="n">builder</span> <span class="o">=</span> <span class="n">gtk_builder_new</span> <span class="p">();</span>
+<a name="line-476"></a> <span class="n">gtk_builder_add_from_file</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="n">DATADIR</span><span class="s">&quot;file-share-properties.ui&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">error</span><span class="p">);</span>
+<a name="line-477"></a>
+<a name="line-478"></a> <span class="k">if</span> <span class="p">(</span><span class="n">error</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-479"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">dialog</span><span class="p">;</span>
+<a name="line-480"></a>
+<a name="line-481"></a> <span class="n">dialog</span> <span class="o">=</span> <span class="n">error_dialog</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Could not build interface.&quot;</span><span class="p">),</span> <span class="n">error</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-482"></a> <span class="n">gtk_dialog_run</span> <span class="p">(</span><span class="n">GTK_DIALOG</span> <span class="p">(</span><span class="n">dialog</span><span class="p">));</span>
+<a name="line-483"></a> <span class="n">gtk_widget_destroy</span> <span class="p">(</span><span class="n">dialog</span><span class="p">);</span>
+<a name="line-484"></a>
+<a name="line-485"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">error</span><span class="p">);</span>
+<a name="line-486"></a> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-487"></a> <span class="p">}</span>
+<a name="line-488"></a>
+<a name="line-489"></a> <span class="n">window</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;user_share_dialog&quot;</span><span class="p">));</span>
+<a name="line-490"></a>
+<a name="line-491"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">);</span>
+<a name="line-492"></a>
+<a name="line-493"></a> <span class="n">check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;enable_check&quot;</span><span class="p">));</span>
+<a name="line-494"></a> <span class="n">password_combo</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;password_combo&quot;</span><span class="p">));</span>
+<a name="line-495"></a> <span class="n">password_entry</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;password_entry&quot;</span><span class="p">));</span>
+<a name="line-496"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-497"></a> <span class="n">bluetooth_check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;enable_bluetooth_check&quot;</span><span class="p">));</span>
+<a name="line-498"></a> <span class="n">bluetooth_allow_write_check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;allow_write_bluetooth_check&quot;</span><span class="p">));</span>
+<a name="line-499"></a> <span class="n">require_pairing_check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;require_pairing_check&quot;</span><span class="p">));</span>
+<a name="line-500"></a> <span class="n">enable_obexpush_check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;enable_obexpush_check&quot;</span><span class="p">));</span>
+<a name="line-501"></a> <span class="n">accept_obexpush_combo</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;accept_obexpush_combo&quot;</span><span class="p">));</span>
+<a name="line-502"></a> <span class="n">notify_received_obexpush_check</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;notify_received_obexpush_check&quot;</span><span class="p">));</span>
+<a name="line-503"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-504"></a>
+<a name="line-505"></a> <span class="n">store</span> <span class="o">=</span> <span class="n">gtk_list_store_new</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">G_TYPE_STRING</span><span class="p">);</span>
+<a name="line-506"></a> <span class="n">gtk_combo_box_set_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">password_combo</span><span class="p">),</span>
+<a name="line-507"></a> <span class="n">GTK_TREE_MODEL</span> <span class="p">(</span><span class="n">store</span><span class="p">));</span>
+<a name="line-508"></a> <span class="n">cell</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_text_new</span> <span class="p">();</span>
+<a name="line-509"></a> <span class="n">gtk_cell_layout_pack_start</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">password_combo</span><span class="p">),</span> <span class="n">cell</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-510"></a> <span class="n">gtk_cell_layout_set_attributes</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">password_combo</span><span class="p">),</span> <span class="n">cell</span><span class="p">,</span>
+<a name="line-511"></a> <span class="s">&quot;text&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-512"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-513"></a>
+<a name="line-514"></a> <span class="cm">/* Keep in same order as enum */</span>
+<a name="line-515"></a> <span class="n">gtk_list_store_append</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-516"></a> <span class="n">gtk_list_store_set</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-517"></a> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Never&quot;</span><span class="p">),</span> <span class="mi">-1</span><span class="p">);</span>
+<a name="line-518"></a> <span class="n">gtk_list_store_append</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-519"></a> <span class="n">gtk_list_store_set</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-520"></a> <span class="n">_</span><span class="p">(</span><span class="s">&quot;When writing files&quot;</span><span class="p">),</span> <span class="mi">-1</span><span class="p">);</span>
+<a name="line-521"></a> <span class="n">gtk_list_store_append</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-522"></a> <span class="n">gtk_list_store_set</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-523"></a> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Always&quot;</span><span class="p">),</span> <span class="mi">-1</span><span class="p">);</span>
+<a name="line-524"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">store</span><span class="p">);</span>
+<a name="line-525"></a>
+<a name="line-526"></a> <span class="cm">/* We can&#39;t read the password from the text, just set it to something */</span>
+<a name="line-527"></a> <span class="n">gtk_entry_set_text</span> <span class="p">(</span><span class="n">GTK_ENTRY</span> <span class="p">(</span><span class="n">password_entry</span><span class="p">),</span> <span class="s">&quot;none&quot;</span><span class="p">);</span>
+<a name="line-528"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">password_entry</span><span class="p">),</span>
+<a name="line-529"></a> <span class="s">&quot;user_edited&quot;</span><span class="p">,</span> <span class="n">GINT_TO_POINTER</span> <span class="p">(</span><span class="mi">0</span><span class="p">));</span>
+<a name="line-530"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">password_entry</span><span class="p">,</span>
+<a name="line-531"></a> <span class="s">&quot;changed&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">password_entry_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-532"></a>
+<a name="line-533"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-534"></a> <span class="cm">/* Accept files combo */</span>
+<a name="line-535"></a> <span class="n">store</span> <span class="o">=</span> <span class="n">gtk_list_store_new</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">G_TYPE_STRING</span><span class="p">);</span>
+<a name="line-536"></a> <span class="n">gtk_combo_box_set_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">accept_obexpush_combo</span><span class="p">),</span>
+<a name="line-537"></a> <span class="n">GTK_TREE_MODEL</span> <span class="p">(</span><span class="n">store</span><span class="p">));</span>
+<a name="line-538"></a> <span class="n">cell</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_text_new</span> <span class="p">();</span>
+<a name="line-539"></a> <span class="n">gtk_cell_layout_pack_start</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">accept_obexpush_combo</span><span class="p">),</span> <span class="n">cell</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-540"></a> <span class="n">gtk_cell_layout_set_attributes</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">accept_obexpush_combo</span><span class="p">),</span> <span class="n">cell</span><span class="p">,</span>
+<a name="line-541"></a> <span class="s">&quot;text&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-542"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-543"></a>
+<a name="line-544"></a> <span class="cm">/* Keep in same order as enum */</span>
+<a name="line-545"></a> <span class="n">gtk_list_store_append</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-546"></a> <span class="n">gtk_list_store_set</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-547"></a> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Always&quot;</span><span class="p">),</span> <span class="mi">-1</span><span class="p">);</span>
+<a name="line-548"></a> <span class="n">gtk_list_store_append</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-549"></a> <span class="n">gtk_list_store_set</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-550"></a> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Only for set up devices&quot;</span><span class="p">),</span> <span class="mi">-1</span><span class="p">);</span>
+<a name="line-551"></a> <span class="c1">//FIXME implement</span>
+<a name="line-552"></a><span class="cp">#if 0</span><span class="c"></span>
+<a name="line-553"></a><span class="c"> gtk_list_store_append (store, &amp;iter);</span>
+<a name="line-554"></a><span class="c"> gtk_list_store_set (store, &amp;iter, 0,</span>
+<a name="line-555"></a><span class="c"> _(&quot;Ask&quot;), -1);</span>
+<a name="line-556"></a><span class="cp">#endif</span>
+<a name="line-557"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">store</span><span class="p">);</span>
+<a name="line-558"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-559"></a>
+<a name="line-560"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">check</span><span class="p">,</span>
+<a name="line-561"></a> <span class="s">&quot;toggled&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">enable_check_toggled</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-562"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">password_combo</span><span class="p">,</span>
+<a name="line-563"></a> <span class="s">&quot;changed&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">password_combo_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-564"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-565"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">bluetooth_check</span><span class="p">,</span>
+<a name="line-566"></a> <span class="s">&quot;toggled&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">enable_bluetooth_check_toggled</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-567"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">bluetooth_allow_write_check</span><span class="p">,</span>
+<a name="line-568"></a> <span class="s">&quot;toggled&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">bluetooth_allow_write_check_toggled</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-569"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">require_pairing_check</span><span class="p">,</span>
+<a name="line-570"></a> <span class="s">&quot;toggled&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">bluetooth_require_pairing_check_toggled</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-571"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">enable_obexpush_check</span><span class="p">,</span>
+<a name="line-572"></a> <span class="s">&quot;toggled&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">enable_obexpush_check_toggled</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-573"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">accept_obexpush_combo</span><span class="p">,</span>
+<a name="line-574"></a> <span class="s">&quot;changed&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">accept_obexpush_combo_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-575"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">notify_received_obexpush_check</span><span class="p">,</span>
+<a name="line-576"></a> <span class="s">&quot;toggled&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">notify_received_obexpush_check_toggled</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-577"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-578"></a>
+<a name="line-579"></a> <span class="n">g_signal_connect_swapped</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;close_button&quot;</span><span class="p">)),</span>
+<a name="line-580"></a> <span class="s">&quot;clicked&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">gtk_widget_destroy</span><span class="p">),</span> <span class="n">window</span><span class="p">);</span>
+<a name="line-581"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;help_button&quot;</span><span class="p">)),</span>
+<a name="line-582"></a> <span class="s">&quot;clicked&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">help_button_clicked</span><span class="p">),</span>
+<a name="line-583"></a> <span class="n">gtk_builder_get_object</span> <span class="p">(</span><span class="n">builder</span><span class="p">,</span> <span class="s">&quot;user_share_dialog&quot;</span><span class="p">));</span>
+<a name="line-584"></a>
+<a name="line-585"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-586"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_ENABLED</span><span class="p">,</span>
+<a name="line-587"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_enabled_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-588"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-589"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_REQUIRE_PASSWORD</span><span class="p">,</span>
+<a name="line-590"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">password_required_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-591"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-592"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-593"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ENABLED</span><span class="p">,</span>
+<a name="line-594"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_enabled_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-595"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-596"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ALLOW_WRITE</span><span class="p">,</span>
+<a name="line-597"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_allow_write_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-598"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-599"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_REQUIRE_PAIRING</span><span class="p">,</span>
+<a name="line-600"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_require_pairing_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-601"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-602"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED</span><span class="p">,</span>
+<a name="line-603"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_obexpush_enabled_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-604"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-605"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES</span><span class="p">,</span>
+<a name="line-606"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_obexpush_accept_files_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-607"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-608"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY</span><span class="p">,</span>
+<a name="line-609"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_obexpush_notify_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-610"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-611"></a>
+<a name="line-612"></a> <span class="n">update_ui</span> <span class="p">();</span>
+<a name="line-613"></a>
+<a name="line-614"></a> <span class="k">return</span> <span class="n">window</span><span class="p">;</span>
+<a name="line-615"></a><span class="p">}</span>
+<a name="line-616"></a>
+<a name="line-617"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-618"></a><span class="n">activate</span> <span class="p">(</span><span class="n">GtkApplication</span> <span class="o">*</span><span class="n">app</span><span class="p">)</span>
+<a name="line-619"></a><span class="p">{</span>
+<a name="line-620"></a> <span class="n">GList</span> <span class="o">*</span><span class="n">list</span><span class="p">;</span>
+<a name="line-621"></a><span class="hll"> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">window</span><span class="p">;</span><div class="verbose expandable"><span class="error2">&lt;--- The scope of the variable 'window' can be reduced. <span class="marker">[+]</span></span><div class="content">The scope of the variable &apos;window&apos; can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for &apos;i&apos; can be reduced:
+void f(int x)
+{
+ int i = 0;
+ if (x) {
+ // it&apos;s safe to move &apos;int i = 0;&apos; here
+ for (int n = 0; n &lt; 10; ++n) {
+ // it is possible but not safe to move &apos;int i = 0;&apos; here
+ do_something(&amp;i);
+ }
+ }
+}
+When you see this message it is always safe to reduce the variable scope 1 level.</div></div>
+</span><a name="line-622"></a>
+<a name="line-623"></a> <span class="n">list</span> <span class="o">=</span> <span class="n">gtk_application_get_windows</span> <span class="p">(</span><span class="n">app</span><span class="p">);</span>
+<a name="line-624"></a>
+<a name="line-625"></a> <span class="k">if</span> <span class="p">(</span><span class="n">list</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-626"></a> <span class="n">gtk_window_present</span> <span class="p">(</span><span class="n">GTK_WINDOW</span> <span class="p">(</span><span class="n">list</span><span class="o">-&gt;</span><span class="n">data</span><span class="p">));</span>
+<a name="line-627"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-628"></a> <span class="n">window</span> <span class="o">=</span> <span class="n">create_window</span> <span class="p">();</span>
+<a name="line-629"></a> <span class="n">gtk_window_set_application</span> <span class="p">(</span><span class="n">GTK_WINDOW</span> <span class="p">(</span><span class="n">window</span><span class="p">),</span> <span class="n">app</span><span class="p">);</span>
+<a name="line-630"></a> <span class="n">gtk_widget_show</span> <span class="p">(</span><span class="n">window</span><span class="p">);</span>
+<a name="line-631"></a> <span class="p">}</span>
+<a name="line-632"></a><span class="p">}</span>
+<a name="line-633"></a>
+<a name="line-634"></a><span class="kt">int</span>
+<a name="line-635"></a><span class="n">main</span> <span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span>
+<a name="line-636"></a><span class="p">{</span>
+<a name="line-637"></a> <span class="n">GtkApplication</span> <span class="o">*</span><span class="n">app</span><span class="p">;</span>
+<a name="line-638"></a> <span class="n">gint</span> <span class="n">status</span><span class="p">;</span>
+<a name="line-639"></a>
+<a name="line-640"></a> <span class="n">bindtextdomain</span> <span class="p">(</span><span class="n">GETTEXT_PACKAGE</span><span class="p">,</span> <span class="n">MATELOCALEDIR</span><span class="p">);</span>
+<a name="line-641"></a> <span class="n">bind_textdomain_codeset</span> <span class="p">(</span><span class="n">GETTEXT_PACKAGE</span><span class="p">,</span> <span class="s">&quot;UTF-8&quot;</span><span class="p">);</span>
+<a name="line-642"></a> <span class="n">textdomain</span> <span class="p">(</span><span class="n">GETTEXT_PACKAGE</span><span class="p">);</span>
+<a name="line-643"></a>
+<a name="line-644"></a> <span class="n">app</span> <span class="o">=</span> <span class="n">gtk_application_new</span> <span class="p">(</span><span class="s">&quot;org.mate.user-share.properties&quot;</span><span class="p">,</span>
+<a name="line-645"></a> <span class="n">G_APPLICATION_FLAGS_NONE</span><span class="p">);</span>
+<a name="line-646"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">app</span><span class="p">,</span> <span class="s">&quot;activate&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">activate</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-647"></a>
+<a name="line-648"></a> <span class="n">status</span> <span class="o">=</span> <span class="n">g_application_run</span> <span class="p">(</span><span class="n">G_APPLICATION</span> <span class="p">(</span><span class="n">app</span><span class="p">),</span> <span class="n">argc</span><span class="p">,</span> <span class="n">argv</span><span class="p">);</span>
+<a name="line-649"></a>
+<a name="line-650"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">app</span><span class="p">);</span>
+<a name="line-651"></a>
+<a name="line-652"></a> <span class="k">return</span> <span class="n">status</span><span class="p">;</span>
+<a name="line-653"></a><span class="p">}</span>
+</pre></div>
+</td></tr></table>
+ </div> <!-- /.wrapper -->
+ </div>
+ <div id="footer" class="footer">
+ <p>
+ Cppcheck 2.3 - a tool for static C/C++ code analysis<br>
+ <br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a><br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a><br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/1.html b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/1.html
new file mode 100644
index 0000000..5897574
--- /dev/null
+++ b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/1.html
@@ -0,0 +1,1061 @@
+
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-user-share</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+pre { line-height: 125%; }
+td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
+span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
+td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #ffffff; }
+.highlight .c { color: #888888 } /* Comment */
+.highlight .err { color: #FF0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #008800; font-weight: bold } /* Keyword */
+.highlight .o { color: #333333 } /* Operator */
+.highlight .ch { color: #888888 } /* Comment.Hashbang */
+.highlight .cm { color: #888888 } /* Comment.Multiline */
+.highlight .cp { color: #557799 } /* Comment.Preproc */
+.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
+.highlight .c1 { color: #888888 } /* Comment.Single */
+.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #003388; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #333399; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #6600EE; font-weight: bold } /* Literal.Number */
+.highlight .s { background-color: #fff0f0 } /* Literal.String */
+.highlight .na { color: #0000CC } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #BB0066; font-weight: bold } /* Name.Class */
+.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #880000; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0066BB; font-weight: bold } /* Name.Function */
+.highlight .nl { color: #997700; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #007700 } /* Name.Tag */
+.highlight .nv { color: #996633 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #4400EE; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { background-color: #fff0f0 } /* Literal.String.Affix */
+.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.highlight .sc { color: #0044DD } /* Literal.String.Char */
+.highlight .dl { background-color: #fff0f0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #DD4422 } /* Literal.String.Doc */
+.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.highlight .se { color: #666666; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.highlight .si { background-color: #eeeeee } /* Literal.String.Interpol */
+.highlight .sx { color: #DD2200; background-color: #fff0f0 } /* Literal.String.Other */
+.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.highlight .ss { color: #AA6600 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #0066BB; font-weight: bold } /* Name.Function.Magic */
+.highlight .vc { color: #336699 } /* Name.Variable.Class */
+.highlight .vg { color: #dd7700; font-weight: bold } /* Name.Variable.Global */
+.highlight .vi { color: #3333BB } /* Name.Variable.Instance */
+.highlight .vm { color: #996633 } /* Name.Variable.Magic */
+.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
+ </style>
+ <script>
+ function getStyle(el, styleProp) {
+ var y;
+
+ if (el.currentStyle) {
+ y = el.currentStyle[styleProp];
+ } else if (window.getComputedStyle) {
+ y = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
+ }
+
+ return y;
+ }
+
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+
+ if (el.style.display === "block") {
+ el.style.display = "none";
+ mark.textContent = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.textContent = "[-]";
+ }
+ }
+
+ function initExpandables() {
+ var elements = document.querySelectorAll(".expandable");
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ var el = elements[i];
+ var clickable = el.querySelector("span");
+ var marker = clickable.querySelector(".marker");
+ var content = el.querySelector(".content");
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.addEventListener("click", toggle);
+ }
+ }
+
+ function toggleDisplay(id) {
+ var elements = document.querySelectorAll("." + id);
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ elements[i].classList.toggle("d-none");
+ }
+ }
+
+ function toggleAll() {
+ var elements = document.querySelectorAll("input");
+
+ // starting from 1 since 0 is the "toggle all" input
+ for (var i = 1, len = elements.length; i < len; i++) {
+ var el = elements[i];
+
+ if (el.checked) {
+ el.checked = false;
+ } else {
+ el.checked = true;
+ }
+
+ toggleDisplay(el.id);
+ }
+ }
+ window.addEventListener("load", initExpandables);
+ </script>
+ </head>
+ <body>
+ <div id="header" class="header">
+ <h1>Cppcheck report - mate-user-share: src/http.c</h1>
+ </div>
+ <div class="wrapper">
+ <div id="menu">
+ <p id="filename"><a href="index.html">Defects:</a> http.c</p>
+<a href="1.html#line-115"> variableScope 115</a>
+ </div>
+ <div id="content">
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437</pre></div></td><td class="code"><div class="highlight"><pre><span></span><a name="line-1"></a><span class="cm">/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */</span>
+<a name="line-2"></a>
+<a name="line-3"></a><span class="cm">/*</span>
+<a name="line-4"></a><span class="cm"> * Copyright (C) 2004-2008 Red Hat, Inc.</span>
+<a name="line-5"></a><span class="cm"> * Copyright (C) 2012-2021 MATE Developers</span>
+<a name="line-6"></a><span class="cm"> *</span>
+<a name="line-7"></a><span class="cm"> * Caja is free software; you can redistribute it and/or</span>
+<a name="line-8"></a><span class="cm"> * modify it under the terms of the GNU General Public License as</span>
+<a name="line-9"></a><span class="cm"> * published by the Free Software Foundation; either version 2 of the</span>
+<a name="line-10"></a><span class="cm"> * License, or (at your option) any later version.</span>
+<a name="line-11"></a><span class="cm"> *</span>
+<a name="line-12"></a><span class="cm"> * Caja is distributed in the hope that it will be useful,</span>
+<a name="line-13"></a><span class="cm"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
+<a name="line-14"></a><span class="cm"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
+<a name="line-15"></a><span class="cm"> * General Public License for more details.</span>
+<a name="line-16"></a><span class="cm"> *</span>
+<a name="line-17"></a><span class="cm"> * You should have received a copy of the GNU General Public License</span>
+<a name="line-18"></a><span class="cm"> * along with this program; if not, write to the Free Software</span>
+<a name="line-19"></a><span class="cm"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span>
+<a name="line-20"></a><span class="cm"> *</span>
+<a name="line-21"></a><span class="cm"> * Authors: Alexander Larsson &lt;[email protected]&gt;</span>
+<a name="line-22"></a><span class="cm"> *</span>
+<a name="line-23"></a><span class="cm"> */</span>
+<a name="line-24"></a>
+<a name="line-25"></a><span class="cp">#include</span> <span class="cpf">&quot;config.h&quot;</span><span class="cp"></span>
+<a name="line-26"></a>
+<a name="line-27"></a><span class="cp">#include</span> <span class="cpf">&lt;glib.h&gt;</span><span class="cp"></span>
+<a name="line-28"></a><span class="cp">#include</span> <span class="cpf">&lt;glib/gi18n.h&gt;</span><span class="cp"></span>
+<a name="line-29"></a><span class="cp">#include</span> <span class="cpf">&lt;X11/Xlib.h&gt;</span><span class="cp"></span>
+<a name="line-30"></a>
+<a name="line-31"></a><span class="cp">#include</span> <span class="cpf">&lt;gio/gio.h&gt;</span><span class="cp"></span>
+<a name="line-32"></a>
+<a name="line-33"></a><span class="cp">#include</span> <span class="cpf">&lt;stdarg.h&gt;</span><span class="cp"></span>
+<a name="line-34"></a><span class="cp">#include</span> <span class="cpf">&lt;string.h&gt;</span><span class="cp"></span>
+<a name="line-35"></a><span class="cp">#include</span> <span class="cpf">&lt;stdio.h&gt;</span><span class="cp"></span>
+<a name="line-36"></a><span class="cp">#include</span> <span class="cpf">&lt;stdlib.h&gt;</span><span class="cp"></span>
+<a name="line-37"></a><span class="cp">#include</span> <span class="cpf">&lt;signal.h&gt;</span><span class="cp"></span>
+<a name="line-38"></a><span class="cp">#include</span> <span class="cpf">&lt;unistd.h&gt;</span><span class="cp"></span>
+<a name="line-39"></a><span class="cp">#include</span> <span class="cpf">&lt;sys/types.h&gt;</span><span class="cp"></span>
+<a name="line-40"></a><span class="cp">#include</span> <span class="cpf">&lt;sys/socket.h&gt;</span><span class="cp"></span>
+<a name="line-41"></a><span class="cp">#include</span> <span class="cpf">&lt;netinet/in.h&gt;</span><span class="cp"></span>
+<a name="line-42"></a><span class="cp">#include</span> <span class="cpf">&lt;sys/stat.h&gt;</span><span class="cp"></span>
+<a name="line-43"></a>
+<a name="line-44"></a><span class="cp">#ifdef HAVE_SELINUX</span>
+<a name="line-45"></a><span class="cp">#include</span> <span class="cpf">&lt;selinux/selinux.h&gt;</span><span class="cp"></span>
+<a name="line-46"></a><span class="cp">#endif</span>
+<a name="line-47"></a>
+<a name="line-48"></a><span class="cp">#include</span> <span class="cpf">&quot;user_share-common.h&quot;</span><span class="cp"></span>
+<a name="line-49"></a><span class="cp">#include</span> <span class="cpf">&quot;user_share-private.h&quot;</span><span class="cp"></span>
+<a name="line-50"></a><span class="cp">#include</span> <span class="cpf">&quot;http.h&quot;</span><span class="cp"></span>
+<a name="line-51"></a>
+<a name="line-52"></a><span class="cm">/* From avahi-common/domain.h */</span>
+<a name="line-53"></a><span class="cp">#define AVAHI_LABEL_MAX 64</span>
+<a name="line-54"></a>
+<a name="line-55"></a><span class="cp">#define GSETTINGS_SCHEMA &quot;org.mate.FileSharing&quot;</span>
+<a name="line-56"></a>
+<a name="line-57"></a><span class="k">static</span> <span class="kt">pid_t</span> <span class="n">httpd_pid</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-58"></a>
+<a name="line-59"></a><span class="k">static</span> <span class="kt">int</span>
+<a name="line-60"></a><span class="n">get_port</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-61"></a><span class="p">{</span>
+<a name="line-62"></a> <span class="kt">int</span> <span class="n">sock</span><span class="p">;</span>
+<a name="line-63"></a> <span class="k">struct</span> <span class="nc">sockaddr_in</span> <span class="n">addr</span><span class="p">;</span>
+<a name="line-64"></a> <span class="kt">int</span> <span class="n">reuse</span><span class="p">;</span>
+<a name="line-65"></a> <span class="kt">socklen_t</span> <span class="n">len</span><span class="p">;</span>
+<a name="line-66"></a>
+<a name="line-67"></a> <span class="n">sock</span> <span class="o">=</span> <span class="n">socket</span> <span class="p">(</span><span class="n">PF_INET</span><span class="p">,</span> <span class="n">SOCK_STREAM</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-68"></a> <span class="k">if</span> <span class="p">(</span><span class="n">sock</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-69"></a> <span class="k">return</span> <span class="mi">-1</span><span class="p">;</span>
+<a name="line-70"></a> <span class="p">}</span>
+<a name="line-71"></a>
+<a name="line-72"></a> <span class="n">memset</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">addr</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="k">sizeof</span> <span class="p">(</span><span class="n">addr</span><span class="p">));</span>
+<a name="line-73"></a> <span class="n">addr</span><span class="p">.</span><span class="n">sin_port</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-74"></a> <span class="n">addr</span><span class="p">.</span><span class="n">sin_addr</span><span class="p">.</span><span class="n">s_addr</span> <span class="o">=</span> <span class="n">INADDR_ANY</span><span class="p">;</span>
+<a name="line-75"></a> <span class="n">addr</span><span class="p">.</span><span class="n">sin_family</span> <span class="o">=</span> <span class="n">AF_INET</span><span class="p">;</span>
+<a name="line-76"></a>
+<a name="line-77"></a> <span class="n">reuse</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-78"></a> <span class="n">setsockopt</span> <span class="p">(</span><span class="n">sock</span><span class="p">,</span> <span class="n">SOL_SOCKET</span><span class="p">,</span> <span class="n">SO_REUSEADDR</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">reuse</span><span class="p">,</span> <span class="k">sizeof</span> <span class="p">(</span><span class="n">reuse</span><span class="p">));</span>
+<a name="line-79"></a> <span class="k">if</span> <span class="p">(</span><span class="n">bind</span> <span class="p">(</span><span class="n">sock</span><span class="p">,</span> <span class="p">(</span><span class="k">struct</span> <span class="nc">sockaddr</span> <span class="o">*</span><span class="p">)</span><span class="o">&amp;</span><span class="n">addr</span><span class="p">,</span> <span class="k">sizeof</span> <span class="p">(</span><span class="n">addr</span><span class="p">))</span> <span class="o">==</span> <span class="mi">-1</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-80"></a> <span class="n">close</span> <span class="p">(</span><span class="n">sock</span><span class="p">);</span>
+<a name="line-81"></a> <span class="k">return</span> <span class="mi">-1</span><span class="p">;</span>
+<a name="line-82"></a> <span class="p">}</span>
+<a name="line-83"></a>
+<a name="line-84"></a> <span class="n">len</span> <span class="o">=</span> <span class="k">sizeof</span> <span class="p">(</span><span class="n">addr</span><span class="p">);</span>
+<a name="line-85"></a> <span class="k">if</span> <span class="p">(</span><span class="n">getsockname</span> <span class="p">(</span><span class="n">sock</span><span class="p">,</span> <span class="p">(</span><span class="k">struct</span> <span class="nc">sockaddr</span> <span class="o">*</span><span class="p">)</span><span class="o">&amp;</span><span class="n">addr</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">len</span><span class="p">)</span> <span class="o">==</span> <span class="mi">-1</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-86"></a> <span class="n">close</span> <span class="p">(</span><span class="n">sock</span><span class="p">);</span>
+<a name="line-87"></a> <span class="k">return</span> <span class="mi">-1</span><span class="p">;</span>
+<a name="line-88"></a> <span class="p">}</span>
+<a name="line-89"></a>
+<a name="line-90"></a><span class="cp">#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__OpenBSD__)</span>
+<a name="line-91"></a> <span class="cm">/* XXX This exposes a potential race condition, but without this,</span>
+<a name="line-92"></a><span class="cm"> * httpd will not start on the above listed platforms due to the fact</span>
+<a name="line-93"></a><span class="cm"> * that SO_REUSEADDR is also needed when Apache binds to the listening</span>
+<a name="line-94"></a><span class="cm"> * socket. At this time, Apache does not support that socket option.</span>
+<a name="line-95"></a><span class="cm"> */</span>
+<a name="line-96"></a> <span class="n">close</span> <span class="p">(</span><span class="n">sock</span><span class="p">);</span>
+<a name="line-97"></a><span class="cp">#endif</span>
+<a name="line-98"></a> <span class="k">return</span> <span class="nf">ntohs</span> <span class="p">(</span><span class="n">addr</span><span class="p">.</span><span class="n">sin_port</span><span class="p">);</span>
+<a name="line-99"></a><span class="p">}</span>
+<a name="line-100"></a>
+<a name="line-101"></a><span class="k">static</span> <span class="kt">char</span> <span class="o">*</span>
+<a name="line-102"></a><span class="n">truncate_name</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span><span class="p">)</span>
+<a name="line-103"></a><span class="p">{</span>
+<a name="line-104"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">end</span><span class="p">;</span>
+<a name="line-105"></a>
+<a name="line-106"></a> <span class="n">end</span> <span class="o">=</span> <span class="n">g_utf8_find_prev_char</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">name</span> <span class="o">+</span> <span class="mi">64</span><span class="p">);</span>
+<a name="line-107"></a> <span class="n">g_assert</span> <span class="p">(</span><span class="n">end</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-108"></a> <span class="k">return</span> <span class="nf">g_strndup</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">end</span> <span class="o">-</span> <span class="n">name</span><span class="p">);</span>
+<a name="line-109"></a><span class="p">}</span>
+<a name="line-110"></a>
+<a name="line-111"></a><span class="k">static</span> <span class="kt">char</span> <span class="o">*</span>
+<a name="line-112"></a><span class="n">get_share_name</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-113"></a><span class="p">{</span>
+<a name="line-114"></a> <span class="k">static</span> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-115"></a><span class="hll"> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">host_name</span><span class="p">;</span><div class="verbose expandable"><span class="error2">&lt;--- The scope of the variable 'host_name' can be reduced. <span class="marker">[+]</span></span><div class="content">The scope of the variable &apos;host_name&apos; can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for &apos;i&apos; can be reduced:
+void f(int x)
+{
+ int i = 0;
+ if (x) {
+ // it&apos;s safe to move &apos;int i = 0;&apos; here
+ for (int n = 0; n &lt; 10; ++n) {
+ // it is possible but not safe to move &apos;int i = 0;&apos; here
+ do_something(&amp;i);
+ }
+ }
+}
+When you see this message it is always safe to reduce the variable scope 1 level.</div></div>
+</span><a name="line-116"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">str</span><span class="p">;</span>
+<a name="line-117"></a>
+<a name="line-118"></a> <span class="k">if</span> <span class="p">(</span><span class="n">name</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-119"></a> <span class="n">host_name</span> <span class="o">=</span> <span class="n">g_get_host_name</span> <span class="p">();</span>
+<a name="line-120"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">host_name</span><span class="p">,</span> <span class="s">&quot;localhost&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-121"></a> <span class="cm">/* Translators: The %s will get filled in with the user name</span>
+<a name="line-122"></a><span class="cm"> of the user, to form a genitive. If this is difficult to</span>
+<a name="line-123"></a><span class="cm"> translate correctly so that it will work correctly in your</span>
+<a name="line-124"></a><span class="cm"> language, you may use something equivalent to</span>
+<a name="line-125"></a><span class="cm"> &quot;Public files of %s&quot;, or leave out the %s altogether.</span>
+<a name="line-126"></a><span class="cm"> In the latter case, please put &quot;%.0s&quot; somewhere in the string,</span>
+<a name="line-127"></a><span class="cm"> which will match the user name string passed by the C code,</span>
+<a name="line-128"></a><span class="cm"> but not put the user name in the final string. This is to</span>
+<a name="line-129"></a><span class="cm"> avoid the warning that msgfmt might otherwise generate. */</span>
+<a name="line-130"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;%s&#39;s public files&quot;</span><span class="p">),</span> <span class="n">g_get_user_name</span> <span class="p">());</span>
+<a name="line-131"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-132"></a> <span class="cm">/* Translators: This is similar to the string before, only it</span>
+<a name="line-133"></a><span class="cm"> has the hostname in it too. */</span>
+<a name="line-134"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;%s&#39;s public files on %s&quot;</span><span class="p">),</span>
+<a name="line-135"></a> <span class="n">g_get_user_name</span> <span class="p">(),</span>
+<a name="line-136"></a> <span class="n">host_name</span><span class="p">);</span>
+<a name="line-137"></a> <span class="p">}</span>
+<a name="line-138"></a>
+<a name="line-139"></a> <span class="p">}</span>
+<a name="line-140"></a> <span class="cm">/* And truncate */</span>
+<a name="line-141"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strlen</span> <span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="o">&lt;</span> <span class="n">AVAHI_LABEL_MAX</span><span class="p">)</span>
+<a name="line-142"></a> <span class="k">return</span> <span class="n">name</span><span class="p">;</span>
+<a name="line-143"></a>
+<a name="line-144"></a> <span class="n">str</span> <span class="o">=</span> <span class="n">truncate_name</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-145"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-146"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">str</span><span class="p">;</span>
+<a name="line-147"></a>
+<a name="line-148"></a> <span class="k">return</span> <span class="n">name</span><span class="p">;</span>
+<a name="line-149"></a><span class="p">}</span>
+<a name="line-150"></a>
+<a name="line-151"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-152"></a><span class="n">ensure_conf_dir</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-153"></a><span class="p">{</span>
+<a name="line-154"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">dirname</span><span class="p">;</span>
+<a name="line-155"></a>
+<a name="line-156"></a> <span class="n">dirname</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">g_get_user_config_dir</span> <span class="p">(),</span> <span class="s">&quot;user-share&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-157"></a> <span class="n">g_mkdir_with_parents</span> <span class="p">(</span><span class="n">dirname</span><span class="p">,</span> <span class="mo">0755</span><span class="p">);</span>
+<a name="line-158"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">dirname</span><span class="p">);</span>
+<a name="line-159"></a><span class="p">}</span>
+<a name="line-160"></a>
+<a name="line-161"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-162"></a><span class="n">httpd_child_setup</span> <span class="p">(</span><span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span>
+<a name="line-163"></a><span class="p">{</span>
+<a name="line-164"></a><span class="cp">#ifdef HAVE_SELINUX</span>
+<a name="line-165"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">mycon</span><span class="p">;</span>
+<a name="line-166"></a> <span class="cm">/* If selinux is enabled, avoid transitioning to the httpd_t context,</span>
+<a name="line-167"></a><span class="cm"> as this normally means you can&#39;t read the users homedir. */</span>
+<a name="line-168"></a> <span class="k">if</span> <span class="p">(</span><span class="n">is_selinux_enabled</span><span class="p">())</span> <span class="p">{</span>
+<a name="line-169"></a> <span class="k">if</span> <span class="p">(</span><span class="n">getcon</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">mycon</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-170"></a> <span class="n">abort</span> <span class="p">();</span>
+<a name="line-171"></a> <span class="p">}</span>
+<a name="line-172"></a> <span class="k">if</span> <span class="p">(</span><span class="n">setexeccon</span> <span class="p">(</span><span class="n">mycon</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">)</span>
+<a name="line-173"></a> <span class="n">abort</span> <span class="p">();</span>
+<a name="line-174"></a> <span class="n">freecon</span> <span class="p">(</span><span class="n">mycon</span><span class="p">);</span>
+<a name="line-175"></a> <span class="p">}</span>
+<a name="line-176"></a><span class="cp">#endif</span>
+<a name="line-177"></a><span class="p">}</span>
+<a name="line-178"></a>
+<a name="line-179"></a><span class="k">static</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">known_httpd_locations</span> <span class="p">[]</span> <span class="o">=</span> <span class="p">{</span>
+<a name="line-180"></a> <span class="n">HTTPD_PROGRAM</span><span class="p">,</span>
+<a name="line-181"></a> <span class="s">&quot;/usr/sbin/httpd&quot;</span><span class="p">,</span>
+<a name="line-182"></a> <span class="s">&quot;/usr/sbin/httpd2&quot;</span><span class="p">,</span>
+<a name="line-183"></a> <span class="s">&quot;/usr/sbin/apache2&quot;</span><span class="p">,</span>
+<a name="line-184"></a> <span class="nb">NULL</span>
+<a name="line-185"></a><span class="p">};</span>
+<a name="line-186"></a>
+<a name="line-187"></a><span class="k">static</span> <span class="kt">char</span><span class="o">*</span>
+<a name="line-188"></a><span class="n">get_httpd_program</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-189"></a><span class="p">{</span>
+<a name="line-190"></a> <span class="kt">int</span> <span class="n">i</span><span class="p">;</span>
+<a name="line-191"></a>
+<a name="line-192"></a> <span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">known_httpd_locations</span><span class="p">[</span><span class="n">i</span><span class="p">];</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-193"></a> <span class="k">if</span> <span class="p">(</span><span class="n">known_httpd_locations</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="sc">&#39;\0&#39;</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-194"></a> <span class="cm">/* empty string as first element, happens when</span>
+<a name="line-195"></a><span class="cm"> * configured --with-httpd=auto */</span>
+<a name="line-196"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-197"></a> <span class="p">}</span>
+<a name="line-198"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_test</span> <span class="p">(</span><span class="n">known_httpd_locations</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">G_FILE_TEST_IS_EXECUTABLE</span><span class="p">)</span>
+<a name="line-199"></a> <span class="o">&amp;&amp;</span> <span class="o">!</span> <span class="n">g_file_test</span> <span class="p">(</span><span class="n">known_httpd_locations</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">G_FILE_TEST_IS_DIR</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-200"></a> <span class="k">return</span> <span class="nf">g_strdup</span> <span class="p">(</span><span class="n">known_httpd_locations</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
+<a name="line-201"></a> <span class="p">}</span>
+<a name="line-202"></a> <span class="p">}</span>
+<a name="line-203"></a> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-204"></a><span class="p">}</span>
+<a name="line-205"></a>
+<a name="line-206"></a><span class="k">static</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">known_httpd_modules_locations</span> <span class="p">[]</span> <span class="o">=</span> <span class="p">{</span>
+<a name="line-207"></a> <span class="n">HTTPD_MODULES_PATH</span><span class="p">,</span>
+<a name="line-208"></a> <span class="s">&quot;/etc/httpd/modules&quot;</span><span class="p">,</span>
+<a name="line-209"></a> <span class="s">&quot;/usr/lib/apache2/modules&quot;</span><span class="p">,</span>
+<a name="line-210"></a> <span class="nb">NULL</span>
+<a name="line-211"></a><span class="p">};</span>
+<a name="line-212"></a>
+<a name="line-213"></a><span class="k">static</span> <span class="n">gchar</span><span class="o">*</span>
+<a name="line-214"></a><span class="n">get_httpd_modules_path</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-215"></a><span class="p">{</span>
+<a name="line-216"></a> <span class="kt">int</span> <span class="n">i</span><span class="p">;</span>
+<a name="line-217"></a>
+<a name="line-218"></a> <span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">known_httpd_modules_locations</span><span class="p">[</span><span class="n">i</span><span class="p">];</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-219"></a> <span class="k">if</span> <span class="p">(</span><span class="n">known_httpd_modules_locations</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="sc">&#39;\0&#39;</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-220"></a> <span class="cm">/* empty string as first element, happens when</span>
+<a name="line-221"></a><span class="cm"> * configured --with-httpd=auto */</span>
+<a name="line-222"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-223"></a> <span class="p">}</span>
+<a name="line-224"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_test</span> <span class="p">(</span><span class="n">known_httpd_modules_locations</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">G_FILE_TEST_IS_EXECUTABLE</span><span class="p">)</span>
+<a name="line-225"></a> <span class="o">&amp;&amp;</span> <span class="n">g_file_test</span> <span class="p">(</span><span class="n">known_httpd_modules_locations</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">G_FILE_TEST_IS_DIR</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-226"></a> <span class="k">return</span> <span class="nf">g_strdup</span> <span class="p">(</span><span class="n">known_httpd_modules_locations</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
+<a name="line-227"></a> <span class="p">}</span>
+<a name="line-228"></a> <span class="p">}</span>
+<a name="line-229"></a> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-230"></a><span class="p">}</span>
+<a name="line-231"></a>
+<a name="line-232"></a><span class="k">static</span> <span class="n">GRegex</span> <span class="o">*</span><span class="n">version_regex</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-233"></a>
+<a name="line-234"></a><span class="k">static</span> <span class="kt">char</span><span class="o">*</span>
+<a name="line-235"></a><span class="n">get_httpd_config</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">httpd_program</span><span class="p">)</span>
+<a name="line-236"></a><span class="p">{</span>
+<a name="line-237"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">standard_output</span><span class="p">;</span>
+<a name="line-238"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">cmd_line</span><span class="p">;</span>
+<a name="line-239"></a> <span class="n">GMatchInfo</span> <span class="o">*</span><span class="n">match_info</span><span class="p">;</span>
+<a name="line-240"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">version_number</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-241"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">config</span><span class="p">;</span>
+<a name="line-242"></a>
+<a name="line-243"></a> <span class="n">cmd_line</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;%s -v&quot;</span><span class="p">,</span> <span class="n">httpd_program</span><span class="p">);</span>
+<a name="line-244"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">g_spawn_command_line_sync</span> <span class="p">(</span><span class="n">cmd_line</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">standard_output</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-245"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">cmd_line</span><span class="p">);</span>
+<a name="line-246"></a> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-247"></a> <span class="p">}</span>
+<a name="line-248"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">cmd_line</span><span class="p">);</span>
+<a name="line-249"></a>
+<a name="line-250"></a> <span class="k">if</span> <span class="p">(</span><span class="n">version_regex</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-251"></a> <span class="n">version_regex</span> <span class="o">=</span> <span class="n">g_regex_new</span> <span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">d</span><span class="se">\\</span><span class="s">.</span><span class="se">\\</span><span class="s">d&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-252"></a> <span class="p">}</span>
+<a name="line-253"></a>
+<a name="line-254"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_regex_match</span> <span class="p">(</span><span class="n">version_regex</span><span class="p">,</span> <span class="n">standard_output</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">match_info</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-255"></a> <span class="k">while</span> <span class="p">(</span><span class="n">g_match_info_matches</span> <span class="p">(</span><span class="n">match_info</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-256"></a> <span class="n">version_number</span> <span class="o">=</span> <span class="n">g_match_info_fetch</span> <span class="p">(</span><span class="n">match_info</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-257"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-258"></a> <span class="p">}</span>
+<a name="line-259"></a> <span class="n">g_match_info_free</span> <span class="p">(</span><span class="n">match_info</span><span class="p">);</span>
+<a name="line-260"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">standard_output</span><span class="p">);</span>
+<a name="line-261"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-262"></a> <span class="cm">/* Failed to parse httpd version number */</span>
+<a name="line-263"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Could not parse &#39;%s&#39; as a version for httpd&quot;</span><span class="p">,</span> <span class="n">standard_output</span><span class="p">);</span>
+<a name="line-264"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">standard_output</span><span class="p">);</span>
+<a name="line-265"></a> <span class="cm">/* assume it is 2.2 */</span>
+<a name="line-266"></a> <span class="n">version_number</span> <span class="o">=</span> <span class="n">g_strdup</span> <span class="p">(</span><span class="s">&quot;2.2&quot;</span><span class="p">);</span>
+<a name="line-267"></a> <span class="p">}</span>
+<a name="line-268"></a>
+<a name="line-269"></a> <span class="n">config</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="n">HTTPD_CONFIG_TEMPLATE</span><span class="p">,</span> <span class="n">version_number</span><span class="p">);</span>
+<a name="line-270"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">version_number</span><span class="p">);</span>
+<a name="line-271"></a>
+<a name="line-272"></a> <span class="k">return</span> <span class="n">config</span><span class="p">;</span>
+<a name="line-273"></a><span class="p">}</span>
+<a name="line-274"></a>
+<a name="line-275"></a><span class="k">static</span> <span class="n">gboolean</span>
+<a name="line-276"></a><span class="n">spawn_httpd</span> <span class="p">(</span><span class="kt">int</span> <span class="n">port</span><span class="p">,</span> <span class="kt">pid_t</span> <span class="o">*</span><span class="n">pid_out</span><span class="p">)</span>
+<a name="line-277"></a><span class="p">{</span>
+<a name="line-278"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">free1</span><span class="p">,</span> <span class="o">*</span><span class="n">free2</span><span class="p">,</span> <span class="o">*</span><span class="n">free3</span><span class="p">,</span> <span class="o">*</span><span class="n">free4</span><span class="p">,</span> <span class="o">*</span><span class="n">free5</span><span class="p">,</span> <span class="o">*</span><span class="n">free6</span><span class="p">,</span> <span class="o">*</span><span class="n">free7</span><span class="p">,</span> <span class="o">*</span><span class="n">free8</span><span class="p">,</span> <span class="o">*</span><span class="n">free9</span><span class="p">;</span>
+<a name="line-279"></a> <span class="n">gboolean</span> <span class="n">res</span><span class="p">;</span>
+<a name="line-280"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[</span><span class="mi">10</span><span class="p">];</span>
+<a name="line-281"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">env</span><span class="p">[</span><span class="mi">10</span><span class="p">];</span>
+<a name="line-282"></a> <span class="kt">int</span> <span class="n">i</span><span class="p">;</span>
+<a name="line-283"></a> <span class="n">gint</span> <span class="n">status</span><span class="p">;</span>
+<a name="line-284"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">pid_filename</span><span class="p">;</span>
+<a name="line-285"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">pidfile</span><span class="p">;</span>
+<a name="line-286"></a> <span class="n">GError</span> <span class="o">*</span><span class="n">error</span><span class="p">;</span>
+<a name="line-287"></a> <span class="n">gboolean</span> <span class="n">got_pidfile</span><span class="p">;</span>
+<a name="line-288"></a> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span>
+<a name="line-289"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">str</span><span class="p">;</span>
+<a name="line-290"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">public_dir</span><span class="p">;</span>
+<a name="line-291"></a>
+<a name="line-292"></a> <span class="n">public_dir</span> <span class="o">=</span> <span class="n">lookup_public_dir</span> <span class="p">();</span>
+<a name="line-293"></a> <span class="n">ensure_conf_dir</span> <span class="p">();</span>
+<a name="line-294"></a>
+<a name="line-295"></a> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-296"></a> <span class="n">free1</span> <span class="o">=</span> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="n">get_httpd_program</span> <span class="p">();</span>
+<a name="line-297"></a> <span class="k">if</span> <span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-298"></a> <span class="n">fprintf</span> <span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">&quot;error finding httpd server</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
+<a name="line-299"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-300"></a> <span class="p">}</span>
+<a name="line-301"></a>
+<a name="line-302"></a> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;-f&quot;</span><span class="p">;</span>
+<a name="line-303"></a> <span class="n">free2</span> <span class="o">=</span> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="n">get_httpd_config</span> <span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
+<a name="line-304"></a> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;-C&quot;</span><span class="p">;</span>
+<a name="line-305"></a> <span class="n">free3</span> <span class="o">=</span> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;Listen %d&quot;</span><span class="p">,</span> <span class="n">port</span><span class="p">);</span>
+<a name="line-306"></a>
+<a name="line-307"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">);</span>
+<a name="line-308"></a> <span class="n">str</span> <span class="o">=</span> <span class="n">g_settings_get_string</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-309"></a> <span class="n">FILE_SHARING_REQUIRE_PASSWORD</span><span class="p">);</span>
+<a name="line-310"></a>
+<a name="line-311"></a> <span class="k">if</span> <span class="p">(</span><span class="n">str</span> <span class="o">&amp;&amp;</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">str</span><span class="p">,</span> <span class="s">&quot;never&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-312"></a> <span class="cm">/* Do nothing */</span>
+<a name="line-313"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">str</span> <span class="o">&amp;&amp;</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">str</span><span class="p">,</span> <span class="s">&quot;on_write&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">){</span>
+<a name="line-314"></a> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;-D&quot;</span><span class="p">;</span>
+<a name="line-315"></a> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;RequirePasswordOnWrite&quot;</span><span class="p">;</span>
+<a name="line-316"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-317"></a> <span class="cm">/* always, or safe fallback */</span>
+<a name="line-318"></a> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;-D&quot;</span><span class="p">;</span>
+<a name="line-319"></a> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;RequirePasswordAlways&quot;</span><span class="p">;</span>
+<a name="line-320"></a> <span class="p">}</span>
+<a name="line-321"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">str</span><span class="p">);</span>
+<a name="line-322"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-323"></a>
+<a name="line-324"></a> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-325"></a>
+<a name="line-326"></a> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-327"></a> <span class="n">free4</span> <span class="o">=</span> <span class="n">env</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;HOME=%s&quot;</span><span class="p">,</span> <span class="n">g_get_home_dir</span><span class="p">());</span>
+<a name="line-328"></a> <span class="n">free5</span> <span class="o">=</span> <span class="n">env</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;XDG_PUBLICSHARE_DIR=%s&quot;</span><span class="p">,</span> <span class="n">public_dir</span><span class="p">);</span>
+<a name="line-329"></a> <span class="n">free6</span> <span class="o">=</span> <span class="n">env</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;XDG_CONFIG_HOME=%s&quot;</span><span class="p">,</span> <span class="n">g_get_user_config_dir</span> <span class="p">());</span>
+<a name="line-330"></a> <span class="n">free7</span> <span class="o">=</span> <span class="n">env</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;GUS_SHARE_NAME=%s&quot;</span><span class="p">,</span> <span class="n">get_share_name</span> <span class="p">());</span>
+<a name="line-331"></a> <span class="n">free8</span> <span class="o">=</span> <span class="n">env</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;GUS_LOGIN_LABEL=%s&quot;</span><span class="p">,</span> <span class="s">&quot;Please log in as the user guest&quot;</span><span class="p">);</span>
+<a name="line-332"></a> <span class="n">free9</span> <span class="o">=</span> <span class="n">env</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;HTTP_MODULES_PATH=%s&quot;</span><span class="p">,</span><span class="n">get_httpd_modules_path</span> <span class="p">());</span>
+<a name="line-333"></a> <span class="n">env</span><span class="p">[</span><span class="n">i</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;LANG=C&quot;</span><span class="p">;</span>
+<a name="line-334"></a> <span class="n">env</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-335"></a>
+<a name="line-336"></a> <span class="n">pid_filename</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">g_get_user_config_dir</span> <span class="p">(),</span> <span class="s">&quot;user-share&quot;</span><span class="p">,</span> <span class="s">&quot;pid&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-337"></a>
+<a name="line-338"></a> <span class="cm">/* Remove pid file before spawning to avoid races with child and old pidfile */</span>
+<a name="line-339"></a> <span class="n">unlink</span> <span class="p">(</span><span class="n">pid_filename</span><span class="p">);</span>
+<a name="line-340"></a>
+<a name="line-341"></a> <span class="n">error</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-342"></a> <span class="n">res</span> <span class="o">=</span> <span class="n">g_spawn_sync</span> <span class="p">(</span><span class="n">g_get_home_dir</span><span class="p">(),</span>
+<a name="line-343"></a> <span class="n">argv</span><span class="p">,</span> <span class="n">env</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-344"></a> <span class="n">httpd_child_setup</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-345"></a> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-346"></a> <span class="o">&amp;</span><span class="n">status</span><span class="p">,</span>
+<a name="line-347"></a> <span class="o">&amp;</span><span class="n">error</span><span class="p">);</span>
+<a name="line-348"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">free1</span><span class="p">);</span>
+<a name="line-349"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">free2</span><span class="p">);</span>
+<a name="line-350"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">free3</span><span class="p">);</span>
+<a name="line-351"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">free4</span><span class="p">);</span>
+<a name="line-352"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">free5</span><span class="p">);</span>
+<a name="line-353"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">free6</span><span class="p">);</span>
+<a name="line-354"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">free7</span><span class="p">);</span>
+<a name="line-355"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">free8</span><span class="p">);</span>
+<a name="line-356"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">free9</span><span class="p">);</span>
+<a name="line-357"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">public_dir</span><span class="p">);</span>
+<a name="line-358"></a>
+<a name="line-359"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-360"></a> <span class="n">fprintf</span> <span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">&quot;error spawning httpd: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span>
+<a name="line-361"></a> <span class="n">error</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">);</span>
+<a name="line-362"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">error</span><span class="p">);</span>
+<a name="line-363"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">pid_filename</span><span class="p">);</span>
+<a name="line-364"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-365"></a> <span class="p">}</span>
+<a name="line-366"></a>
+<a name="line-367"></a> <span class="k">if</span> <span class="p">(</span><span class="n">status</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-368"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">pid_filename</span><span class="p">);</span>
+<a name="line-369"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-370"></a> <span class="p">}</span>
+<a name="line-371"></a>
+<a name="line-372"></a> <span class="n">got_pidfile</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-373"></a> <span class="n">error</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-374"></a> <span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="mi">5</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-375"></a> <span class="k">if</span> <span class="p">(</span><span class="n">error</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-376"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">error</span><span class="p">);</span>
+<a name="line-377"></a> <span class="n">error</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-378"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_get_contents</span> <span class="p">(</span><span class="n">pid_filename</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">pidfile</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">error</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-379"></a> <span class="n">got_pidfile</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-380"></a> <span class="o">*</span><span class="n">pid_out</span> <span class="o">=</span> <span class="n">atoi</span> <span class="p">(</span><span class="n">pidfile</span><span class="p">);</span>
+<a name="line-381"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">pidfile</span><span class="p">);</span>
+<a name="line-382"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-383"></a> <span class="p">}</span>
+<a name="line-384"></a> <span class="n">sleep</span> <span class="p">(</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-385"></a> <span class="p">}</span>
+<a name="line-386"></a>
+<a name="line-387"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">pid_filename</span><span class="p">);</span>
+<a name="line-388"></a>
+<a name="line-389"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">got_pidfile</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-390"></a> <span class="n">fprintf</span> <span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">&quot;error opening httpd pidfile: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">error</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">);</span>
+<a name="line-391"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">error</span><span class="p">);</span>
+<a name="line-392"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-393"></a> <span class="p">}</span>
+<a name="line-394"></a> <span class="k">return</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-395"></a><span class="p">}</span>
+<a name="line-396"></a>
+<a name="line-397"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-398"></a><span class="n">kill_httpd</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-399"></a><span class="p">{</span>
+<a name="line-400"></a> <span class="k">if</span> <span class="p">(</span><span class="n">httpd_pid</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-401"></a> <span class="n">kill</span> <span class="p">(</span><span class="n">httpd_pid</span><span class="p">,</span> <span class="n">SIGTERM</span><span class="p">);</span>
+<a name="line-402"></a>
+<a name="line-403"></a> <span class="cm">/* Allow child time to die, we can&#39;t waitpid, because its</span>
+<a name="line-404"></a><span class="cm"> not a direct child */</span>
+<a name="line-405"></a> <span class="n">sleep</span> <span class="p">(</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-406"></a> <span class="p">}</span>
+<a name="line-407"></a> <span class="n">httpd_pid</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-408"></a><span class="p">}</span>
+<a name="line-409"></a>
+<a name="line-410"></a><span class="kt">void</span>
+<a name="line-411"></a><span class="n">http_up</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-412"></a><span class="p">{</span>
+<a name="line-413"></a> <span class="n">guint</span> <span class="n">port</span><span class="p">;</span>
+<a name="line-414"></a>
+<a name="line-415"></a> <span class="n">port</span> <span class="o">=</span> <span class="n">get_port</span> <span class="p">();</span>
+<a name="line-416"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">spawn_httpd</span> <span class="p">(</span><span class="n">port</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">httpd_pid</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-417"></a> <span class="n">fprintf</span> <span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">&quot;spawning httpd failed</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
+<a name="line-418"></a> <span class="p">}</span>
+<a name="line-419"></a><span class="p">}</span>
+<a name="line-420"></a>
+<a name="line-421"></a><span class="kt">void</span>
+<a name="line-422"></a><span class="n">http_down</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-423"></a><span class="p">{</span>
+<a name="line-424"></a> <span class="n">kill_httpd</span> <span class="p">();</span>
+<a name="line-425"></a><span class="p">}</span>
+<a name="line-426"></a>
+<a name="line-427"></a><span class="n">gboolean</span>
+<a name="line-428"></a><span class="n">http_init</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-429"></a><span class="p">{</span>
+<a name="line-430"></a> <span class="k">return</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-431"></a><span class="p">}</span>
+<a name="line-432"></a>
+<a name="line-433"></a><span class="kt">pid_t</span>
+<a name="line-434"></a><span class="n">http_get_pid</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-435"></a><span class="p">{</span>
+<a name="line-436"></a> <span class="k">return</span> <span class="n">httpd_pid</span><span class="p">;</span>
+<a name="line-437"></a><span class="p">}</span>
+</pre></div>
+</td></tr></table>
+ </div> <!-- /.wrapper -->
+ </div>
+ <div id="footer" class="footer">
+ <p>
+ Cppcheck 2.3 - a tool for static C/C++ code analysis<br>
+ <br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a><br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a><br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/2.html b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/2.html
new file mode 100644
index 0000000..4049036
--- /dev/null
+++ b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/2.html
@@ -0,0 +1,1295 @@
+
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-user-share</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+pre { line-height: 125%; }
+td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
+span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
+td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #ffffff; }
+.highlight .c { color: #888888 } /* Comment */
+.highlight .err { color: #FF0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #008800; font-weight: bold } /* Keyword */
+.highlight .o { color: #333333 } /* Operator */
+.highlight .ch { color: #888888 } /* Comment.Hashbang */
+.highlight .cm { color: #888888 } /* Comment.Multiline */
+.highlight .cp { color: #557799 } /* Comment.Preproc */
+.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
+.highlight .c1 { color: #888888 } /* Comment.Single */
+.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #003388; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #333399; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #6600EE; font-weight: bold } /* Literal.Number */
+.highlight .s { background-color: #fff0f0 } /* Literal.String */
+.highlight .na { color: #0000CC } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #BB0066; font-weight: bold } /* Name.Class */
+.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #880000; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0066BB; font-weight: bold } /* Name.Function */
+.highlight .nl { color: #997700; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #007700 } /* Name.Tag */
+.highlight .nv { color: #996633 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #4400EE; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { background-color: #fff0f0 } /* Literal.String.Affix */
+.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.highlight .sc { color: #0044DD } /* Literal.String.Char */
+.highlight .dl { background-color: #fff0f0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #DD4422 } /* Literal.String.Doc */
+.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.highlight .se { color: #666666; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.highlight .si { background-color: #eeeeee } /* Literal.String.Interpol */
+.highlight .sx { color: #DD2200; background-color: #fff0f0 } /* Literal.String.Other */
+.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.highlight .ss { color: #AA6600 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #0066BB; font-weight: bold } /* Name.Function.Magic */
+.highlight .vc { color: #336699 } /* Name.Variable.Class */
+.highlight .vg { color: #dd7700; font-weight: bold } /* Name.Variable.Global */
+.highlight .vi { color: #3333BB } /* Name.Variable.Instance */
+.highlight .vm { color: #996633 } /* Name.Variable.Magic */
+.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
+ </style>
+ <script>
+ function getStyle(el, styleProp) {
+ var y;
+
+ if (el.currentStyle) {
+ y = el.currentStyle[styleProp];
+ } else if (window.getComputedStyle) {
+ y = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
+ }
+
+ return y;
+ }
+
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+
+ if (el.style.display === "block") {
+ el.style.display = "none";
+ mark.textContent = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.textContent = "[-]";
+ }
+ }
+
+ function initExpandables() {
+ var elements = document.querySelectorAll(".expandable");
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ var el = elements[i];
+ var clickable = el.querySelector("span");
+ var marker = clickable.querySelector(".marker");
+ var content = el.querySelector(".content");
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.addEventListener("click", toggle);
+ }
+ }
+
+ function toggleDisplay(id) {
+ var elements = document.querySelectorAll("." + id);
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ elements[i].classList.toggle("d-none");
+ }
+ }
+
+ function toggleAll() {
+ var elements = document.querySelectorAll("input");
+
+ // starting from 1 since 0 is the "toggle all" input
+ for (var i = 1, len = elements.length; i < len; i++) {
+ var el = elements[i];
+
+ if (el.checked) {
+ el.checked = false;
+ } else {
+ el.checked = true;
+ }
+
+ toggleDisplay(el.id);
+ }
+ }
+ window.addEventListener("load", initExpandables);
+ </script>
+ </head>
+ <body>
+ <div id="header" class="header">
+ <h1>Cppcheck report - mate-user-share: src/obexpush.c</h1>
+ </div>
+ <div class="wrapper">
+ <div id="menu">
+ <p id="filename"><a href="index.html">Defects:</a> obexpush.c</p>
+<a href="2.html#line-48"> shadowVariable 48</a><a href="2.html#line-188"> shadowVariable 188</a>
+ </div>
+ <div id="content">
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560</pre></div></td><td class="code"><div class="highlight"><pre><span></span><a name="line-1"></a><span class="cm">/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */</span>
+<a name="line-2"></a>
+<a name="line-3"></a><span class="cm">/*</span>
+<a name="line-4"></a><span class="cm"> * Copyright (C) 2004-2008 Red Hat, Inc.</span>
+<a name="line-5"></a><span class="cm"> * Copyright (C) 2012-2021 MATE Developers</span>
+<a name="line-6"></a><span class="cm"> *</span>
+<a name="line-7"></a><span class="cm"> * Caja is free software; you can redistribute it and/or</span>
+<a name="line-8"></a><span class="cm"> * modify it under the terms of the GNU General Public License as</span>
+<a name="line-9"></a><span class="cm"> * published by the Free Software Foundation; either version 2 of the</span>
+<a name="line-10"></a><span class="cm"> * License, or (at your option) any later version.</span>
+<a name="line-11"></a><span class="cm"> *</span>
+<a name="line-12"></a><span class="cm"> * Caja is distributed in the hope that it will be useful,</span>
+<a name="line-13"></a><span class="cm"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
+<a name="line-14"></a><span class="cm"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
+<a name="line-15"></a><span class="cm"> * General Public License for more details.</span>
+<a name="line-16"></a><span class="cm"> *</span>
+<a name="line-17"></a><span class="cm"> * You should have received a copy of the GNU General Public License</span>
+<a name="line-18"></a><span class="cm"> * along with this program; if not, write to the Free Software</span>
+<a name="line-19"></a><span class="cm"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span>
+<a name="line-20"></a><span class="cm"> *</span>
+<a name="line-21"></a><span class="cm"> * Authors: Bastien Nocera &lt;[email protected]&gt;</span>
+<a name="line-22"></a><span class="cm"> *</span>
+<a name="line-23"></a><span class="cm"> */</span>
+<a name="line-24"></a>
+<a name="line-25"></a><span class="cp">#include</span> <span class="cpf">&quot;config.h&quot;</span><span class="cp"></span>
+<a name="line-26"></a>
+<a name="line-27"></a><span class="cp">#include</span> <span class="cpf">&lt;glib.h&gt;</span><span class="cp"></span>
+<a name="line-28"></a><span class="cp">#include</span> <span class="cpf">&lt;glib/gi18n.h&gt;</span><span class="cp"></span>
+<a name="line-29"></a><span class="cp">#include</span> <span class="cpf">&lt;gio/gio.h&gt;</span><span class="cp"></span>
+<a name="line-30"></a><span class="cp">#include</span> <span class="cpf">&lt;gdk/gdk.h&gt;</span><span class="cp"></span>
+<a name="line-31"></a><span class="cp">#include</span> <span class="cpf">&lt;gtk/gtk.h&gt;</span><span class="cp"></span>
+<a name="line-32"></a><span class="cp">#include</span> <span class="cpf">&lt;libnotify/notify.h&gt;</span><span class="cp"></span>
+<a name="line-33"></a><span class="cp">#include</span> <span class="cpf">&lt;dbus/dbus-glib.h&gt;</span><span class="cp"></span>
+<a name="line-34"></a><span class="cp">#include</span> <span class="cpf">&lt;dbus/dbus-glib-lowlevel.h&gt;</span><span class="cp"></span>
+<a name="line-35"></a><span class="cp">#include</span> <span class="cpf">&lt;canberra-gtk.h&gt;</span><span class="cp"></span>
+<a name="line-36"></a>
+<a name="line-37"></a><span class="cp">#include</span> <span class="cpf">&lt;string.h&gt;</span><span class="cp"></span>
+<a name="line-38"></a>
+<a name="line-39"></a><span class="cp">#include</span> <span class="cpf">&quot;marshal.h&quot;</span><span class="cp"></span>
+<a name="line-40"></a><span class="cp">#include</span> <span class="cpf">&quot;obexpush.h&quot;</span><span class="cp"></span>
+<a name="line-41"></a><span class="cp">#include</span> <span class="cpf">&quot;user_share-common.h&quot;</span><span class="cp"></span>
+<a name="line-42"></a><span class="cp">#include</span> <span class="cpf">&quot;user_share-private.h&quot;</span><span class="cp"></span>
+<a name="line-43"></a>
+<a name="line-44"></a><span class="cp">#define DBUS_TYPE_G_STRING_VARIANT_HASHTABLE (dbus_g_type_get_map (&quot;GHashTable&quot;, G_TYPE_STRING, G_TYPE_STRING))</span>
+<a name="line-45"></a>
+<a name="line-46"></a><span class="cp">#define GSETTINGS_SCHEMA &quot;org.mate.FileSharing&quot;</span>
+<a name="line-47"></a>
+<a name="line-48"></a><span class="hll"><span class="k">static</span> <span class="n">DBusGConnection</span> <span class="o">*</span><span class="n">connection</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span><span class="error2">&lt;--- Shadowed declaration</span>
+</span><a name="line-49"></a><span class="k">static</span> <span class="n">DBusGProxy</span> <span class="o">*</span><span class="n">manager_proxy</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-50"></a><span class="k">static</span> <span class="n">DBusGProxy</span> <span class="o">*</span><span class="n">server_proxy</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-51"></a><span class="k">static</span> <span class="n">AcceptSetting</span> <span class="n">accept_setting</span> <span class="o">=</span> <span class="mi">-1</span><span class="p">;</span>
+<a name="line-52"></a><span class="k">static</span> <span class="n">gboolean</span> <span class="n">show_notifications</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-53"></a>
+<a name="line-54"></a><span class="k">static</span> <span class="n">GtkStatusIcon</span> <span class="o">*</span><span class="n">statusicon</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-55"></a><span class="k">static</span> <span class="n">guint</span> <span class="n">num_notifications</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-56"></a>
+<a name="line-57"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-58"></a><span class="n">hide_statusicon</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-59"></a><span class="p">{</span>
+<a name="line-60"></a> <span class="n">num_notifications</span><span class="o">--</span><span class="p">;</span>
+<a name="line-61"></a> <span class="k">if</span> <span class="p">(</span><span class="n">num_notifications</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+<a name="line-62"></a> <span class="n">gtk_status_icon_set_visible</span> <span class="p">(</span><span class="n">statusicon</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-63"></a><span class="p">}</span>
+<a name="line-64"></a>
+<a name="line-65"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-66"></a><span class="n">on_close_notification</span> <span class="p">(</span><span class="n">NotifyNotification</span> <span class="o">*</span><span class="n">notification</span><span class="p">)</span>
+<a name="line-67"></a><span class="p">{</span>
+<a name="line-68"></a> <span class="n">hide_statusicon</span> <span class="p">();</span>
+<a name="line-69"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">notification</span><span class="p">);</span>
+<a name="line-70"></a><span class="p">}</span>
+<a name="line-71"></a>
+<a name="line-72"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-73"></a><span class="n">notification_launch_action_on_file_cb</span> <span class="p">(</span><span class="n">NotifyNotification</span> <span class="o">*</span><span class="n">notification</span><span class="p">,</span>
+<a name="line-74"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">action</span><span class="p">,</span>
+<a name="line-75"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">file_uri</span><span class="p">)</span>
+<a name="line-76"></a><span class="p">{</span>
+<a name="line-77"></a> <span class="n">GdkScreen</span> <span class="o">*</span><span class="n">screen</span><span class="p">;</span>
+<a name="line-78"></a> <span class="n">GAppLaunchContext</span> <span class="o">*</span><span class="n">ctx</span><span class="p">;</span>
+<a name="line-79"></a> <span class="n">GTimeVal</span> <span class="n">val</span><span class="p">;</span>
+<a name="line-80"></a>
+<a name="line-81"></a> <span class="n">g_assert</span> <span class="p">(</span><span class="n">action</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-82"></a>
+<a name="line-83"></a> <span class="n">g_get_current_time</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">val</span><span class="p">);</span>
+<a name="line-84"></a>
+<a name="line-85"></a> <span class="n">ctx</span> <span class="o">=</span> <span class="n">G_APP_LAUNCH_CONTEXT</span> <span class="p">(</span><span class="n">gdk_app_launch_context_new</span> <span class="p">());</span>
+<a name="line-86"></a> <span class="n">screen</span> <span class="o">=</span> <span class="n">gdk_screen_get_default</span> <span class="p">();</span>
+<a name="line-87"></a> <span class="n">gdk_app_launch_context_set_screen</span> <span class="p">(</span><span class="n">GDK_APP_LAUNCH_CONTEXT</span> <span class="p">(</span><span class="n">ctx</span><span class="p">),</span> <span class="n">screen</span><span class="p">);</span>
+<a name="line-88"></a> <span class="n">gdk_app_launch_context_set_timestamp</span> <span class="p">(</span><span class="n">GDK_APP_LAUNCH_CONTEXT</span> <span class="p">(</span><span class="n">ctx</span><span class="p">),</span> <span class="n">val</span><span class="p">.</span><span class="n">tv_sec</span><span class="p">);</span>
+<a name="line-89"></a>
+<a name="line-90"></a> <span class="cm">/* We launch the file viewer for the file */</span>
+<a name="line-91"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_str_equal</span> <span class="p">(</span><span class="n">action</span><span class="p">,</span> <span class="s">&quot;display&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-92"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_app_info_launch_default_for_uri</span> <span class="p">(</span><span class="n">file_uri</span><span class="p">,</span> <span class="n">ctx</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-93"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Failed to launch the file viewer</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
+<a name="line-94"></a> <span class="p">}</span>
+<a name="line-95"></a> <span class="p">}</span>
+<a name="line-96"></a>
+<a name="line-97"></a> <span class="cm">/* we open the Downloads folder */</span>
+<a name="line-98"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_str_equal</span> <span class="p">(</span><span class="n">action</span><span class="p">,</span> <span class="s">&quot;reveal&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-99"></a> <span class="n">GFile</span> <span class="o">*</span><span class="n">file</span><span class="p">;</span>
+<a name="line-100"></a> <span class="n">GFile</span> <span class="o">*</span><span class="n">parent</span><span class="p">;</span>
+<a name="line-101"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">parent_uri</span><span class="p">;</span>
+<a name="line-102"></a>
+<a name="line-103"></a> <span class="n">file</span> <span class="o">=</span> <span class="n">g_file_new_for_uri</span> <span class="p">(</span><span class="n">file_uri</span><span class="p">);</span>
+<a name="line-104"></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">g_file_get_parent</span> <span class="p">(</span><span class="n">file</span><span class="p">);</span>
+<a name="line-105"></a> <span class="n">parent_uri</span> <span class="o">=</span> <span class="n">g_file_get_uri</span> <span class="p">(</span><span class="n">parent</span><span class="p">);</span>
+<a name="line-106"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">file</span><span class="p">);</span>
+<a name="line-107"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">parent</span><span class="p">);</span>
+<a name="line-108"></a>
+<a name="line-109"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">g_app_info_launch_default_for_uri</span> <span class="p">(</span><span class="n">parent_uri</span><span class="p">,</span> <span class="n">ctx</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-110"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Failed to launch the file manager</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
+<a name="line-111"></a> <span class="p">}</span>
+<a name="line-112"></a>
+<a name="line-113"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">parent_uri</span><span class="p">);</span>
+<a name="line-114"></a> <span class="p">}</span>
+<a name="line-115"></a>
+<a name="line-116"></a> <span class="n">notify_notification_close</span> <span class="p">(</span><span class="n">notification</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-117"></a> <span class="cm">/* No need to call hide_statusicon(), closing the notification</span>
+<a name="line-118"></a><span class="cm"> * will call the close callback */</span>
+<a name="line-119"></a><span class="p">}</span>
+<a name="line-120"></a>
+<a name="line-121"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-122"></a><span class="n">show_notification</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">filename</span><span class="p">)</span>
+<a name="line-123"></a><span class="p">{</span>
+<a name="line-124"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">file_uri</span><span class="p">,</span> <span class="o">*</span><span class="n">notification_text</span><span class="p">,</span> <span class="o">*</span><span class="n">display</span><span class="p">,</span> <span class="o">*</span><span class="n">mime_type</span><span class="p">;</span>
+<a name="line-125"></a> <span class="n">NotifyNotification</span> <span class="o">*</span><span class="n">notification</span><span class="p">;</span>
+<a name="line-126"></a> <span class="n">ca_context</span> <span class="o">*</span><span class="n">ctx</span><span class="p">;</span>
+<a name="line-127"></a> <span class="n">GAppInfo</span> <span class="o">*</span><span class="n">app</span><span class="p">;</span>
+<a name="line-128"></a>
+<a name="line-129"></a> <span class="n">file_uri</span> <span class="o">=</span> <span class="n">g_filename_to_uri</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-130"></a> <span class="k">if</span> <span class="p">(</span><span class="n">file_uri</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-131"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Could not make a filename from &#39;%s&#39;&quot;</span><span class="p">,</span> <span class="n">filename</span><span class="p">);</span>
+<a name="line-132"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-133"></a> <span class="p">}</span>
+<a name="line-134"></a>
+<a name="line-135"></a> <span class="n">display</span> <span class="o">=</span> <span class="n">g_filename_display_basename</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-136"></a> <span class="cm">/* Translators: %s is the name of the filename received */</span>
+<a name="line-137"></a> <span class="n">notification_text</span> <span class="o">=</span> <span class="n">g_strdup_printf</span><span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;You received </span><span class="se">\&quot;</span><span class="s">%s</span><span class="se">\&quot;</span><span class="s"> via Bluetooth&quot;</span><span class="p">),</span> <span class="n">display</span><span class="p">);</span>
+<a name="line-138"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">display</span><span class="p">);</span>
+<a name="line-139"></a> <span class="n">notification</span> <span class="o">=</span> <span class="n">notify_notification_new</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;You received a file&quot;</span><span class="p">),</span>
+<a name="line-140"></a> <span class="n">notification_text</span><span class="p">,</span>
+<a name="line-141"></a> <span class="s">&quot;dialog-information&quot;</span><span class="p">);</span>
+<a name="line-142"></a>
+<a name="line-143"></a> <span class="n">notify_notification_set_timeout</span> <span class="p">(</span><span class="n">notification</span><span class="p">,</span> <span class="n">NOTIFY_EXPIRES_DEFAULT</span><span class="p">);</span>
+<a name="line-144"></a>
+<a name="line-145"></a> <span class="n">mime_type</span> <span class="o">=</span> <span class="n">g_content_type_guess</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-146"></a> <span class="n">app</span> <span class="o">=</span> <span class="n">g_app_info_get_default_for_type</span> <span class="p">(</span><span class="n">mime_type</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-147"></a> <span class="k">if</span> <span class="p">(</span><span class="n">app</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-148"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">app</span><span class="p">);</span>
+<a name="line-149"></a> <span class="n">notify_notification_add_action</span> <span class="p">(</span><span class="n">notification</span><span class="p">,</span> <span class="s">&quot;display&quot;</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Open File&quot;</span><span class="p">),</span>
+<a name="line-150"></a> <span class="p">(</span><span class="n">NotifyActionCallback</span><span class="p">)</span> <span class="n">notification_launch_action_on_file_cb</span><span class="p">,</span>
+<a name="line-151"></a> <span class="n">g_strdup</span> <span class="p">(</span><span class="n">file_uri</span><span class="p">),</span> <span class="p">(</span><span class="n">GFreeFunc</span><span class="p">)</span> <span class="n">g_free</span><span class="p">);</span>
+<a name="line-152"></a> <span class="p">}</span>
+<a name="line-153"></a> <span class="n">notify_notification_add_action</span> <span class="p">(</span><span class="n">notification</span><span class="p">,</span> <span class="s">&quot;reveal&quot;</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Reveal File&quot;</span><span class="p">),</span>
+<a name="line-154"></a> <span class="p">(</span><span class="n">NotifyActionCallback</span><span class="p">)</span> <span class="n">notification_launch_action_on_file_cb</span><span class="p">,</span>
+<a name="line-155"></a> <span class="n">g_strdup</span> <span class="p">(</span><span class="n">file_uri</span><span class="p">),</span> <span class="p">(</span><span class="n">GFreeFunc</span><span class="p">)</span> <span class="n">g_free</span><span class="p">);</span>
+<a name="line-156"></a>
+<a name="line-157"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">file_uri</span><span class="p">);</span>
+<a name="line-158"></a>
+<a name="line-159"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">notification</span><span class="p">),</span> <span class="s">&quot;closed&quot;</span><span class="p">,</span> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_close_notification</span><span class="p">),</span> <span class="n">notification</span><span class="p">);</span>
+<a name="line-160"></a>
+<a name="line-161"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">notify_notification_show</span> <span class="p">(</span><span class="n">notification</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-162"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;failed to send notification</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
+<a name="line-163"></a> <span class="p">}</span>
+<a name="line-164"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">notification_text</span><span class="p">);</span>
+<a name="line-165"></a>
+<a name="line-166"></a> <span class="cm">/* Now we do the audio notification */</span>
+<a name="line-167"></a> <span class="n">ctx</span> <span class="o">=</span> <span class="n">ca_gtk_context_get</span> <span class="p">();</span>
+<a name="line-168"></a> <span class="n">ca_context_play</span> <span class="p">(</span><span class="n">ctx</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-169"></a> <span class="n">CA_PROP_EVENT_ID</span><span class="p">,</span> <span class="s">&quot;complete-download&quot;</span><span class="p">,</span>
+<a name="line-170"></a> <span class="n">CA_PROP_EVENT_DESCRIPTION</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;File reception complete&quot;</span><span class="p">),</span>
+<a name="line-171"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-172"></a><span class="p">}</span>
+<a name="line-173"></a>
+<a name="line-174"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-175"></a><span class="n">show_icon</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-176"></a><span class="p">{</span>
+<a name="line-177"></a> <span class="k">if</span> <span class="p">(</span><span class="n">statusicon</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-178"></a> <span class="n">statusicon</span> <span class="o">=</span> <span class="n">gtk_status_icon_new_from_icon_name</span> <span class="p">(</span><span class="s">&quot;mate-obex-server&quot;</span><span class="p">);</span>
+<a name="line-179"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-180"></a> <span class="n">gtk_status_icon_set_visible</span> <span class="p">(</span><span class="n">statusicon</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-181"></a> <span class="p">}</span>
+<a name="line-182"></a> <span class="n">num_notifications</span><span class="o">++</span><span class="p">;</span>
+<a name="line-183"></a><span class="p">}</span>
+<a name="line-184"></a>
+<a name="line-185"></a><span class="k">static</span> <span class="n">gboolean</span>
+<a name="line-186"></a><span class="n">device_is_authorised</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">bdaddr</span><span class="p">)</span>
+<a name="line-187"></a><span class="p">{</span>
+<a name="line-188"></a><span class="hll"> <span class="n">DBusGConnection</span> <span class="o">*</span><span class="n">connection</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-189"></a> <span class="n">DBusGProxy</span> <span class="o">*</span><span class="n">manager</span><span class="p">;</span>
+<a name="line-190"></a> <span class="n">GError</span> <span class="o">*</span><span class="n">error</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-191"></a> <span class="n">GPtrArray</span> <span class="o">*</span><span class="n">adapters</span><span class="p">;</span>
+<a name="line-192"></a> <span class="n">gboolean</span> <span class="n">retval</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-193"></a> <span class="n">guint</span> <span class="n">i</span><span class="p">;</span>
+<a name="line-194"></a>
+<a name="line-195"></a> <span class="n">connection</span> <span class="o">=</span> <span class="n">dbus_g_bus_get</span> <span class="p">(</span><span class="n">DBUS_BUS_SYSTEM</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-196"></a> <span class="k">if</span> <span class="p">(</span><span class="n">connection</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-197"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-198"></a>
+<a name="line-199"></a> <span class="n">manager</span> <span class="o">=</span> <span class="n">dbus_g_proxy_new_for_name</span> <span class="p">(</span><span class="n">connection</span><span class="p">,</span> <span class="s">&quot;org.bluez&quot;</span><span class="p">,</span>
+<a name="line-200"></a> <span class="s">&quot;/&quot;</span><span class="p">,</span> <span class="s">&quot;org.bluez.Manager&quot;</span><span class="p">);</span>
+<a name="line-201"></a> <span class="k">if</span> <span class="p">(</span><span class="n">manager</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-202"></a> <span class="n">dbus_g_connection_unref</span> <span class="p">(</span><span class="n">connection</span><span class="p">);</span>
+<a name="line-203"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-204"></a> <span class="p">}</span>
+<a name="line-205"></a>
+<a name="line-206"></a> <span class="k">if</span> <span class="p">(</span><span class="n">dbus_g_proxy_call</span> <span class="p">(</span><span class="n">manager</span><span class="p">,</span> <span class="s">&quot;ListAdapters&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">error</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">,</span> <span class="n">dbus_g_type_get_collection</span> <span class="p">(</span><span class="s">&quot;GPtrArray&quot;</span><span class="p">,</span> <span class="n">DBUS_TYPE_G_OBJECT_PATH</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">adapters</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-207"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">manager</span><span class="p">);</span>
+<a name="line-208"></a> <span class="n">dbus_g_connection_unref</span> <span class="p">(</span><span class="n">connection</span><span class="p">);</span>
+<a name="line-209"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-210"></a> <span class="p">}</span>
+<a name="line-211"></a>
+<a name="line-212"></a> <span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">adapters</span><span class="o">-&gt;</span><span class="n">len</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-213"></a> <span class="n">DBusGProxy</span> <span class="o">*</span><span class="n">adapter</span><span class="p">,</span> <span class="o">*</span><span class="n">device</span><span class="p">;</span>
+<a name="line-214"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">device_path</span><span class="p">;</span>
+<a name="line-215"></a> <span class="n">GHashTable</span> <span class="o">*</span><span class="n">props</span><span class="p">;</span>
+<a name="line-216"></a>
+<a name="line-217"></a> <span class="n">g_debug</span> <span class="p">(</span><span class="s">&quot;checking adapter %s&quot;</span><span class="p">,</span> <span class="p">(</span><span class="n">gchar</span> <span class="o">*</span><span class="p">)</span> <span class="n">g_ptr_array_index</span> <span class="p">(</span><span class="n">adapters</span><span class="p">,</span> <span class="n">i</span><span class="p">));</span>
+<a name="line-218"></a>
+<a name="line-219"></a> <span class="n">adapter</span> <span class="o">=</span> <span class="n">dbus_g_proxy_new_for_name</span> <span class="p">(</span><span class="n">connection</span><span class="p">,</span> <span class="s">&quot;org.bluez&quot;</span><span class="p">,</span>
+<a name="line-220"></a> <span class="n">g_ptr_array_index</span> <span class="p">(</span><span class="n">adapters</span><span class="p">,</span> <span class="n">i</span><span class="p">),</span> <span class="s">&quot;org.bluez.Adapter&quot;</span><span class="p">);</span>
+<a name="line-221"></a>
+<a name="line-222"></a> <span class="k">if</span> <span class="p">(</span><span class="n">dbus_g_proxy_call</span> <span class="p">(</span><span class="n">adapter</span><span class="p">,</span> <span class="s">&quot;FindDevice&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-223"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span> <span class="n">bdaddr</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">,</span>
+<a name="line-224"></a> <span class="n">DBUS_TYPE_G_OBJECT_PATH</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">device_path</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-225"></a> <span class="p">{</span>
+<a name="line-226"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">adapter</span><span class="p">);</span>
+<a name="line-227"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-228"></a> <span class="p">}</span>
+<a name="line-229"></a>
+<a name="line-230"></a> <span class="n">device</span> <span class="o">=</span> <span class="n">dbus_g_proxy_new_for_name</span> <span class="p">(</span><span class="n">connection</span><span class="p">,</span> <span class="s">&quot;org.bluez&quot;</span><span class="p">,</span> <span class="n">device_path</span><span class="p">,</span> <span class="s">&quot;org.bluez.Device&quot;</span><span class="p">);</span>
+<a name="line-231"></a>
+<a name="line-232"></a> <span class="k">if</span> <span class="p">(</span><span class="n">dbus_g_proxy_call</span> <span class="p">(</span><span class="n">device</span><span class="p">,</span> <span class="s">&quot;GetProperties&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-233"></a> <span class="n">G_TYPE_INVALID</span><span class="p">,</span> <span class="n">dbus_g_type_get_map</span> <span class="p">(</span><span class="s">&quot;GHashTable&quot;</span><span class="p">,</span> <span class="n">G_TYPE_STRING</span><span class="p">,</span> <span class="n">G_TYPE_VALUE</span><span class="p">),</span>
+<a name="line-234"></a> <span class="o">&amp;</span><span class="n">props</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">)</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-235"></a> <span class="p">{</span>
+<a name="line-236"></a> <span class="n">GValue</span> <span class="o">*</span><span class="n">value</span><span class="p">;</span>
+<a name="line-237"></a> <span class="n">gboolean</span> <span class="n">bonded</span><span class="p">;</span>
+<a name="line-238"></a>
+<a name="line-239"></a> <span class="n">value</span> <span class="o">=</span> <span class="n">g_hash_table_lookup</span> <span class="p">(</span><span class="n">props</span><span class="p">,</span> <span class="s">&quot;Paired&quot;</span><span class="p">);</span>
+<a name="line-240"></a> <span class="n">bonded</span> <span class="o">=</span> <span class="n">g_value_get_boolean</span> <span class="p">(</span><span class="n">value</span><span class="p">);</span>
+<a name="line-241"></a> <span class="n">g_message</span> <span class="p">(</span><span class="s">&quot;%s is %s&quot;</span><span class="p">,</span> <span class="n">bdaddr</span><span class="p">,</span> <span class="n">bonded</span> <span class="o">?</span> <span class="s">&quot;bonded&quot;</span> <span class="o">:</span> <span class="s">&quot;not bonded&quot;</span><span class="p">);</span>
+<a name="line-242"></a>
+<a name="line-243"></a> <span class="k">if</span> <span class="p">(</span><span class="n">bonded</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-244"></a> <span class="n">g_hash_table_destroy</span> <span class="p">(</span><span class="n">props</span><span class="p">);</span>
+<a name="line-245"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">device</span><span class="p">);</span>
+<a name="line-246"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">adapter</span><span class="p">);</span>
+<a name="line-247"></a> <span class="n">retval</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-248"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-249"></a> <span class="p">}</span>
+<a name="line-250"></a> <span class="p">}</span>
+<a name="line-251"></a> <span class="n">g_object_unref</span><span class="p">(</span><span class="n">adapter</span><span class="p">);</span>
+<a name="line-252"></a> <span class="p">}</span>
+<a name="line-253"></a>
+<a name="line-254"></a> <span class="n">g_ptr_array_free</span> <span class="p">(</span><span class="n">adapters</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-255"></a>
+<a name="line-256"></a> <span class="n">g_object_unref</span><span class="p">(</span><span class="n">manager</span><span class="p">);</span>
+<a name="line-257"></a> <span class="n">dbus_g_connection_unref</span><span class="p">(</span><span class="n">connection</span><span class="p">);</span>
+<a name="line-258"></a>
+<a name="line-259"></a> <span class="k">return</span> <span class="n">retval</span><span class="p">;</span>
+<a name="line-260"></a><span class="p">}</span>
+<a name="line-261"></a>
+<a name="line-262"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-263"></a><span class="n">transfer_started_cb</span> <span class="p">(</span><span class="n">DBusGProxy</span> <span class="o">*</span><span class="n">session</span><span class="p">,</span>
+<a name="line-264"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">filename</span><span class="p">,</span>
+<a name="line-265"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">local_path</span><span class="p">,</span>
+<a name="line-266"></a> <span class="n">guint64</span> <span class="n">size</span><span class="p">,</span>
+<a name="line-267"></a> <span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span>
+<a name="line-268"></a><span class="p">{</span>
+<a name="line-269"></a> <span class="n">GHashTable</span> <span class="o">*</span><span class="n">dict</span><span class="p">;</span>
+<a name="line-270"></a> <span class="n">DBusGProxy</span> <span class="o">*</span><span class="n">server</span> <span class="o">=</span> <span class="p">(</span><span class="n">DBusGProxy</span> <span class="o">*</span><span class="p">)</span> <span class="n">user_data</span><span class="p">;</span>
+<a name="line-271"></a> <span class="n">GError</span> <span class="o">*</span><span class="n">error</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-272"></a> <span class="n">gboolean</span> <span class="n">authorise</span><span class="p">;</span>
+<a name="line-273"></a>
+<a name="line-274"></a> <span class="n">g_message</span> <span class="p">(</span><span class="s">&quot;transfer started on %s&quot;</span><span class="p">,</span> <span class="n">local_path</span><span class="p">);</span>
+<a name="line-275"></a> <span class="n">g_object_set_data_full</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="s">&quot;filename&quot;</span><span class="p">,</span> <span class="n">g_strdup</span> <span class="p">(</span><span class="n">local_path</span><span class="p">),</span> <span class="p">(</span><span class="n">GDestroyNotify</span><span class="p">)</span> <span class="n">g_free</span><span class="p">);</span>
+<a name="line-276"></a>
+<a name="line-277"></a> <span class="n">show_icon</span> <span class="p">();</span>
+<a name="line-278"></a>
+<a name="line-279"></a> <span class="cm">/* First transfer of the session */</span>
+<a name="line-280"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="s">&quot;bdaddr&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-281"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">bdaddr</span><span class="p">;</span>
+<a name="line-282"></a>
+<a name="line-283"></a> <span class="k">if</span> <span class="p">(</span><span class="n">dbus_g_proxy_call</span> <span class="p">(</span><span class="n">server</span><span class="p">,</span> <span class="s">&quot;GetServerSessionInfo&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">error</span><span class="p">,</span>
+<a name="line-284"></a> <span class="n">DBUS_TYPE_G_OBJECT_PATH</span><span class="p">,</span> <span class="n">dbus_g_proxy_get_path</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="n">G_TYPE_INVALID</span><span class="p">,</span>
+<a name="line-285"></a> <span class="n">DBUS_TYPE_G_STRING_VARIANT_HASHTABLE</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">dict</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-286"></a> <span class="n">g_printerr</span> <span class="p">(</span><span class="s">&quot;Getting Server session info failed: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span>
+<a name="line-287"></a> <span class="n">error</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">);</span>
+<a name="line-288"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">error</span><span class="p">);</span>
+<a name="line-289"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-290"></a> <span class="p">}</span>
+<a name="line-291"></a>
+<a name="line-292"></a> <span class="n">bdaddr</span> <span class="o">=</span> <span class="n">g_hash_table_lookup</span> <span class="p">(</span><span class="n">dict</span><span class="p">,</span> <span class="s">&quot;BluetoothAddress&quot;</span><span class="p">);</span>
+<a name="line-293"></a> <span class="n">g_message</span> <span class="p">(</span><span class="s">&quot;transfer started for device %s&quot;</span><span class="p">,</span> <span class="n">bdaddr</span><span class="p">);</span>
+<a name="line-294"></a>
+<a name="line-295"></a> <span class="n">g_object_set_data_full</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="s">&quot;bdaddr&quot;</span><span class="p">,</span> <span class="n">g_strdup</span> <span class="p">(</span><span class="n">bdaddr</span><span class="p">),</span> <span class="p">(</span><span class="n">GDestroyNotify</span><span class="p">)</span> <span class="n">g_free</span><span class="p">);</span>
+<a name="line-296"></a> <span class="cm">/* Initial accept method is undefined, we do that lower down */</span>
+<a name="line-297"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="s">&quot;accept-method&quot;</span><span class="p">,</span> <span class="n">GINT_TO_POINTER</span> <span class="p">(</span><span class="mi">-1</span><span class="p">));</span>
+<a name="line-298"></a> <span class="n">g_hash_table_destroy</span> <span class="p">(</span><span class="n">dict</span><span class="p">);</span>
+<a name="line-299"></a> <span class="p">}</span>
+<a name="line-300"></a>
+<a name="line-301"></a> <span class="cm">/* Accept method changed */</span>
+<a name="line-302"></a> <span class="k">if</span> <span class="p">(</span><span class="n">GPOINTER_TO_INT</span> <span class="p">(</span><span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="s">&quot;accept-method&quot;</span><span class="p">))</span> <span class="o">!=</span> <span class="n">accept_setting</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-303"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">bdaddr</span><span class="p">;</span>
+<a name="line-304"></a>
+<a name="line-305"></a> <span class="n">bdaddr</span> <span class="o">=</span> <span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="s">&quot;bdaddr&quot;</span><span class="p">);</span>
+<a name="line-306"></a>
+<a name="line-307"></a> <span class="k">if</span> <span class="p">(</span><span class="n">bdaddr</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-308"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Couldn&#39;t get the Bluetooth address for the device, rejecting the transfer&quot;</span><span class="p">);</span>
+<a name="line-309"></a> <span class="n">authorise</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-310"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">accept_setting</span> <span class="o">==</span> <span class="n">ACCEPT_ALWAYS</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-311"></a> <span class="n">authorise</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-312"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">accept_setting</span> <span class="o">==</span> <span class="n">ACCEPT_BONDED</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-313"></a> <span class="n">authorise</span> <span class="o">=</span> <span class="n">device_is_authorised</span> <span class="p">(</span><span class="n">bdaddr</span><span class="p">);</span>
+<a name="line-314"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-315"></a> <span class="c1">//FIXME implement</span>
+<a name="line-316"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;</span><span class="se">\&quot;</span><span class="s">Ask</span><span class="se">\&quot;</span><span class="s"> authorisation method not implemented&quot;</span><span class="p">);</span>
+<a name="line-317"></a> <span class="n">authorise</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-318"></a> <span class="p">}</span>
+<a name="line-319"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="s">&quot;authorise&quot;</span><span class="p">,</span> <span class="n">GINT_TO_POINTER</span> <span class="p">(</span><span class="n">authorise</span><span class="p">));</span>
+<a name="line-320"></a> <span class="p">}</span>
+<a name="line-321"></a>
+<a name="line-322"></a> <span class="n">g_message</span> <span class="p">(</span><span class="s">&quot;accept_setting: %d&quot;</span><span class="p">,</span> <span class="n">accept_setting</span><span class="p">);</span>
+<a name="line-323"></a>
+<a name="line-324"></a> <span class="n">authorise</span> <span class="o">=</span> <span class="n">GPOINTER_TO_INT</span> <span class="p">(</span><span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="s">&quot;authorise&quot;</span><span class="p">));</span>
+<a name="line-325"></a> <span class="k">if</span> <span class="p">(</span><span class="n">authorise</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-326"></a> <span class="k">if</span> <span class="p">(</span><span class="n">dbus_g_proxy_call</span> <span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="s">&quot;Accept&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">error</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-327"></a> <span class="n">g_printerr</span> <span class="p">(</span><span class="s">&quot;Failed to accept file transfer: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">error</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">);</span>
+<a name="line-328"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">error</span><span class="p">);</span>
+<a name="line-329"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-330"></a> <span class="p">}</span>
+<a name="line-331"></a> <span class="n">g_message</span> <span class="p">(</span><span class="s">&quot;authorised transfer&quot;</span><span class="p">);</span>
+<a name="line-332"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-333"></a> <span class="k">if</span> <span class="p">(</span><span class="n">dbus_g_proxy_call</span> <span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="s">&quot;Reject&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">error</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-334"></a> <span class="n">g_printerr</span> <span class="p">(</span><span class="s">&quot;Failed to reject file transfer: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">error</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">);</span>
+<a name="line-335"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">error</span><span class="p">);</span>
+<a name="line-336"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-337"></a> <span class="p">}</span>
+<a name="line-338"></a> <span class="n">g_message</span> <span class="p">(</span><span class="s">&quot;rejected transfer&quot;</span><span class="p">);</span>
+<a name="line-339"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="s">&quot;filename&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-340"></a> <span class="p">}</span>
+<a name="line-341"></a><span class="p">}</span>
+<a name="line-342"></a>
+<a name="line-343"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-344"></a><span class="n">transfer_completed_cb</span> <span class="p">(</span><span class="n">DBusGProxy</span> <span class="o">*</span><span class="n">session</span><span class="p">,</span>
+<a name="line-345"></a> <span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span>
+<a name="line-346"></a><span class="p">{</span>
+<a name="line-347"></a> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span>
+<a name="line-348"></a> <span class="n">gboolean</span> <span class="n">display_notify</span><span class="p">;</span>
+<a name="line-349"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">filename</span><span class="p">;</span>
+<a name="line-350"></a>
+<a name="line-351"></a> <span class="n">filename</span> <span class="o">=</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="p">)</span> <span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="s">&quot;filename&quot;</span><span class="p">);</span>
+<a name="line-352"></a>
+<a name="line-353"></a> <span class="n">g_message</span> <span class="p">(</span><span class="s">&quot;file finish transfer: %s&quot;</span><span class="p">,</span> <span class="n">filename</span><span class="p">);</span>
+<a name="line-354"></a>
+<a name="line-355"></a> <span class="k">if</span> <span class="p">(</span><span class="n">filename</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-356"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-357"></a>
+<a name="line-358"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">);</span>
+<a name="line-359"></a> <span class="n">display_notify</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY</span><span class="p">);</span>
+<a name="line-360"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-361"></a>
+<a name="line-362"></a> <span class="k">if</span> <span class="p">(</span><span class="n">display_notify</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-363"></a> <span class="n">show_notification</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-364"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-365"></a> <span class="n">hide_statusicon</span> <span class="p">();</span>
+<a name="line-366"></a> <span class="p">}</span>
+<a name="line-367"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">session</span><span class="p">),</span> <span class="s">&quot;filename&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-368"></a><span class="p">}</span>
+<a name="line-369"></a>
+<a name="line-370"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-371"></a><span class="n">cancelled_cb</span> <span class="p">(</span><span class="n">DBusGProxy</span> <span class="o">*</span><span class="n">session</span><span class="p">,</span>
+<a name="line-372"></a> <span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span>
+<a name="line-373"></a><span class="p">{</span>
+<a name="line-374"></a> <span class="c1">//FIXME implement properly, we never actually finished the transfer</span>
+<a name="line-375"></a> <span class="n">g_message</span> <span class="p">(</span><span class="s">&quot;transfered was cancelled by the sender&quot;</span><span class="p">);</span>
+<a name="line-376"></a> <span class="n">transfer_completed_cb</span> <span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="n">user_data</span><span class="p">);</span>
+<a name="line-377"></a> <span class="n">hide_statusicon</span> <span class="p">();</span>
+<a name="line-378"></a><span class="p">}</span>
+<a name="line-379"></a>
+<a name="line-380"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-381"></a><span class="n">error_occurred_cb</span> <span class="p">(</span><span class="n">DBusGProxy</span> <span class="o">*</span><span class="n">session</span><span class="p">,</span>
+<a name="line-382"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">error_name</span><span class="p">,</span>
+<a name="line-383"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">error_message</span><span class="p">,</span>
+<a name="line-384"></a> <span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span>
+<a name="line-385"></a><span class="p">{</span>
+<a name="line-386"></a> <span class="c1">//FIXME implement properly</span>
+<a name="line-387"></a> <span class="n">g_message</span> <span class="p">(</span><span class="s">&quot;transfer error occurred: %s&quot;</span><span class="p">,</span> <span class="n">error_message</span><span class="p">);</span>
+<a name="line-388"></a> <span class="n">transfer_completed_cb</span> <span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="n">user_data</span><span class="p">);</span>
+<a name="line-389"></a><span class="p">}</span>
+<a name="line-390"></a>
+<a name="line-391"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-392"></a><span class="n">session_created_cb</span> <span class="p">(</span><span class="n">DBusGProxy</span> <span class="o">*</span><span class="n">server</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">session_path</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span>
+<a name="line-393"></a><span class="p">{</span>
+<a name="line-394"></a> <span class="n">DBusGProxy</span> <span class="o">*</span><span class="n">session</span><span class="p">;</span>
+<a name="line-395"></a>
+<a name="line-396"></a> <span class="n">session</span> <span class="o">=</span> <span class="n">dbus_g_proxy_new_for_name</span> <span class="p">(</span><span class="n">connection</span><span class="p">,</span>
+<a name="line-397"></a> <span class="s">&quot;org.openobex&quot;</span><span class="p">,</span>
+<a name="line-398"></a> <span class="n">session_path</span><span class="p">,</span>
+<a name="line-399"></a> <span class="s">&quot;org.openobex.ServerSession&quot;</span><span class="p">);</span>
+<a name="line-400"></a>
+<a name="line-401"></a> <span class="n">dbus_g_proxy_add_signal</span> <span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="s">&quot;TransferStarted&quot;</span><span class="p">,</span>
+<a name="line-402"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span> <span class="n">G_TYPE_STRING</span><span class="p">,</span> <span class="n">G_TYPE_UINT64</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">);</span>
+<a name="line-403"></a> <span class="n">dbus_g_proxy_connect_signal</span><span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="s">&quot;TransferStarted&quot;</span><span class="p">,</span>
+<a name="line-404"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">transfer_started_cb</span><span class="p">),</span> <span class="n">server</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-405"></a> <span class="n">dbus_g_proxy_add_signal</span> <span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="s">&quot;TransferCompleted&quot;</span><span class="p">,</span>
+<a name="line-406"></a> <span class="n">G_TYPE_INVALID</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">);</span>
+<a name="line-407"></a> <span class="n">dbus_g_proxy_connect_signal</span><span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="s">&quot;TransferCompleted&quot;</span><span class="p">,</span>
+<a name="line-408"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">transfer_completed_cb</span><span class="p">),</span> <span class="n">server</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-409"></a> <span class="n">dbus_g_proxy_add_signal</span> <span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="s">&quot;Cancelled&quot;</span><span class="p">,</span>
+<a name="line-410"></a> <span class="n">G_TYPE_INVALID</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">);</span>
+<a name="line-411"></a> <span class="n">dbus_g_proxy_connect_signal</span><span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="s">&quot;Cancelled&quot;</span><span class="p">,</span>
+<a name="line-412"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">cancelled_cb</span><span class="p">),</span> <span class="n">server</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-413"></a> <span class="n">dbus_g_proxy_add_signal</span> <span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="s">&quot;ErrorOccurred&quot;</span><span class="p">,</span>
+<a name="line-414"></a> <span class="n">G_TYPE_INVALID</span><span class="p">,</span> <span class="n">G_TYPE_STRING</span><span class="p">,</span> <span class="n">G_TYPE_STRING</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">);</span>
+<a name="line-415"></a> <span class="n">dbus_g_proxy_connect_signal</span><span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="s">&quot;ErrorOccurred&quot;</span><span class="p">,</span>
+<a name="line-416"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">error_occurred_cb</span><span class="p">),</span> <span class="n">server</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-417"></a><span class="p">}</span>
+<a name="line-418"></a>
+<a name="line-419"></a><span class="kt">void</span>
+<a name="line-420"></a><span class="n">obexpush_up</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-421"></a><span class="p">{</span>
+<a name="line-422"></a> <span class="n">GError</span> <span class="o">*</span><span class="n">err</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-423"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">download_dir</span><span class="p">,</span> <span class="o">*</span><span class="n">server</span><span class="p">;</span>
+<a name="line-424"></a>
+<a name="line-425"></a> <span class="n">server</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-426"></a> <span class="k">if</span> <span class="p">(</span><span class="n">manager_proxy</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-427"></a> <span class="n">manager_proxy</span> <span class="o">=</span> <span class="n">dbus_g_proxy_new_for_name</span> <span class="p">(</span><span class="n">connection</span><span class="p">,</span>
+<a name="line-428"></a> <span class="s">&quot;org.openobex&quot;</span><span class="p">,</span>
+<a name="line-429"></a> <span class="s">&quot;/org/openobex&quot;</span><span class="p">,</span>
+<a name="line-430"></a> <span class="s">&quot;org.openobex.Manager&quot;</span><span class="p">);</span>
+<a name="line-431"></a> <span class="k">if</span> <span class="p">(</span><span class="n">dbus_g_proxy_call</span> <span class="p">(</span><span class="n">manager_proxy</span><span class="p">,</span> <span class="s">&quot;CreateBluetoothServer&quot;</span><span class="p">,</span>
+<a name="line-432"></a> <span class="o">&amp;</span><span class="n">err</span><span class="p">,</span> <span class="n">G_TYPE_STRING</span><span class="p">,</span> <span class="s">&quot;00:00:00:00:00:00&quot;</span><span class="p">,</span> <span class="n">G_TYPE_STRING</span><span class="p">,</span> <span class="s">&quot;opp&quot;</span><span class="p">,</span> <span class="n">G_TYPE_BOOLEAN</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">,</span>
+<a name="line-433"></a> <span class="n">DBUS_TYPE_G_OBJECT_PATH</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">server</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-434"></a> <span class="n">g_printerr</span> <span class="p">(</span><span class="s">&quot;Creating Bluetooth ObexPush server failed: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span>
+<a name="line-435"></a> <span class="n">err</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">);</span>
+<a name="line-436"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">err</span><span class="p">);</span>
+<a name="line-437"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">manager_proxy</span><span class="p">);</span>
+<a name="line-438"></a> <span class="n">manager_proxy</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-439"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-440"></a> <span class="p">}</span>
+<a name="line-441"></a> <span class="p">}</span>
+<a name="line-442"></a>
+<a name="line-443"></a> <span class="n">download_dir</span> <span class="o">=</span> <span class="n">lookup_download_dir</span> <span class="p">();</span>
+<a name="line-444"></a>
+<a name="line-445"></a> <span class="k">if</span> <span class="p">(</span><span class="n">server_proxy</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-446"></a> <span class="n">server_proxy</span> <span class="o">=</span> <span class="n">dbus_g_proxy_new_for_name</span> <span class="p">(</span><span class="n">connection</span><span class="p">,</span>
+<a name="line-447"></a> <span class="s">&quot;org.openobex&quot;</span><span class="p">,</span>
+<a name="line-448"></a> <span class="n">server</span><span class="p">,</span>
+<a name="line-449"></a> <span class="s">&quot;org.openobex.Server&quot;</span><span class="p">);</span>
+<a name="line-450"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">server</span><span class="p">);</span>
+<a name="line-451"></a>
+<a name="line-452"></a> <span class="n">dbus_g_proxy_add_signal</span> <span class="p">(</span><span class="n">server_proxy</span><span class="p">,</span> <span class="s">&quot;SessionCreated&quot;</span><span class="p">,</span>
+<a name="line-453"></a> <span class="n">DBUS_TYPE_G_OBJECT_PATH</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">);</span>
+<a name="line-454"></a> <span class="n">dbus_g_proxy_connect_signal</span><span class="p">(</span><span class="n">server_proxy</span><span class="p">,</span> <span class="s">&quot;SessionCreated&quot;</span><span class="p">,</span>
+<a name="line-455"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">session_created_cb</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-456"></a> <span class="p">}</span>
+<a name="line-457"></a>
+<a name="line-458"></a> <span class="k">if</span> <span class="p">(</span><span class="n">dbus_g_proxy_call</span> <span class="p">(</span><span class="n">server_proxy</span><span class="p">,</span> <span class="s">&quot;Start&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">err</span><span class="p">,</span>
+<a name="line-459"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span> <span class="n">download_dir</span><span class="p">,</span> <span class="n">G_TYPE_BOOLEAN</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span> <span class="n">G_TYPE_BOOLEAN</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">,</span>
+<a name="line-460"></a> <span class="n">G_TYPE_INVALID</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-461"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_error_matches</span> <span class="p">(</span><span class="n">err</span><span class="p">,</span> <span class="n">DBUS_GERROR</span><span class="p">,</span> <span class="n">DBUS_GERROR_REMOTE_EXCEPTION</span><span class="p">)</span> <span class="o">!=</span> <span class="n">FALSE</span> <span class="o">&amp;&amp;</span>
+<a name="line-462"></a> <span class="n">dbus_g_error_has_name</span> <span class="p">(</span><span class="n">err</span><span class="p">,</span> <span class="s">&quot;org.openobex.Error.Started&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-463"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">err</span><span class="p">);</span>
+<a name="line-464"></a> <span class="n">g_message</span> <span class="p">(</span><span class="s">&quot;already started, ignoring error&quot;</span><span class="p">);</span>
+<a name="line-465"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">download_dir</span><span class="p">);</span>
+<a name="line-466"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-467"></a> <span class="p">}</span>
+<a name="line-468"></a> <span class="n">g_printerr</span> <span class="p">(</span><span class="s">&quot;Starting Bluetooth ObexPush server failed: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span>
+<a name="line-469"></a> <span class="n">err</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">);</span>
+<a name="line-470"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">err</span><span class="p">);</span>
+<a name="line-471"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">download_dir</span><span class="p">);</span>
+<a name="line-472"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">server_proxy</span><span class="p">);</span>
+<a name="line-473"></a> <span class="n">server_proxy</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-474"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">manager_proxy</span><span class="p">);</span>
+<a name="line-475"></a> <span class="n">manager_proxy</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-476"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-477"></a> <span class="p">}</span>
+<a name="line-478"></a>
+<a name="line-479"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">download_dir</span><span class="p">);</span>
+<a name="line-480"></a><span class="p">}</span>
+<a name="line-481"></a>
+<a name="line-482"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-483"></a><span class="n">obexpush_stop</span> <span class="p">(</span><span class="n">gboolean</span> <span class="n">stop_manager</span><span class="p">)</span>
+<a name="line-484"></a><span class="p">{</span>
+<a name="line-485"></a> <span class="n">GError</span> <span class="o">*</span><span class="n">err</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-486"></a>
+<a name="line-487"></a> <span class="k">if</span> <span class="p">(</span><span class="n">server_proxy</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-488"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-489"></a>
+<a name="line-490"></a> <span class="k">if</span> <span class="p">(</span><span class="n">dbus_g_proxy_call</span> <span class="p">(</span><span class="n">server_proxy</span><span class="p">,</span> <span class="s">&quot;Close&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">err</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-491"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_error_matches</span> <span class="p">(</span><span class="n">err</span><span class="p">,</span> <span class="n">DBUS_GERROR</span><span class="p">,</span> <span class="n">DBUS_GERROR_REMOTE_EXCEPTION</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span> <span class="o">||</span>
+<a name="line-492"></a> <span class="n">dbus_g_error_has_name</span> <span class="p">(</span><span class="n">err</span><span class="p">,</span> <span class="s">&quot;org.openobex.Error.NotStarted&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-493"></a> <span class="n">g_printerr</span> <span class="p">(</span><span class="s">&quot;Stopping Bluetooth ObexPush server failed: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span>
+<a name="line-494"></a> <span class="n">err</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">);</span>
+<a name="line-495"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">err</span><span class="p">);</span>
+<a name="line-496"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-497"></a> <span class="p">}</span>
+<a name="line-498"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">err</span><span class="p">);</span>
+<a name="line-499"></a> <span class="p">}</span>
+<a name="line-500"></a>
+<a name="line-501"></a> <span class="k">if</span> <span class="p">(</span><span class="n">stop_manager</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-502"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">server_proxy</span><span class="p">);</span>
+<a name="line-503"></a> <span class="n">server_proxy</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-504"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">manager_proxy</span><span class="p">);</span>
+<a name="line-505"></a> <span class="n">manager_proxy</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-506"></a> <span class="p">}</span>
+<a name="line-507"></a>
+<a name="line-508"></a> <span class="c1">//FIXME stop all the notifications</span>
+<a name="line-509"></a><span class="p">}</span>
+<a name="line-510"></a>
+<a name="line-511"></a><span class="kt">void</span>
+<a name="line-512"></a><span class="n">obexpush_down</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-513"></a><span class="p">{</span>
+<a name="line-514"></a> <span class="n">obexpush_stop</span> <span class="p">(</span><span class="n">TRUE</span><span class="p">);</span>
+<a name="line-515"></a><span class="p">}</span>
+<a name="line-516"></a>
+<a name="line-517"></a><span class="kt">void</span>
+<a name="line-518"></a><span class="n">obexpush_restart</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-519"></a><span class="p">{</span>
+<a name="line-520"></a> <span class="n">obexpush_stop</span> <span class="p">(</span><span class="n">FALSE</span><span class="p">);</span>
+<a name="line-521"></a> <span class="n">obexpush_up</span> <span class="p">();</span>
+<a name="line-522"></a><span class="p">}</span>
+<a name="line-523"></a>
+<a name="line-524"></a><span class="n">gboolean</span>
+<a name="line-525"></a><span class="n">obexpush_init</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-526"></a><span class="p">{</span>
+<a name="line-527"></a> <span class="n">GError</span> <span class="o">*</span><span class="n">err</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-528"></a>
+<a name="line-529"></a> <span class="n">connection</span> <span class="o">=</span> <span class="n">dbus_g_bus_get</span> <span class="p">(</span><span class="n">DBUS_BUS_SESSION</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">err</span><span class="p">);</span>
+<a name="line-530"></a> <span class="k">if</span> <span class="p">(</span><span class="n">connection</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-531"></a> <span class="n">g_printerr</span> <span class="p">(</span><span class="s">&quot;Connecting to session bus failed: %s</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">,</span>
+<a name="line-532"></a> <span class="n">err</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">);</span>
+<a name="line-533"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">err</span><span class="p">);</span>
+<a name="line-534"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-535"></a> <span class="p">}</span>
+<a name="line-536"></a>
+<a name="line-537"></a> <span class="n">dbus_g_object_register_marshaller</span> <span class="p">(</span><span class="n">marshal_VOID__STRING_STRING_UINT64</span><span class="p">,</span>
+<a name="line-538"></a> <span class="n">G_TYPE_NONE</span><span class="p">,</span>
+<a name="line-539"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span> <span class="n">G_TYPE_STRING</span><span class="p">,</span> <span class="n">G_TYPE_UINT64</span><span class="p">,</span> <span class="n">G_TYPE_INVALID</span><span class="p">);</span>
+<a name="line-540"></a>
+<a name="line-541"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">notify_init</span><span class="p">(</span><span class="s">&quot;mate-user-share&quot;</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-542"></a> <span class="n">g_warning</span><span class="p">(</span><span class="s">&quot;Unable to initialize the notification system</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
+<a name="line-543"></a> <span class="p">}</span>
+<a name="line-544"></a>
+<a name="line-545"></a> <span class="n">dbus_connection_set_exit_on_disconnect</span> <span class="p">(</span><span class="n">dbus_g_connection_get_connection</span> <span class="p">(</span><span class="n">connection</span><span class="p">),</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-546"></a>
+<a name="line-547"></a> <span class="k">return</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-548"></a><span class="p">}</span>
+<a name="line-549"></a>
+<a name="line-550"></a><span class="kt">void</span>
+<a name="line-551"></a><span class="n">obexpush_set_accept_files_policy</span> <span class="p">(</span><span class="n">AcceptSetting</span> <span class="n">setting</span><span class="p">)</span>
+<a name="line-552"></a><span class="p">{</span>
+<a name="line-553"></a> <span class="n">accept_setting</span> <span class="o">=</span> <span class="n">setting</span><span class="p">;</span>
+<a name="line-554"></a><span class="p">}</span>
+<a name="line-555"></a>
+<a name="line-556"></a><span class="kt">void</span>
+<a name="line-557"></a><span class="n">obexpush_set_notify</span> <span class="p">(</span><span class="n">gboolean</span> <span class="n">enabled</span><span class="p">)</span>
+<a name="line-558"></a><span class="p">{</span>
+<a name="line-559"></a> <span class="n">show_notifications</span> <span class="o">=</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-560"></a><span class="p">}</span>
+</pre></div>
+</td></tr></table>
+ </div> <!-- /.wrapper -->
+ </div>
+ <div id="footer" class="footer">
+ <p>
+ Cppcheck 2.3 - a tool for static C/C++ code analysis<br>
+ <br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a><br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a><br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/3.html b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/3.html
new file mode 100644
index 0000000..5211d1c
--- /dev/null
+++ b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/3.html
@@ -0,0 +1,771 @@
+
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-user-share</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+pre { line-height: 125%; }
+td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
+span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
+td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #ffffff; }
+.highlight .c { color: #888888 } /* Comment */
+.highlight .err { color: #FF0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #008800; font-weight: bold } /* Keyword */
+.highlight .o { color: #333333 } /* Operator */
+.highlight .ch { color: #888888 } /* Comment.Hashbang */
+.highlight .cm { color: #888888 } /* Comment.Multiline */
+.highlight .cp { color: #557799 } /* Comment.Preproc */
+.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
+.highlight .c1 { color: #888888 } /* Comment.Single */
+.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #003388; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #333399; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #6600EE; font-weight: bold } /* Literal.Number */
+.highlight .s { background-color: #fff0f0 } /* Literal.String */
+.highlight .na { color: #0000CC } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #BB0066; font-weight: bold } /* Name.Class */
+.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #880000; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0066BB; font-weight: bold } /* Name.Function */
+.highlight .nl { color: #997700; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #007700 } /* Name.Tag */
+.highlight .nv { color: #996633 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #4400EE; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { background-color: #fff0f0 } /* Literal.String.Affix */
+.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.highlight .sc { color: #0044DD } /* Literal.String.Char */
+.highlight .dl { background-color: #fff0f0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #DD4422 } /* Literal.String.Doc */
+.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.highlight .se { color: #666666; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.highlight .si { background-color: #eeeeee } /* Literal.String.Interpol */
+.highlight .sx { color: #DD2200; background-color: #fff0f0 } /* Literal.String.Other */
+.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.highlight .ss { color: #AA6600 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #0066BB; font-weight: bold } /* Name.Function.Magic */
+.highlight .vc { color: #336699 } /* Name.Variable.Class */
+.highlight .vg { color: #dd7700; font-weight: bold } /* Name.Variable.Global */
+.highlight .vi { color: #3333BB } /* Name.Variable.Instance */
+.highlight .vm { color: #996633 } /* Name.Variable.Magic */
+.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
+ </style>
+ <script>
+ function getStyle(el, styleProp) {
+ var y;
+
+ if (el.currentStyle) {
+ y = el.currentStyle[styleProp];
+ } else if (window.getComputedStyle) {
+ y = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
+ }
+
+ return y;
+ }
+
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+
+ if (el.style.display === "block") {
+ el.style.display = "none";
+ mark.textContent = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.textContent = "[-]";
+ }
+ }
+
+ function initExpandables() {
+ var elements = document.querySelectorAll(".expandable");
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ var el = elements[i];
+ var clickable = el.querySelector("span");
+ var marker = clickable.querySelector(".marker");
+ var content = el.querySelector(".content");
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.addEventListener("click", toggle);
+ }
+ }
+
+ function toggleDisplay(id) {
+ var elements = document.querySelectorAll("." + id);
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ elements[i].classList.toggle("d-none");
+ }
+ }
+
+ function toggleAll() {
+ var elements = document.querySelectorAll("input");
+
+ // starting from 1 since 0 is the "toggle all" input
+ for (var i = 1, len = elements.length; i < len; i++) {
+ var el = elements[i];
+
+ if (el.checked) {
+ el.checked = false;
+ } else {
+ el.checked = true;
+ }
+
+ toggleDisplay(el.id);
+ }
+ }
+ window.addEventListener("load", initExpandables);
+ </script>
+ </head>
+ <body>
+ <div id="header" class="header">
+ <h1>Cppcheck report - mate-user-share: src/share-extension.c</h1>
+ </div>
+ <div class="wrapper">
+ <div id="menu">
+ <p id="filename"><a href="index.html">Defects:</a> share-extension.c</p>
+<a href="3.html#line-62"> variableScope 62</a>
+ </div>
+ <div id="content">
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292</pre></div></td><td class="code"><div class="highlight"><pre><span></span><a name="line-1"></a><span class="cm">/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*-</span>
+<a name="line-2"></a><span class="cm"> *</span>
+<a name="line-3"></a><span class="cm"> * Copyright (C) 2003 Novell, Inc.</span>
+<a name="line-4"></a><span class="cm"> * Copyright (C) 2003-2004 Red Hat, Inc.</span>
+<a name="line-5"></a><span class="cm"> * Copyright (C) 2005 William Jon McCann &lt;[email protected]&gt;</span>
+<a name="line-6"></a><span class="cm"> * Copyright (C) 2012-2021 MATE Developers</span>
+<a name="line-7"></a><span class="cm"> *</span>
+<a name="line-8"></a><span class="cm"> * This program is free software; you can redistribute it and/or</span>
+<a name="line-9"></a><span class="cm"> * modify it under the terms of the GNU General Public License as</span>
+<a name="line-10"></a><span class="cm"> * published by the Free Software Foundation; either version 2 of the</span>
+<a name="line-11"></a><span class="cm"> * License, or (at your option) any later version.</span>
+<a name="line-12"></a><span class="cm"> *</span>
+<a name="line-13"></a><span class="cm"> * This program is distributed in the hope that it will be useful,</span>
+<a name="line-14"></a><span class="cm"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
+<a name="line-15"></a><span class="cm"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
+<a name="line-16"></a><span class="cm"> * General Public License for more details.</span>
+<a name="line-17"></a><span class="cm"> *</span>
+<a name="line-18"></a><span class="cm"> * You should have received a copy of the GNU General Public</span>
+<a name="line-19"></a><span class="cm"> * License along with this program; if not, write to the</span>
+<a name="line-20"></a><span class="cm"> * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,</span>
+<a name="line-21"></a><span class="cm"> * Boston, MA 02110-1301, USA.</span>
+<a name="line-22"></a><span class="cm"> *</span>
+<a name="line-23"></a><span class="cm"> */</span>
+<a name="line-24"></a>
+<a name="line-25"></a><span class="cp">#include</span> <span class="cpf">&quot;config.h&quot;</span><span class="cp"></span>
+<a name="line-26"></a>
+<a name="line-27"></a><span class="cp">#include</span> <span class="cpf">&lt;stdlib.h&gt;</span><span class="cp"></span>
+<a name="line-28"></a><span class="cp">#include</span> <span class="cpf">&lt;string.h&gt;</span><span class="cp"></span>
+<a name="line-29"></a><span class="cp">#include</span> <span class="cpf">&lt;glib/gi18n-lib.h&gt;</span><span class="cp"></span>
+<a name="line-30"></a><span class="cp">#include</span> <span class="cpf">&lt;gtk/gtk.h&gt;</span><span class="cp"></span>
+<a name="line-31"></a><span class="cp">#include</span> <span class="cpf">&lt;libcaja-extension/caja-menu-provider.h&gt;</span><span class="cp"></span>
+<a name="line-32"></a><span class="cp">#include</span> <span class="cpf">&lt;libcaja-extension/caja-location-widget-provider.h&gt;</span><span class="cp"></span>
+<a name="line-33"></a>
+<a name="line-34"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-35"></a><span class="cp">#include</span> <span class="cpf">&lt;bluetooth-client.h&gt;</span><span class="cp"></span>
+<a name="line-36"></a><span class="cp">#endif</span>
+<a name="line-37"></a>
+<a name="line-38"></a><span class="cp">#include</span> <span class="cpf">&quot;caja-share-bar.h&quot;</span><span class="cp"></span>
+<a name="line-39"></a><span class="cp">#include</span> <span class="cpf">&quot;user_share-common.h&quot;</span><span class="cp"></span>
+<a name="line-40"></a>
+<a name="line-41"></a><span class="cp">#define CAJA_TYPE_USER_SHARE (caja_user_share_get_type ())</span>
+<a name="line-42"></a><span class="cp">#define CAJA_USER_SHARE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_USER_SHARE, CajaUserShare))</span>
+<a name="line-43"></a><span class="cp">#define CAJA_IS_USER_SHARE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_USER_SHARE))</span>
+<a name="line-44"></a>
+<a name="line-45"></a><span class="k">typedef</span> <span class="k">struct</span>
+<a name="line-46"></a><span class="p">{</span>
+<a name="line-47"></a> <span class="n">GObject</span> <span class="n">parent_slot</span><span class="p">;</span>
+<a name="line-48"></a><span class="p">}</span> <span class="n">CajaUserShare</span><span class="p">;</span>
+<a name="line-49"></a>
+<a name="line-50"></a><span class="k">typedef</span> <span class="k">struct</span>
+<a name="line-51"></a><span class="p">{</span>
+<a name="line-52"></a> <span class="n">GObjectClass</span> <span class="n">parent_slot</span><span class="p">;</span>
+<a name="line-53"></a><span class="p">}</span> <span class="n">CajaUserShareClass</span><span class="p">;</span>
+<a name="line-54"></a>
+<a name="line-55"></a><span class="k">static</span> <span class="n">GType</span> <span class="n">caja_user_share_get_type</span> <span class="p">(</span><span class="kt">void</span><span class="p">);</span>
+<a name="line-56"></a><span class="k">static</span> <span class="kt">void</span> <span class="n">caja_user_share_register_type</span> <span class="p">(</span><span class="n">GTypeModule</span> <span class="o">*</span><span class="n">module</span><span class="p">);</span>
+<a name="line-57"></a>
+<a name="line-58"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-59"></a><span class="n">launch_process</span> <span class="p">(</span><span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">,</span> <span class="n">GtkWindow</span> <span class="o">*</span><span class="n">parent</span><span class="p">)</span>
+<a name="line-60"></a><span class="p">{</span>
+<a name="line-61"></a> <span class="n">GError</span> <span class="o">*</span><span class="n">error</span><span class="p">;</span>
+<a name="line-62"></a><span class="hll"> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">dialog</span><span class="p">;</span><div class="verbose expandable"><span class="error2">&lt;--- The scope of the variable 'dialog' can be reduced. <span class="marker">[+]</span></span><div class="content">The scope of the variable &apos;dialog&apos; can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for &apos;i&apos; can be reduced:
+void f(int x)
+{
+ int i = 0;
+ if (x) {
+ // it&apos;s safe to move &apos;int i = 0;&apos; here
+ for (int n = 0; n &lt; 10; ++n) {
+ // it is possible but not safe to move &apos;int i = 0;&apos; here
+ do_something(&amp;i);
+ }
+ }
+}
+When you see this message it is always safe to reduce the variable scope 1 level.</div></div>
+</span><a name="line-63"></a>
+<a name="line-64"></a> <span class="n">error</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-65"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">g_spawn_async</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">,</span>
+<a name="line-66"></a> <span class="n">argv</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-67"></a> <span class="mi">0</span><span class="p">,</span>
+<a name="line-68"></a> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-69"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-70"></a> <span class="o">&amp;</span><span class="n">error</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-71"></a>
+<a name="line-72"></a>
+<a name="line-73"></a> <span class="n">dialog</span> <span class="o">=</span> <span class="n">gtk_message_dialog_new</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="n">GTK_DIALOG_MODAL</span><span class="p">,</span> <span class="n">GTK_MESSAGE_WARNING</span><span class="p">,</span>
+<a name="line-74"></a> <span class="n">GTK_BUTTONS_OK</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Unable to launch the Personal File Sharing preferences&quot;</span><span class="p">));</span>
+<a name="line-75"></a>
+<a name="line-76"></a> <span class="n">gtk_message_dialog_format_secondary_text</span> <span class="p">(</span><span class="n">GTK_MESSAGE_DIALOG</span> <span class="p">(</span><span class="n">dialog</span><span class="p">),</span> <span class="s">&quot;%s&quot;</span><span class="p">,</span> <span class="n">error</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">);</span>
+<a name="line-77"></a>
+<a name="line-78"></a> <span class="n">gtk_dialog_run</span> <span class="p">(</span><span class="n">GTK_DIALOG</span> <span class="p">(</span><span class="n">dialog</span><span class="p">));</span>
+<a name="line-79"></a> <span class="n">gtk_widget_destroy</span> <span class="p">(</span><span class="n">dialog</span><span class="p">);</span>
+<a name="line-80"></a>
+<a name="line-81"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">error</span><span class="p">);</span>
+<a name="line-82"></a> <span class="p">}</span>
+<a name="line-83"></a><span class="p">}</span>
+<a name="line-84"></a>
+<a name="line-85"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-86"></a><span class="n">launch_prefs_on_window</span> <span class="p">(</span><span class="n">GtkWindow</span> <span class="o">*</span><span class="n">window</span><span class="p">)</span>
+<a name="line-87"></a><span class="p">{</span>
+<a name="line-88"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span> <span class="p">[</span><span class="mi">2</span><span class="p">];</span>
+<a name="line-89"></a>
+<a name="line-90"></a> <span class="n">argv</span> <span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">BINDIR</span><span class="p">,</span> <span class="s">&quot;mate-file-share-properties&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-91"></a> <span class="n">argv</span> <span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-92"></a>
+<a name="line-93"></a> <span class="n">launch_process</span> <span class="p">(</span><span class="n">argv</span><span class="p">,</span> <span class="n">window</span><span class="p">);</span>
+<a name="line-94"></a>
+<a name="line-95"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">argv</span> <span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
+<a name="line-96"></a><span class="p">}</span>
+<a name="line-97"></a>
+<a name="line-98"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-99"></a><span class="n">bar_response_cb</span> <span class="p">(</span><span class="n">CajaShareBar</span> <span class="o">*</span><span class="n">bar</span><span class="p">,</span>
+<a name="line-100"></a> <span class="n">gint</span> <span class="n">response</span><span class="p">,</span>
+<a name="line-101"></a> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-102"></a><span class="p">{</span>
+<a name="line-103"></a> <span class="k">if</span> <span class="p">(</span><span class="n">response</span> <span class="o">==</span> <span class="n">CAJA_SHARE_BAR_RESPONSE_PREFERENCES</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-104"></a> <span class="n">launch_prefs_on_window</span> <span class="p">(</span><span class="n">GTK_WINDOW</span> <span class="p">(</span><span class="n">data</span><span class="p">));</span>
+<a name="line-105"></a> <span class="p">}</span>
+<a name="line-106"></a><span class="p">}</span>
+<a name="line-107"></a>
+<a name="line-108"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-109"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-110"></a><span class="n">downloads_bar_set_from_bluetooth_status</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">bar</span><span class="p">)</span>
+<a name="line-111"></a><span class="p">{</span>
+<a name="line-112"></a> <span class="n">BluetoothClient</span> <span class="o">*</span><span class="n">client</span><span class="p">;</span>
+<a name="line-113"></a> <span class="n">gboolean</span> <span class="n">bt_powered</span><span class="p">;</span>
+<a name="line-114"></a>
+<a name="line-115"></a> <span class="n">client</span> <span class="o">=</span> <span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">bar</span><span class="p">),</span> <span class="s">&quot;bluetooth-client&quot;</span><span class="p">);</span>
+<a name="line-116"></a> <span class="n">g_object_get</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">client</span><span class="p">),</span>
+<a name="line-117"></a> <span class="s">&quot;default-adapter-powered&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">bt_powered</span><span class="p">,</span>
+<a name="line-118"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-119"></a> <span class="n">gtk_widget_set_visible</span> <span class="p">(</span><span class="n">bar</span><span class="p">,</span> <span class="n">bt_powered</span><span class="p">);</span>
+<a name="line-120"></a><span class="p">}</span>
+<a name="line-121"></a>
+<a name="line-122"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-123"></a><span class="n">default_adapter_powered_cb</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">gobject</span><span class="p">,</span>
+<a name="line-124"></a> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">pspec</span><span class="p">,</span>
+<a name="line-125"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">bar</span><span class="p">)</span>
+<a name="line-126"></a><span class="p">{</span>
+<a name="line-127"></a> <span class="n">downloads_bar_set_from_bluetooth_status</span> <span class="p">(</span><span class="n">bar</span><span class="p">);</span>
+<a name="line-128"></a><span class="p">}</span>
+<a name="line-129"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-130"></a>
+<a name="line-131"></a><span class="k">static</span> <span class="n">GtkWidget</span> <span class="o">*</span>
+<a name="line-132"></a><span class="n">caja_user_share_get_location_widget</span> <span class="p">(</span><span class="n">CajaLocationWidgetProvider</span> <span class="o">*</span><span class="n">iface</span><span class="p">,</span>
+<a name="line-133"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">uri</span><span class="p">,</span>
+<a name="line-134"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">window</span><span class="p">)</span>
+<a name="line-135"></a><span class="p">{</span>
+<a name="line-136"></a> <span class="n">GFile</span> <span class="o">*</span><span class="n">file</span><span class="p">;</span>
+<a name="line-137"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">bar</span><span class="p">;</span>
+<a name="line-138"></a> <span class="n">guint</span> <span class="n">i</span><span class="p">;</span>
+<a name="line-139"></a> <span class="n">gboolean</span> <span class="n">enable</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-140"></a> <span class="n">GFile</span> <span class="o">*</span><span class="n">home</span><span class="p">;</span>
+<a name="line-141"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-142"></a> <span class="k">const</span> <span class="n">GUserDirectory</span> <span class="n">special_dirs</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span> <span class="n">G_USER_DIRECTORY_PUBLIC_SHARE</span><span class="p">,</span> <span class="n">G_USER_DIRECTORY_DOWNLOAD</span> <span class="p">};</span>
+<a name="line-143"></a>
+<a name="line-144"></a> <span class="n">gboolean</span> <span class="n">is_dir</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span> <span class="p">};</span>
+<a name="line-145"></a><span class="cp">#else</span>
+<a name="line-146"></a> <span class="k">const</span> <span class="n">GUserDirectory</span> <span class="n">special_dirs</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span> <span class="n">G_USER_DIRECTORY_PUBLIC_SHARE</span> <span class="p">};</span>
+<a name="line-147"></a>
+<a name="line-148"></a> <span class="n">gboolean</span> <span class="n">is_dir</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span> <span class="n">FALSE</span> <span class="p">};</span>
+<a name="line-149"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-150"></a> <span class="n">file</span> <span class="o">=</span> <span class="n">g_file_new_for_uri</span> <span class="p">(</span><span class="n">uri</span><span class="p">);</span>
+<a name="line-151"></a> <span class="n">home</span> <span class="o">=</span> <span class="n">g_file_new_for_path</span> <span class="p">(</span><span class="n">g_get_home_dir</span> <span class="p">());</span>
+<a name="line-152"></a>
+<a name="line-153"></a> <span class="cm">/* We don&#39;t show anything in $HOME */</span>
+<a name="line-154"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_equal</span> <span class="p">(</span><span class="n">home</span><span class="p">,</span> <span class="n">file</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-155"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">home</span><span class="p">);</span>
+<a name="line-156"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">file</span><span class="p">);</span>
+<a name="line-157"></a> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-158"></a> <span class="p">}</span>
+<a name="line-159"></a>
+<a name="line-160"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">home</span><span class="p">);</span>
+<a name="line-161"></a>
+<a name="line-162"></a> <span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">G_N_ELEMENTS</span> <span class="p">(</span><span class="n">special_dirs</span><span class="p">);</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-163"></a> <span class="n">GFile</span> <span class="o">*</span><span class="n">dir</span><span class="p">;</span>
+<a name="line-164"></a> <span class="n">dir</span> <span class="o">=</span> <span class="n">lookup_dir_with_fallback</span> <span class="p">(</span><span class="n">special_dirs</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
+<a name="line-165"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_equal</span> <span class="p">(</span><span class="n">dir</span><span class="p">,</span> <span class="n">file</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-166"></a> <span class="n">enable</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-167"></a> <span class="n">is_dir</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-168"></a> <span class="p">}</span>
+<a name="line-169"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">dir</span><span class="p">);</span>
+<a name="line-170"></a> <span class="p">}</span>
+<a name="line-171"></a>
+<a name="line-172"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">file</span><span class="p">);</span>
+<a name="line-173"></a>
+<a name="line-174"></a> <span class="k">if</span> <span class="p">(</span><span class="n">enable</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-175"></a> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-176"></a>
+<a name="line-177"></a> <span class="k">if</span> <span class="p">(</span><span class="n">is_dir</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-178"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-179"></a> <span class="k">if</span> <span class="p">(</span><span class="n">is_dir</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-180"></a> <span class="n">bar</span> <span class="o">=</span> <span class="n">caja_share_bar_new</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;May be used to share or receive files&quot;</span><span class="p">));</span>
+<a name="line-181"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-182"></a> <span class="n">bar</span> <span class="o">=</span> <span class="n">caja_share_bar_new</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;May be shared over the network or Bluetooth&quot;</span><span class="p">));</span>
+<a name="line-183"></a> <span class="p">}</span>
+<a name="line-184"></a><span class="cp">#else</span>
+<a name="line-185"></a> <span class="n">bar</span> <span class="o">=</span> <span class="n">caja_share_bar_new</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;May be shared over the network&quot;</span><span class="p">));</span>
+<a name="line-186"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-187"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-188"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-189"></a> <span class="n">BluetoothClient</span> <span class="o">*</span><span class="n">client</span><span class="p">;</span>
+<a name="line-190"></a>
+<a name="line-191"></a> <span class="n">bar</span> <span class="o">=</span> <span class="n">caja_share_bar_new</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;May be used to receive files over Bluetooth&quot;</span><span class="p">));</span>
+<a name="line-192"></a>
+<a name="line-193"></a> <span class="n">gtk_widget_set_no_show_all</span> <span class="p">(</span><span class="n">bar</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-194"></a> <span class="n">client</span> <span class="o">=</span> <span class="n">bluetooth_client_new</span> <span class="p">();</span>
+<a name="line-195"></a> <span class="n">g_object_set_data_full</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">bar</span><span class="p">),</span> <span class="s">&quot;bluetooth-client&quot;</span><span class="p">,</span> <span class="n">client</span><span class="p">,</span> <span class="n">g_object_unref</span><span class="p">);</span>
+<a name="line-196"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">client</span><span class="p">),</span> <span class="s">&quot;notify::default-adapter-powered&quot;</span><span class="p">,</span>
+<a name="line-197"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">default_adapter_powered_cb</span><span class="p">),</span> <span class="n">bar</span><span class="p">);</span>
+<a name="line-198"></a> <span class="n">downloads_bar_set_from_bluetooth_status</span> <span class="p">(</span><span class="n">bar</span><span class="p">);</span>
+<a name="line-199"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-200"></a> <span class="p">}</span>
+<a name="line-201"></a>
+<a name="line-202"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">bar</span><span class="p">,</span> <span class="s">&quot;response&quot;</span><span class="p">,</span>
+<a name="line-203"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">bar_response_cb</span><span class="p">),</span>
+<a name="line-204"></a> <span class="n">window</span><span class="p">);</span>
+<a name="line-205"></a>
+<a name="line-206"></a> <span class="n">gtk_widget_show_all</span> <span class="p">(</span><span class="n">bar</span><span class="p">);</span>
+<a name="line-207"></a>
+<a name="line-208"></a> <span class="k">return</span> <span class="n">bar</span><span class="p">;</span>
+<a name="line-209"></a><span class="p">}</span>
+<a name="line-210"></a>
+<a name="line-211"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-212"></a><span class="n">caja_user_share_location_widget_provider_iface_init</span> <span class="p">(</span><span class="n">CajaLocationWidgetProviderIface</span> <span class="o">*</span><span class="n">iface</span><span class="p">)</span>
+<a name="line-213"></a><span class="p">{</span>
+<a name="line-214"></a> <span class="n">iface</span><span class="o">-&gt;</span><span class="n">get_widget</span> <span class="o">=</span> <span class="n">caja_user_share_get_location_widget</span><span class="p">;</span>
+<a name="line-215"></a><span class="p">}</span>
+<a name="line-216"></a>
+<a name="line-217"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-218"></a><span class="n">caja_user_share_instance_init</span> <span class="p">(</span><span class="n">CajaUserShare</span> <span class="o">*</span><span class="n">share</span><span class="p">)</span>
+<a name="line-219"></a><span class="p">{</span>
+<a name="line-220"></a>
+<a name="line-221"></a><span class="p">}</span>
+<a name="line-222"></a>
+<a name="line-223"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-224"></a><span class="n">caja_user_share_class_init</span> <span class="p">(</span><span class="n">CajaUserShareClass</span> <span class="o">*</span><span class="n">klass</span><span class="p">)</span>
+<a name="line-225"></a><span class="p">{</span>
+<a name="line-226"></a>
+<a name="line-227"></a><span class="p">}</span>
+<a name="line-228"></a>
+<a name="line-229"></a><span class="k">static</span> <span class="n">GType</span> <span class="n">share_type</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-230"></a>
+<a name="line-231"></a><span class="k">static</span> <span class="n">GType</span>
+<a name="line-232"></a><span class="n">caja_user_share_get_type</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-233"></a><span class="p">{</span>
+<a name="line-234"></a> <span class="k">return</span> <span class="n">share_type</span><span class="p">;</span>
+<a name="line-235"></a><span class="p">}</span>
+<a name="line-236"></a>
+<a name="line-237"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-238"></a><span class="n">caja_user_share_register_type</span> <span class="p">(</span><span class="n">GTypeModule</span> <span class="o">*</span><span class="n">module</span><span class="p">)</span>
+<a name="line-239"></a><span class="p">{</span>
+<a name="line-240"></a> <span class="k">static</span> <span class="k">const</span> <span class="n">GTypeInfo</span> <span class="n">info</span> <span class="o">=</span> <span class="p">{</span>
+<a name="line-241"></a> <span class="k">sizeof</span> <span class="p">(</span><span class="n">CajaUserShareClass</span><span class="p">),</span>
+<a name="line-242"></a> <span class="p">(</span><span class="n">GBaseInitFunc</span><span class="p">)</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-243"></a> <span class="p">(</span><span class="n">GBaseFinalizeFunc</span><span class="p">)</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-244"></a> <span class="p">(</span><span class="n">GClassInitFunc</span><span class="p">)</span> <span class="n">caja_user_share_class_init</span><span class="p">,</span>
+<a name="line-245"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-246"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-247"></a> <span class="k">sizeof</span> <span class="p">(</span><span class="n">CajaUserShare</span><span class="p">),</span>
+<a name="line-248"></a> <span class="mi">0</span><span class="p">,</span>
+<a name="line-249"></a> <span class="p">(</span><span class="n">GInstanceInitFunc</span><span class="p">)</span> <span class="n">caja_user_share_instance_init</span><span class="p">,</span>
+<a name="line-250"></a> <span class="p">};</span>
+<a name="line-251"></a>
+<a name="line-252"></a> <span class="k">static</span> <span class="k">const</span> <span class="n">GInterfaceInfo</span> <span class="n">location_widget_provider_iface_info</span> <span class="o">=</span> <span class="p">{</span>
+<a name="line-253"></a> <span class="p">(</span><span class="n">GInterfaceInitFunc</span><span class="p">)</span> <span class="n">caja_user_share_location_widget_provider_iface_init</span><span class="p">,</span>
+<a name="line-254"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-255"></a> <span class="nb">NULL</span>
+<a name="line-256"></a> <span class="p">};</span>
+<a name="line-257"></a>
+<a name="line-258"></a> <span class="n">share_type</span> <span class="o">=</span> <span class="n">g_type_module_register_type</span> <span class="p">(</span><span class="n">module</span><span class="p">,</span>
+<a name="line-259"></a> <span class="n">G_TYPE_OBJECT</span><span class="p">,</span>
+<a name="line-260"></a> <span class="s">&quot;CajaUserShare&quot;</span><span class="p">,</span>
+<a name="line-261"></a> <span class="o">&amp;</span><span class="n">info</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-262"></a>
+<a name="line-263"></a> <span class="n">g_type_module_add_interface</span> <span class="p">(</span><span class="n">module</span><span class="p">,</span>
+<a name="line-264"></a> <span class="n">share_type</span><span class="p">,</span>
+<a name="line-265"></a> <span class="n">CAJA_TYPE_LOCATION_WIDGET_PROVIDER</span><span class="p">,</span>
+<a name="line-266"></a> <span class="o">&amp;</span><span class="n">location_widget_provider_iface_info</span><span class="p">);</span>
+<a name="line-267"></a><span class="p">}</span>
+<a name="line-268"></a>
+<a name="line-269"></a><span class="kt">void</span>
+<a name="line-270"></a><span class="n">caja_module_initialize</span> <span class="p">(</span><span class="n">GTypeModule</span> <span class="o">*</span><span class="n">module</span><span class="p">)</span>
+<a name="line-271"></a><span class="p">{</span>
+<a name="line-272"></a> <span class="n">caja_user_share_register_type</span> <span class="p">(</span><span class="n">module</span><span class="p">);</span>
+<a name="line-273"></a> <span class="n">bindtextdomain</span> <span class="p">(</span><span class="n">GETTEXT_PACKAGE</span><span class="p">,</span> <span class="n">MATELOCALEDIR</span><span class="p">);</span>
+<a name="line-274"></a> <span class="n">bind_textdomain_codeset</span> <span class="p">(</span><span class="n">GETTEXT_PACKAGE</span><span class="p">,</span> <span class="s">&quot;UTF-8&quot;</span><span class="p">);</span>
+<a name="line-275"></a><span class="p">}</span>
+<a name="line-276"></a>
+<a name="line-277"></a><span class="kt">void</span>
+<a name="line-278"></a><span class="n">caja_module_shutdown</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-279"></a><span class="p">{</span>
+<a name="line-280"></a><span class="p">}</span>
+<a name="line-281"></a>
+<a name="line-282"></a><span class="kt">void</span>
+<a name="line-283"></a><span class="n">caja_module_list_types</span> <span class="p">(</span><span class="k">const</span> <span class="n">GType</span> <span class="o">**</span><span class="n">types</span><span class="p">,</span>
+<a name="line-284"></a> <span class="kt">int</span> <span class="o">*</span><span class="n">num_types</span><span class="p">)</span>
+<a name="line-285"></a><span class="p">{</span>
+<a name="line-286"></a> <span class="k">static</span> <span class="n">GType</span> <span class="n">type_list</span> <span class="p">[</span><span class="mi">1</span><span class="p">];</span>
+<a name="line-287"></a>
+<a name="line-288"></a> <span class="n">type_list</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">CAJA_TYPE_USER_SHARE</span><span class="p">;</span>
+<a name="line-289"></a>
+<a name="line-290"></a> <span class="o">*</span><span class="n">types</span> <span class="o">=</span> <span class="n">type_list</span><span class="p">;</span>
+<a name="line-291"></a> <span class="o">*</span><span class="n">num_types</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-292"></a><span class="p">}</span>
+</pre></div>
+</td></tr></table>
+ </div> <!-- /.wrapper -->
+ </div>
+ <div id="footer" class="footer">
+ <p>
+ Cppcheck 2.3 - a tool for static C/C++ code analysis<br>
+ <br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a><br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a><br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/4.html b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/4.html
new file mode 100644
index 0000000..6886e58
--- /dev/null
+++ b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/4.html
@@ -0,0 +1,1189 @@
+
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-user-share</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+pre { line-height: 125%; }
+td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
+span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
+td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #ffffff; }
+.highlight .c { color: #888888 } /* Comment */
+.highlight .err { color: #FF0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #008800; font-weight: bold } /* Keyword */
+.highlight .o { color: #333333 } /* Operator */
+.highlight .ch { color: #888888 } /* Comment.Hashbang */
+.highlight .cm { color: #888888 } /* Comment.Multiline */
+.highlight .cp { color: #557799 } /* Comment.Preproc */
+.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
+.highlight .c1 { color: #888888 } /* Comment.Single */
+.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #003388; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #333399; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #6600EE; font-weight: bold } /* Literal.Number */
+.highlight .s { background-color: #fff0f0 } /* Literal.String */
+.highlight .na { color: #0000CC } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #BB0066; font-weight: bold } /* Name.Class */
+.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #880000; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0066BB; font-weight: bold } /* Name.Function */
+.highlight .nl { color: #997700; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #007700 } /* Name.Tag */
+.highlight .nv { color: #996633 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #4400EE; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { background-color: #fff0f0 } /* Literal.String.Affix */
+.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.highlight .sc { color: #0044DD } /* Literal.String.Char */
+.highlight .dl { background-color: #fff0f0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #DD4422 } /* Literal.String.Doc */
+.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.highlight .se { color: #666666; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.highlight .si { background-color: #eeeeee } /* Literal.String.Interpol */
+.highlight .sx { color: #DD2200; background-color: #fff0f0 } /* Literal.String.Other */
+.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.highlight .ss { color: #AA6600 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #0066BB; font-weight: bold } /* Name.Function.Magic */
+.highlight .vc { color: #336699 } /* Name.Variable.Class */
+.highlight .vg { color: #dd7700; font-weight: bold } /* Name.Variable.Global */
+.highlight .vi { color: #3333BB } /* Name.Variable.Instance */
+.highlight .vm { color: #996633 } /* Name.Variable.Magic */
+.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
+ </style>
+ <script>
+ function getStyle(el, styleProp) {
+ var y;
+
+ if (el.currentStyle) {
+ y = el.currentStyle[styleProp];
+ } else if (window.getComputedStyle) {
+ y = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
+ }
+
+ return y;
+ }
+
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+
+ if (el.style.display === "block") {
+ el.style.display = "none";
+ mark.textContent = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.textContent = "[-]";
+ }
+ }
+
+ function initExpandables() {
+ var elements = document.querySelectorAll(".expandable");
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ var el = elements[i];
+ var clickable = el.querySelector("span");
+ var marker = clickable.querySelector(".marker");
+ var content = el.querySelector(".content");
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.addEventListener("click", toggle);
+ }
+ }
+
+ function toggleDisplay(id) {
+ var elements = document.querySelectorAll("." + id);
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ elements[i].classList.toggle("d-none");
+ }
+ }
+
+ function toggleAll() {
+ var elements = document.querySelectorAll("input");
+
+ // starting from 1 since 0 is the "toggle all" input
+ for (var i = 1, len = elements.length; i < len; i++) {
+ var el = elements[i];
+
+ if (el.checked) {
+ el.checked = false;
+ } else {
+ el.checked = true;
+ }
+
+ toggleDisplay(el.id);
+ }
+ }
+ window.addEventListener("load", initExpandables);
+ </script>
+ </head>
+ <body>
+ <div id="header" class="header">
+ <h1>Cppcheck report - mate-user-share: src/user_share.c</h1>
+ </div>
+ <div class="wrapper">
+ <div id="menu">
+ <p id="filename"><a href="index.html">Defects:</a> user_share.c</p>
+<a href="4.html#line-56"> shadowVariable 56</a><a href="4.html#line-56"> shadowVariable 56</a><a href="4.html#line-56"> shadowVariable 56</a><a href="4.html#line-87"> shadowVariable 87</a><a href="4.html#line-261"> shadowVariable 261</a><a href="4.html#line-392"> shadowVariable 392</a>
+ </div>
+ <div id="content">
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507</pre></div></td><td class="code"><div class="highlight"><pre><span></span><a name="line-1"></a><span class="cm">/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */</span>
+<a name="line-2"></a>
+<a name="line-3"></a><span class="cm">/*</span>
+<a name="line-4"></a><span class="cm"> * Copyright (C) 2004-2008 Red Hat, Inc.</span>
+<a name="line-5"></a><span class="cm"> * Copyright (C) 2012-2021 MATE Developers</span>
+<a name="line-6"></a><span class="cm"> *</span>
+<a name="line-7"></a><span class="cm"> * Caja is free software; you can redistribute it and/or</span>
+<a name="line-8"></a><span class="cm"> * modify it under the terms of the GNU General Public License as</span>
+<a name="line-9"></a><span class="cm"> * published by the Free Software Foundation; either version 2 of the</span>
+<a name="line-10"></a><span class="cm"> * License, or (at your option) any later version.</span>
+<a name="line-11"></a><span class="cm"> *</span>
+<a name="line-12"></a><span class="cm"> * Caja is distributed in the hope that it will be useful,</span>
+<a name="line-13"></a><span class="cm"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
+<a name="line-14"></a><span class="cm"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
+<a name="line-15"></a><span class="cm"> * General Public License for more details.</span>
+<a name="line-16"></a><span class="cm"> *</span>
+<a name="line-17"></a><span class="cm"> * You should have received a copy of the GNU General Public License</span>
+<a name="line-18"></a><span class="cm"> * along with this program; if not, write to the Free Software</span>
+<a name="line-19"></a><span class="cm"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span>
+<a name="line-20"></a><span class="cm"> *</span>
+<a name="line-21"></a><span class="cm"> * Authors: Alexander Larsson &lt;[email protected]&gt;</span>
+<a name="line-22"></a><span class="cm"> *</span>
+<a name="line-23"></a><span class="cm"> */</span>
+<a name="line-24"></a>
+<a name="line-25"></a><span class="cp">#include</span> <span class="cpf">&quot;config.h&quot;</span><span class="cp"></span>
+<a name="line-26"></a>
+<a name="line-27"></a><span class="cp">#include</span> <span class="cpf">&lt;gdk/gdkx.h&gt;</span><span class="cp"></span>
+<a name="line-28"></a><span class="cp">#include</span> <span class="cpf">&lt;gtk/gtk.h&gt;</span><span class="cp"></span>
+<a name="line-29"></a><span class="cp">#include</span> <span class="cpf">&lt;glib/gi18n.h&gt;</span><span class="cp"></span>
+<a name="line-30"></a><span class="cp">#include</span> <span class="cpf">&lt;glib/gstdio.h&gt;</span><span class="cp"></span>
+<a name="line-31"></a><span class="cp">#include</span> <span class="cpf">&lt;gio/gio.h&gt;</span><span class="cp"></span>
+<a name="line-32"></a><span class="cp">#include</span> <span class="cpf">&lt;X11/Xlib.h&gt;</span><span class="cp"></span>
+<a name="line-33"></a>
+<a name="line-34"></a><span class="cp">#include</span> <span class="cpf">&quot;user_share-private.h&quot;</span><span class="cp"></span>
+<a name="line-35"></a><span class="cp">#include</span> <span class="cpf">&quot;user_share-common.h&quot;</span><span class="cp"></span>
+<a name="line-36"></a><span class="cp">#include</span> <span class="cpf">&quot;http.h&quot;</span><span class="cp"></span>
+<a name="line-37"></a>
+<a name="line-38"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-39"></a><span class="cp">#include</span> <span class="cpf">&lt;bluetooth-client.h&gt;</span><span class="cp"></span>
+<a name="line-40"></a>
+<a name="line-41"></a><span class="cp">#include</span> <span class="cpf">&quot;obexftp.h&quot;</span><span class="cp"></span>
+<a name="line-42"></a><span class="cp">#include</span> <span class="cpf">&quot;obexpush.h&quot;</span><span class="cp"></span>
+<a name="line-43"></a>
+<a name="line-44"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-45"></a>
+<a name="line-46"></a><span class="cp">#include</span> <span class="cpf">&lt;gio/gio.h&gt;</span><span class="cp"></span>
+<a name="line-47"></a>
+<a name="line-48"></a><span class="cp">#include</span> <span class="cpf">&lt;stdarg.h&gt;</span><span class="cp"></span>
+<a name="line-49"></a><span class="cp">#include</span> <span class="cpf">&lt;string.h&gt;</span><span class="cp"></span>
+<a name="line-50"></a><span class="cp">#include</span> <span class="cpf">&lt;stdio.h&gt;</span><span class="cp"></span>
+<a name="line-51"></a><span class="cp">#include</span> <span class="cpf">&lt;stdlib.h&gt;</span><span class="cp"></span>
+<a name="line-52"></a><span class="cp">#include</span> <span class="cpf">&lt;signal.h&gt;</span><span class="cp"></span>
+<a name="line-53"></a><span class="cp">#include</span> <span class="cpf">&lt;unistd.h&gt;</span><span class="cp"></span>
+<a name="line-54"></a>
+<a name="line-55"></a><span class="k">static</span> <span class="n">guint</span> <span class="n">disabled_timeout_tag</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-56"></a><span class="hll"><span class="k">static</span> <span class="n">GSettings</span><span class="o">*</span> <span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadowed declaration</span><span class="error2">&lt;--- Shadowed declaration</span><span class="error2">&lt;--- Shadowed declaration</span>
+</span><a name="line-57"></a>
+<a name="line-58"></a><span class="cp">#define GSETTINGS_SCHEMA &quot;org.mate.FileSharing&quot;</span>
+<a name="line-59"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_ENABLED &quot;enabled&quot;</span>
+<a name="line-60"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_REQUIRE_PASSWORD &quot;require-password&quot;</span>
+<a name="line-61"></a>
+<a name="line-62"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-63"></a><span class="cm">/* MATE Session */</span>
+<a name="line-64"></a><span class="cp">#define MATE_SESSION_DBUS_NAME &quot;org.gnome.SessionManager&quot;</span>
+<a name="line-65"></a><span class="cp">#define MATE_SESSION_DBUS_OBJECT &quot;/org/gnome/SessionManager&quot;</span>
+<a name="line-66"></a><span class="cp">#define MATE_SESSION_DBUS_INTERFACE &quot;org.gnome.SessionManager&quot;</span>
+<a name="line-67"></a>
+<a name="line-68"></a><span class="k">static</span> <span class="n">GDBusProxy</span> <span class="o">*</span><span class="n">session_proxy</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-69"></a><span class="k">static</span> <span class="n">gboolean</span> <span class="n">has_console</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-70"></a>
+<a name="line-71"></a><span class="k">static</span> <span class="n">BluetoothClient</span> <span class="o">*</span><span class="n">client</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-72"></a><span class="k">static</span> <span class="n">gboolean</span> <span class="n">bluetoothd_enabled</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-73"></a>
+<a name="line-74"></a><span class="cp">#define OBEX_ENABLED (bluetoothd_enabled &amp;&amp; has_console)</span>
+<a name="line-75"></a>
+<a name="line-76"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ENABLED &quot;bluetooth-enabled&quot;</span>
+<a name="line-77"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ALLOW_WRITE &quot;bluetooth-allow-write&quot;</span>
+<a name="line-78"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_REQUIRE_PAIRING &quot;bluetooth-require-pairing&quot;</span>
+<a name="line-79"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED &quot;bluetooth-obexpush-enabled&quot;</span>
+<a name="line-80"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES &quot;bluetooth-accept-files&quot;</span>
+<a name="line-81"></a><span class="cp">#define GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY &quot;bluetooth-notify&quot;</span>
+<a name="line-82"></a>
+<a name="line-83"></a>
+<a name="line-84"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-85"></a><span class="n">obex_services_start</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-86"></a><span class="p">{</span>
+<a name="line-87"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-88"></a>
+<a name="line-89"></a> <span class="k">if</span> <span class="p">(</span><span class="n">bluetoothd_enabled</span> <span class="o">==</span> <span class="n">FALSE</span> <span class="o">||</span>
+<a name="line-90"></a> <span class="n">has_console</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-91"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-92"></a>
+<a name="line-93"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span><span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">);</span>
+<a name="line-94"></a>
+<a name="line-95"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">TRUE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-96"></a> <span class="n">obexpush_up</span> <span class="p">();</span>
+<a name="line-97"></a> <span class="p">}</span>
+<a name="line-98"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">TRUE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-99"></a> <span class="n">obexftp_up</span> <span class="p">();</span>
+<a name="line-100"></a> <span class="p">}</span>
+<a name="line-101"></a>
+<a name="line-102"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">client</span><span class="p">);</span>
+<a name="line-103"></a><span class="p">}</span>
+<a name="line-104"></a>
+<a name="line-105"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-106"></a><span class="n">obex_services_shutdown</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-107"></a><span class="p">{</span>
+<a name="line-108"></a> <span class="n">obexpush_down</span> <span class="p">();</span>
+<a name="line-109"></a> <span class="n">obexftp_down</span> <span class="p">();</span>
+<a name="line-110"></a><span class="p">}</span>
+<a name="line-111"></a>
+<a name="line-112"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-113"></a><span class="n">session_properties_changed_cb</span> <span class="p">(</span><span class="n">GDBusProxy</span> <span class="o">*</span><span class="n">session</span><span class="p">,</span>
+<a name="line-114"></a> <span class="n">GVariant</span> <span class="o">*</span><span class="n">changed</span><span class="p">,</span>
+<a name="line-115"></a> <span class="kt">char</span> <span class="o">**</span><span class="n">invalidated</span><span class="p">,</span>
+<a name="line-116"></a> <span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span>
+<a name="line-117"></a><span class="p">{</span>
+<a name="line-118"></a> <span class="n">GVariant</span> <span class="o">*</span><span class="n">v</span><span class="p">;</span>
+<a name="line-119"></a>
+<a name="line-120"></a> <span class="n">v</span> <span class="o">=</span> <span class="n">g_variant_lookup_value</span> <span class="p">(</span><span class="n">changed</span><span class="p">,</span> <span class="s">&quot;SessionIsActive&quot;</span><span class="p">,</span> <span class="n">G_VARIANT_TYPE_BOOLEAN</span><span class="p">);</span>
+<a name="line-121"></a> <span class="k">if</span> <span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-122"></a> <span class="n">has_console</span> <span class="o">=</span> <span class="n">g_variant_get_boolean</span> <span class="p">(</span><span class="n">v</span><span class="p">);</span>
+<a name="line-123"></a> <span class="n">g_debug</span> <span class="p">(</span><span class="s">&quot;Received session is active change: now %s&quot;</span><span class="p">,</span> <span class="n">has_console</span> <span class="o">?</span> <span class="s">&quot;active&quot;</span> <span class="o">:</span> <span class="s">&quot;inactive&quot;</span><span class="p">);</span>
+<a name="line-124"></a>
+<a name="line-125"></a> <span class="k">if</span> <span class="p">(</span><span class="n">has_console</span><span class="p">)</span>
+<a name="line-126"></a> <span class="n">obex_services_start</span> <span class="p">();</span>
+<a name="line-127"></a> <span class="k">else</span>
+<a name="line-128"></a> <span class="nf">obex_services_shutdown</span> <span class="p">();</span>
+<a name="line-129"></a>
+<a name="line-130"></a> <span class="n">g_variant_unref</span> <span class="p">(</span><span class="n">v</span><span class="p">);</span>
+<a name="line-131"></a> <span class="p">}</span>
+<a name="line-132"></a><span class="p">}</span>
+<a name="line-133"></a>
+<a name="line-134"></a><span class="k">static</span> <span class="n">gboolean</span>
+<a name="line-135"></a><span class="n">is_session_active</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-136"></a><span class="p">{</span>
+<a name="line-137"></a> <span class="n">GVariant</span> <span class="o">*</span><span class="n">variant</span><span class="p">;</span>
+<a name="line-138"></a> <span class="n">gboolean</span> <span class="n">is_session_active</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-139"></a>
+<a name="line-140"></a> <span class="n">variant</span> <span class="o">=</span> <span class="n">g_dbus_proxy_get_cached_property</span> <span class="p">(</span><span class="n">session_proxy</span><span class="p">,</span>
+<a name="line-141"></a> <span class="s">&quot;SessionIsActive&quot;</span><span class="p">);</span>
+<a name="line-142"></a> <span class="k">if</span> <span class="p">(</span><span class="n">variant</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-143"></a> <span class="n">is_session_active</span> <span class="o">=</span> <span class="n">g_variant_get_boolean</span> <span class="p">(</span><span class="n">variant</span><span class="p">);</span>
+<a name="line-144"></a> <span class="n">g_variant_unref</span> <span class="p">(</span><span class="n">variant</span><span class="p">);</span>
+<a name="line-145"></a> <span class="p">}</span>
+<a name="line-146"></a>
+<a name="line-147"></a> <span class="k">return</span> <span class="n">is_session_active</span><span class="p">;</span>
+<a name="line-148"></a><span class="p">}</span>
+<a name="line-149"></a>
+<a name="line-150"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-151"></a><span class="n">session_init</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-152"></a><span class="p">{</span>
+<a name="line-153"></a> <span class="n">GError</span> <span class="o">*</span><span class="n">error</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-154"></a>
+<a name="line-155"></a> <span class="n">session_proxy</span> <span class="o">=</span> <span class="n">g_dbus_proxy_new_for_bus_sync</span> <span class="p">(</span><span class="n">G_BUS_TYPE_SESSION</span><span class="p">,</span>
+<a name="line-156"></a> <span class="n">G_DBUS_PROXY_FLAGS_NONE</span><span class="p">,</span>
+<a name="line-157"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-158"></a> <span class="n">MATE_SESSION_DBUS_NAME</span><span class="p">,</span>
+<a name="line-159"></a> <span class="n">MATE_SESSION_DBUS_OBJECT</span><span class="p">,</span>
+<a name="line-160"></a> <span class="n">MATE_SESSION_DBUS_INTERFACE</span><span class="p">,</span>
+<a name="line-161"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-162"></a> <span class="o">&amp;</span><span class="n">error</span><span class="p">);</span>
+<a name="line-163"></a> <span class="k">if</span> <span class="p">(</span><span class="n">session_proxy</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-164"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Failed to get session proxy: %s&quot;</span><span class="p">,</span> <span class="n">error</span><span class="o">-&gt;</span><span class="n">message</span><span class="p">);</span>
+<a name="line-165"></a> <span class="n">g_error_free</span> <span class="p">(</span><span class="n">error</span><span class="p">);</span>
+<a name="line-166"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-167"></a> <span class="p">}</span>
+<a name="line-168"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">session_proxy</span><span class="p">,</span> <span class="s">&quot;g-properties-changed&quot;</span><span class="p">,</span>
+<a name="line-169"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">session_properties_changed_cb</span><span class="p">),</span>
+<a name="line-170"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-171"></a> <span class="n">has_console</span> <span class="o">=</span> <span class="n">is_session_active</span> <span class="p">();</span>
+<a name="line-172"></a><span class="p">}</span>
+<a name="line-173"></a>
+<a name="line-174"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-175"></a><span class="n">default_adapter_changed</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">gobject</span><span class="p">,</span>
+<a name="line-176"></a> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">pspec</span><span class="p">,</span>
+<a name="line-177"></a> <span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span>
+<a name="line-178"></a><span class="p">{</span>
+<a name="line-179"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">adapter</span><span class="p">;</span>
+<a name="line-180"></a> <span class="n">gboolean</span> <span class="n">adapter_powered</span><span class="p">;</span>
+<a name="line-181"></a>
+<a name="line-182"></a> <span class="n">g_object_get</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">client</span><span class="p">),</span>
+<a name="line-183"></a> <span class="s">&quot;default-adapter&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">adapter</span><span class="p">,</span>
+<a name="line-184"></a> <span class="s">&quot;default-adapter-powered&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">adapter_powered</span><span class="p">,</span>
+<a name="line-185"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-186"></a> <span class="k">if</span> <span class="p">(</span><span class="n">adapter</span> <span class="o">!=</span> <span class="nb">NULL</span> <span class="o">&amp;&amp;</span> <span class="o">*</span><span class="n">adapter</span> <span class="o">!=</span> <span class="sc">&#39;\0&#39;</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-187"></a> <span class="n">bluetoothd_enabled</span> <span class="o">=</span> <span class="n">adapter_powered</span><span class="p">;</span>
+<a name="line-188"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-189"></a> <span class="n">bluetoothd_enabled</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-190"></a> <span class="p">}</span>
+<a name="line-191"></a>
+<a name="line-192"></a> <span class="cm">/* Were we called as init, or as a callback */</span>
+<a name="line-193"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gobject</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-194"></a> <span class="k">if</span> <span class="p">(</span><span class="n">bluetoothd_enabled</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-195"></a> <span class="n">obex_services_start</span> <span class="p">();</span>
+<a name="line-196"></a> <span class="k">else</span>
+<a name="line-197"></a> <span class="nf">obex_services_shutdown</span> <span class="p">();</span>
+<a name="line-198"></a> <span class="p">}</span>
+<a name="line-199"></a><span class="p">}</span>
+<a name="line-200"></a>
+<a name="line-201"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-202"></a><span class="n">bluez_init</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-203"></a><span class="p">{</span>
+<a name="line-204"></a> <span class="n">client</span> <span class="o">=</span> <span class="n">bluetooth_client_new</span> <span class="p">();</span>
+<a name="line-205"></a> <span class="n">default_adapter_changed</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-206"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">client</span><span class="p">),</span> <span class="s">&quot;notify::default-adapter&quot;</span><span class="p">,</span>
+<a name="line-207"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">default_adapter_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-208"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">client</span><span class="p">),</span> <span class="s">&quot;notify::default-adapter-powered&quot;</span><span class="p">,</span>
+<a name="line-209"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">default_adapter_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-210"></a><span class="p">}</span>
+<a name="line-211"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-212"></a>
+<a name="line-213"></a><span class="k">static</span> <span class="n">gboolean</span>
+<a name="line-214"></a><span class="n">file_sharing_enabled</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-215"></a><span class="p">{</span>
+<a name="line-216"></a> <span class="n">gboolean</span> <span class="n">enabled</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-217"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">);</span>
+<a name="line-218"></a>
+<a name="line-219"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-220"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span> <span class="o">&amp;&amp;</span>
+<a name="line-221"></a> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span> <span class="o">&amp;&amp;</span>
+<a name="line-222"></a> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-223"></a><span class="cp">#else </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-224"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-225"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-226"></a> <span class="n">enabled</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-227"></a>
+<a name="line-228"></a> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">settings</span><span class="p">);</span>
+<a name="line-229"></a>
+<a name="line-230"></a> <span class="k">return</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-231"></a><span class="p">}</span>
+<a name="line-232"></a>
+<a name="line-233"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-234"></a><span class="n">migrate_old_configuration</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-235"></a><span class="p">{</span>
+<a name="line-236"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">old_config_dir</span><span class="p">;</span>
+<a name="line-237"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">new_config_dir</span><span class="p">;</span>
+<a name="line-238"></a>
+<a name="line-239"></a> <span class="n">old_config_dir</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">g_get_home_dir</span> <span class="p">(),</span> <span class="s">&quot;.mate2&quot;</span><span class="p">,</span> <span class="s">&quot;user-share&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-240"></a> <span class="n">new_config_dir</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">g_get_user_config_dir</span> <span class="p">(),</span> <span class="s">&quot;user-share&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-241"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_test</span> <span class="p">(</span><span class="n">old_config_dir</span><span class="p">,</span> <span class="n">G_FILE_TEST_IS_DIR</span><span class="p">))</span>
+<a name="line-242"></a> <span class="n">g_rename</span> <span class="p">(</span><span class="n">old_config_dir</span><span class="p">,</span> <span class="n">new_config_dir</span><span class="p">);</span>
+<a name="line-243"></a>
+<a name="line-244"></a><span class="p">}</span>
+<a name="line-245"></a>
+<a name="line-246"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-247"></a><span class="n">require_password_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-248"></a><span class="p">{</span>
+<a name="line-249"></a> <span class="cm">/* Need to restart to get new password setting */</span>
+<a name="line-250"></a> <span class="k">if</span> <span class="p">(</span><span class="n">http_get_pid</span> <span class="p">()</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-251"></a> <span class="n">http_down</span> <span class="p">();</span>
+<a name="line-252"></a> <span class="n">http_up</span> <span class="p">();</span>
+<a name="line-253"></a> <span class="p">}</span>
+<a name="line-254"></a><span class="p">}</span>
+<a name="line-255"></a>
+<a name="line-256"></a><span class="cm">/* File sharing was disabled for some time, exit now */</span>
+<a name="line-257"></a><span class="cm">/* If we re-enable it in the ui, this will be restarted anyway */</span>
+<a name="line-258"></a><span class="k">static</span> <span class="n">gboolean</span>
+<a name="line-259"></a><span class="n">disabled_timeout_callback</span> <span class="p">(</span><span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span>
+<a name="line-260"></a><span class="p">{</span>
+<a name="line-261"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span> <span class="o">=</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="p">)</span> <span class="n">user_data</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-262"></a> <span class="n">http_down</span> <span class="p">();</span>
+<a name="line-263"></a>
+<a name="line-264"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-265"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span> <span class="o">&amp;&amp;</span>
+<a name="line-266"></a> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-267"></a> <span class="n">_exit</span> <span class="p">(</span><span class="mi">0</span><span class="p">);</span>
+<a name="line-268"></a><span class="cp">#else </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-269"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-270"></a> <span class="n">_exit</span> <span class="p">(</span><span class="mi">0</span><span class="p">);</span>
+<a name="line-271"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-272"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-273"></a><span class="p">}</span>
+<a name="line-274"></a>
+<a name="line-275"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-276"></a><span class="n">file_sharing_enabled_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-277"></a><span class="p">{</span>
+<a name="line-278"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-279"></a>
+<a name="line-280"></a> <span class="k">if</span> <span class="p">(</span><span class="n">disabled_timeout_tag</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-281"></a> <span class="n">g_source_remove</span> <span class="p">(</span><span class="n">disabled_timeout_tag</span><span class="p">);</span>
+<a name="line-282"></a> <span class="n">disabled_timeout_tag</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-283"></a> <span class="p">}</span>
+<a name="line-284"></a>
+<a name="line-285"></a> <span class="n">enabled</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-286"></a> <span class="n">FILE_SHARING_ENABLED</span><span class="p">);</span>
+<a name="line-287"></a> <span class="k">if</span> <span class="p">(</span><span class="n">enabled</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-288"></a> <span class="k">if</span> <span class="p">(</span><span class="n">http_get_pid</span> <span class="p">()</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-289"></a> <span class="n">http_up</span> <span class="p">();</span>
+<a name="line-290"></a> <span class="p">}</span>
+<a name="line-291"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-292"></a> <span class="n">http_down</span> <span class="p">();</span>
+<a name="line-293"></a> <span class="n">disabled_timeout_tag</span> <span class="o">=</span> <span class="n">g_timeout_add_seconds</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span>
+<a name="line-294"></a> <span class="p">(</span><span class="n">GSourceFunc</span><span class="p">)</span><span class="n">disabled_timeout_callback</span><span class="p">,</span>
+<a name="line-295"></a> <span class="n">settings</span><span class="p">);</span>
+<a name="line-296"></a> <span class="p">}</span>
+<a name="line-297"></a><span class="p">}</span>
+<a name="line-298"></a>
+<a name="line-299"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-300"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-301"></a><span class="n">file_sharing_bluetooth_allow_write_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-302"></a><span class="p">{</span>
+<a name="line-303"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_ENABLED</span><span class="p">)</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-304"></a> <span class="n">obexftp_restart</span> <span class="p">();</span>
+<a name="line-305"></a><span class="p">}</span>
+<a name="line-306"></a>
+<a name="line-307"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-308"></a><span class="n">file_sharing_bluetooth_require_pairing_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-309"></a><span class="p">{</span>
+<a name="line-310"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_ENABLED</span><span class="p">)</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-311"></a> <span class="cm">/* We need to fully reset the session,</span>
+<a name="line-312"></a><span class="cm"> * otherwise the new setting isn&#39;t taken into account */</span>
+<a name="line-313"></a> <span class="n">obexftp_down</span> <span class="p">();</span>
+<a name="line-314"></a> <span class="n">obexftp_up</span> <span class="p">();</span>
+<a name="line-315"></a> <span class="p">}</span>
+<a name="line-316"></a><span class="p">}</span>
+<a name="line-317"></a>
+<a name="line-318"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-319"></a><span class="n">file_sharing_bluetooth_enabled_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-320"></a><span class="p">{</span>
+<a name="line-321"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-322"></a> <span class="n">FILE_SHARING_BLUETOOTH_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-323"></a> <span class="n">obexftp_down</span> <span class="p">();</span>
+<a name="line-324"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span> <span class="o">&amp;&amp;</span>
+<a name="line-325"></a> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-326"></a> <span class="n">_exit</span> <span class="p">(</span><span class="mi">0</span><span class="p">);</span>
+<a name="line-327"></a> <span class="p">}</span>
+<a name="line-328"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">OBEX_ENABLED</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-329"></a> <span class="n">obexftp_up</span> <span class="p">();</span>
+<a name="line-330"></a> <span class="p">}</span>
+<a name="line-331"></a><span class="p">}</span>
+<a name="line-332"></a>
+<a name="line-333"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-334"></a><span class="n">file_sharing_bluetooth_obexpush_enabled_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-335"></a><span class="p">{</span>
+<a name="line-336"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-337"></a> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-338"></a> <span class="n">obexpush_down</span> <span class="p">();</span>
+<a name="line-339"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span> <span class="o">&amp;&amp;</span>
+<a name="line-340"></a> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_ENABLED</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-341"></a> <span class="n">_exit</span> <span class="p">(</span><span class="mi">0</span><span class="p">);</span>
+<a name="line-342"></a> <span class="p">}</span>
+<a name="line-343"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">OBEX_ENABLED</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-344"></a> <span class="n">obexpush_up</span> <span class="p">();</span>
+<a name="line-345"></a> <span class="p">}</span>
+<a name="line-346"></a><span class="p">}</span>
+<a name="line-347"></a>
+<a name="line-348"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-349"></a><span class="n">file_sharing_bluetooth_obexpush_accept_files_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-350"></a><span class="p">{</span>
+<a name="line-351"></a> <span class="n">AcceptSetting</span> <span class="n">setting</span><span class="p">;</span>
+<a name="line-352"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">str</span><span class="p">;</span>
+<a name="line-353"></a>
+<a name="line-354"></a> <span class="n">str</span> <span class="o">=</span> <span class="n">g_settings_get_string</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES</span><span class="p">);</span>
+<a name="line-355"></a> <span class="n">setting</span> <span class="o">=</span> <span class="n">accept_setting_from_string</span> <span class="p">(</span><span class="n">str</span><span class="p">);</span>
+<a name="line-356"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">str</span><span class="p">);</span>
+<a name="line-357"></a>
+<a name="line-358"></a> <span class="n">obexpush_set_accept_files_policy</span> <span class="p">(</span><span class="n">setting</span><span class="p">);</span>
+<a name="line-359"></a><span class="p">}</span>
+<a name="line-360"></a>
+<a name="line-361"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-362"></a><span class="n">file_sharing_bluetooth_obexpush_notify_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
+<a name="line-363"></a><span class="p">{</span>
+<a name="line-364"></a> <span class="n">obexpush_set_notify</span> <span class="p">(</span><span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="n">FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY</span><span class="p">));</span>
+<a name="line-365"></a><span class="p">}</span>
+<a name="line-366"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-367"></a>
+<a name="line-368"></a><span class="k">static</span> <span class="n">RETSIGTYPE</span>
+<a name="line-369"></a><span class="n">cleanup_handler</span> <span class="p">(</span><span class="kt">int</span> <span class="n">sig</span><span class="p">)</span>
+<a name="line-370"></a><span class="p">{</span>
+<a name="line-371"></a> <span class="n">http_down</span> <span class="p">();</span>
+<a name="line-372"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-373"></a> <span class="n">obexftp_down</span> <span class="p">();</span>
+<a name="line-374"></a> <span class="n">obexpush_down</span> <span class="p">();</span>
+<a name="line-375"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-376"></a> <span class="n">_exit</span> <span class="p">(</span><span class="mi">2</span><span class="p">);</span>
+<a name="line-377"></a><span class="p">}</span>
+<a name="line-378"></a>
+<a name="line-379"></a><span class="k">static</span> <span class="kt">int</span>
+<a name="line-380"></a><span class="n">x_io_error_handler</span> <span class="p">(</span><span class="n">Display</span> <span class="o">*</span><span class="n">xdisplay</span><span class="p">)</span>
+<a name="line-381"></a><span class="p">{</span>
+<a name="line-382"></a> <span class="n">http_down</span> <span class="p">();</span>
+<a name="line-383"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-384"></a> <span class="n">obexftp_down</span> <span class="p">();</span>
+<a name="line-385"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-386"></a> <span class="n">_exit</span> <span class="p">(</span><span class="mi">2</span><span class="p">);</span>
+<a name="line-387"></a><span class="p">}</span>
+<a name="line-388"></a>
+<a name="line-389"></a><span class="kt">int</span>
+<a name="line-390"></a><span class="n">main</span> <span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<a name="line-391"></a><span class="p">{</span>
+<a name="line-392"></a><span class="hll"> <span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">;</span><span class="error2">&lt;--- Shadow variable</span>
+</span><a name="line-393"></a> <span class="n">Display</span> <span class="o">*</span><span class="n">xdisplay</span><span class="p">;</span>
+<a name="line-394"></a> <span class="n">G_GNUC_UNUSED</span> <span class="kt">int</span> <span class="n">x_fd</span><span class="p">;</span>
+<a name="line-395"></a> <span class="n">Window</span> <span class="n">selection_owner</span><span class="p">;</span>
+<a name="line-396"></a> <span class="n">Atom</span> <span class="n">xatom</span><span class="p">;</span>
+<a name="line-397"></a>
+<a name="line-398"></a> <span class="n">bindtextdomain</span> <span class="p">(</span><span class="n">GETTEXT_PACKAGE</span><span class="p">,</span> <span class="n">MATELOCALEDIR</span><span class="p">);</span>
+<a name="line-399"></a> <span class="n">bind_textdomain_codeset</span> <span class="p">(</span><span class="n">GETTEXT_PACKAGE</span><span class="p">,</span> <span class="s">&quot;UTF-8&quot;</span><span class="p">);</span>
+<a name="line-400"></a> <span class="n">textdomain</span> <span class="p">(</span><span class="n">GETTEXT_PACKAGE</span><span class="p">);</span>
+<a name="line-401"></a>
+<a name="line-402"></a> <span class="n">gtk_init</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">argc</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">argv</span><span class="p">);</span>
+<a name="line-403"></a>
+<a name="line-404"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_strcmp0</span> <span class="p">(</span><span class="n">g_get_real_name</span> <span class="p">(),</span> <span class="s">&quot;root&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-405"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;mate-user-share cannot be started as root for security reasons.&quot;</span><span class="p">);</span>
+<a name="line-406"></a> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-407"></a> <span class="p">}</span>
+<a name="line-408"></a>
+<a name="line-409"></a> <span class="n">signal</span> <span class="p">(</span><span class="n">SIGPIPE</span><span class="p">,</span> <span class="n">SIG_IGN</span><span class="p">);</span>
+<a name="line-410"></a> <span class="n">signal</span> <span class="p">(</span><span class="n">SIGINT</span><span class="p">,</span> <span class="n">cleanup_handler</span><span class="p">);</span>
+<a name="line-411"></a> <span class="n">signal</span> <span class="p">(</span><span class="n">SIGHUP</span><span class="p">,</span> <span class="n">cleanup_handler</span><span class="p">);</span>
+<a name="line-412"></a> <span class="n">signal</span> <span class="p">(</span><span class="n">SIGTERM</span><span class="p">,</span> <span class="n">cleanup_handler</span><span class="p">);</span>
+<a name="line-413"></a>
+<a name="line-414"></a> <span class="n">xdisplay</span> <span class="o">=</span> <span class="n">GDK_DISPLAY_XDISPLAY</span> <span class="p">(</span><span class="n">gdk_display_get_default</span> <span class="p">());</span>
+<a name="line-415"></a> <span class="k">if</span> <span class="p">(</span><span class="n">xdisplay</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-416"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Can&#39;t open display&quot;</span><span class="p">);</span>
+<a name="line-417"></a> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-418"></a> <span class="p">}</span>
+<a name="line-419"></a>
+<a name="line-420"></a> <span class="n">xatom</span> <span class="o">=</span> <span class="n">XInternAtom</span> <span class="p">(</span><span class="n">xdisplay</span><span class="p">,</span> <span class="s">&quot;_MATE_USER_SHARE&quot;</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-421"></a> <span class="n">selection_owner</span> <span class="o">=</span> <span class="n">XGetSelectionOwner</span> <span class="p">(</span><span class="n">xdisplay</span><span class="p">,</span> <span class="n">xatom</span><span class="p">);</span>
+<a name="line-422"></a>
+<a name="line-423"></a> <span class="k">if</span> <span class="p">(</span><span class="n">selection_owner</span> <span class="o">!=</span> <span class="n">None</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-424"></a> <span class="cm">/* There is an owner already, quit */</span>
+<a name="line-425"></a> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-426"></a> <span class="p">}</span>
+<a name="line-427"></a>
+<a name="line-428"></a> <span class="n">selection_owner</span> <span class="o">=</span> <span class="n">XCreateSimpleWindow</span> <span class="p">(</span><span class="n">xdisplay</span><span class="p">,</span>
+<a name="line-429"></a> <span class="n">RootWindow</span> <span class="p">(</span><span class="n">xdisplay</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span>
+<a name="line-430"></a> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span>
+<a name="line-431"></a> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-432"></a> <span class="n">XSetSelectionOwner</span> <span class="p">(</span><span class="n">xdisplay</span><span class="p">,</span> <span class="n">xatom</span><span class="p">,</span> <span class="n">selection_owner</span><span class="p">,</span> <span class="n">CurrentTime</span><span class="p">);</span>
+<a name="line-433"></a>
+<a name="line-434"></a> <span class="k">if</span> <span class="p">(</span><span class="n">XGetSelectionOwner</span> <span class="p">(</span><span class="n">xdisplay</span><span class="p">,</span> <span class="n">xatom</span><span class="p">)</span> <span class="o">!=</span> <span class="n">selection_owner</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-435"></a> <span class="cm">/* Didn&#39;t get the selection */</span>
+<a name="line-436"></a> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-437"></a> <span class="p">}</span>
+<a name="line-438"></a>
+<a name="line-439"></a> <span class="n">migrate_old_configuration</span> <span class="p">();</span>
+<a name="line-440"></a>
+<a name="line-441"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">file_sharing_enabled</span> <span class="p">())</span>
+<a name="line-442"></a> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-443"></a>
+<a name="line-444"></a> <span class="n">settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">GSETTINGS_SCHEMA</span><span class="p">);</span>
+<a name="line-445"></a>
+<a name="line-446"></a> <span class="n">x_fd</span> <span class="o">=</span> <span class="n">ConnectionNumber</span> <span class="p">(</span><span class="n">xdisplay</span><span class="p">);</span>
+<a name="line-447"></a> <span class="n">XSetIOErrorHandler</span> <span class="p">(</span><span class="n">x_io_error_handler</span><span class="p">);</span>
+<a name="line-448"></a>
+<a name="line-449"></a> <span class="k">if</span> <span class="p">(</span><span class="n">http_init</span> <span class="p">()</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-450"></a> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-451"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-452"></a> <span class="k">if</span> <span class="p">(</span><span class="n">obexftp_init</span> <span class="p">()</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-453"></a> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-454"></a> <span class="k">if</span> <span class="p">(</span><span class="n">obexpush_init</span> <span class="p">()</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-455"></a> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-456"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-457"></a>
+<a name="line-458"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-459"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_ENABLED</span><span class="p">,</span>
+<a name="line-460"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_enabled_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-461"></a>
+<a name="line-462"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-463"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_REQUIRE_PASSWORD</span><span class="p">,</span>
+<a name="line-464"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">require_password_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-465"></a>
+<a name="line-466"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-467"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-468"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ENABLED</span><span class="p">,</span>
+<a name="line-469"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_enabled_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-470"></a>
+<a name="line-471"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-472"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_ALLOW_WRITE</span><span class="p">,</span>
+<a name="line-473"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_allow_write_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-474"></a>
+<a name="line-475"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-476"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_REQUIRE_PAIRING</span><span class="p">,</span>
+<a name="line-477"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_require_pairing_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-478"></a>
+<a name="line-479"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-480"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED</span><span class="p">,</span>
+<a name="line-481"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_obexpush_enabled_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-482"></a>
+<a name="line-483"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-484"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_ACCEPT_FILES</span><span class="p">,</span>
+<a name="line-485"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_obexpush_accept_files_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-486"></a>
+<a name="line-487"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-488"></a> <span class="s">&quot;changed::&quot;</span> <span class="n">GSETTINGS_KEY_FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY</span><span class="p">,</span>
+<a name="line-489"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">file_sharing_bluetooth_obexpush_notify_changed</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-490"></a>
+<a name="line-491"></a> <span class="n">bluez_init</span> <span class="p">();</span>
+<a name="line-492"></a> <span class="n">session_init</span> <span class="p">();</span>
+<a name="line-493"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-494"></a>
+<a name="line-495"></a> <span class="cm">/* Initial setting */</span>
+<a name="line-496"></a> <span class="n">file_sharing_enabled_changed</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-497"></a><span class="cp">#ifdef HAVE_BLUETOOTH</span>
+<a name="line-498"></a> <span class="n">file_sharing_bluetooth_enabled_changed</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-499"></a> <span class="n">file_sharing_bluetooth_obexpush_accept_files_changed</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-500"></a> <span class="n">file_sharing_bluetooth_obexpush_notify_changed</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-501"></a> <span class="n">file_sharing_bluetooth_obexpush_enabled_changed</span> <span class="p">(</span><span class="n">settings</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-502"></a><span class="cp">#endif </span><span class="cm">/* HAVE_BLUETOOTH */</span><span class="cp"></span>
+<a name="line-503"></a>
+<a name="line-504"></a> <span class="n">gtk_main</span> <span class="p">();</span>
+<a name="line-505"></a>
+<a name="line-506"></a> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-507"></a><span class="p">}</span>
+</pre></div>
+</td></tr></table>
+ </div> <!-- /.wrapper -->
+ </div>
+ <div id="footer" class="footer">
+ <p>
+ Cppcheck 2.3 - a tool for static C/C++ code analysis<br>
+ <br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a><br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a><br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/index.html b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/index.html
new file mode 100644
index 0000000..58c64de
--- /dev/null
+++ b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/index.html
@@ -0,0 +1,141 @@
+
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-user-share</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+
+ </style>
+ <script>
+ function getStyle(el, styleProp) {
+ var y;
+
+ if (el.currentStyle) {
+ y = el.currentStyle[styleProp];
+ } else if (window.getComputedStyle) {
+ y = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
+ }
+
+ return y;
+ }
+
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+
+ if (el.style.display === "block") {
+ el.style.display = "none";
+ mark.textContent = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.textContent = "[-]";
+ }
+ }
+
+ function initExpandables() {
+ var elements = document.querySelectorAll(".expandable");
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ var el = elements[i];
+ var clickable = el.querySelector("span");
+ var marker = clickable.querySelector(".marker");
+ var content = el.querySelector(".content");
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.addEventListener("click", toggle);
+ }
+ }
+
+ function toggleDisplay(id) {
+ var elements = document.querySelectorAll("." + id);
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ elements[i].classList.toggle("d-none");
+ }
+ }
+
+ function toggleAll() {
+ var elements = document.querySelectorAll("input");
+
+ // starting from 1 since 0 is the "toggle all" input
+ for (var i = 1, len = elements.length; i < len; i++) {
+ var el = elements[i];
+
+ if (el.checked) {
+ el.checked = false;
+ } else {
+ el.checked = true;
+ }
+
+ toggleDisplay(el.id);
+ }
+ }
+ window.addEventListener("load", initExpandables);
+ </script>
+ </head>
+ <body>
+ <div id="header" class="header">
+ <h1>Cppcheck report - mate-user-share: </h1>
+ </div>
+ <div class="wrapper">
+ <div id="menu_index">
+ <p id="filename"><a href="index.html">Defect summary;</a> </p>
+
+ <label><input type="checkbox" onclick="toggleAll()" checked> Toggle all</label>
+ <table>
+ <tr><th>Show</th><th>#</th><th>Defect ID</th></tr>
+ <tr><td><input type="checkbox" onclick="toggleDisplay(this.id)" id="shadowVariable" name="shadowVariable" checked></td><td>14</td><td>shadowVariable</td></tr>
+ <tr><td><input type="checkbox" onclick="toggleDisplay(this.id)" id="variableScope" name="variableScope" checked></td><td>4</td><td>variableScope</td></tr>
+ <tr><td><input type="checkbox" onclick="toggleDisplay(this.id)" id="missingInclude" name="missingInclude" checked></td><td>1</td><td>missingInclude</td></tr>
+ <tr><td><input type="checkbox" onclick="toggleDisplay(this.id)" id="unusedVariable" name="unusedVariable" checked></td><td>1</td><td>unusedVariable</td></tr>
+ <tr><td></td><td>20</td><td>total</td></tr>
+ </table>
+ <p><a href="stats.html">Statistics</a></p>
+ </div>
+ <div id="content_index">
+
+ <table>
+ <tr><th>Line</th><th>Id</th><th>CWE</th><th>Severity</th><th>Message</th></tr>
+ <tr><td colspan="5"><a href="5.html"></a></td></tr>
+ <tr class="missingInclude"><td></td><td>missingInclude</td><td></td><td>information</td><td>Cppcheck cannot find all the include files (use --check-config for details)</td></tr>
+ <tr><td colspan="5"><a href="0.html">src/file-share-properties.c</a></td></tr>
+ <tr class="variableScope"><td><a href="0.html#line-83">83</a></td><td>variableScope</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >The scope of the variable &apos;password&apos; can be reduced.</td></tr>
+ <tr class="shadowVariable"><td><a href="0.html#line-98">98</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="unusedVariable"><td><a href="0.html#line-106">106</a></td><td>unusedVariable</td><td><a href="https://cwe.mitre.org/data/definitions/563.html">563</a></td><td>style</td><td >Unused variable: accept_setting</td></tr>
+ <tr class="shadowVariable"><td><a href="0.html#line-250">250</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="shadowVariable"><td><a href="0.html#line-274">274</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="shadowVariable"><td><a href="0.html#line-295">295</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="shadowVariable"><td><a href="0.html#line-324">324</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="shadowVariable"><td><a href="0.html#line-341">341</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="shadowVariable"><td><a href="0.html#line-358">358</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="shadowVariable"><td><a href="0.html#line-378">378</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="shadowVariable"><td><a href="0.html#line-394">394</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="shadowVariable"><td><a href="0.html#line-458">458</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="variableScope"><td><a href="0.html#line-621">621</a></td><td>variableScope</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >The scope of the variable &apos;window&apos; can be reduced.</td></tr>
+ <tr><td colspan="5"><a href="1.html">src/http.c</a></td></tr>
+ <tr class="variableScope"><td><a href="1.html#line-115">115</a></td><td>variableScope</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >The scope of the variable &apos;host_name&apos; can be reduced.</td></tr>
+ <tr><td colspan="5"><a href="2.html">src/obexpush.c</a></td></tr>
+ <tr class="shadowVariable"><td><a href="2.html#line-188">188</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;connection&apos; shadows outer variable</td></tr>
+ <tr><td colspan="5"><a href="3.html">src/share-extension.c</a></td></tr>
+ <tr class="variableScope"><td><a href="3.html#line-62">62</a></td><td>variableScope</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >The scope of the variable &apos;dialog&apos; can be reduced.</td></tr>
+ <tr><td colspan="5"><a href="4.html">src/user_share.c</a></td></tr>
+ <tr class="shadowVariable"><td><a href="4.html#line-87">87</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="shadowVariable"><td><a href="4.html#line-261">261</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ <tr class="shadowVariable"><td><a href="4.html#line-392">392</a></td><td>shadowVariable</td><td><a href="https://cwe.mitre.org/data/definitions/398.html">398</a></td><td>style</td><td >Local variable &apos;settings&apos; shadows outer variable</td></tr>
+ </table>
+ </div> <!-- /.wrapper -->
+ </div>
+ <div id="footer" class="footer">
+ <p>
+ Cppcheck 2.3 - a tool for static C/C++ code analysis<br>
+ <br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a><br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a><br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/stats.html b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/stats.html
new file mode 100644
index 0000000..2020977
--- /dev/null
+++ b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/stats.html
@@ -0,0 +1,109 @@
+
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-user-share</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+
+ </style>
+ <script>
+ function getStyle(el, styleProp) {
+ var y;
+
+ if (el.currentStyle) {
+ y = el.currentStyle[styleProp];
+ } else if (window.getComputedStyle) {
+ y = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
+ }
+
+ return y;
+ }
+
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+
+ if (el.style.display === "block") {
+ el.style.display = "none";
+ mark.textContent = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.textContent = "[-]";
+ }
+ }
+
+ function initExpandables() {
+ var elements = document.querySelectorAll(".expandable");
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ var el = elements[i];
+ var clickable = el.querySelector("span");
+ var marker = clickable.querySelector(".marker");
+ var content = el.querySelector(".content");
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.addEventListener("click", toggle);
+ }
+ }
+
+ function toggleDisplay(id) {
+ var elements = document.querySelectorAll("." + id);
+
+ for (var i = 0, len = elements.length; i < len; i++) {
+ elements[i].classList.toggle("d-none");
+ }
+ }
+
+ function toggleAll() {
+ var elements = document.querySelectorAll("input");
+
+ // starting from 1 since 0 is the "toggle all" input
+ for (var i = 1, len = elements.length; i < len; i++) {
+ var el = elements[i];
+
+ if (el.checked) {
+ el.checked = false;
+ } else {
+ el.checked = true;
+ }
+
+ toggleDisplay(el.id);
+ }
+ }
+ window.addEventListener("load", initExpandables);
+ </script>
+ </head>
+ <body>
+ <div id="header" class="header">
+ <h1>Cppcheck report - mate-user-share: Statistics</h1>
+ </div>
+ <div class="wrapper">
+ <div id="menu_index">
+ <p id="filename"><a href="index.html">Back to summary</a> </p>
+
+ </div>
+ <div id="content_index">
+<p>Top 10 files for style severity, total findings: 19<br>
+&#160;&#160;&#160;13&#160;<a href="0.html"> src/file-share-properties.c</a><br>
+&#160;&#160;&#160;3&#160;&#160;<a href="4.html"> src/user_share.c</a><br>
+&#160;&#160;&#160;1&#160;&#160;<a href="3.html"> src/share-extension.c</a><br>
+&#160;&#160;&#160;1&#160;&#160;<a href="2.html"> src/obexpush.c</a><br>
+&#160;&#160;&#160;1&#160;&#160;<a href="1.html"> src/http.c</a><br>
+</p>
+
+ </div> <!-- /.wrapper -->
+ </div>
+ <div id="footer" class="footer">
+ <p>
+ Cppcheck 2.3 - a tool for static C/C++ code analysis<br>
+ <br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a><br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a><br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/style.css b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/style.css
new file mode 100644
index 0000000..07125f4
--- /dev/null
+++ b/2021-06-25-153248-0614-cppcheck@198f334ccf4c_master/style.css
@@ -0,0 +1,137 @@
+
+body {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
+ font-size: 13px;
+ line-height: 1.5;
+ margin: 0;
+ width: auto;
+}
+
+h1 {
+ margin: 10px;
+}
+
+.header {
+ border-bottom: thin solid #aaa;
+}
+
+.footer {
+ border-top: thin solid #aaa;
+ font-size: 90%;
+ margin-top: 5px;
+}
+
+.footer ul {
+ list-style-type: none;
+ padding-left: 0;
+}
+
+.footer > p {
+ margin: 4px;
+}
+
+.wrapper {
+ display: -webkit-box;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-pack: justify;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+}
+
+#menu,
+#menu_index {
+ text-align: left;
+ width: 350px;
+ height: 90vh;
+ min-height: 200px;
+ overflow: auto;
+ position: -webkit-sticky;
+ position: sticky;
+ top: 0;
+ padding: 0 15px 15px 15px;
+}
+
+#menu > a {
+ display: block;
+ margin-left: 10px;
+ font-size: 12px;
+ z-index: 1;
+}
+
+#content,
+#content_index {
+ background-color: #fff;
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ padding: 0 15px 15px 15px;
+ width: calc(100% - 350px);
+ height: 100%;
+ overflow-x: auto;
+}
+
+#filename {
+ margin-left: 10px;
+ font-size: 12px;
+ z-index: 1;
+}
+
+.error {
+ background-color: #ffb7b7;
+}
+
+.error2 {
+ background-color: #faa;
+ display: inline-block;
+ margin-left: 4px;
+}
+
+.inconclusive {
+ background-color: #b6b6b4;
+}
+
+.inconclusive2 {
+ background-color: #b6b6b4;
+ display: inline-block;
+ margin-left: 4px;
+}
+
+.verbose {
+ display: inline-block;
+ vertical-align: top;
+ cursor: help;
+}
+
+.verbose .content {
+ display: none;
+ position: absolute;
+ padding: 10px;
+ margin: 4px;
+ max-width: 40%;
+ white-space: pre-wrap;
+ border: 1px solid #000;
+ background-color: #ffffcc;
+ cursor: auto;
+}
+
+.highlight .hll {
+ padding: 1px;
+}
+
+.highlighttable {
+ background-color: #fff;
+ z-index: 10;
+ position: relative;
+ margin: -10px;
+}
+
+.linenos {
+ border-right: thin solid #aaa;
+ color: #d3d3d3;
+ padding-right: 6px;
+}
+
+.d-none {
+ display: none;
+}