mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
* Rename confusing variables
* Fix some project warnings
* Fix code style
* Add constant for the default page size
* Move KeyFormats enum to CipherSettings
* Fix code style
* Fix memory leak
* Stop relying on CipherDialog for encryption settings management
* Fix code style
* Add .env format for QSettings
* Add automatic crypted databases open via dotenvs
This adds support for `.env` files next to the crypted databases that
are to be opened that contains the needed cipher settings.
The only required one is the plain-text password as a value for the key
with the name of the database like this:
myCryptedDatabase.sqlite = MyPassword
This way, databases with a different extension are supported too:
myCryptedDatabase.db = MyPassword
You can also specify a custom page size adding a different line
(anywhere in the file) like this:
myCryptedDatabase.db_pageSize = 2048
If not specified, `1024` is used.
You can also specify the format of the specified key using the
associated integer id:
anotherCryptedDatabase.sqlite = 0xCAFEBABE
anotherCryptedDatabase.sqlite_keyFormat = 1
where `1` means a Raw key. If not specified, `0` is used, which means a
simple text Passphrase.
Dotenv files (`.env`) are already used on other platforms and by
different tools to manage environment variables, and it's recommended
to be ignored from version control systems, so they won't leak.
* Add new files to CMakeLists
* Move DotenvFormat include to the implementation
* Fix build error
* Remove superfluous method
(related to ac51c23)
* Remove superfluous checks
* Fix memory leaks
(introduced by 94bbb46)
* Fix code style
* Make dotenv related variable and comment clearer
* Remove duplicated code
* Remove unused forward declaration
(introduced by e5a0293)
36 lines
678 B
C++
36 lines
678 B
C++
#ifndef CIPHERDIALOG_H
|
|
#define CIPHERDIALOG_H
|
|
|
|
#include <QDialog>
|
|
|
|
#include "CipherSettings.h"
|
|
|
|
class QRegExpValidator;
|
|
|
|
namespace Ui {
|
|
class CipherDialog;
|
|
}
|
|
|
|
class CipherDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
// Set the encrypt parameter to true when the dialog is used to encrypt a database;
|
|
// set it to false if the dialog is used to ask the user for the key to decrypt a file.
|
|
explicit CipherDialog(QWidget* parent, bool encrypt);
|
|
~CipherDialog();
|
|
|
|
CipherSettings getCipherSettings() const;
|
|
|
|
private:
|
|
Ui::CipherDialog* ui;
|
|
bool encryptMode;
|
|
QRegExpValidator* rawKeyValidator;
|
|
|
|
private slots:
|
|
void checkInputFields();
|
|
};
|
|
|
|
#endif
|