summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx12
-rw-r--r--connectivity/source/drivers/evoab2/NResultSet.cxx20
2 files changed, 26 insertions, 6 deletions
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
index e5b504e2c6b3..a83de24bc724 100644
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
@@ -1131,7 +1131,6 @@ Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables(
if (eds_check_version(3, 6, 0) == NULL)
{
- fprintf(stderr, "OEvoabDatabaseMetaData::getTables\n");
GList *pSources = e_source_registry_list_sources(get_e_source_registry(), E_SOURCE_EXTENSION_ADDRESS_BOOK);
for (GList* liter = pSources; liter; liter = liter->next)
@@ -1158,13 +1157,16 @@ Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables(
ODatabaseMetaDataResultSet::ORow aRow(3);
aRow.reserve(6);
- OUString aUID = OStringToOUString( e_source_get_uid( pSource ),
+ OUString aHumanName = OStringToOUString( e_source_get_display_name( pSource ),
RTL_TEXTENCODING_UTF8 );
- aRow.push_back(new ORowSetValueDecorator(aUID));
+ aRow.push_back(new ORowSetValueDecorator(aHumanName)); //tablename
aRow.push_back(new ORowSetValueDecorator(aTable));
- OUString aHumanName = OStringToOUString( e_source_get_display_name( pSource ),
+ OUString aUID = OStringToOUString( e_source_get_uid( pSource ),
RTL_TEXTENCODING_UTF8 );
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
+ aRow.push_back(new ORowSetValueDecorator(aUID)); //comment
+ //I'd prefer to swap the comment and the human name and
+ //just use e_source_registry_ref_source(get_e_source_registry(), aUID);
+ //in open book rather than search for the name again
aRows.push_back(aRow);
}
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index 13a510d100ec..4baf3ae54800 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -389,8 +389,26 @@ public:
freeContacts();
}
- virtual EBook* openBook(const char *id)
+ virtual EBook* openBook(const char *abname)
{
+ //It would be better if here we had id to begin with, see
+ //NDatabaseMetaData.cxx
+ const char *id = NULL;
+ GList *pSources = e_source_registry_list_sources(get_e_source_registry(), E_SOURCE_EXTENSION_ADDRESS_BOOK);
+ for (GList* liter = pSources; liter; liter = liter->next)
+ {
+ ESource *pSource = E_SOURCE (liter->data);
+
+ if (strcmp(abname, e_source_get_display_name( pSource )) == 0)
+ {
+ id = e_source_get_uid( pSource );
+ break;
+ }
+ }
+ g_list_free_full (pSources, g_object_unref);
+ if (!id)
+ return NULL;
+
ESource *pSource = e_source_registry_ref_source(get_e_source_registry(), id);
EBookClient *pBook = pSource ? e_book_client_new (pSource, NULL) : NULL;
if (pBook && !e_client_open_sync (pBook, TRUE, NULL, NULL))