[gnome-weather/wip/christopherdavis/unify-app-id: 6/7] weather: Unify App ID



commit 9f7f5a68d47c5aaa0d18453f51c92a629c88ed78
Author: Christopher Davis <brainblasted disroot org>
Date:   Sun Jan 27 10:23:51 2019 -0500

    weather: Unify App ID
    
    The app ID was a mix of `org.gnome.Weather` and `org.gnome.Weather.Application` used differently in 
different
    spots.
    
    This simplifies it to only using `org.gnome.Weather`

 data/meson.build                                     | 20 ++++++++++----------
 data/org.gnome.Weather.Application.service.in        |  3 ---
 data/org.gnome.Weather.appdata.xml.in                |  5 ++++-
 ...urce.xml => org.gnome.Weather.data.gresource.xml} |  2 +-
 ...desktop.in.in => org.gnome.Weather.desktop.in.in} |  2 +-
 ...ion.gschema.xml => org.gnome.Weather.gschema.xml} |  2 +-
 ...der.ini => org.gnome.Weather.search-provider.ini} |  2 +-
 data/org.gnome.Weather.service.in                    |  3 +++
 po/POTFILES.in                                       |  4 ++--
 src/app/city.js                                      |  4 ++--
 src/app/currentLocationController.js                 |  2 +-
 src/app/main.js                                      |  2 +-
 src/app/window.js                                    |  4 ++--
 src/app/world.js                                     |  2 +-
 src/meson.build                                      |  8 ++++----
 ...e.Weather.Application.in => org.gnome.Weather.in} |  0
 ...ource.xml => org.gnome.Weather.src.gresource.xml} |  2 +-
 src/service/searchProvider.js                        |  4 ++--
 src/shared/world.js                                  |  2 +-
 tests/testutil.py                                    |  4 ++--
 20 files changed, 40 insertions(+), 37 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 4a7f2c2..27abed5 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -8,8 +8,8 @@ data_conf.set('DATA_DIR', DATA_DIR)
 message('Compiling resources')
 
 gnome.compile_resources(
-       application_id_stable + '.Application.data',
-       application_id_stable + '.Application.data.gresource.xml',
+       application_id_stable + '.data',
+       application_id_stable + '.data.gresource.xml',
        gresource_bundle: true,
        source_dir: '.',
        install_dir: DATA_DIR,
@@ -27,7 +27,7 @@ gnome.compile_resources(
 
 # Installing the schema file
 install_data(
-       application_id_stable + '.Application.gschema.xml',
+       application_id_stable + '.gschema.xml',
        install_dir: 'share/glib-2.0/schemas'
 )
 
@@ -38,11 +38,11 @@ desktop_conf.set('APP_ID', application_id)
 desktop = custom_target(
   'desktop-file',
   input: configure_file(
-    input: '@0  Application desktop in in'.format(application_id_stable),
-    output: '@0  Application desktop in'.format(application_id_stable),
+    input: '@0  desktop in in'.format(application_id_stable),
+    output: '@0  desktop in'.format(application_id_stable),
     configuration: desktop_conf,
   ),
-  output: '@0@.Application.desktop'.format(application_id),
+  output: '@0@.desktop'.format(application_id),
   install: true,
   install_dir: join_paths(get_option('datadir'), 'applications'),
   command: [msgfmt, '--desktop',
@@ -58,7 +58,7 @@ if desktop_file_validate.found()
        test (
                'Validate desktop file',
                desktop_file_validate,
-               args: join_paths(meson.current_build_dir(), application_id + '.Application.desktop')
+               args: join_paths(meson.current_build_dir(), application_id + '.desktop')
        )
 endif
 
@@ -75,8 +75,8 @@ appdata = i18n.merge_file(
 
 
 configure_file(
-       input: application_id_stable + '.Application.service.in',
-       output: application_id + '.Application.service',
+       input: application_id_stable + '.service.in',
+       output: application_id + '.service',
        configuration: data_conf,
        install: true,
        install_dir: join_paths(get_option('datadir'), 'dbus-1', 'services')
@@ -92,7 +92,7 @@ configure_file(
 
 # Search Provider
 install_data(
-       application_id_stable + '.Application.search-provider.ini',
+       application_id_stable + '.search-provider.ini',
        install_dir: 'share/gnome-shell/search-providers'
 )
 
diff --git a/data/org.gnome.Weather.appdata.xml.in b/data/org.gnome.Weather.appdata.xml.in
index 61191c3..6b03555 100644
--- a/data/org.gnome.Weather.appdata.xml.in
+++ b/data/org.gnome.Weather.appdata.xml.in
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Copyright 2014 Giovanni Campagna -->
 <component type="desktop">
-  <id>org.gnome.Weather.Application.desktop</id>
+  <id>org.gnome.Weather</id>
   <name>Weather</name>
   <summary>Show weather conditions and forecast</summary>
   <metadata_license>CC0-1.0</metadata_license>
@@ -41,4 +41,7 @@
   <url type="bugtracker">https://gitlab.gnome.org/GNOME/gnome-weather/issues</url>
   <updatecontact>gcampagna_at_src.gnome.org</updatecontact>
   <translation type="gettext">org.gnome.Weather</translation>
+  <provides>
+    <id>org.gnome.Weather.Application.desktop</id>
+  </provides>
 </component>
diff --git a/data/org.gnome.Weather.Application.data.gresource.xml b/data/org.gnome.Weather.data.gresource.xml
similarity index 93%
rename from data/org.gnome.Weather.Application.data.gresource.xml
rename to data/org.gnome.Weather.data.gresource.xml
index e634d6f..6a04a87 100644
--- a/data/org.gnome.Weather.Application.data.gresource.xml
+++ b/data/org.gnome.Weather.data.gresource.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
-  <gresource prefix="/org/gnome/Weather/Application">
+  <gresource prefix="/org/gnome/Weather">
     <file preprocess="xml-stripblanks">city.ui</file>
     <file preprocess="xml-stripblanks">places-popover.ui</file>
     <file preprocess="xml-stripblanks">primary-menu.ui</file>
diff --git a/data/org.gnome.Weather.Application.desktop.in.in b/data/org.gnome.Weather.desktop.in.in
similarity index 91%
rename from data/org.gnome.Weather.Application.desktop.in.in
rename to data/org.gnome.Weather.desktop.in.in
index f0dddca..729d134 100644
--- a/data/org.gnome.Weather.Application.desktop.in.in
+++ b/data/org.gnome.Weather.desktop.in.in
@@ -4,7 +4,7 @@ Name=Weather
 Comment=Show weather conditions and forecast
 # Translators: Do NOT translate or transliterate this text (this is an icon file name)!
 Icon=@APP_ID@
-Exec=gapplication launch @APP_ID@.Application
+Exec=gapplication launch @APP_ID@
 DBusActivatable=true
 StartupNotify=true
 Categories=GNOME;GTK;Utility;Core;
diff --git a/data/org.gnome.Weather.Application.gschema.xml b/data/org.gnome.Weather.gschema.xml
similarity index 89%
rename from data/org.gnome.Weather.Application.gschema.xml
rename to data/org.gnome.Weather.gschema.xml
index 2bba122..f3c98f7 100644
--- a/data/org.gnome.Weather.Application.gschema.xml
+++ b/data/org.gnome.Weather.gschema.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <schemalist gettext-domain="org.gnome.Weather">
-  <schema id="org.gnome.Weather.Application" path="/org/gnome/Weather/Application/">
+  <schema id="org.gnome.Weather" path="/org/gnome/Weather/">
     <key name="locations" type="av">
       <default>[]</default>
       <summary>Configured cities to show weather for</summary>
diff --git a/data/org.gnome.Weather.Application.search-provider.ini 
b/data/org.gnome.Weather.search-provider.ini
similarity index 64%
rename from data/org.gnome.Weather.Application.search-provider.ini
rename to data/org.gnome.Weather.search-provider.ini
index 57b340d..db26f62 100644
--- a/data/org.gnome.Weather.Application.search-provider.ini
+++ b/data/org.gnome.Weather.search-provider.ini
@@ -1,5 +1,5 @@
 [Shell Search Provider]
-DesktopId=org.gnome.Weather.Application.desktop
+DesktopId=org.gnome.Weather.desktop
 BusName=org.gnome.Weather.BackgroundService
 ObjectPath=/org/gnome/Weather/BackgroundService
 Version=2
diff --git a/data/org.gnome.Weather.service.in b/data/org.gnome.Weather.service.in
new file mode 100644
index 0000000..1667e5d
--- /dev/null
+++ b/data/org.gnome.Weather.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=@APP_ID@
+Exec=@DATA_DIR@/@APP_ID@ --gapplication-service
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0285f3e..93d39bf 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,8 +2,8 @@
 # Please keep this file sorted alphabetically.
 data/city.ui
 data/org.gnome.Weather.appdata.xml.in
-data/org.gnome.Weather.Application.desktop.in.in
-data/org.gnome.Weather.Application.gschema.xml
+data/org.gnome.Weather.desktop.in.in
+data/org.gnome.Weather.gschema.xml
 data/places-popover.ui
 data/primary-menu.ui
 data/weather-widget.ui
diff --git a/src/app/city.js b/src/app/city.js
index a7e0354..ee49168 100644
--- a/src/app/city.js
+++ b/src/app/city.js
@@ -34,7 +34,7 @@ const SCROLLING_ANIMATION_TIME = 400000; //us
 var WeatherWidget = new Lang.Class({
     Name: 'WeatherWidget',
     Extends: Gtk.Frame,
-    Template: 'resource:///org/gnome/Weather/Application/weather-widget.ui',
+    Template: 'resource:///org/gnome/Weather/weather-widget.ui',
     InternalChildren: ['contentFrame', 'outerGrid', 'conditionsImage',
                        'temperatureLabel', 'conditionsLabel',
                        'timeLabel', 'timeGrid', 'forecastStack',
@@ -204,7 +204,7 @@ var WeatherWidget = new Lang.Class({
 var WeatherView = new Lang.Class({
     Name: 'WeatherView',
     Extends: Gtk.Stack,
-    Template: 'resource:///org/gnome/Weather/Application/city.ui',
+    Template: 'resource:///org/gnome/Weather/city.ui',
     InternalChildren: ['spinner'],
 
     _init: function(params) {
diff --git a/src/app/currentLocationController.js b/src/app/currentLocationController.js
index ea88800..df6085e 100644
--- a/src/app/currentLocationController.js
+++ b/src/app/currentLocationController.js
@@ -34,7 +34,7 @@ var CurrentLocationController = class CurrentLocationController {
     constructor(world) {
         this._world = world;
         this._processStarted = false;
-        this._settings = Util.getSettings('org.gnome.Weather.Application');
+        this._settings = Util.getSettings('org.gnome.Weather');
         let autoLocation = this._settings.get_value('automatic-location').deep_unpack();
         this._syncAutoLocation(autoLocation);
         if (this.autoLocation == AutoLocation.ENABLED)
diff --git a/src/app/main.js b/src/app/main.js
index 733fcd0..291620c 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -80,7 +80,7 @@ const Application = new Lang.Class({
         // ensure the type before we call to GtkBuilder
         GWeather.LocationEntry;
 
-        Util.loadStyleSheet('/org/gnome/Weather/Application/application.css');
+        Util.loadStyleSheet('/org/gnome/Weather/application.css');
 
         let settings = Gtk.Settings.get_for_screen(Gdk.Screen.get_default());
         settings.gtk_application_prefer_dark_theme = true;
diff --git a/src/app/window.js b/src/app/window.js
index 2b1bc71..4486439 100644
--- a/src/app/window.js
+++ b/src/app/window.js
@@ -53,8 +53,8 @@ var MainWindow = new Lang.Class({
                             activate: this.update }]);
 
         let builder = new Gtk.Builder();
-        builder.add_from_resource('/org/gnome/Weather/Application/window.ui');
-        builder.add_from_resource('/org/gnome/Weather/Application/primary-menu.ui');
+        builder.add_from_resource('/org/gnome/Weather/window.ui');
+        builder.add_from_resource('/org/gnome/Weather/primary-menu.ui');
 
         let grid = builder.get_object('main-panel');
         this._header = builder.get_object('header-bar');
diff --git a/src/app/world.js b/src/app/world.js
index d5f4cf2..2eafbb3 100644
--- a/src/app/world.js
+++ b/src/app/world.js
@@ -39,7 +39,7 @@ var WorldContentView = new Lang.Class({
         this.get_accessible().accessible_name = _("World view");
 
         let builder = new Gtk.Builder();
-        builder.add_from_resource('/org/gnome/Weather/Application/places-popover.ui');
+        builder.add_from_resource('/org/gnome/Weather/places-popover.ui');
 
         let grid = builder.get_object('popover-grid');
         this.add(grid);
diff --git a/src/meson.build b/src/meson.build
index 90cfd5c..8d64aa8 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -6,8 +6,8 @@ source_conf.set('libdir', EXTENSION_DIR)
 source_conf.set('prefix', prefix)
 
 application = configure_file(
-       input: application_id_stable + '.Application.in',
-       output: application_id + '.Application',
+       input: application_id_stable + '.in',
+       output: application_id,
        configuration: source_conf,
        install: true,
        install_dir: DATA_DIR
@@ -22,8 +22,8 @@ configure_file(
 )
 
 application_sources = gnome.compile_resources(
-       application_id_stable + '.Application.src',
-       application_id_stable + '.Application.src.gresource.xml',
+       application_id_stable + '.src',
+       application_id_stable + '.src.gresource.xml',
        gresource_bundle: true,
        install: true,
        install_dir: DATA_DIR
diff --git a/src/org.gnome.Weather.Application.in b/src/org.gnome.Weather.in
similarity index 100%
rename from src/org.gnome.Weather.Application.in
rename to src/org.gnome.Weather.in
diff --git a/src/org.gnome.Weather.Application.src.gresource.xml b/src/org.gnome.Weather.src.gresource.xml
similarity index 87%
rename from src/org.gnome.Weather.Application.src.gresource.xml
rename to src/org.gnome.Weather.src.gresource.xml
index 034a3b5..703006c 100644
--- a/src/org.gnome.Weather.Application.src.gresource.xml
+++ b/src/org.gnome.Weather.src.gresource.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
-  <gresource prefix="/org/gnome/Weather/Application/js">
+  <gresource prefix="/org/gnome/Weather/js">
     <file>app/city.js</file>
     <file>app/currentLocationController.js</file>
     <file>app/forecast.js</file>
diff --git a/src/service/searchProvider.js b/src/service/searchProvider.js
index a841951..9954d4f 100644
--- a/src/service/searchProvider.js
+++ b/src/service/searchProvider.js
@@ -202,8 +202,8 @@ var SearchProvider = class WeatherSearchProvider {
         else
             wrappedParam = [];
 
-        Gio.DBus.session.call('org.gnome.Weather.Application',
-                              '/org/gnome/Weather/Application',
+        Gio.DBus.session.call('org.gnome.Weather',
+                              '/org/gnome/Weather',
                               'org.freedesktop.Application',
                               'ActivateAction',
                               new GLib.Variant('(sava{sv})', [action, wrappedParam,
diff --git a/src/shared/world.js b/src/shared/world.js
index 5752b2c..4cf0bc1 100644
--- a/src/shared/world.js
+++ b/src/shared/world.js
@@ -41,7 +41,7 @@ var WorldModel = new Lang.Class({
 
         this._world = world;
 
-        this._settings = Util.getSettings('org.gnome.Weather.Application');
+        this._settings = Util.getSettings('org.gnome.Weather');
         this._providers = Util.getEnabledProviders();
 
         this._loadingCount = 0;
diff --git a/tests/testutil.py b/tests/testutil.py
index 6edff8e..1d2e57e 100644
--- a/tests/testutil.py
+++ b/tests/testutil.py
@@ -14,7 +14,7 @@ from dogtail.procedural import *
 import os, sys
 import subprocess
 
-APPLICATION_ID = "org.gnome.Weather.Application"
+APPLICATION_ID = "org.gnome.Weather"
 
 _bus = None
 
@@ -71,7 +71,7 @@ def reset_settings():
 def init():
     global settings, _previous_locations
 
-    settings = Gio.Settings("org.gnome.Weather.Application")
+    settings = Gio.Settings("org.gnome.Weather")
     _previous_locations = settings.get_value("locations")
     reset_settings()
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]