Settings/BrowserSettingModel.cpp
// Callback called when /apps/browser/SyncState changed
Callback called when /apps/browser/SyncState changed
Callback called when / apps / browser / SyncState changed
void BrowserSettingModel::OnGConfSettingChanged(GConfClient* client, 
				guint cnxn_id, GConfEntry* entry, gpointer data)
{
		BrowserSettingModel* model = static_cast<BrowserSettingModel*>(data);
                const QMap<BrowserSettingType, const char*>& keynames = model->keynames();
		if(g_strcmp0(entry->key, keynames[BrowserSettingModel::kSyncStatus]) == 0)
		{
				int status = gconf_client_get_int(client, entry->key, NULL);
				model->setSyncState(static_cast<SyncState>(status));
		} else if(!g_strcmp0(entry->key, keynames[BrowserSettingModel::kNewTabIsHomePage])) {
				bool new_tab_is_home_page = gconf_client_get_bool(model->client(), entry->key, NULL);
				model->setNewTabIsHomePage(new_tab_is_home_page);
		}  else if(!g_strcmp0(entry->key, keynames[BrowserSettingModel::kShowBookmarkBar])) {
				bool show = gconf_client_get_bool(model->client(), entry->key, NULL);
				model->setShowBookmarkBar(show);
		} else if(!g_strcmp0(entry->key, keynames[BrowserSettingModel::kDefaultSearchEngine])) {
				char* tmp = gconf_client_get_string(model->client(), entry->key, NULL);
        QString engine = QString::fromUtf8(tmp);
				model->setDefaultSearchEngine(engine);
				g_free(tmp);
		} else {
				qDebug() << " No handler for " << entry->key;
		}
}
void BrowserSettingModel :: OnGConfSettingChanged ( GConfClient * client , guint cnxn_id , GConfEntry * entry , gpointer data ) { BrowserSettingModel * model = static_cast < BrowserSettingModel * > ( data ) ; const QMap < BrowserSettingType , const char * > & keynames = model -> keynames ( ) ; if ( g_strcmp0 ( entry -> key , keynames [ BrowserSettingModel :: kSyncStatus ] ) == 0 ) { int status = gconf_client_get_int ( client , entry -> key , NULL ) ; model -> setSyncState ( static_cast < SyncState > ( status ) ) ; } else if ( ! g_strcmp0 ( entry -> key , keynames [ BrowserSettingModel :: kNewTabIsHomePage ] ) ) { bool new_tab_is_home_page = gconf_client_get_bool ( model -> client ( ) , entry -> key , NULL ) ; model -> setNewTabIsHomePage ( new_tab_is_home_page ) ; } else if ( ! g_strcmp0 ( entry -> key , keynames [ BrowserSettingModel :: kShowBookmarkBar ] ) ) { bool show = gconf_client_get_bool ( model -> client ( ) , entry -> key , NULL ) ; model -> setShowBookmarkBar ( show ) ; } else if ( ! g_strcmp0 ( entry -> key , keynames [ BrowserSettingModel :: kDefaultSearchEngine ] ) ) { char * tmp = gconf_client_get_string ( model -> client ( ) , entry -> key , NULL ) ; QString engine = QString :: fromUtf8 ( tmp ) ; model -> setDefaultSearchEngine ( engine ) ; g_free ( tmp ) ; } else { qDebug ( ) << " " << entry -> key ; } }
Callback called when /apps/browser/SyncState changed
Callback called when / apps / browser / SyncState changed
/*else if(!g_strcmp0(entry->key, keynames[BrowserSettingModel::kHomePage])) {
				
				char* homepage = gconf_client_get_string(model->client(), entry->key, NULL);
				QString full_url(homepage);
				
				// Append http prefix to a raw URL
				if(!full_url.startsWith("http://", Qt::CaseInsensitive) &&
								!full_url.startsWith("https://", Qt::CaseInsensitive)) {
						full_url.prepend("http://");
				}
				
				model->setHomePage(full_url);

				g_free(homepage);

		} */