Simplify country code handling

This commit is contained in:
Evangelos Ribeiro Tzaras
2021-09-23 09:32:37 +02:00
parent 04d391c5dd
commit 33ad4dbe86
8 changed files with 55 additions and 165 deletions

View File

@@ -24,11 +24,11 @@
#define G_LOG_DOMAIN "CallsNewCallBox"
#include "calls-application.h"
#include "calls-new-call-box.h"
#include "calls-ussd.h"
#include "calls-main-window.h"
#include "calls-manager.h"
#include "calls-settings.h"
#include <glib/gi18n.h>
#include <handy.h>
@@ -83,11 +83,12 @@ static CallsOrigin *
get_origin (CallsNewCallBox *self,
const char *target)
{
CallsApplication *app = CALLS_APPLICATION (g_application_get_default ());
CallsManager *manager = calls_manager_get_default ();
CallsSettings *settings = calls_manager_get_settings (manager);
g_autoptr (CallsOrigin) origin = NULL;
GListModel *model;
gboolean auto_use_def_origin =
calls_application_get_use_default_origins_setting (app);
calls_settings_get_use_default_origins (settings);
if (auto_use_def_origin) {
model = calls_manager_get_suitable_origins (calls_manager_get_default (),