Skip to content

Instantly share code, notes, and snippets.

View MKleusberg's full-sized avatar

Martin Kleusberg MKleusberg

View GitHub Profile
@MKleusberg
MKleusberg / mainwindow.cpp
Created June 22, 2015 14:34
Modified QScintilla example application
/****************************************************************************
**
** Copyright (C) 2004-2006 Trolltech ASA. All rights reserved.
**
** This file is part of the example classes of the Qt Toolkit.
**
** Licensees holding a valid Qt License Agreement may use this file in
** accordance with the rights, responsibilities and obligations
** contained therein. Please consult your licensing agreement or
** contact sales@trolltech.com if any conditions of this licensing
@MKleusberg
MKleusberg / sqlcipher1.patch
Created November 10, 2014 21:46
SQLCipher 'inconsistent' opening patch
diff --git a/src/sqlitedb.cpp b/src/sqlitedb.cpp
index 9f2649f..68f7ff9 100644
--- a/src/sqlitedb.cpp
+++ b/src/sqlitedb.cpp
@@ -79,6 +79,8 @@ bool DBBrowserDB::open(const QString& db)
if(cipher.exec())
{
sqlite3_key(_db, cipher.password().toUtf8(), cipher.password().toUtf8().length());
+ sqlite3_exec(_db, QString("PRAGMA cipher_page_size = 4096;").toUtf8(), NULL, NULL, NULL);
+ sqlite3_key(_db, cipher.password().toUtf8(), cipher.password().toUtf8().length());
@MKleusberg
MKleusberg / debug.diff
Created June 11, 2014 19:27
Patch for relative path project file debugging
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index e60b367..c83df9f 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -1721,8 +1721,13 @@ bool MainWindow::loadProject(QString filename)
{
// DB file
QString dbfilename = xml.attributes().value("path").toString();
+ qDebug() << "before: " << dbfilename;
if(!QFile::exists(dbfilename))