DEV Community

Ali Orhun Akkirman for Açıklab

Posted on

2 2

Örnek GSettings Şeması oluşturma

GSettings şemaları, Gnome masaüstü ortamı ile kullanılan ve dconf düzenleyici ile de düzenlenebilen, Microsoft Windows sistemlerde yer alan Registry'ye benzeyen yapıya verilen ad.

GSettings Şeması oluşturma

Örnek bir GSettings şeması için örneğin apps.gsettings-ornekuygulama.gschema.xml isminde bir dosya oluşturmanız gerekmektedir.

<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
  <schema id="apps.gsettings-ornekuygulama" path="/apps/gsettings-ornekuygulama/">
    <key type="b" name="ornekozellik">
      <default>false</default>
      <summary>Mantıksal bir özellik</summary>
      <description>Mantıksal bir ayar içeren özellik.</description>
    </key>
  </schema>
</schemalist>
Enter fullscreen mode Exit fullscreen mode

Daha sonra bu dosyayı yönetici olarak /usr/share/glib-2.0/schemas/ klasörüne koyup, şemaları tekrar compile etmeniz gerekmektedir.

cp apps.gsettings-ornekuygulama.gschema.xml /usr/share/glib-2.0/schemas/
glib-compile-schemas /usr/share/glib-2.0/schemas/
Enter fullscreen mode Exit fullscreen mode

Bu işlemi yaptığınızda "dconf-editor" uygulaması ile baktığınızda apps>gsettings-ornekuygulama ağaç hiyerarşisi altında ornekozellik isminde bir değer gözükmesi gerekmektedir.

Alt Text

Dosya içerisinde belki de en önemli kısım anahtar tipleri olarak düşünülebilir. Key type="b" olarak belirtilmiş kısım boolean tipi yani mantıksal true-false olarak belirtilmektedir. Örnek bazı alternatfi anahtar tiplerini aşağıda bulabilirsiniz.

b : boolean : true-false
s : string : düzmetin
i : integer : sayı
d : decimal : ondalık sayı
as : array string : örneğin ['bir','iki','uc']
(ii) : : çoklu sayı. Varsayılan değer olarak (12,14) gibi bir değer alabilir.
Enter fullscreen mode Exit fullscreen mode

Qui nescit dissimulare, nescit regnare

Image of Datadog

Master Mobile Monitoring for iOS Apps

Monitor your app’s health with real-time insights into crash-free rates, start times, and more. Optimize performance and prevent user churn by addressing critical issues like app hangs, and ANRs. Learn how to keep your iOS app running smoothly across all devices by downloading this eBook.

Get The eBook

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay