aboutsummaryrefslogtreecommitdiff
path: root/lib/open.cc
AgeCommit message (Collapse)Author
2021-03-18lib: save path of xapian database in notmuch struct.David Bremner
This will allow re-opening in a different mode (read/write vs. read-only) with current Xapian API. It will also prove useful when updating the compact functions to support more flexible database location.
2021-03-13lib/open: free GKeyFileDavid Bremner
This fixes a small-to-medium (depending on size of config file) memory leak.
2021-03-13lib/open: free value from g_key_file_get_valueDavid Bremner
This fixes a small memory leak.
2021-03-13lib/open: use local talloc context in n_d_create_with_configDavid Bremner
This better matches the memory allocation semantics in notmuch_database_open_with_config.
2021-03-13lib: run uncrustifyuncrustify
This is the result of running $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h *.cc in the lib directory
2021-02-14lib/open: remove incorrect unused attributeDavid Bremner
With the current unused macro in lib/notmuch-private.h this seems harmless, but is misleading, since the parameter is in fact used.
2021-02-06lib/open: set HOOK_DIR on openDavid Bremner
This is a simple two step path search. Most error checking is deferred until running the hooks.
2021-02-06lib: introduce notmuch_database_create_with_configDavid Bremner
This takes a config path parameter, and can use that to decide the new database location.
2021-02-06lib/database: move n_d_create* to open.ccDavid Bremner
This will help share code with n_d_open_with_config.
2021-02-06lib: add NOTMUCH_STATUS_NO_CONFIGDavid Bremner
This will allow client code to provide more meaningful diagnostics. In particular it will enable "notmuch new" to continue suggsting the user run "notmuch setup" to create a config after "notmuch new" is transitioned to the new configuration framework.
2021-02-06lib/open: factor out choosing database pathDavid Bremner
The plan is to share code with a new database creation function that has a similar API to n_d_open_with_config.
2021-02-06lib/open: load default values for known configuration keys.David Bremner
This emulates the behaviour of notmuch_config_open defined in the CLI, in that it fills in default values if they are not otherwise defined.
2021-02-06lib/open: add support for config profiles and default locationsDavid Bremner
Fill in the remainder of the documented functionality for n_d_open_with_config with respect to config file location. Similar searching default locations of the database file still needs to be added.
2021-02-06lib: add stub for notmuch_database_open_with_configDavid Bremner
Initially document the intended API and copy the code from notmuch_database_open_verbose. Most of the documented functionality is not there yet.
2021-02-06lib: cache configuration information from databaseDavid Bremner
The main goal is to allow configuration information to be temporarily overridden by a separate config file. That will require further changes not in this commit. The performance impact is unclear, and will depend on the balance between number of queries and number of distinct metadata items read on the first call to n_d_get_config.
2020-12-23lib: factor out notmuch_database_open* related code to own fileDavid Bremner
Reduce the size of database.cc, and prepare for extending the database opening API