File indexing completed on 2024-04-21 03:51:39

0001 /*
0002     This file is part of the KDE Baloo Project
0003     SPDX-FileCopyrightText: 2015 Ashish Bansal <bansal.ashish096@gmail.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef GLOBAL_H
0009 #define GLOBAL_H
0010 
0011 #include "engine_export.h"
0012 #include <QString>
0013 
0014 namespace Baloo {
0015     class Database;
0016 
0017     /*
0018      * If BALOO_DB_PATH environment variable is set, then it returns value of that variable.
0019      * Otherwise returns the default database path.
0020      */
0021     BALOO_ENGINE_EXPORT QString fileIndexDbPath();
0022 
0023     /*
0024      * lmdb doesn't support opening database twice at the same time in the single process
0025      * because if we open database twice at the same time and closes one of them, then it
0026      * would invalidate the handles of both the instances and may lead to crash or some
0027      * other undesirable behaviour. So, keeping one global database would solve this problem
0028      * and improve the performance too.
0029      */
0030     BALOO_ENGINE_EXPORT Database* globalDatabaseInstance();
0031 }
0032 
0033 #endif // GLOBAL_H